diff --git a/MSBuild.sln b/MSBuild.sln index 258d1a5c5d7..caac39c6344 100644 --- a/MSBuild.sln +++ b/MSBuild.sln @@ -52,12 +52,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MSBuildTaskHost", "src\MSBu EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MSBuild.VSSetup", "src\Package\MSBuild.VSSetup\MSBuild.VSSetup.csproj", "{136C8713-3103-4AF9-B7CB-9619E87249C1}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Deprecated", "Deprecated", "{0AC7F677-AD87-48C8-A51C-008A68136929}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Build.Engine", "src\Deprecated\Engine\Microsoft.Build.Engine.csproj", "{586C55EE-4003-4A20-AAE2-76DBDA421BB3}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Build.Conversion", "src\Deprecated\Conversion\Microsoft.Build.Conversion.csproj", "{8AE12A8B-D64C-48CF-AD00-9A0C35884DFA}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Localization", "src\Package\Localization\Localization.csproj", "{16DBDF17-3E0E-4140-989A-B42638126A40}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevDivPackage", "src\Package\DevDivPackage\DevDivPackage.csproj", "{EDBFE32E-F264-4F01-97C3-B58F8B9165C9}" @@ -556,54 +550,6 @@ Global {136C8713-3103-4AF9-B7CB-9619E87249C1}.Release|x64.Build.0 = Release|x64 {136C8713-3103-4AF9-B7CB-9619E87249C1}.Release|x86.ActiveCfg = Release|Any CPU {136C8713-3103-4AF9-B7CB-9619E87249C1}.Release|x86.Build.0 = Release|Any CPU - {586C55EE-4003-4A20-AAE2-76DBDA421BB3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {586C55EE-4003-4A20-AAE2-76DBDA421BB3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {586C55EE-4003-4A20-AAE2-76DBDA421BB3}.Debug|ARM64.ActiveCfg = Debug|Any CPU - {586C55EE-4003-4A20-AAE2-76DBDA421BB3}.Debug|ARM64.Build.0 = Debug|Any CPU - {586C55EE-4003-4A20-AAE2-76DBDA421BB3}.Debug|x64.ActiveCfg = Debug|x64 - {586C55EE-4003-4A20-AAE2-76DBDA421BB3}.Debug|x64.Build.0 = Debug|x64 - {586C55EE-4003-4A20-AAE2-76DBDA421BB3}.Debug|x86.ActiveCfg = Debug|Any CPU - {586C55EE-4003-4A20-AAE2-76DBDA421BB3}.Debug|x86.Build.0 = Debug|Any CPU - {586C55EE-4003-4A20-AAE2-76DBDA421BB3}.MachineIndependent|Any CPU.ActiveCfg = MachineIndependent|Any CPU - {586C55EE-4003-4A20-AAE2-76DBDA421BB3}.MachineIndependent|Any CPU.Build.0 = MachineIndependent|Any CPU - {586C55EE-4003-4A20-AAE2-76DBDA421BB3}.MachineIndependent|ARM64.ActiveCfg = MachineIndependent|Any CPU - {586C55EE-4003-4A20-AAE2-76DBDA421BB3}.MachineIndependent|ARM64.Build.0 = MachineIndependent|Any CPU - {586C55EE-4003-4A20-AAE2-76DBDA421BB3}.MachineIndependent|x64.ActiveCfg = MachineIndependent|x64 - {586C55EE-4003-4A20-AAE2-76DBDA421BB3}.MachineIndependent|x64.Build.0 = MachineIndependent|x64 - {586C55EE-4003-4A20-AAE2-76DBDA421BB3}.MachineIndependent|x86.ActiveCfg = MachineIndependent|Any CPU - {586C55EE-4003-4A20-AAE2-76DBDA421BB3}.MachineIndependent|x86.Build.0 = MachineIndependent|Any CPU - {586C55EE-4003-4A20-AAE2-76DBDA421BB3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {586C55EE-4003-4A20-AAE2-76DBDA421BB3}.Release|Any CPU.Build.0 = Release|Any CPU - {586C55EE-4003-4A20-AAE2-76DBDA421BB3}.Release|ARM64.ActiveCfg = Release|Any CPU - {586C55EE-4003-4A20-AAE2-76DBDA421BB3}.Release|ARM64.Build.0 = Release|Any CPU - {586C55EE-4003-4A20-AAE2-76DBDA421BB3}.Release|x64.ActiveCfg = Release|x64 - {586C55EE-4003-4A20-AAE2-76DBDA421BB3}.Release|x64.Build.0 = Release|x64 - {586C55EE-4003-4A20-AAE2-76DBDA421BB3}.Release|x86.ActiveCfg = Release|Any CPU - {586C55EE-4003-4A20-AAE2-76DBDA421BB3}.Release|x86.Build.0 = Release|Any CPU - {8AE12A8B-D64C-48CF-AD00-9A0C35884DFA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8AE12A8B-D64C-48CF-AD00-9A0C35884DFA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8AE12A8B-D64C-48CF-AD00-9A0C35884DFA}.Debug|ARM64.ActiveCfg = Debug|Any CPU - {8AE12A8B-D64C-48CF-AD00-9A0C35884DFA}.Debug|ARM64.Build.0 = Debug|Any CPU - {8AE12A8B-D64C-48CF-AD00-9A0C35884DFA}.Debug|x64.ActiveCfg = Debug|x64 - {8AE12A8B-D64C-48CF-AD00-9A0C35884DFA}.Debug|x64.Build.0 = Debug|x64 - {8AE12A8B-D64C-48CF-AD00-9A0C35884DFA}.Debug|x86.ActiveCfg = Debug|Any CPU - {8AE12A8B-D64C-48CF-AD00-9A0C35884DFA}.Debug|x86.Build.0 = Debug|Any CPU - {8AE12A8B-D64C-48CF-AD00-9A0C35884DFA}.MachineIndependent|Any CPU.ActiveCfg = MachineIndependent|Any CPU - {8AE12A8B-D64C-48CF-AD00-9A0C35884DFA}.MachineIndependent|Any CPU.Build.0 = MachineIndependent|Any CPU - {8AE12A8B-D64C-48CF-AD00-9A0C35884DFA}.MachineIndependent|ARM64.ActiveCfg = MachineIndependent|Any CPU - {8AE12A8B-D64C-48CF-AD00-9A0C35884DFA}.MachineIndependent|ARM64.Build.0 = MachineIndependent|Any CPU - {8AE12A8B-D64C-48CF-AD00-9A0C35884DFA}.MachineIndependent|x64.ActiveCfg = MachineIndependent|x64 - {8AE12A8B-D64C-48CF-AD00-9A0C35884DFA}.MachineIndependent|x64.Build.0 = MachineIndependent|x64 - {8AE12A8B-D64C-48CF-AD00-9A0C35884DFA}.MachineIndependent|x86.ActiveCfg = MachineIndependent|Any CPU - {8AE12A8B-D64C-48CF-AD00-9A0C35884DFA}.MachineIndependent|x86.Build.0 = MachineIndependent|Any CPU - {8AE12A8B-D64C-48CF-AD00-9A0C35884DFA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8AE12A8B-D64C-48CF-AD00-9A0C35884DFA}.Release|Any CPU.Build.0 = Release|Any CPU - {8AE12A8B-D64C-48CF-AD00-9A0C35884DFA}.Release|ARM64.ActiveCfg = Release|Any CPU - {8AE12A8B-D64C-48CF-AD00-9A0C35884DFA}.Release|ARM64.Build.0 = Release|Any CPU - {8AE12A8B-D64C-48CF-AD00-9A0C35884DFA}.Release|x64.ActiveCfg = Release|x64 - {8AE12A8B-D64C-48CF-AD00-9A0C35884DFA}.Release|x64.Build.0 = Release|x64 - {8AE12A8B-D64C-48CF-AD00-9A0C35884DFA}.Release|x86.ActiveCfg = Release|Any CPU - {8AE12A8B-D64C-48CF-AD00-9A0C35884DFA}.Release|x86.Build.0 = Release|Any CPU {16DBDF17-3E0E-4140-989A-B42638126A40}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {16DBDF17-3E0E-4140-989A-B42638126A40}.Debug|Any CPU.Build.0 = Debug|Any CPU {16DBDF17-3E0E-4140-989A-B42638126A40}.Debug|ARM64.ActiveCfg = Debug|Any CPU @@ -927,8 +873,6 @@ Global {F45DBA88-C833-434A-8F68-087124540303} = {760FF85D-8BEB-4992-8095-A9678F88FD47} {523E1555-DB60-4FD4-8CDF-3C159710CAED} = {760FF85D-8BEB-4992-8095-A9678F88FD47} {136C8713-3103-4AF9-B7CB-9619E87249C1} = {9BAD9352-DEFB-45E5-B8A4-4816B9B22A33} - {586C55EE-4003-4A20-AAE2-76DBDA421BB3} = {0AC7F677-AD87-48C8-A51C-008A68136929} - {8AE12A8B-D64C-48CF-AD00-9A0C35884DFA} = {0AC7F677-AD87-48C8-A51C-008A68136929} {16DBDF17-3E0E-4140-989A-B42638126A40} = {9BAD9352-DEFB-45E5-B8A4-4816B9B22A33} {EDBFE32E-F264-4F01-97C3-B58F8B9165C9} = {9BAD9352-DEFB-45E5-B8A4-4816B9B22A33} {B60173F0-F9F0-4688-9DF8-9ADDD57BD45F} = {9BAD9352-DEFB-45E5-B8A4-4816B9B22A33} diff --git a/src/Build/AssemblyInfo.cs b/src/Build/AssemblyInfo.cs index 36254bf8544..fd0a475c5e8 100644 --- a/src/Build/AssemblyInfo.cs +++ b/src/Build/AssemblyInfo.cs @@ -21,8 +21,7 @@ [assembly: InternalsVisibleTo("Microsoft.Build.Engine.UnitTests, PublicKey=002400000480000094000000060200000024000052534131000400000100010015c01ae1f50e8cc09ba9eac9147cf8fd9fce2cfe9f8dce4f7301c4132ca9fb50ce8cbf1df4dc18dd4d210e4345c744ecb3365ed327efdbc52603faa5e21daa11234c8c4a73e51f03bf192544581ebe107adee3a34928e39d04e524a9ce729d5090bfd7dad9d10c722c0def9ccc08ff0a03790e48bcd1f9b6c476063e1966a1c4")] [assembly: InternalsVisibleTo("Microsoft.Build.BuildCheck.UnitTests, PublicKey=002400000480000094000000060200000024000052534131000400000100010015c01ae1f50e8cc09ba9eac9147cf8fd9fce2cfe9f8dce4f7301c4132ca9fb50ce8cbf1df4dc18dd4d210e4345c744ecb3365ed327efdbc52603faa5e21daa11234c8c4a73e51f03bf192544581ebe107adee3a34928e39d04e524a9ce729d5090bfd7dad9d10c722c0def9ccc08ff0a03790e48bcd1f9b6c476063e1966a1c4")] [assembly: InternalsVisibleTo("Microsoft.Build.UnitTests.Shared, PublicKey=002400000480000094000000060200000024000052534131000400000100010015c01ae1f50e8cc09ba9eac9147cf8fd9fce2cfe9f8dce4f7301c4132ca9fb50ce8cbf1df4dc18dd4d210e4345c744ecb3365ed327efdbc52603faa5e21daa11234c8c4a73e51f03bf192544581ebe107adee3a34928e39d04e524a9ce729d5090bfd7dad9d10c722c0def9ccc08ff0a03790e48bcd1f9b6c476063e1966a1c4")] -[assembly: InternalsVisibleTo("Microsoft.Build.Conversion.Core, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")] -[assembly: InternalsVisibleTo("Microsoft.Build.Conversion.Unittest, PublicKey=002400000480000094000000060200000024000052534131000400000100010015c01ae1f50e8cc09ba9eac9147cf8fd9fce2cfe9f8dce4f7301c4132ca9fb50ce8cbf1df4dc18dd4d210e4345c744ecb3365ed327efdbc52603faa5e21daa11234c8c4a73e51f03bf192544581ebe107adee3a34928e39d04e524a9ce729d5090bfd7dad9d10c722c0def9ccc08ff0a03790e48bcd1f9b6c476063e1966a1c4")] +[assembly: InternalsVisibleTo("Microsoft.Build.UnitTests.Shared, PublicKey=002400000480000094000000060200000024000052534131000400000100010015c01ae1f50e8cc09ba9eac9147cf8fd9fce2cfe9f8dce4f7301c4132ca9fb50ce8cbf1df4dc18dd4d210e4345c744ecb3365ed327efdbc52603faa5e21daa11234c8c4a73e51f03bf192544581ebe107adee3a34928e39d04e524a9ce729d5090bfd7dad9d10c722c0def9ccc08ff0a03790e48bcd1f9b6c476063e1966a1c4")] [assembly: InternalsVisibleTo("Microsoft.Build.Tasks.Cop, PublicKey=002400000480000094000000060200000024000052534131000400000100010015c01ae1f50e8cc09ba9eac9147cf8fd9fce2cfe9f8dce4f7301c4132ca9fb50ce8cbf1df4dc18dd4d210e4345c744ecb3365ed327efdbc52603faa5e21daa11234c8c4a73e51f03bf192544581ebe107adee3a34928e39d04e524a9ce729d5090bfd7dad9d10c722c0def9ccc08ff0a03790e48bcd1f9b6c476063e1966a1c4")] [assembly: InternalsVisibleTo("Microsoft.Build.BuildCheck.UnitTests, PublicKey=002400000480000094000000060200000024000052534131000400000100010015c01ae1f50e8cc09ba9eac9147cf8fd9fce2cfe9f8dce4f7301c4132ca9fb50ce8cbf1df4dc18dd4d210e4345c744ecb3365ed327efdbc52603faa5e21daa11234c8c4a73e51f03bf192544581ebe107adee3a34928e39d04e524a9ce729d5090bfd7dad9d10c722c0def9ccc08ff0a03790e48bcd1f9b6c476063e1966a1c4")] // DO NOT expose Internals to "Microsoft.Build.UnitTests.OM.OrcasCompatibility" as this assembly is supposed to only see public interface diff --git a/src/Deprecated/Conversion.UnitTests/OldVSProjectFileReader_Tests.cs b/src/Deprecated/Conversion.UnitTests/OldVSProjectFileReader_Tests.cs deleted file mode 100644 index 268e5d6c849..00000000000 --- a/src/Deprecated/Conversion.UnitTests/OldVSProjectFileReader_Tests.cs +++ /dev/null @@ -1,498 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.IO; -using System.Text; - -using Microsoft.Build.Conversion; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using Microsoft.Build.Shared; - -namespace Microsoft.Build.UnitTests -{ - /*************************************************************************** - * - * Class: OldVSProjectFileReader_Tests - * Owner: RGoel - * - * This class contains the unit tests for the "OldVSProjectFileReader" class. - * See the comments in that class for a description of its purpose. - * - **************************************************************************/ - [TestClass] - public class OldVSProjectFileReader_Tests - { - /*********************************************************************** - * - * Method: OldVSProjectFileReader_Tests.CreateTemporaryProjectFile - * Owner: RGoel - * - * Helper method which creates a temporary text file on disk with the - * specified contents. Returns the temp filename as an [out] parameter. - * - **********************************************************************/ - private void CreateTemporaryProjectFile - ( - string projectFileContents, - out string projectFilename - ) - { - projectFilename = FileUtilities.GetTemporaryFile(); - - StreamWriter projectFile = new StreamWriter(projectFilename, false, Encoding.Default); // HIGHCHAR: Default means ANSI, ANSI is what VS .NET 2003 wrote. Without this, the project would be written as ASCII. - projectFile.Write(projectFileContents); - projectFile.Close(); - } - - /*********************************************************************** - * - * Method: OldVSProjectFileReader_Tests.DeleteTemporaryProjectFile - * Owner: RGoel - * - * Helper method to delete the temporary file created via - * "CreateTemporaryProjectFile". - * - **********************************************************************/ - private void DeleteTemporaryProjectFile - ( - string projectFilename - ) - { - File.Delete(projectFilename); - } - - /*********************************************************************** - * - * Method: OldVSProjectFileReader_Tests.NoSpecialCharacters - * Owner: RGoel - * - * Tests the OldVSProjectFileReader class, using a project file that - * does not contain any special characters. - * - **********************************************************************/ - [TestMethod] - public void NoSpecialCharacters - ( - ) - { - // The contents of the project file that we'll be testing. Look at the - // right side, for a cleaner copy without all the escaping. - string projectFileContents = - - "\r\n" + // - "\r\n" + // - " \r\n" + // > - " \r\n" + // - "\r\n" + // - "\r\n"; // - - // Create a temp file on disk with the above contents. - string projectFilename; - this.CreateTemporaryProjectFile(projectFileContents, out projectFilename); - - // Instantiate our class with the project file. - OldVSProjectFileReader reader = new OldVSProjectFileReader(projectFilename); - - // Create a buffer to hold 20 characters. - char[] characterBuffer = new char[20]; - int exceptionCount = 0; - int charactersRead = 0; - - // Read the first 20 characters into our buffer. - charactersRead = reader.Read(characterBuffer, 0, 20); - Assert.AreEqual(20, charactersRead); - Assert.AreEqual("\r\n\r\n \r\n\r\n\n Projeasic\r", new string(characterBuffer)); - - // Try reading the next 30 characters. Since there's not enough room in our - // buffer for 30 characters, this will fail. - try - { - charactersRead = reader.Read(characterBuffer, 5, 30); - } - catch (ArgumentException) - { - exceptionCount++; - } - // Confirm that the proper exception was thrown and that the buffer - // was not touched. - Assert.AreEqual(1, exceptionCount); - Assert.AreEqual(">\r\n\r\n\n Projeasic\r", new string(characterBuffer)); - - // Read to the end of the current line. - string readLine = reader.ReadLine(); - Assert.AreEqual("ctType = \"Local\"", readLine); - - // Read the next line. - readLine = reader.ReadLine(); - Assert.AreEqual(" ProductVersion = \"7.10.3022\"", readLine); - - // Read the next character. - int character = reader.Read(); - Assert.AreEqual(' ', character); - - // Read the next character. - character = reader.Read(); - Assert.AreEqual(' ', character); - - // Peek at the next character, but don't advance the read pointer. - character = reader.Peek(); - Assert.AreEqual('>', character); - - // Read the next 20 characters into our buffer. - charactersRead = reader.Read(characterBuffer, 0, 20); - // Read the next 20 characters into our buffer. - charactersRead = reader.Read(characterBuffer, 0, 20); - - // Read the next 20 characters into our buffer. But actually, since - // we're almost at the end of the file, we expect that only 7 characters - // will actually be read. - charactersRead = reader.Read(characterBuffer, 0, 20); - Assert.AreEqual(7, charactersRead); - Assert.AreEqual("ject>\r\nsualStudioPro", new string(characterBuffer)); - - // Read the next 20 characters into our buffer. Now, we're really - // at the end of the file already, so it should come back with zero - // characters read. - charactersRead = reader.Read(characterBuffer, 0, 20); - Assert.AreEqual(0, charactersRead); - Assert.AreEqual("ject>\r\nsualStudioPro", new string(characterBuffer)); - - // Clean up. - reader.Close(); - this.DeleteTemporaryProjectFile(projectFilename); - } - - - /*********************************************************************** - * - * Method: OldVSProjectFileReader_Tests.XmlAttributesWithSpecialCharacters - * Owner: RGoel - * - * Tests the OldVSProjectFileReader class, using a project file that - * contains special characters in some of the XML attribute values. - * - **********************************************************************/ - [TestMethod] - public void XmlAttributesWithSpecialCharacters - ( - ) - { - // The contents of the project file that we'll be testing. Look at the - // right side, for a cleaner copy without all the escaping. - string projectFileContents = - - "\r\n" + // - "\r\n" + // - " 3022\"\r\n" + // ProductVersion = "7<.10.>3022" - " A=\"blah>\" B=\"bloo<\"\r\n" + // A="blah>" B="bloo<" - " >\r\n" + // > - " \r\n" + // - "\r\n" + // - "\r\n"; // - - // Create a temp file on disk with the above contents. - string projectFilename; - this.CreateTemporaryProjectFile(projectFileContents, out projectFilename); - - // Instantiate our class with the project file. - OldVSProjectFileReader reader = new OldVSProjectFileReader(projectFilename); - - // Create a buffer to hold 30 characters. - char[] characterBuffer = new char[30]; - int charactersRead = 0; - - // Read the first 30 characters into our buffer. - charactersRead = reader.Read(characterBuffer, 0, 30); - Assert.AreEqual(30, charactersRead); - Assert.AreEqual("\r\n\r\n characters within an attribute value got translated correctly. - charactersRead = reader.Read(characterBuffer, 10, 20); - Assert.AreEqual(20, charactersRead); - Assert.AreEqual("sualBasic\rLo<cal\"\r\n Prod", new string(characterBuffer)); - - // Read the next 20 characters into our buffer. Confirm that the < and > characters within - // an attribute value got translated correctly. - charactersRead = reader.Read(characterBuffer, 0, 20); - Assert.AreEqual(20, charactersRead); - Assert.AreEqual("uctVersion = \"7<.\r\n Prod", new string(characterBuffer)); - - // Read the remainder of the file. Confirm that the < and > characters within - // an attribute value got translated correctly. - string restOfFile = reader.ReadToEnd(); - Assert.AreEqual("10.>3022\"\r\n A=\"blah>\" B=\"bloo<\"\r\n >\r\n \r\n\r\n\r\n", - restOfFile); - - // Clean up. - reader.Close(); - this.DeleteTemporaryProjectFile(projectFilename); - } - - /*********************************************************************** - * - * Method: OldVSProjectFileReader_Tests.MultipleElementsOnSameLine - * Owner: RGoel - * - * Tests the OldVSProjectFileReader class, using a project file that - * contains multiple XML elements with attributes on the same line. - * This will actually never happen in a real VS7/Everett project file, - * but it's good to test it anyway. - * - **********************************************************************/ - [TestMethod] - public void MultipleElementsOnSameLine - ( - ) - { - // The contents of the project file that we'll be testing. Look at the - // right side, for a cleaner copy without all the escaping. - string projectFileContents = - - ">ah\"/>"; // - - // Create a temp file on disk with the above contents. - string projectFilename; - this.CreateTemporaryProjectFile(projectFileContents, out projectFilename); - - // Instantiate our class with the project file. - OldVSProjectFileReader reader = new OldVSProjectFileReader(projectFilename); - - // Read the whole file into a string. Confirm that the < and > characters within - // an attribute value got translated correctly, but the < and > characters occurring - // *outside* an attribute value are not touched. - string wholeFile = reader.ReadToEnd(); - Assert.AreEqual("\r\n", - wholeFile); - - // Clean up. - reader.Close(); - this.DeleteTemporaryProjectFile(projectFilename); - } - - /// - /// Sometimes VS.NET 2002/2003 wrote out the attribute value using single-quotes instead - /// of double-quotes (particularly when the value itself contained double-quotes). Therefore - /// we make sure we handle this case properly. - /// - /// RGoel - [TestMethod] - public void AttributeValueUsingSingleQuotes - ( - ) - { - // The contents of the project file that we'll be testing. - string projectFileContents = - ""; - - // Create a temp file on disk with the above contents. - string projectFilename; - this.CreateTemporaryProjectFile(projectFileContents, out projectFilename); - - // Instantiate our class with the project file. - OldVSProjectFileReader reader = new OldVSProjectFileReader(projectFilename); - - // Read the whole file into a string. Confirm that the < and > characters within - // an attribute value got translated correctly, but the < and > characters occurring - // *outside* an attribute value are not touched. - string wholeFile = reader.ReadToEnd(); - Assert.AreEqual("\r\n", - wholeFile); - - // Clean up. - reader.Close(); - this.DeleteTemporaryProjectFile(projectFilename); - } - - - /// - /// Make sure that a lonely ampersand that is NOT legitimately used for escaping does get - /// replaced with "&" by our reader. - /// - /// RGoel - [TestMethod] - public void AmpersandReplacement - ( - ) - { - // Single lonely ampersand. This should get replaced. - Assert.AreEqual("blah&doo", - OldVSProjectFileReader.ReplaceSpecialCharactersInXmlAttributeString("blah&doo")); - - // Single lonely ampersand again, but this time with a semicolon at some point afterwards, just - // to try and confuse the parser. - Assert.AreEqual("blah&doo;doo", - OldVSProjectFileReader.ReplaceSpecialCharactersInXmlAttributeString("blah&doo;doo")); - - // An ampersand used to escape a legitimate special character should NOT be replaced by our function. - Assert.AreEqual("blah<doo", - OldVSProjectFileReader.ReplaceSpecialCharactersInXmlAttributeString("blah<doo")); - - // An ampersand used to escape a legitimate special character should NOT be replaced by our function. - Assert.AreEqual("blah<doo", - OldVSProjectFileReader.ReplaceSpecialCharactersInXmlAttributeString("blah<doo")); - - // If the code between the "&" and the ";" is not a legitimate number, then we SHOULD replace the "&". - Assert.AreEqual("blah&#AB;doo", - OldVSProjectFileReader.ReplaceSpecialCharactersInXmlAttributeString("blah&#AB;doo")); - - // A valid hexadecimal number should NOT be replaced. - Assert.AreEqual("blah«doo", - OldVSProjectFileReader.ReplaceSpecialCharactersInXmlAttributeString("blah«doo")); - - // Check to make sure we can handle two replacements. - Assert.AreEqual("blah&doo&heehee", - OldVSProjectFileReader.ReplaceSpecialCharactersInXmlAttributeString("blah&doo&heehee")); - - // Check to make sure we can handle a replacement at the end of a string. - Assert.AreEqual("blahdoo&", - OldVSProjectFileReader.ReplaceSpecialCharactersInXmlAttributeString("blahdoo&")); - - // Emptiness between the "&" and the ";" is not valid, and therefore the "&" should get replaced. - Assert.AreEqual("blah&;doo", - OldVSProjectFileReader.ReplaceSpecialCharactersInXmlAttributeString("blah&;doo")); - - // Emptiness between the "#" and the ";" is not valid, and therefore the "&" should get replaced. - Assert.AreEqual("blah&#;doo", - OldVSProjectFileReader.ReplaceSpecialCharactersInXmlAttributeString("blah&#;doo")); - - // Emptiness between the "#x" and the ";" is not valid, and therefore the "&" should get replaced. - Assert.AreEqual("blah&#x;doo", - OldVSProjectFileReader.ReplaceSpecialCharactersInXmlAttributeString("blah&#x;doo")); - - // Even characters beyond 256 should be considered valid. - Assert.AreEqual("blahĘdoo", - OldVSProjectFileReader.ReplaceSpecialCharactersInXmlAttributeString("blahĘdoo")); - - // The VS.NET 2003 XML writer even persisted things like the copyright symbol as an entity. - // So we need to be careful about not touching those. - Assert.AreEqual("blah©doo", - OldVSProjectFileReader.ReplaceSpecialCharactersInXmlAttributeString("blah©doo")); - - // The VS.NET 2003 XML writer even persisted things like the copyright symbol as an entity. - // So we need to be careful about not touching those. - Assert.AreEqual("blah&COPY;doo", - OldVSProjectFileReader.ReplaceSpecialCharactersInXmlAttributeString("blah©doo")); - } - - - /// - /// VS .NET 2002/2003 wrote out projects in invalid XML in some cases. For example, - /// an "&" character is not allowed in an XML attribute value, unless it is being - /// used to escape some other special character (where that other character may itself - /// be an ampersand). However, the VS .NET 2002/2003 XML writer did this all the time. - /// In order for System.Xml to be able to handle it, we need to translate those bogus - /// "&"'s to "&" before letting System.Xml have at it. - /// - /// RGoel - [TestMethod] - public void Regress322573 - ( - ) - { - // The contents of the project file that we'll be testing. - string projectFileContents = - ""; - - // Create a temp file on disk with the above contents. - string projectFilename; - this.CreateTemporaryProjectFile(projectFileContents, out projectFilename); - - // Instantiate our class with the project file. - OldVSProjectFileReader reader = new OldVSProjectFileReader(projectFilename); - - // Read the whole file into a string. Confirm that the & character within - // an attribute value got translated correctly. - string wholeFile = reader.ReadToEnd(); - Assert.AreEqual("\r\n", - wholeFile); - - // Clean up. - reader.Close(); - this.DeleteTemporaryProjectFile(projectFilename); - } - - - /// - /// VS .NET wrote out projects in ANSI format by default. - /// We want to make sure those characters don't get stripped by our reader. - /// - [TestMethod] - public void Regress184573() - { - // The contents of the project file that we'll be testing. Look at the - // right side, for a cleaner copy without all the escaping. - char c = '�'; - string projectFileContents = new string(c,1); - - // Create a temp file on disk with the above contents. - string projectFilename; - this.CreateTemporaryProjectFile(projectFileContents, out projectFilename); - - // Instantiate our class with the project file. - OldVSProjectFileReader reader = new OldVSProjectFileReader(projectFilename); - - // Read the whole file into a string. - string wholeFile = reader.ReadToEnd(); - Assert.IsTrue(wholeFile.Length > 0, "High-bit character was stripped."); - - // Create two different encodings. - Encoding defaultEncoding = Encoding.Default; - Encoding unicode = Encoding.Unicode; - - // Convert the string into a byte array. - byte[] unicodeBytes = unicode.GetBytes(projectFileContents); - // Perform the conversion from one encoding to the other. - byte[] defaultEncodingBytes = Encoding.Convert(unicode, defaultEncoding, unicodeBytes); - - // Convert the new byte[] into a char[] and then into a string. - char[] defaultEncodingChars = new char[defaultEncoding.GetCharCount(defaultEncodingBytes, 0, defaultEncodingBytes.Length)]; - defaultEncoding.GetChars(defaultEncodingBytes, 0, defaultEncodingBytes.Length, defaultEncodingChars, 0); - - Assert.IsTrue(defaultEncodingChars.Length > 0); - Assert.IsTrue(wholeFile[0] == defaultEncodingChars[0], String.Format("Expected ANSI encoding of '{0}' to result in '{0}'. Instead it was '{1}'", c, defaultEncodingChars[0], wholeFile[0]) - ); - - // Clean up. - reader.Close(); - this.DeleteTemporaryProjectFile(projectFilename); - } - - /// - /// Tests that a single ampersand replacement works correctly at the beginning of - /// a string, middle of a string, and end of a string. - /// - [TestMethod] - public void ReplaceSingleAmpersand() - { - Assert.AreEqual("&1234", OldVSProjectFileReader.ReplaceAmpersandWithLiteral("&1234", 0)); - Assert.AreEqual("12&34", OldVSProjectFileReader.ReplaceAmpersandWithLiteral("12&34", 2)); - Assert.AreEqual("1234&", OldVSProjectFileReader.ReplaceAmpersandWithLiteral("1234&", 4)); - } - } -} diff --git a/src/Deprecated/Conversion.UnitTests/ProjectFileConverter_Tests.cs b/src/Deprecated/Conversion.UnitTests/ProjectFileConverter_Tests.cs deleted file mode 100644 index c2992c6631c..00000000000 --- a/src/Deprecated/Conversion.UnitTests/ProjectFileConverter_Tests.cs +++ /dev/null @@ -1,5982 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.IO; -using System.Reflection; -using System.Xml; - -using Microsoft.Build.Conversion; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -using ProjectRootElement = Microsoft.Build.Construction.ProjectRootElement; - -namespace Microsoft.Build.UnitTests -{ - internal static partial class Helpers - { - /// - /// Converts a VS7/Everett project to Whidbey format, and compares the result with the expected - /// contents to make sure they match. - /// - /// - /// - /// RGoel - internal static void ConvertAndCompare - ( - string sourceProjectContents, - string targetProjectContents - ) - { - ConvertAndCompare(sourceProjectContents, targetProjectContents, null); - } - - /// - /// Converts a VS7/Everett project to Whidbey format, and compares the result with the expected - /// contents to make sure they match. - /// - /// - /// - /// - /// - /// RGoel - internal static void ConvertAndCompare - ( - string sourceProjectContents, - string targetProjectContents, - string additionalDummyFileToCreateInEverettProjectDirectory, - bool isMinorUpgrade = false - ) - { - string sourceProjectFile = ObjectModelHelpers.CreateTempFileOnDiskNoFormat(sourceProjectContents); - - string dummyExtraFile = null; - if (additionalDummyFileToCreateInEverettProjectDirectory != null) - { - dummyExtraFile = Path.Combine(Path.GetDirectoryName(sourceProjectFile), additionalDummyFileToCreateInEverettProjectDirectory); - - File.WriteAllText(dummyExtraFile, String.Empty); - } - - try - { - ProjectFileConverter converter = new ProjectFileConverter(); - - converter.OldProjectFile = sourceProjectFile; - converter.IsUserFile = false; - converter.IsMinorUpgrade = isMinorUpgrade; - ProjectRootElement project = converter.ConvertInMemory(); - - Helpers.CompareProjectXml(targetProjectContents, project.RawXml); - } - finally - { - File.Delete(sourceProjectFile); - - if (dummyExtraFile != null) - { - File.Delete(dummyExtraFile); - } - } - } - } - - /*************************************************************************** - * - * Class: ProjectFileConverter_Tests - * Owner: jomof - * - * This class contains the unit tests for the " ProjectFileConverter" class. - * See the comments in that class for a description of its purpose. - * - **************************************************************************/ - [TestClass] - public class ProjectFileConverter_Tests - { - /*********************************************************************** - * - * Method: ProjectFileConverter_Tests.MakeRelativeWithHash - * Owner: jomof - * - * Test where paths with '#' in them can be converted into relative - * paths - * - **********************************************************************/ - [TestMethod] - public void MakeRelativeWithHash() - { - // Intentionally making the paths not the same case, because this should be irrelevant. - string path1 = @"D:\Public\Samples\Visual J# .NET 2003\Crosslanguage\Copy (8) of TilePuzzle\TileDriver\TileDriver.vcproj"; - string path2 = @"D:\public\Samples\Visual J# .NET 2003\Crosslanguage\Copy (8) of TilePuzzle\PUZZLE.vjsproj"; - - string rel = ProjectFileConverter.RelativePathTo(path2, path1); - Console.WriteLine(rel); - - Assert.AreEqual(@"TileDriver\TileDriver.vcproj", rel); - } - - /*********************************************************************** - * - * Method: ProjectFileConverter_Tests.MakeRelativeWithSpace - * Owner: RGoel - * - * Test where paths where the relative path ends up having a in - * it. - * - **********************************************************************/ - [TestMethod] - public void MakeRelativeWithSpace() - { - string path1 = @"D:\Public\Samples\Tile Driver\Tile#Driver.vcproj"; - string path2 = @"D:\public\Samples\Main App\Main App.vcproj"; - - string rel = ProjectFileConverter.RelativePathTo(path2, path1); - Console.WriteLine(rel); - - Assert.AreEqual(@"..\Tile Driver\Tile#Driver.vcproj", rel); - } - - /// - /// Per this bug, any references to resx files that were empty - /// should be removed from the project. The files should not be - /// deleted though. - /// - [TestMethod] - public void RemoveReferencesToEmptyResxPerBug248965() - { - string temp = Path.GetTempPath(); - string projFolder = temp + "\\projfolder"; - Directory.CreateDirectory(projFolder); - string projectFile = projFolder + "\\project.proj"; - string resxFile1 = projFolder + "\\emptyresx1.resx"; - string resxFile2 = projFolder + "\\resx2.resx"; - string resxFile3 = projFolder + "\\emptyresx3.resx"; - string resxFile4 = projFolder + "\\resx4.resx"; - string resxFile5 = temp + "\\emptyresx5.resx"; - string resxFile6 = temp + "\\resx6.resx"; - string newProjectFile = ""; - - #region projectContent - string projectContent = - @" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "; - #endregion - - try - { - using (StreamWriter sw = new StreamWriter(projectFile)) - sw.Write(projectContent); - using (StreamWriter sw = new StreamWriter(resxFile1)) - sw.Write(""); - using (StreamWriter sw = new StreamWriter(resxFile2)) - sw.Write("not empty blah blah"); - using (StreamWriter sw = new StreamWriter(resxFile3)) - sw.Write(""); - using (StreamWriter sw = new StreamWriter(resxFile4)) - sw.Write("not empty blah blah"); - using (StreamWriter sw = new StreamWriter(resxFile5)) - sw.Write(""); - using (StreamWriter sw = new StreamWriter(resxFile6)) - sw.Write("not empty blah blah"); - - ProjectFileConverter projectFileConverter = new ProjectFileConverter(); - projectFileConverter.OldProjectFile = projectFile; - newProjectFile = projectFile + ".1"; - projectFileConverter.NewProjectFile = newProjectFile; - projectFileConverter.IsUserFile = false; - projectFileConverter.Convert(Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().EscapedCodeBase).LocalPath)); - - string newContent; - using (StreamReader sr = new StreamReader(newProjectFile)) - { - newContent = sr.ReadToEnd(); - } - - #region expectedContent - string expectedContent = @" - - - Form - - - Form - - - - resx6.resx - - - " + Path.GetFileNameWithoutExtension(resxFile2) + @".cs - - - "; - #endregion - - Console.WriteLine("=actual="); - Console.WriteLine(newContent); - Console.WriteLine("=="); - Console.WriteLine("=expected="); - Console.WriteLine(expectedContent); - Console.WriteLine("=="); - - Assert.AreNotEqual(-1, newContent.IndexOf(expectedContent)); - - // shouldn't delete any - Assert.IsTrue(File.Exists(resxFile1)); - Assert.IsTrue(File.Exists(resxFile2)); - Assert.IsTrue(File.Exists(resxFile3)); - Assert.IsTrue(File.Exists(resxFile4)); - Assert.IsTrue(File.Exists(resxFile5)); - Assert.IsTrue(File.Exists(resxFile6)); - - } - finally - { - if (File.Exists(projectFile)) File.Delete(projectFile); - if (File.Exists(newProjectFile)) File.Delete(newProjectFile); - if (File.Exists(resxFile1)) File.Delete(resxFile1); - if (File.Exists(resxFile2)) File.Delete(resxFile2); - if (File.Exists(resxFile3)) File.Delete(resxFile3); - if (File.Exists(resxFile4)) File.Delete(resxFile4); - if (File.Exists(resxFile5)) File.Delete(resxFile5); - if (File.Exists(resxFile6)) File.Delete(resxFile6); - if (Directory.Exists(projFolder)) Directory.Delete(projFolder); - } - } - - /// - /// This is a regression test for bug VSWhidbey 414632. We're testing to make sure that if the Everett - /// project already had a value for MyType that the conversion utility should not overwrite it. - /// - /// RGoel - [TestMethod] - public void VbConversionWithMyTypeAlreadySet() - { - // ********************************************** - // EVERETT - // ********************************************** - string everettProjectContents = @" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "; - - // ********************************************** - // WHIDBEY - // ********************************************** - string whidbeyProjectContents = @" - - - Local - WindowsForms - 2.0 - Debug - AnyCPU - Project1 - WinExe - Project1.Form1 - 1 - 0 - 0 - False - Microsoft - Project1 - 20 - - - .\bin\ - Project1.xml - True - True - True - Win32=True - 42016,42017,42018,42019,42032,42353,42354,42355 - full - - - .\bin\ - Project1.xml - False - False - True - Win32=True - 42016,42017,42018,42019,42032,42353,42354,42355 - none - - - - Microsoft.VisualBasic.Compatibility - - - System - - - System.Data - - - System.Drawing - - - System.Windows.Forms - - - System.XML - - - - - - - - - - - - - - - - Code - Form1.vb - - - Form - - - - - - - - - "; - - Helpers.ConvertAndCompare(everettProjectContents, whidbeyProjectContents, "Form1.resx"); - } - - /// - /// This is a regression test for bug VSWhidbey 477054. We're testing to make sure that if the Everett - /// project was a Trinity project and has a reference to an Office document file in the UserProperties - /// section, that we correctly add this as an item "None" in the converted project. - /// - /// RGoel - [TestMethod] - public void ConvertTrinityWithOfficeDocumentFile() - { - // ********************************************** - // EVERETT - // ********************************************** - string everettProjectContents = @" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "; - - // ********************************************** - // WHIDBEY - // ********************************************** - string whidbeyProjectContents = @" - - - Local - 2.0 - {305E5110-3086-465A-A246-9D9718726777} - Debug - AnyCPU - - - ExcelProject1 - - JScript - Grid - IE50 - false - Library - ExcelProject1 - OnBuildSuccess - - {BAA0C2D2-18E2-41B9-852F-F413020CAA33};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 20 - - - bin\Debug\ - false - 285212672 - false - - DEBUG;TRACE - - true - 4096 - false - - false - false - false - false - 4 - full - prompt - - - bin\Release\ - false - 285212672 - false - - TRACE - - false - 4096 - false - - true - false - false - false - 4 - none - prompt - - - - {00020813-0000-0000-C000-000000000046} - 1 - 5 - 0 - primary - - - {2DF8D04C-5BFA-101B-BDE5-00AA0044DE52} - 2 - 3 - 0 - primary - - - {0D452EE1-E08F-101A-852E-02608C4D0BB4} - 2 - 0 - 0 - primary - - - {0002E157-0000-0000-C000-000000000046} - 5 - 3 - 0 - primary - - - System - - - System.Data - - - System.Windows.Forms - - - System.XML - - - - - Code - - - Code - - - - - - - - - - - - - - - - - - - - "; - - Helpers.ConvertAndCompare(everettProjectContents, whidbeyProjectContents, "EXCELPROJECT1.XLS"); - } - - /// - /// This is to test that we convert nodes correctly. It's not rocket - /// science, but we need to cover it. - /// - /// RGoel - [TestMethod] - public void ConvertEmptyFolders() - { - // ********************************************** - // EVERETT - // ********************************************** - string everettProjectContents = @" - - - - - - - - - - - - - - - - - - - - - - - - - - - "; - - // ********************************************** - // WHIDBEY - // ********************************************** - string whidbeyProjectContents = @" - - - - Local - 2.0 - Debug - AnyCPU - - 20 - - - .xml - 42016,42017,42018,42019,42032,42353,42354,42355 - - - .xml - 42016,42017,42018,42019,42032,42353,42354,42355 - - - - System - - - - - - - - - Code - - - Form - - - - - - - - - - "; - - Helpers.ConvertAndCompare(everettProjectContents, whidbeyProjectContents, "Form1.resx"); - } - - /// - /// This is to test that we convert P2P references correctly by looking up the - /// referenced project in the passed-in .SLN file. - /// - /// RGoel - [TestMethod] - public void ConvertP2PReference() - { - // ********************************************** - // EVERETT PROJECT - // ********************************************** - string resxFile = Path.Combine(Path.GetTempPath(), "Form1.resx"); - File.WriteAllText(resxFile, String.Empty); - - string everettProjectFile = ObjectModelHelpers.CreateTempFileOnDiskNoFormat(@" - - - - - - - - - - - - - - - - - - - - - - - "); - - // ********************************************** - // EVERETT SOLUTION - // ********************************************** - string everettSolutionFile = ObjectModelHelpers.CreateTempFileOnDiskNoFormat( - - @"Microsoft Visual Studio Solution File, Format Version 8.00 - Project(`{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}`) = `WindowsApplication2`, `WindowsApplication2.csproj`, `{77E21864-797C-4220-974E-530BB832801B}` - ProjectSection(ProjectDependencies) = postProject - EndProjectSection - EndProject - Project(`{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}`) = `ClassLibrary1`, `..\ClassLibrary1\ClassLibrary1.csproj`, `{F532DD6D-9E5C-4FE8-BE84-96F37D47F45A}` - ProjectSection(ProjectDependencies) = postProject - EndProjectSection - EndProject - Global - GlobalSection(SolutionConfiguration) = preSolution - Debug = Debug - Release = Release - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {77E21864-797C-4220-974E-530BB832801B}.Debug.ActiveCfg = Debug|.NET - {77E21864-797C-4220-974E-530BB832801B}.Debug.Build.0 = Debug|.NET - {77E21864-797C-4220-974E-530BB832801B}.Release.ActiveCfg = Release|.NET - {77E21864-797C-4220-974E-530BB832801B}.Release.Build.0 = Release|.NET - {F532DD6D-9E5C-4FE8-BE84-96F37D47F45A}.Debug.ActiveCfg = Debug|.NET - {F532DD6D-9E5C-4FE8-BE84-96F37D47F45A}.Debug.Build.0 = Debug|.NET - {F532DD6D-9E5C-4FE8-BE84-96F37D47F45A}.Release.ActiveCfg = Release|.NET - {F532DD6D-9E5C-4FE8-BE84-96F37D47F45A}.Release.Build.0 = Release|.NET - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection - EndGlobal - "); - - // ********************************************** - // WHIDBEY PROJECT - // ********************************************** - string whidbeyProjectContents = @" - - - - Local - 2.0 - {77E21864-797C-4220-974E-530BB832801B} - Debug - AnyCPU - App.ico - 20 - - - bin\Debug\ - prompt - - - bin\Release\ - prompt - - - - ClassLibrary1 - {F532DD6D-9E5C-4FE8-BE84-96F37D47F45A} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - - - System - - - System.XML - - - - - Form - - - - - - - - - "; - - ProjectFileConverter converter = new ProjectFileConverter(); - converter.OldProjectFile = everettProjectFile; - converter.SolutionFile = everettSolutionFile; - converter.IsUserFile = false; - - ProjectRootElement project = converter.ConvertInMemory(); - - Helpers.CompareProjectXml(whidbeyProjectContents, project.RawXml); - - File.Delete(resxFile); - File.Delete(everettProjectFile); - File.Delete(everettSolutionFile); - } - - /// - /// This is to test that we convert Everett projects that are part of solutions including - /// VC++ projects. - /// - [TestMethod] - public void ConvertProjectWithVCInSolutionAndP2Ps() - { - // ********************************************** - // EVERETT PROJECT - // ********************************************** - string resxFile = Path.Combine(Path.GetTempPath(), "Form1.resx"); - File.WriteAllText(resxFile, String.Empty); - - string everettProjectFile = ObjectModelHelpers.CreateTempFileOnDiskNoFormat(@" - - - - - - - - - - - - - - - - - - - - - - - "); - - // ********************************************** - // EVERETT SOLUTION - // ********************************************** - string everettSolutionFile = ObjectModelHelpers.CreateTempFileOnDiskNoFormat( - - @"Microsoft Visual Studio Solution File, Format Version 8.00 - Project(`{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}`) = `WindowsApplication2`, `WindowsApplication2.csproj`, `{77E21864-797C-4220-974E-530BB832801B}` - ProjectSection(ProjectDependencies) = postProject - EndProjectSection - EndProject - Project(`{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}`) = `ClassLibrary1`, `..\ClassLibrary1\ClassLibrary1.csproj`, `{F532DD6D-9E5C-4FE8-BE84-96F37D47F45A}` - ProjectSection(ProjectDependencies) = postProject - EndProjectSection - EndProject - Project(`{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}`) = `VCClassLibrary1`, `..\VCClassLibrary1\VCClassLibrary1.vcproj`, `{6C4A36F7-F091-432A-9CA0-98FF2DEA9F33}` - ProjectSection(ProjectDependencies) = postProject - EndProjectSection - EndProject - Global - GlobalSection(SolutionConfiguration) = preSolution - Debug = Debug - Release = Release - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {77E21864-797C-4220-974E-530BB832801B}.Debug.ActiveCfg = Debug|.NET - {77E21864-797C-4220-974E-530BB832801B}.Debug.Build.0 = Debug|.NET - {77E21864-797C-4220-974E-530BB832801B}.Release.ActiveCfg = Release|.NET - {77E21864-797C-4220-974E-530BB832801B}.Release.Build.0 = Release|.NET - {F532DD6D-9E5C-4FE8-BE84-96F37D47F45A}.Debug.ActiveCfg = Debug|.NET - {F532DD6D-9E5C-4FE8-BE84-96F37D47F45A}.Debug.Build.0 = Debug|.NET - {F532DD6D-9E5C-4FE8-BE84-96F37D47F45A}.Release.ActiveCfg = Release|.NET - {F532DD6D-9E5C-4FE8-BE84-96F37D47F45A}.Release.Build.0 = Release|.NET - {6C4A36F7-F091-432A-9CA0-98FF2DEA9F33}.Debug.ActiveCfg = Debug|.NET - {6C4A36F7-F091-432A-9CA0-98FF2DEA9F33}.Debug.Build.0 = Debug|.NET - {6C4A36F7-F091-432A-9CA0-98FF2DEA9F33}.Release.ActiveCfg = Release|.NET - {6C4A36F7-F091-432A-9CA0-98FF2DEA9F33}.Release.Build.0 = Release|.NET - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection - EndGlobal - "); - - // ********************************************** - // WHIDBEY PROJECT - // ********************************************** - string whidbeyProjectContents = @" - - - - Local - 2.0 - {77E21864-797C-4220-974E-530BB832801B} - Debug - AnyCPU - App.ico - 20 - - - bin\Debug\ - prompt - - - bin\Release\ - prompt - - - - ClassLibrary1 - {F532DD6D-9E5C-4FE8-BE84-96F37D47F45A} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - - - System - - - System.XML - - - - - Form - - - - - - - - - "; - - ProjectFileConverter converter = new ProjectFileConverter(); - converter.OldProjectFile = everettProjectFile; - converter.SolutionFile = everettSolutionFile; - converter.IsUserFile = false; - - ProjectRootElement project = converter.ConvertInMemory(); - - Helpers.CompareProjectXml(whidbeyProjectContents, project.RawXml); - - File.Delete(resxFile); - File.Delete(everettProjectFile); - File.Delete(everettSolutionFile); - } - - /// - /// This is to test that we convert P2P references correctly by looking up the - /// referenced project in the given .SLN file. Force the conversion code to - /// have to search for the .SLN file. - /// - /// RGoel - [TestMethod] - public void ConvertP2PReferenceSearchForSolution() - { - ObjectModelHelpers.DeleteTempProjectDirectory(); - - // ********************************************** - // EVERETT PROJECT - // ********************************************** - string everettProjectFileRelativePath = @"Project\WindowsApplication1.csproj"; - ObjectModelHelpers.CreateFileInTempProjectDirectory(everettProjectFileRelativePath, @" - - - - - - - - - - - - - - - - - - - - - - - "); - - string resxFile = "Project\\Form1.resx"; - ObjectModelHelpers.CreateFileInTempProjectDirectory(resxFile, String.Empty); - - // ********************************************** - // EVERETT SOLUTION - // ********************************************** - ObjectModelHelpers.CreateFileInTempProjectDirectory(@"WindowsApplication1.sln", - - @"Microsoft Visual Studio Solution File, Format Version 8.00 - Project(`{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}`) = `WindowsApplication1`, `Project\WindowsApplication1.csproj`, `{77E21864-797C-4220-974E-530BB832801B}` - ProjectSection(ProjectDependencies) = postProject - EndProjectSection - EndProject - Project(`{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}`) = `ClassLibrary1`, `ClassLibrary1\ClassLibrary1.csproj`, `{F532DD6D-9E5C-4FE8-BE84-96F37D47F45A}` - ProjectSection(ProjectDependencies) = postProject - EndProjectSection - EndProject - Global - GlobalSection(SolutionConfiguration) = preSolution - Debug = Debug - Release = Release - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {77E21864-797C-4220-974E-530BB832801B}.Debug.ActiveCfg = Debug|.NET - {77E21864-797C-4220-974E-530BB832801B}.Debug.Build.0 = Debug|.NET - {77E21864-797C-4220-974E-530BB832801B}.Release.ActiveCfg = Release|.NET - {77E21864-797C-4220-974E-530BB832801B}.Release.Build.0 = Release|.NET - {F532DD6D-9E5C-4FE8-BE84-96F37D47F45A}.Debug.ActiveCfg = Debug|.NET - {F532DD6D-9E5C-4FE8-BE84-96F37D47F45A}.Debug.Build.0 = Debug|.NET - {F532DD6D-9E5C-4FE8-BE84-96F37D47F45A}.Release.ActiveCfg = Release|.NET - {F532DD6D-9E5C-4FE8-BE84-96F37D47F45A}.Release.Build.0 = Release|.NET - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection - EndGlobal - "); - - // ********************************************** - // RANDOM OTHER SOLUTION - // ********************************************** - ObjectModelHelpers.CreateFileInTempProjectDirectory(@"Project\Random.sln", - - @"Microsoft Visual Studio Solution File, Format Version 8.00 - Project(`{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}`) = `ClassLibrary2`, `ClassLibrary2\ClassLibrary2.csproj`, `{11111111-9E5C-4FE8-BE84-96F37D47F45A}` - ProjectSection(ProjectDependencies) = postProject - EndProjectSection - EndProject - Global - GlobalSection(SolutionConfiguration) = preSolution - Debug = Debug - Release = Release - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {11111111-9E5C-4FE8-BE84-96F37D47F45A}.Debug.ActiveCfg = Debug|.NET - {11111111-9E5C-4FE8-BE84-96F37D47F45A}.Debug.Build.0 = Debug|.NET - {11111111-9E5C-4FE8-BE84-96F37D47F45A}.Release.ActiveCfg = Release|.NET - {11111111-9E5C-4FE8-BE84-96F37D47F45A}.Release.Build.0 = Release|.NET - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection - EndGlobal - "); - - // ********************************************** - // WHIDBEY PROJECT - // ********************************************** - string whidbeyProjectContents = @" - - - - Local - 2.0 - {77E21864-797C-4220-974E-530BB832801B} - Debug - AnyCPU - App.ico - 20 - - - bin\Debug\ - prompt - - - bin\Release\ - prompt - - - - ClassLibrary1 - {F532DD6D-9E5C-4FE8-BE84-96F37D47F45A} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - - - System - - - System.XML - - - - - Form - - - - - - - - - "; - - ProjectFileConverter converter = new ProjectFileConverter(); - converter.OldProjectFile = Path.Combine(ObjectModelHelpers.TempProjectDir, everettProjectFileRelativePath); - converter.IsUserFile = false; - ProjectRootElement project = converter.ConvertInMemory(); - - Helpers.CompareProjectXml(whidbeyProjectContents, project.RawXml); - } - - /// - /// This is a test for bug VSWhidbey 472064. We are making sure that if DebugSymbols is true in - /// the original project file, then we also emit DebugType to the whidbey project file. We also - /// emit ErrorReport = prompt to the whidbey project file if the language is C# - /// - /// FaisalMo - [TestMethod] - public void ConvertEverettProjectWithNoDebugInfoFlag() - { - // ********************************************** - // EVERETT - // ********************************************** - string everettProjectContents = @" - - - - - - - - - - - - - - - - - - - - - - - "; - - // ********************************************** - // WHIDBEY - // ********************************************** - string whidbeyProjectContents = @" - - - Local - 2.0 - {172D0AFF-7BF3-4297-8168-792C46DC89DD} - Debug - AnyCPU - App.ico - - ConsoleApplication1 - - JScript - Grid - IE50 - false - Exe - ConsoleApplication1 - OnBuildSuccess - - 20 - - - bin\Debug\ - false - 285212672 - false - - DEBUG;TRACE - - true - 4096 - false - - false - false - false - false - 4 - full - prompt - - - bin\Release\ - false - 285212672 - false - - TRACE - - false - 4096 - false - - true - false - false - false - 4 - none - prompt - - - - System - - - System.Data - - - System.XML - - - - - Code - - - Code - - - - - - - - - - "; - - Helpers.ConvertAndCompare(everettProjectContents, whidbeyProjectContents); - } - - /// - /// This is a test for converting Everett projects that had special characters in the AssemblyName, - /// OutputPath, config name, etc. These characters need to be escaped when converted to MSBuild. - /// - /// RGoel - [TestMethod] - public void ConvertEverettProjectWithSpecialCharaceters() - { - // ********************************************** - // EVERETT - // ********************************************** - string everettProjectContents = @" - - - - - - - - - - - - - - - - - - - - - - - - "; - - // ********************************************** - // WHIDBEY - // ********************************************** - string whidbeyProjectContents = @" - - - Local - 2.0 - {172D0AFF-7BF3-4297-8168-792C46DC89DD} - Debug - AnyCPU - App.ico - - Console%3bApplication1 - - JScript - Grid - IE50 - false - Exe - ConsoleApplication1 - OnBuildSuccess - - 20 - - - bin\Debu%40foo - %24%28hello%29g\ - false - 285212672 - false - - DEBUG;TRACE - - true - 4096 - false - - false - false - false - false - 4 - full - prompt - - - bin\Release\ - false - 285212672 - false - - TRACE - - false - 4096 - false - - true - false - false - false - 4 - none - prompt - - - - Microsoft.My%27Different%3bAssemb%25ly - D:\myapps\Microsoft.My%27Different%3bAssemb%25ly.dll - - - System - - - System.Data - - - System.XML - - - - - Code - - - Code - - - - - - echo $(TargetPath) - echo %25DEBUGGER%25 - - - "; - - Helpers.ConvertAndCompare(everettProjectContents, whidbeyProjectContents); - } - - /// - /// Dev10 Bug 557388: When converting a project to v4.0, if the project contains - /// references to v3.5 and before VC projects (.vcproj), convert that reference to - /// instead reference a .vcxproj of the same name. - /// - [TestMethod] - public void ConvertVCProjectReferenceExtensions() - { - string orcasProjectFileContents = @" - - - - - - "; - - string dev10projectContents = @" - - - - - - "; - - Helpers.ConvertAndCompare(orcasProjectFileContents, dev10projectContents); - } - - /// - /// Dev10 Bug 557388: When converting a project to v4.0, if the project contains - /// references to v3.5 and before VC projects (.vcproj), convert that reference to - /// instead reference a .vcxproj of the same name. - /// - [TestMethod] - public void ConvertVCProjectReferenceExtensionsWildcard() - { - string orcasProjectFileContents = @" - - - - - - "; - - string dev10projectContents = @" - - - - - - "; - - Helpers.ConvertAndCompare(orcasProjectFileContents, dev10projectContents); - } - - /// - /// Dev10 Bug 557388: When converting a project to v4.0, if the project contains - /// references to v3.5 and before VC projects (.vcproj), convert that reference to - /// instead reference a .vcxproj of the same name. - /// - [TestMethod] - public void ConvertVCProjectReferenceExtensionsTrimNeeded() - { - string orcasProjectFileContents = @" - - - - - - "; - - string dev10projectContents = @" - - - - - - "; - - Helpers.ConvertAndCompare(orcasProjectFileContents, dev10projectContents); - } - - [TestMethod] - public void ConvertProjectFileWithClientSubset() - { - string orcasProjectFileClient = @" - - - Debug - AnyCPU - 9.0.21022 - 2.0 - {3D948CB8-F515-41D5-B0ED-4215ED0A6D76} - Exe - Properties - FxProfile - FxProfile - v3.5 - Client - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - "; - - string dev12ProjectFileClient = ObjectModelHelpers.CleanupFileContents(@" - - - Debug - AnyCPU - 9.0.21022 - 2.0 - {3D948CB8-F515-41D5-B0ED-4215ED0A6D76} - Exe - Properties - FxProfile - FxProfile - v3.5 - 512 - Client - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - "); - - Helpers.ConvertAndCompare(orcasProjectFileClient, dev12ProjectFileClient); - } - - [TestMethod] - public void ConvertProjectFileWithFullSubset() - { - string orcasProjectFileFull = @" - - - Debug - AnyCPU - 9.0.21022 - 2.0 - {3D948CB8-F515-41D5-B0ED-4215ED0A6D76} - Exe - Properties - FxProfile - FxProfile - v3.5 - Full - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - "; - - string dev12ProjectFileFull = ObjectModelHelpers.CleanupFileContents(@" - - - Debug - AnyCPU - 9.0.21022 - 2.0 - {3D948CB8-F515-41D5-B0ED-4215ED0A6D76} - Exe - Properties - FxProfile - FxProfile - v3.5 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - "); - - Helpers.ConvertAndCompare(orcasProjectFileFull, dev12ProjectFileFull); - } - - [TestMethod] - public void ConvertFSharpOrcasProjectFile() - { - string fsharpOrcasProjectFile = @" - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {4516a96a-098b-408b-b914-71d82752c1cb} - Exe - ImportToDev10 - ImportToDev10 - v3.5 - 512 - ImportToDev10 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 3 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 3 - - - - - 3.5 - - - - - - - - - "; - string fsharpDev10ProjectFile = @" - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {4516a96a-098b-408b-b914-71d82752c1cb} - Exe - ImportToDev10 - ImportToDev10 - v3.5 - 512 - ImportToDev10 - 2.3.0.0 - 11 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 3 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 3 - - - - True - - - - - 3.5 - - - - - - - - - $(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets - - - - - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets - - - - - - - "; - Helpers.ConvertAndCompare(fsharpOrcasProjectFile, fsharpDev10ProjectFile); - } - - [TestMethod] - public void ConvertDev11PortableLibraryProjectFile() - { - string sampleDev11PortableLibraryProjectFile = @" - - - - Debug - AnyCPU - 2.0 - abe4e969-375e-463c-8db0-005e32337771 - Library - PortableLibrary1 - PortableLibrary1 - v4.0 - Profile47 - PortableLibrary1 - - - true - full - false - false - bin\Debug\ - DEBUG;TRACE - 3 - bin\Debug\PortableLibrary1.XML - - - pdbonly - true - true - bin\Release\ - TRACE - 3 - bin\Release\PortableLibrary1.XML - - - - FSharp.Core - FSharp.Core.dll - $(MSBuildExtensionsPath32)\..\Reference Assemblies\Microsoft\FSharp\3.0\Runtime\.NETPortable\FSharp.Core.dll - - - - - - - - 11 - - - - - "; - - string asDev12ProjectFile = @" - - - - Debug - AnyCPU - 2.0 - abe4e969-375e-463c-8db0-005e32337771 - Library - PortableLibrary1 - PortableLibrary1 - v4.0 - Profile47 - PortableLibrary1 - 2.3.5.0 - - - true - full - false - false - bin\Debug\ - DEBUG;TRACE - 3 - bin\Debug\PortableLibrary1.XML - - - pdbonly - true - true - bin\Release\ - TRACE - 3 - bin\Release\PortableLibrary1.XML - - - - $(MSBuildExtensionsPath32)\..\Reference Assemblies\Microsoft\FSharp\.NETPortable\$(TargetFSharpCoreVersion)\FSharp.Core.dll - True - - - - - - - - 11 - - - - - $(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.Portable.FSharp.Targets - - - - - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.Portable.FSharp.Targets - - - - - - - "; - - Helpers.ConvertAndCompare(sampleDev11PortableLibraryProjectFile, asDev12ProjectFile); - } - - [TestMethod] - public void ConvertDev12PortableLibraryProjectFileShouldBeNoOp() - { - string asDev12ProjectFile = ObjectModelHelpers.CleanupFileContents(@" - - - - Debug - AnyCPU - 2.0 - abe4e969-375e-463c-8db0-005e32337771 - Library - PortableLibrary1 - PortableLibrary1 - v4.0 - Profile47 - PortableLibrary1 - - - true - full - false - false - bin\Debug\ - DEBUG;TRACE - 3 - bin\Debug\PortableLibrary1.XML - - - pdbonly - true - true - bin\Release\ - TRACE - 3 - bin\Release\PortableLibrary1.XML - - - - FSharp.Core - FSharp.Core.dll - $(MSBuildExtensionsPath32)\..\Reference Assemblies\Microsoft\FSharp\3.0\Runtime\.NETPortable\FSharp.Core.dll - - - - - - - - 11 - - - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.Portable.FSharp.Targets - - - - - "); - - Helpers.ConvertAndCompare(asDev12ProjectFile, asDev12ProjectFile); - } - - [TestMethod] - public void ConvertFSharpDev10ProjectFile() - { - // pick standard proj from dev10, do conversion - string sampleFSharpDev10ProjectFile = @" - - - Debug - x86 - 8.0.30703 - 2.0 - {83a887ac-cd45-4d4a-a769-324d9055ac97} - Exe - ConsoleApplication1 - ConsoleApplication1 - v4.0 - Client - ConsoleApplication1 - - - true - full - false - false - bin\Debug\ - DEBUG;TRACE - 3 - x86 - bin\Debug\ConsoleApplication1.XML - - - pdbonly - true - true - bin\Release\ - TRACE - 3 - x86 - bin\Release\ConsoleApplication1.XML - - - - - - - - - - - - - - - - "; - string asDev11ProjectFile = @" - - - Debug - x86 - 8.0.30703 - 2.0 - {83a887ac-cd45-4d4a-a769-324d9055ac97} - Exe - ConsoleApplication1 - ConsoleApplication1 - v4.0 - Client - ConsoleApplication1 - 4.3.0.0 - 11 - - - true - full - false - false - bin\Debug\ - DEBUG;TRACE - 3 - x86 - bin\Debug\ConsoleApplication1.XML - - - pdbonly - true - true - bin\Release\ - TRACE - 3 - x86 - bin\Release\ConsoleApplication1.XML - - - - True - - - - - - - - - - - - - $(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets - - - - - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets - - - - - - - "; - Helpers.ConvertAndCompare(sampleFSharpDev10ProjectFile, asDev11ProjectFile); - } - - [TestMethod] - public void ConvertFSharpDev10ProjectFileWithMinVS() - { - // pick standard proj from dev10, do conversion - string sampleFSharpDev10ProjectFile = @" - - - Debug - x86 - 8.0.30703 - 2.0 - {83a887ac-cd45-4d4a-a769-324d9055ac97} - Exe - ConsoleApplication1 - ConsoleApplication1 - v4.0 - Client - ConsoleApplication1 - - - true - full - false - false - bin\Debug\ - DEBUG;TRACE - 3 - x86 - bin\Debug\ConsoleApplication1.XML - - - pdbonly - true - true - bin\Release\ - TRACE - 3 - x86 - bin\Release\ConsoleApplication1.XML - - - - - - - - - - - - - 10 - - - - - - "; - string asDev11ProjectFile = @" - - - Debug - x86 - 8.0.30703 - 2.0 - {83a887ac-cd45-4d4a-a769-324d9055ac97} - Exe - ConsoleApplication1 - ConsoleApplication1 - v4.0 - Client - ConsoleApplication1 - 4.3.0.0 - - - true - full - false - false - bin\Debug\ - DEBUG;TRACE - 3 - x86 - bin\Debug\ConsoleApplication1.XML - - - pdbonly - true - true - bin\Release\ - TRACE - 3 - x86 - bin\Release\ConsoleApplication1.XML - - - - True - - - - - - - - - - - 10 - - - - - $(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets - - - - - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets - - - - - - - "; - Helpers.ConvertAndCompare(sampleFSharpDev10ProjectFile, asDev11ProjectFile); - } - - [TestMethod] - public void ConvertFSharpDev11ProjectFile() - { - string sampleDev11Project = @" - - - Debug - x86 - 2.0 - {bfafbde5-287f-430e-85ed-e5cdfc71213b} - Exe - ConsoleApplication2 - ConsoleApplication2 - v4.5 - Client - ConsoleApplication2 - - - true - full - false - false - bin\Debug\ - DEBUG;TRACE - 3 - x86 - bin\Debug\ConsoleApplication2.XML - - - pdbonly - true - true - bin\Release\ - TRACE - 3 - x86 - bin\Release\ConsoleApplication2.XML - - - - - - - - - - - - - - - - - - "; - - string aDev12Project = @" - - - Debug - x86 - 2.0 - {bfafbde5-287f-430e-85ed-e5cdfc71213b} - Exe - ConsoleApplication2 - ConsoleApplication2 - v4.5 - Client - ConsoleApplication2 - 4.3.0.0 - 11 - - - true - full - false - false - bin\Debug\ - DEBUG;TRACE - 3 - x86 - bin\Debug\ConsoleApplication2.XML - - - pdbonly - true - true - bin\Release\ - TRACE - 3 - x86 - bin\Release\ConsoleApplication2.XML - - - - - $(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets - - - - - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets - - - - - - - - - - - True - - - - - - - - - "; - Helpers.ConvertAndCompare(sampleDev11Project, aDev12Project); - } - - [TestMethod] - public void ConvertFSharpDev11ProjectFileWithCustomFSharpCoreLocation() - { - string sampleDev11Project = @" - - - Debug - x86 - 2.0 - {bfafbde5-287f-430e-85ed-e5cdfc71213b} - Exe - ConsoleApplication2 - ConsoleApplication2 - v4.5 - Client - ConsoleApplication2 - - - true - full - false - false - bin\Debug\ - DEBUG;TRACE - 3 - x86 - bin\Debug\ConsoleApplication2.XML - - - pdbonly - true - true - bin\Release\ - TRACE - 3 - x86 - bin\Release\ConsoleApplication2.XML - - - - - - - - - - - - c:\some-custom-location\FSharp.Core.dll - - - - - - - - "; - - string aDev12Project = @" - - - Debug - x86 - 2.0 - {bfafbde5-287f-430e-85ed-e5cdfc71213b} - Exe - ConsoleApplication2 - ConsoleApplication2 - v4.5 - Client - ConsoleApplication2 - 11 - - - true - full - false - false - bin\Debug\ - DEBUG;TRACE - 3 - x86 - bin\Debug\ConsoleApplication2.XML - - - pdbonly - true - true - bin\Release\ - TRACE - 3 - x86 - bin\Release\ConsoleApplication2.XML - - - - - $(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets - - - - - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets - - - - - - - - - - - - c:\some-custom-location\FSharp.Core.dll - - - - - - - - "; - Helpers.ConvertAndCompare(sampleDev11Project, aDev12Project); - } - - [TestMethod] - public void ConvertFSharpDev12ProjectFileShouldBeNoOp() - { - string aDev12Project = ObjectModelHelpers.CleanupFileContents(@" - - - Debug - x86 - 2.0 - {bfafbde5-287f-430e-85ed-e5cdfc71213b} - Exe - ConsoleApplication2 - ConsoleApplication2 - v4.5 - Client - ConsoleApplication2 - - - true - full - false - false - bin\Debug\ - DEBUG;TRACE - 3 - x86 - bin\Debug\ConsoleApplication2.XML - - - pdbonly - true - true - bin\Release\ - TRACE - 3 - x86 - bin\Release\ConsoleApplication2.XML - - - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets - - - 12 - - - - - - - - - - - - - - - - "); - Helpers.ConvertAndCompare(aDev12Project, aDev12Project); // ensure no change - } - - [TestMethod] - public void ConvertWFProjectFile() - { - string wfWhidbeyProjectFile = @" - - - Debug - 8.0.50727 - 2.0 - {60A2C065-FE5A-4A8F-808D-506BE3007BBD} - Library - WorkflowLibrary1 - WorkflowLibrary1 - {14822709-B5A1-4724-98CA-57A101D1B079};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 4 - - - true - full - false - .\bin\Debug\ - DEBUG;TRACE - false - - - false - true - .\bin\Release\ - TRACE - false - - - - - - - - - - - - - - - - - - - SettingsSingleFileGenerator - Settings.cs - - - Component - - - Workflow1.cs - - - True - Settings.settings - - - - - - - "; - string wfDev10ProjectFile = ObjectModelHelpers.CleanupFileContents(@" - - - Debug - 8.0.50727 - 2.0 - {60A2C065-FE5A-4A8F-808D-506BE3007BBD} - Library - WorkflowLibrary1 - WorkflowLibrary1 - {14822709-B5A1-4724-98CA-57A101D1B079};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 4 - v3.0 - - - true - full - false - .\bin\Debug\ - DEBUG;TRACE - false - - - false - true - .\bin\Release\ - TRACE - false - - - - - - - - - - - - - - - - - - - SettingsSingleFileGenerator - Settings.cs - - - Component - - - Workflow1.cs - - - True - Settings.settings - - - - - - - "); - Helpers.ConvertAndCompare(wfWhidbeyProjectFile, wfDev10ProjectFile); - } - - [TestMethod] - public void ConvertVisualBasicVS2005Project() { - string wfWhidbeyProjectFile = @" - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {280AE511-8349-4296-8296-9EF098121639} - Exe - ConsoleApplication21.Module1 - ConsoleApplication21 - ConsoleApplication21 - 512 - Console - v3.5 - On - Binary - Off - On - - - true - full - true - true - bin\Debug\ - ConsoleApplication21.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - - - pdbonly - false - true - true - bin\Release\ - ConsoleApplication21.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - - - - - - - - 3.5 - - - 3.5 - - - 3.5 - - - - - - - - - - - - - - - - - - "; - string wfDev10ProjectFile = ObjectModelHelpers.CleanupFileContents(@" - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {280AE511-8349-4296-8296-9EF098121639} - Exe - ConsoleApplication21.Module1 - ConsoleApplication21 - ConsoleApplication21 - 512 - Console - v3.5 - On - Binary - Off - On - - - true - full - true - true - bin\Debug\ - ConsoleApplication21.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,42353,42354,42355 - - - pdbonly - false - true - true - bin\Release\ - ConsoleApplication21.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,42353,42354,42355 - - - - - - - - 3.5 - - - 3.5 - - - 3.5 - - - - - - - - - - - - - - - - - - "); - Helpers.ConvertAndCompare(wfWhidbeyProjectFile, wfDev10ProjectFile); - } - - #region VS2011 - - /// - /// A VS2010 C# project file which requires Repair - /// - [TestMethod] - public void ConvertVB2008RepairRequired() - { - string ProjectBefore = @" - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {C7234361-F078-473B-BCA0-2E62A6DE4D46} - {349c5851-65df-11da-9384-00065b846f21};{F184B08F-C81C-45F6-A57F-5ABD9991F28F} - Library - Vs2008Sp1_Wap_35_Vb - Vs2008Sp1_Wap_35_Vb - v3.5 - Custom - On - Binary - Off - On - - - true - full - true - true - bin\ - Vs2008Sp1_Wap_35_Vb.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - - - pdbonly - false - true - true - bin\ - Vs2008Sp1_Wap_35_Vb.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - - - - - - - 3.5 - - - 3.5 - - - 3.5 - - - 3.5 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ASPXCodeBehind - Default.aspx - - - Default.aspx - - - - True - Application.myapp - - - Microsoft.VisualBasic.Web.MyExtension - 1.0.0.0 - - - True - True - Resources.resx - - - True - Settings.settings - True - - - Site1.Master - - - Site1.Master - ASPXCodeBehind - - - WebForm1.aspx - - - WebForm1.aspx - ASPXCodebehind - - - - - VbMyResourcesResXFileCodeGenerator - Resources.Designer.vb - My.Resources - Designer - - - - - MyApplicationCodeGenerator - Application.Designer.vb - - - SettingsSingleFileGenerator - My - Settings.Designer.vb - - - - - - - - - - - - - - - False - True - 64194 - / - - - False - False - - - False - - - - -"; - - string ProjectAfter = ObjectModelHelpers.CleanupFileContents(@" - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {C7234361-F078-473B-BCA0-2E62A6DE4D46} - {349c5851-65df-11da-9384-00065b846f21};{F184B08F-C81C-45F6-A57F-5ABD9991F28F} - Library - Vs2008Sp1_Wap_35_Vb - Vs2008Sp1_Wap_35_Vb - v3.5 - Custom - On - Binary - Off - On - - - true - full - true - true - bin\ - Vs2008Sp1_Wap_35_Vb.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,42353,42354,42355 - - - pdbonly - false - true - true - bin\ - Vs2008Sp1_Wap_35_Vb.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,42353,42354,42355 - - - - - - - 3.5 - - - 3.5 - - - 3.5 - - - 3.5 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ASPXCodeBehind - Default.aspx - - - Default.aspx - - - - True - Application.myapp - - - Microsoft.VisualBasic.Web.MyExtension - 1.0.0.0 - - - True - True - Resources.resx - - - True - Settings.settings - True - - - Site1.Master - - - Site1.Master - ASPXCodeBehind - - - WebForm1.aspx - - - WebForm1.aspx - ASPXCodebehind - - - - - VbMyResourcesResXFileCodeGenerator - Resources.Designer.vb - My.Resources - Designer - - - - - MyApplicationCodeGenerator - Application.Designer.vb - - - SettingsSingleFileGenerator - My - Settings.Designer.vb - - - - - - - - - 10.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - - - - - - - False - True - 64194 - / - - - False - False - - - False - - - - -"); - - Helpers.ConvertAndCompare(ProjectBefore, ProjectAfter); - } - - /// - /// A VS2010 C# project file which requires Repair - /// - [TestMethod] - public void ConvertCSharp2010RepairRequired() - { - string ProjectBefore = @" - - - Debug - AnyCPU - - - 2.0 - {F4206430-F95D-4E52-B394-2E9E91EB362E} - {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - Dev10Solution_Dev10RepairRequired - Dev10Solution_Dev10RepairRequired - v4.0 - - - true - full - false - bin\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Web.config - - - Web.config - - - - - About.aspx - ASPXCodeBehind - - - About.aspx - - - ChangePassword.aspx - ASPXCodeBehind - - - ChangePassword.aspx - - - ChangePasswordSuccess.aspx - ASPXCodeBehind - - - ChangePasswordSuccess.aspx - - - Login.aspx - ASPXCodeBehind - - - Login.aspx - - - Register.aspx - ASPXCodeBehind - - - Register.aspx - - - Default.aspx - ASPXCodeBehind - - - Default.aspx - - - Global.asax - - - - Site.Master - ASPXCodeBehind - - - Site.Master - - - - - - - - - - - - - - - - False - True - 63975 - / - - - False - False - - - False - - - - - - "; - - string ProjectAfter = ObjectModelHelpers.CleanupFileContents(@" - - - - Debug - AnyCPU - - - 2.0 - {F4206430-F95D-4E52-B394-2E9E91EB362E} - {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - Dev10Solution_Dev10RepairRequired - Dev10Solution_Dev10RepairRequired - v4.0 - - - true - full - false - bin\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Web.config - - - Web.config - - - - - About.aspx - ASPXCodeBehind - - - About.aspx - - - ChangePassword.aspx - ASPXCodeBehind - - - ChangePassword.aspx - - - ChangePasswordSuccess.aspx - ASPXCodeBehind - - - ChangePasswordSuccess.aspx - - - Login.aspx - ASPXCodeBehind - - - Login.aspx - - - Register.aspx - ASPXCodeBehind - - - Register.aspx - - - Default.aspx - ASPXCodeBehind - - - Default.aspx - - - Global.asax - - - - Site.Master - ASPXCodeBehind - - - Site.Master - - - - - - - - - - - 10.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - - - - - - False - True - 63975 - / - - - False - False - - - False - - - - - - "); - - Helpers.ConvertAndCompare(ProjectBefore, ProjectAfter); - } - - /// - /// A VS2010 Deploy project file which requires is no longer supported - /// - [TestMethod] - public void VS2010DeployProjectDeprecated() - { - string ProjectBefore = @" - ""DeployProject"" - { - ""VSVersion"" = ""3:800"" - ""ProjectType"" = ""8:{978C614F-708E-4E1A-B201-565925725DBA}"" - ""IsWebType"" = ""8:FALSE"" - ""ProjectName"" = ""8:Dev10Dep1"" - ""LanguageId"" = ""3:1033"" - ""CodePage"" = ""3:1252"" - ""UILanguageId"" = ""3:1033"" - ""SccProjectName"" = ""8:"" - ""SccLocalPath"" = ""8:"" - ""SccAuxPath"" = ""8:"" - ""SccProvider"" = ""8:"" - ""Hierarchy"" - { - } - ""Configurations"" - { - ""Debug"" - { - ""DisplayName"" = ""8:Debug"" - ""IsDebugOnly"" = ""11:TRUE"" - ""IsReleaseOnly"" = ""11:FALSE"" - ""OutputFilename"" = ""8:Debug\\Dev10Dep1.msi"" - ""PackageFilesAs"" = ""3:2"" - ""PackageFileSize"" = ""3:-2147483648"" - ""CabType"" = ""3:1"" - ""Compression"" = ""3:2"" - ""SignOutput"" = ""11:FALSE"" - ""CertificateFile"" = ""8:"" - ""PrivateKeyFile"" = ""8:"" - ""TimeStampServer"" = ""8:"" - ""InstallerBootstrapper"" = ""3:2"" - } - ""Release"" - { - ""DisplayName"" = ""8:Release"" - ""IsDebugOnly"" = ""11:FALSE"" - ""IsReleaseOnly"" = ""11:TRUE"" - ""OutputFilename"" = ""8:Release\\Dev10Dep1.msi"" - ""PackageFilesAs"" = ""3:2"" - ""PackageFileSize"" = ""3:-2147483648"" - ""CabType"" = ""3:1"" - ""Compression"" = ""3:2"" - ""SignOutput"" = ""11:FALSE"" - ""CertificateFile"" = ""8:"" - ""PrivateKeyFile"" = ""8:"" - ""TimeStampServer"" = ""8:"" - ""InstallerBootstrapper"" = ""3:2"" - } - } - ""Deployable"" - { - ""CustomAction"" - { - } - ""DefaultFeature"" - { - ""Name"" = ""8:DefaultFeature"" - ""Title"" = ""8:"" - ""Description"" = ""8:"" - } - ""ExternalPersistence"" - { - ""LaunchCondition"" - { - } - } - ""File"" - { - } - ""FileType"" - { - } - ""Folder"" - { - ""{1525181F-901A-416C-8A58-119130FE478E}:_0AA7A53E511C4817B4948E95C0DF4664"" - { - ""Name"" = ""8:#1919"" - ""AlwaysCreate"" = ""11:FALSE"" - ""Condition"" = ""8:"" - ""Transitive"" = ""11:FALSE"" - ""Property"" = ""8:ProgramMenuFolder"" - ""Folders"" - { - } - } - ""{3C67513D-01DD-4637-8A68-80971EB9504F}:_1B395C1DD72D471891B8440A6A066FE5"" - { - ""DefaultLocation"" = ""8:[ProgramFilesFolder][Manufacturer]\\[ProductName]"" - ""Name"" = ""8:#1925"" - ""AlwaysCreate"" = ""11:FALSE"" - ""Condition"" = ""8:"" - ""Transitive"" = ""11:FALSE"" - ""Property"" = ""8:TARGETDIR"" - ""Folders"" - { - } - } - ""{1525181F-901A-416C-8A58-119130FE478E}:_D6EBF35E5CC343C290FAE28008DC6E7E"" - { - ""Name"" = ""8:#1916"" - ""AlwaysCreate"" = ""11:FALSE"" - ""Condition"" = ""8:"" - ""Transitive"" = ""11:FALSE"" - ""Property"" = ""8:DesktopFolder"" - ""Folders"" - { - } - } - } - ""LaunchCondition"" - { - } - ""Locator"" - { - } - ""MsiBootstrapper"" - { - ""LangId"" = ""3:1033"" - ""RequiresElevation"" = ""11:FALSE"" - } - ""Product"" - { - ""Name"" = ""8:Microsoft Visual Studio"" - ""ProductName"" = ""8:Dev10Dep1"" - ""ProductCode"" = ""8:{43FB18EF-67AC-473C-AD2A-DC07B7ABF16F}"" - ""PackageCode"" = ""8:{4C46BDB8-9AB2-4369-83CF-203DF67A3561}"" - ""UpgradeCode"" = ""8:{730CFD38-8449-4AFE-AED2-B34234601C56}"" - ""AspNetVersion"" = ""8:4.0.30319.0"" - ""RestartWWWService"" = ""11:FALSE"" - ""RemovePreviousVersions"" = ""11:FALSE"" - ""DetectNewerInstalledVersion"" = ""11:TRUE"" - ""InstallAllUsers"" = ""11:FALSE"" - ""ProductVersion"" = ""8:1.0.0"" - ""Manufacturer"" = ""8:Microsoft"" - ""ARPHELPTELEPHONE"" = ""8:"" - ""ARPHELPLINK"" = ""8:"" - ""Title"" = ""8:Dev10Dep1"" - ""Subject"" = ""8:"" - ""ARPCONTACT"" = ""8:Microsoft"" - ""Keywords"" = ""8:"" - ""ARPCOMMENTS"" = ""8:"" - ""ARPURLINFOABOUT"" = ""8:"" - ""ARPPRODUCTICON"" = ""8:"" - ""ARPIconIndex"" = ""3:0"" - ""SearchPath"" = ""8:"" - ""UseSystemSearchPath"" = ""11:TRUE"" - ""TargetPlatform"" = ""3:0"" - ""PreBuildEvent"" = ""8:"" - ""PostBuildEvent"" = ""8:"" - ""RunPostBuildEvent"" = ""3:0"" - } - ""Registry"" - { - ""HKLM"" - { - ""Keys"" - { - ""{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_AC44CB3A56164C5FB678594056AC8A01"" - { - ""Name"" = ""8:Software"" - ""Condition"" = ""8:"" - ""AlwaysCreate"" = ""11:FALSE"" - ""DeleteAtUninstall"" = ""11:FALSE"" - ""Transitive"" = ""11:FALSE"" - ""Keys"" - { - ""{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_8703E97B5EFC4DFB87EDC467D0E61560"" - { - ""Name"" = ""8:[Manufacturer]"" - ""Condition"" = ""8:"" - ""AlwaysCreate"" = ""11:FALSE"" - ""DeleteAtUninstall"" = ""11:FALSE"" - ""Transitive"" = ""11:FALSE"" - ""Keys"" - { - } - ""Values"" - { - } - } - } - ""Values"" - { - } - } - } - } - ""HKCU"" - { - ""Keys"" - { - ""{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_5BD957DCAAEA4AE49C46557E3D4B4076"" - { - ""Name"" = ""8:Software"" - ""Condition"" = ""8:"" - ""AlwaysCreate"" = ""11:FALSE"" - ""DeleteAtUninstall"" = ""11:FALSE"" - ""Transitive"" = ""11:FALSE"" - ""Keys"" - { - ""{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_C51959C240B141E4B5DC7F3CB358EB03"" - { - ""Name"" = ""8:[Manufacturer]"" - ""Condition"" = ""8:"" - ""AlwaysCreate"" = ""11:FALSE"" - ""DeleteAtUninstall"" = ""11:FALSE"" - ""Transitive"" = ""11:FALSE"" - ""Keys"" - { - } - ""Values"" - { - } - } - } - ""Values"" - { - } - } - } - } - ""HKCR"" - { - ""Keys"" - { - } - } - ""HKU"" - { - ""Keys"" - { - } - } - ""HKPU"" - { - ""Keys"" - { - } - } - } - ""Sequences"" - { - } - ""Shortcut"" - { - } - ""UserInterface"" - { - ""{2479F3F5-0309-486D-8047-8187E2CE5BA0}:_1D4A4CE12E704A68BF617F9EBBD6DE62"" - { - ""UseDynamicProperties"" = ""11:FALSE"" - ""IsDependency"" = ""11:FALSE"" - ""SourcePath"" = ""8:\\VsdBasicDialogs.wim"" - } - ""{DF760B10-853B-4699-99F2-AFF7185B4A62}:_3E838CB7B9B14D41B3A0BC24E5D1A219"" - { - ""Name"" = ""8:#1901"" - ""Sequence"" = ""3:2"" - ""Attributes"" = ""3:2"" - ""Dialogs"" - { - ""{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_01573A9060964A069C78FD9E40D8706F"" - { - ""Sequence"" = ""3:100"" - ""DisplayName"" = ""8:Progress"" - ""UseDynamicProperties"" = ""11:TRUE"" - ""IsDependency"" = ""11:FALSE"" - ""SourcePath"" = ""8:\\VsdAdminProgressDlg.wid"" - ""Properties"" - { - ""BannerBitmap"" - { - ""Name"" = ""8:BannerBitmap"" - ""DisplayName"" = ""8:#1001"" - ""Description"" = ""8:#1101"" - ""Type"" = ""3:8"" - ""ContextData"" = ""8:Bitmap"" - ""Attributes"" = ""3:4"" - ""Setting"" = ""3:1"" - ""UsePlugInResources"" = ""11:TRUE"" - } - ""ShowProgress"" - { - ""Name"" = ""8:ShowProgress"" - ""DisplayName"" = ""8:#1009"" - ""Description"" = ""8:#1109"" - ""Type"" = ""3:5"" - ""ContextData"" = ""8:1;True=1;False=0"" - ""Attributes"" = ""3:0"" - ""Setting"" = ""3:0"" - ""Value"" = ""3:1"" - ""DefaultValue"" = ""3:1"" - ""UsePlugInResources"" = ""11:TRUE"" - } - } - } - } - } - ""{DF760B10-853B-4699-99F2-AFF7185B4A62}:_490F3627B9214CCEA509B6126EBAA586"" - { - ""Name"" = ""8:#1901"" - ""Sequence"" = ""3:1"" - ""Attributes"" = ""3:2"" - ""Dialogs"" - { - ""{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_42E52D514DE041D58DEEE621DA18551D"" - { - ""Sequence"" = ""3:100"" - ""DisplayName"" = ""8:Progress"" - ""UseDynamicProperties"" = ""11:TRUE"" - ""IsDependency"" = ""11:FALSE"" - ""SourcePath"" = ""8:\\VsdProgressDlg.wid"" - ""Properties"" - { - ""BannerBitmap"" - { - ""Name"" = ""8:BannerBitmap"" - ""DisplayName"" = ""8:#1001"" - ""Description"" = ""8:#1101"" - ""Type"" = ""3:8"" - ""ContextData"" = ""8:Bitmap"" - ""Attributes"" = ""3:4"" - ""Setting"" = ""3:1"" - ""UsePlugInResources"" = ""11:TRUE"" - } - ""ShowProgress"" - { - ""Name"" = ""8:ShowProgress"" - ""DisplayName"" = ""8:#1009"" - ""Description"" = ""8:#1109"" - ""Type"" = ""3:5"" - ""ContextData"" = ""8:1;True=1;False=0"" - ""Attributes"" = ""3:0"" - ""Setting"" = ""3:0"" - ""Value"" = ""3:1"" - ""DefaultValue"" = ""3:1"" - ""UsePlugInResources"" = ""11:TRUE"" - } - } - } - } - } - ""{DF760B10-853B-4699-99F2-AFF7185B4A62}:_79632A079AC34475B054FB01EE83F43E"" - { - ""Name"" = ""8:#1902"" - ""Sequence"" = ""3:1"" - ""Attributes"" = ""3:3"" - ""Dialogs"" - { - ""{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_65FEFF54A86446E0A331A5DAB110A495"" - { - ""Sequence"" = ""3:100"" - ""DisplayName"" = ""8:Finished"" - ""UseDynamicProperties"" = ""11:TRUE"" - ""IsDependency"" = ""11:FALSE"" - ""SourcePath"" = ""8:\\VsdFinishedDlg.wid"" - ""Properties"" - { - ""BannerBitmap"" - { - ""Name"" = ""8:BannerBitmap"" - ""DisplayName"" = ""8:#1001"" - ""Description"" = ""8:#1101"" - ""Type"" = ""3:8"" - ""ContextData"" = ""8:Bitmap"" - ""Attributes"" = ""3:4"" - ""Setting"" = ""3:1"" - ""UsePlugInResources"" = ""11:TRUE"" - } - ""UpdateText"" - { - ""Name"" = ""8:UpdateText"" - ""DisplayName"" = ""8:#1058"" - ""Description"" = ""8:#1158"" - ""Type"" = ""3:15"" - ""ContextData"" = ""8:"" - ""Attributes"" = ""3:0"" - ""Setting"" = ""3:1"" - ""Value"" = ""8:#1258"" - ""DefaultValue"" = ""8:#1258"" - ""UsePlugInResources"" = ""11:TRUE"" - } - } - } - } - } - ""{DF760B10-853B-4699-99F2-AFF7185B4A62}:_920D0874C0714728A52B67391F321564"" - { - ""Name"" = ""8:#1902"" - ""Sequence"" = ""3:2"" - ""Attributes"" = ""3:3"" - ""Dialogs"" - { - ""{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_68C15B16DFB74BF895B444A1E7F2A2E5"" - { - ""Sequence"" = ""3:100"" - ""DisplayName"" = ""8:Finished"" - ""UseDynamicProperties"" = ""11:TRUE"" - ""IsDependency"" = ""11:FALSE"" - ""SourcePath"" = ""8:\\VsdAdminFinishedDlg.wid"" - ""Properties"" - { - ""BannerBitmap"" - { - ""Name"" = ""8:BannerBitmap"" - ""DisplayName"" = ""8:#1001"" - ""Description"" = ""8:#1101"" - ""Type"" = ""3:8"" - ""ContextData"" = ""8:Bitmap"" - ""Attributes"" = ""3:4"" - ""Setting"" = ""3:1"" - ""UsePlugInResources"" = ""11:TRUE"" - } - } - } - } - } - ""{DF760B10-853B-4699-99F2-AFF7185B4A62}:_CA216A037F2D49CABBA5C5230D50CA17"" - { - ""Name"" = ""8:#1900"" - ""Sequence"" = ""3:2"" - ""Attributes"" = ""3:1"" - ""Dialogs"" - { - ""{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_60BE1685AB5C48A8974B528786607841"" - { - ""Sequence"" = ""3:100"" - ""DisplayName"" = ""8:Welcome"" - ""UseDynamicProperties"" = ""11:TRUE"" - ""IsDependency"" = ""11:FALSE"" - ""SourcePath"" = ""8:\\VsdAdminWelcomeDlg.wid"" - ""Properties"" - { - ""BannerBitmap"" - { - ""Name"" = ""8:BannerBitmap"" - ""DisplayName"" = ""8:#1001"" - ""Description"" = ""8:#1101"" - ""Type"" = ""3:8"" - ""ContextData"" = ""8:Bitmap"" - ""Attributes"" = ""3:4"" - ""Setting"" = ""3:1"" - ""UsePlugInResources"" = ""11:TRUE"" - } - ""CopyrightWarning"" - { - ""Name"" = ""8:CopyrightWarning"" - ""DisplayName"" = ""8:#1002"" - ""Description"" = ""8:#1102"" - ""Type"" = ""3:3"" - ""ContextData"" = ""8:"" - ""Attributes"" = ""3:0"" - ""Setting"" = ""3:1"" - ""Value"" = ""8:#1202"" - ""DefaultValue"" = ""8:#1202"" - ""UsePlugInResources"" = ""11:TRUE"" - } - ""Welcome"" - { - ""Name"" = ""8:Welcome"" - ""DisplayName"" = ""8:#1003"" - ""Description"" = ""8:#1103"" - ""Type"" = ""3:3"" - ""ContextData"" = ""8:"" - ""Attributes"" = ""3:0"" - ""Setting"" = ""3:1"" - ""Value"" = ""8:#1203"" - ""DefaultValue"" = ""8:#1203"" - ""UsePlugInResources"" = ""11:TRUE"" - } - } - } - ""{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_C1CA957AC4194CAE8883139CCE319BD8"" - { - ""Sequence"" = ""3:300"" - ""DisplayName"" = ""8:Confirm Installation"" - ""UseDynamicProperties"" = ""11:TRUE"" - ""IsDependency"" = ""11:FALSE"" - ""SourcePath"" = ""8:\\VsdAdminConfirmDlg.wid"" - ""Properties"" - { - ""BannerBitmap"" - { - ""Name"" = ""8:BannerBitmap"" - ""DisplayName"" = ""8:#1001"" - ""Description"" = ""8:#1101"" - ""Type"" = ""3:8"" - ""ContextData"" = ""8:Bitmap"" - ""Attributes"" = ""3:4"" - ""Setting"" = ""3:1"" - ""UsePlugInResources"" = ""11:TRUE"" - } - } - } - ""{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_E4416625D6DF4973918800B4910BC20D"" - { - ""Sequence"" = ""3:200"" - ""DisplayName"" = ""8:Installation Folder"" - ""UseDynamicProperties"" = ""11:TRUE"" - ""IsDependency"" = ""11:FALSE"" - ""SourcePath"" = ""8:\\VsdAdminFolderDlg.wid"" - ""Properties"" - { - ""BannerBitmap"" - { - ""Name"" = ""8:BannerBitmap"" - ""DisplayName"" = ""8:#1001"" - ""Description"" = ""8:#1101"" - ""Type"" = ""3:8"" - ""ContextData"" = ""8:Bitmap"" - ""Attributes"" = ""3:4"" - ""Setting"" = ""3:1"" - ""UsePlugInResources"" = ""11:TRUE"" - } - } - } - } - } - ""{DF760B10-853B-4699-99F2-AFF7185B4A62}:_DA1AB83886AE4E3ABF481FD039BBC368"" - { - ""Name"" = ""8:#1900"" - ""Sequence"" = ""3:1"" - ""Attributes"" = ""3:1"" - ""Dialogs"" - { - ""{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_1A17192A8B1B42AD8834821D94C34422"" - { - ""Sequence"" = ""3:100"" - ""DisplayName"" = ""8:Welcome"" - ""UseDynamicProperties"" = ""11:TRUE"" - ""IsDependency"" = ""11:FALSE"" - ""SourcePath"" = ""8:\\VsdWelcomeDlg.wid"" - ""Properties"" - { - ""BannerBitmap"" - { - ""Name"" = ""8:BannerBitmap"" - ""DisplayName"" = ""8:#1001"" - ""Description"" = ""8:#1101"" - ""Type"" = ""3:8"" - ""ContextData"" = ""8:Bitmap"" - ""Attributes"" = ""3:4"" - ""Setting"" = ""3:1"" - ""UsePlugInResources"" = ""11:TRUE"" - } - ""CopyrightWarning"" - { - ""Name"" = ""8:CopyrightWarning"" - ""DisplayName"" = ""8:#1002"" - ""Description"" = ""8:#1102"" - ""Type"" = ""3:3"" - ""ContextData"" = ""8:"" - ""Attributes"" = ""3:0"" - ""Setting"" = ""3:1"" - ""Value"" = ""8:#1202"" - ""DefaultValue"" = ""8:#1202"" - ""UsePlugInResources"" = ""11:TRUE"" - } - ""Welcome"" - { - ""Name"" = ""8:Welcome"" - ""DisplayName"" = ""8:#1003"" - ""Description"" = ""8:#1103"" - ""Type"" = ""3:3"" - ""ContextData"" = ""8:"" - ""Attributes"" = ""3:0"" - ""Setting"" = ""3:1"" - ""Value"" = ""8:#1203"" - ""DefaultValue"" = ""8:#1203"" - ""UsePlugInResources"" = ""11:TRUE"" - } - } - } - ""{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_31F1ACFF32E94780B48F7ED10871CAEE"" - { - ""Sequence"" = ""3:300"" - ""DisplayName"" = ""8:Confirm Installation"" - ""UseDynamicProperties"" = ""11:TRUE"" - ""IsDependency"" = ""11:FALSE"" - ""SourcePath"" = ""8:\\VsdConfirmDlg.wid"" - ""Properties"" - { - ""BannerBitmap"" - { - ""Name"" = ""8:BannerBitmap"" - ""DisplayName"" = ""8:#1001"" - ""Description"" = ""8:#1101"" - ""Type"" = ""3:8"" - ""ContextData"" = ""8:Bitmap"" - ""Attributes"" = ""3:4"" - ""Setting"" = ""3:1"" - ""UsePlugInResources"" = ""11:TRUE"" - } - } - } - ""{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_332BF9E1EFDA4D12BFD34DA8CC44F337"" - { - ""Sequence"" = ""3:200"" - ""DisplayName"" = ""8:Installation Folder"" - ""UseDynamicProperties"" = ""11:TRUE"" - ""IsDependency"" = ""11:FALSE"" - ""SourcePath"" = ""8:\\VsdFolderDlg.wid"" - ""Properties"" - { - ""BannerBitmap"" - { - ""Name"" = ""8:BannerBitmap"" - ""DisplayName"" = ""8:#1001"" - ""Description"" = ""8:#1101"" - ""Type"" = ""3:8"" - ""ContextData"" = ""8:Bitmap"" - ""Attributes"" = ""3:4"" - ""Setting"" = ""3:1"" - ""UsePlugInResources"" = ""11:TRUE"" - } - ""InstallAllUsersVisible"" - { - ""Name"" = ""8:InstallAllUsersVisible"" - ""DisplayName"" = ""8:#1059"" - ""Description"" = ""8:#1159"" - ""Type"" = ""3:5"" - ""ContextData"" = ""8:1;True=1;False=0"" - ""Attributes"" = ""3:0"" - ""Setting"" = ""3:0"" - ""Value"" = ""3:1"" - ""DefaultValue"" = ""3:1"" - ""UsePlugInResources"" = ""11:TRUE"" - } - } - } - } - } - ""{2479F3F5-0309-486D-8047-8187E2CE5BA0}:_DF8B5EA652E34B8EB3D051F927859B9B"" - { - ""UseDynamicProperties"" = ""11:FALSE"" - ""IsDependency"" = ""11:FALSE"" - ""SourcePath"" = ""8:\\VsdUserInterface.wim"" - } - } - ""MergeModule"" - { - } - ""ProjectOutput"" - { - } - } - } - "; - - try - { - Helpers.ConvertAndCompare(ProjectBefore, ProjectBefore); - Assert.Fail("There should have been a Microsoft.Build.Exceptions.InvalidProjectFileException"); - } - catch (Exception e) - { - Assert.IsInstanceOfType(e, typeof(Microsoft.Build.Exceptions.InvalidProjectFileException)); - } - } - - - /// - /// A VS2010 C# project file which requires no changes Repair - /// - [TestMethod] - public void ConvertCSharp2010NoChangeRequired() - { - string ProjectBefore = @" - - - Debug - x86 - 8.0.30703 - 2.0 - {D97016B8-9FB6-4D56-A90E-C3DFD38AC032} - Exe - Properties - Dev10SolutionDev10VanillaProject - Dev10SolutionDev10VanillaProject - v4.0 - Client - 512 - - - x86 - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - x86 - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - "; - - Helpers.ConvertAndCompare(ProjectBefore, ProjectBefore); - } - - /// - /// A VS2003 C# project file which requires conversion - /// - [TestMethod] - public void ConvertCSharp2003ConversionRequired() - { - string ProjectBefore = @" - - - - - - - - - - - - - - - - - - - - - - "; - - string ProjectAfter = ObjectModelHelpers.CleanupFileContents(@" - - - Local - 7.10.6030 - 2.0 - {C455AB6F-933F-441D-ABF8-D2F3FDA8CDA2} - Debug - AnyCPU - - - ClassLibrary1 - - JScript - Grid - IE50 - false - Library - ClassLibrary1 - OnBuildSuccess - - 20 - - - bin\Debug\ - false - 285212672 - false - - DEBUG;TRACE - - true - 4096 - false - - false - false - false - false - 4 - full - prompt - - - bin\Release\ - false - 285212672 - false - - TRACE - - false - 4096 - false - - true - false - false - false - 4 - none - prompt - - - - System - - - System.Data - - - System.XML - - - - - Code - - - Code - - - - - - - - - "); - - Helpers.ConvertAndCompare(ProjectBefore, ProjectAfter); - } - - /// - /// A VS2005 VB project file which requires conversion - /// - [TestMethod] - public void ConvertVB2005ConversionRequired() - { - string ProjectBefore = @" - - - Debug - AnyCPU - 8.0.50727 - 2.0 - {F23FE10A-EE6B-4800-8CFB-9CA07DA2D358} - Library - Vs2005_ClassLib_20_Vb - Vs2005_ClassLib_20_Vb - Windows - - - true - full - true - true - bin\Debug\ - Vs2005_ClassLib_20_Vb.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - - - pdbonly - false - true - true - bin\Release\ - Vs2005_ClassLib_20_Vb.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - - - - - - - - - - - - - - - - - - - True - Application.myapp - - - True - True - Resources.resx - - - True - Settings.settings - True - - - - - VbMyResourcesResXFileCodeGenerator - Resources.Designer.vb - My.Resources - Designer - - - - - MyApplicationCodeGenerator - Application.Designer.vb - - - SettingsSingleFileGenerator - My - Settings.Designer.vb - - - - "; - - string ProjectAfter = ObjectModelHelpers.CleanupFileContents(@" - - - Debug - AnyCPU - 8.0.50727 - 2.0 - {F23FE10A-EE6B-4800-8CFB-9CA07DA2D358} - Library - Vs2005_ClassLib_20_Vb - Vs2005_ClassLib_20_Vb - Windows - - - true - full - true - true - bin\Debug\ - Vs2005_ClassLib_20_Vb.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - - - pdbonly - false - true - true - bin\Release\ - Vs2005_ClassLib_20_Vb.xml - 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 - - - - - - - - - - - - - - - - - - - True - Application.myapp - - - True - True - Resources.resx - - - True - Settings.settings - True - - - - - VbMyResourcesResXFileCodeGenerator - Resources.Designer.vb - My.Resources - Designer - - - - - MyApplicationCodeGenerator - Application.Designer.vb - - - SettingsSingleFileGenerator - My - Settings.Designer.vb - - - - "); - - Helpers.ConvertAndCompare(ProjectBefore, ProjectAfter); - } - - /// - /// A VS2005 VB project file which requires conversion - /// - [TestMethod] - public void ConvertCS2005ExcelProjectConversionRequired() - { - string projectBefore = - @" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "; - - string projectAfter = ObjectModelHelpers.CleanupFileContents(@" - - - Local - 7.10.3077 - 2.0 - {3CACC4D8-8DC1-418E-BB2C-3F9F60ECB2A5} - Debug - AnyCPU - - - BasicExcel - - JScript - Grid - IE50 - false - Library - BasicExcel - OnBuildSuccess - - {BAA0C2D2-18E2-41B9-852F-F413020CAA33};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 20 - - - bin\Debug\ - false - 285212672 - false - - DEBUG;TRACE - - true - 4096 - false - - false - false - false - false - 4 - full - prompt - - - bin\Release\ - false - 285212672 - false - - TRACE - - false - 4096 - false - - true - false - false - false - 4 - none - prompt - - - - {00020813-0000-0000-C000-000000000046} - 1 - 5 - 0 - primary - - - {2DF8D04C-5BFA-101B-BDE5-00AA0044DE52} - 2 - 3 - 0 - primary - - - {0D452EE1-E08F-101A-852E-02608C4D0BB4} - 2 - 0 - 0 - primary - - - {0002E157-0000-0000-C000-000000000046} - 5 - 3 - 0 - primary - - - System - - - System.Data - - - System.Windows.Forms - - - System.XML - - - - - Code - - - Code - - - - - - - - - - - - - - - - - ") - ; - - Helpers.ConvertAndCompare(projectBefore, projectAfter); - } - - /// - /// Check that when we're upgrading projects referencing and compiling .xaml source files - /// we are correctly appending Generator and Subtype properties to the source file and not the - /// reference - /// Check also that project references to vcproj have their extensions fixed to .vcxproj - /// - [TestMethod] - public void CheckForReferencesReplacements() - { - string ProjectBefore = @" - - - - - - - - - - {a289b3a9-e10c-4bb8-8814-18faf19ec92d} - SampeProject - - - {a289b3a9-e10c-4bb8-8814-18faf19ec92e} - SampeProject2 - - - - - - - "; - - string ProjectAfter = ObjectModelHelpers.CleanupFileContents(@" - - - - - - - - - - {a289b3a9-e10c-4bb8-8814-18faf19ec92d} - SampeProject - - - {a289b3a9-e10c-4bb8-8814-18faf19ec92e} - SampeProject2 - - - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - "); - - Helpers.ConvertAndCompare(ProjectBefore, ProjectAfter); - } - - /// - /// Check that when we're upgrading projects referencing and compiling .xaml source files - /// we are correctly appending Generator and Subtype properties to the source file and not the - /// reference - /// - /// Check also that project references to vcproj have their extensions fixed to .vcxproj - /// - /// Lastly, make sure that this still happens even if the ToolsVersion is > 3.5. - /// - [TestMethod] - public void CheckForReferencesReplacements_NewerToolsVersion() - { - string ProjectBefore = @" - - - - - - - - - - {a289b3a9-e10c-4bb8-8814-18faf19ec92d} - SampeProject - - - {a289b3a9-e10c-4bb8-8814-18faf19ec92e} - SampeProject2 - - - - - - - "; - - string ProjectAfter = ObjectModelHelpers.CleanupFileContents(@" - - - - - - - - - - {a289b3a9-e10c-4bb8-8814-18faf19ec92d} - SampeProject - - - {a289b3a9-e10c-4bb8-8814-18faf19ec92e} - SampeProject2 - - - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - "); - - Helpers.ConvertAndCompare(ProjectBefore, ProjectAfter); - } - - /// - /// Check that when we're upgrading projects referencing and compiling .xaml source files - /// that we don't append the Generator and SubType properties to the source file if they - /// are already set. - /// - [TestMethod] - public void DoNotReplacePreExistingXamlProperties() - { - string ProjectBefore = @" - - - - - - - - - - {a289b3a9-e10c-4bb8-8814-18faf19ec92d} - SampeProject - - - {a289b3a9-e10c-4bb8-8814-18faf19ec92e} - SampeProject2 - - - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - "; - - string ProjectAfter = ObjectModelHelpers.CleanupFileContents(@" - - - - - - - - - - {a289b3a9-e10c-4bb8-8814-18faf19ec92d} - SampeProject - - - {a289b3a9-e10c-4bb8-8814-18faf19ec92e} - SampeProject2 - - - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - "); - - Helpers.ConvertAndCompare(ProjectBefore, ProjectAfter); - } - - /// - /// Check that when we're upgrading projects referencing and compiling .xaml source files - /// that even if there are multiple instances of the metadata, we don't eliminate them -- - /// we just also don't add any more. - /// - [TestMethod] - public void DontEliminateDuplicateXamlProperties() - { - string ProjectBefore = @" - - - - - - - - - - {a289b3a9-e10c-4bb8-8814-18faf19ec92d} - SampeProject - - - {a289b3a9-e10c-4bb8-8814-18faf19ec92e} - SampeProject2 - - - - - MSBuild:Compile - MSBuild:Compile - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - Designer - Designer - Designer - - - MSBuild:Compile - Designer - MSBuild:Compile - Designer - Designer - - - "; - - string ProjectAfter = ObjectModelHelpers.CleanupFileContents(@" - - - - - - - - - - {a289b3a9-e10c-4bb8-8814-18faf19ec92d} - SampeProject - - - {a289b3a9-e10c-4bb8-8814-18faf19ec92e} - SampeProject2 - - - - - MSBuild:Compile - MSBuild:Compile - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - Designer - Designer - Designer - - - MSBuild:Compile - Designer - MSBuild:Compile - Designer - Designer - - - "); - - Helpers.ConvertAndCompare(ProjectBefore, ProjectAfter); - } - - /// - /// Check that when we're upgrading projects referencing and compiling .xaml source files - /// that already have Generator and Subtype metadata, we don't make any changes and - /// don't update the ToolsVersion. - /// - [TestMethod] - public void DontUpdateToolsVersionIfNothingChanged() - { - string ProjectBeforeAndAfter = ObjectModelHelpers.CleanupFileContents(@" - - - - - - - - - - MSBuild:Compile - MSBuild:Compile - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - MSBuild:Compile - Designer - Designer - - - "); - - Helpers.ConvertAndCompare(ProjectBeforeAndAfter, ProjectBeforeAndAfter); - } - - #endregion - - [TestMethod] - public void MinorUpgradeShouldNotUpdateToolsVersion() - { - string ProjectBefore = @" - - - - "; - - string ProjectAfterByDefault = ObjectModelHelpers.CleanupFileContents(@" - - - - 10.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - - "); - - Helpers.ConvertAndCompare(ProjectBefore, ProjectAfterByDefault); - - string ProjectAfterMinorUpgrade = @" - - - - 10.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - - "; - - Helpers.ConvertAndCompare(ProjectBefore, ProjectAfterMinorUpgrade, null, isMinorUpgrade: true); - } - } -} diff --git a/src/Deprecated/Conversion.UnitTests/XMakeConversionUnitTests.csproj b/src/Deprecated/Conversion.UnitTests/XMakeConversionUnitTests.csproj deleted file mode 100644 index de178a504d3..00000000000 --- a/src/Deprecated/Conversion.UnitTests/XMakeConversionUnitTests.csproj +++ /dev/null @@ -1,97 +0,0 @@ - - - - $([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), Build.props))\Build.props - - - - - - true - true - - - - - - $(SuiteBinPath) - library - Microsoft.Build.Conversion.Unittest - true - SAK - SAK - SAK - SAK - $(BuildArchitecturesAllowed);amd64;arm - - - - {9BDEE040-06EC-48F1-81A6-CDA7AA98CADA} - {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - - $(NoWarn);0618 - - - - - - - - - - - - - - {3F1F7307-EE89-4110-B636-BDE1E45358C4} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - XMakeBuildEngine - Needs 'microsoft.build.dll' - true - - - {D21C4Bf9-E131-4ACB-8960-794797f19A39} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - OrcasEngine - Needs 'microsoft.build.engine.dll' - true - - - {653E79B4-118B-4E0A-9E34-8EB30E5E0881} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Utilities %28components\xmake\Framework\Utilities%29 - Needs 'microsoft.build.utilities.v12.0.dll' - - - {784BF121-CE8F-4314-AA55-E86AB61670FE} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Framework %28components\xmake\Framework\Framework%29 - Needs 'microsoft.build.framework.dll' - true - - - {5274C277-F122-4a44-B7A0-00A1B3F39803} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - XMakeConversion - Needs 'microsoft.build.conversion.v12.0.dll' - - - - - - - - true - - - - - - - - - - - diff --git a/src/Deprecated/Conversion/AdditionalOptionsParser.cs b/src/Deprecated/Conversion/AdditionalOptionsParser.cs deleted file mode 100644 index 422ae5277e6..00000000000 --- a/src/Deprecated/Conversion/AdditionalOptionsParser.cs +++ /dev/null @@ -1,443 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections; -using System.Text; -using System.Diagnostics; -using System.Globalization; -using Microsoft.Build.Construction; - -namespace Microsoft.Build.Conversion -{ - /// - /// Only these switches will be migrated. - /// This enum doesnt have any use, except to explicitly list the compiler - /// options in AdditionalOptions project property that will be migrated - /// - internal enum SwitchesToMigrate - { - STM_CodePage, - STM_DisableLangExtensions, - STM_Jcpa, - STM_LinkResource, - STM_SecureScoping, - STM_Win32Resource, - }; - - /// - /// These are types of values associated with the switches - /// - internal enum SwitchValueType - { - /// - /// Boolean value - /// - SVT_Boolean, - - /// - /// String value - /// - SVT_String, - - /// - /// This switch can occur multiple times and the - /// final value is the ';' delimeted concat of all the - /// individual occurrences - /// - SVT_MultiString, - } - - /// - /// This class contains the migration info for a switch - /// that we want to migrate - /// - internal sealed class CompSwitchInfo - { - /// - /// This is the internal switch identifier - /// Examples: - /// 1. STM_SecureScoping - /// - internal SwitchesToMigrate Switch; - - /// - /// This is the string passed to the compiler - /// Examples: - /// 1. /ss, /securescoping - /// 2. @ - /// - internal string[] SwitchIDs; - - /// - /// This is the type of the value associated with the switch - /// Examples: - /// 1. SVT_Boolean - /// 2. SVT_MultiString - /// - internal SwitchValueType SwitchValueType; - - /// - /// This is the final value of the switch - /// 1. true - /// 2. "path-a;path-b\\file-b" - /// - internal object SwitchValue; - - /// - /// This is the name of property in the project file in which the - /// value of this switch is stored - /// - internal string SwitchProjectPropertyName; - - /// - /// The constructor - /// - internal CompSwitchInfo( - SwitchesToMigrate switchStr, - string[] switchIDs, - SwitchValueType switchValueType, - object switchValue, - string switchProjectPropertyName - ) - { - this.Switch = switchStr; - this.SwitchIDs = switchIDs; - this.SwitchValueType = switchValueType; - this.SwitchValue = switchValue; - this.SwitchProjectPropertyName = switchProjectPropertyName; - } - } - - /// - /// - /// Class: AdditionalOptionsParser - /// Owner: ParthaD - /// - /// This class contains the logic to parse the AdditionalOptions project - /// property of v7.x J# projects and add the individual options as project - /// properties of the upgraded projects. - /// - /// AdditionalOptions project property in v7.x was basically a string that - /// was passed ditto to the compiler. - /// It was used to hold J# compiler options that didnt have an 1-1 equivalent - /// project property. - /// For v8.0 and beyond, each J# compiler option has a corresponding project - /// property. - /// - /// AdditionalOptions property string is broken down into list of options. - /// White space (only ' ' and '\t') are considered as delimiters if not wrapped - /// inside double quotes ("). - /// NOTE: - /// 1. Other unicode spaces or double quotes sequences not considered - /// 2. Backslash (\) not considered as possible escape char for ". - /// - /// Once broken down into individual options, only a few compiler options are - /// seached for (viz. the options for which v8.0 has new project properties) - /// Everything else is ignored. - /// - /// Refer to SwitchesToMigrade enum for the switches that are migrated. - /// - internal sealed class AdditionalOptionsParser - { - // These are all that we recognize in the AdditionalOptions - private CompSwitchInfo[] validCompilerSwitches = new CompSwitchInfo[] { - #region Info on the compiler switches to be parsed from AdditionalOptions - // /codepage: - new CompSwitchInfo( - SwitchesToMigrate.STM_CodePage, - new string[] { "/codepage:" }, - SwitchValueType.SVT_String, - null, - "CodePage" - ), - - // /x:[all | net] - new CompSwitchInfo( - SwitchesToMigrate.STM_DisableLangExtensions, - new string[] { "/x:" }, - SwitchValueType.SVT_String, - null, - "DisableLangXtns" - ), - - // /jcpa:[package=namespace | @filename] - new CompSwitchInfo( - SwitchesToMigrate.STM_Jcpa, - new string[] { "/jcpa:" }, - SwitchValueType.SVT_MultiString, - new StringBuilder(), - "JCPA" - ), - - // /linkres[ource]: - new CompSwitchInfo( - SwitchesToMigrate.STM_LinkResource, - new string[] { "/linkres:", "/linkresource:" }, - SwitchValueType.SVT_MultiString, - new StringBuilder(), - "LinkResource" - ), - - // /securescoping[+|-], /ss[+|-] - new CompSwitchInfo( - SwitchesToMigrate.STM_SecureScoping, - new string[] { "/securescoping", "/ss" }, - SwitchValueType.SVT_Boolean, - null, - "SecureScoping" - ), - - // /win32res: - new CompSwitchInfo( - SwitchesToMigrate.STM_Win32Resource, - new string[] { "/win32res:" }, - SwitchValueType.SVT_String, - null, - "Win32Resource" - ) - #endregion - }; - - /// - /// One and only entry point to the functionality offered by this class - /// - public void ProcessAdditionalOptions( - string additionalOptionsValue, - ProjectPropertyGroupElement configPropertyGroup - ) - { - // Trivial case - if (additionalOptionsValue == null) - { - return; - } - - // Tokenize the additional options first - string[] compSwitchList = TokenizeAdditionalOptionsValue(additionalOptionsValue); - - // Extract the switch arguments - foreach (string compSwitch in compSwitchList) - { - foreach (CompSwitchInfo compSwitchInfo in validCompilerSwitches) - { - if (ExtractSwitchInfo(compSwitchInfo, compSwitch)) - { - break; - } - } - } - - // Finally populate the project file and we'r done! - PopulatePropertyGroup(configPropertyGroup); - } - - /// - /// This will tokenize the given string using ' ' and '\t' as delimiters - /// The delimiters are escaped inside a pair of quotes - /// If there is an unbalanced quote, EOL is treated as the closing quotes - /// - private string[] TokenizeAdditionalOptionsValue(string additionalOptionsValue) - { - ArrayList tokens = new ArrayList(); - - bool inQuotes = false; - StringBuilder option = new StringBuilder(); - foreach (char c in additionalOptionsValue) - { - switch (c) - { - case '\t': - case ' ': - if (inQuotes) - { - option.Append(c); - } - else - { - if (0 != option.Length) - { - tokens.Add(option.ToString()); - option.Length = 0; - } - } - break; - - case '"': - inQuotes = !inQuotes; - break; - - default: - option.Append(c); - break; - } - } - - // Ignore everything unbalanced quotes - if (!inQuotes) - { - tokens.Add(option.ToString()); - } - - return (string[])tokens.ToArray(typeof(string)); - } - - /// - /// If compSwitch is the compSwitchInfo compiler switch, then extract the switch args - /// Return - /// - true: if this is the switch (even if the switch args have error) - /// - false: this is not the switch - /// - private bool ExtractSwitchInfo(CompSwitchInfo compSwitchInfo, string compSwitch) - { - string matchedID = null; - // First see if we have a match... - for (int i = 0; i < compSwitchInfo.SwitchIDs.Length; i++) - { - if (compSwitch.StartsWith(compSwitchInfo.SwitchIDs[i], StringComparison.Ordinal)) - { - matchedID = compSwitchInfo.SwitchIDs[i]; - break; - } - } - // No no... we arent dealing with the correct switchInfo - if (matchedID == null) - { - return false; - } - - // Now we can get to extracting the switch arguments - object switchVal = null; - switch (compSwitchInfo.SwitchValueType) - { - case SwitchValueType.SVT_Boolean: - if (matchedID.Length == compSwitch.Length) - { - switchVal = true; - } - else if ((matchedID.Length + 1) == compSwitch.Length) - { - if ('+' == compSwitch[matchedID.Length]) - { - switchVal = true; - } - else if ('-' == compSwitch[matchedID.Length]) - { - switchVal = false; - } - } - if (switchVal != null) - { - compSwitchInfo.SwitchValue = switchVal; - } - else - { - Debug.Assert(false, "Cannot parse boolean switch: " + compSwitch); - } - break; - - case SwitchValueType.SVT_String: - if (matchedID.Length < compSwitch.Length) - { - switchVal = compSwitch.Substring(matchedID.Length); - } - if (switchVal != null) - { - compSwitchInfo.SwitchValue = switchVal; - } - else - { - Debug.Assert(false, "Cannot parse string switch: " + compSwitch); - } - break; - - case SwitchValueType.SVT_MultiString: - Debug.Assert( - compSwitchInfo.SwitchValue != null, - "Non null switch value expected for a multistring switch: " + matchedID - ); - - if (matchedID.Length < compSwitch.Length) - { - switchVal = compSwitch.Substring(matchedID.Length); - } - if (switchVal != null) - { - ((StringBuilder)(compSwitchInfo.SwitchValue)).Append(switchVal); - ((StringBuilder)(compSwitchInfo.SwitchValue)).Append(";"); - } - else - { - Debug.Assert(false, "Cannot parse multistring switch: " + compSwitch); - } - break; - - default: - Debug.Assert(false, "Unknown switch value type"); - break; - } - - return true; - } - - /// - /// Populate the property group with the individual options - /// - private void PopulatePropertyGroup(ProjectPropertyGroupElement configPropertyGroup) - { - string propertyName; - - foreach (CompSwitchInfo compSwitchInfo in validCompilerSwitches) - { - propertyName = compSwitchInfo.SwitchProjectPropertyName; - - // No need to remove the already existing property node - // since the switches we are dealing with couldnt have been - // set anywhere else in the property pages except the additional - // options - - switch (compSwitchInfo.SwitchValueType) - { - case SwitchValueType.SVT_Boolean: - if (compSwitchInfo.SwitchValue != null) - { - configPropertyGroup.AddProperty( - propertyName, - compSwitchInfo.SwitchValue.ToString().ToLower(CultureInfo.InvariantCulture) - ); - } - break; - - case SwitchValueType.SVT_String: - if (compSwitchInfo.SwitchValue != null) - { - configPropertyGroup.AddProperty( - propertyName, - compSwitchInfo.SwitchValue.ToString() - ); - } - break; - - case SwitchValueType.SVT_MultiString: - Debug.Assert(compSwitchInfo.SwitchValue != null, "Expected non null value for multistring switch"); - if (0 != ((StringBuilder)(compSwitchInfo.SwitchValue)).Length) - { - configPropertyGroup.AddProperty( - propertyName, - compSwitchInfo.SwitchValue.ToString() - ); - } - break; - - default: - Debug.Assert(false, "Unknown switch value type"); - break; - } - } - } - } -} diff --git a/src/Deprecated/Conversion/AssemblyInfo.cs b/src/Deprecated/Conversion/AssemblyInfo.cs deleted file mode 100644 index 861a59d36f0..00000000000 --- a/src/Deprecated/Conversion/AssemblyInfo.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Security.Permissions; -using System.Resources; -using System.Runtime.InteropServices; -using System.Runtime.CompilerServices; - -#pragma warning disable 618 -[assembly: SecurityPermission(SecurityAction.RequestMinimum, Flags = SecurityPermissionFlag.Execution)] -#pragma warning restore 618 - -// This is the assembly-level GUID, and the GUID for the TypeLib associated with -// this assembly. We should specify this explicitly, as opposed to letting -// tlbexp just pick whatever it wants. -[assembly: GuidAttribute("634AFA8F-4271-4e2c-9525-D0B75DAA821A")] -[assembly: InternalsVisibleTo("Microsoft.Build.Conversion.Unittest, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")] - -// This will enable passing the SafeDirectories flag to any P/Invoke calls/implementations within the assembly, -// so that we don't run into known security issues with loading libraries from unsafe locations -[assembly: DefaultDllImportSearchPaths(DllImportSearchPath.SafeDirectories)] - -[assembly: CLSCompliant(true)] - -[assembly: NeutralResourcesLanguage("en")] diff --git a/src/Deprecated/Conversion/AssemblyResources.cs b/src/Deprecated/Conversion/AssemblyResources.cs deleted file mode 100644 index ccdba65a922..00000000000 --- a/src/Deprecated/Conversion/AssemblyResources.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System.Resources; -using System.Reflection; -using System.Globalization; - -namespace Microsoft.Build.Conversion -{ - /// - /// This class provides access to the assembly's resources. - /// - /// SumedhK - internal static class AssemblyResources - { - /// - /// Loads the specified resource string, either from the assembly's primary resources, or its shared resources. - /// - /// This method is thread-safe. - /// SumedhK - /// - /// The resource string, or null if not found. - internal static string GetString(string name) - { - // NOTE: the ResourceManager.GetString() method is thread-safe - string resource = resources.GetString(name, CultureInfo.CurrentUICulture); - - if (resource == null) - { - resource = sharedResources.GetString(name, CultureInfo.CurrentUICulture); - } - - return resource; - } - - // assembly resources - private static readonly ResourceManager resources = new ResourceManager("Microsoft.Build.Conversion.Core.Strings", Assembly.GetExecutingAssembly()); - // shared resources - private static readonly ResourceManager sharedResources = new ResourceManager("Microsoft.Build.Conversion.Core.Strings.shared", Assembly.GetExecutingAssembly()); - } -} diff --git a/src/Deprecated/Conversion/Constants.cs b/src/Deprecated/Conversion/Constants.cs deleted file mode 100644 index 05ffc70b443..00000000000 --- a/src/Deprecated/Conversion/Constants.cs +++ /dev/null @@ -1,208 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using Microsoft.Build.Shared; - -namespace Microsoft.Build.Conversion -{ - /// - /// Contains strings identifying hint paths that we should remove - /// - /// AJenner - internal static class LegacyFrameworkPaths - { - internal const string RTMFrameworkPath = "MICROSOFT.NET\\FRAMEWORK\\V1.0.3705"; - internal const string EverettFrameworkPath = "MICROSOFT.NET\\FRAMEWORK\\V1.1.4322"; - internal const string JSharpRTMFrameworkPath = "MICROSOFT VISUAL JSHARP .NET\\FRAMEWORK\\V1.0.4205"; - } - - /// - /// Contains the names of the known elements in the VS.NET project file. - /// - /// RGoel - internal static class VSProjectElements - { - internal const string visualStudioProject = "VisualStudioProject"; - internal const string visualJSharp = "VISUALJSHARP"; - internal const string cSharp = "CSHARP"; - internal const string visualBasic = "VisualBasic"; - internal const string ECSharp = "ECSHARP"; - internal const string EVisualBasic = "EVisualBasic"; - internal const string build = "Build"; - internal const string settings = "Settings"; - internal const string config = "Config"; - internal const string platform = "Platform"; - internal const string interopRegistration = "InteropRegistration"; - internal const string references = "References"; - internal const string reference = "Reference"; - internal const string files = "Files"; - internal const string imports = "Imports"; - internal const string import = "Import"; - internal const string include = "Include"; - internal const string exclude = "Exclude"; - internal const string file = "File"; - internal const string folder = "Folder"; - internal const string startupServices = "StartupServices"; - internal const string service = "Service"; - internal const string userProperties = "UserProperties"; - internal const string otherProjectSettings = "OtherProjectSettings"; - internal const string PocketPC = "Pocket PC"; - internal const string WindowsCE = "Windows CE"; - internal const string Smartphone = "Smartphone"; - internal const string SystemDataCommon = "System.Data.Common"; - internal const string SystemSR = "System.SR"; - internal const string MSCorLib = "MSCorLib"; - } - - /// - /// Contains the names of the known elements in the VS.NET project file. - /// - /// RGoel - internal static class VSProjectAttributes - { - internal const string relPath = "RelPath"; - internal const string name = "Name"; - internal const string guid = "Guid"; - internal const string project = "Project"; - internal const string projectType = "ProjectType"; - internal const string local = "Local"; - internal const string assemblyName = "AssemblyName"; - internal const string importNamespace = "Namespace"; - internal const string id = "ID"; - internal const string link = "Link"; - internal const string buildAction = "BuildAction"; - internal const string buildActionNone = "None"; - internal const string buildActionResource = "EmbeddedResource"; - internal const string webReferences = "WebReferences"; - internal const string webReferenceUrl = "WebReferenceUrl"; - internal const string projectGuid = "ProjectGuid"; - internal const string preBuildEvent = "PreBuildEvent"; - internal const string postBuildEvent = "PostBuildEvent"; - internal const string productVersion = "ProductVersion"; - internal const string schemaVersion = "SchemaVersion"; - internal const string outputPath = "OutputPath"; - internal const string officeDocumentPath = "OfficeDocumentPath"; - internal const string officeDocumentType = "OfficeProjectType"; - internal const string officeProject = "OfficeProject"; - internal const string additionalOptions = "AdditionalOptions"; - internal const string platform = "Platform"; - internal const string selectedDevice = "SelectedDevice"; - internal const string deploymentPlatform = "DeploymentPlatform"; - internal const string incrementalBuild = "IncrementalBuild"; - internal const string hintPath = "HintPath"; - internal const string documentationFile = "DocumentationFile"; - internal const string debugType = "DebugType"; - internal const string debugTypeNone = "none"; - internal const string debugTypeFull = "full"; - internal const string errorReport = "ErrorReport"; - internal const string errorReportPrompt = "prompt"; - } - - /// - /// Contains the names of some of the hard-coded strings we'll be inserting into the newly converted MSBuild project file. - /// - /// RGoel - internal static class XMakeProjectStrings - { - internal const string project = "Project"; - internal const string defaultTargets = "Build"; - internal const string msbuildVersion = "MSBuildVersion"; - internal const string xmlns = "xmlns"; - internal const string importPrefix = "$(MSBuildToolsPath)\\"; - internal const string importSuffix = ".targets"; - internal const string targetsFilenamePrefix = "Microsoft."; - internal const string csharpTargets = "CSharp"; - internal const string visualBasicTargets = "VisualBasic"; - internal const string visualJSharpTargets = "VisualJSharp"; - internal const string triumphImport = "$(MSBuildExtensionsPath)\\Microsoft\\VisualStudio\\v9.0\\OfficeTools\\Microsoft.VisualStudio.OfficeTools.targets"; - internal const string officeTargetsVS2005Import = @"$(MSBuildExtensionsPath)\Microsoft.VisualStudio.OfficeTools.targets"; - internal const string officeTargetsVS2005Import2 = @"$(MSBuildExtensionsPath)\Microsoft.VisualStudio.OfficeTools2.targets"; - internal const string officeTargetsVS2005Repair = @"OfficeTools\Microsoft.VisualStudio.Tools.Office.targets"; - internal const string configurationPrefix = " '$(Configuration)' == '"; - internal const string configurationSuffix = "' "; - internal const string configuration = "Configuration"; - internal const string platformPrefix = " '$(Platform)' == '"; - internal const string platformSuffix = "' "; - internal const string platform = "Platform"; - internal const string configplatformPrefix = " '$(Configuration)|$(Platform)' == '"; - internal const string configplatformSeparator = "|"; - internal const string configplatformSuffix = "' "; - internal const string defaultConfiguration = "Debug"; - internal const string defaultPlatform = "AnyCPU"; - internal const string x86Platform = "x86"; - internal const string debugSymbols = "DebugSymbols"; - internal const string reference = "Reference"; - internal const string comReference = "COMReference"; - internal const string projectReference = "ProjectReference"; - internal const string import = "Import"; - internal const string service = "Service"; - internal const string folder = "Folder"; - internal const string link = "Link"; - internal const string autogen = "AutoGen"; - internal const string webReferences = "WebReferences"; - internal const string webReferenceUrl = "WebReferenceUrl"; - internal const string relPath = "RelPath"; - internal const string visualStudio = "VisualStudio"; - internal const string webRefEnableProperties = "WebReference_EnableProperties"; - internal const string webRefEnableSqlTypes = "WebReference_EnableSQLTypes"; - internal const string webRefEnableLegacyEventing = "WebReference_EnableLegacyEventingModel"; - internal const string xmlNamespace = "http://schemas.microsoft.com/developer/msbuild/2003"; - - internal const string cSharpGuid = "FAE04EC0-301F-11D3-BF4B-00C04F79EFBC"; - internal const string visualBasicGuid = "F184B08F-C81C-45F6-A57F-5ABD9991F28F"; - internal const string visualJSharpGuid = "E6FDF86B-F3D1-11D4-8576-0002A516ECE8"; - internal const string triumphProjectTypeGuid = "BAA0C2D2-18E2-41B9-852F-F413020CAA33"; - internal const string VSDCSProjectTypeGuid = "4D628B5B-2FBC-4AA6-8C16-197242AEB884"; - internal const string VSDVBProjectTypeGuid = "68B1623D-7FB9-47D8-8664-7ECEA3297D4F"; - internal const string wpfFlavorGuid = "60dc8134-eba5-43b8-bcc9-bb4bc16c2548"; - internal const string projectTypeGuids = "ProjectTypeGuids"; - internal const string platformID = "PlatformID"; - internal const string platformFamilyName = "PlatformFamilyName"; - internal const string deployTargetSuffix = "DeployDirSuffix"; - internal const string disableCSHostProc = "\n\n"; - internal const string disableVBHostProc = "\n\n"; - internal const string SDECSTargets = "Microsoft.CompactFramework.CSharp.targets"; - internal const string SDEVBTargets = "Microsoft.CompactFramework.VisualBasic.targets"; - internal const string TargetFrameworkVersion = "TargetFrameworkVersion"; - internal const string TargetFrameworkSubset = "TargetFrameworkSubset"; - internal const string TargetFrameworkProfile = "TargetFrameworkProfile"; - internal const string ClientProfile = "Client"; - internal const string vOne = "v1.0"; - internal const string vTwo = "v2.0"; - internal const string noWarn = "NoWarn"; - internal const string disabledVBWarnings = "42016,42017,42018,42019,42032,42353,42354,42355"; - internal const string xmlFileExtension = ".xml"; - internal const string csdprojFileExtension = ".csdproj"; - internal const string vbdprojFileExtension = ".vbdproj"; - internal const string csprojFileExtension = ".csproj"; - internal const string vbprojFileExtension = ".vbproj"; - internal const string myType = "MyType"; - internal const string web = "Web"; - internal const string windowsFormsWithCustomSubMain = "WindowsFormsWithCustomSubMain"; - internal const string windows = "Windows"; - internal const string codeAnalysisRuleAssemblies = "CodeAnalysisRuleAssemblies"; - internal const string console = "Console"; - internal const string empty = "Empty"; - internal const string exe = "Exe"; - internal const string library = "Library"; - internal const string winExe = "WinExe"; - internal const string outputType = "OutputType"; - internal const string fileUpgradeFlags = "FileUpgradeFlags"; - internal const string content = "Content"; - internal const string copytooutput = "CopyToOutputDirectory"; - internal const string preservenewest = "PreserveNewest"; - internal const string toolsVersion = MSBuildConstants.CurrentToolsVersion; - internal const string vbTargetsVS2008 = @"$(MSBuildToolsPath)\Microsoft.VisualBasic.targets"; - internal const string vbTargetsVS2005 = @"$(MSBuildBinPath)\Microsoft.VisualBasic.targets"; - internal const string vsToolsPath = @"VSToolsPath"; - internal const string visualStudioVersion = @"VisualStudioVersion"; - internal const string toRepairPatternForAssetCompat = @"$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\"; - internal const string toRepairPatternForAssetCompatBeforeV10 = @"$(MSBuildExtensionsPath)\Microsoft\VisualStudio\"; - internal const string toRepairPatternForAssetCompatV10 = @"$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\"; - internal const string repairHardCodedPathPattern = @"^v\d{1,2}\.\d\\"; - } -} diff --git a/src/Deprecated/Conversion/Microsoft.Build.Conversion.csproj b/src/Deprecated/Conversion/Microsoft.Build.Conversion.csproj deleted file mode 100644 index 0f73cd9c6d9..00000000000 --- a/src/Deprecated/Conversion/Microsoft.Build.Conversion.csproj +++ /dev/null @@ -1,43 +0,0 @@ - - - Microsoft.Build.Conversion.Core - $(FullFrameworkTFM) - true - false - true - This package contains the $(MSBuildProjectName) assembly which contains logic for converting projects. NOTE: This assembly is deprecated. - false - $(NoWarn);1570;1572;1573;1587 - disable - true - - - - - - - - - - - - - - $(AssemblyName).Strings.resources - Designer - - - - Resources\Strings.shared.resx - $(AssemblyName).Strings.shared.resources - Designer - - - - - - - - - - diff --git a/src/Deprecated/Conversion/OldVSProjectFileReader.cs b/src/Deprecated/Conversion/OldVSProjectFileReader.cs deleted file mode 100644 index 995871eb31c..00000000000 --- a/src/Deprecated/Conversion/OldVSProjectFileReader.cs +++ /dev/null @@ -1,825 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.IO; -using System.Text; -using System.Text.RegularExpressions; - -using error = Microsoft.Build.Shared.ErrorUtilities; - -namespace Microsoft.Build.Conversion -{ - /// - /// This class implements a custom text reader for the old VS7/Everett - /// project file format. The old format allowed certain XML special - /// characters to be present within an XML attribute value. For example, - /// - /// <MyElement MyAttribute="My --> Value" /> - /// - /// However, the System.Xml classes are more strict, and do not allow - /// the < or > characters to exist within an attribute value. But - /// the conversion utility still needs to be able to convert all old - /// project files. So the OldVSProjectFileReader class implements - /// the TextReader interface, thereby effectively intercepting all of - /// the calls which are used by the XmlTextReader to actually read the - /// raw text out of the file. As we are reading the text out of the - /// file, we replace all > (less-than) characters inside attribute values with ">", - /// etc. The XmlTextReader has no idea that this is going on, but - /// no longer complains about invalid characters. - /// - /// rgoel - internal sealed class OldVSProjectFileReader : TextReader - { - // This is the underlying text file where we will be reading the raw text - // from. - private StreamReader oldVSProjectFile; - - // We will be reading one line at a time out of the text file, and caching - // it here. - private StringBuilder singleLine; - - // The "TextReader" interface that we are implementing only allows - // forward access through the file. You cannot seek to a random location - // or read backwards. This variable is the index into the "singleLine" - // string above, which indicates how far the caller has read. Once we - // reach the end of "singleLine", we'll go read a new line from the file. - private int currentReadPositionWithinSingleLine; - - /// - /// Constructor, initialized using the filename of an existing old format - /// project file on disk. - /// - /// rgoel - /// - internal OldVSProjectFileReader - ( - string filename - ) - { - this.oldVSProjectFile = new StreamReader(filename, Encoding.Default); // HIGHCHAR: Default means ANSI, ANSI is what VS .NET 2003 wrote. Without this, the project would be read as ASCII. - - this.singleLine = new StringBuilder(); - this.currentReadPositionWithinSingleLine = 0; - } - - /// - /// Releases all locks and closes all handles on the underlying file. - /// - /// rgoel - public override void Close - ( - ) - { - oldVSProjectFile.Close(); - } - - /// - /// Returns the next character in the file, without actually advancing - /// the read pointer. Returns -1 if we're already at the end of the file. - /// - /// - /// rgoel - public override int Peek - ( - ) - { - // If necessary, read a new line of text into our internal buffer - // (this.singleLine). - if (!this.ReadLineIntoInternalBuffer()) - { - // If we've reached the end of the file, return -1. - return -1; - } - - // Return the next character, but don't advance the current position. - return this.singleLine[this.currentReadPositionWithinSingleLine]; - } - - /// - /// Returns the next character in the file, and advances the read pointer. - /// Returns -1 if we're already at the end of the file. - /// - /// - /// rgoel - public override int Read - ( - ) - { - // Use our "Peek" functionality above. - int returnCharacter = this.Peek(); - - // If there's a character there, advance the read pointer by one. - if (returnCharacter != -1) - { - this.currentReadPositionWithinSingleLine++; - } - - return returnCharacter; - } - - /// - /// Reads the specified number of characters into the caller's buffer, - /// starting at the specified index into the caller's buffer. Returns - /// the number of characters read, or 0 if we're already at the end of - /// the file. - /// - /// - /// - /// - /// - /// rgoel - public override int Read - ( - char[] bufferToReadInto, // The buffer to read the data into. - int startIndexIntoBuffer, // The index into "bufferToReadInto" - int charactersToRead // The number of characters to read. - ) - { - // Make sure there's enough room in the caller's buffer for what he's - // asking us to do. - if ((startIndexIntoBuffer + charactersToRead) > bufferToReadInto.Length) - { - // End-user should never see this message, so it doesn't need to be localized. - throw new ArgumentException("Cannot write past end of user's buffer.", nameof(charactersToRead)); - } - - int charactersCopied = 0; - - // Keep looping until we've read in the number of characters requested. - // If we reach the end of file, we'll break out early. - while (0 < charactersToRead) - { - // Read more data from the underlying file if necessary. - if (!this.ReadLineIntoInternalBuffer()) - { - // If we've reached the end of the underlying file, exit the - // loop. - break; - } - - // We're going to copy characters from our cached singleLine to the caller's - // buffer. The number of characters to copy is the lesser of (the remaining - // characters in our cached singleLine) and (the number of characters remaining - // before we've fulfilled the caller's request). - int charactersToCopy = (this.singleLine.Length - currentReadPositionWithinSingleLine); - if (charactersToCopy > charactersToRead) - { - charactersToCopy = charactersToRead; - } - - // Copy characters from our cached "singleLine" to the caller's buffer. - this.singleLine.ToString().CopyTo(this.currentReadPositionWithinSingleLine, bufferToReadInto, - startIndexIntoBuffer, charactersToCopy); - - // Update all counts and indices. - startIndexIntoBuffer += charactersToCopy; - this.currentReadPositionWithinSingleLine += charactersToCopy; - charactersCopied += charactersToCopy; - charactersToRead -= charactersToCopy; - } - - return charactersCopied; - } - - /// - /// Not implemented. Our class only supports reading from a file, which - /// can't change beneath the covers while we're reading from it. Therefore, - /// a blocking read doesn't make sense for our scenario. (A blocking read - /// is where you wait until the requested number of characters actually - /// become available ... which is never going to happen if you've already - /// reached the end of a file.) - /// - /// - /// - /// - /// - /// rgoel - public override int ReadBlock - ( - char[] bufferToReadInto, - int startIndexIntoBuffer, - int charactersToRead - ) - { - throw new NotImplementedException(); - } - - /// - /// Reads a single line of text, and returns it as a string, not including the - /// terminating line-ending characters. If we were at the end of the file, - /// return null. - /// - /// - /// rgoel - public override string ReadLine - ( - ) - { - // Read a new line from the underlying file if necessary (that is, only - // if our currently cached singleLine has already been used up). - if (!this.ReadLineIntoInternalBuffer()) - { - // If we reached the end of the underlying file, return null. - return null; - } - - // We now have a single line of text cached in our "singleLine" variable. - // Just return that, or the portion of that which hasn't been already read - // by the caller). - string result = this.singleLine.ToString(this.currentReadPositionWithinSingleLine, - this.singleLine.Length - this.currentReadPositionWithinSingleLine); - - // The caller has read the entirety of our cached "singleLine", so update - // our read pointer accordingly. - this.currentReadPositionWithinSingleLine = this.singleLine.Length; - - // Strip off the line endings before returning to caller. - char[] lineEndingCharacters = new char[] { '\r', '\n' }; - return result.Trim(lineEndingCharacters); - } - - /// - /// Reads the remainder of the file, and returns it as a string. Returns - /// an empty string if we've already reached the end of the file. - /// - /// - /// rgoel - public override string ReadToEnd - ( - ) - { - // This is what we're going to return to the caller. - StringBuilder result = new StringBuilder(); - - // Keep reading lines of text out of the underlying file, one line at - // a time. - while (true) - { - if (!this.ReadLineIntoInternalBuffer()) - { - // Exit the loop when we've reached the end of the underlying - // file. - break; - } - - // Append the line of text to the resulting output. - result.Append(this.singleLine.ToString(this.currentReadPositionWithinSingleLine, - this.singleLine.Length - this.currentReadPositionWithinSingleLine)); - - this.currentReadPositionWithinSingleLine = this.singleLine.Length; - } - - return result.ToString(); - } - - /// - /// And this is where the real magic happens. If our currently cached - /// "singleLine" has been used up, we read a new line of text from the - /// underlying text file. But as we read the line of text from the file, - /// we immediately replace all instances of special characters that occur - /// within double-quotes with the corresponding XML-friendly equivalents. - /// For example, if the underlying text file contained this: - /// - /// <MyElement MyAttribute="My --> Value" /> - /// - /// then we would read it in and immediately convert it to this: - /// - /// <MyElement MyAttribute="My --> Value" /> - /// - /// and we would store it this way in our "singleLine", so that the callers - /// never know the difference. - /// - /// This method returns true on success, and false if we were unable to - /// read a new line (due to end of file). - /// - /// - /// rgoel - private bool ReadLineIntoInternalBuffer - ( - ) - { - // Only do the work if we've already used up the data in the currently - // cached "singleLine". - if (this.currentReadPositionWithinSingleLine >= this.singleLine.Length) - { - // Read a line of text from the underlying file. - string lineFromProjectFile = this.oldVSProjectFile.ReadLine(); - if (lineFromProjectFile == null) - { - // If we've reached the end of the file, return false. - return false; - } - - // Take the line of text just read, and replace all special characters - // with the escaped XML-friendly string equivalents. - this.singleLine = new StringBuilder(this.ReplaceSpecialCharacters(lineFromProjectFile)); - - // The underlying StreamReader.ReadLine method doesn't give us the - // trailing line endings, so add them back ourselves. - this.singleLine.Append(Environment.NewLine); - - // So now we have a new cached "singleLine". Reset the read pointer - // to the beginning of the new line just read. - this.currentReadPositionWithinSingleLine = 0; - } - - return true; - } - - /// - /// This method uses a regular expression to search for the stuff in - /// between double-quotes. We obviously don't want to touch the stuff - /// OUTSIDE of double-quotes, because then we would be mucking with the - /// real angle-brackets that delimit the XML element names, etc. - /// - /// - /// - /// rgoel - private string ReplaceSpecialCharacters - ( - string originalLine - ) - { - // Find the stuff within double-quotes, and send it off to the - // "ReplaceSpecialCharactersInXmlAttribute" for proper replacement of - // the special characters. - Regex attributeValueInsideDoubleQuotesPattern = new Regex("= *\"[^\"]*\""); - - string replacedStuffInsideDoubleQuotes = attributeValueInsideDoubleQuotesPattern.Replace(originalLine, - new MatchEvaluator(this.ReplaceSpecialCharactersInXmlAttribute)); - - // Find the stuff within single-quotes, and send it off to the - // "ReplaceSpecialCharactersInXmlAttribute" for proper replacement of - // the special characters. - Regex attributeValueInsideSingleQuotesPattern = new Regex("= *'[^']*'"); - - string replacedStuffInsideSingleQuotes = attributeValueInsideSingleQuotesPattern.Replace(replacedStuffInsideDoubleQuotes, - new MatchEvaluator(this.ReplaceSpecialCharactersInXmlAttribute)); - - return replacedStuffInsideSingleQuotes; - } - - /// - /// This method is used as the delegate that is passed into Regex.Replace. - /// It a regular expression to search for the stuff in - /// between double-quotes. We obviously don't want to touch the stuff - /// OUTSIDE of double-quotes, because then we would be mucking with the - /// real angle-brackets that delimit the XML element names, etc. - /// - /// - /// - /// RGoel - private string ReplaceSpecialCharactersInXmlAttribute - ( - Match xmlAttribute - ) - { - // We've been given the string for the attribute value (i.e., all the stuff - // within double-quotes, including the double-quotes). Replace all the special characters - // within it, and return the new string. - return ReplaceSpecialCharactersInXmlAttributeString(xmlAttribute.Value); - } - - /// - /// This method actually does the replacement of special characters within the - /// text of the XML attribute. - /// - /// Input string - /// New string with all the replacements (e.g. "&" becomes "&amp;", etc.) - /// RGoel - internal static string ReplaceSpecialCharactersInXmlAttributeString - ( - string xmlAttributeText - ) - { - // Replace the special characters with their XML-friendly escaped equivalents. The - // "<" and ">" signs are easy, because if they exist at all within the value of an - // XML attribute, we know that they need to be replaced with "<" and ">" - // respectively. - xmlAttributeText = xmlAttributeText.Replace("<", "<"); - xmlAttributeText = xmlAttributeText.Replace(">", ">"); - xmlAttributeText = ReplaceNonEscapingAmpersands(xmlAttributeText); - - return xmlAttributeText; - } - - // Note -- the comment below is rendered a little confusing by escaping for XML doc compiler. Read "&" as "&" - // and "&amp;" as "&". Or just look at the intellisense tooltip. - /// - /// This method scans the strings for "&" characters, and based on what follows - /// the "&" character, it determines whether the "&" character needs to be replaced - /// with "&amp;". The old XML parser used in the VS.NET 2002/2003 project system - /// was quite inconsistent in its treatment of escaped characters in XML, so here - /// we're having to make up for those bugs. The new XML parser (System.Xml) - /// is much more strict in enforcing proper XML syntax, and therefore doesn't - /// tolerate "&" characters in the XML attribute value, unless the "&" is being - /// used to escape some special character. - /// - /// Input string - /// New string with all the replacements (e.g. "&" becomes "&amp;", etc.) - /// RGoel - private static string ReplaceNonEscapingAmpersands - ( - string xmlAttributeText - ) - { - // Ampersands are a little trickier, because some instances of "&" we need to leave - // untouched, and some we need to replace with "&". For example, - // aaa&bbb should be replaced with aaa&bbb - // But: - // aaa<bbb should not be touched. - - // Loop through each instance of "&" - int indexOfAmpersand = xmlAttributeText.IndexOf('&'); - while (indexOfAmpersand != -1) - { - // If an "&" was found, search for the next ";" following the "&". - int indexOfNextSemicolon = xmlAttributeText.IndexOf(';', indexOfAmpersand); - if (indexOfNextSemicolon == -1) - { - // No semicolon means that the ampersand was really intended to be a literal - // ampersand and therefore we need to replace it with "&". For example, - // - // aaa&bbb should get replaced with aaa&bbb - xmlAttributeText = ReplaceAmpersandWithLiteral(xmlAttributeText, indexOfAmpersand); - } - else - { - // We found the semicolon. Capture the characters between (but not - // including) the "&" and ";". - string entityName = xmlAttributeText.Substring(indexOfAmpersand + 1, - indexOfNextSemicolon - indexOfAmpersand - 1); - - // Perf note: Here we are walking through the entire list of entities, and - // doing a string comparison for each. This is expensive, but this code - // should only get executed in fairly rare circumstances. It's not very - // common for people to have these embedded into their project files. - bool foundEntity = false; - for (int i = 0; i < entities.Length; i++) - { - // Case-sensitive comparison to see if the entity name matches any of - // the well-known ones that were emitted by the XML writer in the VS.NET - // 2002/2003 project system. - if (String.Equals(entityName, entities[i], StringComparison.Ordinal)) - { - foundEntity = true; - break; - } - } - - // If it didn't match a well-known entity name, then the next thing to - // check is if it represents an ASCII code. For example, in an XML - // attribute, if I wanted to represent the "+" sign, I could do this: - // - // + - // - if (!foundEntity && (entityName.Length > 0) && (entityName[0] == '#')) - { - // At this point, we know entityName is something like "#1234" or "#x1234abcd" - bool isNumber = false; - - // A lower-case "x" in the second position indicates a hexadecimal value. - if ((entityName.Length > 2) && (entityName[1] == 'x')) - { - isNumber = true; - - // It's a hexadecimal number. Make sure every character of the entity - // is in fact a valid hexadecimal character. - for (int i = 2; i < entityName.Length; i++) - { - if (!Uri.IsHexDigit(entityName[i])) - { - isNumber = false; - break; - } - } - } - else if (entityName.Length > 1) - { - // Otherwise it's a decimal value. - isNumber = true; - - // ake sure every character of the entity is in fact a valid decimal number. - for (int i = 1; i < entityName.Length; i++) - { - if (!Char.IsNumber(entityName[i])) - { - isNumber = false; - break; - } - } - } - - if (isNumber) - { - foundEntity = true; - } - } - - // If the ampersand did not precede an actual well-known entity, then we DO want to - // replace the "&" with a "&". Otherwise we don't. - if (!foundEntity) - { - xmlAttributeText = ReplaceAmpersandWithLiteral(xmlAttributeText, indexOfAmpersand); - } - } - - // We're done process that particular "&". Now find the next one. - indexOfAmpersand = xmlAttributeText.IndexOf('&', indexOfAmpersand + 1); - } - - return xmlAttributeText; - } - - // Note -- the comment below is rendered a little confusing by escaping for XML doc compiler. Read "&" as "&" - // and "&amp;" as "&". Or just look at the intellisense tooltip. - /// - /// Replaces a single instance of an "&" character in a string with "&amp;" and returns the new string. - /// - /// Original string where we should find an "&" character. - /// The index of the "&" which we want to replace. - /// The new string with the "&" replaced with "&amp;". - /// RGoel - internal static string ReplaceAmpersandWithLiteral - ( - string originalString, - int indexOfAmpersand - ) - { - error.VerifyThrow(originalString[indexOfAmpersand] == '&', - "Caller passed in a string that doesn't have an '&' character in the specified location."); - - StringBuilder replacedString = new StringBuilder(); - - replacedString.Append(originalString, 0, indexOfAmpersand); - replacedString.Append("&"); - replacedString.Append(originalString, indexOfAmpersand + 1, originalString.Length - indexOfAmpersand + 1); - - return replacedString.ToString(); - } - - // This is the complete list of well-known entity names that were written out - // by the XML writer in the VS.NET 2002/2003 project system. This list was - // taken directly from the source code. - private static readonly string[] entities = - { - "quot", // - "amp", // & - ampersand - "apos", // ' - apostrophe //// not part of HTML! - "lt", // < less than - "gt", // > greater than - "nbsp", // Non breaking space - "iexcl", // - "cent", // cent - "pound", // pound - "curren", // currency - "yen", // yen - "brvbar", // vertical bar - "sect", // section - "uml", // - "copy", // Copyright - "ordf", // - "laquo", // - "not", // - "shy", // - "reg", // Registered TradeMark - "macr", // - "deg", // - "plusmn", // - "sup2", // - "sup3", // - "acute", // - "micro", // - "para", // - "middot", // - "cedil", // - "sup1", // - "ordm", // - "raquo", // - "frac14", // 1/4 - "frac12", // 1/2 - "frac34", // 3/4 - "iquest", // Inverse question mark - "Agrave", // Capital A grave accent - "Aacute", // Capital A acute accent - "Acirc", // Capital A circumflex accent - "Atilde", // Capital A tilde - "Auml", // Capital A dieresis or umlaut mark - "Aring", // Capital A ring - "AElig", // Capital AE dipthong (ligature) - "Ccedil", // Capital C cedilla - "Egrave", // Capital E grave accent - "Eacute", // Capital E acute accent - "Ecirc", // Capital E circumflex accent - "Euml", // Capital E dieresis or umlaut mark - "Igrave", // Capital I grave accent - "Iacute", // Capital I acute accent - "Icirc", // Capital I circumflex accent - "Iuml", // Capital I dieresis or umlaut mark - "ETH", // Capital Eth Icelandic - "Ntilde", // Capital N tilde - "Ograve", // Capital O grave accent - "Oacute", // Capital O acute accent - "Ocirc", // Capital O circumflex accent - "Otilde", // Capital O tilde - "Ouml", // Capital O dieresis or umlaut mark - "times", // multiply or times - "Oslash", // Capital O slash - "Ugrave", // Capital U grave accent - "Uacute", // Capital U acute accent - "Ucirc", // Capital U circumflex accent - "Uuml", // Capital U dieresis or umlaut mark; - "Yacute", // Capital Y acute accent - "THORN", // Capital THORN Icelandic - "szlig", // Small sharp s German (sz ligature) - "agrave", // Small a grave accent - "aacute", // Small a acute accent - "acirc", // Small a circumflex accent - "atilde", // Small a tilde - "auml", // Small a dieresis or umlaut mark - "aring", // Small a ring - "aelig", // Small ae dipthong (ligature) - "ccedil", // Small c cedilla - "egrave", // Small e grave accent - "eacute", // Small e acute accent - "ecirc", // Small e circumflex accent - "euml", // Small e dieresis or umlaut mark - "igrave", // Small i grave accent - "iacute", // Small i acute accent - "icirc", // Small i circumflex accent - "iuml", // Small i dieresis or umlaut mark - "eth", // Small eth Icelandic - "ntilde", // Small n tilde - "ograve", // Small o grave accent - "oacute", // Small o acute accent - "ocirc", // Small o circumflex accent - "otilde", // Small o tilde - "ouml", // Small o dieresis or umlaut mark - "divide", // divide - "oslash", // Small o slash - "ugrave", // Small u grave accent - "uacute", // Small u acute accent - "ucirc", // Small u circumflex accent - "uuml", // Small u dieresis or umlaut mark - "yacute", // Small y acute accent - "thorn", // Small thorn Icelandic - "yuml", // Small y dieresis or umlaut mark - "OElig", // latin capital ligature oe, U0152 ISOlat2 - "oelig", // latin small ligature oe, U0153 ISOlat2 - "Scaron", // latin capital letter s with caron, U0160 ISOlat2 - "scaron", // latin small letter s with caron, U0161 ISOlat2 - "Yuml", // latin capital letter y with diaeresis, U0178 ISOlat2 - "fnof", // latin small f with hook, =function, =florin, U0192 ISOtech - "circ", // modifier letter circumflex accent, U02C6 ISOpub - "tilde", // small tilde, U02DC ISOdia - "Alpha", // greek capital letter alpha - "Beta", // greek capital letter beta - "Gamma", // greek capital letter gamma - "Delta", // greek capital letter delta - "Epsilon", // greek capital letter epsilon - "Zeta", // greek capital letter zeta - "Eta", // greek capital letter eta - "Theta", // greek capital letter theta - "Iota", // greek capital letter iota - "Kappa", // greek capital letter kappa - "Lambda", // greek capital letter lambda - "Mu", // greek capital letter mu - "Nu", // greek capital letter nu - "Xi", // greek capital letter xi - "Omicron", // greek capital letter omicron - "Pi", // greek capital letter pi - "Rho", // greek capital letter rho - "Sigma", // greek capital letter sigma - "Tau", // greek capital letter tau - "Upsilon", // greek capital letter upsilon - "Phi", // greek capital letter phi - "Chi", // greek capital letter chi - "Psi", // greek capital letter psi - "Omega", // greek capital letter omega - "alpha", // greek small letter alpha - "beta", // greek small letter beta - "gamma", // greek small letter gamma - "delta", // greek small letter delta - "epsilon", // greek small letter epsilon - "zeta", // greek small letter zeta - "eta", // greek small letter eta - "theta", // greek small letter theta - "iota", // greek small letter iota - "kappa", // greek small letter kappa - "lambda", // greek small letter lambda - "mu", // greek small letter mu - "nu", // greek small letter nu - "xi", // greek small letter xi - "omicron", // greek small letter omicron - "pi", // greek small letter pi - "rho", // greek small letter rho - "sigmaf", // greek small final sigma - "sigma", // greek small letter sigma - "tau", // greek small letter tau - "upsilon", // greek small letter upsilon - "phi", // greek small letter phi - "chi", // greek small letter chi - "psi", // greek small letter psi - "omega", // greek small letter omega - "thetasym", // greek small letter theta symbol, U03D1 NEW - "upsih", // greek upsilon with hook symbol - "piv", // greek pi symbol - "ensp", // en space, U2002 ISOpub - "emsp", // em space, U2003 ISOpub - "thinsp", // thin space, U2009 ISOpub - "zwnj", // zero width non-joiner, U200C NEW RFC 2070 - "zwj", // zero width joiner, U200D NEW RFC 2070 - "lrm", // left-to-right mark, U200E NEW RFC 2070 - "rlm", // right-to-left mark, U200F NEW RFC 2070 - "ndash", // en dash, U2013 ISOpub - "mdash", // em dash, U2014 ISOpub - "lsquo", // left single quotation mark, U2018 ISOnum - "rsquo", // right single quotation mark, U2019 ISOnum - "sbquo", // single low-9 quotation mark, U201A NEW - "ldquo", // left double quotation mark, U201C ISOnum - "rdquo", // right double quotation mark, U201D ISOnum - "bdquo", // double low-9 quotation mark, U201E NEW - "dagger", // dagger, U2020 ISOpub - "Dagger", // double dagger, U2021 ISOpub - "bull", // bullet, =black small circle, U2022 ISOpub - "hellip", // horizontal ellipsis, =three dot leader, U2026 ISOpub - "permil", // per mille sign, U2030 ISOtech - "prime", // prime, =minutes, =feet, U2032 ISOtech - "Prime", // double prime, =seconds, =inches, U2033 ISOtech - "lsaquo", // single left-pointing angle quotation mark, U2039 ISO proposed - "rsaquo", // single right-pointing angle quotation mark, U203A ISO proposed - "oline", // overline, spacing overscore - "frasl", // fraction slash - "image", // blackletter capital I, =imaginary part, U2111 ISOamso - "weierp", // script capital P, =power set, =Weierstrass p, U2118 ISOamso - "real", // blackletter capital R, =real part symbol, U211C ISOamso - "trade", // trade mark sign, U2122 ISOnum - "alefsym", // alef symbol, =first transfinite cardinal, U2135 NEW - "larr", // leftwards arrow, U2190 ISOnum - "uarr", // upwards arrow, U2191 ISOnum - "rarr", // rightwards arrow, U2192 ISOnum - "darr", // downwards arrow, U2193 ISOnum - "harr", // left right arrow, U2194 ISOamsa - "crarr", // downwards arrow with corner leftwards, =carriage return, U21B5 NEW - "lArr", // leftwards double arrow, U21D0 ISOtech - "uArr", // upwards double arrow, U21D1 ISOamsa - "rArr", // rightwards double arrow, U21D2 ISOtech - "dArr", // downwards double arrow, U21D3 ISOamsa - "hArr", // left right double arrow, U21D4 ISOamsa - "forall", // for all, U2200 ISOtech - "part", // partial differential, U2202 ISOtech - "exist", // there exists, U2203 ISOtech - "empty", // empty set, =null set, =diameter, U2205 ISOamso - "nabla", // nabla, =backward difference, U2207 ISOtech - "isin", // element of, U2208 ISOtech - "notin", // not an element of, U2209 ISOtech - "ni", // contains as member, U220B ISOtech - "prod", // n-ary product, =product sign, U220F ISOamsb - "sum", // n-ary sumation, U2211 ISOamsb - "minus", // minus sign, U2212 ISOtech - "lowast", // asterisk operator, U2217 ISOtech - "radic", // square root, =radical sign, U221A ISOtech - "prop", // proportional to, U221D ISOtech - "infin", // infinity, U221E ISOtech - "ang", // angle, U2220 ISOamso - "and", // logical and, =wedge, U2227 ISOtech - "or", // logical or, =vee, U2228 ISOtech - "cap", // intersection, =cap, U2229 ISOtech - "cup", // union, =cup, U222A ISOtech - "int", // integral, U222B ISOtech - "there4", // therefore, U2234 ISOtech - "sim", // tilde operator, =varies with, =similar to, U223C ISOtech - "cong", // approximately equal to, U2245 ISOtech - "asymp", // almost equal to, =asymptotic to, U2248 ISOamsr - "ne", // not equal to, U2260 ISOtech - "equiv", // identical to, U2261 ISOtech - "le", // less-than or equal to, U2264 ISOtech - "ge", // greater-than or equal to, U2265 ISOtech - "sub", // subset of, U2282 ISOtech - "sup", // superset of, U2283 ISOtech - "nsub", // not a subset of, U2284 ISOamsn - "sube", // subset of or equal to, U2286 ISOtech - "supe", // superset of or equal to, U2287 ISOtech - "oplus", // circled plus, =direct sum, U2295 ISOamsb - "otimes", // circled times, =vector product, U2297 ISOamsb - "perp", // up tack, =orthogonal to, =perpendicular, U22A5 ISOtech - "sdot", // dot operator, U22C5 ISOamsb - "lceil", // left ceiling, =apl upstile, U2308, ISOamsc - "rceil", // right ceiling, U2309, ISOamsc - "lfloor", // left floor, =apl downstile, U230A, ISOamsc - "rfloor", // right floor, U230B, ISOamsc - "lang", // left-pointing angle bracket, =bra, U2329 ISOtech - "rang", // right-pointing angle bracket, =ket, U232A ISOtech - "loz", // lozenge, U25CA ISOpub - "spades", // black spade suit, U2660 ISOpub - "clubs", // black club suit, =shamrock, U2663 ISOpub - "hearts", // black heart suit, =valentine, U2665 ISOpub - "diams" // black diamond suit, U2666 ISOpub - }; - } -} diff --git a/src/Deprecated/Conversion/ProjectFileConverter.cs b/src/Deprecated/Conversion/ProjectFileConverter.cs deleted file mode 100644 index 699df69088c..00000000000 --- a/src/Deprecated/Conversion/ProjectFileConverter.cs +++ /dev/null @@ -1,4109 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections; -using System.IO; -using System.Globalization; -using System.Reflection; -using System.Xml; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Text.RegularExpressions; -using System.Linq; - -using Microsoft.Build.Construction; -using Microsoft.Build.Shared; -using ProjectLoadSettings = Microsoft.Build.BuildEngine.ProjectLoadSettings; -using OldProject = Microsoft.Build.BuildEngine.Project; -using OldEngine = Microsoft.Build.BuildEngine.Engine; - -using InvalidProjectFileException = Microsoft.Build.Exceptions.InvalidProjectFileException; -using ProjectXmlUtilities = Microsoft.Build.Internal.ProjectXmlUtilities; - -using error = Microsoft.Build.Shared.ErrorUtilities; -using Microsoft.Build.Evaluation; - -namespace Microsoft.Build.Conversion -{ - /*************************************************************************** - * - * An outline of the structure of a VS.NET 2002/2003 project file is shown - * below: - * - * - * - * - * - * - * (.USER file only) - * - * - * (.USER file only) - * - * ... - * - * - * - * - * - * ... - * - * - * - * - * - * ... - * - * - * - * - * - * - * - * ... - * - * - * - * - * - * - * ... - * - * - * - * random goop? - * - * - * (.USER file only) - * - * - * - * - * - **************************************************************************/ - /// - /// This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// This class performs a project file format conversion from Visual Studio - /// .NET 2002 or 2003 to MSBuild format (for Whidbey). - /// - /// - /// [!WARNING] - /// > This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// rgoel - public sealed class ProjectFileConverter - { - // The filename of the old VS7/Everett project file. - private string oldProjectFile = null; - - // The target Whidbey project file for the conversion. - private string newProjectFile = null; - - // Is the project file we're converting a .USER file? - private bool isUserFile = false; - - // Is the conversion a minor upgrade operation? - // Minor upgrade also means the converted project file can be opened in old VS as well, so we won't update the tools version. - private bool isMinorUpgrade = false; - - // The object representing the destination XMake project. - private ProjectRootElement xmakeProject = null; - - // This is the XMake object representing the global property group - // in the destination project file. - private ProjectPropertyGroupElement globalPropertyGroup = null; - - // The language for the project we're converting -- CSHARP, VisualBasic, VISUALJSHARP - private string language = null; - - // This is the project instance GUID for the project we're converting - // (only if it's the main project file -- this doesn't apply for .USER - // files). - private string projectGuid = null; - - // This is the fullpath to the solution file that contains this project - // being converted. When conversion is done from the IDE in-proc, this - // information can be given to us unambiguously. However, in the command- - // line case, we may have to use a heuristic to search for the containing - // SLN ourselves. - private string solutionFile = null; - - // This is the object representing the VS solution named above. - private SolutionFile solution = null; - - // The PreBuildEvent and PostBuildEvent properties are handled specially. - private string preBuildEvent = null; - private string postBuildEvent = null; - - // If we see any web references in the project, we must add some new properties to the - // Whidbey project file, in order to force the proxy generation code to mimic the - // Everett behavior. - private bool newWebReferencePropertiesAdded = false; - - // If this is a VSD ( devices ) project, this is the platform retrieved. It's needed in two places... - private string platformForVSD = null; - private string frameworkVersionForVSD = null; - - // Cache the assembly name (used for converting DocumentationFile property for VB) - private string assemblyName = null; - - // Cache the output type (used for choosing the correct MyType for VB projects). - private string outputType = null; - - // Whether or not System.Windows.Forms is present as a reference. - private bool hasWindowsFormsReference = false; - - private bool isMyTypeAlreadySetInOriginalProject = false; - - // Internal collecction that collects the conversion warnings, - // to be exposed through the ConversionWarnings property - private ArrayList conversionWarnings = null; - - // A list of property names whose values we need to escape when converting to Whidbey. - private Dictionary propertiesToEscape = null; - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Default constructor. We need a constructor that takes zero parameters, - /// because this class needs to be instantiated from COM. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// rgoel - public ProjectFileConverter - ( - ) - { - this.oldProjectFile = null; - this.newProjectFile = null; - this.isUserFile = false; - this.solutionFile = null; - - Initialize(); - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// The read/write accessor for the old project filename. This must be - /// set by the consumer before calling Convert(). - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// rgoel - public string OldProjectFile - { - get - { - return oldProjectFile; - } - set - { - oldProjectFile = value; - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// The read/write accessor for the new project filename. This must be - /// set by the consumer before calling Convert(). - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// rgoel - public string NewProjectFile - { - get - { - return newProjectFile; - } - set - { - newProjectFile = value; - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// The read/write accessor for the boolean which tells the converter - /// whether the project file we're converting is a "main" project file - /// or a .USER file. Most of the conversion logic is identical for - /// both types of files, but for example, one difference is that the - /// "main" project file gets an <Import> tag inserted at the end. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// rgoel - public bool IsUserFile - { - get - { - return isUserFile; - } - set - { - isUserFile = value; - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// The read/write accessor for the solution file which contains this - /// project being converted. This is used to look up information about the - /// project-to-project references. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// rgoel - public string SolutionFile - { - get - { - return solutionFile; - } - set - { - solutionFile = Path.GetFullPath(value); - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Indicates if the last attempted conversion was skipped because the project is already in the latest format. - /// This will always return false; - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// SumedhK - /// true, if conversion was skipped - public bool ConversionSkippedBecauseProjectAlreadyConverted - { - get - { - return false; - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// This property returns the list of warnings that were generated during the conversion - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// faisalmo - /// true, if conversion was skipped - [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays", Justification = "Public interface that has shipped previously. ")] - public string[] ConversionWarnings - { - get - { - return (string[])conversionWarnings.ToArray(typeof(string)); - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Is the conversion a minor upgrade operation? - /// Minor upgrade also means the converted project file can be opened in old VS as well, so we won't update the tools version. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public bool IsMinorUpgrade - { - get - { - return this.isMinorUpgrade; - } - - set - { - this.isMinorUpgrade = value; - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// This is the entry point method, which performs the project file format - /// conversion. This method will overwrite "newProjectFile" if it already - /// exists, so the caller of this method should confirm with the user - /// that that's what he really wants to do. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// rgoel - public void Convert() - { - DoConvert(); - } - - /// - /// This is the entry point method, which performs the project file format - /// conversion. This method will overwrite "newProjectFile" if it already - /// exists, so the caller of this method should confirm with the user - /// that that's what he really wants to do. - /// - /// rgoel - [Obsolete("Use parameterless overload instead")] - public void Convert(ProjectLoadSettings projectLoadSettings) - { - DoConvert(); - } - - /// - /// This is the entry point method, which performs the project file format - /// conversion. This method will overwrite "newProjectFile" if it already - /// exists, so the caller of this method should confirm with the user - /// that that's what he really wants to do. - /// - /// rgoel - [Obsolete("Use parameterless overload instead.")] - public void Convert - ( - string msbuildBinPath - ) - { - DoConvert(); - } - - /// - /// Helper method to convert given an engine - /// - private void DoConvert() - { - // Make sure we were passed in non-empty source and destination project - // file names. - error.VerifyThrowArgument(!string.IsNullOrEmpty(this.oldProjectFile), - "MissingOldProjectFile"); - error.VerifyThrowArgument(!string.IsNullOrEmpty(this.newProjectFile), - "MissingNewProjectFile"); - - ConvertInMemoryToMSBuildProject(); - - this.xmakeProject.Save(newProjectFile); - } - - /// - /// Initialize all member variables to get ready for a conversion. - /// - /// RGoel - private void Initialize() - { - this.xmakeProject = null; - this.globalPropertyGroup = null; - this.language = null; - this.projectGuid = null; - this.preBuildEvent = null; - this.postBuildEvent = null; - this.solution = null; - this.newWebReferencePropertiesAdded = false; - this.platformForVSD = null; - this.assemblyName = null; - this.outputType = null; - this.hasWindowsFormsReference = false; - this.isMyTypeAlreadySetInOriginalProject = false; - this.conversionWarnings = new ArrayList(); - - this.propertiesToEscape = new Dictionary(StringComparer.OrdinalIgnoreCase); - this.propertiesToEscape.Add("ApplicationIcon", null); - this.propertiesToEscape.Add("AssemblyKeyContainerName", null); - this.propertiesToEscape.Add("AssemblyName", null); - this.propertiesToEscape.Add("AssemblyOriginatorKeyFile", null); - this.propertiesToEscape.Add("RootNamespace", null); - this.propertiesToEscape.Add("StartupObject", null); - this.propertiesToEscape.Add("ConfigurationOverrideFile", null); - this.propertiesToEscape.Add("DocumentationFile", null); - this.propertiesToEscape.Add("OutputPath", null); - } - - /// - /// This is the entry point method, which performs the project file format - /// conversion. This method will simply create a new XmlDocument - /// in memory, instead of trying to write it to disk. - /// - /// RGoel - private void ConvertInMemoryToMSBuildProject() - { - // Make sure we were passed in non-empty source and destination project - // file names. - error.VerifyThrowArgument(!string.IsNullOrEmpty(this.oldProjectFile), - "MissingOldProjectFile"); - - // Make sure the source project file exists. - error.VerifyThrowArgument(File.Exists(oldProjectFile), "ProjectFileNotFound", - oldProjectFile); - - Initialize(); - - // Load the old project file as an XML document. - XmlDocumentWithLocation oldProjectDocument = new XmlDocumentWithLocation(); - oldProjectDocument.PreserveWhitespace = true; - TextReader oldProjectFileReader = new OldVSProjectFileReader(oldProjectFile); - try - { - // We have our own custom XML reader to read in the old VS7/Everett project - // file. This is because the VS7/Everett project file format supported - // having characters like <, >, &, etc. embedded inside XML attribute - // values, but the default XmlTextReader won't handle this. - using (XmlTextReader xmlReader = new XmlTextReader(oldProjectFileReader)) - { - xmlReader.DtdProcessing = DtdProcessing.Ignore; - oldProjectDocument.Load(xmlReader); - } - } - catch (Exception e) - { - throw new InvalidProjectFileException(e.Message); - } - finally - { - oldProjectFileReader.Close(); - } - - // Get the top-level nodes from the XML. - XmlNodeList rootNodes = oldProjectDocument.ChildNodes; - XmlElementWithLocation visualStudioProjectElement = null; - - // The XML parser will guarantee that we only have one real root element, - // but since XML comments may appear outside of the scope, - // it's possible to get more than one child node. Just find the first - // non-comment node. That should be the element. - foreach (XmlNode childNode in rootNodes) - { - if ((childNode.NodeType != XmlNodeType.Comment) && - (childNode.NodeType != XmlNodeType.XmlDeclaration) && - (childNode.NodeType != XmlNodeType.Whitespace)) - { - visualStudioProjectElement = (XmlElementWithLocation)childNode; - break; - } - } - - IElementLocation oldProjectDocumentLocation = ElementLocation.Create(oldProjectDocument.FullPath, 1, 1); - - // Verify that we found a non-comment root node. - ProjectErrorUtilities.VerifyThrowInvalidProject(visualStudioProjectElement != null, - oldProjectDocumentLocation, - "NoRootProjectElement", VSProjectElements.visualStudioProject); - - // If the root element is , then assume that this project is - // already in XMake format. - if (visualStudioProjectElement.Name == XMakeProjectStrings.project) - { - this.xmakeProject = ProjectRootElement.Open(oldProjectFile); - - // For Whidbey project just need to set the "ToolsVersion" attribute for the main project file - // and remove imports like - // because the Fidalgo stuff is part of .NET Framework 3.5 - - // For upgraded workflow projects, the workflow targets need to reference the new v3.5 targets instead of v3.0 targets - // this change is required to fix the msbuild break when building workflow rules. - // e.g. before upgrade : - // after upgrade - - string oldToolsVersion = xmakeProject.ToolsVersion; - - xmakeProject.ToolsVersion = XMakeProjectStrings.toolsVersion; - List listOfImportsToBeDeleted = new List(); - List listOfWFImportsToBeDeleted = new List(); - List workflowImportsToAdd = new List(); - string workflowTargetsBasePath = @"$(MSBuildExtensionsPath)\Microsoft\Windows Workflow Foundation\"; - string workflowOldWhidbeyTargetsPath = workflowTargetsBasePath + @"v3.0\"; - string workflowOldOrcasTargetsPath = workflowTargetsBasePath + @"v3.5\"; - string workflowNewTargetsPath = @"$(MSBuildToolsPath)\"; - bool removedWFWhidbeyTargets = false; - bool changedProject = false; - - // Find matching imports but don't delete whilst enumerating else it will throw an error - foreach (ProjectImportElement nextImport in xmakeProject.Imports) - { - if (String.Equals(nextImport.Project, @"$(MSBuildBinPath)\Microsoft.WinFX.targets", StringComparison.OrdinalIgnoreCase)) - { - listOfImportsToBeDeleted.Add(nextImport); - } - - if (nextImport.Project.Contains(workflowOldWhidbeyTargetsPath)) - { - listOfWFImportsToBeDeleted.Add(nextImport); - workflowImportsToAdd.Add(nextImport.Project.Replace(workflowOldWhidbeyTargetsPath, workflowNewTargetsPath)); - removedWFWhidbeyTargets = true; - } - if (nextImport.Project.Contains(workflowOldOrcasTargetsPath)) - { - listOfWFImportsToBeDeleted.Add(nextImport); - workflowImportsToAdd.Add(nextImport.Project.Replace(workflowOldOrcasTargetsPath, workflowNewTargetsPath)); - } - } - - // Now delete any matching imports - foreach (ProjectImportElement importToDelete in listOfWFImportsToBeDeleted) - { - this.xmakeProject.RemoveChild(importToDelete); - changedProject = true; - } - - bool removedWinFXTargets = false; - foreach (ProjectImportElement importToDelete in listOfImportsToBeDeleted) - { - this.xmakeProject.RemoveChild(importToDelete); - removedWinFXTargets = true; - changedProject = true; - } - - // If we removed WinFX targets this is a sparkle project and should use v3.0 - if (removedWinFXTargets) - { - xmakeProject.AddProperty(XMakeProjectStrings.TargetFrameworkVersion, "v3.0"); - changedProject = true; - } - - //If we removed WFWhidbey imports, we should target this project to v3.0 - if (removedWFWhidbeyTargets) - { - xmakeProject.AddProperty(XMakeProjectStrings.TargetFrameworkVersion, "v3.0"); - changedProject = true; - } - - // Re-add the workflow imports with the v4.0 targets. - foreach (string workflowImportToAdd in workflowImportsToAdd) - { - this.xmakeProject.AddImport(workflowImportToAdd); - changedProject = true; - } - - // Find all the XAML files in the project and give them the custom attributes - // MSBuild:Compile (DevDiv Bugs bug 81222) - // Designer (DevDiv Bugs bug 82748) - - // Find all references to old VC project files (.vcproj extension) and change the - // extension to .vcxproj instead. NOTE: we assume that the actual .vcproj -> .vcxproj - // conversion has already been / is being / will be done elsewhere. - // Dev10 Bug 557388 - - foreach (ProjectItemElement nextItem in xmakeProject.Items) - { - if ((!nextItem.ItemType.Equals("Reference", StringComparison.OrdinalIgnoreCase)) && - (nextItem.Include.Trim().EndsWith(".xaml", StringComparison.OrdinalIgnoreCase))) - - { - if (!nextItem.Metadata.Any(m => String.Equals(m.Name, "Generator", StringComparison.OrdinalIgnoreCase))) - { - nextItem.AddMetadata("Generator", "MSBuild:Compile"); - changedProject = true; - } - - if (!nextItem.Metadata.Any(m => String.Equals(m.Name, "SubType", StringComparison.OrdinalIgnoreCase))) - { - nextItem.AddMetadata("SubType", "Designer"); - changedProject = true; - } - } - - if (String.Equals(nextItem.ItemType, "ProjectReference", StringComparison.OrdinalIgnoreCase) && - nextItem.Include.Trim().EndsWith(".vcproj", StringComparison.OrdinalIgnoreCase)) - { - nextItem.Include = Path.ChangeExtension(nextItem.Include, ".vcxproj"); - changedProject = true; - } - } - - // DevDiv Bugs bug 100701: if we removed the Microsoft.WinFX.targets import, - // and if there is no ProjectTypeGuids property, add the WPF flavor GUID - if (removedWinFXTargets) - { - ProjectPropertyElement currentGuidsProperty = FindPropertyIfPresent(this.xmakeProject, XMakeProjectStrings.projectTypeGuids); - string newGuids = "{" + XMakeProjectStrings.wpfFlavorGuid + "}"; - if (currentGuidsProperty == null || currentGuidsProperty.Value.Length == 0) - { - string currentGuids = String.Empty; - - // To have a flavor GUID we need a base GUID. - if (oldProjectFile.EndsWith(".csproj", StringComparison.OrdinalIgnoreCase)) - { - currentGuids = "{" + XMakeProjectStrings.cSharpGuid + "}"; - } - if (oldProjectFile.EndsWith(".vbproj", StringComparison.OrdinalIgnoreCase)) - { - currentGuids = "{" + XMakeProjectStrings.visualBasicGuid + "}"; - } - xmakeProject.AddProperty(XMakeProjectStrings.projectTypeGuids, newGuids + ";" + currentGuids); - changedProject = true; - } - } - - // Fix up TargetFrameworkSubset - changedProject = FixTargetFrameworkSubset() || changedProject; - - var hasFSharpSpecificConversions = FSharpSpecificConversions(true); - - changedProject = hasFSharpSpecificConversions || changedProject; - changedProject = VBSpecificConversions() || changedProject; - - // Do asset compat repair for any project that was previously a TV < 12.0 - if ( - String.IsNullOrEmpty(oldToolsVersion) || - String.Equals(oldToolsVersion, "3.5", StringComparison.OrdinalIgnoreCase) || - String.Equals(oldToolsVersion, "4.0", StringComparison.OrdinalIgnoreCase) - ) - { - changedProject = DoRepairForAssetCompat() || changedProject; - } - - // Remove any default fully qualified Code Analysis paths. - // DevDiv bug 63415 - changedProject = FixCodeAnalysisPaths() || changedProject; - - if (hasFSharpSpecificConversions && !String.IsNullOrEmpty(oldToolsVersion)) - { - // for Bug 609702:A ToolsVersion=12.0 F# project fails to load in VS 2012 - // for F# project after upgrade we restore previous value of ToolsVersion so Dev11 still can load upgraded project - // however if old ToolsVersion as 3.5 - it will be upgraded to 4.0 to avoid any unexpected behavior in Dev10\Dev11 - xmakeProject.ToolsVersion = String.Equals(oldToolsVersion, "3.5", StringComparison.OrdinalIgnoreCase) ? "4.0" : oldToolsVersion; - } - else if (this.isMinorUpgrade || - (!changedProject && - !String.IsNullOrEmpty(oldToolsVersion) && - !String.Equals(oldToolsVersion, "3.5", StringComparison.OrdinalIgnoreCase)) - ) - { - // If it's minor upgrade, or nothing changed and the project was already TV 4.0 or higher, - // set the ToolsVersion back to its old value. - xmakeProject.ToolsVersion = oldToolsVersion; - } - } - else - { - // OK, we have to start with a fresh project and assemble it - this.xmakeProject = ProjectRootElement.Create(); - - // This root node must be a node. - ProjectErrorUtilities.VerifyThrowInvalidProject(visualStudioProjectElement.Name == - VSProjectElements.visualStudioProject, - visualStudioProjectElement.Location, "UnrecognizedElement", visualStudioProjectElement.Name); - - // Set the "DefaultTargets" attribute for the main project file. - if (!isUserFile) - { - xmakeProject.DefaultTargets = XMakeProjectStrings.defaultTargets; - } - - // Set the "ToolsVersion" attribute for the main project file. - if (!isUserFile) - { - xmakeProject.ToolsVersion = XMakeProjectStrings.toolsVersion; - } - - // Process the element in the source project file, - // adding the necessary stuff to the XMake project. - this.ProcessVisualStudioProjectElement(visualStudioProjectElement); - } - } - - /// - /// returns 'false' if there was no repair required - /// else does a repair and returns 'true' - /// - /// bool - private bool DoRepairForAssetCompat() - { - var toRepairImports = RequiresRepairForAssetCompat(); - - if (toRepairImports == null || toRepairImports.Count() == 0) - { - // no need to repair - return false; - } - - foreach (var toRepairImport in toRepairImports) - { - RepairImportForAssetCompat(toRepairImport); - } - - // - // Add PropertyGroup with Conditions right before where the Imports occur - // - // 10.0 - // $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - // - // - var vsToolsPathPropGroup = this.xmakeProject.CreatePropertyGroupElement(); - var firstAmongImports = this.xmakeProject.Imports.First(); - firstAmongImports.Parent.InsertBeforeChild(vsToolsPathPropGroup, firstAmongImports); - - var vsVersionProperty = this.xmakeProject.CreatePropertyElement(XMakeProjectStrings.visualStudioVersion); - vsVersionProperty.Value = @"10.0"; - vsVersionProperty.Condition = @"'$(VisualStudioVersion)' == ''"; - vsToolsPathPropGroup.AppendChild(vsVersionProperty); - - var vsToolsPathProperty = this.xmakeProject.CreatePropertyElement(XMakeProjectStrings.vsToolsPath); - vsToolsPathProperty.Value = @"$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)"; - vsToolsPathProperty.Condition = @"'$(VSToolsPath)' == ''"; - vsToolsPathPropGroup.AppendChild(vsToolsPathProperty); - - // - // Add a conditional import to Microsoft.Common.props at the beginning of project - // - // - var newImportElement = this.xmakeProject.CreateImportElement(@"$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props"); - newImportElement.Condition = @"Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')"; - this.xmakeProject.InsertBeforeChild(newImportElement, this.xmakeProject.FirstChild); - - return true; - } - - /// - /// Repairs the given import element - /// Change Import to use $(VSToolsPath), with Condition using $(VSToolsPath) - /// e.g. From: Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" - /// To: Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" - /// Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" - /// $(VSToolsPath) will be defined elsewhere in this upgrade to be: $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - /// - /// - private void RepairImportForAssetCompat(ProjectImportElement toRepairImport) - { - // We shouldn't have this happen but check anyway: - ErrorUtilities.VerifyThrowInternalNull(toRepairImport, nameof(toRepairImport)); - ErrorUtilities.VerifyThrow(!toRepairImport.Condition.Equals("false", StringComparison.OrdinalIgnoreCase), "RepairImportForAssetCompat should not receive imports with condition=false already"); - - var newImportElement = this.xmakeProject.CreateImportElement(toRepairImport.Project); - newImportElement.Condition = "false"; - newImportElement.Project = XMakeProjectStrings.toRepairPatternForAssetCompatV10 + ExtractImportTargetsString(newImportElement.Project); - toRepairImport.Parent.InsertAfterChild(newImportElement, toRepairImport); - - toRepairImport.Project = @"$(VSToolsPath)\" + ExtractImportTargetsString(toRepairImport.Project); - toRepairImport.Condition = @"'$(VSToolsPath)' != ''"; - } - - /// - /// Extracts the actual targets imported without the repair -pattern path - /// e.g. from: $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets - /// we will extract: WebApplications\Microsoft.WebApplication.targets - /// - /// - /// - private string ExtractImportTargetsString(string importProjectValue) - { - // For VS2005 Office Targets return: OfficeTools\Microsoft.VisualStudio.Tools.Office.targets - if (importProjectValue.Equals(XMakeProjectStrings.officeTargetsVS2005Import, StringComparison.OrdinalIgnoreCase) - || importProjectValue.Equals(XMakeProjectStrings.officeTargetsVS2005Import2, StringComparison.OrdinalIgnoreCase)) - { - return XMakeProjectStrings.officeTargetsVS2005Repair; - } - - string startString; - - if (importProjectValue.StartsWith(XMakeProjectStrings.toRepairPatternForAssetCompat, StringComparison.OrdinalIgnoreCase)) - { - startString = XMakeProjectStrings.toRepairPatternForAssetCompat; - } - else - { - startString = XMakeProjectStrings.toRepairPatternForAssetCompatBeforeV10; - } - - string result = importProjectValue.Remove(0, startString.Length); - - // Extract the version string - Match m = Regex.Match(result, XMakeProjectStrings.repairHardCodedPathPattern); - - return result.Remove(0, m.Length); - } - - /// - /// Checks if repair is required - /// - /// bool - private IEnumerable RequiresRepairForAssetCompat() - { - // check if the project has the to-repair pattern in the Imports - // pattern: $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\ - var toRepairImports = from import in xmakeProject.Imports - where HasRepairPattern(import) - select import; - - return toRepairImports; - } - - /// - /// Check if the Import element has a repair pattern: - /// $(MSBuildExtensionsPath)\Microsoft\VisualStudio\vX.X - /// or $(MSBuildExtensionsPath)\Microsoft.VisualStudio.OfficeTools.targets - /// - /// - /// - private bool HasRepairPattern(ProjectImportElement importElement) - { - bool bHasRepairPattern = false; - - // in case of an already repaired project the repair pattern will exist with Condition="false" - if (!String.Equals(importElement.Condition, "false", StringComparison.OrdinalIgnoreCase)) - { - if ((importElement.Project.StartsWith(XMakeProjectStrings.toRepairPatternForAssetCompat, StringComparison.OrdinalIgnoreCase)) - || (importElement.Project.StartsWith(XMakeProjectStrings.toRepairPatternForAssetCompatBeforeV10, StringComparison.OrdinalIgnoreCase))) - { - string startString; - if (importElement.Project.StartsWith(XMakeProjectStrings.toRepairPatternForAssetCompat, StringComparison.OrdinalIgnoreCase)) - { - startString = XMakeProjectStrings.toRepairPatternForAssetCompat; - } - else - { - startString = XMakeProjectStrings.toRepairPatternForAssetCompatBeforeV10; - } - - Match m = Regex.Match(importElement.Project.Substring(startString.Length), XMakeProjectStrings.repairHardCodedPathPattern); - - if (m.Success) - { - bHasRepairPattern = true; - } - } - else - { - // Check for VS2003/2005 Office Targets - // $(MSBuildExtensionsPath)\Microsoft.VisualStudio.OfficeTools.targets - if (importElement.Project.Equals(XMakeProjectStrings.officeTargetsVS2005Import, StringComparison.OrdinalIgnoreCase) - || importElement.Project.Equals(XMakeProjectStrings.officeTargetsVS2005Import2, StringComparison.OrdinalIgnoreCase)) - { - bHasRepairPattern = true; - } - } - } - - return bHasRepairPattern; - } - - /// - /// Fixes properties in the project file. This was the Orcas SP1 way of - /// handling framework profiles, and that way is now incompatible with the VS 2010 way of handling - /// profiles. - /// - /// true if changes were required, false otherwise - private bool FixTargetFrameworkSubset() - { - bool changedProject = false; - - foreach (ProjectPropertyElement propertyElement in xmakeProject.Properties) - { - if (String.Equals(propertyElement.Name, XMakeProjectStrings.TargetFrameworkSubset, StringComparison.OrdinalIgnoreCase)) - { - // For the Client profile, which was the only profile supported in Orcas SP1, we want to replace - // with . - if (String.Equals(propertyElement.Value, XMakeProjectStrings.ClientProfile, StringComparison.OrdinalIgnoreCase)) - { - ProjectPropertyGroupElement parentGroup = (ProjectPropertyGroupElement)propertyElement.Parent; - parentGroup.SetProperty(XMakeProjectStrings.TargetFrameworkProfile, XMakeProjectStrings.ClientProfile); - changedProject = true; - } - - // In all cases, is no longer supported. If it comes from the project - // that we're converting, then we forcibly remove it. If it comes from some import... the user is - // on their own. - if (propertyElement.ContainingProject == xmakeProject) - { - propertyElement.Parent.RemoveChild(propertyElement); - changedProject = true; - } - - break; - } - } - - return changedProject; - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Performs conversions specific to F# projects (VS2008 CTP -> VS2012) and (VS2010 -> VS2012). - /// This involves: changing the location of FSharp targets, - /// and for 2008CTP, adding explicit mscorlib and FSharp.Core references. - /// - /// if true, make the changes, otherwise, don't actually make any changes, but do report the return boolean as to whether you would make changes - /// true if anything was (would be) changed, false otherwise - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public bool FSharpSpecificConversions(bool actuallyMakeChanges) - { - // For FSharp projects, should import different location of FSharp targets - const string fsharpFS10TargetsPath = @"$(MSBuildExtensionsPath)\FSharp\1.0\Microsoft.FSharp.Targets"; - const string fsharpFS10TargetsPath32 = @"$(MSBuildExtensionsPath32)\FSharp\1.0\Microsoft.FSharp.Targets"; - const string fsharpFS40TargetsPath = @"$(MSBuildExtensionsPath32)\..\Microsoft F#\v4.0\Microsoft.FSharp.Targets"; - const string fsharpFS45TargetsPath = @"$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets"; - const string fsharpPortableDev11TargetsPath = @"$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.Portable.FSharp.Targets"; - - const string fsharpDev12PlusProperty = "FSharpTargetsPath"; - - // Dev12+ projects import *.targets files using property - const string fsharpDev12PlusImportsValue = @"$(" + fsharpDev12PlusProperty + ")"; - // Q: do we need to distinguish between different versions of F# for the same version of VS - const string fsharpDev12PlusTargetsPath = @"$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets"; - const string fsharpDev12PlusPortableTargetsPath = @"$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.Portable.FSharp.Targets"; - - bool isAtLeastDev10Project = false; - - ProjectImportElement fsharpTargetsFS10Import = null; - ProjectImportElement fsharpTargetsFS40Import = null; - ProjectImportElement fsharpTargetsFS45Import = null; - ProjectImportElement fsharpTargetsDev12PlusImport = null; - ProjectImportElement fsharpTargetsDev11PortableImport = null; - - if (!actuallyMakeChanges && this.xmakeProject == null) - { - // when coming down the actuallyMakeChanges==false code path (from the F# project system's UpgradeProject_CheckOnly method), we may not have loaded the Xml yet, so do that now - this.xmakeProject = ProjectRootElement.Open(oldProjectFile); - } - - // local function: string equality check using OrdinalIgnoreCase comparison - Func equals = (s1, s2) => String.Equals(s1, s2, StringComparison.OrdinalIgnoreCase); - - // local function: wraps specified string value into Exists('value') - Func exists = s => string.Format(CultureInfo.InvariantCulture, "Exists('{0}')", s); - - // local function: - // Creates property group element containing one property fsharpDev12PlusProperty with value 'path'. - // If addCondition is true, property group will have Exists(path) condition - Action appendPropertyGroupForDev12PlusTargetsPath = - (path, parent) => - { - var propGroup = xmakeProject.CreatePropertyGroupElement(); - parent.AppendChild(propGroup); - var prop = xmakeProject.CreatePropertyElement(fsharpDev12PlusProperty); - prop.Value = path; - propGroup.AppendChild(prop); - }; - - foreach (ProjectImportElement importElement in xmakeProject.Imports) - { - if (equals(importElement.Project, fsharpFS10TargetsPath) || equals(importElement.Project, fsharpFS10TargetsPath32)) - { - fsharpTargetsFS10Import = importElement; - if (equals(@"!Exists('$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll')", fsharpTargetsFS10Import.Condition) - || equals(@"!Exists('$(MSBuildBinPath)\Microsoft.Build.Tasks.v4.0.dll')", fsharpTargetsFS10Import.Condition)) - { - isAtLeastDev10Project = true; - } - } - else if (equals(importElement.Project, fsharpFS40TargetsPath)) - { - fsharpTargetsFS40Import = importElement; - isAtLeastDev10Project = true; - } - else if (equals(importElement.Project, fsharpFS45TargetsPath)) - { - fsharpTargetsFS45Import = importElement; - isAtLeastDev10Project = true; - } - else if (equals(importElement.Project, fsharpDev12PlusImportsValue)) - { - fsharpTargetsDev12PlusImport = importElement; - isAtLeastDev10Project = true; - } - else if (equals(importElement.Project, fsharpPortableDev11TargetsPath)) - { - fsharpTargetsDev11PortableImport = importElement; - isAtLeastDev10Project = true; - } - } - - if (fsharpTargetsDev12PlusImport != null) - { - // if project already contains version independent import - then assume it is already at least dev12 - do nothing - return false; - } - - // no other F# imports - do nothing - if (fsharpTargetsFS10Import == null && fsharpTargetsFS40Import == null && fsharpTargetsFS45Import == null && fsharpTargetsDev11PortableImport == null) - { - return false; - } - - if (!actuallyMakeChanges) - { - return true; - } - - // both branches adds this elements to the project - var chooseElement = xmakeProject.CreateChooseElement(); // (1) - - if (fsharpTargetsDev11PortableImport != null) - { - // Dev11 portable library - // Expected fragment of the project file after upgrade - // - // (2) - // - // $(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.Portable.FSharp.Targets - // - // - // (3) - // - // $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.Portable.FSharp.Targets - // - // - // - // - fsharpTargetsDev11PortableImport.Parent.InsertBeforeChild(chooseElement, fsharpTargetsDev11PortableImport); - - // portable libraries are supported since Dev11 - var whenVsVersionIsDev11 = xmakeProject.CreateWhenElement("'$(VisualStudioVersion)' == '11.0'"); // (2) - chooseElement.AppendChild(whenVsVersionIsDev11); - - appendPropertyGroupForDev12PlusTargetsPath(fsharpPortableDev11TargetsPath, whenVsVersionIsDev11); - - var otherwiseIfVsVersionIsDev12Plus = xmakeProject.CreateOtherwiseElement(); // (3) - chooseElement.AppendChild(otherwiseIfVsVersionIsDev12Plus); - - appendPropertyGroupForDev12PlusTargetsPath(fsharpDev12PlusPortableTargetsPath, otherwiseIfVsVersionIsDev12Plus); - } - else - { - // This is an FSharp project, and it does not already have a 4.5 import, and thus it needs repair. - // one of these elements should be non-null, otherwise we'll exit based on the check above - var someNonNullImportElement = fsharpTargetsFS10Import ?? fsharpTargetsFS40Import ?? fsharpTargetsFS45Import; - - someNonNullImportElement.Parent.InsertBeforeChild(chooseElement, someNonNullImportElement); - - // Expected fragment of the project file after upgrade - // - // - // - // $(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets - // - // - // - // - // $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets - // - // - // - // - - var whenVsVersionIsDev11 = xmakeProject.CreateWhenElement("'$(VisualStudioVersion)' == '11.0'"); - chooseElement.AppendChild(whenVsVersionIsDev11); - { - appendPropertyGroupForDev12PlusTargetsPath(fsharpFS45TargetsPath, whenVsVersionIsDev11); - } - - var otherwiseIfVsVersionIsDev12Plus = xmakeProject.CreateOtherwiseElement(); - chooseElement.AppendChild(otherwiseIfVsVersionIsDev12Plus); - { - // Dev12+ projects - import target file based on property 'fsharpDev12PlusProperty' - appendPropertyGroupForDev12PlusTargetsPath(fsharpDev12PlusTargetsPath, otherwiseIfVsVersionIsDev12Plus); - } - } - // add Dev12 specific Imports element - var dev12PlusImportElement = xmakeProject.CreateImportElement(fsharpDev12PlusImportsValue); - dev12PlusImportElement.Condition = exists(fsharpDev12PlusImportsValue); - chooseElement.Parent.InsertAfterChild(dev12PlusImportElement, chooseElement); - - if (fsharpTargetsFS10Import != null) - { - xmakeProject.RemoveChild(fsharpTargetsFS10Import); - } - - if (fsharpTargetsFS40Import != null) - { - xmakeProject.RemoveChild(fsharpTargetsFS40Import); - } - - if (fsharpTargetsFS45Import != null) - { - xmakeProject.RemoveChild(fsharpTargetsFS45Import); - } - - if (fsharpTargetsDev11PortableImport != null) - { - xmakeProject.RemoveChild(fsharpTargetsDev11PortableImport); - } - - const string ReferenceItemType = "Reference"; - - // find ItemGroup for Reference items - ProjectItemGroupElement referencesItemGroup = xmakeProject.Items - .Where(projectItem => projectItem.ItemType == ReferenceItemType && projectItem.Parent is ProjectItemGroupElement) - .Select(projectItem => (ProjectItemGroupElement)projectItem.Parent) - .FirstOrDefault(); - - if (referencesItemGroup == null) - { - referencesItemGroup = this.xmakeProject.AddItemGroup(); - } - - var targetFrameworkVersionProperty = xmakeProject.Properties.FirstOrDefault(p => equals(p.Name, "TargetFrameworkVersion")); - - // fix FSharp.Core reference - const string TargetFSharpCoreVersionProperty = "TargetFSharpCoreVersion"; - - // by default import with minimal possible version - const string DefaultFSharpCoreVersionFor40 = "4.3.0.0"; - const string DefaultFSharpCoreVersionFor20 = "2.3.0.0"; - const string DefaultPortableFSharpCoreVersion = "2.3.5.0"; - const string FSharpCoreName = "FSharp.Core"; - - if (!isAtLeastDev10Project) - { - bool hasMscorlibReference = xmakeProject.Items.Any(projectItem => projectItem.ItemType == ReferenceItemType && equals(projectItem.Include, "mscorlib")); - // It appears pre-dev10, so add explicit references to mscorlib - if (!hasMscorlibReference) - { - referencesItemGroup.AddItem(ReferenceItemType, "mscorlib"); - } - } - - // try to find reference to FSharp.Core - ProjectItemElement fsharpCoreItem = null; - foreach (var item in xmakeProject.Items.Where(x => x.ItemType == ReferenceItemType)) - { - try - { - var name = new AssemblyName(item.Include); - if (name.Name == FSharpCoreName) - { - fsharpCoreItem = item; - break; - } - } - catch (FileLoadException) - { - // Include contains not AssemblyName but rather something else - not the case for F# projects - } - } - - const string Dev11PortableFSharpCoreLocation = @"$(MSBuildExtensionsPath32)\..\Reference Assemblies\Microsoft\FSharp\3.0\Runtime\.NETPortable\FSharp.Core.dll"; - const string Dev12PortableFSharpCoreLocationForDev11Projects = @"$(MSBuildExtensionsPath32)\..\Reference Assemblies\Microsoft\FSharp\.NETPortable\$(" + TargetFSharpCoreVersionProperty + @")\FSharp.Core.dll"; - const string HintPath = "HintPath"; - - ProjectItemElement newFSharpCoreItem = null; - string targetFSharpCoreVersionValue = null; - - var hintPathValue = fsharpCoreItem?.Metadata.FirstOrDefault(metadata => metadata.Name == HintPath); - if (hintPathValue != null) - { - if (equals(hintPathValue.Value, Dev11PortableFSharpCoreLocation)) - { - // Reference to Dev11 portable library - newFSharpCoreItem = referencesItemGroup.AddItem(ReferenceItemType, FSharpCoreName); - newFSharpCoreItem.AddMetadata(HintPath, Dev12PortableFSharpCoreLocationForDev11Projects); - - targetFSharpCoreVersionValue = DefaultPortableFSharpCoreVersion; - } - } - else if (!isAtLeastDev10Project || fsharpCoreItem != null) - { - newFSharpCoreItem = referencesItemGroup.AddItem(ReferenceItemType, string.Format("FSharp.Core, Version=$({0}), Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", TargetFSharpCoreVersionProperty)); - if (targetFrameworkVersionProperty == null || string.IsNullOrEmpty(targetFrameworkVersionProperty.Value) || !targetFrameworkVersionProperty.Value.StartsWith("v")) - { - targetFSharpCoreVersionValue = DefaultFSharpCoreVersionFor40; - } - else - { - var versionStr = targetFrameworkVersionProperty.Value.Substring(1); // strip 'v' - Version version; - targetFSharpCoreVersionValue = - Version.TryParse(versionStr, out version) - ? version.Major < 4 ? DefaultFSharpCoreVersionFor20 : DefaultFSharpCoreVersionFor40 - : DefaultFSharpCoreVersionFor40; - } - } - - newFSharpCoreItem?.AddMetadata("Private", "True"); - - const string MinimumVisualStudioVersionProperty = "MinimumVisualStudioVersion"; - var hasMinimumVSVersion = xmakeProject.Properties.Any(prop => prop.Name == MinimumVisualStudioVersionProperty); - - foreach (var group in xmakeProject.PropertyGroups) - { - // find first non-conditional property group to add TargetFSharpCoreVersion property - if (string.IsNullOrEmpty(group.Condition)) - { - if (targetFSharpCoreVersionValue != null) - { - group.AddProperty(TargetFSharpCoreVersionProperty, targetFSharpCoreVersionValue); - } - - if (!hasMinimumVSVersion) - { - var prop = group.AddProperty(MinimumVisualStudioVersionProperty, "11"); - prop.Condition = "'$(" + MinimumVisualStudioVersionProperty + ")' == ''"; - } - - break; - } - } - - // new FSharp.Core was added - can delete the old reference - if (newFSharpCoreItem != null && fsharpCoreItem != null) - { - fsharpCoreItem.Parent.RemoveChild(fsharpCoreItem); - } - - return true; - } - - /// - /// Performs conversions specific to VB projects (VS2008 and VS2008 -> VS2010). - /// This involves: Adding a set of nowarn settings to disable warnings added - /// in VS2010 that break customers upgrading from previous releases. - /// - /// true if changes were required, false otherwise - private bool VBSpecificConversions() - { - // Are we upgrading a VB project? - // We are if the project file imports: - // "$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" (VS2008) - // "$(MSBuildBinPath)\Microsoft.VisualBasic.targets" (VS2005) - - bool vbProject = false; - bool changedProject = false; - - foreach (var import in xmakeProject.Imports) - { - if (String.Equals(import.Project, XMakeProjectStrings.vbTargetsVS2008, StringComparison.OrdinalIgnoreCase) || - String.Equals(import.Project, XMakeProjectStrings.vbTargetsVS2005, StringComparison.OrdinalIgnoreCase)) - { - vbProject = true; - break; - } - } - - // Not a VB project -> no work to do. - if (!vbProject) - { - return changedProject; - } - - // Any property group with a condition is of interest. - // If we find it and it has "NoWarn" property, we add our warnings into it. - // If it doesn't, we create new NoWarn property with the initial value - foreach (var group in xmakeProject.PropertyGroups) - { - if (String.IsNullOrEmpty(group.Condition)) - { - continue; - } - - string noWarn = null; - foreach (var property in group.Properties) - { - if (String.Equals(property.Name, XMakeProjectStrings.noWarn, StringComparison.OrdinalIgnoreCase)) - { - noWarn = property.Value; - break; - } - } - - if (String.IsNullOrWhiteSpace(noWarn)) - { - noWarn = String.Empty; - } - else - { - noWarn = noWarn.Trim(); - } - - string originalNoWarnValue = noWarn; - // - // Split the no warning string and trim the results - // - string[] oldWarnings = noWarn.Split(','); - for (var oi = 0; oi < oldWarnings.Length; oi++) - { - oldWarnings[oi] = oldWarnings[oi].Trim(); - } - - // - // Add the new warnings specific to Dev10: 42353,42354,42355 - // (if we don't have them already) - // - string[] newWarnings = new[] { "42353", "42354", "42355" }; - - foreach (var newWarn in newWarnings) - { - bool found = false; - foreach (var oldWarn in oldWarnings) - { - if (String.Equals(newWarn, oldWarn, StringComparison.OrdinalIgnoreCase)) - { - found = true; - break; - } - } - - if (!found) - { - // append the new warning - if (!String.IsNullOrEmpty(noWarn) && !noWarn.EndsWith(",", StringComparison.OrdinalIgnoreCase)) - { - noWarn += ","; - } - noWarn += newWarn; - } - } - - // Set the property value. If it doesn't exist, it will be added. - if (!String.Equals(originalNoWarnValue, noWarn, StringComparison.OrdinalIgnoreCase)) - { - group.SetProperty(XMakeProjectStrings.noWarn, noWarn); - changedProject = true; - } - } - - return changedProject; - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// This is the entry point method, which performs the project file format - /// conversion. This method will simply create a new MSBuild Project object - /// in memory, instead of trying to write it to disk. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public ProjectRootElement ConvertInMemory() - { - ConvertInMemoryToMSBuildProject(); - - return xmakeProject; - } - - /// - /// This is the entry point method, which performs the project file format - /// conversion. This method will simply create a new MSBuild Project object - /// in memory, instead of trying to write it to disk. - /// - /// - /// rgoel - [Obsolete("Use parameterless ConvertInMemory() method instead")] - public OldProject ConvertInMemory - ( - OldEngine engine - ) - { - return ConvertInMemory(engine, ProjectLoadSettings.None); - } - - /// - /// This is the entry point method, which performs the project file format - /// conversion. This method will simply create a new MSBuild Project object - /// in memory, instead of trying to write it to disk. - /// - /// - /// rgoel - [Obsolete("Use parameterless ConvertInMemory() method instead")] - public OldProject ConvertInMemory - ( - OldEngine engine, - ProjectLoadSettings projectLoadSettings - ) - { - this.ConvertInMemoryToMSBuildProject(); - - OldProject oldProject = new OldProject(engine); - - using (StringReader reader = new StringReader(xmakeProject.RawXml)) - { - oldProject.Load(reader); - } - - return oldProject; - } - - /// - /// Takes an XML element from an Everett project file, and loops through - /// all its attributes. For each attribute, it adds a new XMake property - /// to the destination project file in the property group passed in. - /// - /// RGoel - private void AddXMakePropertiesFromXMLAttributes - ( - ProjectPropertyGroupElement propertyGroup, - XmlElement xmlElement - ) - { - error.VerifyThrow(propertyGroup != null, "Expected valid ProjectPropertyElementGroup to add properties to."); - - foreach (XmlAttribute xmlAttribute in xmlElement.Attributes) - { - // Add this as a property to the MSBuild project file. If the property is one of those - // that contains an identifier or a path, we must escape it to treat it as a literal. - string value = xmlAttribute.Value; - if (this.propertiesToEscape.ContainsKey(xmlAttribute.Name)) - { - value = ProjectCollection.Escape(value); - } - - propertyGroup.AddProperty(xmlAttribute.Name, value); - } - } - - /// - /// Processes the <VisualStudioProject> XML element, and everything - /// within it. As it is doing this, it will add stuff to the xmakeProject. - /// - /// RGoel - private void ProcessVisualStudioProjectElement - ( - XmlElementWithLocation visualStudioProjectElement - ) - { - // Make sure this is the element. - error.VerifyThrow((visualStudioProjectElement?.Name == VSProjectElements.visualStudioProject), - "Expected element."); - - // Make sure the caller has given us a valid xmakeProject object. - error.VerifyThrow(xmakeProject != null, "Expected valid XMake project object."); - - // This is just about better error reporting. Detect if the user tried - // to convert a VC++ or some other type of project, and give a more friendly - // error message. - string projectType = visualStudioProjectElement.GetAttribute(VSProjectAttributes.projectType); - ProjectErrorUtilities.VerifyThrowInvalidProject(string.IsNullOrEmpty(projectType), - visualStudioProjectElement.Location, "ProjectTypeCannotBeConverted", projectType); - - // Make sure the tag doesn't have any attributes. - ProjectErrorUtilities.VerifyThrowInvalidProject(!visualStudioProjectElement.HasAttributes, - visualStudioProjectElement.Location, "NoAttributesExpected", - VSProjectElements.visualStudioProject); - - bool languageFound = false; - - // Loop through all the direct children of the element. - foreach (XmlNode visualStudioProjectChildNode in visualStudioProjectElement) - { - // Handle XML comments under the node (just ignore them) - if ((visualStudioProjectChildNode.NodeType == XmlNodeType.Comment) || - (visualStudioProjectChildNode.NodeType == XmlNodeType.Whitespace)) - { - continue; - } - - if (visualStudioProjectChildNode.NodeType == XmlNodeType.Element) - { - XmlElementWithLocation visualStudioProjectChildElement = (XmlElementWithLocation)visualStudioProjectChildNode; - - switch (visualStudioProjectChildElement.Name) - { - // See if we have a , , or element. - case VSProjectElements.cSharp: - case VSProjectElements.visualJSharp: - case VSProjectElements.visualBasic: - case VSProjectElements.ECSharp: - case VSProjectElements.EVisualBasic: - // Make sure this is the first language node we're encountering. - ProjectErrorUtilities.VerifyThrowInvalidProject(!languageFound, visualStudioProjectChildElement.Location, - "MultipleLanguageNodesNotAllowed", VSProjectElements.visualStudioProject); - - languageFound = true; - this.language = visualStudioProjectChildNode.Name; - this.ProcessLanguageElement((XmlElementWithLocation)visualStudioProjectChildElement); - break; - - default: - ProjectErrorUtilities.VerifyThrowInvalidProject(false, visualStudioProjectChildElement.Location, - "UnrecognizedChildElement", visualStudioProjectChildElement.Name, - VSProjectElements.visualStudioProject); - break; - } - } - else - { - ProjectXmlUtilities.ThrowProjectInvalidChildElement(visualStudioProjectChildNode.Name, visualStudioProjectElement.Name, visualStudioProjectElement.Location); - } - } - } - - /// - /// Processes the language (e.g. <CSHARP>) XML element, and everything - /// within it. As it is doing this, it will add stuff to the xmakeProject. - /// - /// RGoel - private void ProcessLanguageElement - ( - XmlElementWithLocation languageElement - ) - { - // Make sure we have a valid XML element to process. - error.VerifyThrow(languageElement != null, "Expected valid XML language element."); - - // Make sure the caller has given us a valid xmakeProject object. - error.VerifyThrow(xmakeProject != null, "Expected valid XMake project object."); - - // Get the project instance GUID for this project file. It is required for - // the main project file, but not for the .USER file. - this.projectGuid = languageElement.GetAttribute(VSProjectAttributes.projectGuid); - ProjectErrorUtilities.VerifyThrowInvalidProject((this.projectGuid != null) || (this.isUserFile), - languageElement.Location, "MissingAttribute", languageElement.Name, VSProjectAttributes.projectGuid); - - // Get the project type for this project file. We only support "Local". We do not - // convert web projects -- that's Venus's job. - string projectType = languageElement.GetAttribute(VSProjectAttributes.projectType); - ProjectErrorUtilities.VerifyThrowInvalidProject(string.IsNullOrEmpty(projectType) || - (String.Compare(projectType, VSProjectAttributes.local, StringComparison.OrdinalIgnoreCase) == 0), - languageElement.Location, "ProjectTypeCannotBeConverted", projectType); - - // All of the attributes on the language tag get converted to XMake - // properties. A couple exceptions ... for the "ProductVersion" - // and "SchemaVersion" properties, we don't just copy the previous - // value; we actually set it to 8.0.##### and 2.0 respectively. - // In addition, we also add a default value for the "Configuration" - // property. For example, - // ----------------------------------------------------------------------- - // Everett format: - // =============== - // - // ... - // ... - // ... - // - // ----------------------------------------------------------------------- - // XMake format: - // ============= - // - // Local - // 8.0.31031 - // 2.0 - // {71F4C768-901B-4027-BD9D-378665D6C0B2} - // Debug - // - // ----------------------------------------------------------------------- - // For Dev11, we are removing "ProductVersion" and "SchemaVersion" from all - // project templates. Thus, eliminated writing these tags from this method. - // ----------------------------------------------------------------------- - - string originalMyType = languageElement.GetAttribute(XMakeProjectStrings.myType); - if (!string.IsNullOrEmpty(originalMyType)) - { - // Flag the fact that the Everett project already had a MyType property in there, - // so we don't try to override it later. - this.isMyTypeAlreadySetInOriginalProject = true; - } - - // Copy over all the other properties. - this.globalPropertyGroup = xmakeProject.AddPropertyGroup(); - this.AddXMakePropertiesFromXMLAttributes(this.globalPropertyGroup, languageElement); - - // Add the "Configuration" property. Put a condition on it so it only gets - // set to the default if the user doesn't have an environment variable called - // "Configuration". The final XML looks something like this: - // Debug - ProjectPropertyElement configurationProperty = this.globalPropertyGroup.AddProperty( - XMakeProjectStrings.configuration, XMakeProjectStrings.defaultConfiguration); - configurationProperty.Condition = XMakeProjectStrings.configurationPrefix + - XMakeProjectStrings.configurationSuffix; - - // Add the "Platform" property. Put a condition on it so it only gets - // set to the default if the user doesn't have an environment variable called - // "Platform". The final XML looks something like this: - // - // Platform of course depends on the language we are dealing with - J# in whidbey supports only x86 - string platform = (this.language != VSProjectElements.visualJSharp) - ? XMakeProjectStrings.defaultPlatform - : XMakeProjectStrings.x86Platform; - ProjectPropertyElement platformProperty = this.globalPropertyGroup.AddProperty( - XMakeProjectStrings.platform, platform); - platformProperty.Condition = XMakeProjectStrings.platformPrefix + - XMakeProjectStrings.platformSuffix; - - bool isTriumphProject = false; - - // For SDE projects, we need to add a special property to - // the project file. This will contain the project types for both the - // flavor and the main language project type. In addition, SDE projects - // need to have the host process disabled. - if (!this.isUserFile) - { - if (languageElement.Name == VSProjectElements.ECSharp) - { - this.globalPropertyGroup.AddProperty(XMakeProjectStrings.projectTypeGuids, - "{" + - XMakeProjectStrings.VSDCSProjectTypeGuid + - "};{" + - XMakeProjectStrings.cSharpGuid + - "}"); - string visualStudioProjectExtensions = GetProjectExtensionsString(XMakeProjectStrings.visualStudio); - visualStudioProjectExtensions += XMakeProjectStrings.disableCSHostProc; - SetProjectExtensionsString(XMakeProjectStrings.visualStudio, visualStudioProjectExtensions); - } - else if (languageElement.Name == VSProjectElements.EVisualBasic) - { - this.globalPropertyGroup.AddProperty(XMakeProjectStrings.projectTypeGuids, - "{" + - XMakeProjectStrings.VSDVBProjectTypeGuid + - "};{" + - XMakeProjectStrings.visualBasicGuid + - "}"); - string visualStudioProjectExtensions = GetProjectExtensionsString(XMakeProjectStrings.visualStudio); - visualStudioProjectExtensions += XMakeProjectStrings.disableVBHostProc; - SetProjectExtensionsString(XMakeProjectStrings.visualStudio, visualStudioProjectExtensions); - } - } - - // Loop through all the direct child elements of the language element. - foreach (XmlNode languageChildNode in languageElement) - { - // Handle XML comments under the the language node (just ignore them). - if ((languageChildNode.NodeType == XmlNodeType.Comment) || - (languageChildNode.NodeType == XmlNodeType.Whitespace)) - { - continue; - } - - if (languageChildNode.NodeType == XmlNodeType.Element) - { - XmlElementWithLocation languageChildElement = (XmlElementWithLocation)languageChildNode; - - switch (languageChildElement.Name) - { - // The element. - case VSProjectElements.build: - this.ProcessBuildElement((XmlElementWithLocation)languageChildElement); - break; - - case VSProjectElements.files: - this.ProcessFilesElement((XmlElementWithLocation)languageChildElement); - break; - - case VSProjectElements.startupServices: - this.ProcessStartupServicesElement((XmlElementWithLocation)languageChildElement); - break; - - case VSProjectElements.userProperties: - this.ProcessUserPropertiesElement((XmlElementWithLocation)languageChildElement, out isTriumphProject); - break; - - case VSProjectElements.otherProjectSettings: - this.ProcessOtherProjectSettingsElement((XmlElementWithLocation)languageChildElement); - break; - - default: - ProjectErrorUtilities.VerifyThrowInvalidProject(false, languageChildElement.Location, - "UnrecognizedChildElement", languageChildNode.Name, - languageElement.Name); - break; - } - } - else - { - ProjectXmlUtilities.ThrowProjectInvalidChildElement(languageChildNode.Name, languageElement.Name, languageElement.Location); - } - } - - AddFinalPropertiesAndImports(languageElement, isTriumphProject); - } - - /// - /// Adds any last-minute additional properties such as FileUpgradeFlags and MyType, - /// and also adds in the necessary Import tags. - /// - /// - /// - private void AddFinalPropertiesAndImports(XmlElementWithLocation languageElement, bool isTriumphProject) - { - // For the main project file only, add a line at the end of the new XMake - // project file to import the appropriate .TARGETS file. - if (!this.isUserFile) - { - // We set a property called "FileUpgradeFlags", so that for command-line conversions, - // if this project is ever loaded into the IDE, the file upgrade (.VB code, etc.) will kick in. - // The "20" means SxS upgrade. For IDE conversions, the project system will itself set - // this property immediately after the MSBuild conversion returns, so this value will - // be overwritten. - this.globalPropertyGroup.AddProperty(XMakeProjectStrings.fileUpgradeFlags, "20"); - - // VisualBasic projects need MyType set. - if - ( - ( - (this.language == VSProjectElements.visualBasic) || - ( - (this.language == VSProjectElements.EVisualBasic) && - (this.frameworkVersionForVSD == XMakeProjectStrings.vTwo) - ) - ) && - (!this.isMyTypeAlreadySetInOriginalProject) && - !isTriumphProject // Doesn't apply to Triumph->Trinity conversions. - ) - { - if (!string.IsNullOrEmpty(this.outputType)) - { - if (String.Equals(this.outputType, XMakeProjectStrings.winExe, StringComparison.OrdinalIgnoreCase)) - { - if (this.hasWindowsFormsReference) - { - // Only applies if there's a System.Windows.Forms reference. - this.globalPropertyGroup.AddProperty(XMakeProjectStrings.myType, XMakeProjectStrings.windowsFormsWithCustomSubMain); - } - else - { - this.globalPropertyGroup.AddProperty(XMakeProjectStrings.myType, XMakeProjectStrings.console); - } - } - else if (String.Equals(this.outputType, XMakeProjectStrings.exe, StringComparison.OrdinalIgnoreCase)) - { - this.globalPropertyGroup.AddProperty(XMakeProjectStrings.myType, XMakeProjectStrings.console); - } - else if (String.Equals(this.outputType, XMakeProjectStrings.library, StringComparison.OrdinalIgnoreCase)) - { - this.globalPropertyGroup.AddProperty(XMakeProjectStrings.myType, XMakeProjectStrings.windows); - } - } - } - else if (this.language == VSProjectElements.EVisualBasic) - { - // For Devices, we always want a MyType of "Empty," as projects - // are converted into v1 .NETCF, which doesn't support My.NET - this.globalPropertyGroup.AddProperty(XMakeProjectStrings.myType, XMakeProjectStrings.empty); - } - - // We need to handle the SDE scenarios for C# and VB - if (languageElement.Name == VSProjectElements.ECSharp) - { - xmakeProject.AddImport(XMakeProjectStrings.importPrefix + XMakeProjectStrings.SDECSTargets); - } - else if (languageElement.Name == VSProjectElements.EVisualBasic) - { - xmakeProject.AddImport(XMakeProjectStrings.importPrefix + XMakeProjectStrings.SDEVBTargets); - } - else if (languageElement.Name == VSProjectElements.cSharp) - { - xmakeProject.AddImport(XMakeProjectStrings.importPrefix + XMakeProjectStrings.targetsFilenamePrefix + XMakeProjectStrings.csharpTargets + XMakeProjectStrings.importSuffix); - } - else if (languageElement.Name == VSProjectElements.visualBasic) - { - xmakeProject.AddImport(XMakeProjectStrings.importPrefix + XMakeProjectStrings.targetsFilenamePrefix + XMakeProjectStrings.visualBasicTargets + XMakeProjectStrings.importSuffix); - } - else if (languageElement.Name == VSProjectElements.visualJSharp) - { - xmakeProject.AddImport(XMakeProjectStrings.importPrefix + XMakeProjectStrings.targetsFilenamePrefix + XMakeProjectStrings.visualJSharpTargets + XMakeProjectStrings.importSuffix); - } - else - { - xmakeProject.AddImport(XMakeProjectStrings.importPrefix + XMakeProjectStrings.targetsFilenamePrefix + languageElement.Name + XMakeProjectStrings.importSuffix); - } - - // [ancrider] VSTO project migration will handle the import target changes. - //if (isTriumphProject) - //{ - // xmakeProject.AddImport(XMakeProjectStrings.triumphImport, null); - //} - - // Also add the PreBuildEvent and PostBuildEvent properties to the end - // of the project file. The reason is that they can contain embedded - // macros that are defined in the .TARGETS file that was imported - // above. - if ((this.preBuildEvent != null) || (this.postBuildEvent != null)) - { - // In this case, we specifically need the property group at the end, so we can't just call AddPropertyGroup(..), - // but instead must do it ourselves - ProjectPropertyGroupElement preAndPostBuildEvents = xmakeProject.CreatePropertyGroupElement(); - xmakeProject.AppendChild(preAndPostBuildEvents); - - // Add the "PreBuildEvent" property. - if (this.preBuildEvent != null) - { - // We must escape the percent-sign in order to handle cases like - // "echo %DEBUGGER%". We don't want MSBuild to treat the "%DE" as - // an escaped character. - preAndPostBuildEvents.AddProperty(VSProjectAttributes.preBuildEvent, - this.preBuildEvent.Replace("%", "%25")); - } - - // Add the "PostBuildEvent" property. - if (this.postBuildEvent != null) - { - // We must escape the percent-sign in order to handle cases like - // "echo %DEBUGGER%". We don't want MSBuild to treat the "%DE" as - // an escaped character. - preAndPostBuildEvents.AddProperty(VSProjectAttributes.postBuildEvent, - this.postBuildEvent.Replace("%", "%25")); - } - } - } - } - - /// - /// Processes the <Build> element, and everything within it. As it is - /// doing this, it will add stuff to the xmakeProject. - /// - /// RGoel - private void ProcessBuildElement - ( - XmlElementWithLocation buildElement - ) - { - // Make sure this is the element. - error.VerifyThrow((buildElement?.Name == VSProjectElements.build), "Expected element."); - - // Make sure the caller has given us a valid xmakeProject object. - error.VerifyThrow(xmakeProject != null, "Expected valid XMake project object."); - - // Make sure the caller has given us a valid globalPropertyGroup object. - error.VerifyThrow(globalPropertyGroup != null, "Expected valid global ProjectPropertyElementGroup."); - - // The element should not have any attributes on it. - ProjectErrorUtilities.VerifyThrowInvalidProject(!buildElement.HasAttributes, buildElement.Location, - "NoAttributesExpected", VSProjectElements.build); - - // Loop through all the direct child elements of the element. - foreach (XmlNode buildChildNode in buildElement) - { - // Handle XML comments under the the node (just ignore them). - if ((buildChildNode.NodeType == XmlNodeType.Comment) || - (buildChildNode.NodeType == XmlNodeType.Whitespace)) - { - continue; - } - - if (buildChildNode.NodeType == XmlNodeType.Element) - { - XmlElementWithLocation buildChildElement = (XmlElementWithLocation)buildChildNode; - switch (buildChildElement.Name) - { - // The element. - case VSProjectElements.settings: - this.ProcessSettingsElement((XmlElementWithLocation)buildChildElement); - break; - - // The element. - case VSProjectElements.references: - this.ProcessReferencesElement((XmlElementWithLocation)buildChildElement); - break; - - // The element. - case VSProjectElements.imports: - this.ProcessImportsElement((XmlElementWithLocation)buildChildElement); - break; - - default: - ProjectErrorUtilities.VerifyThrowInvalidProject(false, buildChildElement.Location, - "UnrecognizedChildElement", buildChildNode.Name, - VSProjectElements.build); - break; - } - } - else - { - ProjectXmlUtilities.ThrowProjectInvalidChildElement(buildChildNode.Name, buildElement.Name, buildElement.Location); - } - } - } - - /// - /// Processes the <Settings> element, and everything within it. As it is - /// doing this, it will add stuff to the xmakeProject. - /// - /// RGoel - private void ProcessSettingsElement - ( - XmlElementWithLocation settingsElement - ) - { - // Make sure this is the element. - error.VerifyThrow((settingsElement?.Name == VSProjectElements.settings), - "Expected element."); - - // Make sure the caller has given us a valid xmakeProject object. - error.VerifyThrow(xmakeProject != null, "Expected valid XMake project object."); - - // Make sure the caller has given us a valid globalPropertyGroup object. - error.VerifyThrow(globalPropertyGroup != null, "Expected valid global ProjectPropertyElementGroup."); - - // All of the attributes on the tag get converted to XMake - // properties, except for PreBuildEvent and PostBuildEvent. For example, - // ----------------------------------------------------------------------- - // Everett format: - // =============== - // - // ... - // ... - // ... - // - // ----------------------------------------------------------------------- - // XMake format: - // ============= - // - // - // - // XMakeBuildEngine - // - // JScript - // Grid - // IE50 - // false - // Library - // XMakeBuildEngine - // OnBuildSuccess - // - // - // ----------------------------------------------------------------------- - - // The "PreBuildEvent" and "PostBuildEvent" properties need to be handled - // specially. These can contain references to predefined macros, such - // as "$(ProjectDir)". But these get defined in Microsoft.CSharp.targets, so the - // "PreBuildEvent" and "PostBuildEvent" properties need to get added to - // the project file *after* the for Microsoft.CSharp.targets. For now, - // just save the values of these two properties. - this.preBuildEvent = settingsElement.GetAttribute(VSProjectAttributes.preBuildEvent); - settingsElement.RemoveAttribute(VSProjectAttributes.preBuildEvent); - this.postBuildEvent = settingsElement.GetAttribute(VSProjectAttributes.postBuildEvent); - settingsElement.RemoveAttribute(VSProjectAttributes.postBuildEvent); - - // cache the assembly name in case its needed to upgrade the - // documentation file property) - this.assemblyName = settingsElement.GetAttribute(VSProjectAttributes.assemblyName); - - // cache the output type. - this.outputType = settingsElement.GetAttribute(XMakeProjectStrings.outputType); - - // Take care of copying all the other normal properties. - this.AddXMakePropertiesFromXMLAttributes(this.globalPropertyGroup, settingsElement); - - // Loop through all the direct child elements of the element. - foreach (XmlNode settingsChildNode in settingsElement) - { - // Handle XML comments under the the node (just ignore them). - if ((settingsChildNode.NodeType == XmlNodeType.Comment) || - (settingsChildNode.NodeType == XmlNodeType.Whitespace)) - { - continue; - } - - if (settingsChildNode.NodeType == XmlNodeType.Element) - { - XmlElementWithLocation settingsChildElement = (XmlElementWithLocation)settingsChildNode; - switch (settingsChildElement.Name) - { - // The element. - case VSProjectElements.config: - this.ProcessConfigElement(settingsChildElement); - break; - - // In the case of a VSD project, the element - case VSProjectElements.platform: - this.ProcessPlatformElement(settingsChildElement); - break; - - default: - ProjectErrorUtilities.VerifyThrowInvalidProject(false, settingsChildElement.Location, - "UnrecognizedChildElement", settingsChildElement.Name, - VSProjectElements.settings); - break; - } - } - else - { - ProjectXmlUtilities.ThrowProjectInvalidChildElement(settingsChildNode.Name, settingsElement.Name, settingsElement.Location); - } - } - } - - /// - /// Processes the <Config> element, and everything within it. As it is - /// doing this, it will add stuff to the xmakeProject, including new - /// configuration-specific property groups. - /// - /// RGoel - private void ProcessConfigElement - ( - XmlElementWithLocation configElement - ) - { - // Make sure this is the element. - error.VerifyThrow((configElement?.Name == VSProjectElements.config), - "Expected element."); - - // Make sure the caller has given us a valid xmakeProject object. - error.VerifyThrow(xmakeProject != null, "Expected valid XMake project object."); - - // All of the attributes on the tag get converted to XMake - // properties, except for the "Name" attribute which becomes part of - // the "Condition" on the . For example, - // ----------------------------------------------------------------------- - // Everett format: - // =============== - // - // ----------------------------------------------------------------------- - // XMake format: - // ============= - // - // false - // 285212672 - // false - // - // DEBUG;TRACE - // - // true - // 4096 - // false - // - // false - // bin\Debug\ - // false - // false - // true - // 4 - // - // ----------------------------------------------------------------------- - - // Get the "Name" attribute of the element. - string configName = configElement.GetAttribute(VSProjectAttributes.name); - ProjectErrorUtilities.VerifyThrowInvalidProject(!string.IsNullOrEmpty(configName), - configElement.Location, "MissingAttribute", VSProjectElements.config, VSProjectAttributes.name); - - // In the case of VSD projects, the "Name" attribute will have a pipe in it, - // followed by the device platform. This last part needs to be removed, - // leaving just the config name. - if ((this.language == VSProjectElements.ECSharp) || - (this.language == VSProjectElements.EVisualBasic)) - { - int pipeLocation = configName.IndexOf('|'); - if (pipeLocation != -1) - { - configName = configName.Remove(pipeLocation, - configName.Length - pipeLocation); - } - } - - // Remove the "Name" attribute from the element, so it doesn't get - // added as an XMake property. - configElement.RemoveAttribute(VSProjectAttributes.name); - - // PPD@31111: J# Only: We need to remove the AdditionalOptions attribute - // (and note it down) before we create the property group out of the configElement - string additionalOptionsValue = null; - if (VSProjectElements.visualJSharp == this.language) - { - additionalOptionsValue = configElement.GetAttribute(VSProjectAttributes.additionalOptions); - // Dont bother about getting a null value for additionalOptionsValue - // GetAttribute return String.Empty if the attribute is not present - configElement.RemoveAttribute(VSProjectAttributes.additionalOptions); - } - - // Create a new property group, and add all of the XML attributes as XMake - // properties. - ProjectPropertyGroupElement configPropertyGroup = xmakeProject.AddPropertyGroup(); - - // Process OutputPath attribute separately to ensure it contains trailing backslash - string outputPath = configElement.GetAttribute(VSProjectAttributes.outputPath); - if (!string.IsNullOrEmpty(outputPath)) - { - if (outputPath[outputPath.Length - 1] != Path.DirectorySeparatorChar) - { - outputPath += Path.DirectorySeparatorChar; - } - - configElement.RemoveAttribute(VSProjectAttributes.outputPath); - configPropertyGroup.AddProperty(VSProjectAttributes.outputPath, ProjectCollection.Escape(outputPath)); - } - - // If the "SelectedDevice" or "DeploymentPlatform" attributes exist in the per-user - // project file, we should get rid of them. - string selectedDevice = configElement.GetAttribute(VSProjectAttributes.selectedDevice); - if (isUserFile && (selectedDevice?.Length > 0)) - { - configElement.RemoveAttribute(VSProjectAttributes.selectedDevice); - } - - string deploymentPlatform = configElement.GetAttribute(VSProjectAttributes.deploymentPlatform); - if (isUserFile && (deploymentPlatform?.Length > 0)) - { - configElement.RemoveAttribute(VSProjectAttributes.deploymentPlatform); - } - - // Get rid of the "IncrementalBuild" attribute - string incrementalBuild = configElement.GetAttribute(VSProjectAttributes.incrementalBuild); - if (!string.IsNullOrEmpty(incrementalBuild)) - { - configElement.RemoveAttribute(VSProjectAttributes.incrementalBuild); - } - - // VSWhidbey bug 261464. For VB projects migrated from VS7/Everett, the VB team would - // like to enable XML documentation by default (this feature was unavailable to VB users - // in VS7/Everett. To enable for VB, set the DocumentationFile property to .xml - if ((!this.isUserFile) && (VSProjectElements.visualBasic == this.language)) - { - string documentationFile = this.assemblyName + XMakeProjectStrings.xmlFileExtension; - configPropertyGroup.AddProperty(VSProjectAttributes.documentationFile, ProjectCollection.Escape(documentationFile)); - } - - // process the rest of Config attributes - this.AddXMakePropertiesFromXMLAttributes(configPropertyGroup, configElement); - - // PPD@31111: J# Only: We now need to parse the additionalOptionsValue for properties and - // add the individual properties to configPropertyGroup. - // This needs to be done after the AddXMakePropertiesFromXMLAttributes call above since - // an property defined in the AdditionalOptions takes precedence. - if (VSProjectElements.visualJSharp == this.language) - { - AdditionalOptionsParser addnlOptParser = new AdditionalOptionsParser(); - addnlOptParser.ProcessAdditionalOptions(additionalOptionsValue, configPropertyGroup); - } - - // VSWhidbey bug 302946. For VB projects migrated from VS7/Everett, the VB team would - // like to disable the following new warnings for Whidbey: 42016,42017,42018,42019,42032 - // New projects created in Whidbey already have these warnings disabled by default. - if ((!this.isUserFile) && (VSProjectElements.visualBasic == this.language)) - { - configPropertyGroup.AddProperty(XMakeProjectStrings.noWarn, XMakeProjectStrings.disabledVBWarnings); - } - - // VSWhidbey bug 472064. For all projects that are converted, if "DebugSymbols" is set for a - // particular platform/configuration, we set a "DebugType" property if and only if "DebugType" property - // is not already there. DebugType is set to "full" for DebugSymbols=true, DebugType is set to "none" - // if DebugSymbols=false, and we don't do anything if DebugSymbols is not present in the source project. - if (!this.isUserFile) - { - string debugType = configElement.GetAttribute(VSProjectAttributes.debugType); - if (String.IsNullOrEmpty(debugType)) - { - string debugSymbols = configElement.GetAttribute(XMakeProjectStrings.debugSymbols); - if (String.Equals(debugSymbols, "true", StringComparison.OrdinalIgnoreCase)) - { - configPropertyGroup.AddProperty(VSProjectAttributes.debugType, VSProjectAttributes.debugTypeFull); - } - else if (String.Equals(debugSymbols, "false", StringComparison.OrdinalIgnoreCase)) - { - configPropertyGroup.AddProperty(VSProjectAttributes.debugType, VSProjectAttributes.debugTypeNone); - } - } - } - - // VSWhidbey bug 472064. For all VC# projects that are converted, we add an ErrorReport - // property, always set to "prompt" - if (!this.isUserFile && this.language == VSProjectElements.cSharp) - { - configPropertyGroup.AddProperty(VSProjectAttributes.errorReport, VSProjectAttributes.errorReportPrompt); - } - - // Platform of course depends on the language we are dealing with - J# in whidbey supports only x86 - string platform = (this.language != VSProjectElements.visualJSharp) - ? XMakeProjectStrings.defaultPlatform - : XMakeProjectStrings.x86Platform; - - // Add the "Condition" to the new . - configPropertyGroup.Condition = XMakeProjectStrings.configplatformPrefix + - ProjectCollection.Escape(configName) + XMakeProjectStrings.configplatformSeparator + - ProjectCollection.Escape(platform) + XMakeProjectStrings.configplatformSuffix; - - // Loop through all the direct child elements of the element. - foreach (XmlNode configChildNode in configElement) - { - // Handle XML comments under the the node (just ignore them). - if ((configChildNode.NodeType == XmlNodeType.Comment) || - (configChildNode.NodeType == XmlNodeType.Whitespace)) - { - continue; - } - - if (configChildNode.NodeType == XmlNodeType.Element) - { - XmlElementWithLocation configChildElement = (XmlElementWithLocation)configChildNode; - switch (configChildElement.Name) - { - // The element. - case VSProjectElements.interopRegistration: - this.ProcessInteropRegistrationElement((XmlElementWithLocation)configChildElement, configPropertyGroup); - break; - - default: - ProjectErrorUtilities.VerifyThrowInvalidProject(false, configChildElement.Location, - "UnrecognizedChildElement", configChildElement.Name, - VSProjectElements.config); - break; - } - } - else - { - ProjectXmlUtilities.ThrowProjectInvalidChildElement(configChildNode.Name, configElement.Name, configElement.Location); - } - } - } - - /// - /// Processes the <Platform> element, and everything within it. As it is - /// doing this, it will add stuff to the xmakeProject, including new - /// configuration-specific property groups. - /// - /// BCham - private void ProcessPlatformElement - ( - XmlElementWithLocation platformElement - ) - { - if (!IsUserFile) - { - // Make sure this is the element. - error.VerifyThrow((platformElement?.Name == VSProjectElements.platform), - "Expected element."); - - // Make sure the caller has given us a valid xmakeProject object. - error.VerifyThrow(xmakeProject != null, "Expected valid XMake project object."); - - // The platform listed in the element will be the platform - // used for the Whidbey project. - // ----------------------------------------------------------------------- - // Everett format: - // =============== - // - // ----------------------------------------------------------------------- - // XMake format: - // ============= - // - // - // - // - // ----------------------------------------------------------------------- - - // Get the "Name" attribute of the element. - platformForVSD = platformElement.GetAttribute(VSProjectAttributes.name); - ProjectErrorUtilities.VerifyThrowInvalidProject(!string.IsNullOrEmpty(platformForVSD), - platformElement.Location, "MissingAttribute", VSProjectElements.platform, VSProjectAttributes.name); - - // Create a new property group, and add all of the XML attributes as XMake - // properties. - ProjectPropertyGroupElement platformPropertyGroup = xmakeProject.AddPropertyGroup(); - - string platformID; - string platformFamily; - - frameworkVersionForVSD = XMakeProjectStrings.vOne; - - switch (platformForVSD) - { - case VSProjectElements.PocketPC: - platformID = "3C41C503-53EF-4c2a-8DD4-A8217CAD115E"; - platformFamily = "PocketPC"; - break; - - case VSProjectElements.Smartphone: - platformID = "4DE813A2-67E0-4a00-945C-3188240A8243"; - platformFamily = "Smartphone"; - break; - - case VSProjectElements.WindowsCE: - default: - - // If we're dealing with a platform other than the three that Everett ships with, we'll assign it as Windows CE - - platformID = "E2BECB1F-8C8C-41ba-B736-9BE7D946A398"; - platformFamily = "WindowsCE"; - - // We don't ship with a v1.0 WindowsCE platform. Default to v2.0 instead. - - frameworkVersionForVSD = XMakeProjectStrings.vTwo; - break; - } - - // Add the properties for PlatformID and PlatformFamilyName - - platformPropertyGroup.AddProperty(XMakeProjectStrings.platformID, platformID); - platformPropertyGroup.AddProperty(XMakeProjectStrings.platformFamilyName, platformFamily); - - // Since we're here, we know this is a VSD project. Therefore, let's - // add a property for the deployment target path. Note, we only need a suffix. - // The prefix will be defaulted to based on the selected device. - - platformPropertyGroup.AddProperty(XMakeProjectStrings.deployTargetSuffix, "$(AssemblyName)"); - - // And, we should also set the Target Framework version. For - // VSD projects, we want to stay with v1.0 - - platformPropertyGroup.AddProperty(XMakeProjectStrings.TargetFrameworkVersion, frameworkVersionForVSD); - } - } - - /// - /// Processes the <InteropRegistration> element, and everything within it. - /// As it is doing this, it will add extra properties to the configuration's - /// property group. - /// - /// RGoel - private void ProcessInteropRegistrationElement - ( - XmlElementWithLocation interopRegistrationElement, - ProjectPropertyGroupElement configPropertyGroup - ) - { - // Make sure this is the element. - error.VerifyThrow((interopRegistrationElement?.Name == VSProjectElements.interopRegistration), - "Expected element."); - - // Make sure we've been given a valid configuration property group. - error.VerifyThrow(configPropertyGroup != null, - "Expected configuration's property group."); - - // All of the attributes on the tag get converted to XMake - // properties. For example, - // ----------------------------------------------------------------------- - // Everett format: - // =============== - // - // ... - // ... - // > - // - // - // ----------------------------------------------------------------------- - // XMake format: - // ============= - // - // ... - // ... - // ... - // ... - // ... - // true - // Project1.dll - // Project1.tlb - // - // ----------------------------------------------------------------------- - this.AddXMakePropertiesFromXMLAttributes(configPropertyGroup, interopRegistrationElement); - - // There should be no children of the element. - ProjectXmlUtilities.VerifyThrowProjectNoChildElements(interopRegistrationElement); - } - - /// - /// Processes the <References> element, and everything within it. As it is - /// doing this, it will add reference items to a new ProjectItemGroupElement. - /// - /// RGoel - private void ProcessReferencesElement - ( - XmlElementWithLocation referencesElement - ) - { - // Make sure this is the element. - error.VerifyThrow((referencesElement?.Name == VSProjectElements.references), - "Expected element."); - - // Make sure the caller has given us a valid xmakeProject object. - error.VerifyThrow(xmakeProject != null, "Expected valid XMake project object."); - - // The tag should have no attributes. - ProjectErrorUtilities.VerifyThrowInvalidProject(!referencesElement.HasAttributes, referencesElement.Location, - "NoAttributesExpected", VSProjectElements.references); - - // Before we begin processing the individual references, let's make sure - // we have an SLN file, so we can go look up the project-to-project references. - // If the caller has not provided us with an SLN file, or if the SLN provided - // doesn't actually exist on disk yet (which can happen in VS IDE scenarios because - // the SLN is only in-memory and hasn't been saved yet), then we search for the - // SLN using a heuristic. - if (this.solutionFile == null || !File.Exists(this.solutionFile)) - { - this.solutionFile = null; - this.SearchForSolutionFile(); - } - else - { - // We've been given a valid SLN file that exists on disk, so just parse - // it. - this.solution = new SolutionFile(); - this.solution.FullPath = this.solutionFile; - this.solution.ParseSolutionFileForConversion(); - this.conversionWarnings.AddRange(this.solution.SolutionParserWarnings); - } - - ProjectItemGroupElement referencesItemGroup = null; - - // Loop through all the direct child elements of the element. - foreach (XmlNode referencesChildNode in referencesElement) - { - // Handle XML comments under the the node (just ignore them). - if ((referencesChildNode.NodeType == XmlNodeType.Comment) || - (referencesChildNode.NodeType == XmlNodeType.Whitespace)) - { - continue; - } - - if (referencesChildNode.NodeType == XmlNodeType.Element) - { - XmlElementWithLocation referencesChildElement = (XmlElementWithLocation)referencesChildNode; - switch (referencesChildElement.Name) - { - // The element. - case VSProjectElements.reference: - if (referencesItemGroup == null) - { - referencesItemGroup = xmakeProject.AddItemGroup(); - } - - this.ProcessReferenceElement(referencesChildElement, referencesItemGroup); - break; - - default: - ProjectErrorUtilities.VerifyThrowInvalidProject(false, referencesChildElement.Location, - "UnrecognizedChildElement", referencesChildElement.Name, - VSProjectElements.references); - break; - } - } - else - { - ProjectXmlUtilities.ThrowProjectInvalidChildElement(referencesChildNode.Name, referencesElement.Name, referencesElement.Location); - } - } - } - - /// - /// Processes the <Reference> element, and add an appropriate reference - /// items to the referencesItemGroup. - /// - /// RGoel - private void ProcessReferenceElement - ( - XmlElementWithLocation referenceElement, - ProjectItemGroupElement referencesItemGroup - ) - { - // Make sure this is the element. - error.VerifyThrow((referenceElement?.Name == VSProjectElements.reference), - "Expected element."); - - // Make sure the caller has already created an ProjectItemGroupElement for us to - // put the new items in. - error.VerifyThrow(referencesItemGroup != null, "Received null ProjectItemGroupElement"); - - // Before we do anything else, look for the "Platform" attribute. - // If it's available, we need to remove it, and if it ends in - // "-Designer", we need to disregard this reference entirely. - - string platform = referenceElement.GetAttribute(VSProjectAttributes.platform); - if (!string.IsNullOrEmpty(platform)) - { - if (platform.IndexOf("-Designer", 0, platform.Length, StringComparison.Ordinal) != -1) - { - return; - } - - referenceElement.RemoveAttribute(VSProjectAttributes.platform); - } - - ProjectItemElement newReferenceItem; - - // Get the "Name" attribute. This is a required attribute in the VS7/ - // Everett format. - string referenceName = referenceElement.GetAttribute(VSProjectAttributes.name); - ProjectErrorUtilities.VerifyThrowInvalidProject(!string.IsNullOrEmpty(referenceName), - referenceElement.Location, "MissingAttribute", VSProjectAttributes.name, VSProjectElements.reference); - - // Before we go any further, we must special-case some assemblies for VSD projects. - - if ((this.language == VSProjectElements.ECSharp) || - (this.language == VSProjectElements.EVisualBasic)) - { - if ((this.frameworkVersionForVSD == XMakeProjectStrings.vTwo) && - (String.Equals(referenceName, VSProjectElements.SystemDataCommon, StringComparison.OrdinalIgnoreCase))) - { - // We need to remove all references to "System.Data.Common" for VSD projects only. - // Note : We only want to do this for projects that will be updated to v2.0 - // System.Data.Common is still valid for v1.0 upgraded projects. - return; - } - else if (String.Equals(referenceName, VSProjectElements.SystemSR, StringComparison.OrdinalIgnoreCase)) - { - // We always want to remove all references to "System.SR" - return; - } - } - - if ((this.language == VSProjectElements.EVisualBasic) && - (String.Equals(referenceName, VSProjectElements.MSCorLib, StringComparison.OrdinalIgnoreCase))) - { - // We also want to get rid of all 'mscorlib' references for VB projects only. - return; - } - - // We need to find out what type of reference this is -- a .NET assembly - // reference, a COM reference, or a project reference. In the XMake format, - // we use separate item types for each of these. - - // See if there's a "Guid" attribute on the element. If so, - // it's a classic COM reference. - string comReferenceGuid = referenceElement.GetAttribute(VSProjectAttributes.guid); - - // See if there's a "Project" guid attribute. If so, it's a project - // reference. - string referencedProjectGuid = referenceElement.GetAttribute(VSProjectAttributes.project); - - if (!string.IsNullOrEmpty(comReferenceGuid) && - (comReferenceGuid != "{00000000-0000-0000-0000-000000000000}")) - { - newReferenceItem = ConvertClassicComReference(referenceElement, referencesItemGroup, referenceName); - } - else if (!string.IsNullOrEmpty(referencedProjectGuid)) - { - newReferenceItem = ConvertProjectToProjectReference(referenceElement, referencesItemGroup, referenceName, ref referencedProjectGuid); - } - else - { - newReferenceItem = ConvertAssemblyReference(referenceElement, referencesItemGroup, referenceName); - } - - // Add all the rest of the attributes on the element to the new - // XMake item. - foreach (XmlAttribute referenceAttribute in referenceElement.Attributes) - { - newReferenceItem.AddMetadata(referenceAttribute.Name, ProjectCollection.Escape(referenceAttribute.Value)); - } - - // There should be no children of the element. - ProjectXmlUtilities.VerifyThrowProjectNoChildElements(referenceElement); - } - - /// - /// Given an element corresponding to a COM reference, create the appropriate element in the new project - /// - /// - /// - /// - /// - private static ProjectItemElement ConvertClassicComReference(XmlElementWithLocation referenceElement, ProjectItemGroupElement referencesItemGroup, string referenceName) - { - // This is a classic COM reference. - - // This gets added as a new XMake item of type "COMReference". - // The "Include" attribute will contain the reference name, - // and all the other attributes remain the same. For example, - // ----------------------------------------------------------------------- - // Everett format: - // =============== - // - // ----------------------------------------------------------------------- - // XMake format: - // ============= - // - // {0EF79DA1-6555-11D2-A889-00AA006C2A9A} - // 1 - // 0 - // 0 - // tlbimp - // - // ----------------------------------------------------------------------- - - // Remove the "Name" attribute so we don't add it again at the end. - referenceElement.RemoveAttribute(VSProjectAttributes.name); - - // Add a new item to XMake of type "COMReference". - return referencesItemGroup.AddItem(XMakeProjectStrings.comReference, ProjectCollection.Escape(referenceName)); - } - - /// - /// Given an element corresponding to a P2P reference, create the appropriate element in the new project - /// - /// - /// - /// - /// - /// - private ProjectItemElement ConvertProjectToProjectReference(XmlElementWithLocation referenceElement, ProjectItemGroupElement referencesItemGroup, string referenceName, ref string referencedProjectGuid) - { - // This is a project-to-project reference. - // This gets added as a new XMake item of type "ProjectReference". - // The "Include" attribute should be the relative path from the - // current project to the referenced project file. For example, - // ----------------------------------------------------------------------- - // Everett format: - // =============== - // - // ----------------------------------------------------------------------- - // XMake format: - // ============= - // - // XMakeTasks - // {44342961-78F4-4F98-AFD6-720DA6E648A2} - // {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - // - // ----------------------------------------------------------------------- - - // Apparently, sometimes project reference guids contain additional goo with relative project path. - // Just strip it off. The project system does the same thing, and by doing this early we make - // sure that we have the correct guid attribute in the project file and ResolveNonMSBuildReferences - // does not complain about invalid characters there which causes all the references to fail to resolve. - int barIndex = referencedProjectGuid.IndexOf('|'); - if (barIndex != -1) - { - referencedProjectGuid = referencedProjectGuid.Remove(barIndex); - referenceElement.SetAttribute(VSProjectAttributes.project, referencedProjectGuid); - } - - string pathToReferencedProject = this.GetRelativePathToReferencedProject(referencedProjectGuid); - - if (pathToReferencedProject != null) - { - // For VSD Projects, we want to transform all Everett ( .csdproj & .vbdproj ) project 2 project references into - // Whidbey ( .csproj & .vbproj ) references. - if (String.Equals(Path.GetExtension(pathToReferencedProject), - XMakeProjectStrings.csdprojFileExtension, - StringComparison.OrdinalIgnoreCase)) - { - pathToReferencedProject = Path.ChangeExtension(pathToReferencedProject, XMakeProjectStrings.csprojFileExtension); - } - else if (String.Equals(Path.GetExtension(pathToReferencedProject), - XMakeProjectStrings.vbdprojFileExtension, - StringComparison.OrdinalIgnoreCase)) - { - pathToReferencedProject = Path.ChangeExtension(pathToReferencedProject, XMakeProjectStrings.vbprojFileExtension); - } - } - - // Add a new item to XMake of type "ProjectReference". If we were able to find - // the relative path to the project, use it for the "Include", otherwise just use - // the project name. - string value = pathToReferencedProject ?? referenceName; - return referencesItemGroup.AddItem(XMakeProjectStrings.projectReference, ProjectCollection.Escape(value)); - } - - /// - /// Given an element corresponding to a .NET Assembly reference, create the appropriate element in the new project - /// - /// - /// - /// - /// - private ProjectItemElement ConvertAssemblyReference(XmlElementWithLocation referenceElement, ProjectItemGroupElement referencesItemGroup, string referenceName) - { - // This is a regular .NET assembly reference. - - // This gets added as a new XMake item of type "Reference". The "Include" - // attribute is the assembly name, and all the other attributes remain - // the same. For example, - // ----------------------------------------------------------------------- - // Everett format: - // =============== - // - // ----------------------------------------------------------------------- - // XMake format: - // ============= - // - // System.Xml - // ..\..\binaries\x86chk\bin\i386\System.Xml.dll - // - // ----------------------------------------------------------------------- - - // Get the "AssemblyName" attribute. If not found, just use the value from the - // "Name" attribute. This is what the project loading code does in VS. - string assemblyName = referenceElement.GetAttribute(VSProjectAttributes.assemblyName); - if (string.IsNullOrEmpty(assemblyName)) - { - assemblyName = referenceName; - } - else - { - // Remove the "AssemblyName" attribute so we don't add it again at - // the end. - referenceElement.RemoveAttribute(VSProjectAttributes.assemblyName); - } - - // MyType should only be added when System.Windows.Forms is present. If this - // reference is seen, then set a flag so we can later add MyType. - if (String.Equals("System.Windows.Forms", assemblyName, StringComparison.OrdinalIgnoreCase)) - { - hasWindowsFormsReference = true; - } - - // Remove hint paths that we think are to RTM or Everett framework assemblies - string hintPath = referenceElement.GetAttribute(VSProjectAttributes.hintPath); - if (hintPath != null) - { - hintPath = hintPath.ToUpper(CultureInfo.InvariantCulture); - if (hintPath.IndexOf(LegacyFrameworkPaths.RTMFrameworkPath, StringComparison.Ordinal) != -1 || - hintPath.IndexOf(LegacyFrameworkPaths.EverettFrameworkPath, StringComparison.Ordinal) != -1 || - hintPath.IndexOf(LegacyFrameworkPaths.JSharpRTMFrameworkPath, StringComparison.Ordinal) != -1) - { - referenceElement.RemoveAttribute(VSProjectAttributes.hintPath); - } - } - - return referencesItemGroup.AddItem(XMakeProjectStrings.reference, ProjectCollection.Escape(assemblyName)); - } - - /// - /// To convert project-to-project references correctly, we need some data - /// out of the solution file. If we weren't given a solution file, then - /// we search the project's directory and every parent directory all the - /// way up to the root for the corresponding SLN file. - /// - /// RGoel - private void SearchForSolutionFile - ( - ) - { - error.VerifyThrow(this.solutionFile == null, "Solution file already passed in!"); - error.VerifyThrow(this.projectGuid != null, "Need project Guid to find solution file."); - - // Start by looking for a solution file in the directory of the original project file. - DirectoryInfo searchDirectory = new DirectoryInfo(Path.GetDirectoryName(Path.GetFullPath(this.oldProjectFile))); - - while (searchDirectory != null) - { - // Get a list of all the .SLN files in the current search directory. - FileInfo[] slnFiles = searchDirectory.GetFiles("*.sln"); - - // Open each .SLN file and parse it. We're searching for a .SLN - // file that contains the current project that we're converting. - foreach (FileInfo slnFile in slnFiles) - { - // Check that the extension really is ".SLN", because the above call to - // GetFiles will also return files such as blah.SLN1 and bloo.SLN2. - if (String.Equals(".sln", slnFile.Extension, StringComparison.OrdinalIgnoreCase)) - { - // Parse the .SLN file. - SolutionFile solutionParser = new SolutionFile(); - solutionParser.FullPath = slnFile.FullName; - - try - { - solutionParser.ParseSolutionFile(); - this.conversionWarnings.AddRange(solutionParser.SolutionParserWarnings); - - // Determine if our current project guid (for the project we're converting) - // is listed in the .SLN file. - if (solutionParser.GetProjectUniqueNameByGuid(this.projectGuid) != null) - { - // If we found our project listed, then this is the solution we will - // use to help us convert the project-to-project references. - this.solutionFile = slnFile.FullName; - this.solution = solutionParser; - return; - } - } - catch (InvalidProjectFileException) - { - // If the SLN wasn't valid, that's fine ... just skip it, and - // move on to the next one. - } - } - } - - // Go up one directory, and search there. Stop when we hit the root. - searchDirectory = searchDirectory.Parent; - } - - // If we don't find a solution file that contains our project, that's okay... - // we can still proceed. It just means that the converted project-to-project - // references won't have the relative path to the referenced project. This - // may prevent command-line builds from being fully functional, but it's - // not the end of the world. - } - - /// - /// Given a 'from' path and a 'to' path, compose a relative path from 'from' - /// to 'to'. - /// - /// jomof - internal static string RelativePathTo(string from, string to) - { - error.VerifyThrow(from.IndexOf("*", StringComparison.Ordinal) == -1, "Bug: RelativePathTo can't handle wild cards."); - error.VerifyThrow(to.IndexOf("*", StringComparison.Ordinal) == -1, "Bug: RelativePathTo can't handle wild cards."); - from = Path.GetFullPath(from); - to = Path.GetFullPath(to); - - Uri uriFrom = new Uri(from); - Uri uriTo = new Uri(to); - Uri relative = uriFrom.MakeRelativeUri(uriTo); - string result = Uri.UnescapeDataString(relative.ToString()); - - // The URI class returns forward slashes instead of backslashes. Replace - // them now, and return the final path. - return result.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar); - } - - /// - /// Given a project guid for a referenced project, this method computes - /// the relative path to that referenced project file from the current - /// project file that is being converted. In order to do this, we need - /// some information out of the SLN file. - /// - /// RGoel - private string GetRelativePathToReferencedProject - ( - string referencedProjectGuid - ) - { - error.VerifyThrow(referencedProjectGuid != null, "Need valid project guid."); - - // If we don't have a pointer to the SLN file that contains this project, - // then we really have no hope of finding the relative path to the - // referenced project. - if (this.solution == null) - { - // Log a warning that indicates that the complete solution file was not used - string warning = ResourceUtilities.FormatString( - AssemblyResources.GetString("CouldNotFindCompleteSolutionFile"), - referencedProjectGuid); - conversionWarnings.Add(warning); - return null; - } - - // Find the referenced project guid in the SLN file. - string relativePathFromSolutionToReferencedProject = - this.solution.GetProjectRelativePathByGuid(referencedProjectGuid); - - if (relativePathFromSolutionToReferencedProject == null) - { - // If the referenced project does not exist in the solution, we can't - // get its relative path. This is not a conversion error; it just means - // the converted project file won't have the relative path to the - // referenced project. This may prevent some command-line build - // scenarios from working completely. - string warning = ResourceUtilities.FormatString( - AssemblyResources.GetString("ProjectNotListingInSolutionFile"), - referencedProjectGuid, this.solution.FullPath); - conversionWarnings.Add(warning); - return null; - } - - if (relativePathFromSolutionToReferencedProject.StartsWith("http", StringComparison.OrdinalIgnoreCase)) - { - // We've discovered a P2P reference to a web project. This feature is no - // longer supported in Whidbey. We will remove the - // P2P reference to the web project and issue a warning into the upgrade log - // telling the user he needs to fix this up himself. - string warning = ResourceUtilities.FormatString( - AssemblyResources.GetString("UnsupportedProjectToProjectWebReference"), - relativePathFromSolutionToReferencedProject); - conversionWarnings.Add(warning); - return null; - } - - // Get the full path to the referenced project. Compute this by combining - // the full path to the SLN file with the relative path specified within - // the SLN file. - string fullPathToReferencedProject = Path.Combine( - Path.GetDirectoryName(this.solutionFile), - relativePathFromSolutionToReferencedProject); - - // Now compute the relative path from the current project to the referenced - // project. - return RelativePathTo(this.oldProjectFile, fullPathToReferencedProject); - } - - /// - /// Processes the <Imports> element, and everything within it. As it is - /// doing this, it will add "Import" items to a new ProjectItemGroupElement. - /// - /// RGoel - private void ProcessImportsElement - ( - XmlElementWithLocation importsElement - ) - { - // Make sure this is the element. - error.VerifyThrow((importsElement?.Name == VSProjectElements.imports), - "Expected element."); - - // Make sure the caller gave us a valid xmakeProject to stuff - // our new items into. - error.VerifyThrow(xmakeProject != null, "Expected valid xmake project object."); - - // The tag should have no attributes. - ProjectErrorUtilities.VerifyThrowInvalidProject(!importsElement.HasAttributes, importsElement.Location, - "NoAttributesExpected", VSProjectElements.imports); - - ProjectItemGroupElement importsItemGroup = null; - - // Loop through all the direct child elements of the element. - foreach (XmlNode importsChildNode in importsElement) - { - // Handle XML comments under the the node (just ignore them). - if ((importsChildNode.NodeType == XmlNodeType.Comment) || - (importsChildNode.NodeType == XmlNodeType.Whitespace)) - { - continue; - } - - if (importsChildNode.NodeType == XmlNodeType.Element) - { - XmlElementWithLocation importsChildElement = (XmlElementWithLocation)importsChildNode; - switch (importsChildNode.Name) - { - // The element. - case VSProjectElements.import: - if (importsItemGroup == null) - { - importsItemGroup = xmakeProject.AddItemGroup(); - } - - this.ProcessImportElement((XmlElementWithLocation)importsChildElement, importsItemGroup); - break; - - default: - ProjectErrorUtilities.VerifyThrowInvalidProject(false, importsChildElement.Location, - "UnrecognizedChildElement", importsChildElement.Name, - VSProjectElements.imports); - break; - } - } - else - { - ProjectXmlUtilities.ThrowProjectInvalidChildElement(importsChildNode.Name, importsElement.Name, importsElement.Location); - } - } - } - - /// - /// Processes the <Import> element, and add an appropriate reference - /// items to the importsItemGroup. - /// - /// RGoel - private void ProcessImportElement - ( - XmlElementWithLocation importElement, - ProjectItemGroupElement importsItemGroup - ) - { - // Make sure this is the element. - error.VerifyThrow((importElement?.Name == VSProjectElements.import), - "Expected element."); - - // Make sure the caller has already created an ProjectItemGroupElement for us to - // put the new items in. - error.VerifyThrow(importsItemGroup != null, "Received null ProjectItemGroupElement"); - - // Get the required "Namespace" attribute. - string importNamespace = importElement.GetAttribute(VSProjectAttributes.importNamespace); - ProjectErrorUtilities.VerifyThrowInvalidProject(!string.IsNullOrEmpty(importNamespace), - importElement.Location, "MissingAttribute", VSProjectAttributes.importNamespace, VSProjectElements.import); - // Remove the "Namespace" attribute, so it doesn't show up in our loop later. - importElement.RemoveAttribute(VSProjectAttributes.importNamespace); - - // The element gets converted to XMake as an item of type "Import". - // The "Namespace" attribute becomes the "Include" for the new item. For - // example, - // ----------------------------------------------------------------------- - // Everett format: - // =============== - // - // ----------------------------------------------------------------------- - // XMake format: - // ============= - // - // ----------------------------------------------------------------------- - importsItemGroup.AddItem(XMakeProjectStrings.import, ProjectCollection.Escape(importNamespace)); - - // There should be no other attributes on the element (besides - // "Namespace" which we already took care of). But loop through them - // anyway, so we can emit a useful error message. - foreach (XmlAttributeWithLocation importAttribute in importElement.Attributes) - { - ProjectErrorUtilities.VerifyThrowInvalidProject(false, importAttribute.Location, "UnrecognizedAttribute", - importAttribute.Name, VSProjectElements.import); - } - - // There should be no children of the element. - ProjectXmlUtilities.VerifyThrowProjectNoChildElements(importElement); - } - - /// - /// Processes the <Files> element, and everything within it. As it is - /// doing this, it will add the appropriate items to a new ProjectItemGroupElement. - /// - /// RGoel - private void ProcessFilesElement - ( - XmlElementWithLocation filesElement - ) - { - // Make sure this is the element. - error.VerifyThrow((filesElement?.Name == VSProjectElements.files), - "Expected element."); - - // Make sure the caller gave us a valid xmakeProject to stuff - // our new items into. - error.VerifyThrow(xmakeProject != null, "Expected valid xmake project object."); - - // The tag should have no attributes. - ProjectErrorUtilities.VerifyThrowInvalidProject(!filesElement.HasAttributes, filesElement.Location, - "NoAttributesExpected", VSProjectElements.files); - - // Loop through all the direct child elements of the element. - foreach (XmlNode filesChildNode in filesElement) - { - // Handle XML comments under the the node (just ignore them). - if ((filesChildNode.NodeType == XmlNodeType.Comment) || - (filesChildNode.NodeType == XmlNodeType.Whitespace)) - { - continue; - } - - if (filesChildNode.NodeType == XmlNodeType.Element) - { - XmlElementWithLocation filesChildElement = (XmlElementWithLocation)filesChildNode; - switch (filesChildNode.Name) - { - // The element. - case VSProjectElements.include: - this.ProcessIncludeElement(filesChildElement); - break; - - // The element. Actually, the element is not supported - // by VS. That is, VS completely ignores anything under the - // element. Yet, some really old project files have this tag in there, - // even though it doesn't do anything. So let's at least not fail if - // the project file contains this. - case VSProjectElements.exclude: - string warning = AssemblyResources.GetString("ExcludeFoundInProject"); - conversionWarnings.Add(warning); - break; - - default: - ProjectErrorUtilities.VerifyThrowInvalidProject(false, filesChildElement.Location, - "UnrecognizedChildElement", filesChildNode.Name, - VSProjectElements.files); - break; - } - } - else - { - ProjectXmlUtilities.ThrowProjectInvalidChildElement(filesChildNode.Name, filesElement.Name, filesElement.Location); - } - } - } - - /// - /// Processes the <Include> element, and everything within it. As it is - /// doing this, it will add the appropriate items to a new ProjectItemGroupElement. - /// - /// RGoel - private void ProcessIncludeElement - ( - XmlElementWithLocation includeElement - ) - { - // Make sure this is the element. - error.VerifyThrow((includeElement?.Name == VSProjectElements.include), - "Expected element."); - - // Make sure the caller gave us a valid xmakeProject to stuff - // our new items into. - error.VerifyThrow(xmakeProject != null, "Expected valid xmake project object."); - - // The tag should have no attributes. - ProjectErrorUtilities.VerifyThrowInvalidProject(!includeElement.HasAttributes, includeElement.Location, - "NoAttributesExpected", VSProjectElements.include); - - ProjectItemGroupElement filesItemGroup = null; - - // Loop through all the direct child elements of the element. - foreach (XmlNode includeChildNode in includeElement) - { - // Handle XML comments under the the node (just ignore them). - if ((includeChildNode.NodeType == XmlNodeType.Comment) || - (includeChildNode.NodeType == XmlNodeType.Whitespace)) - { - continue; - } - - if (includeChildNode.NodeType == XmlNodeType.Element) - { - if (filesItemGroup == null) - { - filesItemGroup = xmakeProject.AddItemGroup(); - } - - XmlElementWithLocation includeChildElement = (XmlElementWithLocation)includeChildNode; - switch (includeChildElement.Name) - { - // The element. - case VSProjectElements.file: - this.ProcessFileElement(includeChildElement, filesItemGroup); - break; - - // The element. - case VSProjectElements.folder: - this.ProcessFolderElement(includeChildElement, filesItemGroup); - break; - - default: - ProjectErrorUtilities.VerifyThrowInvalidProject(false, includeChildElement.Location, - "UnrecognizedChildElement", includeChildNode.Name, - VSProjectElements.include); - break; - } - } - else - { - ProjectXmlUtilities.ThrowProjectInvalidChildElement(includeChildNode.Name, includeElement.Name, includeElement.Location); - } - } - } - - /// - /// Processes the <File> element, and adds an appropriate item to the - /// filesItemGroup. - /// - /// RGoel - private void ProcessFileElement - ( - XmlElementWithLocation fileElement, - ProjectItemGroupElement filesItemGroup - ) - { - // Make sure this is the element. - error.VerifyThrow((fileElement?.Name == VSProjectElements.file), - "Expected element."); - - // Make sure the caller has already created an ProjectItemGroupElement for us to - // put the new items in. - error.VerifyThrow(filesItemGroup != null, "Received null ProjectItemGroupElement"); - - // Get the required "RelPath" attribute. - string relPath = fileElement.GetAttribute(VSProjectAttributes.relPath); - ProjectErrorUtilities.VerifyThrowInvalidProject(!string.IsNullOrEmpty(relPath), - fileElement.Location, "MissingAttribute", VSProjectAttributes.relPath, VSProjectElements.file); - // Remove the "RelPath" attribute, so we don't end up adding it twice. - fileElement.RemoveAttribute(VSProjectAttributes.relPath); - - // Get the "Link" attribute. This is for linked items only. - string linkPath = fileElement.GetAttribute(VSProjectAttributes.link); - // Remove the "Link" attribute, so we don't end up adding it twice. - fileElement.RemoveAttribute(VSProjectAttributes.link); - - // Get the "BuildAction" attribute. If it doesn't exist, figure out - // what the build action is based on the file extension. This is - // what the project loading code does in VS. - string buildAction = fileElement.GetAttribute(VSProjectAttributes.buildAction); - if (string.IsNullOrEmpty(buildAction)) - { - buildAction = VSProjectAttributes.buildActionNone; - } - // Remove the "BuildAction" attribute, so we don't end up adding it twice. - fileElement.RemoveAttribute(VSProjectAttributes.buildAction); - - ProjectItemElement newFileItem; - - // Bug Whidbey #248965. If a .resx file is completely empty, do not include a reference - // to it in the upgraded project file. - if (! - (String.Equals(Path.GetExtension(relPath), ".resx", StringComparison.OrdinalIgnoreCase) - && IsFilePresentButEmpty(relPath, linkPath)) - ) - { - // Add the new item to XMake. - if (string.IsNullOrEmpty(linkPath)) - { - // Normal item. - - // The element gets converted to XMake as a new item, where - // the item type is the BuildAction, and the "Include" contains - // the relative path to the item. For - // example, - // ----------------------------------------------------------------------- - // Everett format: - // =============== - // - // ----------------------------------------------------------------------- - // XMake format: - // ============= - // - // Code - // - // ----------------------------------------------------------------------- - newFileItem = filesItemGroup.AddItem(buildAction, ProjectCollection.Escape(relPath)); - } - else - { - // Linked item. - - // The element gets converted to XMake as a new item, where - // the item type is the BuildAction, the "Include" contains - // the physical relative path to the item, and the non-XMake "Link" - // attribute contains the project-relative path for item (for display - // purposes in the Solution Explorer). For example, - // ----------------------------------------------------------------------- - // Everett format: - // =============== - // - // ----------------------------------------------------------------------- - // XMake format: - // ============= - // - // Properties\PropertyGroupCollection.cs - // Code - // - // ----------------------------------------------------------------------- - newFileItem = filesItemGroup.AddItem(buildAction, ProjectCollection.Escape(linkPath)); - newFileItem.AddMetadata(XMakeProjectStrings.link, ProjectCollection.Escape(relPath)); - } - - // Add all the rest of the attributes on the element to the new - // XMake item. - foreach (XmlAttribute fileAttribute in fileElement.Attributes) - { - newFileItem.AddMetadata(fileAttribute.Name, ProjectCollection.Escape(fileAttribute.Value)); - } - - // If this is a VSD(devices) project and we're dealing with a content file, - // mark it to copy if newer. - if (((this.language == VSProjectElements.ECSharp) || - (this.language == VSProjectElements.EVisualBasic)) && - (String.Equals(buildAction, XMakeProjectStrings.content, StringComparison.OrdinalIgnoreCase))) - { - newFileItem.AddMetadata(XMakeProjectStrings.copytooutput, - XMakeProjectStrings.preservenewest); - } - } - else - { - string warning = ResourceUtilities.FormatString( - AssemblyResources.GetString("EmptyResxRemoved"), - relPath); - conversionWarnings.Add(warning); - } - - // There should be no children of the element. - ProjectXmlUtilities.VerifyThrowProjectNoChildElements(fileElement); - } - - /// - /// Checks whether a file has content. If it is empty, returns true. - /// If file does not exist we may be waiting for it to download asynchronously - /// via source control so return false to leave it in the project - /// - /// danmose - private bool IsFilePresentButEmpty(string relPath, string linkPath) - { - // relpath is the filename - // linkPath, if it exists, is the relative path from the project, or the absolute full path - string path; - if (string.IsNullOrEmpty(linkPath)) - { - path = Path.Combine(Path.GetDirectoryName(oldProjectFile), relPath); - } - else - { - if (Path.IsPathRooted(linkPath)) // absolute - { - path = linkPath; - } - else // relative - { - path = Path.Combine(Path.GetDirectoryName(oldProjectFile), linkPath); - } - } - - if (!File.Exists(path)) - { - // File does not exist - may be waiting to be download asynchronously via source control - // so return false to leave it in the project - return false; - } - - long length; - try - { - FileInfo fi = new FileInfo(path); - length = fi.Length; - } - catch (Exception e) // Catching Exception, but rethrowing unless it's a well-known exception. - { - if (ExceptionHandling.NotExpectedException(e)) - { - throw; - } - // if we can't say for sure it's empty, play safe and return false - return false; - } - - return length == 0; - } - - /// - /// Processes the <Folder> element, and adds an appropriate item to the - /// filesItemGroup. - /// - /// RGoel - private void ProcessFolderElement - ( - XmlElementWithLocation folderElement, - ProjectItemGroupElement filesItemGroup - ) - { - // Make sure this is the element. - error.VerifyThrow((folderElement?.Name == VSProjectElements.folder), - "Expected element."); - - // Make sure the caller has already created an ProjectItemGroupElement for us to - // put the new items in. - error.VerifyThrow(filesItemGroup != null, "Received null ProjectItemGroupElement"); - - // Get the required "RelPath" attribute. - string relPath = folderElement.GetAttribute(VSProjectAttributes.relPath); - ProjectErrorUtilities.VerifyThrowInvalidProject(!string.IsNullOrEmpty(relPath), - folderElement.Location, "MissingAttribute", VSProjectAttributes.relPath, VSProjectElements.folder); - // Remove the "RelPath" attribute, so we don't end up adding it twice. - folderElement.RemoveAttribute(VSProjectAttributes.relPath); - - // We need to find out what type of folder this is -- a web references - // folder, a web reference URL, or just an empty project folder. - - // See if there's a "WebReferences" attribute on the element. If so, - // and the value is set to "True", then it's a web reference folder. - string webReferences = folderElement.GetAttribute(VSProjectAttributes.webReferences); - // Remove the "WebReferences" attribute, so we don't end up adding it twice. - folderElement.RemoveAttribute(VSProjectAttributes.webReferences); - - // See if there's a "WebReferenceURL" attribute. If so, it's a web reference - // URL. - string webReferenceUrl = folderElement.GetAttribute(VSProjectAttributes.webReferenceUrl); - // Remove the "WebReferenceURL" attribute, so we don't end up adding it twice. - folderElement.RemoveAttribute(VSProjectAttributes.webReferenceUrl); - - ProjectItemElement newFolderItem; - - if ((webReferences != null) && (String.Equals(webReferences, "true", StringComparison.OrdinalIgnoreCase))) - { - // This is a web reference folder. - - // The element gets converted to XMake as an item of type - // "WebReferences". The "Include" will contain the relative path. - // For example, - // ----------------------------------------------------------------------- - // Everett format: - // =============== - // - // ----------------------------------------------------------------------- - // XMake format: - // ============= - // - // ----------------------------------------------------------------------- - newFolderItem = filesItemGroup.AddItem(XMakeProjectStrings.webReferences, - ProjectCollection.Escape(relPath)); - } - else if (!string.IsNullOrEmpty(webReferenceUrl)) - { - // This is an actual web reference URL. - - // The element gets converted to XMake as an item of type - // "WebReferenceURL". The "Include" will contain the URL. - // For example, - // ----------------------------------------------------------------------- - // Everett format: - // =============== - // - // ----------------------------------------------------------------------- - // XMake format: - // ============= - // - // Web References\mobileakipman\ - // Static - // - // ----------------------------------------------------------------------- - newFolderItem = filesItemGroup.AddItem(XMakeProjectStrings.webReferenceUrl, - ProjectCollection.Escape(webReferenceUrl)); - newFolderItem.AddMetadata(XMakeProjectStrings.relPath, ProjectCollection.Escape(relPath)); - - // Whidbey projects have some new properties to control the behavior of the - // proxy generation. For projects migrated from Everett, we want to force - // the proxy generation to mimic the Everett behavior, so that people's projects - // still work the same as they did in Everett. (These properties did not - // exist in Everett.) See spec at: - // http://devdiv/SpecTool/Documents/Whidbey/VSCore/Solution%20Project%20Build/FeatureSpecs/Project-WebReferences.doc - if (!this.newWebReferencePropertiesAdded) - { - this.globalPropertyGroup.AddProperty(XMakeProjectStrings.webRefEnableProperties, - (this.language == VSProjectElements.visualJSharp) ? "false" : "true"); - this.globalPropertyGroup.AddProperty(XMakeProjectStrings.webRefEnableSqlTypes, "false"); - this.globalPropertyGroup.AddProperty(XMakeProjectStrings.webRefEnableLegacyEventing, "true"); - - this.newWebReferencePropertiesAdded = true; - } - } - else - { - // This is just a project folder that happens not to have any files in it. - - // The element gets converted to XMake as an item of type "Folder". - // However, we do need to remove the trailing backslash, because XMake - // interprets that as a recursion (bug # 58591). For example, - // ----------------------------------------------------------------------- - // Everett format: - // =============== - // - // ----------------------------------------------------------------------- - // XMake format: - // ============= - // - // ----------------------------------------------------------------------- - - // Remove the trailing backslash. XMake interprets trailing backslashes - // as a recursive wildcard. This will be fixed in M2 -- bug # 58591 - if (relPath.EndsWith("\\", StringComparison.Ordinal)) - { - relPath = relPath.Remove(relPath.Length - 1, 1); - } - - newFolderItem = filesItemGroup.AddItem(XMakeProjectStrings.folder, - ProjectCollection.Escape(relPath)); - } - - // Add all the rest of the attributes on the element to the new - // XMake item. - foreach (XmlAttribute folderAttribute in folderElement.Attributes) - { - newFolderItem.AddMetadata(folderAttribute.Name, ProjectCollection.Escape(folderAttribute.Value)); - } - - // There should be no children of the element. - ProjectXmlUtilities.VerifyThrowProjectNoChildElements(folderElement); - } - - /// - /// Processes the <StartupServices> element, and everything within it. As - /// it is doing this, it will add new "StartupService" items to a new ProjectItemGroupElement. - /// - /// RGoel - private void ProcessStartupServicesElement - ( - XmlElementWithLocation startupServicesElement - ) - { - // Make sure this is the element. - error.VerifyThrow((startupServicesElement?.Name == VSProjectElements.startupServices), - "Expected element."); - - // Make sure the caller gave us a valid xmakeProject to stuff - // our new items into. - error.VerifyThrow(xmakeProject != null, "Expected valid xmake project object."); - - // The tag should have no attributes. - ProjectErrorUtilities.VerifyThrowInvalidProject(!startupServicesElement.HasAttributes, startupServicesElement.Location, - "NoAttributesExpected", VSProjectElements.startupServices); - - ProjectItemGroupElement startupServicesItemGroup = null; - - // Loop through all the direct child elements of the element. - foreach (XmlNode startupServicesChildNode in startupServicesElement) - { - // Handle XML comments under the the node (just ignore them). - if ((startupServicesChildNode.NodeType == XmlNodeType.Comment) || - (startupServicesChildNode.NodeType == XmlNodeType.Whitespace)) - { - continue; - } - - if (startupServicesChildNode.NodeType == XmlNodeType.Element) - { - XmlElementWithLocation startupServicesChildElement = (XmlElementWithLocation)startupServicesChildNode; - switch (startupServicesChildElement.Name) - { - // The element. - case VSProjectElements.service: - if (startupServicesItemGroup == null) - { - startupServicesItemGroup = xmakeProject.AddItemGroup(); - } - - this.ProcessServiceElement(startupServicesChildElement, startupServicesItemGroup); - break; - - default: - ProjectErrorUtilities.VerifyThrowInvalidProject(false, startupServicesChildElement.Location, - "UnrecognizedChildElement", startupServicesChildNode.Name, - VSProjectElements.startupServices); - break; - } - } - else - { - ProjectXmlUtilities.ThrowProjectInvalidChildElement(startupServicesChildNode.Name, startupServicesElement.Name, startupServicesElement.Location); - } - } - } - - /// - /// Processes the <Service> element, and add an appropriate reference - /// items to the startupServicesItemGroup. - /// - /// RGoel - private void ProcessServiceElement - ( - XmlElementWithLocation serviceElement, - ProjectItemGroupElement startupServicesItemGroup - ) - { - // Make sure this is the element. - error.VerifyThrow((serviceElement?.Name == VSProjectElements.service), - "Expected element."); - - // Make sure the caller has already created an ProjectItemGroupElement for us to - // put the new items in. - error.VerifyThrow(startupServicesItemGroup != null, "Received null ProjectItemGroupElement"); - - // Get the required "ID" attribute. - string id = serviceElement.GetAttribute(VSProjectAttributes.id); - ProjectErrorUtilities.VerifyThrowInvalidProject(!string.IsNullOrEmpty(id), serviceElement.Location, - "MissingAttribute", VSProjectAttributes.id, VSProjectElements.service); - // Remove the "ID" attribute, so it doesn't show up in our loop later. - serviceElement.RemoveAttribute(VSProjectAttributes.id); - - // The element gets converted to XMake as an item of type "Service". - // The "ID" attribute becomes the "Include" for the new item. For - // example, - // ----------------------------------------------------------------------- - // Everett format: - // =============== - // - // ----------------------------------------------------------------------- - // XMake format: - // ============= - // - // ----------------------------------------------------------------------- - startupServicesItemGroup.AddItem(XMakeProjectStrings.service, ProjectCollection.Escape(id)); - - // There should be no other attributes on the element (besides - // "ID" which we already took care of). But loop through them - // anyway, so we can emit a useful error message. - foreach (XmlAttributeWithLocation serviceAttribute in serviceElement.Attributes) - { - ProjectErrorUtilities.VerifyThrowInvalidProject(false, serviceAttribute.Location, "UnrecognizedAttribute", - serviceAttribute.Name, VSProjectElements.service); - } - - // There should be no children of the element. - ProjectXmlUtilities.VerifyThrowProjectNoChildElements(serviceElement); - } - - /// - /// Processes the <OtherProjectSettings> element, and everything within it. - /// As it is doing this, it will add stuff to the globalPropertyGroup. - /// - /// RGoel - private void ProcessOtherProjectSettingsElement - ( - XmlElementWithLocation otherProjectSettingsElement - ) - { - // Make sure this is the element. - error.VerifyThrow((otherProjectSettingsElement?.Name == VSProjectElements.otherProjectSettings), - "Expected element."); - - // Make sure the caller gave us a valid globalPropertyGroup to stuff - // our properties into. - error.VerifyThrow(globalPropertyGroup != null, "Expected valid global ProjectPropertyElementGroup."); - - // All of the attributes on the tag get converted to XMake - // properties. For example, - // ----------------------------------------------------------------------- - // Everett format: - // =============== - // - // ----------------------------------------------------------------------- - // XMake format: - // ============= - // - // - // - // 0 - // ProjectFiles - // 0 - // - // ----------------------------------------------------------------------- - this.AddXMakePropertiesFromXMLAttributes(this.globalPropertyGroup, otherProjectSettingsElement); - - // There should be no children of the element. - ProjectXmlUtilities.VerifyThrowProjectNoChildElements(otherProjectSettingsElement); - } - - /// - /// Processes the <UserProperties> element, and everything within it. - /// Basically, this element and its contents end up going verbatim into - /// the <ProjectExtensions> section of the newly converted MSBuild project - /// file. - /// - /// The one slight exception is that we do something special for Trinity - /// conversion. Specifically, if we detect that this is a White Rabbit - /// project, we add the flavor GUID for Triumph. - /// - /// - /// - /// rgoel - private void ProcessUserPropertiesElement - ( - XmlElementWithLocation userPropertiesElement, - out bool isTriumphProject - ) - { - // Make sure this is the element. - error.VerifyThrow((userPropertiesElement?.Name == VSProjectElements.userProperties), - "Expected element."); - - isTriumphProject = false; - - // All of the node goes into the section - // verbatim. The one exception is that if we detect a White Rabbit project, - // then we add the flavor GUID for Triumph. For example, - // ----------------------------------------------------------------------- - // Everett format: - // =============== - // - // ----------------------------------------------------------------------- - // XMake format: - // ============= - // - // - // - // ... - // {BAA0C2D2-18E2-41B9-852F-F413020CAA33};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - // ... - // - // ... - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // ----------------------------------------------------------------------- - - string visualStudioProjectExtensions = GetProjectExtensionsString(XMakeProjectStrings.visualStudio); - visualStudioProjectExtensions += userPropertiesElement.OuterXml; - - // If there are any attributes on the element that indicate that - // this was a White Rabbit project, add the Triumph flavor GUID. - if ( - (userPropertiesElement.Attributes[VSProjectAttributes.officeDocumentPath] != null) || - (userPropertiesElement.Attributes[VSProjectAttributes.officeDocumentType] != null) || - (userPropertiesElement.Attributes[VSProjectAttributes.officeProject] != null) - ) - { - isTriumphProject = true; - - // We need the language-specific Guid as well. - string languageGuid = String.Empty; - - if (this.language == VSProjectElements.cSharp) - { - languageGuid = XMakeProjectStrings.cSharpGuid; - } - else if (this.language == VSProjectElements.visualBasic) - { - languageGuid = XMakeProjectStrings.visualBasicGuid; - } - else if (this.language == VSProjectElements.visualJSharp) - { - languageGuid = XMakeProjectStrings.visualJSharpGuid; - } - else - { - error.VerifyThrow(false, "This project is not recognized as one of the following 3 languages: C#, VB, VJ#"); - } - - // Add a new global property called ProjectTypeGuids. - this.globalPropertyGroup.AddProperty(XMakeProjectStrings.projectTypeGuids, - "{" + XMakeProjectStrings.triumphProjectTypeGuid + "};{" + languageGuid + "}"); - - // Add the Office document as a "None" item in the converted project file. - XmlAttribute officeDocumentPathAttribute = userPropertiesElement.Attributes[VSProjectAttributes.officeDocumentPath]; - if (officeDocumentPathAttribute != null) - { - string officeDocumentPath = officeDocumentPathAttribute.Value; - if (!string.IsNullOrEmpty(officeDocumentPath)) - { - string projectFileDirectory = Path.GetDirectoryName(Path.GetFullPath(this.oldProjectFile)); - string officeDocumentFullPath = Path.GetFullPath(Path.Combine(projectFileDirectory, officeDocumentPath)); - - // If the office document is in the project directory ... - if (String.Equals(projectFileDirectory, Path.GetDirectoryName(officeDocumentFullPath), StringComparison.OrdinalIgnoreCase)) - { - // If the office document actually exists on disk ... - if (File.Exists(officeDocumentFullPath)) - { - // Add the office document as a "None" item to the converted project. - ProjectItemGroupElement officeDocumentItemGroup = this.xmakeProject.AddItemGroup(); - officeDocumentItemGroup.AddItem("None", ProjectCollection.Escape(officeDocumentPath)); - } - } - } - } - } - - SetProjectExtensionsString(XMakeProjectStrings.visualStudio, visualStudioProjectExtensions); - } - - /// - /// Fix hard-coded fully qualified paths in Code Analysis properties. - /// - /// Due to a bug in Whidbey configuration cloning, some Code Analysis - /// properties in Whidbey project files contain fully qualified paths. - /// They need to be detected and removed during project conversion so - /// that Code Analysis will work on converted Whidbey projects. - /// - /// duanek - /// true if changes were required, false otherwise - // ----------------------------------------------------------------------- - // XMake format: - // ============= - // - // ... - // - // ... - // C:\Program Files\Microsoft Visual Studio 8\Team Tools\Static Analysis Tools\FxCop\\rules - // ... - // - // ... - // - // ----------------------------------------------------------------------- - private bool FixCodeAnalysisPaths() - { - bool changedProject = false; - - // Iterate over all nodes - // Look for a node - foreach (ProjectPropertyElement ProjectPropertyElement in xmakeProject.Properties) - { - if (ProjectPropertyElement.Name == XMakeProjectStrings.codeAnalysisRuleAssemblies) - { - // We do not want to blindly remove this property since it - // is valid for the user to modify it in the project file. - - // The default value in Microsoft.CodeAnalysis.Targets - // is a rooted path ending in "FxCop\\rules". - if (Path.IsPathRooted(ProjectPropertyElement.Value)) - { - if (ProjectPropertyElement.Value.EndsWith(@"FxCop\\rules", StringComparison.Ordinal)) - { - ProjectPropertyElement.Parent.RemoveChild(ProjectPropertyElement); - changedProject = true; - } - } - - break; - } - } - - return changedProject; - } - - /// - /// Find the first property with the provided name in the ProjectRootElement. - /// If none is found, returns null. - /// - private ProjectPropertyElement FindPropertyIfPresent(ProjectRootElement project, string name) - { - foreach (ProjectPropertyElement property in project.Properties) - { - if (String.Equals(property.Name, name, StringComparison.OrdinalIgnoreCase)) - { - return property; - } - } - - return null; - } - - /// - /// Get the project extensions string with a particular ID, - /// or empty string if it does not exist or there is no project extensions at all - /// - private string GetProjectExtensionsString(string id) - { - ProjectExtensionsElement element = xmakeProject.ProjectExtensions; - - return (element == null) ? String.Empty : element[id]; - } - - /// - /// Set a project extensions string with the provided Id, - /// even if there is no project extensions tag at present - /// - private void SetProjectExtensionsString(string id, string content) - { - ProjectExtensionsElement element = xmakeProject.ProjectExtensions; - - if (element == null) - { - element = xmakeProject.CreateProjectExtensionsElement(); - xmakeProject.AppendChild(element); - } - - element[id] = content; - } - } -} diff --git a/src/Deprecated/Conversion/README.md b/src/Deprecated/Conversion/README.md deleted file mode 100644 index 3e39338920b..00000000000 --- a/src/Deprecated/Conversion/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Microsoft.Build.Conversion.Core - -⚠️ This package is **deprecated** and should not be referenced. It will be removed in a future version of MSBuild. - -Contains `Microsoft.Build.Conversion.Core.dll`, which is provided with MSBuild for compatibility purposes. diff --git a/src/Deprecated/Conversion/Resources/Strings.resx b/src/Deprecated/Conversion/Resources/Strings.resx deleted file mode 100644 index 7aa5726a4f8..00000000000 --- a/src/Deprecated/Conversion/Resources/Strings.resx +++ /dev/null @@ -1,190 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - MSB2013: The project-to-project reference with GUID {0} could not be converted because a valid .SLN file containing all projects could not be found. - {StrBegin="MSB2013: "} - - - MSB2016: Found an empty .RESX file in the project ({0}). Removing it from the converted project. - {StrBegin="MSB2016: "} - - - MSB2015: Found an <Exclude> element in the original project file. This cannot be converted to Visual Studio .NET and is being ignored. - {StrBegin="MSB2015: "} - - - MSB2001: Element <{0}> does not contain the required attribute "{1}". - {StrBegin="MSB2001: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - - MSB2002: The file name of the new project must be specified. - {StrBegin="MSB2002: "}This error shouldn't be possible when converting through Visual Studio, but we have it just in case. - - - MSB2003: The file name of the old project must be specified. - {StrBegin="MSB2003: "}This error shouldn't be possible when converting through Visual Studio, but we have it just in case. - - - MSB2004: Element <{0}> cannot contain more than one language node. - {StrBegin="MSB2004: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. The {0} in this case is going to be "VisualStudioProject". - - - MSB2005: Element <{0}> cannot contain attributes. - {StrBegin="MSB2005: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - - MSB2006: The project file does not contain the root element <{0}>. - {StrBegin="MSB2006: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - - MSB2007: Visual Studio cannot find the project file "{0}". - {StrBegin="MSB2007: "}This error shouldn't be possible when converting through Visual Studio, but we have it just in case. - - - MSB2014: The project-to-project reference with GUID {0} cannot be converted because it is not listed in the file '{1}'. - {StrBegin="MSB2014: "} - - - MSB2008: This Visual Studio project system cannot convert "{0}" projects. It can only be used to convert C#, VB, and VJ# client projects. - {StrBegin="MSB2008: "}It appears we've been asked to convert a project that either wasn't created by the Visual Studio managed client project system (C#, VB, J#), or that has been hand-modified or corrupted. You would get this error if this conversion utility was invoked on a VC++ project (.VCPROJ) for example. In this case, the {0} would be replaced with "Visual C++". - - - MSB2009: Attribute "{0}" of element <{1}> is not valid. - {StrBegin="MSB2009: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - - MSB2010: Child element <{0}> of element <{1}> is not valid. - {StrBegin="MSB2010: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - - MSB2011: Element <{0}> is not valid. - {StrBegin="MSB2011: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - - MSB2012: Project-to-project references to web projects are no longer supported and therefore cannot be converted. Please remove the reference to project {0} and add it again. - {StrBegin="MSB2012: "} - - - diff --git a/src/Deprecated/Conversion/Resources/xlf/Strings.cs.xlf b/src/Deprecated/Conversion/Resources/xlf/Strings.cs.xlf deleted file mode 100644 index 71cedc89897..00000000000 --- a/src/Deprecated/Conversion/Resources/xlf/Strings.cs.xlf +++ /dev/null @@ -1,169 +0,0 @@ - - - -
- - 231 - 107.05 - 107.05 - 0 - 0 - - - 0 - 26 - 112 - 0 - 0 - 93 - 0 - -
- - - MSB2013: The project-to-project reference with GUID {0} could not be converted because a valid .SLN file containing all projects could not be found. - MSB2013: Meziprojektový odkaz s identifikací GUID {0} nebylo možno převést, protože nebyl nalezen platný soubor SLN obsahující všechny projekty. - {StrBegin="MSB2013: "} - - MSB2013: Der Interprojektverweis mit der GUID {0} konnte nicht konvertiert werden, da keine gültige SLN-Datei mit allen Projekten gefunden wurde. - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - MSB2016: Found an empty .RESX file in the project ({0}). Removing it from the converted project. - MSB2016: V projektu byl nalezen prázdný soubor RESX ({0}). Soubor bude z převedeného projektu odebrán. - {StrBegin="MSB2016: "} - - MSB2016: Eine leere RESX-Datei wurde im Projekt "({0})" gefunden. Die Datei wird aus dem konvertierten Projekt entfernt. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB2015: Found an <Exclude> element in the original project file. This cannot be converted to Visual Studio .NET and is being ignored. - MSB2015: V původním souboru projektu byl nalezen element <Exclude>. Tento element nelze převést do formátu aplikace Visual Studio .NET, a proto bude ignorován. - {StrBegin="MSB2015: "} - - MSB2015: Gefunden Sie ein < Exclude > Element in der Projektdatei. Dies kann nicht in Visual Studio .NET konvertiert werden und wird ignoriert. - - fuzzyMatch="15" wordcount="23" adjWordcount="19.55" curWordcount="19.55" - - - MSB2001: Element <{0}> does not contain the required attribute "{1}". - MSB2001: Element <{0}> neobsahuje požadovaný atribut {1}. - {StrBegin="MSB2001: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2001: Element <{0}> enthält nicht das erforderliche Attribut "{1}". - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB2002: The file name of the new project must be specified. - MSB2002: Je nutné zadat název souboru nového projektu. - {StrBegin="MSB2002: "}This error shouldn't be possible when converting through Visual Studio, but we have it just in case. - - MSB2002: Der Dateiname des neuen Projekts muss angegeben werden. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB2003: The file name of the old project must be specified. - MSB2003: Je nutné zadat název souboru starého projektu. - {StrBegin="MSB2003: "}This error shouldn't be possible when converting through Visual Studio, but we have it just in case. - - MSB2003: Der Dateiname des alten Projekts muss angegeben werden. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB2004: Element <{0}> cannot contain more than one language node. - MSB2004: Element <{0}> nemůže obsahovat více než jeden uzel jazyka. - {StrBegin="MSB2004: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. The {0} in this case is going to be "VisualStudioProject". - - MSB2004: Element <{0}> darf nicht mehr als einen Sprachknoten enthalten. - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB2005: Element <{0}> cannot contain attributes. - MSB2005: Element <{0}> nemůže obsahovat atributy. - {StrBegin="MSB2005: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2005: Element <{0}> darf keine Attribute enthalten. - - fuzzyMatch="15" wordcount="7" adjWordcount="5.95" curWordcount="5.95" - - - MSB2006: The project file does not contain the root element <{0}>. - MSB2006: Soubor projektu neobsahuje kořenový element <{0}>. - {StrBegin="MSB2006: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2006: Die Projektdatei enthält kein Stammelement <{0}>. - - fuzzyMatch="15" wordcount="12" adjWordcount="10.2" curWordcount="10.2" - - - MSB2007: Visual Studio cannot find the project file "{0}". - MSB2007: Aplikaci Visual Studio se nepodařilo nalézt soubor projektu {0}. - {StrBegin="MSB2007: "}This error shouldn't be possible when converting through Visual Studio, but we have it just in case. - - MSB2007: Die Projektdatei "{0}" wurde nicht gefunden. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB2014: The project-to-project reference with GUID {0} cannot be converted because it is not listed in the file '{1}'. - MSB2014: Meziprojektový odkaz s identifikací GUID {0} nebylo možno převést, protože není uveden v souboru {1}. - {StrBegin="MSB2014: "} - - MSB2014: Der Interprojektverweis mit der GUID {0} kann nicht konvertiert werden, da er nicht in der Datei "{1}" enthalten ist. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB2008: This Visual Studio project system cannot convert "{0}" projects. It can only be used to convert C#, VB, and VJ# client projects. - MSB2008: Tento systém projektů Visual Studio nemůže převést projekty {0}. Lze jej použít pouze k převodu klientských projektů v jazycích C#, Visual Basic a Visual J#. - {StrBegin="MSB2008: "}It appears we've been asked to convert a project that either wasn't created by the Visual Studio managed client project system (C#, VB, J#), or that has been hand-modified or corrupted. You would get this error if this conversion utility was invoked on a VC++ project (.VCPROJ) for example. In this case, the {0} would be replaced with "Visual C++". - - MSB2008: Mit diesem Visual Studio-Projektsystem können keine {0}-Projekte konvertiert werden. Mit diesem System können nur C#-, VB- und VJ#-Clientprojekte konvertiert werden. - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - MSB2009: Attribute "{0}" of element <{1}> is not valid. - MSB2009: Atribut {0} elementu <{1}> není platný. - {StrBegin="MSB2009: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2009: Das Attribut "{0}" des Elements <{1}> ist ungültig. - - fuzzyMatch="15" wordcount="10" adjWordcount="8.5" curWordcount="8.5" - - - MSB2010: Child element <{0}> of element <{1}> is not valid. - MSB2010: Podřízený element <{0}> elementu <{1}> není platný. - {StrBegin="MSB2010: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2010: Untergeordnete Element <{0}> Element <{1}> ist ungültig. - - fuzzyMatch="15" wordcount="12" adjWordcount="10.2" curWordcount="10.2" - - - MSB2011: Element <{0}> is not valid. - MSB2011: Element <{0}> není platný. - {StrBegin="MSB2011: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2011: Element <{0}> ist ungültig. - - fuzzyMatch="15" wordcount="7" adjWordcount="5.95" curWordcount="5.95" - - - MSB2012: Project-to-project references to web projects are no longer supported and therefore cannot be converted. Please remove the reference to project {0} and add it again. - MSB2012: Meziprojektové odkazy na webové projekty již nejsou podporovány, a proto nemohou být převedeny. Odeberte odkaz na projekt {0} a přidejte jej znovu. - {StrBegin="MSB2012: "} - - MSB2012: Interprojektverweise auf Webprojekte werden nicht mehr unterstützt und können daher nicht konvertiert werden. Entfernen Sie den Verweis auf das Projekt "{0}", und fügen Sie es erneut hinzu. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - -
-
\ No newline at end of file diff --git a/src/Deprecated/Conversion/Resources/xlf/Strings.de.xlf b/src/Deprecated/Conversion/Resources/xlf/Strings.de.xlf deleted file mode 100644 index 06d47da226f..00000000000 --- a/src/Deprecated/Conversion/Resources/xlf/Strings.de.xlf +++ /dev/null @@ -1,169 +0,0 @@ - - - -
- - 231 - 107.05 - 107.05 - 0 - 0 - - - 0 - 26 - 112 - 0 - 0 - 93 - 0 - -
- - - MSB2013: The project-to-project reference with GUID {0} could not be converted because a valid .SLN file containing all projects could not be found. - MSB2013: Der Interprojektverweis mit der GUID {0} konnte nicht konvertiert werden, da keine gültige SLN-Datei mit allen Projekten gefunden wurde. - {StrBegin="MSB2013: "} - - MSB2013: Der Interprojektverweis mit der GUID {0} konnte nicht konvertiert werden, da keine gültige SLN-Datei mit allen Projekten gefunden wurde. - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - MSB2016: Found an empty .RESX file in the project ({0}). Removing it from the converted project. - MSB2016: Eine leere RESX-Datei wurde im Projekt "({0})" gefunden. Die Datei wird aus dem konvertierten Projekt entfernt. - {StrBegin="MSB2016: "} - - MSB2016: Eine leere RESX-Datei wurde im Projekt "({0})" gefunden. Die Datei wird aus dem konvertierten Projekt entfernt. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB2015: Found an <Exclude> element in the original project file. This cannot be converted to Visual Studio .NET and is being ignored. - MSB2015: Ein <Exclude>-Element wurde in der ursprünglichen Projektdatei gefunden. Dieses Element kann nicht in Visual Studio .NET konvertiert werden und wird ignoriert. - {StrBegin="MSB2015: "} - - MSB2015: Gefunden Sie ein < Exclude > Element in der Projektdatei. Dies kann nicht in Visual Studio .NET konvertiert werden und wird ignoriert. - - fuzzyMatch="15" wordcount="23" adjWordcount="19.55" curWordcount="19.55" - - - MSB2001: Element <{0}> does not contain the required attribute "{1}". - MSB2001: Das <{0}>-Element enthält nicht das erforderliche {1}-Attribut. - {StrBegin="MSB2001: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2001: Element <{0}> enthält nicht das erforderliche Attribut "{1}". - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB2002: The file name of the new project must be specified. - MSB2002: Der Dateiname des neuen Projekts muss angegeben werden. - {StrBegin="MSB2002: "}This error shouldn't be possible when converting through Visual Studio, but we have it just in case. - - MSB2002: Der Dateiname des neuen Projekts muss angegeben werden. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB2003: The file name of the old project must be specified. - MSB2003: Der Dateiname des alten Projekts muss angegeben werden. - {StrBegin="MSB2003: "}This error shouldn't be possible when converting through Visual Studio, but we have it just in case. - - MSB2003: Der Dateiname des alten Projekts muss angegeben werden. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB2004: Element <{0}> cannot contain more than one language node. - MSB2004: Das <{0}>-Element darf nur einen Sprachknoten enthalten. - {StrBegin="MSB2004: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. The {0} in this case is going to be "VisualStudioProject". - - MSB2004: Element <{0}> darf nicht mehr als einen Sprachknoten enthalten. - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB2005: Element <{0}> cannot contain attributes. - MSB2005: Das <{0}>-Element darf keine Attribute enthalten. - {StrBegin="MSB2005: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2005: Element <{0}> darf keine Attribute enthalten. - - fuzzyMatch="15" wordcount="7" adjWordcount="5.95" curWordcount="5.95" - - - MSB2006: The project file does not contain the root element <{0}>. - MSB2006: In der Projektdatei ist das <{0}>-Stammelement nicht enthalten. - {StrBegin="MSB2006: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2006: Die Projektdatei enthält kein Stammelement <{0}>. - - fuzzyMatch="15" wordcount="12" adjWordcount="10.2" curWordcount="10.2" - - - MSB2007: Visual Studio cannot find the project file "{0}". - MSB2007: Die Projektdatei "{0}" wurde nicht gefunden. - {StrBegin="MSB2007: "}This error shouldn't be possible when converting through Visual Studio, but we have it just in case. - - MSB2007: Die Projektdatei "{0}" wurde nicht gefunden. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB2014: The project-to-project reference with GUID {0} cannot be converted because it is not listed in the file '{1}'. - MSB2014: Der Interprojektverweis mit der GUID {0} kann nicht konvertiert werden, da er nicht in der Datei "{1}" enthalten ist. - {StrBegin="MSB2014: "} - - MSB2014: Der Interprojektverweis mit der GUID {0} kann nicht konvertiert werden, da er nicht in der Datei "{1}" enthalten ist. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB2008: This Visual Studio project system cannot convert "{0}" projects. It can only be used to convert C#, VB, and VJ# client projects. - MSB2008: Mit diesem Visual Studio-Projektsystem können keine {0}-Projekte konvertiert werden. Mit diesem System können nur C#-, VB- und VJ#-Clientprojekte konvertiert werden. - {StrBegin="MSB2008: "}It appears we've been asked to convert a project that either wasn't created by the Visual Studio managed client project system (C#, VB, J#), or that has been hand-modified or corrupted. You would get this error if this conversion utility was invoked on a VC++ project (.VCPROJ) for example. In this case, the {0} would be replaced with "Visual C++". - - MSB2008: Mit diesem Visual Studio-Projektsystem können keine {0}-Projekte konvertiert werden. Mit diesem System können nur C#-, VB- und VJ#-Clientprojekte konvertiert werden. - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - MSB2009: Attribute "{0}" of element <{1}> is not valid. - MSB2009: Das {0}-Attribut des <{1}>-Elements ist ungültig. - {StrBegin="MSB2009: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2009: Das Attribut "{0}" des Elements <{1}> ist ungültig. - - fuzzyMatch="15" wordcount="10" adjWordcount="8.5" curWordcount="8.5" - - - MSB2010: Child element <{0}> of element <{1}> is not valid. - MSB2010: Das untergeordnete <{0}>-Element des <{1}>-Elements ist ungültig. - {StrBegin="MSB2010: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2010: Untergeordnete Element <{0}> Element <{1}> ist ungültig. - - fuzzyMatch="15" wordcount="12" adjWordcount="10.2" curWordcount="10.2" - - - MSB2011: Element <{0}> is not valid. - MSB2011: Das <{0}>-Element ist ungültig. - {StrBegin="MSB2011: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2011: Element <{0}> ist ungültig. - - fuzzyMatch="15" wordcount="7" adjWordcount="5.95" curWordcount="5.95" - - - MSB2012: Project-to-project references to web projects are no longer supported and therefore cannot be converted. Please remove the reference to project {0} and add it again. - MSB2012: Interprojektverweise auf Webprojekte werden nicht mehr unterstützt und können daher nicht konvertiert werden. Entfernen Sie den Verweis auf das Projekt "{0}", und fügen Sie es erneut hinzu. - {StrBegin="MSB2012: "} - - MSB2012: Interprojektverweise auf Webprojekte werden nicht mehr unterstützt und können daher nicht konvertiert werden. Entfernen Sie den Verweis auf das Projekt "{0}", und fügen Sie es erneut hinzu. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - -
-
\ No newline at end of file diff --git a/src/Deprecated/Conversion/Resources/xlf/Strings.es.xlf b/src/Deprecated/Conversion/Resources/xlf/Strings.es.xlf deleted file mode 100644 index 89d087f8822..00000000000 --- a/src/Deprecated/Conversion/Resources/xlf/Strings.es.xlf +++ /dev/null @@ -1,169 +0,0 @@ - - - -
- - 231 - 107.05 - 107.05 - 0 - 0 - - - 0 - 26 - 112 - 0 - 0 - 93 - 0 - -
- - - MSB2013: The project-to-project reference with GUID {0} could not be converted because a valid .SLN file containing all projects could not be found. - MSB2013: La referencia entre proyectos con GUID {0} no se pudo convertir porque no se encuentra un archivo .SLN válido con todos los proyectos. - {StrBegin="MSB2013: "} - - MSB2013: Der Interprojektverweis mit der GUID {0} konnte nicht konvertiert werden, da keine gültige SLN-Datei mit allen Projekten gefunden wurde. - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - MSB2016: Found an empty .RESX file in the project ({0}). Removing it from the converted project. - MSB2016: Se encontró un archivo .RESX vacío en el proyecto ({0}). Se quitará del proyecto convertido. - {StrBegin="MSB2016: "} - - MSB2016: Eine leere RESX-Datei wurde im Projekt "({0})" gefunden. Die Datei wird aus dem konvertierten Projekt entfernt. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB2015: Found an <Exclude> element in the original project file. This cannot be converted to Visual Studio .NET and is being ignored. - MSB2015: Se encontró un elemento <Exclude> en el archivo del proyecto original. No se puede convertir a Visual Studio .NET y se omitirá. - {StrBegin="MSB2015: "} - - MSB2015: Gefunden Sie ein < Exclude > Element in der Projektdatei. Dies kann nicht in Visual Studio .NET konvertiert werden und wird ignoriert. - - fuzzyMatch="15" wordcount="23" adjWordcount="19.55" curWordcount="19.55" - - - MSB2001: Element <{0}> does not contain the required attribute "{1}". - MSB2001: El elemento <{0}> no contiene el atributo necesario "{1}". - {StrBegin="MSB2001: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2001: Element <{0}> enthält nicht das erforderliche Attribut "{1}". - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB2002: The file name of the new project must be specified. - MSB2002: Debe especificarse el nombre de archivo del nuevo proyecto. - {StrBegin="MSB2002: "}This error shouldn't be possible when converting through Visual Studio, but we have it just in case. - - MSB2002: Der Dateiname des neuen Projekts muss angegeben werden. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB2003: The file name of the old project must be specified. - MSB2003: Debe especificarse el nombre de archivo del proyecto anterior. - {StrBegin="MSB2003: "}This error shouldn't be possible when converting through Visual Studio, but we have it just in case. - - MSB2003: Der Dateiname des alten Projekts muss angegeben werden. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB2004: Element <{0}> cannot contain more than one language node. - MSB2004: El elemento <{0}> no puede contener más de un nodo de lenguaje. - {StrBegin="MSB2004: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. The {0} in this case is going to be "VisualStudioProject". - - MSB2004: Element <{0}> darf nicht mehr als einen Sprachknoten enthalten. - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB2005: Element <{0}> cannot contain attributes. - MSB2005: El elemento <{0}> no puede contener atributos. - {StrBegin="MSB2005: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2005: Element <{0}> darf keine Attribute enthalten. - - fuzzyMatch="15" wordcount="7" adjWordcount="5.95" curWordcount="5.95" - - - MSB2006: The project file does not contain the root element <{0}>. - MSB2006: El archivo del proyecto no contiene el elemento raíz <{0}>. - {StrBegin="MSB2006: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2006: Die Projektdatei enthält kein Stammelement <{0}>. - - fuzzyMatch="15" wordcount="12" adjWordcount="10.2" curWordcount="10.2" - - - MSB2007: Visual Studio cannot find the project file "{0}". - MSB2007: Visual Studio no encuentra el archivo del proyecto "{0}". - {StrBegin="MSB2007: "}This error shouldn't be possible when converting through Visual Studio, but we have it just in case. - - MSB2007: Die Projektdatei "{0}" wurde nicht gefunden. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB2014: The project-to-project reference with GUID {0} cannot be converted because it is not listed in the file '{1}'. - MSB2014: La referencia entre proyectos con GUID {0} no se puede convertir porque no aparece en el archivo '{1}'. - {StrBegin="MSB2014: "} - - MSB2014: Der Interprojektverweis mit der GUID {0} kann nicht konvertiert werden, da er nicht in der Datei "{1}" enthalten ist. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB2008: This Visual Studio project system cannot convert "{0}" projects. It can only be used to convert C#, VB, and VJ# client projects. - MSB2008: Este sistema de proyectos de Visual Studio no puede convertir proyectos de "{0}". Solo se puede usar para convertir proyectos de cliente C#, VB y VJ#. - {StrBegin="MSB2008: "}It appears we've been asked to convert a project that either wasn't created by the Visual Studio managed client project system (C#, VB, J#), or that has been hand-modified or corrupted. You would get this error if this conversion utility was invoked on a VC++ project (.VCPROJ) for example. In this case, the {0} would be replaced with "Visual C++". - - MSB2008: Mit diesem Visual Studio-Projektsystem können keine {0}-Projekte konvertiert werden. Mit diesem System können nur C#-, VB- und VJ#-Clientprojekte konvertiert werden. - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - MSB2009: Attribute "{0}" of element <{1}> is not valid. - MSB2009: El atributo "{0}" del elemento <{1}> no es válido. - {StrBegin="MSB2009: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2009: Das Attribut "{0}" des Elements <{1}> ist ungültig. - - fuzzyMatch="15" wordcount="10" adjWordcount="8.5" curWordcount="8.5" - - - MSB2010: Child element <{0}> of element <{1}> is not valid. - MSB2010: El elemento secundario <{0}> del elemento <{1}> no es válido. - {StrBegin="MSB2010: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2010: Untergeordnete Element <{0}> Element <{1}> ist ungültig. - - fuzzyMatch="15" wordcount="12" adjWordcount="10.2" curWordcount="10.2" - - - MSB2011: Element <{0}> is not valid. - MSB2011: El elemento <{0}> no es válido. - {StrBegin="MSB2011: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2011: Element <{0}> ist ungültig. - - fuzzyMatch="15" wordcount="7" adjWordcount="5.95" curWordcount="5.95" - - - MSB2012: Project-to-project references to web projects are no longer supported and therefore cannot be converted. Please remove the reference to project {0} and add it again. - MSB2012: La referencia entre proyectos a los proyectos web ya no se admite y, en consecuencia, no se puede convertir. Quite la referencia al proyecto {0} y agréguela de nuevo. - {StrBegin="MSB2012: "} - - MSB2012: Interprojektverweise auf Webprojekte werden nicht mehr unterstützt und können daher nicht konvertiert werden. Entfernen Sie den Verweis auf das Projekt "{0}", und fügen Sie es erneut hinzu. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - -
-
\ No newline at end of file diff --git a/src/Deprecated/Conversion/Resources/xlf/Strings.fr.xlf b/src/Deprecated/Conversion/Resources/xlf/Strings.fr.xlf deleted file mode 100644 index dac7ff2b947..00000000000 --- a/src/Deprecated/Conversion/Resources/xlf/Strings.fr.xlf +++ /dev/null @@ -1,169 +0,0 @@ - - - -
- - 231 - 107.05 - 107.05 - 0 - 0 - - - 0 - 26 - 112 - 0 - 0 - 93 - 0 - -
- - - MSB2013: The project-to-project reference with GUID {0} could not be converted because a valid .SLN file containing all projects could not be found. - MSB2013: Impossible de convertir la référence entre projets avec le GUID {0} car le fichier .SLN valide qui contient tous les projets est introuvable. - {StrBegin="MSB2013: "} - - MSB2013: Der Interprojektverweis mit der GUID {0} konnte nicht konvertiert werden, da keine gültige SLN-Datei mit allen Projekten gefunden wurde. - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - MSB2016: Found an empty .RESX file in the project ({0}). Removing it from the converted project. - MSB2016: Fichier .RESX vide trouvé dans le projet ({0}). Suppression de ce fichier dans le projet converti. - {StrBegin="MSB2016: "} - - MSB2016: Eine leere RESX-Datei wurde im Projekt "({0})" gefunden. Die Datei wird aus dem konvertierten Projekt entfernt. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB2015: Found an <Exclude> element in the original project file. This cannot be converted to Visual Studio .NET and is being ignored. - MSB2015: Élément <Exclude> trouvé dans le fichier projet d'origine. Sa conversion à Visual Studio .NET étant impossible, il est ignoré. - {StrBegin="MSB2015: "} - - MSB2015: Gefunden Sie ein < Exclude > Element in der Projektdatei. Dies kann nicht in Visual Studio .NET konvertiert werden und wird ignoriert. - - fuzzyMatch="15" wordcount="23" adjWordcount="19.55" curWordcount="19.55" - - - MSB2001: Element <{0}> does not contain the required attribute "{1}". - MSB2001: L'élément <{0}> ne contient pas l'attribut "{1}" requis. - {StrBegin="MSB2001: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2001: Element <{0}> enthält nicht das erforderliche Attribut "{1}". - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB2002: The file name of the new project must be specified. - MSB2002: Le nom de fichier du nouveau projet doit être spécifié. - {StrBegin="MSB2002: "}This error shouldn't be possible when converting through Visual Studio, but we have it just in case. - - MSB2002: Der Dateiname des neuen Projekts muss angegeben werden. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB2003: The file name of the old project must be specified. - MSB2003: Le nom de fichier de l'ancien projet doit être spécifié. - {StrBegin="MSB2003: "}This error shouldn't be possible when converting through Visual Studio, but we have it just in case. - - MSB2003: Der Dateiname des alten Projekts muss angegeben werden. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB2004: Element <{0}> cannot contain more than one language node. - MSB2004: L'élément <{0}> ne peut pas contenir plusieurs nœuds de langage. - {StrBegin="MSB2004: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. The {0} in this case is going to be "VisualStudioProject". - - MSB2004: Element <{0}> darf nicht mehr als einen Sprachknoten enthalten. - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB2005: Element <{0}> cannot contain attributes. - MSB2005: L'élément <{0}> ne peut pas contenir d'attributs. - {StrBegin="MSB2005: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2005: Element <{0}> darf keine Attribute enthalten. - - fuzzyMatch="15" wordcount="7" adjWordcount="5.95" curWordcount="5.95" - - - MSB2006: The project file does not contain the root element <{0}>. - MSB2006: Le fichier projet ne contient pas l'élément racine <{0}>. - {StrBegin="MSB2006: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2006: Die Projektdatei enthält kein Stammelement <{0}>. - - fuzzyMatch="15" wordcount="12" adjWordcount="10.2" curWordcount="10.2" - - - MSB2007: Visual Studio cannot find the project file "{0}". - MSB2007: Visual Studio ne peut pas trouver le fichier projet "{0}". - {StrBegin="MSB2007: "}This error shouldn't be possible when converting through Visual Studio, but we have it just in case. - - MSB2007: Die Projektdatei "{0}" wurde nicht gefunden. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB2014: The project-to-project reference with GUID {0} cannot be converted because it is not listed in the file '{1}'. - MSB2014: Impossible de convertir la référence entre projets avec le GUID {0}, car elle n'est pas listée dans le fichier '{1}'. - {StrBegin="MSB2014: "} - - MSB2014: Der Interprojektverweis mit der GUID {0} kann nicht konvertiert werden, da er nicht in der Datei "{1}" enthalten ist. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB2008: This Visual Studio project system cannot convert "{0}" projects. It can only be used to convert C#, VB, and VJ# client projects. - MSB2008: Ce système de projet Visual Studio ne peut pas convertir les projets "{0}". Il ne permet de convertir que les projets clients C#, VB et VJ#. - {StrBegin="MSB2008: "}It appears we've been asked to convert a project that either wasn't created by the Visual Studio managed client project system (C#, VB, J#), or that has been hand-modified or corrupted. You would get this error if this conversion utility was invoked on a VC++ project (.VCPROJ) for example. In this case, the {0} would be replaced with "Visual C++". - - MSB2008: Mit diesem Visual Studio-Projektsystem können keine {0}-Projekte konvertiert werden. Mit diesem System können nur C#-, VB- und VJ#-Clientprojekte konvertiert werden. - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - MSB2009: Attribute "{0}" of element <{1}> is not valid. - MSB2009: L'attribut "{0}" de l'élément <{1}> n'est pas valide. - {StrBegin="MSB2009: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2009: Das Attribut "{0}" des Elements <{1}> ist ungültig. - - fuzzyMatch="15" wordcount="10" adjWordcount="8.5" curWordcount="8.5" - - - MSB2010: Child element <{0}> of element <{1}> is not valid. - MSB2010: L'élément enfant <{0}> de l'élément <{1}> n'est pas valide. - {StrBegin="MSB2010: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2010: Untergeordnete Element <{0}> Element <{1}> ist ungültig. - - fuzzyMatch="15" wordcount="12" adjWordcount="10.2" curWordcount="10.2" - - - MSB2011: Element <{0}> is not valid. - MSB2011: L'élément <{0}> n'est pas valide. - {StrBegin="MSB2011: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2011: Element <{0}> ist ungültig. - - fuzzyMatch="15" wordcount="7" adjWordcount="5.95" curWordcount="5.95" - - - MSB2012: Project-to-project references to web projects are no longer supported and therefore cannot be converted. Please remove the reference to project {0} and add it again. - MSB2012: Les références entre projets aux projets Web ne sont plus prises en charge et ne peuvent donc pas être converties. Supprimez la référence au projet {0}, puis ajoutez-la à nouveau. - {StrBegin="MSB2012: "} - - MSB2012: Interprojektverweise auf Webprojekte werden nicht mehr unterstützt und können daher nicht konvertiert werden. Entfernen Sie den Verweis auf das Projekt "{0}", und fügen Sie es erneut hinzu. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - -
-
\ No newline at end of file diff --git a/src/Deprecated/Conversion/Resources/xlf/Strings.it.xlf b/src/Deprecated/Conversion/Resources/xlf/Strings.it.xlf deleted file mode 100644 index 4e8cb64f37f..00000000000 --- a/src/Deprecated/Conversion/Resources/xlf/Strings.it.xlf +++ /dev/null @@ -1,169 +0,0 @@ - - - -
- - 231 - 107.05 - 107.05 - 0 - 0 - - - 0 - 26 - 112 - 0 - 0 - 93 - 0 - -
- - - MSB2013: The project-to-project reference with GUID {0} could not be converted because a valid .SLN file containing all projects could not be found. - MSB2013: non è stato possibile convertire il riferimento da progetto a progetto con GUID {0} perché non è stato trovato un file con estensione sln valido contenente tutti i progetti. - {StrBegin="MSB2013: "} - - MSB2013: Der Interprojektverweis mit der GUID {0} konnte nicht konvertiert werden, da keine gültige SLN-Datei mit allen Projekten gefunden wurde. - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - MSB2016: Found an empty .RESX file in the project ({0}). Removing it from the converted project. - MSB2016: nel progetto ({0}) è stato trovato un file con estensione resx vuoto. Tale file verrà rimosso dal progetto convertito. - {StrBegin="MSB2016: "} - - MSB2016: Eine leere RESX-Datei wurde im Projekt "({0})" gefunden. Die Datei wird aus dem konvertierten Projekt entfernt. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB2015: Found an <Exclude> element in the original project file. This cannot be converted to Visual Studio .NET and is being ignored. - MSB2015: nel file di progetto originale è stato trovato un elemento <Exclude>. Tale elemento non può essere convertito in Visual Studio .NET e verrà ignorato. - {StrBegin="MSB2015: "} - - MSB2015: Gefunden Sie ein < Exclude > Element in der Projektdatei. Dies kann nicht in Visual Studio .NET konvertiert werden und wird ignoriert. - - fuzzyMatch="15" wordcount="23" adjWordcount="19.55" curWordcount="19.55" - - - MSB2001: Element <{0}> does not contain the required attribute "{1}". - MSB2001: l'elemento <{0}> non contiene l'attributo obbligatorio "{1}". - {StrBegin="MSB2001: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2001: Element <{0}> enthält nicht das erforderliche Attribut "{1}". - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB2002: The file name of the new project must be specified. - MSB2002: è necessario specificare il nome file del nuovo progetto. - {StrBegin="MSB2002: "}This error shouldn't be possible when converting through Visual Studio, but we have it just in case. - - MSB2002: Der Dateiname des neuen Projekts muss angegeben werden. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB2003: The file name of the old project must be specified. - MSB2003: è necessario specificare il nome file del vecchio progetto. - {StrBegin="MSB2003: "}This error shouldn't be possible when converting through Visual Studio, but we have it just in case. - - MSB2003: Der Dateiname des alten Projekts muss angegeben werden. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB2004: Element <{0}> cannot contain more than one language node. - MSB2004: l'elemento <{0}> non può contenere più di un nodo lingua. - {StrBegin="MSB2004: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. The {0} in this case is going to be "VisualStudioProject". - - MSB2004: Element <{0}> darf nicht mehr als einen Sprachknoten enthalten. - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB2005: Element <{0}> cannot contain attributes. - MSB2005: l'elemento <{0}> non può contenere attributi. - {StrBegin="MSB2005: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2005: Element <{0}> darf keine Attribute enthalten. - - fuzzyMatch="15" wordcount="7" adjWordcount="5.95" curWordcount="5.95" - - - MSB2006: The project file does not contain the root element <{0}>. - MSB2006: il file di progetto non contiene l'elemento radice <{0}>. - {StrBegin="MSB2006: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2006: Die Projektdatei enthält kein Stammelement <{0}>. - - fuzzyMatch="15" wordcount="12" adjWordcount="10.2" curWordcount="10.2" - - - MSB2007: Visual Studio cannot find the project file "{0}". - MSB2007: il file di progetto "{0}" non è stato trovato. - {StrBegin="MSB2007: "}This error shouldn't be possible when converting through Visual Studio, but we have it just in case. - - MSB2007: Die Projektdatei "{0}" wurde nicht gefunden. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB2014: The project-to-project reference with GUID {0} cannot be converted because it is not listed in the file '{1}'. - MSB2014: non è possibile convertire il riferimento da progetto a progetto con GUID {0} perché non è elencato nel file '{1}'. - {StrBegin="MSB2014: "} - - MSB2014: Der Interprojektverweis mit der GUID {0} kann nicht konvertiert werden, da er nicht in der Datei "{1}" enthalten ist. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB2008: This Visual Studio project system cannot convert "{0}" projects. It can only be used to convert C#, VB, and VJ# client projects. - MSB2008: non è possibile convertire "{0}" progetti con il sistema del progetto Visual Studio. Tale sistema può essere usato solo per convertire progetti client C#, VB e VJ#. - {StrBegin="MSB2008: "}It appears we've been asked to convert a project that either wasn't created by the Visual Studio managed client project system (C#, VB, J#), or that has been hand-modified or corrupted. You would get this error if this conversion utility was invoked on a VC++ project (.VCPROJ) for example. In this case, the {0} would be replaced with "Visual C++". - - MSB2008: Mit diesem Visual Studio-Projektsystem können keine {0}-Projekte konvertiert werden. Mit diesem System können nur C#-, VB- und VJ#-Clientprojekte konvertiert werden. - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - MSB2009: Attribute "{0}" of element <{1}> is not valid. - MSB2009: l'attributo "{0}" dell'elemento <{1}> non è valido. - {StrBegin="MSB2009: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2009: Das Attribut "{0}" des Elements <{1}> ist ungültig. - - fuzzyMatch="15" wordcount="10" adjWordcount="8.5" curWordcount="8.5" - - - MSB2010: Child element <{0}> of element <{1}> is not valid. - MSB2010: l'elemento figlio <{0}> dell'elemento <{1}> non è valido. - {StrBegin="MSB2010: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2010: Untergeordnete Element <{0}> Element <{1}> ist ungültig. - - fuzzyMatch="15" wordcount="12" adjWordcount="10.2" curWordcount="10.2" - - - MSB2011: Element <{0}> is not valid. - MSB2011: elemento <{0}> non valido. - {StrBegin="MSB2011: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2011: Element <{0}> ist ungültig. - - fuzzyMatch="15" wordcount="7" adjWordcount="5.95" curWordcount="5.95" - - - MSB2012: Project-to-project references to web projects are no longer supported and therefore cannot be converted. Please remove the reference to project {0} and add it again. - MSB2012: i riferimenti da progetto a progetto a progetti Web non sono più supportati e pertanto non possono essere convertiti. Rimuovere il riferimento al progetto {0} e aggiungerlo di nuovo. - {StrBegin="MSB2012: "} - - MSB2012: Interprojektverweise auf Webprojekte werden nicht mehr unterstützt und können daher nicht konvertiert werden. Entfernen Sie den Verweis auf das Projekt "{0}", und fügen Sie es erneut hinzu. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - -
-
\ No newline at end of file diff --git a/src/Deprecated/Conversion/Resources/xlf/Strings.ja.xlf b/src/Deprecated/Conversion/Resources/xlf/Strings.ja.xlf deleted file mode 100644 index e3355e3c588..00000000000 --- a/src/Deprecated/Conversion/Resources/xlf/Strings.ja.xlf +++ /dev/null @@ -1,169 +0,0 @@ - - - -
- - 231 - 107.05 - 107.05 - 0 - 0 - - - 0 - 26 - 112 - 0 - 0 - 93 - 0 - -
- - - MSB2013: The project-to-project reference with GUID {0} could not be converted because a valid .SLN file containing all projects could not be found. - MSB2013: すべてのプロジェクトを含む有効な .SLN ファイルが見つからなかったため、GUID {0} を伴うプロジェクト間参照を変換できませんでした。 - {StrBegin="MSB2013: "} - - MSB2013: Der Interprojektverweis mit der GUID {0} konnte nicht konvertiert werden, da keine gültige SLN-Datei mit allen Projekten gefunden wurde. - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - MSB2016: Found an empty .RESX file in the project ({0}). Removing it from the converted project. - MSB2016: プロジェクト ({0}) で空の .RESX ファイルが見つかりました。変換されたプロジェクトからそのファイルを削除しています。 - {StrBegin="MSB2016: "} - - MSB2016: Eine leere RESX-Datei wurde im Projekt "({0})" gefunden. Die Datei wird aus dem konvertierten Projekt entfernt. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB2015: Found an <Exclude> element in the original project file. This cannot be converted to Visual Studio .NET and is being ignored. - MSB2015: 元のプロジェクト ファイルで <Exclude> 要素が見つかりました。これは Visual Studio .NET に変換することはできないため、無視されます。 - {StrBegin="MSB2015: "} - - MSB2015: Gefunden Sie ein < Exclude > Element in der Projektdatei. Dies kann nicht in Visual Studio .NET konvertiert werden und wird ignoriert. - - fuzzyMatch="15" wordcount="23" adjWordcount="19.55" curWordcount="19.55" - - - MSB2001: Element <{0}> does not contain the required attribute "{1}". - MSB2001: 要素 <{0}> には必要な属性 "{1}" が含まれていません。 - {StrBegin="MSB2001: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2001: Element <{0}> enthält nicht das erforderliche Attribut "{1}". - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB2002: The file name of the new project must be specified. - MSB2002: 新しいプロジェクトの名前を指定してください。 - {StrBegin="MSB2002: "}This error shouldn't be possible when converting through Visual Studio, but we have it just in case. - - MSB2002: Der Dateiname des neuen Projekts muss angegeben werden. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB2003: The file name of the old project must be specified. - MSB2003: 古いプロジェクトの名前を指定してください。 - {StrBegin="MSB2003: "}This error shouldn't be possible when converting through Visual Studio, but we have it just in case. - - MSB2003: Der Dateiname des alten Projekts muss angegeben werden. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB2004: Element <{0}> cannot contain more than one language node. - MSB2004: 要素 <{0}> には 1 つ以上の言語ノードを含めることはできません。 - {StrBegin="MSB2004: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. The {0} in this case is going to be "VisualStudioProject". - - MSB2004: Element <{0}> darf nicht mehr als einen Sprachknoten enthalten. - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB2005: Element <{0}> cannot contain attributes. - MSB2005: 要素 <{0}> には属性を含めることはできません。 - {StrBegin="MSB2005: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2005: Element <{0}> darf keine Attribute enthalten. - - fuzzyMatch="15" wordcount="7" adjWordcount="5.95" curWordcount="5.95" - - - MSB2006: The project file does not contain the root element <{0}>. - MSB2006: プロジェクト ファイルにはルート要素 <{0}> がありません。 - {StrBegin="MSB2006: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2006: Die Projektdatei enthält kein Stammelement <{0}>. - - fuzzyMatch="15" wordcount="12" adjWordcount="10.2" curWordcount="10.2" - - - MSB2007: Visual Studio cannot find the project file "{0}". - MSB2007: Visual Studio では、プロジェクト ファイル "{0}" が見つかりませんでした。 - {StrBegin="MSB2007: "}This error shouldn't be possible when converting through Visual Studio, but we have it just in case. - - MSB2007: Die Projektdatei "{0}" wurde nicht gefunden. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB2014: The project-to-project reference with GUID {0} cannot be converted because it is not listed in the file '{1}'. - MSB2014: ファイル '{1}' のリストにないため、GUID {0} を伴うプロジェクト間参照を変換できません。 - {StrBegin="MSB2014: "} - - MSB2014: Der Interprojektverweis mit der GUID {0} kann nicht konvertiert werden, da er nicht in der Datei "{1}" enthalten ist. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB2008: This Visual Studio project system cannot convert "{0}" projects. It can only be used to convert C#, VB, and VJ# client projects. - MSB2008: この Visual Studio プロジェクト システムでは、"{0}" プロジェクトを変換できません。C#、VB、および VJ# クライアント プロジェクト以外はこのシステムを使って変換できません。 - {StrBegin="MSB2008: "}It appears we've been asked to convert a project that either wasn't created by the Visual Studio managed client project system (C#, VB, J#), or that has been hand-modified or corrupted. You would get this error if this conversion utility was invoked on a VC++ project (.VCPROJ) for example. In this case, the {0} would be replaced with "Visual C++". - - MSB2008: Mit diesem Visual Studio-Projektsystem können keine {0}-Projekte konvertiert werden. Mit diesem System können nur C#-, VB- und VJ#-Clientprojekte konvertiert werden. - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - MSB2009: Attribute "{0}" of element <{1}> is not valid. - MSB2009: 要素 <{1}> の属性 "{0}" は有効ではありません。 - {StrBegin="MSB2009: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2009: Das Attribut "{0}" des Elements <{1}> ist ungültig. - - fuzzyMatch="15" wordcount="10" adjWordcount="8.5" curWordcount="8.5" - - - MSB2010: Child element <{0}> of element <{1}> is not valid. - MSB2010: 要素 <{1}> の子要素 <{0}> は有効ではありません。 - {StrBegin="MSB2010: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2010: Untergeordnete Element <{0}> Element <{1}> ist ungültig. - - fuzzyMatch="15" wordcount="12" adjWordcount="10.2" curWordcount="10.2" - - - MSB2011: Element <{0}> is not valid. - MSB2011: 要素 <{0}> は有効ではありません。 - {StrBegin="MSB2011: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2011: Element <{0}> ist ungültig. - - fuzzyMatch="15" wordcount="7" adjWordcount="5.95" curWordcount="5.95" - - - MSB2012: Project-to-project references to web projects are no longer supported and therefore cannot be converted. Please remove the reference to project {0} and add it again. - MSB2012: Web プロジェクトへのプロジェクト間参照は、現在サポートされていないため、変換することができません。プロジェクト {0} への参照を削除してから、再度追加してください。 - {StrBegin="MSB2012: "} - - MSB2012: Interprojektverweise auf Webprojekte werden nicht mehr unterstützt und können daher nicht konvertiert werden. Entfernen Sie den Verweis auf das Projekt "{0}", und fügen Sie es erneut hinzu. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - -
-
\ No newline at end of file diff --git a/src/Deprecated/Conversion/Resources/xlf/Strings.ko.xlf b/src/Deprecated/Conversion/Resources/xlf/Strings.ko.xlf deleted file mode 100644 index 17379a48e22..00000000000 --- a/src/Deprecated/Conversion/Resources/xlf/Strings.ko.xlf +++ /dev/null @@ -1,169 +0,0 @@ - - - -
- - 231 - 107.05 - 107.05 - 0 - 0 - - - 0 - 26 - 112 - 0 - 0 - 93 - 0 - -
- - - MSB2013: The project-to-project reference with GUID {0} could not be converted because a valid .SLN file containing all projects could not be found. - MSB2013: 모든 프로젝트를 포함하는 올바른 .SLN 파일을 찾을 수 없으므로 GUID가 {0}인 프로젝트 간 참조를 변환할 수 없습니다. - {StrBegin="MSB2013: "} - - MSB2013: Der Interprojektverweis mit der GUID {0} konnte nicht konvertiert werden, da keine gültige SLN-Datei mit allen Projekten gefunden wurde. - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - MSB2016: Found an empty .RESX file in the project ({0}). Removing it from the converted project. - MSB2016: 프로젝트({0})에 빈 .RESX 파일이 있습니다. 변환된 프로젝트에서 이 파일을 제거합니다. - {StrBegin="MSB2016: "} - - MSB2016: Eine leere RESX-Datei wurde im Projekt "({0})" gefunden. Die Datei wird aus dem konvertierten Projekt entfernt. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB2015: Found an <Exclude> element in the original project file. This cannot be converted to Visual Studio .NET and is being ignored. - MSB2015: 원래 프로젝트 파일에 <Exclude> 요소가 있습니다. 이 요소는 Visual Studio .NET으로 변환할 수 없으므로 무시됩니다. - {StrBegin="MSB2015: "} - - MSB2015: Gefunden Sie ein < Exclude > Element in der Projektdatei. Dies kann nicht in Visual Studio .NET konvertiert werden und wird ignoriert. - - fuzzyMatch="15" wordcount="23" adjWordcount="19.55" curWordcount="19.55" - - - MSB2001: Element <{0}> does not contain the required attribute "{1}". - MSB2001: <{0}> 요소에 필요한 "{1}" 특성이 없습니다. - {StrBegin="MSB2001: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2001: Element <{0}> enthält nicht das erforderliche Attribut "{1}". - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB2002: The file name of the new project must be specified. - MSB2002: 새 프로젝트의 파일 이름을 지정해야 합니다. - {StrBegin="MSB2002: "}This error shouldn't be possible when converting through Visual Studio, but we have it just in case. - - MSB2002: Der Dateiname des neuen Projekts muss angegeben werden. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB2003: The file name of the old project must be specified. - MSB2003: 이전 프로젝트의 파일 이름을 지정해야 합니다. - {StrBegin="MSB2003: "}This error shouldn't be possible when converting through Visual Studio, but we have it just in case. - - MSB2003: Der Dateiname des alten Projekts muss angegeben werden. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB2004: Element <{0}> cannot contain more than one language node. - MSB2004: <{0}> 요소는 언어 노드를 둘 이상 포함할 수 없습니다. - {StrBegin="MSB2004: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. The {0} in this case is going to be "VisualStudioProject". - - MSB2004: Element <{0}> darf nicht mehr als einen Sprachknoten enthalten. - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB2005: Element <{0}> cannot contain attributes. - MSB2005: <{0}> 요소는 특성을 포함할 수 없습니다. - {StrBegin="MSB2005: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2005: Element <{0}> darf keine Attribute enthalten. - - fuzzyMatch="15" wordcount="7" adjWordcount="5.95" curWordcount="5.95" - - - MSB2006: The project file does not contain the root element <{0}>. - MSB2006: 프로젝트 파일에 <{0}> 루트 요소가 없습니다. - {StrBegin="MSB2006: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2006: Die Projektdatei enthält kein Stammelement <{0}>. - - fuzzyMatch="15" wordcount="12" adjWordcount="10.2" curWordcount="10.2" - - - MSB2007: Visual Studio cannot find the project file "{0}". - MSB2007: Visual Studio에서 프로젝트 파일 "{0}"을(를) 찾을 수 없습니다. - {StrBegin="MSB2007: "}This error shouldn't be possible when converting through Visual Studio, but we have it just in case. - - MSB2007: Die Projektdatei "{0}" wurde nicht gefunden. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB2014: The project-to-project reference with GUID {0} cannot be converted because it is not listed in the file '{1}'. - MSB2014: GUID가 {0}인 프로젝트 간 참조는 '{1}' 파일에 나열되어 있지 않으므로 변환할 수 없습니다. - {StrBegin="MSB2014: "} - - MSB2014: Der Interprojektverweis mit der GUID {0} kann nicht konvertiert werden, da er nicht in der Datei "{1}" enthalten ist. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB2008: This Visual Studio project system cannot convert "{0}" projects. It can only be used to convert C#, VB, and VJ# client projects. - MSB2008: 이 Visual Studio 프로젝트 시스템에서 "{0}" 프로젝트를 변환할 수 없습니다. C#, VB 및 VJ# 클라이언트 프로젝트만 변환할 수 있습니다. - {StrBegin="MSB2008: "}It appears we've been asked to convert a project that either wasn't created by the Visual Studio managed client project system (C#, VB, J#), or that has been hand-modified or corrupted. You would get this error if this conversion utility was invoked on a VC++ project (.VCPROJ) for example. In this case, the {0} would be replaced with "Visual C++". - - MSB2008: Mit diesem Visual Studio-Projektsystem können keine {0}-Projekte konvertiert werden. Mit diesem System können nur C#-, VB- und VJ#-Clientprojekte konvertiert werden. - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - MSB2009: Attribute "{0}" of element <{1}> is not valid. - MSB2009: <{1}> 요소의 "{0}" 특성이 잘못되었습니다. - {StrBegin="MSB2009: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2009: Das Attribut "{0}" des Elements <{1}> ist ungültig. - - fuzzyMatch="15" wordcount="10" adjWordcount="8.5" curWordcount="8.5" - - - MSB2010: Child element <{0}> of element <{1}> is not valid. - MSB2010: <{1}> 요소의 <{0}> 자식 요소가 잘못되었습니다. - {StrBegin="MSB2010: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2010: Untergeordnete Element <{0}> Element <{1}> ist ungültig. - - fuzzyMatch="15" wordcount="12" adjWordcount="10.2" curWordcount="10.2" - - - MSB2011: Element <{0}> is not valid. - MSB2011: <{0}> 요소가 잘못되었습니다. - {StrBegin="MSB2011: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2011: Element <{0}> ist ungültig. - - fuzzyMatch="15" wordcount="7" adjWordcount="5.95" curWordcount="5.95" - - - MSB2012: Project-to-project references to web projects are no longer supported and therefore cannot be converted. Please remove the reference to project {0} and add it again. - MSB2012: 웹 프로젝트에 대한 프로젝트 간 참조는 더 이상 지원되지 않으므로 변환할 수 없습니다. {0} 프로젝트에 대한 참조를 제거한 후 다시 추가하십시오. - {StrBegin="MSB2012: "} - - MSB2012: Interprojektverweise auf Webprojekte werden nicht mehr unterstützt und können daher nicht konvertiert werden. Entfernen Sie den Verweis auf das Projekt "{0}", und fügen Sie es erneut hinzu. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - -
-
\ No newline at end of file diff --git a/src/Deprecated/Conversion/Resources/xlf/Strings.pl.xlf b/src/Deprecated/Conversion/Resources/xlf/Strings.pl.xlf deleted file mode 100644 index 7a064c4613b..00000000000 --- a/src/Deprecated/Conversion/Resources/xlf/Strings.pl.xlf +++ /dev/null @@ -1,169 +0,0 @@ - - - -
- - 231 - 107.05 - 107.05 - 0 - 0 - - - 0 - 26 - 112 - 0 - 0 - 93 - 0 - -
- - - MSB2013: The project-to-project reference with GUID {0} could not be converted because a valid .SLN file containing all projects could not be found. - MSB2013: Nie można przekonwertować odwołania między projektami o identyfikatorze GUID {0}, ponieważ nie odnaleziono prawidłowego pliku SLN zawierającego wszystkie projekty. - {StrBegin="MSB2013: "} - - MSB2013: Der Interprojektverweis mit der GUID {0} konnte nicht konvertiert werden, da keine gültige SLN-Datei mit allen Projekten gefunden wurde. - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - MSB2016: Found an empty .RESX file in the project ({0}). Removing it from the converted project. - MSB2016: Odnaleziono pusty plik RESX w projekcie ({0}). Zostanie on usunięty z przekonwertowanego projektu. - {StrBegin="MSB2016: "} - - MSB2016: Eine leere RESX-Datei wurde im Projekt "({0})" gefunden. Die Datei wird aus dem konvertierten Projekt entfernt. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB2015: Found an <Exclude> element in the original project file. This cannot be converted to Visual Studio .NET and is being ignored. - MSB2015: Znaleziono element <Exclude> w oryginalnym pliku projektu. Nie można go przekonwertować na format Visual Studio .NET i zostanie on zignorowany. - {StrBegin="MSB2015: "} - - MSB2015: Gefunden Sie ein < Exclude > Element in der Projektdatei. Dies kann nicht in Visual Studio .NET konvertiert werden und wird ignoriert. - - fuzzyMatch="15" wordcount="23" adjWordcount="19.55" curWordcount="19.55" - - - MSB2001: Element <{0}> does not contain the required attribute "{1}". - MSB2001: Element <{0}> nie zawiera wymaganego atrybutu „{1}”. - {StrBegin="MSB2001: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2001: Element <{0}> enthält nicht das erforderliche Attribut "{1}". - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB2002: The file name of the new project must be specified. - MSB2002: Należy określić nazwę pliku nowego projektu. - {StrBegin="MSB2002: "}This error shouldn't be possible when converting through Visual Studio, but we have it just in case. - - MSB2002: Der Dateiname des neuen Projekts muss angegeben werden. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB2003: The file name of the old project must be specified. - MSB2003: Należy określić nazwę pliku starego projektu. - {StrBegin="MSB2003: "}This error shouldn't be possible when converting through Visual Studio, but we have it just in case. - - MSB2003: Der Dateiname des alten Projekts muss angegeben werden. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB2004: Element <{0}> cannot contain more than one language node. - MSB2004: Element <{0}> nie może zawierać więcej niż jeden węzeł języka. - {StrBegin="MSB2004: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. The {0} in this case is going to be "VisualStudioProject". - - MSB2004: Element <{0}> darf nicht mehr als einen Sprachknoten enthalten. - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB2005: Element <{0}> cannot contain attributes. - MSB2005: Element <{0}> nie może zawierać atrybutów. - {StrBegin="MSB2005: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2005: Element <{0}> darf keine Attribute enthalten. - - fuzzyMatch="15" wordcount="7" adjWordcount="5.95" curWordcount="5.95" - - - MSB2006: The project file does not contain the root element <{0}>. - MSB2006: Plik projektu nie zawiera elementu głównego <{0}>. - {StrBegin="MSB2006: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2006: Die Projektdatei enthält kein Stammelement <{0}>. - - fuzzyMatch="15" wordcount="12" adjWordcount="10.2" curWordcount="10.2" - - - MSB2007: Visual Studio cannot find the project file "{0}". - MSB2007: Program Visual Studio nie może odnaleźć pliku projektu „{0}”. - {StrBegin="MSB2007: "}This error shouldn't be possible when converting through Visual Studio, but we have it just in case. - - MSB2007: Die Projektdatei "{0}" wurde nicht gefunden. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB2014: The project-to-project reference with GUID {0} cannot be converted because it is not listed in the file '{1}'. - MSB2014: Nie można przekonwertować odwołania między projektami o identyfikatorze GUID {0}, ponieważ nie jest ono wymienione w pliku „{1}”. - {StrBegin="MSB2014: "} - - MSB2014: Der Interprojektverweis mit der GUID {0} kann nicht konvertiert werden, da er nicht in der Datei "{1}" enthalten ist. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB2008: This Visual Studio project system cannot convert "{0}" projects. It can only be used to convert C#, VB, and VJ# client projects. - MSB2008: Ten system projektów programu Visual Studio nie może konwertować projektów „{0}”. Można go używać tylko do konwertowania projektów klienckich C#, VB i VJ#. - {StrBegin="MSB2008: "}It appears we've been asked to convert a project that either wasn't created by the Visual Studio managed client project system (C#, VB, J#), or that has been hand-modified or corrupted. You would get this error if this conversion utility was invoked on a VC++ project (.VCPROJ) for example. In this case, the {0} would be replaced with "Visual C++". - - MSB2008: Mit diesem Visual Studio-Projektsystem können keine {0}-Projekte konvertiert werden. Mit diesem System können nur C#-, VB- und VJ#-Clientprojekte konvertiert werden. - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - MSB2009: Attribute "{0}" of element <{1}> is not valid. - MSB2009: Atrybut „{0}” elementu <{1}> jest nieprawidłowy. - {StrBegin="MSB2009: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2009: Das Attribut "{0}" des Elements <{1}> ist ungültig. - - fuzzyMatch="15" wordcount="10" adjWordcount="8.5" curWordcount="8.5" - - - MSB2010: Child element <{0}> of element <{1}> is not valid. - MSB2010: Element podrzędny <{0}> elementu <{1}> jest nieprawidłowy. - {StrBegin="MSB2010: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2010: Untergeordnete Element <{0}> Element <{1}> ist ungültig. - - fuzzyMatch="15" wordcount="12" adjWordcount="10.2" curWordcount="10.2" - - - MSB2011: Element <{0}> is not valid. - MSB2011: Element <{0}> jest nieprawidłowy. - {StrBegin="MSB2011: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2011: Element <{0}> ist ungültig. - - fuzzyMatch="15" wordcount="7" adjWordcount="5.95" curWordcount="5.95" - - - MSB2012: Project-to-project references to web projects are no longer supported and therefore cannot be converted. Please remove the reference to project {0} and add it again. - MSB2012: Odwołania między projektami do projektów sieci Web nie są już obsługiwane i dlatego nie można ich konwertować. Usuń odwołanie do projektu {0} i dodaj je ponownie. - {StrBegin="MSB2012: "} - - MSB2012: Interprojektverweise auf Webprojekte werden nicht mehr unterstützt und können daher nicht konvertiert werden. Entfernen Sie den Verweis auf das Projekt "{0}", und fügen Sie es erneut hinzu. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - -
-
\ No newline at end of file diff --git a/src/Deprecated/Conversion/Resources/xlf/Strings.pt-BR.xlf b/src/Deprecated/Conversion/Resources/xlf/Strings.pt-BR.xlf deleted file mode 100644 index 7f50ac9166c..00000000000 --- a/src/Deprecated/Conversion/Resources/xlf/Strings.pt-BR.xlf +++ /dev/null @@ -1,169 +0,0 @@ - - - -
- - 231 - 107.05 - 107.05 - 0 - 0 - - - 0 - 26 - 112 - 0 - 0 - 93 - 0 - -
- - - MSB2013: The project-to-project reference with GUID {0} could not be converted because a valid .SLN file containing all projects could not be found. - MSB2013: A referência de projeto-a-projeto com GUID {0} não foi convertida porque um arquivo .SLN válido contendo todos os projetos não foi encontrado. - {StrBegin="MSB2013: "} - - MSB2013: Der Interprojektverweis mit der GUID {0} konnte nicht konvertiert werden, da keine gültige SLN-Datei mit allen Projekten gefunden wurde. - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - MSB2016: Found an empty .RESX file in the project ({0}). Removing it from the converted project. - MSB2016: Foi encontrado um arquivo .RESX vazio no projeto ({0}). Removendo-o do projeto convertido. - {StrBegin="MSB2016: "} - - MSB2016: Eine leere RESX-Datei wurde im Projekt "({0})" gefunden. Die Datei wird aus dem konvertierten Projekt entfernt. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB2015: Found an <Exclude> element in the original project file. This cannot be converted to Visual Studio .NET and is being ignored. - MSB2015: Foi encontrado um elemento <Exclude> no arquivo de projeto original. Ele não pode ser convertido para o Visual Studio .NET e será ignorado. - {StrBegin="MSB2015: "} - - MSB2015: Gefunden Sie ein < Exclude > Element in der Projektdatei. Dies kann nicht in Visual Studio .NET konvertiert werden und wird ignoriert. - - fuzzyMatch="15" wordcount="23" adjWordcount="19.55" curWordcount="19.55" - - - MSB2001: Element <{0}> does not contain the required attribute "{1}". - MSB2001: O elemento <{0}> não contém o atributo "{1}" necessário. - {StrBegin="MSB2001: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2001: Element <{0}> enthält nicht das erforderliche Attribut "{1}". - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB2002: The file name of the new project must be specified. - MSB2002: É necessário especificar o nome de arquivo do projeto novo. - {StrBegin="MSB2002: "}This error shouldn't be possible when converting through Visual Studio, but we have it just in case. - - MSB2002: Der Dateiname des neuen Projekts muss angegeben werden. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB2003: The file name of the old project must be specified. - MSB2003: É necessário especificar o nome de arquivo do projeto antigo. - {StrBegin="MSB2003: "}This error shouldn't be possible when converting through Visual Studio, but we have it just in case. - - MSB2003: Der Dateiname des alten Projekts muss angegeben werden. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB2004: Element <{0}> cannot contain more than one language node. - MSB2004: O elemento <{0}> não pode conter mais de um nó de idioma. - {StrBegin="MSB2004: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. The {0} in this case is going to be "VisualStudioProject". - - MSB2004: Element <{0}> darf nicht mehr als einen Sprachknoten enthalten. - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB2005: Element <{0}> cannot contain attributes. - MSB2005: O elemento <{0}> não pode conter atributos. - {StrBegin="MSB2005: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2005: Element <{0}> darf keine Attribute enthalten. - - fuzzyMatch="15" wordcount="7" adjWordcount="5.95" curWordcount="5.95" - - - MSB2006: The project file does not contain the root element <{0}>. - MSB2006: O arquivo de projeto não contém o elemento raiz <{0}>. - {StrBegin="MSB2006: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2006: Die Projektdatei enthält kein Stammelement <{0}>. - - fuzzyMatch="15" wordcount="12" adjWordcount="10.2" curWordcount="10.2" - - - MSB2007: Visual Studio cannot find the project file "{0}". - MSB2007: O Visual Studio não pode localizar o arquivo de projeto "{0}". - {StrBegin="MSB2007: "}This error shouldn't be possible when converting through Visual Studio, but we have it just in case. - - MSB2007: Die Projektdatei "{0}" wurde nicht gefunden. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB2014: The project-to-project reference with GUID {0} cannot be converted because it is not listed in the file '{1}'. - MSB2014: A referência de projeto-a-projeto com GUID {0} não foi convertida porque ela não está na lista do arquivo "{1}". - {StrBegin="MSB2014: "} - - MSB2014: Der Interprojektverweis mit der GUID {0} kann nicht konvertiert werden, da er nicht in der Datei "{1}" enthalten ist. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB2008: This Visual Studio project system cannot convert "{0}" projects. It can only be used to convert C#, VB, and VJ# client projects. - MSB2008: Esse sistema de projeto do Visual Studio não pode converter projetos "{0}". Ele só pode ser usado para converter projetos de cliente C#, VB e VJ#. - {StrBegin="MSB2008: "}It appears we've been asked to convert a project that either wasn't created by the Visual Studio managed client project system (C#, VB, J#), or that has been hand-modified or corrupted. You would get this error if this conversion utility was invoked on a VC++ project (.VCPROJ) for example. In this case, the {0} would be replaced with "Visual C++". - - MSB2008: Mit diesem Visual Studio-Projektsystem können keine {0}-Projekte konvertiert werden. Mit diesem System können nur C#-, VB- und VJ#-Clientprojekte konvertiert werden. - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - MSB2009: Attribute "{0}" of element <{1}> is not valid. - MSB2009: O atributo "{0}" do elemento <{1}> não é válido. - {StrBegin="MSB2009: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2009: Das Attribut "{0}" des Elements <{1}> ist ungültig. - - fuzzyMatch="15" wordcount="10" adjWordcount="8.5" curWordcount="8.5" - - - MSB2010: Child element <{0}> of element <{1}> is not valid. - MSB2010: O elemento filho <{0}> do elemento <{1}> não é válido. - {StrBegin="MSB2010: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2010: Untergeordnete Element <{0}> Element <{1}> ist ungültig. - - fuzzyMatch="15" wordcount="12" adjWordcount="10.2" curWordcount="10.2" - - - MSB2011: Element <{0}> is not valid. - MSB2011: O elemento <{0}> não é válido. - {StrBegin="MSB2011: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2011: Element <{0}> ist ungültig. - - fuzzyMatch="15" wordcount="7" adjWordcount="5.95" curWordcount="5.95" - - - MSB2012: Project-to-project references to web projects are no longer supported and therefore cannot be converted. Please remove the reference to project {0} and add it again. - MSB2012: Não há mais suporte para as referências projeto-a-projeto a projetos da Web e por isso não é possível convertê-las. Remova a referência ao projeto {0} e adicione-a novamente. - {StrBegin="MSB2012: "} - - MSB2012: Interprojektverweise auf Webprojekte werden nicht mehr unterstützt und können daher nicht konvertiert werden. Entfernen Sie den Verweis auf das Projekt "{0}", und fügen Sie es erneut hinzu. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - -
-
\ No newline at end of file diff --git a/src/Deprecated/Conversion/Resources/xlf/Strings.ru.xlf b/src/Deprecated/Conversion/Resources/xlf/Strings.ru.xlf deleted file mode 100644 index 57f064b07e7..00000000000 --- a/src/Deprecated/Conversion/Resources/xlf/Strings.ru.xlf +++ /dev/null @@ -1,169 +0,0 @@ - - - -
- - 231 - 107.05 - 107.05 - 0 - 0 - - - 0 - 26 - 112 - 0 - 0 - 93 - 0 - -
- - - MSB2013: The project-to-project reference with GUID {0} could not be converted because a valid .SLN file containing all projects could not be found. - MSB2013: не удалось преобразовать ссылку с проекта на проект с GUID {0}, поскольку не удалось найти допустимый файл .SLN, содержащий все проекты. - {StrBegin="MSB2013: "} - - MSB2013: Der Interprojektverweis mit der GUID {0} konnte nicht konvertiert werden, da keine gültige SLN-Datei mit allen Projekten gefunden wurde. - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - MSB2016: Found an empty .RESX file in the project ({0}). Removing it from the converted project. - MSB2016: в проекте ({0}) обнаружен пустой файл .RESX. Идет его удаление из преобразованного проекта. - {StrBegin="MSB2016: "} - - MSB2016: Eine leere RESX-Datei wurde im Projekt "({0})" gefunden. Die Datei wird aus dem konvertierten Projekt entfernt. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB2015: Found an <Exclude> element in the original project file. This cannot be converted to Visual Studio .NET and is being ignored. - MSB2015: обнаружен элемент <Exclude> в исходном файле проекта. Не удается выполнить преобразование в формат Visual Studio .NET. - {StrBegin="MSB2015: "} - - MSB2015: Gefunden Sie ein < Exclude > Element in der Projektdatei. Dies kann nicht in Visual Studio .NET konvertiert werden und wird ignoriert. - - fuzzyMatch="15" wordcount="23" adjWordcount="19.55" curWordcount="19.55" - - - MSB2001: Element <{0}> does not contain the required attribute "{1}". - MSB2001: элемент <{0}> не содержит обязательного атрибута "{1}". - {StrBegin="MSB2001: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2001: Element <{0}> enthält nicht das erforderliche Attribut "{1}". - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB2002: The file name of the new project must be specified. - MSB2002: необходимо указать имя файла нового проекта. - {StrBegin="MSB2002: "}This error shouldn't be possible when converting through Visual Studio, but we have it just in case. - - MSB2002: Der Dateiname des neuen Projekts muss angegeben werden. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB2003: The file name of the old project must be specified. - MSB2003: необходимо указать имя файла старого проекта. - {StrBegin="MSB2003: "}This error shouldn't be possible when converting through Visual Studio, but we have it just in case. - - MSB2003: Der Dateiname des alten Projekts muss angegeben werden. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB2004: Element <{0}> cannot contain more than one language node. - MSB2004: элемент <{0}> не может содержать более одного узла language. - {StrBegin="MSB2004: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. The {0} in this case is going to be "VisualStudioProject". - - MSB2004: Element <{0}> darf nicht mehr als einen Sprachknoten enthalten. - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB2005: Element <{0}> cannot contain attributes. - MSB2005: элемент <{0}> не может содержать атрибуты. - {StrBegin="MSB2005: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2005: Element <{0}> darf keine Attribute enthalten. - - fuzzyMatch="15" wordcount="7" adjWordcount="5.95" curWordcount="5.95" - - - MSB2006: The project file does not contain the root element <{0}>. - MSB2006: файл проекта не содержит корневой элемент <{0}>. - {StrBegin="MSB2006: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2006: Die Projektdatei enthält kein Stammelement <{0}>. - - fuzzyMatch="15" wordcount="12" adjWordcount="10.2" curWordcount="10.2" - - - MSB2007: Visual Studio cannot find the project file "{0}". - MSB2007: Visual Studio не удалось найти файл проекта "{0}". - {StrBegin="MSB2007: "}This error shouldn't be possible when converting through Visual Studio, but we have it just in case. - - MSB2007: Die Projektdatei "{0}" wurde nicht gefunden. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB2014: The project-to-project reference with GUID {0} cannot be converted because it is not listed in the file '{1}'. - MSB2014: нельзя преобразовать ссылку одного проекта на другой с GUID {0}, поскольку она отсутствует в файле "{1}". - {StrBegin="MSB2014: "} - - MSB2014: Der Interprojektverweis mit der GUID {0} kann nicht konvertiert werden, da er nicht in der Datei "{1}" enthalten ist. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB2008: This Visual Studio project system cannot convert "{0}" projects. It can only be used to convert C#, VB, and VJ# client projects. - MSB2008: эта система проектов Visual Studio не может выполнять преобразование проектов "{0}". Она может использоваться только для преобразования клиентских проектов C#, VB и VJ#. - {StrBegin="MSB2008: "}It appears we've been asked to convert a project that either wasn't created by the Visual Studio managed client project system (C#, VB, J#), or that has been hand-modified or corrupted. You would get this error if this conversion utility was invoked on a VC++ project (.VCPROJ) for example. In this case, the {0} would be replaced with "Visual C++". - - MSB2008: Mit diesem Visual Studio-Projektsystem können keine {0}-Projekte konvertiert werden. Mit diesem System können nur C#-, VB- und VJ#-Clientprojekte konvertiert werden. - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - MSB2009: Attribute "{0}" of element <{1}> is not valid. - MSB2009: недопустимый атрибут "{0}" для элемента "{1}". - {StrBegin="MSB2009: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2009: Das Attribut "{0}" des Elements <{1}> ist ungültig. - - fuzzyMatch="15" wordcount="10" adjWordcount="8.5" curWordcount="8.5" - - - MSB2010: Child element <{0}> of element <{1}> is not valid. - MSB2010: недопустимый дочерний элемент <{0}> элемента <{1}>. - {StrBegin="MSB2010: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2010: Untergeordnete Element <{0}> Element <{1}> ist ungültig. - - fuzzyMatch="15" wordcount="12" adjWordcount="10.2" curWordcount="10.2" - - - MSB2011: Element <{0}> is not valid. - MSB2011: недопустимый элемент <{0}>. - {StrBegin="MSB2011: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2011: Element <{0}> ist ungültig. - - fuzzyMatch="15" wordcount="7" adjWordcount="5.95" curWordcount="5.95" - - - MSB2012: Project-to-project references to web projects are no longer supported and therefore cannot be converted. Please remove the reference to project {0} and add it again. - MSB2012: ссылки одного проекта на другой в веб-проектах больше не поддерживаются, и таким образом, не могут быть преобразованы. Удалите ссылку на проект {0} и добавьте ее повторно. - {StrBegin="MSB2012: "} - - MSB2012: Interprojektverweise auf Webprojekte werden nicht mehr unterstützt und können daher nicht konvertiert werden. Entfernen Sie den Verweis auf das Projekt "{0}", und fügen Sie es erneut hinzu. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - -
-
\ No newline at end of file diff --git a/src/Deprecated/Conversion/Resources/xlf/Strings.tr.xlf b/src/Deprecated/Conversion/Resources/xlf/Strings.tr.xlf deleted file mode 100644 index 46398f68e02..00000000000 --- a/src/Deprecated/Conversion/Resources/xlf/Strings.tr.xlf +++ /dev/null @@ -1,169 +0,0 @@ - - - -
- - 231 - 107.05 - 107.05 - 0 - 0 - - - 0 - 26 - 112 - 0 - 0 - 93 - 0 - -
- - - MSB2013: The project-to-project reference with GUID {0} could not be converted because a valid .SLN file containing all projects could not be found. - MSB2013: Tüm projeleri içeren geçerli bir .SLN dosyası bulunamadığından, GUID değeri {0} olan projeden projeye başvuru dönüştürülemedi. - {StrBegin="MSB2013: "} - - MSB2013: Der Interprojektverweis mit der GUID {0} konnte nicht konvertiert werden, da keine gültige SLN-Datei mit allen Projekten gefunden wurde. - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - MSB2016: Found an empty .RESX file in the project ({0}). Removing it from the converted project. - MSB2016: Projede boş bir .RESX dosyası bulundu ({0}). Bu dosya dönüştürülen projeden kaldırılıyor. - {StrBegin="MSB2016: "} - - MSB2016: Eine leere RESX-Datei wurde im Projekt "({0})" gefunden. Die Datei wird aus dem konvertierten Projekt entfernt. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB2015: Found an <Exclude> element in the original project file. This cannot be converted to Visual Studio .NET and is being ignored. - MSB2015: Özgün proje dosyasında <Exclude> öğesi bulundu. Bu, Visual Studio .NET'e dönüştürülemez; yoksayılıyor. - {StrBegin="MSB2015: "} - - MSB2015: Gefunden Sie ein < Exclude > Element in der Projektdatei. Dies kann nicht in Visual Studio .NET konvertiert werden und wird ignoriert. - - fuzzyMatch="15" wordcount="23" adjWordcount="19.55" curWordcount="19.55" - - - MSB2001: Element <{0}> does not contain the required attribute "{1}". - MSB2001: <{0}> öğesi gereken "{1}" özniteliğini içermiyor. - {StrBegin="MSB2001: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2001: Element <{0}> enthält nicht das erforderliche Attribut "{1}". - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB2002: The file name of the new project must be specified. - MSB2002: Yeni projenin dosya adı belirtilmelidir. - {StrBegin="MSB2002: "}This error shouldn't be possible when converting through Visual Studio, but we have it just in case. - - MSB2002: Der Dateiname des neuen Projekts muss angegeben werden. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB2003: The file name of the old project must be specified. - MSB2003: Eski projenin dosya adı belirtilmelidir. - {StrBegin="MSB2003: "}This error shouldn't be possible when converting through Visual Studio, but we have it just in case. - - MSB2003: Der Dateiname des alten Projekts muss angegeben werden. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB2004: Element <{0}> cannot contain more than one language node. - MSB2004: <{0}> öğesi birden çok dil düğümü içeremez. - {StrBegin="MSB2004: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. The {0} in this case is going to be "VisualStudioProject". - - MSB2004: Element <{0}> darf nicht mehr als einen Sprachknoten enthalten. - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB2005: Element <{0}> cannot contain attributes. - MSB2005: <{0}> öğesi öznitelik içeremez. - {StrBegin="MSB2005: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2005: Element <{0}> darf keine Attribute enthalten. - - fuzzyMatch="15" wordcount="7" adjWordcount="5.95" curWordcount="5.95" - - - MSB2006: The project file does not contain the root element <{0}>. - MSB2006: Proje dosyası <{0}> kök öğesini içermiyor. - {StrBegin="MSB2006: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2006: Die Projektdatei enthält kein Stammelement <{0}>. - - fuzzyMatch="15" wordcount="12" adjWordcount="10.2" curWordcount="10.2" - - - MSB2007: Visual Studio cannot find the project file "{0}". - MSB2007: Visual Studio "{0}" proje dosyasını bulamıyor. - {StrBegin="MSB2007: "}This error shouldn't be possible when converting through Visual Studio, but we have it just in case. - - MSB2007: Die Projektdatei "{0}" wurde nicht gefunden. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB2014: The project-to-project reference with GUID {0} cannot be converted because it is not listed in the file '{1}'. - MSB2014: GUID değeri {0} olan projeden projeye başvuru '{1}' dosyasında listelenmediğinden dönüştürülemiyor. - {StrBegin="MSB2014: "} - - MSB2014: Der Interprojektverweis mit der GUID {0} kann nicht konvertiert werden, da er nicht in der Datei "{1}" enthalten ist. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB2008: This Visual Studio project system cannot convert "{0}" projects. It can only be used to convert C#, VB, and VJ# client projects. - MSB2008: Bu Visual Studio proje sistemi "{0}" projelerini dönüştüremez. Bu yalnızca C#, VB ve VJ# istemci projelerini dönüştürmek için kullanılabilir. - {StrBegin="MSB2008: "}It appears we've been asked to convert a project that either wasn't created by the Visual Studio managed client project system (C#, VB, J#), or that has been hand-modified or corrupted. You would get this error if this conversion utility was invoked on a VC++ project (.VCPROJ) for example. In this case, the {0} would be replaced with "Visual C++". - - MSB2008: Mit diesem Visual Studio-Projektsystem können keine {0}-Projekte konvertiert werden. Mit diesem System können nur C#-, VB- und VJ#-Clientprojekte konvertiert werden. - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - MSB2009: Attribute "{0}" of element <{1}> is not valid. - MSB2009: <{1}> öğesinin "{0}" özniteliği geçerli değil. - {StrBegin="MSB2009: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2009: Das Attribut "{0}" des Elements <{1}> ist ungültig. - - fuzzyMatch="15" wordcount="10" adjWordcount="8.5" curWordcount="8.5" - - - MSB2010: Child element <{0}> of element <{1}> is not valid. - MSB2010: <{1}> öğesinin <{0}> alt öğesi geçerli değil. - {StrBegin="MSB2010: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2010: Untergeordnete Element <{0}> Element <{1}> ist ungültig. - - fuzzyMatch="15" wordcount="12" adjWordcount="10.2" curWordcount="10.2" - - - MSB2011: Element <{0}> is not valid. - MSB2011: <{0}> öğesi geçerli değil. - {StrBegin="MSB2011: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2011: Element <{0}> ist ungültig. - - fuzzyMatch="15" wordcount="7" adjWordcount="5.95" curWordcount="5.95" - - - MSB2012: Project-to-project references to web projects are no longer supported and therefore cannot be converted. Please remove the reference to project {0} and add it again. - MSB2012: Web projelerine yönelik projeden projeye yapılan başvurular artık desteklenmiyor ve bu nedenle dönüştürülemez. Lütfen {0} projesine yönelik başvuruyu kaldırın ve sonra yeniden ekleyin. - {StrBegin="MSB2012: "} - - MSB2012: Interprojektverweise auf Webprojekte werden nicht mehr unterstützt und können daher nicht konvertiert werden. Entfernen Sie den Verweis auf das Projekt "{0}", und fügen Sie es erneut hinzu. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - -
-
\ No newline at end of file diff --git a/src/Deprecated/Conversion/Resources/xlf/Strings.xlf b/src/Deprecated/Conversion/Resources/xlf/Strings.xlf deleted file mode 100644 index b0867aebae9..00000000000 --- a/src/Deprecated/Conversion/Resources/xlf/Strings.xlf +++ /dev/null @@ -1,122 +0,0 @@ - - - -
- - 231 - 107.05 - 107.05 - 0 - 0 - - - 0 - 26 - 112 - 0 - 0 - 93 - 0 - -
- - - - MSB2013: The project-to-project reference with GUID {0} could not be converted because a valid .SLN file containing all projects could not be found. - {StrBegin="MSB2013: "} - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - MSB2016: Found an empty .RESX file in the project ({0}). Removing it from the converted project. - {StrBegin="MSB2016: "} - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB2015: Found an <Exclude> element in the original project file. This cannot be converted to Visual Studio .NET and is being ignored. - {StrBegin="MSB2015: "} - - fuzzyMatch="15" wordcount="23" adjWordcount="19.55" curWordcount="19.55" - - - MSB2001: Element <{0}> does not contain the required attribute "{1}". - {StrBegin="MSB2001: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB2002: The file name of the new project must be specified. - {StrBegin="MSB2002: "}This error shouldn't be possible when converting through Visual Studio, but we have it just in case. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB2003: The file name of the old project must be specified. - {StrBegin="MSB2003: "}This error shouldn't be possible when converting through Visual Studio, but we have it just in case. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB2004: Element <{0}> cannot contain more than one language node. - {StrBegin="MSB2004: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. The {0} in this case is going to be "VisualStudioProject". - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB2005: Element <{0}> cannot contain attributes. - {StrBegin="MSB2005: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - fuzzyMatch="15" wordcount="7" adjWordcount="5.95" curWordcount="5.95" - - - MSB2006: The project file does not contain the root element <{0}>. - {StrBegin="MSB2006: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - fuzzyMatch="15" wordcount="12" adjWordcount="10.2" curWordcount="10.2" - - - MSB2007: Visual Studio cannot find the project file "{0}". - {StrBegin="MSB2007: "}This error shouldn't be possible when converting through Visual Studio, but we have it just in case. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB2014: The project-to-project reference with GUID {0} cannot be converted because it is not listed in the file '{1}'. - {StrBegin="MSB2014: "} - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB2008: This Visual Studio project system cannot convert "{0}" projects. It can only be used to convert C#, VB, and VJ# client projects. - {StrBegin="MSB2008: "}It appears we've been asked to convert a project that either wasn't created by the Visual Studio managed client project system (C#, VB, J#), or that has been hand-modified or corrupted. You would get this error if this conversion utility was invoked on a VC++ project (.VCPROJ) for example. In this case, the {0} would be replaced with "Visual C++". - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - MSB2009: Attribute "{0}" of element <{1}> is not valid. - {StrBegin="MSB2009: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - fuzzyMatch="15" wordcount="10" adjWordcount="8.5" curWordcount="8.5" - - - MSB2010: Child element <{0}> of element <{1}> is not valid. - {StrBegin="MSB2010: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - fuzzyMatch="15" wordcount="12" adjWordcount="10.2" curWordcount="10.2" - - - MSB2011: Element <{0}> is not valid. - {StrBegin="MSB2011: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - fuzzyMatch="15" wordcount="7" adjWordcount="5.95" curWordcount="5.95" - - - MSB2012: Project-to-project references to web projects are no longer supported and therefore cannot be converted. Please remove the reference to project {0} and add it again. - {StrBegin="MSB2012: "} - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - -
-
\ No newline at end of file diff --git a/src/Deprecated/Conversion/Resources/xlf/Strings.zh-Hans.xlf b/src/Deprecated/Conversion/Resources/xlf/Strings.zh-Hans.xlf deleted file mode 100644 index e49ab19ee4d..00000000000 --- a/src/Deprecated/Conversion/Resources/xlf/Strings.zh-Hans.xlf +++ /dev/null @@ -1,169 +0,0 @@ - - - -
- - 231 - 107.05 - 107.05 - 0 - 0 - - - 0 - 26 - 112 - 0 - 0 - 93 - 0 - -
- - - MSB2013: The project-to-project reference with GUID {0} could not be converted because a valid .SLN file containing all projects could not be found. - MSB2013: 未能转换 GUID 为 {0} 的项目到项目引用,因为找不到包含所有项目的有效 .SLN 文件。 - {StrBegin="MSB2013: "} - - MSB2013: Der Interprojektverweis mit der GUID {0} konnte nicht konvertiert werden, da keine gültige SLN-Datei mit allen Projekten gefunden wurde. - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - MSB2016: Found an empty .RESX file in the project ({0}). Removing it from the converted project. - MSB2016: 在项目({0})中找到一个空的 .RESX 文件。 将从转换后的项目中将它移除。 - {StrBegin="MSB2016: "} - - MSB2016: Eine leere RESX-Datei wurde im Projekt "({0})" gefunden. Die Datei wird aus dem konvertierten Projekt entfernt. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB2015: Found an <Exclude> element in the original project file. This cannot be converted to Visual Studio .NET and is being ignored. - MSB2015: 在原始项目文件中找到一个 <Exclude> 元素。 无法将它转换为 Visual Studio .NET,因此将它忽略。 - {StrBegin="MSB2015: "} - - MSB2015: Gefunden Sie ein < Exclude > Element in der Projektdatei. Dies kann nicht in Visual Studio .NET konvertiert werden und wird ignoriert. - - fuzzyMatch="15" wordcount="23" adjWordcount="19.55" curWordcount="19.55" - - - MSB2001: Element <{0}> does not contain the required attribute "{1}". - MSB2001: 元素 <{0}> 未包含必需的特性“{1}”。 - {StrBegin="MSB2001: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2001: Element <{0}> enthält nicht das erforderliche Attribut "{1}". - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB2002: The file name of the new project must be specified. - MSB2002: 必须指定新项目的文件名。 - {StrBegin="MSB2002: "}This error shouldn't be possible when converting through Visual Studio, but we have it just in case. - - MSB2002: Der Dateiname des neuen Projekts muss angegeben werden. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB2003: The file name of the old project must be specified. - MSB2003: 必须指定旧项目的文件名。 - {StrBegin="MSB2003: "}This error shouldn't be possible when converting through Visual Studio, but we have it just in case. - - MSB2003: Der Dateiname des alten Projekts muss angegeben werden. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB2004: Element <{0}> cannot contain more than one language node. - MSB2004: 元素 <{0}> 不能包含多个语言节点。 - {StrBegin="MSB2004: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. The {0} in this case is going to be "VisualStudioProject". - - MSB2004: Element <{0}> darf nicht mehr als einen Sprachknoten enthalten. - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB2005: Element <{0}> cannot contain attributes. - MSB2005: 元素 <{0}> 不能包含特性。 - {StrBegin="MSB2005: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2005: Element <{0}> darf keine Attribute enthalten. - - fuzzyMatch="15" wordcount="7" adjWordcount="5.95" curWordcount="5.95" - - - MSB2006: The project file does not contain the root element <{0}>. - MSB2006: 项目文件未包含根元素 <{0}>。 - {StrBegin="MSB2006: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2006: Die Projektdatei enthält kein Stammelement <{0}>. - - fuzzyMatch="15" wordcount="12" adjWordcount="10.2" curWordcount="10.2" - - - MSB2007: Visual Studio cannot find the project file "{0}". - MSB2007: Visual Studio 找不到项目文件“{0}”。 - {StrBegin="MSB2007: "}This error shouldn't be possible when converting through Visual Studio, but we have it just in case. - - MSB2007: Die Projektdatei "{0}" wurde nicht gefunden. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB2014: The project-to-project reference with GUID {0} cannot be converted because it is not listed in the file '{1}'. - MSB2014: 无法转换 GUID 为 {0} 的项目到项目引用,因为文件“{1}”中没有列出该引用。 - {StrBegin="MSB2014: "} - - MSB2014: Der Interprojektverweis mit der GUID {0} kann nicht konvertiert werden, da er nicht in der Datei "{1}" enthalten ist. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB2008: This Visual Studio project system cannot convert "{0}" projects. It can only be used to convert C#, VB, and VJ# client projects. - MSB2008: 此 Visual Studio 项目系统无法转换“{0}”项目。 它只能用于转换 C#、VB 和 VJ# 客户端项目。 - {StrBegin="MSB2008: "}It appears we've been asked to convert a project that either wasn't created by the Visual Studio managed client project system (C#, VB, J#), or that has been hand-modified or corrupted. You would get this error if this conversion utility was invoked on a VC++ project (.VCPROJ) for example. In this case, the {0} would be replaced with "Visual C++". - - MSB2008: Mit diesem Visual Studio-Projektsystem können keine {0}-Projekte konvertiert werden. Mit diesem System können nur C#-, VB- und VJ#-Clientprojekte konvertiert werden. - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - MSB2009: Attribute "{0}" of element <{1}> is not valid. - MSB2009: 元素 <{1}> 的特性“{0}”无效。 - {StrBegin="MSB2009: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2009: Das Attribut "{0}" des Elements <{1}> ist ungültig. - - fuzzyMatch="15" wordcount="10" adjWordcount="8.5" curWordcount="8.5" - - - MSB2010: Child element <{0}> of element <{1}> is not valid. - MSB2010: 元素 <{1}> 的子元素 <{0}> 无效。 - {StrBegin="MSB2010: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2010: Untergeordnete Element <{0}> Element <{1}> ist ungültig. - - fuzzyMatch="15" wordcount="12" adjWordcount="10.2" curWordcount="10.2" - - - MSB2011: Element <{0}> is not valid. - MSB2011: 元素 <{0}> 无效。 - {StrBegin="MSB2011: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2011: Element <{0}> ist ungültig. - - fuzzyMatch="15" wordcount="7" adjWordcount="5.95" curWordcount="5.95" - - - MSB2012: Project-to-project references to web projects are no longer supported and therefore cannot be converted. Please remove the reference to project {0} and add it again. - MSB2012: 不再支持对 Web 项目的项目到项目引用,因此无法转换此类引用。 请移除对项目 {0} 的引用,然后重新添加它。 - {StrBegin="MSB2012: "} - - MSB2012: Interprojektverweise auf Webprojekte werden nicht mehr unterstützt und können daher nicht konvertiert werden. Entfernen Sie den Verweis auf das Projekt "{0}", und fügen Sie es erneut hinzu. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - -
-
\ No newline at end of file diff --git a/src/Deprecated/Conversion/Resources/xlf/Strings.zh-Hant.xlf b/src/Deprecated/Conversion/Resources/xlf/Strings.zh-Hant.xlf deleted file mode 100644 index e99a3a187a1..00000000000 --- a/src/Deprecated/Conversion/Resources/xlf/Strings.zh-Hant.xlf +++ /dev/null @@ -1,169 +0,0 @@ - - - -
- - 231 - 107.05 - 107.05 - 0 - 0 - - - 0 - 26 - 112 - 0 - 0 - 93 - 0 - -
- - - MSB2013: The project-to-project reference with GUID {0} could not be converted because a valid .SLN file containing all projects could not be found. - MSB2013: 無法轉換 GUID 為 {0} 的專案對專案間參考,因為找不到包含所有專案的有效 .SLN 檔。 - {StrBegin="MSB2013: "} - - MSB2013: Der Interprojektverweis mit der GUID {0} konnte nicht konvertiert werden, da keine gültige SLN-Datei mit allen Projekten gefunden wurde. - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - MSB2016: Found an empty .RESX file in the project ({0}). Removing it from the converted project. - MSB2016: 在專案 ({0}) 中找到空的 .RESX 檔。 - {StrBegin="MSB2016: "} - - MSB2016: Eine leere RESX-Datei wurde im Projekt "({0})" gefunden. Die Datei wird aus dem konvertierten Projekt entfernt. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB2015: Found an <Exclude> element in the original project file. This cannot be converted to Visual Studio .NET and is being ignored. - MSB2015: 在原始專案檔中找到 <Exclude> 項目。無法將它轉換為 Visual Studio .NET,已忽略。 - {StrBegin="MSB2015: "} - - MSB2015: Gefunden Sie ein < Exclude > Element in der Projektdatei. Dies kann nicht in Visual Studio .NET konvertiert werden und wird ignoriert. - - fuzzyMatch="15" wordcount="23" adjWordcount="19.55" curWordcount="19.55" - - - MSB2001: Element <{0}> does not contain the required attribute "{1}". - MSB2001: 項目 <{0}> 未包含必要的屬性 "{1}"。 - {StrBegin="MSB2001: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2001: Element <{0}> enthält nicht das erforderliche Attribut "{1}". - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB2002: The file name of the new project must be specified. - MSB2002: 必須指定新專案的檔名。 - {StrBegin="MSB2002: "}This error shouldn't be possible when converting through Visual Studio, but we have it just in case. - - MSB2002: Der Dateiname des neuen Projekts muss angegeben werden. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB2003: The file name of the old project must be specified. - MSB2003: 必須指定舊專案的檔名。 - {StrBegin="MSB2003: "}This error shouldn't be possible when converting through Visual Studio, but we have it just in case. - - MSB2003: Der Dateiname des alten Projekts muss angegeben werden. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB2004: Element <{0}> cannot contain more than one language node. - MSB2004: 項目 <{0}> 不可以包含一個以上的語言節點。 - {StrBegin="MSB2004: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. The {0} in this case is going to be "VisualStudioProject". - - MSB2004: Element <{0}> darf nicht mehr als einen Sprachknoten enthalten. - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB2005: Element <{0}> cannot contain attributes. - MSB2005: 項目 <{0}> 不可以包含屬性。 - {StrBegin="MSB2005: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2005: Element <{0}> darf keine Attribute enthalten. - - fuzzyMatch="15" wordcount="7" adjWordcount="5.95" curWordcount="5.95" - - - MSB2006: The project file does not contain the root element <{0}>. - MSB2006: 專案檔未包含根項目 <{0}>。 - {StrBegin="MSB2006: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2006: Die Projektdatei enthält kein Stammelement <{0}>. - - fuzzyMatch="15" wordcount="12" adjWordcount="10.2" curWordcount="10.2" - - - MSB2007: Visual Studio cannot find the project file "{0}". - MSB2007: Visual Studio 找不到專案檔 "{0}"。 - {StrBegin="MSB2007: "}This error shouldn't be possible when converting through Visual Studio, but we have it just in case. - - MSB2007: Die Projektdatei "{0}" wurde nicht gefunden. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB2014: The project-to-project reference with GUID {0} cannot be converted because it is not listed in the file '{1}'. - MSB2014: 無法轉換 GUID 為 {0} 的專案對專案間參考,因為它未列在檔案 '{1}' 中。 - {StrBegin="MSB2014: "} - - MSB2014: Der Interprojektverweis mit der GUID {0} kann nicht konvertiert werden, da er nicht in der Datei "{1}" enthalten ist. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB2008: This Visual Studio project system cannot convert "{0}" projects. It can only be used to convert C#, VB, and VJ# client projects. - MSB2008: 這個 Visual Studio 專案系統無法轉換 "{0}" 專案。它只能用來轉換 C#、Visual Basic 和 Visual J# 用戶端專案。 - {StrBegin="MSB2008: "}It appears we've been asked to convert a project that either wasn't created by the Visual Studio managed client project system (C#, VB, J#), or that has been hand-modified or corrupted. You would get this error if this conversion utility was invoked on a VC++ project (.VCPROJ) for example. In this case, the {0} would be replaced with "Visual C++". - - MSB2008: Mit diesem Visual Studio-Projektsystem können keine {0}-Projekte konvertiert werden. Mit diesem System können nur C#-, VB- und VJ#-Clientprojekte konvertiert werden. - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - MSB2009: Attribute "{0}" of element <{1}> is not valid. - MSB2009: 項目 <{1}> 的屬性 "{0}" 無效。 - {StrBegin="MSB2009: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2009: Das Attribut "{0}" des Elements <{1}> ist ungültig. - - fuzzyMatch="15" wordcount="10" adjWordcount="8.5" curWordcount="8.5" - - - MSB2010: Child element <{0}> of element <{1}> is not valid. - MSB2010: 項目 <{1}> 的子項目 <{0}> 無效。 - {StrBegin="MSB2010: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2010: Untergeordnete Element <{0}> Element <{1}> ist ungültig. - - fuzzyMatch="15" wordcount="12" adjWordcount="10.2" curWordcount="10.2" - - - MSB2011: Element <{0}> is not valid. - MSB2011: 項目 <{0}> 無效。 - {StrBegin="MSB2011: "}It appears we've been asked to convert a project that either wasn't created by Visual Studio, or that has been hand-modified or corrupted. - - MSB2011: Element <{0}> ist ungültig. - - fuzzyMatch="15" wordcount="7" adjWordcount="5.95" curWordcount="5.95" - - - MSB2012: Project-to-project references to web projects are no longer supported and therefore cannot be converted. Please remove the reference to project {0} and add it again. - MSB2012: 已不再支援 Web 專案的專案對專案間參考,所以無法轉換。請移除專案 {0} 的參考,然後再將它加入。 - {StrBegin="MSB2012: "} - - MSB2012: Interprojektverweise auf Webprojekte werden nicht mehr unterstützt und können daher nicht konvertiert werden. Entfernen Sie den Verweis auf das Projekt "{0}", und fügen Sie es erneut hinzu. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - -
-
\ No newline at end of file diff --git a/src/Deprecated/Directory.Build.props b/src/Deprecated/Directory.Build.props deleted file mode 100644 index 18fa095b5f7..00000000000 --- a/src/Deprecated/Directory.Build.props +++ /dev/null @@ -1,7 +0,0 @@ - - - - - true - - \ No newline at end of file diff --git a/src/Deprecated/Engine.UnitTests/App.config.tt b/src/Deprecated/Engine.UnitTests/App.config.tt deleted file mode 100644 index e6471619cb9..00000000000 --- a/src/Deprecated/Engine.UnitTests/App.config.tt +++ /dev/null @@ -1,40 +0,0 @@ - -<#@ include file="BrandNames.tt" #> - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Deprecated/Engine.UnitTests/BatchingEngine_Tests.cs b/src/Deprecated/Engine.UnitTests/BatchingEngine_Tests.cs deleted file mode 100644 index affbc14d425..00000000000 --- a/src/Deprecated/Engine.UnitTests/BatchingEngine_Tests.cs +++ /dev/null @@ -1,308 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Xml; -using System.Collections; -using System.Text.RegularExpressions; - -using NUnit.Framework; - -using Microsoft.Build.BuildEngine; -using System.Collections.Generic; - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class BatchingEngineTests - { - /// - /// Helper method so we can keep the real Expander.ExpandItemsIntoString private. - /// - /// - /// - /// - /// RGoel - private static string ExpandItemsIntoString - ( - ItemBucket bucket, - string expression - ) - { - - Expander itemExpander = new Expander(new ReadOnlyLookup(bucket.Lookup), null, ExpanderOptions.ExpandItems); - return itemExpander.ExpandAllIntoString(expression, (new XmlDocument()).CreateAttribute("foo")); - } - - /// - /// Helper method so we can keep the real Expander.ExpandMetadataAndProperties private. - /// - /// - /// - /// - /// RGoel - private static string ExpandMetadataAndProperties - ( - ItemBucket bucket, - string expression - ) - { - Expander itemExpander = new Expander(bucket.Expander, ExpanderOptions.ExpandPropertiesAndMetadata); - return itemExpander.ExpandAllIntoString(expression, (new XmlDocument()).CreateAttribute("foo")); - } - - [Test] - public void GetBuckets() - { - List parameters = new List(); - parameters.Add("@(File);$(unittests)"); - parameters.Add("$(obj)\\%(Filename).ext"); - parameters.Add("@(File->'%(extension)')"); // attributes in transforms don't affect batching - - Hashtable itemsByType = new Hashtable(StringComparer.OrdinalIgnoreCase); - - BuildItemGroup items = new BuildItemGroup(); - items.AddNewItem("File", "a.foo"); - items.AddNewItem("File", "b.foo"); - items.AddNewItem("File", "c.foo"); - items.AddNewItem("File", "d.foo"); - items.AddNewItem("File", "e.foo"); - itemsByType["FILE"] = items; - - items = new BuildItemGroup(); - items.AddNewItem("Doc", "a.doc"); - items.AddNewItem("Doc", "b.doc"); - items.AddNewItem("Doc", "c.doc"); - items.AddNewItem("Doc", "d.doc"); - items.AddNewItem("Doc", "e.doc"); - itemsByType["DOC"] = items; - - BuildPropertyGroup properties = new BuildPropertyGroup(); - properties.SetProperty("UnitTests", "unittests.foo"); - properties.SetProperty("OBJ", "obj"); - - ArrayList buckets = BatchingEngine.PrepareBatchingBuckets(new XmlDocument().CreateElement("Foo"), parameters, CreateLookup(itemsByType, properties)); - - Assertion.AssertEquals(5, buckets.Count); - - foreach (ItemBucket bucket in buckets) - { - // non-batching data -- same for all buckets - XmlAttribute tempXmlAttribute = (new XmlDocument()).CreateAttribute("attrib"); - tempXmlAttribute.Value = "'$(Obj)'=='obj'"; - - Assertion.Assert(BuildEngine.Utilities.EvaluateCondition(tempXmlAttribute.Value, - tempXmlAttribute, bucket.Expander, null, ParserOptions.AllowAll, null, null)); - Assertion.AssertEquals("a.doc;b.doc;c.doc;d.doc;e.doc", ExpandItemsIntoString(bucket, "@(doc)")); - Assertion.AssertEquals("unittests.foo", ExpandMetadataAndProperties(bucket, "$(bogus)$(UNITTESTS)")); - } - - Assertion.AssertEquals("a.foo", ExpandItemsIntoString((ItemBucket)buckets[0], "@(File)")); - Assertion.AssertEquals(".foo", ExpandItemsIntoString((ItemBucket)buckets[0], "@(File->'%(Extension)')")); - Assertion.AssertEquals("obj\\a.ext", ExpandMetadataAndProperties((ItemBucket)buckets[0], "$(obj)\\%(Filename).ext")); - - // we weren't batching on this attribute, so it has no value - Assertion.AssertEquals(String.Empty, ExpandMetadataAndProperties((ItemBucket)buckets[0], "%(Extension)")); - - items = ((ItemBucket)buckets[0]).Expander.ExpandSingleItemListExpressionIntoItemsLeaveEscaped("@(file)", null); - Assertion.AssertNotNull(items); - Assertion.AssertEquals(1, items.Count); - - int invalidProjectFileExceptions = 0; - try - { - // This should throw because we don't allow item lists to be concatenated - // with other strings. - items = ((ItemBucket)buckets[0]).Expander.ExpandSingleItemListExpressionIntoItemsLeaveEscaped("@(file);$(unitests)", null); - } - catch (InvalidProjectFileException) - { - invalidProjectFileExceptions++; - } - - // We do allow separators in item vectors, this results in an item group with a single flattened item - items = ((ItemBucket)buckets[0]).Expander.ExpandSingleItemListExpressionIntoItemsLeaveEscaped("@(file, ',')", null); - Assertion.AssertNotNull(items); - Assertion.AssertEquals(1, items.Count); - Assertion.AssertEquals("a.foo", items[0].FinalItemSpec); - - Assertion.AssertEquals(1, invalidProjectFileExceptions); - } - - /// - /// Tests the real simple case of using an unqualified metadata reference %(Culture), - /// where there are only two items and both of them have a value for Culture, but they - /// have different values. - /// - /// RGoel - [Test] - public void ValidUnqualifiedMetadataReference() - { - List parameters = new List(); - parameters.Add("@(File)"); - parameters.Add("%(Culture)"); - - Hashtable itemsByType = new Hashtable(StringComparer.OrdinalIgnoreCase); - - BuildItemGroup items = new BuildItemGroup(); - itemsByType["FILE"] = items; - - BuildItem a = items.AddNewItem("File", "a.foo"); - BuildItem b = items.AddNewItem("File", "b.foo"); - a.SetMetadata("Culture", "fr-fr"); - b.SetMetadata("Culture", "en-en"); - - BuildPropertyGroup properties = new BuildPropertyGroup(); - - ArrayList buckets = BatchingEngine.PrepareBatchingBuckets(new XmlDocument().CreateElement("Foo"), parameters, CreateLookup(itemsByType, properties)); - Assertion.AssertEquals(2, buckets.Count); - } - - /// - /// Tests the case where an unqualified metadata reference is used illegally. - /// It's illegal because not all of the items consumed contain a value for - /// that metadata. - /// - /// RGoel - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void InvalidUnqualifiedMetadataReference() - { - List parameters = new List(); - parameters.Add("@(File)"); - parameters.Add("%(Culture)"); - - Hashtable itemsByType = new Hashtable(StringComparer.OrdinalIgnoreCase); - - BuildItemGroup items = new BuildItemGroup(); - itemsByType["FILE"] = items; - - BuildItem a = items.AddNewItem("File", "a.foo"); - BuildItem b = items.AddNewItem("File", "b.foo"); - a.SetMetadata("Culture", "fr-fr"); - - BuildPropertyGroup properties = new BuildPropertyGroup(); - - // This is expected to throw because not all items contain a value for metadata "Culture". - // Only a.foo has a Culture metadata. b.foo does not. - ArrayList buckets = BatchingEngine.PrepareBatchingBuckets(new XmlDocument().CreateElement("Foo"), parameters, CreateLookup(itemsByType, properties)); - } - - /// - /// Tests the case where an unqualified metadata reference is used illegally. - /// It's illegal because not all of the items consumed contain a value for - /// that metadata. - /// - /// RGoel - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void NoItemsConsumed() - { - List parameters = new List(); - parameters.Add("$(File)"); - parameters.Add("%(Culture)"); - - Hashtable itemsByType = new Hashtable(StringComparer.OrdinalIgnoreCase); - BuildPropertyGroup properties = new BuildPropertyGroup(); - - // This is expected to throw because we have no idea what item list %(Culture) refers to. - ArrayList buckets = BatchingEngine.PrepareBatchingBuckets(new XmlDocument().CreateElement("Foo"), parameters, CreateLookup(itemsByType, properties)); - } - - /// - /// Missing unittest found by mutation testing. - /// REASON TEST WASN'T ORIGINALLY PRESENT: Missed test. - /// - /// This test ensures that two items with duplicate attributes end up in exactly one batching - /// bucket. - /// - [Test] - public void Regress_Mutation_DuplicateBatchingBucketsAreFoldedTogether() - { - List parameters = new List(); - parameters.Add("%(File.Culture)"); - - Hashtable itemsByType = new Hashtable(StringComparer.OrdinalIgnoreCase); - - BuildItemGroup items = new BuildItemGroup(); - items.AddNewItem("File", "a.foo"); - items.AddNewItem("File", "b.foo"); // Need at least two items for this test case to ensure multiple buckets might be possible - itemsByType["FILE"] = items; - - BuildPropertyGroup properties = new BuildPropertyGroup(); - - ArrayList buckets = BatchingEngine.PrepareBatchingBuckets(new XmlDocument().CreateElement("Foo"), parameters, CreateLookup(itemsByType, properties)); - - // If duplicate buckes have been folded correctly, then there will be exactly one bucket here - // containing both a.foo and b.foo. - Assertion.AssertEquals(1, buckets.Count); - } - - [Test] - public void Simple() - { - MockLogger log = ObjectModelHelpers.BuildProjectExpectSuccess(@" - - - - - - - - - - - - - - - "); - - log.AssertLogContains("[AToBBatched: a;b]"); - } - - /// - /// Regression test for bug 528104. It is important that the batching engine invokes - /// the different batches in the same order as the items are declared in the project, especially - /// when batching is simply being used as a "for loop". - /// - /// RGoel - [Test] - public void BatcherPreservesItemOrderWithinASingleItemList() - { - MockLogger log = ObjectModelHelpers.BuildProjectExpectSuccess(@" - - - - - - - - - - - - - - - - - - - - "); - - log.AssertLogContains("AToZBatched: a;b;c;d;e;f;g;h;i;j;k;l;m;n;o;p;q;r;s;t;u;v;w;x;y;z"); - log.AssertLogContains("ZToABatched: z;y;x;w;v;u;t;s;r;q;p;o;n;m;l;k;j;i;h;g;f;e;d;c;b;a"); - } - - private static Lookup CreateLookup(Hashtable itemsByType, BuildPropertyGroup properties) - { - return new Lookup(itemsByType, properties, new ItemDefinitionLibrary(new Project())); - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/BuildItemDefinitionGroupXml_Tests.cs b/src/Deprecated/Engine.UnitTests/BuildItemDefinitionGroupXml_Tests.cs deleted file mode 100644 index 98e5575a033..00000000000 --- a/src/Deprecated/Engine.UnitTests/BuildItemDefinitionGroupXml_Tests.cs +++ /dev/null @@ -1,1086 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections.Generic; -using System.Text; -using NUnit.Framework; -using System.Xml; -using Microsoft.Build.BuildEngine; -using Microsoft.Build.BuildEngine.Shared; -using Metadatum = System.Collections.Generic.KeyValuePair; -using MetadataDictionary = System.Collections.Generic.Dictionary; -using ItemDefinitionsDictionary = System.Collections.Generic.Dictionary>; -using System.IO; -using System.Reflection; - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class BuildItemDefinitionGroupXml_Tests - { - [Test] - public void Basic() - { - XmlElement group = GetBasicItemDefinitionGroupWithOneDefinitionAndOneMetadatum(); - ItemDefinitionLibrary definitions = NewAndEvaluateItemDefinitionLibraryXml(group); - - Assertion.AssertEquals(1, definitions.GetDefaultedMetadataCount("CCompile")); - Assertion.AssertEquals("DEBUG", definitions.GetDefaultMetadataValue("CCompile", "Defines")); - } - - [Test] - public void DuplicateMetadataLastOneWins() - { - XmlElement group = GetBasicItemDefinitionGroupWithOneDefinitionAndOneMetadatum(); - XmlElement meta2 = XmlTestUtilities.AddChildElement(group.ChildNodes[0], "Defines"); - meta2.InnerText = "RETAIL"; - ItemDefinitionLibrary definitions = NewAndEvaluateItemDefinitionLibraryXml(group); - - Assertion.AssertEquals(1, definitions.GetDefaultedMetadataCount("CCompile")); - Assertion.AssertEquals("RETAIL", definitions.GetDefaultMetadataValue("CCompile", "Defines")); - } - - [Test] - public void NoDefinitions() - { - XmlElement group = GetBasicItemDefinitionGroupWithOneDefinitionAndOneMetadatum(); - group.RemoveAll(); - ItemDefinitionLibrary definitions = NewAndEvaluateItemDefinitionLibraryXml(group); - - // No exception - Assertion.AssertEquals(0, definitions.GetDefaultedMetadataCount("arbitrary")); - } - - [Test] - public void NoMetadata() - { - XmlElement group = GetBasicItemDefinitionGroupWithOneDefinitionAndOneMetadatum(); - group.ChildNodes[0].RemoveAll(); - ItemDefinitionLibrary definitions = NewAndEvaluateItemDefinitionLibraryXml(group); - - // No exception - Assertion.AssertEquals(0, definitions.GetDefaultedMetadataCount("arbitrary")); - } - - [Test] - public void FalseConditionOnGroup() - { - XmlElement group = GetBasicItemDefinitionGroupWithOneDefinitionAndOneMetadatum(); - XmlTestUtilities.AddAttribute(group, "Condition", "'v2'=='$(p1)'"); - ItemDefinitionLibrary definitions = NewAndEvaluateItemDefinitionLibraryXml(group); - - // No exception - Assertion.AssertEquals(0, definitions.GetDefaultedMetadataCount("arbitrary")); - } - - [Test] - public void FalseConditionOnDefinition() - { - XmlElement group = GetBasicItemDefinitionGroupWithOneDefinitionAndOneMetadatum(); - XmlTestUtilities.AddAttribute(group.ChildNodes[0], "Condition", "'v2'=='$(p1)'"); - ItemDefinitionLibrary definitions = NewAndEvaluateItemDefinitionLibraryXml(group); - - // No exception - Assertion.AssertEquals(0, definitions.GetDefaultedMetadataCount("arbitrary")); - } - - [Test] - public void FalseConditionOnMetadatum() - { - XmlElement group = GetBasicItemDefinitionGroupWithOneDefinitionAndOneMetadatum(); - XmlTestUtilities.AddAttribute(group.ChildNodes[0].ChildNodes[0], "Condition", "'v2'=='$(p1)'"); - ItemDefinitionLibrary definitions = NewAndEvaluateItemDefinitionLibraryXml(group); - - // No exception - Assertion.AssertEquals(0, definitions.GetDefaultedMetadataCount("arbitrary")); - } - - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void InvalidAttributeOnGroup() - { - XmlElement group = GetBasicItemDefinitionGroupWithOneDefinitionAndOneMetadatum(); - XmlTestUtilities.AddAttribute(group, "XXXX", "YYY"); - ItemDefinitionLibrary definitions = NewAndEvaluateItemDefinitionLibraryXml(group); - } - - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void InvalidIncludeAttributeOnDefinition() - { - XmlElement group = GetBasicItemDefinitionGroupWithOneDefinitionAndOneMetadatum(); - XmlTestUtilities.AddAttribute(group.ChildNodes[0], "Include", "YYY"); - ItemDefinitionLibrary definitions = NewAndEvaluateItemDefinitionLibraryXml(group); - } - - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void InvalidExcludeAttributeOnDefinition() - { - XmlElement group = GetBasicItemDefinitionGroupWithOneDefinitionAndOneMetadatum(); - XmlTestUtilities.AddAttribute(group.ChildNodes[0], "Exclude", "YYY"); - ItemDefinitionLibrary definitions = NewAndEvaluateItemDefinitionLibraryXml(group); - } - - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void InvalidRemoveAttributeOnDefinition() - { - XmlElement group = GetBasicItemDefinitionGroupWithOneDefinitionAndOneMetadatum(); - XmlTestUtilities.AddAttribute(group.ChildNodes[0], "Remove", "YYY"); - ItemDefinitionLibrary definitions = NewAndEvaluateItemDefinitionLibraryXml(group); - } - - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void InvalidAttributeOnMetadatum() - { - XmlElement group = GetBasicItemDefinitionGroupWithOneDefinitionAndOneMetadatum(); - XmlTestUtilities.AddAttribute(group.ChildNodes[0].ChildNodes[0], "XXXX", "YYY"); - ItemDefinitionLibrary definitions = NewAndEvaluateItemDefinitionLibraryXml(group); - } - - [Test] - public void ExpandPropertiesInMetadatumValue() - { - XmlElement group = GetBasicItemDefinitionGroupWithOneDefinitionAndOneMetadatum(); - group["CCompile"]["Defines"].InnerText = "A_$(p1)_$(p2)_B"; - ItemDefinitionLibrary definitions = NewAndEvaluateItemDefinitionLibraryXml(group); - - Assertion.AssertEquals(1, definitions.GetDefaultedMetadataCount("CCompile")); - Assertion.AssertEquals("A_v1__B", definitions.GetDefaultMetadataValue("CCompile", "Defines")); - } - - [Test] - public void TrueConditionOnEverything() - { - XmlElement group = GetBasicItemDefinitionGroupWithOneDefinitionAndOneMetadatum(); - XmlTestUtilities.AddAttribute(group.ChildNodes[0], "Condition", "'v1'=='$(p1)'"); - XmlTestUtilities.AddAttribute(group.ChildNodes[0].ChildNodes[0], "Condition", "'v1'=='$(p1)'"); - XmlTestUtilities.AddAttribute(group.ChildNodes[0].ChildNodes[0], "Condition", "'v1'=='$(p1)'"); - ItemDefinitionLibrary definitions = NewAndEvaluateItemDefinitionLibraryXml(group); - - Assertion.AssertEquals(1, definitions.GetDefaultedMetadataCount("CCompile")); - Assertion.AssertEquals("DEBUG", definitions.GetDefaultMetadataValue("CCompile", "Defines")); - } - - #region Project tests - - [Test] - public void BasicItemDefinitionInProject() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - DEBUG - - - - - - - - - - ", logger); - p.Build("t"); - - logger.AssertLogContains("[a.cpp==DEBUG]", "[b.cpp==DEBUG]"); - } - - [Test] - public void EscapingInItemDefinitionInProject() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - %24(xyz) - - - - - - - ", logger); - p.Build("t"); - - logger.AssertLogContains("[$(xyz)]"); - } - - - [Test] - public void ItemDefinitionForOtherItemType() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - m1 - - - - - - - ", logger); - p.Build("t"); - - logger.AssertLogContains("[]"); - } - - [Test] - public void RedefinitionLastOneWins() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - m1 - n1 - - - - - m2 - o1 - - - - - - - ", logger); - p.Build("t"); - - logger.AssertLogContains("[m2-n1-o1]"); - } - - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void ItemExpressionInDefaultMetadataValueErrors() - { - // We don't allow item expressions on an ItemDefinitionGroup because there are no items when IDG is evaluated. - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - @(x) - - - - ", logger); - p.Build("t"); - } - - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void UnqualifiedMetadataConditionOnItemDefinitionGroupErrors() - { - // We don't allow unqualified metadata on an ItemDefinitionGroup because we don't know what item type it refers to. - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - ", logger); - p.Build("t"); - } - - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void QualifiedMetadataConditionOnItemDefinitionGroupErrors() - { - // We don't allow qualified metadata because it's not worth distinguishing from unqualified, when you can just move the condition to the child. - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - ", logger); - p.Build("t"); - } - - [Test] - public void MetadataConditionOnItemDefinition() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - - m1 - - - n1 - - - - - m2 - - - - n2 - - - - - - - - ", logger); - p.Build("t"); - - logger.AssertLogContains("[m2]", "[n2]"); - } - - [Test] - public void QualifiedMetadataConditionOnItemDefinitionBothQualifiedAndUnqualified() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - m1 - - - - - m2 - - - - - - - ", logger); - p.Build("t"); - - logger.AssertLogContains("[m2]"); - } - - [Test] - public void FalseMetadataConditionOnItemDefinitionBothQualifiedAndUnqualified() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - m1 - - - - - m3 - - - - - - - ", logger); - p.Build("t"); - - logger.AssertLogContains("[m1]"); - } - - [Test] - public void MetadataConditionOnItemDefinitionChildBothQualifiedAndUnqualified() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - m1 - n1 - - - - - m2 - - - - - - - ", logger); - p.Build("t"); - - logger.AssertLogContains("[m2]"); - } - - [Test] - public void FalseMetadataConditionOnItemDefinitionChildBothQualifiedAndUnqualified() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - m1 - n1 - - - - - m3 - - - - - - - ", logger); - p.Build("t"); - - logger.AssertLogContains("[m1]"); - } - - [Test] - public void MetadataConditionOnItemDefinitionAndChildQualifiedWithUnrelatedItemType() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - m1 - - - - - m2 - - - - - - - ", logger); - p.Build("t"); - - logger.AssertLogContains("[m2]"); - } - - /// - /// Make ItemDefinitionGroup inside a target produce a nice error. - /// It will normally produce an error due to the invalid child tag, but - /// we want to error even if there's no child tag. This will make it - /// easier to support it inside targets in a future version. - /// - [Test] - public void ItemDefinitionInTargetErrors() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - ", logger); - bool result = p.Build("t"); - - Assertion.AssertEquals(false, result); - logger.AssertLogContains("MSB4163"); - } - - // Verify that anyone with a task named "ItemDefinitionGroup" can still - // use it by fully qualifying the name. - [Test] - public void ItemDefinitionGroupTask() - { - MockLogger ml = ObjectModelHelpers.BuildProjectExpectSuccess(String.Format(@" - - - - - - - ", new Uri(Assembly.GetExecutingAssembly().EscapedCodeBase).LocalPath)); - - Assertion.Assert(ml.FullLog.Contains("In ItemDefinitionGroup task.")); - } - - [Test] - public void MetadataOnItemWins() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - RETAIL - - - - - - DEBUG - - - - - - - ", logger); - p.Build("t"); - - logger.AssertLogContains("[a.cpp==RETAIL]", "[b.cpp==DEBUG]"); - } - - [Test] - public void MixtureOfItemAndDefaultMetadata() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - 4 - - - - - DEBUG - - - - - - - - ", logger); - p.Build("t"); - - logger.AssertLogContains("[a.cpp==DEBUG]", "[a.cpp==4]"); - } - - [Test] - public void IntrinsicTaskModifyingDefaultMetadata() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - m1 - - - - - - m2 - - - - - - ", logger); - p.Build("t"); - - logger.AssertLogContains("[m2]"); - - BuildItemGroup group = p.GetEvaluatedItemsByName("i"); - BuildItem item = group[0]; - string metadataValue = item.GetMetadata("m"); - Assertion.AssertEquals("m2", metadataValue); - - p.ResetBuildStatus(); - - // Should go back to definition - group = p.GetEvaluatedItemsByName("i"); - item = group[0]; - metadataValue = item.GetMetadata("m"); - Assertion.AssertEquals("m1", metadataValue); - } - - [Test] - public void IntrinsicTaskConsumingDefaultMetadata() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - m1 - - - - - - n2 - - - - - - ", logger); - p.Build("t"); - - logger.AssertLogContains("[n2]"); - } - - [Test] - public void DefinitionInImportedFile() - { - MockLogger logger = new MockLogger(); - string importedFile = null; - - try - { - importedFile = Path.GetTempFileName(); - File.WriteAllText(importedFile, @" - - - - DEBUG - - - - "); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - - - - ", logger); - p.Build("t"); - - logger.AssertLogContains("[a.cpp==DEBUG]"); - } - finally - { - ObjectModelHelpers.DeleteTempFiles(new string[] { importedFile }); - } - } - - /// - /// Item added to project should pick up the item - /// definitions that project has. - [Test] - public void ProjectAddNewItemPicksUpProjectItemDefinitions() - { - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - m1 - - - - "); - - BuildItem item = p.AddNewItem("i", "i1"); - - Assertion.AssertEquals("m1", item.GetEvaluatedMetadata("m")); - } - - /// - /// Item added to project should pick up the item - /// definitions that project has. - [Test] - public void ProjectAddNewItemExistingGroupPicksUpProjectItemDefinitions() - { - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - m1 - - - - - m2 - - - - "); - - BuildItem item1 = p.EvaluatedItems[0]; - BuildItem item2a = p.AddNewItem("i", "i1"); - BuildItem item2b = p.EvaluatedItems[0]; - - Assertion.AssertEquals("m2", item1.GetEvaluatedMetadata("m")); - Assertion.AssertEquals("m1", item2a.GetEvaluatedMetadata("m")); - Assertion.AssertEquals("m1", item2b.GetEvaluatedMetadata("m")); - } - - [Test] - public void ItemsEmittedByTaskPickUpItemDefinitions() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - m1 - n1 - - - - - - - - - - ", logger); - - p.Build("t"); - - logger.AssertLogContains("[m1][n2]"); - } - - [Test] - public void ItemsEmittedByIntrinsicTaskPickUpItemDefinitions() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - m1 - n1 - - - - - - n2 - - - - - - ", logger); - - p.Build("t"); - - logger.AssertLogContains("[m1][n2]"); - } - - [Test] - public void MutualReferenceToDefinition1() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - m1 - ~%(m)~ - - - - - - - - - - ", logger); - - p.Build("t"); - - logger.AssertLogContains("[m1][~m1~]"); - } - - [Test] - public void MutualReferenceToDefinition2() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - ~%(n)~ - n1 - - - - - - - - - - ", logger); - - p.Build("t"); - - logger.AssertLogContains("[~~][n1]"); - } - - [Test] - public void MutualReferenceToDefinition3() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - m1 - %(i.m) - %(j.m) - - - - - - - - - - ", logger); - - p.Build("t"); - - logger.AssertLogContains("[m1][m1][]"); - } - - [Test] - public void ProjectReevaluationReevaluatesItemDefinitions() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - CODEANALYSIS - - - - - - - $(Defines);RETAIL - $(Defines);DEBUG - - - - - - - ", logger); - - p.SetProperty("BuildFlavor", "ret"); - - p.Build("t"); - - logger.AssertLogContains("[a.cpp==CODEANALYSIS;RETAIL]"); - - BuildItemGroup group = p.GetEvaluatedItemsByName("CppCompile"); - BuildItem item = group[0]; - string metadataValue = item.GetMetadata("Defines"); - Assertion.AssertEquals("CODEANALYSIS;RETAIL", metadataValue); - - p.SetProperty("BuildFlavor", "chk"); - - group = p.GetEvaluatedItemsByName("CppCompile"); - item = group[0]; - metadataValue = item.GetMetadata("Defines"); - - Assertion.AssertEquals("CODEANALYSIS;DEBUG", metadataValue); - } - - [Test] - public void MSBuildCallDoesNotAffectCallingProjectsDefinitions() - { - string otherProject = null; - - try - { - otherProject = Path.GetTempFileName(); - string otherProjectContent = @" - - - - - - m2 - - - - - - "; - - using (StreamWriter writer = new StreamWriter(otherProject)) - { - writer.Write(otherProjectContent); - } - - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - m1 - - - - - - - - - ", logger); - - p.Build("t"); - - logger.AssertLogContains("[PARENT-before:m1]", "[CHILD:m2]", "[PARENT-after:m1]"); - } - finally - { - File.Delete(otherProject); - } - } - - [Test] - public void DefaultMetadataTravelWithTargetOutputs() - { - string otherProject = null; - - try - { - otherProject = Path.GetTempFileName(); - string otherProjectContent = @" - - - m1 - - - - - n1 - - - - - - "; - - using (StreamWriter writer = new StreamWriter(otherProject)) - { - writer.Write(otherProjectContent); - } - - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - - - ", logger); - - p.Build("t"); - - logger.AssertLogContains("[CHILD:i1:m=m1,n=n1]", "[PARENT:i1:m=m1,n=n1]"); - } - finally - { - File.Delete(otherProject); - } - } - - #endregion - - #region Helpers - - private static ItemDefinitionLibrary NewAndEvaluateItemDefinitionLibraryXml(XmlElement group) - { - ItemDefinitionLibrary library = new ItemDefinitionLibrary(new Project()); - library.Add(group); - - BuildPropertyGroup properties = new BuildPropertyGroup(); - properties.SetProperty("p1", "v1"); - library.Evaluate(properties); - - return library; - } - - internal static XmlElement GetBasicItemDefinitionGroupWithOneDefinitionAndOneMetadatum() - { - XmlElement group = XmlTestUtilities.CreateBasicElement("ItemDefinitionGroup"); - XmlElement item = XmlTestUtilities.AddChildElement(group, "CCompile"); - XmlTestUtilities.AddChildElementWithInnerText(item, "Defines", "DEBUG"); - return group; - } - - #endregion - } - - public class ItemDefinitionGroup : Microsoft.Build.Utilities.Task - { - public override bool Execute() - { - Log.LogMessage("In ItemDefinitionGroup task."); - return true; - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/BuildItemGroupChildXml_Tests.cs b/src/Deprecated/Engine.UnitTests/BuildItemGroupChildXml_Tests.cs deleted file mode 100644 index 0fd52f93013..00000000000 --- a/src/Deprecated/Engine.UnitTests/BuildItemGroupChildXml_Tests.cs +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections.Generic; -using System.Text; -using NUnit.Framework; -using System.Xml; -using Microsoft.Build.BuildEngine; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class BuildItemGroupChildXml_Tests - { - [Test] - public void ParseBasicRemoveOperation() - { - XmlElement xml = CreateBasicRemoveElement(); - BuildItemGroupChildXml child = new BuildItemGroupChildXml(xml, ChildType.BuildItemRemove); - - Assertion.AssertEquals("i1", child.Remove); - } - - [Test] - public void ExpectAnyGetModify() - { - XmlElement xml = XmlTestUtilities.CreateBasicElement("i"); - BuildItemGroupChildXml child = new BuildItemGroupChildXml(xml, ChildType.Any); - - Assertion.AssertEquals(ChildType.BuildItemModify, child.ChildType); - } - - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void ExpectAddGetRemove() - { - XmlElement xml = CreateBasicRemoveElement(); - BuildItemGroupChildXml child = new BuildItemGroupChildXml(xml, ChildType.BuildItemAdd); - } - - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void ExpectRemoveGetAdd() - { - XmlElement xml = XmlTestUtilities.CreateBasicElementWithOneAttribute("i", "Include", "i1");; - BuildItemGroupChildXml child = new BuildItemGroupChildXml(xml, ChildType.BuildItemRemove); - } - - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void ExpectModifyGetAdd() - { - XmlElement xml = XmlTestUtilities.CreateBasicElementWithOneAttribute("i", "Include", "i1"); ; - BuildItemGroupChildXml child = new BuildItemGroupChildXml(xml, ChildType.BuildItemModify); - } - - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void ExpectModifyGetRemove() - { - XmlElement xml = XmlTestUtilities.CreateBasicElementWithOneAttribute("i", "Remove", "i1"); ; - BuildItemGroupChildXml child = new BuildItemGroupChildXml(xml, ChildType.BuildItemModify); - } - - [Test] - [ExpectedException(typeof(InternalErrorException))] - public void ExpectInvalid() - { - XmlElement xml = XmlTestUtilities.CreateBasicElementWithOneAttribute("i", "Include", "i1"); - BuildItemGroupChildXml child = new BuildItemGroupChildXml(xml, ChildType.Invalid); - } - - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void InvalidIncludeAndRemoveTogether() - { - XmlElement xml = CreateBasicRemoveElement(); - xml.SetAttribute("Include", "i2"); - BuildItemGroupChildXml child = new BuildItemGroupChildXml(xml, ChildType.BuildItemRemove); - } - - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void InvalidExcludeWithoutInclude() - { - XmlElement xml = XmlTestUtilities.CreateBasicElementWithOneAttribute("i", "Exclude", "i1"); - BuildItemGroupChildXml child = new BuildItemGroupChildXml(xml, ChildType.BuildItemAdd); - } - - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void InvalidRemoveWithSomeMetadataChildren() - { - XmlElement xml = CreateBasicRemoveElement(); - XmlElement child1 = xml.OwnerDocument.CreateElement("m", XMakeAttributes.defaultXmlNamespace); - child1.InnerText = "m1"; - xml.AppendChild(child1); - BuildItemGroupChildXml child = new BuildItemGroupChildXml(xml, ChildType.BuildItemRemove); - } - - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void InvalidlyNamedMetadata() - { - XmlElement xml = XmlTestUtilities.CreateBasicElementWithOneAttribute("i", "Include", "i1"); - XmlElement child1 = xml.OwnerDocument.CreateElement("m", XMakeAttributes.defaultXmlNamespace); - XmlElement child2 = xml.OwnerDocument.CreateElement("Filename", XMakeAttributes.defaultXmlNamespace); - xml.AppendChild(child1); - xml.AppendChild(child2); - BuildItemGroupChildXml child = new BuildItemGroupChildXml(xml, ChildType.BuildItemAdd); - } - - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void RemoveAttributeMissing() - { - XmlDocument doc = new XmlDocument(); - XmlElement element = doc.CreateElement("i", XMakeAttributes.defaultXmlNamespace); - BuildItemGroupChildXml child = new BuildItemGroupChildXml(element, ChildType.BuildItemRemove); - } - - [Test] - public void ParseModify() - { - XmlDocument doc = new XmlDocument(); - XmlElement element = doc.CreateElement("i", XMakeAttributes.defaultXmlNamespace); - BuildItemGroupChildXml child = new BuildItemGroupChildXml(element, ChildType.BuildItemModify); - - Assertion.AssertEquals(ChildType.BuildItemModify, child.ChildType); - } - - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void InvalidExcludeAndRemoveTogether() - { - XmlElement xml = CreateBasicRemoveElement(); - xml.SetAttribute("Exclude", "i2"); - BuildItemGroupChildXml child = new BuildItemGroupChildXml(xml, ChildType.BuildItemRemove); - } - - private static XmlElement CreateBasicRemoveElement() - { - return XmlTestUtilities.CreateBasicElementWithOneAttribute("i", "Remove", "i1"); - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/BuildItemGroupProxy_Tests.cs b/src/Deprecated/Engine.UnitTests/BuildItemGroupProxy_Tests.cs deleted file mode 100644 index 62ba6089195..00000000000 --- a/src/Deprecated/Engine.UnitTests/BuildItemGroupProxy_Tests.cs +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Text; -using NUnit.Framework; -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class ItemGroupProxy_Tests - { - [Test] - public void BasicProxying() - { - BuildItemGroup ig = new BuildItemGroup(); - BuildItem i1 = new BuildItem("name1", "value1"); - i1.SetMetadata("myMetaName", "myMetaValue"); - BuildItem i2 = new BuildItem("name2", "value2"); - ig.AddItem(i1); - ig.AddItem(i2); - - BuildItemGroupProxy proxy = new BuildItemGroupProxy(ig); - - // Gather everything into our own table - Hashtable list = new Hashtable(StringComparer.OrdinalIgnoreCase); - foreach (DictionaryEntry item in proxy) - { - list.Add(item.Key, item.Value); - } - - // Check we got all the items - Assertion.AssertEquals(2, list.Count); - Assertion.AssertEquals("value1", ((TaskItem)list["name1"]).ItemSpec); - Assertion.AssertEquals("value2", ((TaskItem)list["name2"]).ItemSpec); - - // Check they have all their metadata - int builtInMetadata = FileUtilities.ItemSpecModifiers.All.Length; - Assertion.AssertEquals(1 + builtInMetadata, ((TaskItem)list["name1"]).MetadataCount); - Assertion.AssertEquals(0 + builtInMetadata, ((TaskItem)list["name2"]).MetadataCount); - Assertion.AssertEquals("myMetaValue", ((TaskItem)list["name1"]).GetMetadata("myMetaName")); - } - - [Test] - public void CantModifyThroughEnumerator() - { - BuildItemGroup ig = new BuildItemGroup(); - BuildItem i1 = new BuildItem("name1", "value1"); - i1.SetMetadata("myMetaName", "myMetaValue"); - ig.AddItem(i1); - - BuildItemGroupProxy proxy = new BuildItemGroupProxy(ig); - - Hashtable list = new Hashtable(StringComparer.OrdinalIgnoreCase); - foreach (DictionaryEntry item in proxy) - { - list.Add(item.Key, item.Value); - } - - // Change the item - Assertion.AssertEquals("value1", ((TaskItem)list["name1"]).ItemSpec); - ((TaskItem)list["name1"]).ItemSpec = "newItemSpec"; - ((TaskItem)list["name1"]).SetMetadata("newMetadata", "newMetadataValue"); - - // We did change our copy - Assertion.AssertEquals("newItemSpec", ((TaskItem)list["name1"]).ItemSpec); - Assertion.AssertEquals("newMetadataValue", ((TaskItem)list["name1"]).GetMetadata("newMetadata")); - Assertion.AssertEquals("myMetaValue", ((TaskItem)list["name1"]).GetMetadata("myMetaName")); - - // But get the item again - list = new Hashtable(StringComparer.OrdinalIgnoreCase); - foreach (DictionaryEntry item in proxy) - { - list.Add(item.Key, item.Value); - } - - // Item value and metadata hasn't changed - Assertion.AssertEquals("value1", ((TaskItem)list["name1"]).ItemSpec); - Assertion.AssertEquals("", ((TaskItem)list["name1"]).GetMetadata("newMetadata")); - Assertion.AssertEquals("myMetaValue", ((TaskItem)list["name1"]).GetMetadata("myMetaName")); - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/BuildItemGroup_Tests.cs b/src/Deprecated/Engine.UnitTests/BuildItemGroup_Tests.cs deleted file mode 100644 index 423558040e6..00000000000 --- a/src/Deprecated/Engine.UnitTests/BuildItemGroup_Tests.cs +++ /dev/null @@ -1,578 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Text; -using NUnit.Framework; -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine; -using Microsoft.Build.BuildEngine.Shared; -using System.Xml; - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class BuildItemGroup_Tests - { - [Test] - public void ParameterlessConstructor() - { - BuildItemGroup group = new BuildItemGroup(); - Assertion.AssertEquals(String.Empty, group.Condition); - Assertion.AssertEquals(false, group.IsPersisted); - Assertion.AssertEquals(0, group.Count); - Assertion.AssertEquals(false, group.IsImported); - } - - [Test] - public void XmlDocConstructor() - { - XmlDocument doc = new XmlDocument(); - BuildItemGroup group = new BuildItemGroup(doc, true, new Project()); - Assertion.AssertEquals(String.Empty, group.Condition); - Assert.AreNotEqual(null, group.ItemGroupElement); - Assertion.AssertEquals(0, group.Count); - Assertion.AssertEquals(true, group.IsImported); - } - - [Test] - [ExpectedException(typeof(InternalErrorException))] - public void XmlDocConstructor2() - { - BuildItemGroup group = new BuildItemGroup((XmlDocument)null, true, new Project()); - } - - [Test] - public void XmlElementConstructor() - { - XmlElement ig = CreatePersistedItemGroupElement(); - - BuildItemGroup group = new BuildItemGroup(ig, false, new Project()); - Assertion.AssertEquals("c", group.Condition); - Assertion.AssertEquals(ig, group.ItemGroupElement); - Assertion.AssertEquals(ig.ParentNode, group.ParentElement); - Assertion.AssertEquals(2, group.Count); - Assertion.AssertEquals(false, group.IsImported); - Assertion.AssertEquals("ci1", group[0].Condition); - Assertion.AssertEquals("i1", group[0].Include); - Assertion.AssertEquals("ci2", group[1].Condition); - Assertion.AssertEquals("i2", group[1].Include); - } - - private static XmlElement CreatePersistedItemGroupElement() - { - XmlDocument doc = new XmlDocument(); - XmlElement ig = doc.CreateElement("ItemGroup", XMakeAttributes.defaultXmlNamespace); - XmlAttribute condition = doc.CreateAttribute("Condition"); - condition.Value = "c"; - ig.SetAttributeNode(condition); - - XmlElement item1 = doc.CreateElement("i", XMakeAttributes.defaultXmlNamespace); - XmlAttribute condition1 = doc.CreateAttribute("Condition"); - condition1.Value = "ci1"; - item1.SetAttributeNode(condition1); - XmlAttribute include1 = doc.CreateAttribute("Include"); - include1.Value = "i1"; - item1.SetAttributeNode(include1); - ig.AppendChild(item1); - - XmlElement item2 = doc.CreateElement("i", XMakeAttributes.defaultXmlNamespace); - XmlAttribute condition2 = doc.CreateAttribute("Condition"); - condition2.Value = "ci2"; - item2.SetAttributeNode(condition2); - XmlAttribute include2 = doc.CreateAttribute("Include"); - include2.Value = "i2"; - item2.SetAttributeNode(include2); - ig.AppendChild(item2); - return ig; - } - - [Test] - [ExpectedException(typeof(InternalErrorException))] - public void XmlElementConstructor2() - { - BuildItemGroup group = new BuildItemGroup((XmlElement)null, true, new Project()); - } - - - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void XmlElementConstructor3() - { - XmlDocument doc = new XmlDocument(); - XmlElement ig = doc.CreateElement("ItemGroup", XMakeAttributes.defaultXmlNamespace); - XmlAttribute a = doc.CreateAttribute("x"); - ig.SetAttributeNode(a); - - BuildItemGroup group = new BuildItemGroup(ig, false, new Project()); - } - - [Test] - [ExpectedException(typeof(InternalErrorException))] - public void XmlElementConstructor4() - { - XmlDocument doc = new XmlDocument(); - XmlElement ig = doc.CreateElement("x", XMakeAttributes.defaultXmlNamespace); - BuildItemGroup group = new BuildItemGroup(ig, true, new Project()); - } - - [Test] - [ExpectedException(typeof(InvalidOperationException))] - public void SetConditionOnVirtualGroup() - { - BuildItemGroup group = new BuildItemGroup(); - group.Condition = "x"; - } - - [Test] - [ExpectedException(typeof(InvalidOperationException))] - public void SetConditionOnImportedGroup() - { - XmlDocument doc = new XmlDocument(); - BuildItemGroup group = new BuildItemGroup(doc, true, new Project()); - group.Condition = "x"; - } - - [Test] - public void SetNullCondition() - { - XmlDocument doc = new XmlDocument(); - BuildItemGroup group = new BuildItemGroup(doc, false, new Project()); - group.Condition = null; - Assertion.AssertEquals(String.Empty, group.Condition); - } - - [Test] - public void SetEmptyCondition() - { - XmlDocument doc = new XmlDocument(); - BuildItemGroup group = new BuildItemGroup(doc, false, new Project()); - group.Condition = String.Empty; - Assertion.AssertEquals(String.Empty, group.Condition); - } - - [Test] - public void SetCondition() - { - XmlDocument doc = new XmlDocument(); - BuildItemGroup group = new BuildItemGroup(doc, false, new Project()); - group.Condition = "x"; - Assertion.AssertEquals("x", group.Condition); - } - - [Test] - public void ToArray() - { - XmlElement ig = CreatePersistedItemGroupElement(); - BuildItemGroup group = new BuildItemGroup(ig, false, new Project()); - BuildItem[] array = group.ToArray(); - - Assertion.AssertEquals(2, array.Length); - Assertion.AssertEquals("i1", array[0].Include); - Assertion.AssertEquals("i2", array[1].Include); - } - - [Test] - public void Enumerator() - { - XmlElement ig = CreatePersistedItemGroupElement(); - BuildItemGroup group = new BuildItemGroup(ig, false, new Project()); - - List items = new List(); - foreach (BuildItem item in group) - { - items.Add(item); - } - - Assertion.AssertEquals(2, items.Count); - Assertion.AssertEquals("i1", items[0].Include); - Assertion.AssertEquals("i2", items[1].Include); - } - - [Test] - public void AddNewItem1() - { - XmlElement ig = CreatePersistedItemGroupElement(); - BuildItemGroup group = new BuildItemGroup(ig, false, new Project()); - - group.AddNewItem("j", "j1"); - group.AddNewItem("j", "j2;", true /*literal*/); - - Assertion.AssertEquals(4, group.Count); - Assertion.AssertEquals("j1", group[2].Include); - Assertion.AssertEquals("j2%3b", group[3].Include); - } - - /// - /// Adding an existing item should cause it to pick up - /// the project's item definitions - /// - [Test] - public void AddExistingItemAt() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - m1 - - - - ", logger); - - BuildItemGroup group = p.AddNewItemGroup(); - BuildItem item = new BuildItem("i", "i1"); - group.AddExistingItemAt(0, item); - Expander expander = new Expander(new BuildPropertyGroup()); - item.EvaluateAllItemMetadata(expander, ParserOptions.AllowPropertiesAndItemLists, null, null); - - Assertion.AssertEquals("m1", item.GetMetadata("m")); - } - - /// - /// Metadata should be able to refer to metadata above - /// - [Test] - public void MutualReferenceToMetadata() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - m1 - %(m);m2 - %(m);m3 - - - - - - - ", logger); - - p.Build("t"); - - logger.AssertLogContains("[m1;m2]"); - } - - /// - /// Metadata should be able to refer to metadata above - /// - [Test] - public void MutualReferenceToMetadataQualified() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - m1 - %(i.m);m2 - %(m);m3 - - - - - - - ", logger); - - p.Build("t"); - - logger.AssertLogContains("[m1;m2]"); - } - - /// - /// Metadata should be able to refer to metadata above - /// - [Test] - public void MutualReferenceToMetadataMixed() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - l1 - - - - - overridden - m1 - %(l);%(i.l);n1;%(m);%(i.m);%(o);%(i.o);n2 - - - - - - - ", logger); - - p.Build("t"); - - logger.AssertLogContains("[l1;l1;n1;m1;m1;;;n2]"); - } - - /// - /// Metadata should be able to refer to metadata definitions - /// - [Test] - public void MetadataReferenceToMetadataDefinition() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - m1 - - - - - %(m);m2 - - - - - - - ", logger); - - p.Build("t"); - - logger.AssertLogContains("[m1;m2]"); - } - - /// - /// Escaping metadata should prevent it being evaluated - /// - [Test] - public void EscapedMetadataReference() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - %25(m) - - - - - - - ", logger); - - p.Build("t"); - - logger.AssertLogContains("[%(m)]"); - } - - [Test] - public void RemoveItem1() - { - XmlElement ig = CreatePersistedItemGroupElement(); - BuildItemGroup group = new BuildItemGroup(ig, false, new Project()); - - BuildItem i2 = group[1]; - group.RemoveItem(i2); - - Assertion.AssertEquals(1, group.Count); - Assertion.AssertEquals(1, group.ItemGroupElement.ChildNodes.Count); - Assertion.AssertEquals("i1", group[0].Include); - Assertion.AssertEquals(null, i2.ParentPersistedItemGroup); - } - - [Test] - [ExpectedException(typeof(InvalidOperationException))] - public void RemoveItemNotBelonging() - { - XmlElement ig = CreatePersistedItemGroupElement(); - BuildItemGroup group = new BuildItemGroup(ig, false, new Project()); - - BuildItem item = new BuildItem("x", "x1"); - group.RemoveItem(item); - } - - [Test] - public void RemoveItemAt1() - { - XmlElement ig = CreatePersistedItemGroupElement(); - BuildItemGroup group = new BuildItemGroup(ig, false, new Project()); - - BuildItem i2 = group[1]; - group.RemoveItemAt(1); - - Assertion.AssertEquals(1, group.Count); - Assertion.AssertEquals(1, group.ItemGroupElement.ChildNodes.Count); - Assertion.AssertEquals("i1", group[0].Include); - Assertion.AssertEquals(null, i2.ParentPersistedItemGroup); - } - - // Can't shallow clone a persisted item group - [Test] - [ExpectedException(typeof(InvalidOperationException))] - public void ShallowCloneOfPersistedItemGroup() - { - XmlElement ig = CreatePersistedItemGroupElement(); - BuildItemGroup group = new BuildItemGroup(ig, false, new Project()); - - BuildItemGroup clone = group.Clone(false); - } - - [Test] - public void DeepCloneOfPersistedItemGroup() - { - XmlElement ig = CreatePersistedItemGroupElement(); - BuildItemGroup group = new BuildItemGroup(ig, false, new Project()); - - BuildItemGroup clone = group.Clone(true); - - Assertion.AssertEquals(2, clone.Count); - Assert.AreNotEqual(group.ItemGroupElement, clone.ItemGroupElement); - Assert.AreNotEqual(group.ParentProject, clone.ParentProject); - } - - [Test] - public void ShallowCloneOfVirtualItemGroup() - { - BuildItemGroup group = new BuildItemGroup(); - group.AddNewItem("i", "i1"); - BuildItem i2 = new BuildItem("i", "i2"); - group.AddItem(i2); - - BuildItemGroup group2 = group.Clone(false /*shallow*/); - - Assertion.AssertEquals(2, group2.Count); - Assertion.AssertEquals("i1", group2[0].FinalItemSpec); - Assertion.Assert(i2.Equals(group2[1])); - } - - [Test] - public void Clear() - { - XmlElement ig = CreatePersistedItemGroupElement(); - BuildItemGroup group = new BuildItemGroup(ig, false, new Project()); - - BuildItem i1 = group[0]; - group.Clear(); - - Assertion.AssertEquals(0, group.Count); - Assertion.AssertEquals(0, ig.ChildNodes.Count); - Assertion.AssertEquals(null, i1.ParentPersistedItemGroup); - } - - [Test] - public void RemoveAllIntermediateItems1() - { - BuildItemGroup group = new BuildItemGroup(); // virtual group - XmlElement element = CreatePersistedItemGroupElement(); - - BuildItem item1 = CreatePersistedBuildItem(element, "i", "i1"); - BuildItem item2 = CreatePersistedBuildItem(element, "i", "i2"); - group.AddExistingItem(item1); - group.AddExistingItem(item2); - group.AddNewItem("j", "j1"); - Assertion.AssertEquals(3, group.Count); - - group.RemoveAllIntermediateItems(); - Assertion.AssertEquals(2, group.Count); - } - - [Test] - public void Backup1() - { - BuildItemGroup group = new BuildItemGroup(); // virtual group - XmlElement element = CreatePersistedItemGroupElement(); - - BuildItem item1 = CreatePersistedBuildItem(element, "i", "i1"); - BuildItem item2 = CreatePersistedBuildItem(element, "i", "i2"); - group.AddExistingItem(item1); - group.AddExistingItem(item2); - BuildItem item3 = group.AddNewItem("j", "j1"); // virtual - Assertion.AssertEquals(3, group.Count); - - group.RemoveItemWithBackup(item3); - group.RemoveItemWithBackup(item1); - Assertion.AssertEquals(1, group.Count); - - group.RemoveAllIntermediateItems(); - Assertion.AssertEquals(2, group.Count); - } - - [Test] - public void AddItem1() - { - XmlElement ig = CreatePersistedItemGroupElement(); - BuildItemGroup group = new BuildItemGroup(ig, false, new Project()); - - BuildItem item = CreatePersistedBuildItem(ig, "i", "i3"); - group.AddItem(item); - VerifyPersistedItemPosition(group, item, 2); // should be last - - item = CreatePersistedBuildItem(ig, "h", "h1"); - group.AddItem(item); - VerifyPersistedItemPosition(group, item, 3); // should be last, because there were no h's. - - item = CreatePersistedBuildItem(ig, "h", "h0"); - group.AddItem(item); - VerifyPersistedItemPosition(group, item, 3);// should be 2nd last - - item = CreatePersistedBuildItem(ig, "i", "i2"); - group.AddItem(item); - VerifyPersistedItemPosition(group, item, 1); // should be 2nd - - item = CreatePersistedBuildItem(ig, "i", "i0"); - group.AddItem(item); - VerifyPersistedItemPosition(group, item, 0); // should be first - } - - [Test] - public void AddItemEmptyPersistedGroup() - { - XmlDocument doc = new XmlDocument(); - XmlElement ig = doc.CreateElement("ItemGroup", XMakeAttributes.defaultXmlNamespace); - BuildItemGroup group = new BuildItemGroup(ig, false, new Project()); - - BuildItem item = CreatePersistedBuildItem(ig, "i", "i3"); - group.AddItem(item); - VerifyPersistedItemPosition(group, item, 0); - } - - [Test] - public void AddItemEmptyNonPersistedGroup() - { - BuildItemGroup group = new BuildItemGroup(); - BuildItem item = new BuildItem("i", "i1"); - group.AddItem(item); - Assertion.AssertEquals(item, group[0]); // should be last - item = new BuildItem("i", "i0"); - group.AddItem(item); - Assertion.AssertEquals(item, group[1]); // should be last again - } - - private static void VerifyPersistedItemPosition(BuildItemGroup group, BuildItem item, int position) - { - Assertion.AssertEquals(group[position].Include, group.ItemGroupElement.ChildNodes[position].Attributes["Include"].Value); - Assertion.AssertEquals(item.Include, group[position].Include); - } - - private static BuildItem CreatePersistedBuildItem(XmlElement groupElement, string name, string include) - { - XmlElement element = groupElement.OwnerDocument.CreateElement(name, XMakeAttributes.defaultXmlNamespace); - element.SetAttribute("Include", include); - BuildItem item = new BuildItem(element, false, new ItemDefinitionLibrary(new Project())); - return item; - } - - } -} diff --git a/src/Deprecated/Engine.UnitTests/BuildItem_Tests.cs b/src/Deprecated/Engine.UnitTests/BuildItem_Tests.cs deleted file mode 100644 index b9358208874..00000000000 --- a/src/Deprecated/Engine.UnitTests/BuildItem_Tests.cs +++ /dev/null @@ -1,207 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Text; -using NUnit.Framework; -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine; -using Microsoft.Build.BuildEngine.Shared; -using System.Xml; - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class BuildItem_Tests - { - [Test] - public void Basic() - { - BuildItem item = new BuildItem("i", "i1"); - Assertion.AssertEquals("i", item.Name); - Assertion.AssertEquals("i1", item.EvaluatedItemSpec); - Assertion.AssertEquals("i1", item.FinalItemSpec); - Assertion.AssertEquals("i1", item.FinalItemSpecEscaped); - } - - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void InvalidNamespace() - { - string content = @" - - m1 - n1 - "; - XmlDocument doc = new XmlDocument(); - doc.LoadXml(content); - CreateBuildItemFromXmlDocument(doc); - } - - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void MissingInclude() - { - string content = @""; - XmlDocument doc = new XmlDocument(); - doc.LoadXml(content); - BuildItem item = CreateBuildItemFromXmlDocument(doc); - } - - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void MissingInclude2() - { - string content = @""; - XmlDocument doc = new XmlDocument(); - doc.LoadXml(content); - BuildItem item = CreateBuildItemFromXmlDocument(doc); - } - - [Test] - public void Metadata() - { - string content = @" - - $(p) - n1 - "; - XmlDocument doc = new XmlDocument(); - doc.LoadXml(content); - BuildItem item = CreateBuildItemFromXmlDocument(doc); - Assertion.AssertEquals("i", item.Name); - BuildPropertyGroup properties = new BuildPropertyGroup(); - properties.SetProperty("p", "p1"); - - // Evaluated - Expander expander = new Expander(properties, null, ExpanderOptions.ExpandAll); - item.EvaluateAllItemMetadata(expander, ParserOptions.AllowPropertiesAndItemLists, null, null); - Assertion.AssertEquals("p1", item.GetEvaluatedMetadata("m")); - - // Unevaluated - Assertion.AssertEquals("$(p)", item.GetMetadata("m")); - Assertion.AssertEquals("n1", item.GetMetadata("n")); - - // All custom metadata - ArrayList metadataNames = new ArrayList(item.CustomMetadataNames); - Assertion.Assert(metadataNames.Contains("n")); - Assertion.Assert(metadataNames.Contains("m")); - - // Custom metadata count only - Assertion.AssertEquals(2, item.CustomMetadataCount); - - // All metadata count - Assertion.AssertEquals(2 + FileUtilities.ItemSpecModifiers.All.Length, item.MetadataCount); - } - - [Test] - public void MetadataIncludesItemDefinitionMetadata() - { - // Get an item of type "i" that has an item definition library - // for type "i" that has default value "m1" for metadata "m" - // and has value "n1" for metadata "n" - BuildItem item = GetXmlBackedItemWithDefinitionLibrary(); - - // Evaluated - Expander expander = new Expander(new BuildPropertyGroup(), null, ExpanderOptions.ExpandAll); - item.EvaluateAllItemMetadata(expander, ParserOptions.AllowPropertiesAndItemLists, null, null); - Assertion.AssertEquals("m1", item.GetEvaluatedMetadata("m")); - Assertion.AssertEquals("n1", item.GetEvaluatedMetadata("n")); - - // Unevaluated - Assertion.AssertEquals("m1", item.GetMetadata("m")); - Assertion.AssertEquals("n1", item.GetMetadata("n")); - - // All custom metadata - List metadataNames = new List((IList)item.CustomMetadataNames); - Assertion.AssertEquals("n", (string)metadataNames[0]); - Assertion.AssertEquals("m", (string)metadataNames[1]); - - // Custom metadata count only - Assertion.AssertEquals(3, item.CustomMetadataCount); - - // All metadata count - Assertion.AssertEquals(item.CustomMetadataCount + FileUtilities.ItemSpecModifiers.All.Length, item.MetadataCount); - } - - [Test] - public void VirtualClone() - { - BuildItem item = new BuildItem("i", "i1"); - BuildItem clone = item.Clone(); - - Assertion.AssertEquals("i", clone.Name); - Assertion.AssertEquals("i1", clone.EvaluatedItemSpec); - Assertion.AssertEquals("i1", clone.FinalItemSpec); - Assertion.AssertEquals("i1", clone.FinalItemSpecEscaped); - } - - [Test] - public void RegularClone() - { - BuildItem item = GetXmlBackedItemWithDefinitionLibrary(); - BuildItem clone = item.Clone(); - - Assertion.AssertEquals("i", clone.Name); - Assertion.AssertEquals("i1", clone.EvaluatedItemSpec); - Assertion.AssertEquals("i1", clone.FinalItemSpec); - Assertion.AssertEquals("i1", clone.FinalItemSpecEscaped); - - // Make sure the itemdefinitionlibrary is cloned, too - Assertion.AssertEquals("m1", clone.GetEvaluatedMetadata("m")); - } - - [Test] - public void CreateClonedParentedItem() - { - BuildItem parent = GetXmlBackedItemWithDefinitionLibrary(); - BuildItem child = new BuildItem("i", "i2"); - child.SetMetadata("n", "n2"); - - BuildItem clone = BuildItem.CreateClonedParentedItem(child, parent); - - Assertion.AssertEquals("i", clone.Name); - Assertion.AssertEquals("i2", clone.EvaluatedItemSpec); - Assertion.AssertEquals("i2", clone.FinalItemSpec); - Assertion.AssertEquals("i2", clone.FinalItemSpecEscaped); - - // Make sure the itemdefinitionlibrary is cloned, too - Assertion.AssertEquals("m1", clone.GetEvaluatedMetadata("m")); - Assertion.AssertEquals("n1", clone.GetEvaluatedMetadata("n")); - } - - internal static BuildItem GetXmlBackedItemWithDefinitionLibrary() - { - string content = @""; - XmlDocument doc = new XmlDocument(); - doc.LoadXml(content); - - XmlElement groupElement = XmlTestUtilities.CreateBasicElement("ItemDefinitionGroup"); - XmlElement itemElement = XmlTestUtilities.AddChildElement(groupElement, "i"); - XmlElement metaElement = XmlTestUtilities.AddChildElementWithInnerText(itemElement, "m", "m1"); - XmlElement metaElement2 = XmlTestUtilities.AddChildElementWithInnerText(itemElement, "o", "o1"); - - ItemDefinitionLibrary library = new ItemDefinitionLibrary(new Project()); - library.Add(groupElement); - library.Evaluate(null); - - BuildItem item = new BuildItem((XmlElement)doc.FirstChild, false, library); - item.SetMetadata("n", "n1"); - return item; - } - - private static BuildItem CreateBuildItemFromXmlDocument(XmlDocument doc) - { - ItemDefinitionLibrary itemDefinitionLibrary = new ItemDefinitionLibrary(new Project()); - itemDefinitionLibrary.Evaluate(new BuildPropertyGroup()); - BuildItem item = new BuildItem((XmlElement)doc.FirstChild, false, itemDefinitionLibrary); - return item; - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/BuildPropertyGroupProxy_Tests.cs b/src/Deprecated/Engine.UnitTests/BuildPropertyGroupProxy_Tests.cs deleted file mode 100644 index 471a412087f..00000000000 --- a/src/Deprecated/Engine.UnitTests/BuildPropertyGroupProxy_Tests.cs +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Text; -using NUnit.Framework; -using Microsoft.Build.BuildEngine; - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class BuildPropertyGroupProxy_Tests - { - [Test] - public void BasicProxying() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - BuildProperty p1 = new BuildProperty("name1", "value1", PropertyType.EnvironmentProperty); - BuildProperty p2 = new BuildProperty("name2", "value2", PropertyType.GlobalProperty); - pg.SetProperty(p1); - pg.SetProperty(p2); - - BuildPropertyGroupProxy proxy = new BuildPropertyGroupProxy(pg); - - Hashtable list = new Hashtable(StringComparer.OrdinalIgnoreCase); - - foreach (DictionaryEntry prop in proxy) - { - list.Add(prop.Key, prop.Value); - } - - Assertion.Assert(list.Count == 2); - Assertion.Assert((string)list["name1"] == "value1"); - Assertion.Assert((string)list["name2"] == "value2"); - } - - /// - /// It is essential that there is no way to modify the original - /// collection through the proxy. - /// - [Test] - public void CantModifyThroughEnumerator() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - // Only NormalProperties are modifiable anyway - BuildProperty p1 = new BuildProperty("name1", "value1", PropertyType.NormalProperty); - pg.SetProperty(p1); - - BuildPropertyGroupProxy proxy = new BuildPropertyGroupProxy(pg); - - Hashtable list = new Hashtable(StringComparer.OrdinalIgnoreCase); - - // Get the one property - foreach (DictionaryEntry prop in proxy) - { - list.Add(prop.Key, prop.Value); - } - - // Change the property - Assertion.Assert((string)list["name1"] == "value1"); - list["name1"] = "newValue"; - Assertion.Assert((string)list["name1"] == "newValue"); - - // Get the property again - list = new Hashtable(StringComparer.OrdinalIgnoreCase); - foreach (DictionaryEntry prop in proxy) - { - list.Add(prop.Key, prop.Value); - } - - // Property value hasn't changed - Assertion.Assert((string)list["name1"] == "value1"); - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/BuildRequest_Tests.cs b/src/Deprecated/Engine.UnitTests/BuildRequest_Tests.cs deleted file mode 100644 index 99734d73427..00000000000 --- a/src/Deprecated/Engine.UnitTests/BuildRequest_Tests.cs +++ /dev/null @@ -1,295 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Xml; -using System.Collections; -using System.Text.RegularExpressions; -using System.Collections.Generic; -using NUnit.Framework; -using System.IO; - -using Microsoft.Build.BuildEngine; -using Microsoft.Build.Framework; - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class BuildRequest_Tests - { - /// - /// Test one of the constructors and some of the properties to make sure that they are set - /// - [Test] - public void TestConstructor1andProperties() - { - - int nodeProxyId = 1; - string projectFileName = "ProjectFileName"; - string[] targetNames = new string[] { "Build" }; - BuildPropertyGroup globalProperties = null; - int requestId = 1; - - BuildRequest firstConstructorRequest = new BuildRequest(nodeProxyId, projectFileName, targetNames, globalProperties, null, requestId, false, false); - Assert.AreEqual(1, firstConstructorRequest.HandleId, "Expected firstConstructorRequest.NodeProxyId to be 1"); - firstConstructorRequest.HandleId = 2; - Assert.AreEqual(2, firstConstructorRequest.HandleId, "Expected firstConstructorRequest.NodeProxyId to be 2"); - Assert.AreEqual(1, firstConstructorRequest.RequestId, "Expected firstConstructorRequest.RequestId to be 1"); - firstConstructorRequest.RequestId = 2; - Assert.AreEqual(2, firstConstructorRequest.RequestId, "Expected firstConstructorRequest.RequestId to be 2"); - Assert.IsNull(firstConstructorRequest.GlobalProperties, "Expected firstConstructorRequest.GlobalProperties to be null"); - firstConstructorRequest.GlobalProperties = new BuildPropertyGroup(); - Assert.IsNotNull(firstConstructorRequest.GlobalProperties, "Expected firstConstructorRequest.GlobalProperties to not be null"); - Assert.IsTrue((firstConstructorRequest.TargetNames.Length == 1) && (string.Compare("Build", firstConstructorRequest.TargetNames[0], StringComparison.OrdinalIgnoreCase) == 0), "Expected to have one target with a value of Build in firstConstructorRequest.TargetNames"); - Assert.IsTrue(string.Compare("ProjectFileName", firstConstructorRequest.ProjectFileName, StringComparison.OrdinalIgnoreCase) == 0, "Expected firstConstructorRequest.ProjectFileName to be called ProjecFileName"); - - globalProperties = new BuildPropertyGroup(); - BuildProperty propertyToAdd = new BuildProperty("PropertyName", "Value"); - globalProperties.SetProperty(propertyToAdd); - - firstConstructorRequest = new BuildRequest(nodeProxyId, projectFileName, targetNames, globalProperties, null, requestId, false, false); - Assert.IsNotNull(firstConstructorRequest.GlobalPropertiesPassedByTask, "Expected GlobalPropertiesPassedByTask to not be null"); - Assert.IsNotNull(firstConstructorRequest.GlobalProperties, "Expected GlobalPropertiesPassedByTask to not be null"); - Assert.IsTrue(string.Compare(firstConstructorRequest.GlobalProperties["PropertyName"].Value, "Value", StringComparison.OrdinalIgnoreCase) == 0, "Expected GlobalProperties, propertyname to be equal to value"); - - string buildProperty = ((Hashtable)firstConstructorRequest.GlobalPropertiesPassedByTask)["PropertyName"] as string; - Assert.IsTrue(string.Compare(buildProperty, "Value", StringComparison.OrdinalIgnoreCase) == 0, "Expected hashtable to contain a property group with a value of value"); - Assert.IsTrue((firstConstructorRequest.TargetNames.Length == 1) && (string.Compare("Build", firstConstructorRequest.TargetNames[0], StringComparison.OrdinalIgnoreCase) == 0), "Expected to have one target with a value of Build"); - Assert.IsTrue(string.Compare("ProjectFileName", firstConstructorRequest.ProjectFileName, StringComparison.OrdinalIgnoreCase) == 0, "Expected project file to be called ProjecFileName"); - - - } - - /// - /// Check the second constructor and more of the properties to make sure they are set - /// - [Test] - public void TestConstructor2andProperties() - { - - int nodeProxyId = 1; - string projectFileName = "ProjectFileName"; - string[] targetNames = new string[] { "Build" }; - Dictionary dictionary = null; - int requestId = 1; - - // Check that the initial values of the properties are set based on the constructor being run - BuildRequest secondConstructorRequest = new BuildRequest(nodeProxyId, projectFileName, targetNames, (IDictionary)dictionary, null, requestId, false, false); - Assert.AreEqual(1, secondConstructorRequest.HandleId, "Expected NodeProxyId to be 1"); - Assert.AreEqual(1, secondConstructorRequest.RequestId, "Expected RequestId to be 1"); - Assert.IsNull(secondConstructorRequest.GlobalProperties, "Expected GlobalProperties to be null"); - Assert.IsNull(secondConstructorRequest.GlobalPropertiesPassedByTask, "Expected GlobalPropertiesPassedByTask to be null"); - Assert.IsTrue((secondConstructorRequest.TargetNames.Length == 1) && (string.Compare("Build", secondConstructorRequest.TargetNames[0], StringComparison.OrdinalIgnoreCase) == 0), "Expected to have one target with a value of Build"); - Assert.IsTrue(string.Compare("ProjectFileName", secondConstructorRequest.ProjectFileName, StringComparison.OrdinalIgnoreCase) == 0, "Expected project file to be called ProjecFileName"); - Assert.IsNull(secondConstructorRequest.ParentEngine, "Expected parent Engine to be null"); - Assert.IsNull(secondConstructorRequest.OutputsByTarget, "Expected outputs by target to be null"); - Assert.IsFalse(secondConstructorRequest.BuildSucceeded, "Expected BuildSucceeded to be false"); - Assert.AreEqual(secondConstructorRequest.BuildSettings, BuildSettings.None, "Expected BuildSettings to be none"); - Assert.IsNull(secondConstructorRequest.ProjectToBuild, "Expected ProjectToBuild to be null"); - Assert.IsFalse(secondConstructorRequest.FireProjectStartedFinishedEvents, " Expected FireProjectStartedFinishedEvents to be false"); - Assert.IsTrue(secondConstructorRequest.IsGeneratedRequest, "Expected GeneratedRequest to be true"); - - // Test that if a nodeProxyId is set to NodeProxy.invalidEngineHandle then we should get a not null dependency chain - secondConstructorRequest = new BuildRequest(EngineCallback.invalidEngineHandle, projectFileName, targetNames, (IDictionary)dictionary, null, requestId, false, false); - Assert.IsFalse(secondConstructorRequest.IsGeneratedRequest, "Expected GeneratedRequest to be false"); - - // Create a dictionary and hash table so that we can test the second constructor more - dictionary = new Dictionary(); - dictionary.Add("PropertyName", "Value"); - Hashtable propertyHash = new Hashtable(); - propertyHash.Add("PropertyName", "Value"); - - // If a dictionary is passed then it will be converted to a hashtable by copying the items out, we shoud - // therefore make sure that the hashtable has the correct items inside of it - secondConstructorRequest = new BuildRequest(nodeProxyId, projectFileName, targetNames, (IDictionary)dictionary, null, requestId, false, false); - string buildPropertyValue = ((Hashtable)secondConstructorRequest.GlobalPropertiesPassedByTask)["PropertyName"] as string; - Assert.IsTrue(string.Compare(buildPropertyValue, "Value", StringComparison.OrdinalIgnoreCase) == 0, "Expected buildPropertyValue to be value"); - - // If a hashtable is passed then the GlobalPropertiesPassedByTask are set to that hashtable - secondConstructorRequest = new BuildRequest(nodeProxyId, projectFileName, targetNames, propertyHash, null, requestId, false, false); - Assert.AreEqual(propertyHash, ((Hashtable)secondConstructorRequest.GlobalPropertiesPassedByTask), "Expected propertyHash to be equal to GlobalPropertiesPassedByTask"); - - //Change the parentNode to verify the working of isExternalRequest - secondConstructorRequest.IsExternalRequest = false; - Assert.IsFalse(secondConstructorRequest.IsExternalRequest, "Expected IsExternalRequest to return false"); - secondConstructorRequest.IsExternalRequest = true; - Assert.IsTrue(secondConstructorRequest.IsExternalRequest, "Expected IsExternalRequest to return true"); - - // Verify that the parentEngine can be set through a property - secondConstructorRequest.ParentEngine = new Engine(); - Assert.IsNotNull(secondConstructorRequest.ParentEngine, "Expected parent Engine to not be null"); - } - - /// - /// Check to make sure that the nonserialized defaults are reset to their correct values - /// - [Test] - public void RestoreNonSerializedDefaults() - { - - int nodeProxyId = 1; - string projectFileName = "ProjectFileName"; - string[] targetNames = new string[] { "Build" }; - Dictionary dictionary = null; - int requestId = 1; - - // Check that the initial values of the properties are set based on the constructor being run - BuildRequest buildRequest = new BuildRequest(nodeProxyId, projectFileName, targetNames, (IDictionary)dictionary, null, requestId, false, false); - buildRequest.RestoreNonSerializedDefaults(); - Assert.IsNotNull(buildRequest.OutputsByTarget, "Expected OutputsByTarget to not be null"); - Assert.IsNotNull(buildRequest.ResultByTarget, "Expected ResultByTarget to not be null"); - Assert.IsNull(buildRequest.ProjectToBuild, "Expected ProjectToBuild to be null"); - Assert.IsTrue(buildRequest.BuildSettings == BuildSettings.None, "Expected BuildSettings to be none"); - Assert.IsTrue(buildRequest.FireProjectStartedFinishedEvents, "Expected FireProjectStartedFinishedEvents to be true"); - Assert.AreEqual(EngineCallback.invalidNode, buildRequest.NodeIndex, "Expected NodeIndex to be -2"); - Assert.IsFalse(buildRequest.BuildCompleted, "Expected buildCompleted to be false"); - Assert.IsFalse(buildRequest.BuildSucceeded, "Expected BuildSucceeded to be false"); - } - - /// - /// Try some different targetNames combinations and make sure the concatonated list is correct - /// - [Test] - public void GetTargetNamesList() - { - int nodeProxyId = 1; - string projectFileName = "ProjectFileName"; - string[] targetNames = null; - - Dictionary dictionary = null; - int requestId = 1; - - // Test the case where we pass in null targets - BuildRequest buildRequest = new BuildRequest(nodeProxyId, projectFileName, targetNames, (IDictionary)dictionary, null, requestId, false, false); - Assert.IsNull(buildRequest.GetTargetNamesList(), "Expected GetTargetNamesList to be null"); - - // Test the case where we pass in one target - targetNames = new string[] { "Build" }; - buildRequest = new BuildRequest(nodeProxyId, projectFileName, targetNames, (IDictionary)dictionary, null, requestId, false, false); - Assert.IsTrue(string.Compare("Build", buildRequest.GetTargetNamesList(),StringComparison.OrdinalIgnoreCase)==0, "Expected to see Build as the targetNamesList"); - - //Test the case where we pass in multiple targets - targetNames = new string[] {"Build","Build2"}; - buildRequest = new BuildRequest(nodeProxyId, projectFileName, targetNames, (IDictionary)dictionary, null, requestId, false, false); - Assert.IsTrue(string.Compare("Build;Build2;", buildRequest.GetTargetNamesList(),StringComparison.OrdinalIgnoreCase)==0, "Expected to see Build;Build2; as the targetNamesList"); - } - - /// - /// See if a non null buildresult is returned, since there are already BuildResult tests we do not care what is inside it - /// - [Test] - public void GetBuildResult() - { - int nodeProxyId = 1; - string projectFileName = "ProjectFileName"; - string[] targetNames = null; - - Dictionary dictionary = null; - int requestId = 1; - - // Test the case where we pass in null targets - BuildRequest buildRequest = new BuildRequest(nodeProxyId, projectFileName, targetNames, (IDictionary)dictionary, null, requestId, false, false); - Assert.IsNotNull(buildRequest.GetBuildResult(),"Expected GetBuildResult to return a non null BuildRequest"); - } - - [Test] - public void InitializeFromCachedResult() - { - BuildResult result = new BuildResult(null, new Hashtable(StringComparer.OrdinalIgnoreCase), true, 0, 1, 1, true, string.Empty, string.Empty, 0, 0, 0); - BuildRequest request = new BuildRequest(); - request.InitializeFromCachedResult(result); - Assert.IsTrue(request.OutputsByTarget == result.OutputsByTarget); - Assert.IsTrue(request.BuildSucceeded); - Assert.IsTrue(request.BuildCompleted); - Assert.IsTrue(request.RestoredFromCache); - Assert.IsTrue(string.Compare(request.DefaultTargets, result.DefaultTargets, StringComparison.OrdinalIgnoreCase) == 0); - Assert.IsTrue(string.Compare(request.InitialTargets, result.InitialTargets, StringComparison.OrdinalIgnoreCase) == 0); - } - - [Test] - public void GetBuildRequestTimingData() - { - BuildRequest request = new BuildRequest(); - long time = DateTime.Now.Ticks; - request.StartTime = time; - Assert.IsTrue(request.StartTime == time); - request.ProcessingStartTime = time; - Assert.IsTrue(request.ProcessingStartTime == time); - request.ProcessingTotalTime = time; - Assert.IsTrue(request.ProcessingTotalTime == time); - Assert.IsNotNull(request.GetBuildResult()); - } - - - [Test] - public void TestCustomSerialization() - { - string projectFileName = "ProjectFileName"; - string[] targetNames = new string[] { "Build" }; - BuildPropertyGroup globalProperties = null; - string toolsVersion = "Tool35"; - int requestId = 1; - int handleId = 4; - - globalProperties = new BuildPropertyGroup(); - BuildProperty propertyToAdd = new BuildProperty("PropertyName", "Value"); - globalProperties.SetProperty(propertyToAdd); - BuildRequest request1 = new BuildRequest(handleId, projectFileName, targetNames, globalProperties, toolsVersion, requestId, true, true); - request1.ParentBuildEventContext = new BuildEventContext(1, 2, 3, 4); - - BuildRequest request2 = new BuildRequest(handleId, projectFileName, null, globalProperties, toolsVersion, requestId, true, true); - request2.GlobalProperties = null; - request2.ProjectFileName = null; - request2.DefaultTargets = null; - request2.InitialTargets = null; - request2.UseResultsCache = false; - request2.ParentBuildEventContext = null; - - MemoryStream stream = new MemoryStream(); - BinaryWriter writer = new BinaryWriter(stream); - BinaryReader reader = new BinaryReader(stream); - try - { - stream.Position = 0; - request1.WriteToStream(writer); - long streamWriteEndPosition = stream.Position; - request2.WriteToStream(writer); - long streamWriteEndPosition2 = stream.Position; - stream.Position = 0; - BuildRequest request3 = BuildRequest.CreateFromStream(reader); - long streamReadEndPosition = stream.Position; - Assert.IsTrue(streamWriteEndPosition == streamReadEndPosition, "Stream end positions should be equal"); - Assert.IsTrue(request1.HandleId == request3.HandleId, "Expected HandleId to Match"); - Assert.IsTrue(request1.RequestId == request3.RequestId, "Expected Request to Match"); - Assert.IsTrue(string.Compare(request1.ProjectFileName, request3.ProjectFileName, StringComparison.OrdinalIgnoreCase) == 0, "Expected ProjectFileName to Match"); - Assert.IsTrue(string.Compare(targetNames[0], request3.TargetNames[0], StringComparison.OrdinalIgnoreCase) == 0, "Expected TargetNames to Match"); - Assert.IsTrue(string.Compare(toolsVersion, request3.ToolsetVersion, StringComparison.OrdinalIgnoreCase) == 0, "Expected ToolsetVersion to Match"); - Assert.IsTrue(request3.TargetNames.Length == 1, "Expected there to be one TargetName"); - Assert.IsTrue(request3.UnloadProjectsOnCompletion, "Expected UnloadProjectsOnCompletion to be true"); - Assert.IsTrue(request3.UseResultsCache, "Expected UseResultsCache to be true"); - Assert.IsTrue(string.Compare(request3.GlobalProperties["PropertyName"].Value,"Value",StringComparison.OrdinalIgnoreCase)==0); - Assert.AreEqual(request1.ParentBuildEventContext, request3.ParentBuildEventContext, "Expected BuildEventContext to Match"); - - BuildRequest request4 = BuildRequest.CreateFromStream(reader); - streamReadEndPosition = stream.Position; - Assert.IsTrue(streamWriteEndPosition2 == streamReadEndPosition, "Stream end positions should be equal"); - Assert.IsTrue(request2.HandleId == request4.HandleId, "Expected HandleId to Match"); - Assert.IsTrue(request2.RequestId == request4.RequestId, "Expected Request to Match"); - Assert.IsNull(request4.ProjectFileName); - Assert.IsNull(request4.TargetNames); - Assert.IsNull(request4.GlobalProperties); - Assert.IsNull(request4.ParentBuildEventContext); - } - finally - { - reader.Close(); - writer = null; - stream = null; - } - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/BuildResult_Tests.cs b/src/Deprecated/Engine.UnitTests/BuildResult_Tests.cs deleted file mode 100644 index 4a0f621d03c..00000000000 --- a/src/Deprecated/Engine.UnitTests/BuildResult_Tests.cs +++ /dev/null @@ -1,219 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Xml; -using System.Collections; -using System.Text.RegularExpressions; -using System.Collections.Generic; -using System.IO; - -using NUnit.Framework; - -using Microsoft.Build.BuildEngine; - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class BuildResult_Tests - { - // A build result where the taskoutputs are null - private BuildResult resultNoOutputs; - - // A build result where the task outputs are acutal values - private BuildResult resultWithOutputs; - - // Create an uninitialized item to test one of the code paths in build result - private BuildItem buildItem1 = new BuildItem(null, "Item1"); - // Create an initialized item - private BuildItem buildItem2 = new BuildItem("BuildItem2", "Item2"); - - [SetUp] - public void Initialize() - { - // Create some items and place them in a dictionary - // Add some include information so that when we check the final - // item spec we can verify that the item was recreated properly - buildItem1.Include = "TestInclude1"; - buildItem2.Include = "TestInclude2"; - - BuildItem[] taskItems = new BuildItem[2]; - taskItems[0] = buildItem1; - taskItems[1] = buildItem2; - - Dictionary dictionary = new Dictionary(); - dictionary.Add("TaskItems", taskItems); - resultNoOutputs = new BuildResult(null, new Hashtable(StringComparer.OrdinalIgnoreCase), true, 0, 1, 2, true, string.Empty, string.Empty, 0, 0, 0); - resultWithOutputs = new BuildResult(dictionary, new Hashtable(StringComparer.OrdinalIgnoreCase), true, 0, 1, 2, true, string.Empty, string.Empty, 0, 0, 0); - } - - /// - /// Test the constructor and properties when taskOutputs have been placed into the item - /// - [Test] - public void TestConstructorsAndProperties() - { - BuildResult resultWithOutputsFromBuildResult = new BuildResult(resultWithOutputs, false /* shallow copy */); - Assert.IsNotNull(resultWithOutputsFromBuildResult.OutputsByTarget, "Exepcted resultWithOutputsFromBuildResult.OutputsByTarget to not be null"); - Assert.IsTrue(resultWithOutputsFromBuildResult.EvaluationResult, "Expected resultWithOutputsFromBuildResult.EvaluationResult to be true"); - Assert.AreEqual(0, resultWithOutputsFromBuildResult.HandleId, "Expected resultWithOutputsFromBuildResult.NodeProxyId to be 0"); - Assert.AreEqual(1, resultWithOutputsFromBuildResult.RequestId, "Expected resultWithOutputsFromBuildResult.RequestId to be 1"); - Assert.AreEqual(2, resultWithOutputsFromBuildResult.ProjectId, "Expected resultWithOutputsFromBuildResult.ProjectId to be 1"); - - // Test some setters which are not set otherwise during the tests - resultWithOutputsFromBuildResult.HandleId = 3; - resultWithOutputsFromBuildResult.RequestId = 4; - Assert.AreEqual(3, resultWithOutputsFromBuildResult.HandleId, "Expected resultWithOutputsFromBuildResult.NodeProxyId to be 3"); - Assert.AreEqual(4, resultWithOutputsFromBuildResult.RequestId, "Expected resultWithOutputsFromBuildResult.RequestId to be 4"); - - resultWithOutputsFromBuildResult = new BuildResult(resultWithOutputs, true /* deep copy */); - Assert.IsNotNull(resultWithOutputsFromBuildResult.OutputsByTarget, "Exepcted resultWithOutputsFromBuildResult.OutputsByTarget to not be null"); - Assert.IsTrue(resultWithOutputsFromBuildResult.EvaluationResult, "Expected resultWithOutputsFromBuildResult.EvaluationResult to be true"); - Assert.AreEqual(0, resultWithOutputsFromBuildResult.HandleId, "Expected resultWithOutputsFromBuildResult.NodeProxyId to be 0"); - Assert.AreEqual(1, resultWithOutputsFromBuildResult.RequestId, "Expected resultWithOutputsFromBuildResult.RequestId to be 1"); - Assert.AreEqual(2, resultWithOutputsFromBuildResult.ProjectId, "Expected resultWithOutputsFromBuildResult.ProjectId to be 1"); - - // Test some setters which are not set otherwise during the tests - resultWithOutputsFromBuildResult.HandleId = 3; - resultWithOutputsFromBuildResult.RequestId = 4; - Assert.AreEqual(3, resultWithOutputsFromBuildResult.HandleId, "Expected resultWithOutputsFromBuildResult.NodeProxyId to be 3"); - Assert.AreEqual(4, resultWithOutputsFromBuildResult.RequestId, "Expected resultWithOutputsFromBuildResult.RequestId to be 4"); - - // Test the setting of RequestId - resultWithOutputsFromBuildResult.RequestId = 4; - Assert.AreEqual(4, resultWithOutputsFromBuildResult.RequestId, "Expected resultWithOutputsFromBuildResult.RequestId to be 4"); - } - - /// - /// Test the constructor and the properties when the taskOutputs are null - /// - [Test] - public void TestConstructorsAndPropertiesNullOutputs() - { - Assert.IsNull(resultNoOutputs.OutputsByTarget, "Exepcted resultNoOutputs.OutputsByTarget to be null"); - Assert.IsTrue(resultNoOutputs.EvaluationResult, "Expected resultNoOutputs.EvaluationResult to be true"); - Assert.AreEqual(0, resultNoOutputs.HandleId, "Expected resultNoOutputs.NodeProxyId to be 0"); - Assert.AreEqual(1, resultNoOutputs.RequestId, "Expected resultNoOutputs.RequestId to be 1"); - Assert.AreEqual(2, resultNoOutputs.ProjectId, "Expected resultNoOutputs.ProjectId to be 2"); - } - - /// - /// Check that a build result constructor which is passed a null buildresult gives the proper exception - /// - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void TestNullParameterInConstructor() - { - BuildResult shouldFail = new BuildResult(null, false /* shallow copy */); - } - /// - /// Test the constructor and the properties when the taskOutputs are null - /// - [Test] - public void TestUncacheableProperty() - { - BuildResult resultCacheable = new BuildResult(null, new Hashtable(StringComparer.OrdinalIgnoreCase), true, 0, 1, 2, false, string.Empty, string.Empty, 0, 0, 0); - Assert.IsFalse(resultCacheable.UseResultCache, "Expected resultCacheable.UseResultCache to be false"); - BuildResult resultUncacheable = new BuildResult(null, new Hashtable(StringComparer.OrdinalIgnoreCase), true, 0, 1, 2, true, string.Empty, string.Empty, 0, 0, 0); - Assert.IsTrue(resultUncacheable.UseResultCache, "Expected resultUncacheable.UseResultCache to be true"); - } - - [Test] - public void ConvertToTaskItems() - { - - resultWithOutputs.ConvertToTaskItems(); - Assert.AreEqual(1, resultWithOutputs.OutputsByTarget.Count, "Expected Number of Item arrays to be 1"); - string[] keys = new string[resultWithOutputs.OutputsByTarget.Count]; - resultWithOutputs.OutputsByTarget.Keys.CopyTo(keys, 0); - TaskItem[] taskItems = (TaskItem[])resultWithOutputs.OutputsByTarget[keys[0]]; - bool foundFirstItem = false; - bool foundSecondItem = false; - foreach (TaskItem taskItem in taskItems) - { - - if ((taskItem.item.IsUninitializedItem) && (string.Compare(taskItem.item.FinalItemSpec, "TestInclude1", StringComparison.OrdinalIgnoreCase) == 0)) - { - foundFirstItem = true; - } - else if ((string.Compare(taskItem.item.Name, "BuildItem2", StringComparison.OrdinalIgnoreCase) == 0) && (string.Compare(taskItem.item.FinalItemSpec, "TestInclude2", StringComparison.OrdinalIgnoreCase) == 0)) - { - foundSecondItem = true; - } - } - Assert.IsTrue(foundFirstItem && foundSecondItem, "Expected to find both items converted to taskItems"); - } - - [Test] - public void CustomSerialization() - { - MemoryStream stream = new MemoryStream(); - BinaryWriter writer = new BinaryWriter(stream); - BinaryReader reader = new BinaryReader(stream); - try - { - stream.Position = 0; - BuildResult result1 = new BuildResult(resultWithOutputs, false /* shallow copy */); - result1.HandleId = 2; - result1.RequestId = 3; - result1.WriteToStream(writer); - - BuildResult result2 = new BuildResult(resultWithOutputs, true /* deep copy */); - result2.HandleId = 2; - result2.RequestId = 3; - result2.WriteToStream(writer); - - BuildResult result3 = new BuildResult(null, new Hashtable(StringComparer.OrdinalIgnoreCase), true, 0, 1, 2, true, null, null, 0, 0, 0); - result3.HandleId = 2; - result3.RequestId = 3; - result3.WriteToStream(writer); - - BuildResult result4 = new BuildResult(null, new Hashtable(StringComparer.OrdinalIgnoreCase), true, 0, 1, 2, true, "DefaultTarget", "InitialTarget", 0, 0, 0); - result4.HandleId = 2; - result4.RequestId = 3; - result4.ResultByTarget.Add("ONE", Target.BuildState.CompletedSuccessfully); - result4.WriteToStream(writer); - long streamWriteEndPosition = stream.Position; - stream.Position = 0; - - BuildResult result5 = BuildResult.CreateFromStream(reader); - BuildResult result6 = BuildResult.CreateFromStream(reader); - BuildResult result7 = BuildResult.CreateFromStream(reader); - BuildResult result8 = BuildResult.CreateFromStream(reader); - long streamReadEndPosition = stream.Position; - Assert.IsTrue(streamWriteEndPosition == streamReadEndPosition, "Stream end positions should be equal"); - CompareBuildResult(result1, result5); - CompareBuildResult(result2, result6); - CompareBuildResult(result3, result7); - CompareBuildResult(result4, result8); - Assert.IsTrue(result8.ResultByTarget.Count == 1); - Assert.IsTrue(((Target.BuildState)result8.ResultByTarget["ONE"]) == Target.BuildState.CompletedSuccessfully); - BuildItem[] buildItemArray = ((BuildItem[])result1.OutputsByTarget["TaskItems"]); - Assert.IsTrue(buildItemArray.Length == 2); - Assert.IsTrue(string.Compare(buildItemArray[0].Include, buildItem1.Include, StringComparison.OrdinalIgnoreCase)==0); - Assert.IsTrue(string.Compare(buildItemArray[1].Include, buildItem2.Include, StringComparison.OrdinalIgnoreCase) == 0); - Assert.IsTrue(string.Compare(buildItemArray[1].Name, buildItem2.Name, StringComparison.OrdinalIgnoreCase) == 0); - } - finally - { - reader.Close(); - writer = null; - stream = null; - } - } - - private static void CompareBuildResult(BuildResult result1, BuildResult result2) - { - Assert.AreEqual(result1.HandleId, result2.HandleId, "Expected HandleId to Match"); - Assert.AreEqual(result1.RequestId, result2.RequestId, "Expected RequestId to Match"); - Assert.AreEqual(result1.ProjectId, result2.ProjectId, "Expected ProjectId to Match"); - Assert.AreEqual(result1.UseResultCache, result2.UseResultCache, "Expected UseResultCache to Match"); - Assert.IsTrue(string.Compare(result1.InitialTargets, result2.InitialTargets, StringComparison.OrdinalIgnoreCase) == 0, "Expected InitialTargets to Match"); - Assert.IsTrue(string.Compare(result1.DefaultTargets, result2.DefaultTargets, StringComparison.OrdinalIgnoreCase) == 0, "Expected DefaultTargets to Match"); - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/BuildTask_Tests.cs b/src/Deprecated/Engine.UnitTests/BuildTask_Tests.cs deleted file mode 100644 index cace4161d89..00000000000 --- a/src/Deprecated/Engine.UnitTests/BuildTask_Tests.cs +++ /dev/null @@ -1,219 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Reflection; -using System.Collections; -using NUnit.Framework; -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine; -using System.Text.RegularExpressions; -using System.Xml; - -namespace Microsoft.Build.UnitTests -{ - internal class MyHostObject : ITaskHost - { - } - - [TestFixture] - public class BuildTask_Tests - { - /*********************************************************************** - * Test: SetGetHostObjectInProject - * Owner: RGoel - * - * Slightly more advanced unit test that loads a real project, finds the - * appropriate task, and sets the host object for it. - * - **********************************************************************/ - [Test] - public void SetGetHostObjectInProject() - { - string projectContents = @" - - - - - - - - - - "; - - Project project = ObjectModelHelpers.CreateInMemoryProject(projectContents); - - MyHostObject hostObject1 = new MyHostObject(); - MyHostObject hostObject2 = new MyHostObject(); - - // Set hostObject1 to the "MakeDir" task, and set hostObject2 to the "Csc" task. - foreach (Target target in project.Targets) - { - foreach (BuildTask myTask in target) - { - if (myTask.Name == "MakeDir") - { - myTask.HostObject = hostObject1; - } - else if (myTask.Name == "Csc") - { - myTask.HostObject = hostObject2; - } - else - { - Assertion.Assert("Unknown task", false); - } - } - } - - bool foundMakeDir = false; - bool foundCsc = false; - - // Now retrieve the host objects for "MakeDir" and "Csc", and confirm they're the - // same ones we set originally. - foreach (Target target in project.Targets) - { - foreach (BuildTask myTask in target) - { - if (myTask.Name == "MakeDir") - { - Assertion.AssertSame(myTask.HostObject, hostObject1); - Assertion.Assert(myTask.HostObject != hostObject2); - foundMakeDir = true; - } - else if (myTask.Name == "Csc") - { - Assertion.AssertSame(myTask.HostObject, hostObject2); - Assertion.Assert(myTask.HostObject != hostObject1); - foundCsc = true; - } - else - { - Assertion.Assert("Unknown task", false); - } - } - } - - Assertion.Assert(foundMakeDir && foundCsc); - } - - /// - /// We want to warn if there is an @ in the item name in an output tag - /// as this was probably an error (#177257) - /// - [Test] - public void CatchAtSignInOutputItemName() - { - string projectContents = @" - - - - - - - - - "; - - Project p = ObjectModelHelpers.CreateInMemoryProject(projectContents); - MockLogger l = new MockLogger(); - p.ParentEngine.RegisterLogger(l); - - p.Build(new string[] { "t" }, null); - string warning = String.Format(MockLogger.GetString("AtSignInTaskOutputItemName"), "@(x)"); - Assertion.Assert(-1 != l.FullLog.IndexOf(warning)); - } - - /// - /// We want to warn if there is an $ in the property name in an output tag - /// as this was probably an error (#177257) - /// - [Test] - public void CatchDollarSignInOutputPropertyName() - { - string projectContents = @" - - - - - - - - - "; - - Project p = ObjectModelHelpers.CreateInMemoryProject(projectContents); - MockLogger l = new MockLogger(); - p.ParentEngine.RegisterLogger(l); - - p.Build(new string[] { "t" }, null); - string warning = String.Format(MockLogger.GetString("DollarSignInTaskOutputPropertyName"), "$(x)"); - Assertion.Assert(-1 != l.FullLog.IndexOf(warning)); - } - - /// - /// Regress 567058. - /// Item expansions using nonexistent metadata can produce items with blank itemspecs -- so - /// can tasks that do new TaskItem(""). - /// The engine should not barf when retrieving these from tasks. - /// - [Test] - public void EmptyItemSpecsToCreateItem() - { - string projectContents = @" - - - - - - - '%(OutputFile)')`> - - - - - "; - - Project p = ObjectModelHelpers.CreateInMemoryProject(projectContents); - MockLogger l = new MockLogger(); - p.ParentEngine.RegisterLogger(l); - - p.Build(new string[] { "t" }, null); - Assertion.Assert(l.ErrorCount == 0); - Assertion.Assert(l.WarningCount == 0); - } - - /// - /// Items coming out of tasks should have their itemspecs escaped - /// - [Test] - public void EscapeOutputItemspecs() - { - string projectContents = @" - - - - - - - - - - "; - - Project p = ObjectModelHelpers.CreateInMemoryProject(projectContents); - MockLogger l = new MockLogger(); - p.ParentEngine.RegisterLogger(l); - - p.Build(new string[] { "t" }, null); - Assertion.Assert(l.ErrorCount == 0); - Assertion.Assert(l.WarningCount == 0); - l.AssertLogContains("%20"); - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/CacheEntry_Tests.cs b/src/Deprecated/Engine.UnitTests/CacheEntry_Tests.cs deleted file mode 100644 index f01add7ddd7..00000000000 --- a/src/Deprecated/Engine.UnitTests/CacheEntry_Tests.cs +++ /dev/null @@ -1,225 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections.Generic; -using System.Text; -using System.IO; - -using NUnit.Framework; -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine; - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class CacheEntry_Tests - { - /// - /// Exercise the public constructors and getters - /// - [Test] - public void CacheEntryGetters() - { - BuildItem[] buildItems = new BuildItem[2] { null, null }; - - BuildItemCacheEntry tice = new BuildItemCacheEntry("tice", buildItems); - Assertion.AssertEquals("tice", tice.Name); - Assertion.AssertEquals(buildItems, tice.BuildItems); - - PropertyCacheEntry pce = new PropertyCacheEntry("pce", "propertyValue"); - Assertion.AssertEquals("pce", pce.Name); - Assertion.AssertEquals("propertyValue", pce.Value); - - BuildResultCacheEntry brce = new BuildResultCacheEntry("brce", buildItems, true); - Assertion.AssertEquals("brce", brce.Name); - Assertion.AssertEquals(buildItems, brce.BuildItems); - Assertion.AssertEquals(true, brce.BuildResult); - } - - [Test] - public void CacheEntryGettersDefaultConstructors() - { - BuildItem[] buildItems = new BuildItem[2] { null, null }; - - BuildItemCacheEntry tice = new BuildItemCacheEntry(); - Assertion.AssertEquals(null, tice.Name); - Assertion.AssertEquals(null, tice.BuildItems); - - tice.Name = "tice"; - tice.BuildItems = buildItems; - Assertion.AssertEquals("tice", tice.Name); - Assertion.AssertEquals(buildItems, tice.BuildItems); - - PropertyCacheEntry pce = new PropertyCacheEntry(); - Assertion.AssertEquals(null, pce.Name); - Assertion.AssertEquals(null, pce.Value); - - pce.Name = "pce"; - pce.Value = "propertyValue"; - Assertion.AssertEquals("pce", pce.Name); - Assertion.AssertEquals("propertyValue", pce.Value); - - BuildResultCacheEntry brce = new BuildResultCacheEntry(); - Assertion.AssertEquals(null, brce.Name); - Assertion.AssertEquals(null, brce.BuildItems); - Assertion.AssertEquals(default(bool), brce.BuildResult); - - brce.Name = "brce"; - brce.BuildItems = buildItems; - brce.BuildResult = false; - Assertion.AssertEquals("brce", brce.Name); - Assertion.AssertEquals(buildItems, brce.BuildItems); - Assertion.AssertEquals(false, brce.BuildResult); - } - - [Test] - public void IsEquivalentProperty() - { - PropertyCacheEntry e = new PropertyCacheEntry("name", "value"); - - Assert.IsFalse(e.IsEquivalent(null)); - Assert.IsFalse(e.IsEquivalent(new BuildItemCacheEntry())); - Assert.IsFalse(e.IsEquivalent(new PropertyCacheEntry())); - Assert.IsFalse(e.IsEquivalent(new PropertyCacheEntry("naame", "value"))); - Assert.IsFalse(e.IsEquivalent(new PropertyCacheEntry("name", "valuue"))); - Assert.IsTrue(e.IsEquivalent(new PropertyCacheEntry("name", "value"))); - } - - [Test] - public void IsEquivalentTaskItem() - { - BuildItem bi = new BuildItem("itemname", "itemspec"); - bi.SetMetadata("mn", "mv"); - - BuildItemCacheEntry e = new BuildItemCacheEntry("name", new BuildItem[] { bi }); - - Assert.IsFalse(e.IsEquivalent(null)); - Assert.IsFalse(e.IsEquivalent(new PropertyCacheEntry())); - Assert.IsFalse(e.IsEquivalent(new BuildItemCacheEntry())); - Assert.IsFalse(e.IsEquivalent(new BuildItemCacheEntry("naame", new BuildItem[] { bi }))); - Assert.IsFalse(e.IsEquivalent(new BuildItemCacheEntry("name", null))); - Assert.IsFalse(e.IsEquivalent(new BuildItemCacheEntry("name", new BuildItem[] { null }))); - Assert.IsFalse(new BuildItemCacheEntry("name", new BuildItem[] { null }).IsEquivalent(e)); - Assert.IsFalse(e.IsEquivalent(new BuildItemCacheEntry("name", new BuildItem[] { new BuildItem("itemname", "itemspec") }))); - Assert.IsFalse(e.IsEquivalent(new BuildItemCacheEntry("name", new BuildItem[] { bi, bi }))); - - BuildItem bi2 = new BuildItem("itemname", "itemspec"); - bi2.SetMetadata("n", "v"); - Assert.IsFalse(e.IsEquivalent(new BuildItemCacheEntry("name", new BuildItem[] { bi2 }))); - bi2.SetMetadata("mn", "mv"); - Assert.IsFalse(e.IsEquivalent(new BuildItemCacheEntry("name", new BuildItem[] { bi2 }))); - - BuildItem bi3 = new BuildItem("itemname", "itemspec"); - bi3.SetMetadata("mn", "mv"); - Assert.IsTrue(e.IsEquivalent(new BuildItemCacheEntry("name", new BuildItem[] { bi3 }))); - } - - [Test] - public void IsEquivalentBuildResult() - { - BuildResultCacheEntry e = new BuildResultCacheEntry("name", null, false); - - Assert.IsFalse(e.IsEquivalent(null)); - Assert.IsFalse(e.IsEquivalent(new PropertyCacheEntry("name", "value"))); - Assert.IsFalse(e.IsEquivalent(new BuildItemCacheEntry("name", null))); - Assert.IsFalse(e.IsEquivalent(new BuildResultCacheEntry())); - Assert.IsFalse(e.IsEquivalent(new BuildResultCacheEntry("naame", null, false))); - Assert.IsFalse(e.IsEquivalent(new BuildResultCacheEntry("name", null, true))); - Assert.IsTrue(e.IsEquivalent(new BuildResultCacheEntry("name", null, false))); - } - - - [Test] - public void TestCacheEntryCustomSerialization() - { - // Stream, writer and reader where the events will be serialized and deserialized from - MemoryStream stream = new MemoryStream(); - BinaryWriter writer = new BinaryWriter(stream); - BinaryReader reader = new BinaryReader(stream); - try - { - BuildItem buildItem1 = new BuildItem("BuildItem1", "Item1"); - BuildItem buildItem2 = new BuildItem("BuildItem2", "Item2"); - buildItem1.Include = "TestInclude1"; - buildItem2.Include = "TestInclude2"; - BuildItem[] buildItems = new BuildItem[2]; - buildItems[0] = buildItem1; - buildItems[1] = buildItem2; - - BuildItemCacheEntry buildItemEntry = new BuildItemCacheEntry("Badger", buildItems); - BuildResultCacheEntry buildResultEntry = new BuildResultCacheEntry("Koi", buildItems, true); - PropertyCacheEntry propertyEntry = new PropertyCacheEntry("Seagull", "bread"); - - stream.Position = 0; - // Serialize - buildItemEntry.WriteToStream(writer); - // Get position of stream after write so it can be compared to the position after read - long streamWriteEndPosition = stream.Position; - - // Deserialize and Verify - stream.Position = 0; - BuildItemCacheEntry newCacheEntry = new BuildItemCacheEntry(); - newCacheEntry.CreateFromStream(reader); - long streamReadEndPosition = stream.Position; - Assert.IsTrue(streamWriteEndPosition == streamReadEndPosition, "Stream End Positions Should Match"); - Assert.IsTrue(string.Compare(newCacheEntry.Name, buildItemEntry.Name, StringComparison.OrdinalIgnoreCase) == 0); - BuildItem[] buildItemArray = newCacheEntry.BuildItems; - Assert.IsTrue(buildItemArray.Length == 2); - Assert.IsTrue(string.Compare(buildItemArray[0].Include, buildItem1.Include, StringComparison.OrdinalIgnoreCase) == 0); - Assert.IsTrue(string.Compare(buildItemArray[1].Include, buildItem2.Include, StringComparison.OrdinalIgnoreCase) == 0); - Assert.IsTrue(string.Compare(buildItemArray[1].Name, buildItem2.Name, StringComparison.OrdinalIgnoreCase) == 0); - - - stream.Position = 0; - // Serialize - buildResultEntry.WriteToStream(writer); - // Get position of stream after write so it can be compared to the position after read - streamWriteEndPosition = stream.Position; - - // Deserialize and Verify - stream.Position = 0; - BuildResultCacheEntry newCacheEntryBuildResult = new BuildResultCacheEntry(); - newCacheEntryBuildResult.CreateFromStream(reader); - streamReadEndPosition = stream.Position; - Assert.IsTrue(streamWriteEndPosition == streamReadEndPosition, "Stream End Positions Should Match"); - Assert.IsTrue(string.Compare(newCacheEntryBuildResult.Name, buildResultEntry.Name, StringComparison.OrdinalIgnoreCase) == 0); - Assert.IsTrue(buildResultEntry.BuildResult == newCacheEntryBuildResult.BuildResult); - buildItemArray = newCacheEntryBuildResult.BuildItems; - Assert.IsTrue(buildItemArray.Length == 2); - Assert.IsTrue(string.Compare(buildItemArray[0].Include, buildItem1.Include, StringComparison.OrdinalIgnoreCase) == 0); - Assert.IsTrue(string.Compare(buildItemArray[1].Include, buildItem2.Include, StringComparison.OrdinalIgnoreCase) == 0); - Assert.IsTrue(string.Compare(buildItemArray[1].Name, buildItem2.Name, StringComparison.OrdinalIgnoreCase) == 0); - - - stream.Position = 0; - // Serialize - propertyEntry.WriteToStream(writer); - // Get position of stream after write so it can be compared to the position after read - streamWriteEndPosition = stream.Position; - - // Deserialize and Verify - stream.Position = 0; - PropertyCacheEntry newPropertyCacheEntry = new PropertyCacheEntry(); - newPropertyCacheEntry.CreateFromStream(reader); - streamReadEndPosition = stream.Position; - Assert.IsTrue(streamWriteEndPosition == streamReadEndPosition, "Stream End Positions Should Match"); - Assert.IsTrue(string.Compare(newPropertyCacheEntry.Name, propertyEntry.Name, StringComparison.OrdinalIgnoreCase) == 0); - Assert.IsTrue(string.Compare(newPropertyCacheEntry.Value, propertyEntry.Value, StringComparison.OrdinalIgnoreCase) == 0); - } - finally - { - // Close will close the writer/reader and the underlying stream - writer.Close(); - reader.Close(); - reader = null; - stream = null; - writer = null; - } - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/CacheManager_Tests.cs b/src/Deprecated/Engine.UnitTests/CacheManager_Tests.cs deleted file mode 100644 index 7df64d0b0aa..00000000000 --- a/src/Deprecated/Engine.UnitTests/CacheManager_Tests.cs +++ /dev/null @@ -1,226 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections.Generic; -using System.Text; -using System.Xml; -using System.IO; -using System.Collections; - -using NUnit.Framework; - -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class CacheManager_Tests - { - // Build result which will be added to the cache - BuildResult resultWithOutputs; - // Build result marked as should not cache - BuildResult uncacheableResult; - // Build result that was failed - BuildResult failedResult; - - [SetUp] - public void Initialize() - { - // Create some items and place them in a dictionary - // Add some include information so that when we check the final - // item spec we can verify that the item was recreated properly - BuildItem buildItem1 = new BuildItem("BuildItem1", "Item1"); - buildItem1.Include = "TestInclude1"; - BuildItem[] buildItems = new BuildItem[1]; - buildItems[0] = buildItem1; - Dictionary dictionary = new Dictionary(); - dictionary.Add("TaskItems", buildItems); - - Hashtable resultByTargetSuccess = new Hashtable(StringComparer.OrdinalIgnoreCase); - resultByTargetSuccess.Add("TaskItems", Target.BuildState.CompletedSuccessfully); - Hashtable resultByTargetFailure = new Hashtable(StringComparer.OrdinalIgnoreCase); - resultByTargetFailure.Add("TaskItems", Target.BuildState.CompletedUnsuccessfully); - Hashtable resultByTargetSkipped = new Hashtable(StringComparer.OrdinalIgnoreCase); - resultByTargetSkipped.Add("TaskItems", Target.BuildState.Skipped); - - resultWithOutputs = new BuildResult(dictionary, resultByTargetSuccess, true, 1, 1, 2, true, string.Empty, string.Empty, 0, 0, 0); - failedResult = new BuildResult(dictionary, resultByTargetFailure, false, 1, 1, 2, true, string.Empty, string.Empty, 0, 0, 0); - uncacheableResult = new BuildResult(dictionary, resultByTargetSkipped, true, 1, 1, 2, true, string.Empty, string.Empty, 0, 0, 0); - } - - /// - /// Test basic operation add/remove - /// - [Test] - public void CheckBasicOperation() - { - CacheManager cacheManager = new CacheManager("3.5"); - CacheScope cacheScope = cacheManager.GetCacheScope("Test.proj", new BuildPropertyGroup(), "3.5", CacheContentType.Items); - Assert.IsNotNull(cacheScope, "Cache should not have an entry"); - CacheScope cacheScope1 = cacheManager.GetCacheScope("Test.proj", new BuildPropertyGroup(), "3.5", CacheContentType.Items); - Assert.AreEqual(cacheScope, cacheScope1, "Expected to get the same scope"); - cacheScope1 = cacheManager.GetCacheScope("Test1.proj", new BuildPropertyGroup(), "3.5", CacheContentType.Items); - Assert.IsNotNull(cacheScope1, "Cache should not have an entry"); - Assert.AreNotEqual(cacheScope, cacheScope1, "Expected to get different scopes"); - // Add an entry and verify that it ends up in the right scope - CacheEntry cacheEntry = new BuildResultCacheEntry("TestEntry", null, true); - CacheEntry cacheEntry1 = new BuildResultCacheEntry("TestEntry1", null, true); - cacheManager.SetCacheEntries(new CacheEntry[] { cacheEntry }, "Test.proj", new BuildPropertyGroup(), "3.5", CacheContentType.Items); - Assert.IsNotNull(cacheScope.GetCacheEntry("TestEntry"), "Cache should have an entry"); - Assert.IsNotNull(cacheManager.GetCacheEntries(new string[] { "TestEntry" }, "Test.proj", new BuildPropertyGroup(), "3.5", CacheContentType.Items)[0], - "Cache should have an entry"); - cacheManager.SetCacheEntries(new CacheEntry[] { cacheEntry1 }, "Test1.proj", new BuildPropertyGroup(), "3.5", CacheContentType.Items); - Assert.IsNotNull(cacheScope1.GetCacheEntry("TestEntry1"), "Cache should have an entry"); - Assert.IsNotNull(cacheManager.GetCacheEntries(new string[] { "TestEntry1" }, "Test1.proj", new BuildPropertyGroup(), "3.5", CacheContentType.Items)[0], - "Cache should have an entry"); - // Try clearing the whole cache - cacheManager.ClearCache(); - Assert.AreNotEqual(cacheScope, cacheManager.GetCacheScope("Test.proj", new BuildPropertyGroup(), "3.5", CacheContentType.Items), - "Expected to get different scopes"); - } - - - /// - /// Test basic operation add/remove - /// - [Test] - public void TestRequestCaching() - { - CacheManager cacheManager = new CacheManager("3.5"); - - ArrayList actuallyBuiltTargets; - - // Test the case where we pass in null targets - Dictionary dictionary = new Dictionary(); - BuildRequest emptyRequest = new BuildRequest(1, "test.proj", null, dictionary, null, 1, true, false); - - Assert.IsNull(cacheManager.GetCachedBuildResult(emptyRequest, out actuallyBuiltTargets), "Expect a null return value if T=null"); - - // Test the case where we pass in length 0 targets - BuildRequest length0Request = new BuildRequest(1, "test.proj", new string[0], dictionary, null, 1, true, false); - Assert.IsNull(cacheManager.GetCachedBuildResult(length0Request, out actuallyBuiltTargets), "Expect a null return value if T.Length=0"); - - // Test the case when the scope doesn't exist - string[] targets = new string[1]; targets[0] = "Target1"; - BuildRequest length1Request = new BuildRequest(1, "test.proj", targets, new BuildPropertyGroup(), null, 1, true, false); - Assert.IsNull(cacheManager.GetCachedBuildResult(length1Request, out actuallyBuiltTargets), "Expect a null return value if no scope"); - - // Test the case when the scope exists but is empty - CacheScope cacheScope = cacheManager.GetCacheScope("test.proj", new BuildPropertyGroup(), "3.5", CacheContentType.BuildResults); - Assert.IsNull(cacheManager.GetCachedBuildResult(length1Request, out actuallyBuiltTargets), "Expect a null return value if scope is empty"); - - // Test the case when the scope exists but contains wrong data - CacheEntry cacheEntry = new BuildResultCacheEntry("Target2", null, true); - cacheManager.SetCacheEntries(new CacheEntry[] { cacheEntry }, "test.proj", new BuildPropertyGroup(), "3.5", CacheContentType.BuildResults); - Assert.IsNull(cacheManager.GetCachedBuildResult(length1Request, out actuallyBuiltTargets), "Expect a null return value if scope contains wrong data"); - - // Test the case when everything is correct - cacheScope.AddCacheEntry(new PropertyCacheEntry(Constants.defaultTargetCacheName, string.Empty)); - cacheScope.AddCacheEntry(new PropertyCacheEntry(Constants.initialTargetCacheName, string.Empty)); - cacheScope.AddCacheEntry(new PropertyCacheEntry(Constants.projectIdCacheName, "1")); - - cacheEntry = new BuildResultCacheEntry("Target1", null, true); - cacheManager.SetCacheEntries(new CacheEntry[] { cacheEntry }, "test.proj", new BuildPropertyGroup(), "3.5", CacheContentType.BuildResults); - BuildResult buildResult = cacheManager.GetCachedBuildResult(length1Request, out actuallyBuiltTargets); - Assert.IsNotNull(buildResult, "Expect a cached value if scope contains data"); - Assert.AreEqual(1, actuallyBuiltTargets.Count); - Assert.AreEqual("Target1", actuallyBuiltTargets[0]); - Assert.AreEqual(1, buildResult.ResultByTarget.Count); - Assert.AreEqual(Target.BuildState.CompletedSuccessfully, buildResult.ResultByTarget["Target1"]); - - // Test the case when the scope contains partially correct data - targets = new string[2]; targets[0] = "Target2"; targets[1] = "Target3"; - BuildRequest length2Request = new BuildRequest(1, "test.proj", targets, new BuildPropertyGroup(), null, 1, true, false); - Assert.IsNull(cacheManager.GetCachedBuildResult(length2Request, out actuallyBuiltTargets), "Expect a null return value if partial data in the scope"); - - // Test the correctness case for multiple targets - cacheEntry = new BuildResultCacheEntry("Target3", null, true); - cacheManager.SetCacheEntries(new CacheEntry[] { cacheEntry }, "test.proj", new BuildPropertyGroup(), "3.5", CacheContentType.BuildResults); - buildResult = cacheManager.GetCachedBuildResult(length2Request, out actuallyBuiltTargets); - Assert.IsNotNull(buildResult, "Expect a cached value if scope contains data"); - - Assert.AreEqual(2, actuallyBuiltTargets.Count); - Assert.AreEqual("Target2", actuallyBuiltTargets[0]); - Assert.AreEqual("Target3", actuallyBuiltTargets[1]); - Assert.AreEqual(2, buildResult.ResultByTarget.Count); - Assert.AreEqual(Target.BuildState.CompletedSuccessfully, buildResult.ResultByTarget["Target2"]); - Assert.AreEqual(Target.BuildState.CompletedSuccessfully, buildResult.ResultByTarget["Target3"]); - Assert.AreEqual(1, buildResult.ProjectId); - } - - /// - /// Test request caching with default/initial targets - /// - [Test] - public void TestRequestCachingDefaultInitialTargets() - { - CacheManager cacheManager = new CacheManager("3.5"); - - ArrayList actuallyBuiltTargets; - CacheScope cacheScope = cacheManager.GetCacheScope("test.proj", new BuildPropertyGroup(), null, CacheContentType.BuildResults); - cacheScope.AddCacheEntry(new PropertyCacheEntry(Constants.defaultTargetCacheName, "Target1;Target2")); - cacheScope.AddCacheEntry(new PropertyCacheEntry(Constants.initialTargetCacheName, "Initial1")); - cacheScope.AddCacheEntry(new PropertyCacheEntry(Constants.projectIdCacheName, "5")); - - CacheEntry cacheEntry = new BuildResultCacheEntry("Initial1", null, true); - cacheManager.SetCacheEntries(new CacheEntry[] { cacheEntry }, "test.proj", new BuildPropertyGroup(), "3.5", CacheContentType.BuildResults); - cacheEntry = new BuildResultCacheEntry("Target1", null, true); - cacheManager.SetCacheEntries(new CacheEntry[] { cacheEntry }, "test.proj", new BuildPropertyGroup(), null, CacheContentType.BuildResults); - cacheEntry = new BuildResultCacheEntry("Target2", null, false); - cacheManager.SetCacheEntries(new CacheEntry[] { cacheEntry }, "test.proj", new BuildPropertyGroup(), "3.5", CacheContentType.BuildResults); - cacheEntry = new BuildResultCacheEntry("Target3", null, true); - cacheManager.SetCacheEntries(new CacheEntry[] { cacheEntry }, "test.proj", new BuildPropertyGroup(), null, CacheContentType.BuildResults); - - // Default target - BuildRequest defaultRequest = new BuildRequest(1, "test.proj", null, new BuildPropertyGroup(), null, 1, true, false); - BuildResult buildResult = cacheManager.GetCachedBuildResult(defaultRequest, out actuallyBuiltTargets); - Assert.IsNotNull(buildResult, "Expect a cached value if scope contains data"); - - Assert.AreEqual(3, actuallyBuiltTargets.Count); - Assert.AreEqual("Initial1", actuallyBuiltTargets[0]); - Assert.AreEqual("Target1", actuallyBuiltTargets[1]); - Assert.AreEqual("Target2", actuallyBuiltTargets[2]); - Assert.AreEqual(3, buildResult.ResultByTarget.Count); - Assert.AreEqual(Target.BuildState.CompletedSuccessfully, buildResult.ResultByTarget["Initial1"]); - Assert.AreEqual(Target.BuildState.CompletedSuccessfully, buildResult.ResultByTarget["Target1"]); - Assert.AreEqual(Target.BuildState.CompletedUnsuccessfully, buildResult.ResultByTarget["Target2"]); - Assert.AreEqual(false, buildResult.EvaluationResult); - Assert.AreEqual(5, buildResult.ProjectId); - - // Specific target - BuildRequest specificRequest = new BuildRequest(1, "test.proj", new string[] { "Target3" }, new BuildPropertyGroup(), null, 1, true, false); - buildResult = cacheManager.GetCachedBuildResult(specificRequest, out actuallyBuiltTargets); - Assert.IsNotNull(buildResult, "Expect a cached value if scope contains data"); - - Assert.AreEqual(2, actuallyBuiltTargets.Count); - Assert.AreEqual("Initial1", actuallyBuiltTargets[0]); - Assert.AreEqual("Target3", actuallyBuiltTargets[1]); - Assert.AreEqual(2, buildResult.ResultByTarget.Count); - Assert.AreEqual(Target.BuildState.CompletedSuccessfully, buildResult.ResultByTarget["Initial1"]); - Assert.AreEqual(Target.BuildState.CompletedSuccessfully, buildResult.ResultByTarget["Target3"]); - Assert.AreEqual(true, buildResult.EvaluationResult); - Assert.AreEqual(5, buildResult.ProjectId); - } - - /// - /// Test Clearing Cache Scope - /// - [Test] - public void TestClearCacheScope() - { - CacheManager cacheManager = new CacheManager("3.5"); - CacheScope cacheScope = cacheManager.GetCacheScope("test.proj", new BuildPropertyGroup(), null, CacheContentType.BuildResults); - cacheScope.AddCacheEntry(new PropertyCacheEntry(Constants.defaultTargetCacheName, "Target1;Target2")); - cacheScope.AddCacheEntry(new PropertyCacheEntry(Constants.initialTargetCacheName, "Initial1")); - cacheManager.ClearCacheScope("test.proj", new BuildPropertyGroup(), "3.5", CacheContentType.BuildResults); - Assert.AreNotEqual(cacheScope, cacheManager.GetCacheScope("test.proj", new BuildPropertyGroup(), "3.5", CacheContentType.BuildResults), "Expected to get different scopes"); - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/CacheScope_Tests.cs b/src/Deprecated/Engine.UnitTests/CacheScope_Tests.cs deleted file mode 100644 index a456c1f074d..00000000000 --- a/src/Deprecated/Engine.UnitTests/CacheScope_Tests.cs +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections.Generic; -using System.Text; -using System.Xml; -using System.IO; -using System.Collections; - -using NUnit.Framework; - -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class CacheScope_Tests - { - // Build result which will be added to the cache - BuildResult resultWith0Outputs; - BuildResult resultWith1Outputs; - BuildResult resultWith2Outputs; - BuildResult uncacheableResult; - - [SetUp] - public void Initialize() - { - // Create some items and place them in a dictionary - // Add some include information so that when we check the final - // item spec we can verify that the item was recreated properly - BuildItem[] buildItems = new BuildItem[1]; - buildItems[0] = new BuildItem("BuildItem1", "Item1"); - Dictionary dictionary1 = new Dictionary(); - dictionary1.Add("Target1", buildItems); - Hashtable resultsByTarget1 = new Hashtable(StringComparer.OrdinalIgnoreCase); - resultsByTarget1.Add("Target1", Target.BuildState.CompletedSuccessfully); - - Dictionary dictionary2 = new Dictionary(); - dictionary2.Add("Target2", buildItems); - dictionary2.Add("Target3", null); - Hashtable resultsByTarget2 = new Hashtable(StringComparer.OrdinalIgnoreCase); - resultsByTarget2.Add("Target2", Target.BuildState.CompletedSuccessfully); - resultsByTarget2.Add("Target3", Target.BuildState.CompletedSuccessfully); - - Dictionary dictionary3 = new Dictionary(); - dictionary3.Add("Target4", buildItems); - Hashtable resultsByTarget3 = new Hashtable(StringComparer.OrdinalIgnoreCase); - resultsByTarget3.Add("Target4", Target.BuildState.Skipped); - - resultWith0Outputs = new BuildResult(new Hashtable(), new Hashtable(StringComparer.OrdinalIgnoreCase), true, 1, 1, 2, true, string.Empty, string.Empty, 0, 0, 0); - resultWith1Outputs = new BuildResult(dictionary1, resultsByTarget1, true, 1, 1, 2, true, string.Empty, string.Empty, 0, 0, 0); - resultWith2Outputs = new BuildResult(dictionary2, resultsByTarget2, true, 1, 1, 2, true, string.Empty, string.Empty, 0, 0, 0); - uncacheableResult = new BuildResult(dictionary3, resultsByTarget3, true, 1, 1, 2, true, string.Empty, string.Empty, 0, 0, 0); - } - - /// - /// Test constructor and properties - /// - [Test] - public void TestConstructor() - { - BuildPropertyGroup default_scope = new BuildPropertyGroup(new Project()); - Assertion.AssertNotNull(default_scope); - - CacheScope testScope = new CacheScope("Test.proj", default_scope, "2.0"); - Assert.AreEqual(testScope.ScopeProperties, default_scope, "Expected ScopeProperties to be set"); - - // We should have detached the parent project from the property group, to avoid holding on to it in the cache - Assertion.AssertEquals(null, testScope.ScopeProperties.ParentProject); - } - - /// - /// Test adding and removing entries - /// - [Test] - public void BasicCacheOperation() - { - BuildPropertyGroup default_scope = new BuildPropertyGroup(); - CacheScope testScope = new CacheScope("Test.proj", new BuildPropertyGroup(), "2.0"); - // First add a single entry and verify that it is in the cache - CacheEntry cacheEntry = new BuildResultCacheEntry("TestEntry", null, true); - testScope.AddCacheEntry(cacheEntry); - Assert.IsTrue(testScope.ContainsCacheEntry("TestEntry"), "Expect entry in the cache"); - CacheEntry inCacheEntry = testScope.GetCacheEntry("TestEntry"); - Assert.IsNotNull(inCacheEntry, "Cache should have an entry"); - Assert.IsTrue(inCacheEntry.IsEquivalent(cacheEntry), "Expect entry to be the same"); - // Add a second entry and then remove the first entry. Verify that the first entry - // is not in the cache while the second entry is still there - cacheEntry = new BuildResultCacheEntry("TestEntry2", null, true); - testScope.AddCacheEntry(cacheEntry); - testScope.ClearCacheEntry("TestEntry"); - Assert.IsFalse(testScope.ContainsCacheEntry("TestEntry"), "Didn't expect entry in the cache"); - Assert.IsTrue(testScope.ContainsCacheEntry("TestEntry2"), "Expected entry in the cache"); - Assert.IsNull(testScope.GetCacheEntry("TestEntry"), "Cache should not have an entry"); - Assert.IsNotNull(testScope.GetCacheEntry("TestEntry2"), "Cache should have an entry"); - } - - /// - /// Test adding and removing build results - /// - [Test] - public void AddRemoveBuildResults() - { - BuildPropertyGroup default_scope = new BuildPropertyGroup(); - CacheScope testScope = new CacheScope("Test.proj", new BuildPropertyGroup(), "2.0"); - // First add a single empty result (expect no crash) - testScope.AddCacheEntryForBuildResults(resultWith0Outputs); - // Add a single result - expect to find target in the cache - testScope.AddCacheEntryForBuildResults(resultWith1Outputs); - Assert.IsTrue(testScope.ContainsCacheEntry("Target1"), "Expected entry in the cache"); - Assert.IsNotNull(testScope.GetCacheEntry("Target1"), "Cache should have an entry"); - // Add a double result expect both target in the entry - testScope.AddCacheEntryForBuildResults(resultWith2Outputs); - Assert.IsTrue(testScope.ContainsCacheEntry("Target2"), "Expected entry in the cache"); - Assert.IsNotNull(testScope.GetCacheEntry("Target2"), "Cache should have an entry"); - Assert.IsTrue(testScope.ContainsCacheEntry("Target3"), "Expected entry in the cache"); - Assert.IsNotNull(testScope.GetCacheEntry("Target3"), "Cache should have an entry"); - // Double add a result ( expect no crash since it is identical ) - testScope.AddCacheEntryForBuildResults(resultWith1Outputs); - // Add an uncacheable result and verify that it is not in the cache - testScope.AddCacheEntryForBuildResults(uncacheableResult); - Assert.IsFalse(testScope.ContainsCacheEntry("Target4"), "Didn't expect entry in the cache"); - Assert.IsNull(testScope.GetCacheEntry("Target4"), "Cache should not have an entry"); - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/Choose_Tests.cs b/src/Deprecated/Engine.UnitTests/Choose_Tests.cs deleted file mode 100644 index 599b02f4046..00000000000 --- a/src/Deprecated/Engine.UnitTests/Choose_Tests.cs +++ /dev/null @@ -1,539 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Text; -using System.IO; -using NUnit.Framework; -using Microsoft.Build.BuildEngine; -using System.Threading; -using System.Collections; - -namespace Microsoft.Build.UnitTests -{ - - /* - * Class: ChooseTests - * Owner: davidle - * - * - */ - [TestFixture] - sealed public class ChooseTests - { - /// - /// Test stack overflow is prevented. - /// - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void ExcessivelyNestedChoose() - { - StringBuilder sb1 = new StringBuilder(); - StringBuilder sb2 = new StringBuilder(); - - for (int i = 0; i < 51; i++) - { - sb1.Append(""); - sb2.Append(""); - } - - string project = ""; - project += sb1.ToString(); - project += "bar"; - project += sb2.ToString(); - project += @" - - - - "; - - Project p = ObjectModelHelpers.CreateInMemoryProject(project); - p.Build(new string[] { "t" }, null); - - // InvalidProjectFile exception expected - } - - /* - * Method: Basic - * Owner: davidle - * - * - */ - [Test] - public void ChooseNotTaken() - { - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - aa - - - - - - - "); - p.Build(new string[] { "t" }, null); - BuildPropertyGroup props = p.EvaluatedProperties; - Assertion.Assert(props["a"] == null); - } - - /* - * Method: NeitherConditionTaken - * Owner: DavidLe - * - * Try a basic workings. - */ - [Test] - public void NeitherConditionTaken() - { - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - aa - - - bb - - - - - - - "); - p.Build(new string[] { "t" }, null); - BuildPropertyGroup props = p.EvaluatedProperties; - Assertion.Assert(props["a"] == null); - Assertion.Assert(props["b"] == null); - } - - [Test] - public void OtherwiseTaken() - { - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - aa - - - bb - - - - - - - "); - p.Build(new string[] { "t" }, null); - BuildPropertyGroup props = p.EvaluatedProperties; - Assertion.Assert(props["a"] == null); - Assertion.Assert((string) props["b"] == "bb"); - } - - [Test] - public void TwoOtherwiseErrorCase() - { - bool fExceptionCaught; - try - { - fExceptionCaught = false; - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - - - - - - "); - p.Build(new string[] { "t" }, null); - } - catch (InvalidProjectFileException e) - { - Console.WriteLine(e.BaseMessage); - fExceptionCaught = true; - } - Assertion.Assert(fExceptionCaught); - } - - [Test] - public void JunkAfterWhenErrorCase() - { - bool fExceptionCaught; - try - { - fExceptionCaught = false; - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - xyz - - - - - - - - - "); - p.Build(new string[] { "t" }, null); - } - catch (InvalidProjectFileException e) - { - Console.WriteLine(e.BaseMessage); - fExceptionCaught = true; - } - Assertion.Assert(fExceptionCaught); - } - - [Test] - public void JunkAfterOtherwiseErrorCase() - { - bool fExceptionCaught; - try - { - fExceptionCaught = false; - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - xyz - - - - - - - - "); - p.Build(new string[] { "t" }, null); - } - catch (InvalidProjectFileException e) - { - Console.WriteLine(e.BaseMessage); - fExceptionCaught = true; - } - Assertion.Assert(fExceptionCaught); - } - - [Test] - public void BogusElementUnderChooseCase() - { - bool fExceptionCaught; - try - { - fExceptionCaught = false; - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - - - - - - - - "); - p.Build(new string[] { "t" }, null); - } - catch (InvalidProjectFileException e) - { - Console.WriteLine(e.BaseMessage); - fExceptionCaught = true; - } - Assertion.Assert(fExceptionCaught); - } - - [Test] - public void ChooseWithConditionErrorCase() - { - bool fExceptionCaught; - try - { - fExceptionCaught = false; - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - - - - - - - "); - p.Build(new string[] { "t" }, null); - } - catch (InvalidProjectFileException e) - { - Console.WriteLine(e.BaseMessage); - fExceptionCaught = true; - } - Assertion.Assert(fExceptionCaught); - } - [Test] - public void OtherwiseWithConditionErrorCase() - { - bool fExceptionCaught; - try - { - fExceptionCaught = false; - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - - - - - - - "); - p.Build(new string[] { "t" }, null); - } - catch (InvalidProjectFileException e) - { - Console.WriteLine(e.BaseMessage); - fExceptionCaught = true; - } - Assertion.Assert(fExceptionCaught); - } - - [Test] - public void JunkUnderChooseErrorCase() - { - bool fExceptionCaught; - try - { - fExceptionCaught = false; - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - abc - - - - - - - - - - "); - p.Build(new string[] { "t" }, null); - } - catch (InvalidProjectFileException e) - { - Console.WriteLine(e.BaseMessage); - fExceptionCaught = true; - } - Assertion.Assert(fExceptionCaught); - } - - [Test] - public void PropertyAssignmentToItemListCase() - { - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - - aa - @(x) - - - - - - "); - p.Build(new string[] { "t" }, null); - BuildPropertyGroup props = p.EvaluatedProperties; - Assertion.Assert((string) props["a"] == "aa"); - Assertion.Assert((string) props["b"] == "@(x)"); - - BuildItemGroup items = p.GetEvaluatedItemsByName("x"); - Assertion.AssertEquals(2, items.Count); - Assertion.Assert(items[0].Include.CompareTo("x1") == 0); - Assertion.Assert(items[1].Include.CompareTo("x2") == 0); - } - - [Test] - public void ItemListAndPropertiesCase() - { - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - - - - - @(x) - - - - - - - "); - p.Build(new string[] { "t" }, null); - BuildPropertyGroup props = p.EvaluatedProperties; - Assertion.Assert((string) props["a"] == "@(x)"); - - BuildItemGroup items = p.GetEvaluatedItemsByName("x"); - Assertion.AssertEquals(2, items.Count); - Assertion.Assert(items[0].Include.CompareTo("x1") == 0); - Assertion.Assert(items[1].Include.CompareTo("x2") == 0); - } - - [Test] - public void ItemGroupInAChooseConditionCase() - { - bool fExceptionCaught = false; - try - { - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - @(x) - - - - - - - "); - p.Build(new string[] { "t" }, null); - } - catch (InvalidProjectFileException) - { - fExceptionCaught = true; - } - Assertion.Assert(fExceptionCaught); - } - - [Test] - public void NestedChooseAndPropertyInConditionCase() - { - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - true - - - bb - - - - - - - - - "); - p.Build(new string[] { "t" }, null); - BuildPropertyGroup props = p.EvaluatedProperties; - Assertion.Assert((string) props["a"] == "true"); - Assertion.Assert((string) props["b"] == "bb"); - } - - [Test] - public void ChooseTakesSameWhenInPass1And2() - { - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - true - - - false - - - - - - - - - - - "); - p.Build(new string[] { "t" }, null); - BuildItemGroup items = p.GetEvaluatedItemsByName("whichpass"); - Assertion.AssertEquals(1, items.Count); - Assertion.Assert(items[0].Include.CompareTo("when1") == 0); - } - - [Test] - public void ChooseTakesOtherwiseInPass1And2() - { - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - false - false - - - true - - - - true - - - - - - - - "); - p.Build(new string[] { "t" }, null); - BuildPropertyGroup props = p.EvaluatedProperties; - Assertion.Assert((string) props["tookfirst"] == "false"); - BuildItemGroup items = p.GetEvaluatedItemsByName("whichpass"); - Assertion.AssertEquals(1, items.Count); - Assertion.Assert(items[0].Include.CompareTo("otherwise") == 0); - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/Compatibility/AddNewImport_Tests.cs b/src/Deprecated/Engine.UnitTests/Compatibility/AddNewImport_Tests.cs deleted file mode 100644 index 7cf7e0ed76c..00000000000 --- a/src/Deprecated/Engine.UnitTests/Compatibility/AddNewImport_Tests.cs +++ /dev/null @@ -1,366 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections.Generic; -using System.Text; -using System.Security.Principal; -using System.Security.AccessControl; -using NUnit.Framework; - -using Microsoft.Build; -using Microsoft.Build.BuildEngine; -using Microsoft.Build.Framework; -using Microsoft.Build.UnitTests; - -namespace Microsoft.Build.UnitTests.OM.OrcasCompatibility -{ - /// - /// Indirection delegate type for AddNewImport Method invocation - /// - public delegate void AddNewImportDelegate(Project p, string path, string condition); - - /// - /// indirection for tests of Project.AddNewImport and ImportCollection.AddNewImport - /// - public abstract class AddNewImportTests - { - #region Indirection Delegates - - /// - /// Indirection delegate for AddNewImport Method invocation - /// - protected AddNewImportDelegate InvokeAddNewImportMethod - { - get; - set; - } - - #endregion - - /// - /// AddNewImport Test, Empty - /// - [Test] - [ExpectedException(typeof(ArgumentException))] - public void AddNewImportFileName_Empty() - { - Project p = new Project(new Engine()); - InvokeAddNewImportMethod(p, String.Empty, null); - } - - /// - /// AddNewImport Test, Null - /// - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void AddNewImportFileName_Null() - { - Project p = new Project(new Engine()); - InvokeAddNewImportMethod(p, null, null); - } - - /// - /// AddNewImport Test, Where imported file does not exist - /// - [Test] - public void AddNewImportFile_DoesNotExist() - { - Project p = new Project(new Engine()); - InvokeAddNewImportMethod(p, @"c:\doesnotexist.proj", null); - } - - /// - /// AddNewImport Test, Import a File, where file is not permitted to be read. - /// - [Test] - public void AddNewImportFile_NoReadPermissions() - { - string importPath = String.Empty; - try - { - importPath = ObjectModelHelpers.CreateTempFileOnDisk(TestData.ContentSimpleTools35InitialTargets); - Project p = new Project(new Engine()); - CompatibilityTestHelpers.SetFileAccessPermissions(importPath, FileSystemRights.Read, AccessControlType.Deny); - InvokeAddNewImportMethod(p, importPath, null); - } - finally - { - CompatibilityTestHelpers.RemoveFile(importPath); - } - } - - /// - /// AddNewImport Test, Import a file with an empty condition. - /// - [Test] - public void AddNewImportFile_EmptyCondition() - { - string importPath = String.Empty; - try - { - Project p = new Project(new Engine()); - importPath = ObjectModelHelpers.CreateTempFileOnDisk(TestData.ContentSimpleTools35InitialTargets); - InvokeAddNewImportMethod(p, importPath, String.Empty); - } - finally - { - CompatibilityTestHelpers.RemoveFile(importPath); - } - } - - /// - /// AddNewImport Test, import file with condiction that is true. - /// - [Test] - public void AddNewImportFileCondition_True() - { - string importPath = String.Empty; - try - { - Project p = new Project(new Engine()); - importPath = ObjectModelHelpers.CreateTempFileOnDisk(TestData.ContentSimpleTools35InitialTargets); - InvokeAddNewImportMethod(p, importPath, "true"); - Assertion.AssertEquals(0, p.Imports.Count); - object o = p.EvaluatedItems; // force evaluation of imported projects. - Assertion.AssertEquals(1, p.Imports.Count); - } - finally - { - CompatibilityTestHelpers.RemoveFile(importPath); - } - } - - /// - /// AddNewImport Test, import file with condiction that evaluates to true. - /// - [Test] - public void AddNewImportFileCondition_EqualIsTrue() - { - string importPath = String.Empty; - try - { - Project p = new Project(new Engine()); - importPath = ObjectModelHelpers.CreateTempFileOnDisk(TestData.ContentSimpleTools35InitialTargets); - InvokeAddNewImportMethod(p, importPath, "1 == 1"); - Assertion.AssertEquals(0, p.Imports.Count); - object o = p.EvaluatedItems; // force evaluation of imported projects. - Assertion.AssertEquals(1, p.Imports.Count); - } - finally - { - CompatibilityTestHelpers.RemoveFile(importPath); - } - } - - /// - /// AddNewImport Test, import file with Condition that is false - /// - [Test] - public void AddNewImportFileCondition_False() - { - string importPath = String.Empty; - try - { - importPath = ObjectModelHelpers.CreateTempFileOnDisk(TestData.ContentSimpleTools35InitialTargets); - Project p = new Project(new Engine()); - InvokeAddNewImportMethod(p, importPath, "false"); - Assertion.AssertEquals(0, p.Imports.Count); - object o = p.EvaluatedItems; // force evaluation of imported projects. - Assertion.AssertEquals(0, p.Imports.Count); - } - finally - { - CompatibilityTestHelpers.RemoveFile(importPath); - } - } - - /// - /// AddNewImport Test, check project flagged as dirty after import - /// - [Test] - public void AddNewImportsIsDirtyAfterImport() - { - Project p = new Project(new Engine()); - string importPath = ObjectModelHelpers.CreateTempFileOnDisk(TestData.ContentSimpleTools35InitialTargets); - Assertion.AssertEquals(false, p.IsDirty); - InvokeAddNewImportMethod(p, importPath, null); - Assertion.AssertEquals(true, p.IsDirty); - } - - /// - /// AddNewImport Test, Check precedence and import of InitialTargets - /// - [Test] - public void AddNewImportAttributeprecedence_InitialTargets() - { - Project p = new Project(new Engine()); - p.InitialTargets = "localTargetFirst"; - string importPath = ObjectModelHelpers.CreateTempFileOnDisk(TestData.ContentSimpleTools35InitialTargets); // InitialTarget - InvokeAddNewImportMethod(p, importPath, null); - Assertion.AssertEquals("localTargetFirst", p.InitialTargets); // Assert non automatic evaluation. - object o = p.EvaluatedItems; // force evaluation of imported projects. - Assertion.AssertEquals("localTargetFirst; InitialTarget", p.InitialTargets); // Assert the concat - } - - /// - /// AddNewImport Test, Check precedence and import of DefaultTargets - /// - [Test] - public void AddNewImportAttributeprecedence_DefaultTarget() - { - string importPath = String.Empty; - try - { - Project p = new Project(new Engine()); - p.DefaultTargets = "localTargetDefault"; - importPath = ObjectModelHelpers.CreateTempFileOnDisk(TestData.Content3SimpleTargetsDefaultSpecified); // TestTargetDefault - InvokeAddNewImportMethod(p, importPath, null); - Assertion.AssertEquals("localTargetDefault", p.DefaultTargets); // Assert non automatic evaluation. - object o = p.EvaluatedItems; // force evaluation of imported projects. - Assertion.AssertEquals("localTargetDefault", p.DefaultTargets); - } - finally - { - CompatibilityTestHelpers.RemoveFile(importPath); - } - } - - /// - /// AddNewImport Test, Import p1 into p2 - /// - [Test] - public void AddNewImportStandard() - { - string projectPath = String.Empty; - string projectPathImport = String.Empty; - try - { - Project p = new Project(new Engine()); - projectPath = ObjectModelHelpers.CreateTempFileOnDisk(TestData.Content3SimpleTargetsDefaultSpecified); - projectPathImport = ObjectModelHelpers.CreateTempFileOnDisk(TestData.Content3SimpleTargetsDefaultSpecified); - p.Load(projectPath); - InvokeAddNewImportMethod(p, projectPathImport, "true"); - Assertion.AssertEquals(0, p.Imports.Count); - object o = p.EvaluatedItems; // force evaluation of imported projects. - Assertion.AssertEquals(1, CompatibilityTestHelpers.CountNodesWithName(p.Xml, "Import")); - Assertion.AssertEquals(1, p.Imports.Count); - } - finally - { - CompatibilityTestHelpers.RemoveFile(projectPath); - CompatibilityTestHelpers.RemoveFile(projectPathImport); - } - } - - /// - /// AddNewImport Test, Import p1 into p twice - /// - [Test] - public void AddNewImportStandardTwice() - { - string projectPath = String.Empty; - string projectPathImport = String.Empty; - try - { - Project p = new Project(new Engine()); - projectPath = ObjectModelHelpers.CreateTempFileOnDisk(TestData.Content3SimpleTargetsDefaultSpecified); - projectPathImport = ObjectModelHelpers.CreateTempFileOnDisk(TestData.Content3SimpleTargetsDefaultSpecified); - p.Load(projectPath); - InvokeAddNewImportMethod(p, projectPathImport, "true"); - InvokeAddNewImportMethod(p, projectPathImport, "true"); - Assertion.AssertEquals(0, p.Imports.Count); - object o = p.EvaluatedItems; // force evaluation of imported projects. - Assertion.AssertEquals(2, CompatibilityTestHelpers.CountNodesWithName(p.Xml, "Import")); // 2 in xml - Assertion.AssertEquals(1, p.Imports.Count); // 1 in OM. - } - finally - { - CompatibilityTestHelpers.RemoveFile(projectPath); - CompatibilityTestHelpers.RemoveFile(projectPathImport); - } - } - - /// - /// AddNewImport Test, Import p1 and p2 into p - /// - [Test] - public void AddTwoNewImportStandard() - { - string projectPath = String.Empty; - string projectPathImport1 = String.Empty; - string projectPathImport2 = String.Empty; - - try - { - Project p = new Project(new Engine()); - projectPath = ObjectModelHelpers.CreateTempFileOnDisk(TestData.Content3SimpleTargetsDefaultSpecified); - projectPathImport1 = ObjectModelHelpers.CreateTempFileOnDisk(TestData.Content3SimpleTargetsDefaultSpecified); - projectPathImport2 = ObjectModelHelpers.CreateTempFileOnDisk(TestData.Content3SimpleTargetsDefaultSpecified); - p.Load(projectPath); - InvokeAddNewImportMethod(p, projectPathImport1, "true"); - InvokeAddNewImportMethod(p, projectPathImport2, "true"); - Assertion.AssertEquals(0, p.Imports.Count); - object o = p.EvaluatedItems; // force evaluation of imported projects. - Assertion.AssertEquals(2, CompatibilityTestHelpers.CountNodesWithName(p.Xml, "Import")); // 2 in the XML - Assertion.AssertEquals(2, p.Imports.Count); // 2 in OM - } - finally - { - CompatibilityTestHelpers.RemoveFile(projectPath); - CompatibilityTestHelpers.RemoveFile(projectPathImport1); - CompatibilityTestHelpers.RemoveFile(projectPathImport2); - } - } - - /// - /// AddNewImport Test, Import a project into itself - /// - [Test] - public void AddNewImportToBecomeSelfReferential() - { - string projectPath = String.Empty; - try - { - Project p = new Project(new Engine()); - projectPath = ObjectModelHelpers.CreateTempFileOnDisk(TestData.Content3SimpleTargetsDefaultSpecified); - p.Load(projectPath); - InvokeAddNewImportMethod(p, projectPath, "true"); - Assertion.AssertEquals(0, p.Imports.Count); - object o = p.EvaluatedItems; // force evaluation of imported projects. - Assertion.AssertEquals(0, p.Imports.Count); // Should be 1 because the XML DOES contain the import node. - } - finally - { - CompatibilityTestHelpers.RemoveFile(projectPath); - } - } - - /// - /// AddNewImport Test, Import a project into itself twice - /// - [Test] - public void AddNewImportToBecomeSelfReferentialTwice() - { - string projectPath = String.Empty; - try - { - Project p = new Project(new Engine()); - projectPath = ObjectModelHelpers.CreateTempFileOnDisk(TestData.Content3SimpleTargetsDefaultSpecified); - InvokeAddNewImportMethod(p, projectPath, null); - InvokeAddNewImportMethod(p, projectPath, null); - object o = p.EvaluatedItems; // force evaluation of imported projects. - Assertion.AssertEquals(1, p.Imports.Count); - Assertion.AssertEquals(2, CompatibilityTestHelpers.CountNodesWithName(p.Xml, "Import")); // 2 in the XML - } - finally - { - CompatibilityTestHelpers.RemoveFile(projectPath); - } - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/Compatibility/BuildItemGroupCollection_Tests.cs b/src/Deprecated/Engine.UnitTests/Compatibility/BuildItemGroupCollection_Tests.cs deleted file mode 100644 index f759aadb7a7..00000000000 --- a/src/Deprecated/Engine.UnitTests/Compatibility/BuildItemGroupCollection_Tests.cs +++ /dev/null @@ -1,310 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.IO; -using System.Xml; -using System.Collections.Generic; -using NUnit.Framework; - -using Microsoft.Build.BuildEngine; -using Microsoft.Build.Framework; -using Microsoft.Build.UnitTests; -using System.Collections; - -namespace Microsoft.Build.UnitTests.OM.OrcasCompatibility -{ - /// - /// Test Fixture Class for the v9 Object Model Public Interface Compatibility Tests for the BuildItemGroupCollection Class. - /// - [TestFixture] - public sealed class BuildItemGroupCollection_Tests - { - #region Common Helpers - /// - /// Basic Project XML Content - /// - private const string ProjectContentWithThreeBuildItemGroups = @" - - - - item1n1m1value - - - - - - - item2n1m1value - item2n1m2value - - - - - - - - - - - - "; - - /// - /// Engine that is used through out test class - /// - private Engine engine; - - /// - /// Project that is used through out test class - /// - private Project project; - - /// - /// Creates the engine and parent object. Also registers the mock logger. - /// - [SetUp()] - public void Initialize() - { - ObjectModelHelpers.DeleteTempProjectDirectory(); - - engine = new Engine(); - project = new Project(engine); - } - - /// - /// Unloads projects and un-registers logger. - /// - [TearDown()] - public void Cleanup() - { - engine.UnloadProject(project); - engine.UnloadAllProjects(); - - ObjectModelHelpers.DeleteTempProjectDirectory(); - } - #endregion - - #region Count Tests - /// - /// Tests BuildItemGroupCollection.Count simple/basic case - /// - [Test] - public void CountSimple() - { - project.LoadXml(ProjectContentWithThreeBuildItemGroups); - BuildItemGroupCollection groups = project.ItemGroups; - - Assertion.AssertEquals(3, groups.Count); - } - - /// - /// Tests BuildItemGroupCollection.Count when no BuildItemGroups exist - /// - [Test] - public void CountZero() - { - string projectContents = @" - - - "; - - project.LoadXml(projectContents); - BuildItemGroupCollection groups = project.ItemGroups; - - Assertion.AssertEquals(0, groups.Count); - } - - /// - /// Tests BuildItemGroupCollection.Count when only one BuildItemGroup exists - /// - [Test] - public void CountOne() - { - string projectContents = @" - - - - - - "; - - project.LoadXml(projectContents); - BuildItemGroupCollection groups = project.ItemGroups; - - Assertion.AssertEquals(1, groups.Count); - } - - /// - /// Tests BuildItemGroupCollection.Count when all BuildItemGroups come from - /// Imported Project - /// - [Test] - public void CountImportedOnly() - { - string parentProjectContents = @" - - - - "; - - Project p = GetProjectThatImportsAnotherProject(null, parentProjectContents); - - BuildItemGroupCollection groups = p.ItemGroups; - Assertion.AssertEquals(2, groups.Count); - } - - /// - /// Tests BuildItemGroupCollection.Count when BuildItemGroups come from both - /// parent project and imported project - /// - [Test] - public void CountParentAndImported() - { - Project p = GetProjectThatImportsAnotherProject(null, null); - - BuildItemGroupCollection groups = p.ItemGroups; - Assertion.AssertEquals(5, groups.Count); - } - - /// - /// Tests BuildItemGroupCollection.Count after adding a new BuildItemGroup - /// - [Test] - public void CountAfterAddingNewGroup() - { - project.LoadXml(ProjectContentWithThreeBuildItemGroups); - BuildItemGroupCollection groups = project.ItemGroups; - - project.AddNewItemGroup(); - - Assertion.AssertEquals(4, groups.Count); - } - - /// - /// Tests BuildItemGroupCollection.Count after removing all BuildItemGroups - /// - [Test] - public void CountAfterRemovingAllGroups() - { - project.LoadXml(ProjectContentWithThreeBuildItemGroups); - BuildItemGroupCollection groups = project.ItemGroups; - - project.RemoveAllItemGroups(); - - Assertion.AssertEquals(0, groups.Count); - } - #endregion - - #region CopyTo Tests - /// - /// Tests BuildItemGroupCollection.CopyTo simple/basic case - /// - [Test] - public void CopyToSimple() - { - project.LoadXml(ProjectContentWithThreeBuildItemGroups); - BuildItemGroupCollection groups = project.ItemGroups; - - object[] array = new object[groups.Count]; - groups.CopyTo(array, 0); - - int count = 0; - foreach (BuildItemGroup group in groups) - { - Assertion.AssertEquals(array[count].ToString(), group.ToString()); - count++; - } - } - - /// - /// Tests BuildItemGroupCollection.Copyto when you attempt CopyTo - /// into an Array that's not long enough - /// - [Test] - [ExpectedException(typeof(IndexOutOfRangeException))] - public void CopyToArrayThatsNotLargeEnough() - { - project.LoadXml(ProjectContentWithThreeBuildItemGroups); - BuildItemGroupCollection groups = project.ItemGroups; - - object[] array = new object[groups.Count - 1]; - groups.CopyTo(array, 0); - } - #endregion - - #region IsSynchronized Tests - /// - /// Tests BuildItemGroupCollection.IsSynchronized for the default case (you load a project p and get the build item group collection from p) - /// - [Test] - public void IsSynchronizedDefault() - { - project.LoadXml(ProjectContentWithThreeBuildItemGroups); - BuildItemGroupCollection groups = project.ItemGroups; - - Assertion.AssertEquals(false, groups.IsSynchronized); - } - #endregion - - #region Helpers - /// - /// Gets a Project that imports another Project - /// - /// Project Contents of the imported Project, to get default content, pass in an empty string - /// Project Contents of the Parent Project, to get default content, pass in an empty string - /// Project - private Project GetProjectThatImportsAnotherProject(string importProjectContents, string parentProjectContents) - { - if (String.IsNullOrEmpty(importProjectContents)) - { - importProjectContents = @" - - - - - n1Importedvalue1 - - - - - - - - "; - } - - if (String.IsNullOrEmpty(parentProjectContents)) - { - parentProjectContents = @" - - - - - - - - - - - - - n2MainValueItem3 - - - - - "; - } - - ObjectModelHelpers.CreateFileInTempProjectDirectory("import.proj", importProjectContents); - ObjectModelHelpers.CreateFileInTempProjectDirectory("main.proj", parentProjectContents); - return ObjectModelHelpers.LoadProjectFileInTempProjectDirectory("main.proj", null); - } - #endregion - } -} diff --git a/src/Deprecated/Engine.UnitTests/Compatibility/BuildItemGroup_Tests.cs b/src/Deprecated/Engine.UnitTests/Compatibility/BuildItemGroup_Tests.cs deleted file mode 100644 index 2d100b12d75..00000000000 --- a/src/Deprecated/Engine.UnitTests/Compatibility/BuildItemGroup_Tests.cs +++ /dev/null @@ -1,1217 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.IO; -using System.Xml; -using System.Collections.Generic; -using NUnit.Framework; - -using Microsoft.Build.BuildEngine; -using Microsoft.Build.Framework; -using Microsoft.Build.UnitTests; -using System.Collections; - -namespace Microsoft.Build.UnitTests.OM.OrcasCompatibility -{ - /// - /// Test Fixture Class for the v9 Object Model Public Interface Compatibility Tests for the BuildItemGroup Class. - /// - [TestFixture] - public sealed class BuildItemGroup_Tests - { - #region Common Helpers - /// - /// Basic Project XML Content - /// - private const string ProjectContentWithOneBuildItemGroupThreeBuildItems = @" - - - - n1value1 - n1value2 - - - - n3value1 - - - - "; - - /// - /// String of Special Characters to use in tests - /// - private const string SpecialCharacters = "%24%40%3b%5c%25"; - - /// - /// String of EscapableCharacters to use in tests - /// - private const string EscapableCharacters = @"%*?@$();\"; - - /// - /// Engine that is used through out test class - /// - private Engine engine; - - /// - /// Project that is used through out test class - /// - private Project project; - - /// - /// Creates the engine and parent object. Also registers the mock logger. - /// - [SetUp()] - public void Initialize() - { - ObjectModelHelpers.DeleteTempProjectDirectory(); - - engine = new Engine(); - project = new Project(engine); - } - - /// - /// Unloads projects and un-registers logger. - /// - [TearDown()] - public void Cleanup() - { - engine.UnloadProject(project); - engine.UnloadAllProjects(); - - ObjectModelHelpers.DeleteTempProjectDirectory(); - } - #endregion - - /// - /// Example test for BuildItemGroup - /// ****Don't keep this test once you're done automating**** - /// - [Test] - public void ExampleTest() - { - //// Part 1 of Example test - working with BuildItemGroup where - //// you have an XML project - project.LoadXml(ProjectContentWithOneBuildItemGroupThreeBuildItems); - BuildItemGroup groupOne = GetBuildItemGroupFromProject(project, false); - - Assertion.AssertEquals("'A'=='B'", groupOne.Condition); - Assertion.AssertEquals(3, groupOne.Count); - Assertion.AssertEquals(false, groupOne.IsImported); - - BuildItem itemOne = GetSpecificBuildItemFromBuildItemGroup(groupOne, "n2"); - Assertion.AssertEquals("'a2' == 'b2'", itemOne.Condition); - groupOne.RemoveItem(itemOne); - Assertion.AssertEquals(2, groupOne.Count); - - BuildItem itemOther = groupOne.AddNewItem("n4", "i4"); - Assertion.AssertEquals(3, groupOne.Count); - - //// Part 2 of Example test - working with BuildItemGroup where - //// you have an in-memory buildItemGroup - BuildItemGroup groupTwo = new BuildItemGroup(); - groupTwo.AddNewItem("name", "include"); - Assertion.AssertEquals(1, groupTwo.Count); - - //// Part 3 of Example test - working with BuildItemGroup where - //// you have an XML project that contains an Imported Project - Project p = GetProjectThatImportsAnotherProject(null, null); - BuildItemGroup groupThree = GetBuildItemGroupFromProject(p, true); - - Assertion.AssertEquals(true, groupThree.IsImported); - - BuildItem itemThree = GetSpecificBuildItemFromBuildItemGroup(groupThree, "n3Imported"); - Assertion.AssertEquals("n3Importedvalue1", itemThree.GetMetadata("n3ImportedMeta1")); - } - - #region Constructor Tests - /// - /// Tests the Default (and only) BuildItemGroup Contructor, which takes no parameters - /// - [Test] - public void ConstructSimple() - { - BuildItemGroup group = new BuildItemGroup(); - Assertion.AssertEquals(0, group.Count); - } - #endregion - - #region Condition Tests - /// - /// Tests BuildItemGroup.Condition Get simple/basic case - /// - [Test] - public void ConditionGetSimple() - { - project.LoadXml(ProjectContentWithOneBuildItemGroupThreeBuildItems); - BuildItemGroup group = GetBuildItemGroupFromProject(project, false); - - Assertion.AssertEquals("'A'=='B'", group.Condition); - } - - /// - /// Tests BuildItemGroup.Condition Get when no condition exists - /// - [Test] - [Ignore("not yet implemented")] - public void ConditionGetWhenNoCondition() - { - } - - /// - /// Tests BuildItemGroup.Condition Get when Condition is an empty string - /// - [Test] - public void ConditionGetEmptyString() - { - } - - /// - /// Tests BuildItemGroup.Condition Get from an imported Project - /// - [Test] - [Ignore("not yet implemented")] - public void ConditionGetFromImportedProject() - { - } - - /// - /// Tests BuildItemGroup.Condition Set on in-memory BuildItemGroup - /// - [Test] - [ExpectedException(typeof(InvalidOperationException))] - public void ConditionSetOnInMemoryGroup() - { - BuildItemGroup group = new BuildItemGroup(); - group.Condition = "'t' == 'TRUE'"; - } - - /// - /// Tests BuildItemGroup.Condition Set when no provious exists - /// - [Test] - [Ignore("not yet implemented")] - public void ConditionSetWhenNoPreviousConditionExists() - { - } - - /// - /// Tests BuildItemGroup.Condition Set when an existing condition exists, changing the condition - /// - [Test] - [Ignore("not yet implemented")] - public void ConditionSetOverExistingCondition() - { - } - - /// - /// Tests BuildItemGroup.Condition Set To Empty string - /// - [Test] - [Ignore("not yet implemented")] - public void ConditionSetToEmptyString() - { - } - - /// - /// Tests BuildItemGroup.Condition Set to null - /// - [Test] - [Ignore("not yet implemented")] - public void ConditionSetToNull() - { - } - - /// - /// Tests BuildItemGroup.Condition Set to Special Characters - /// - [Test] - [Ignore("not yet implemented")] - public void ConditionSetToSpecialCharacters() - { - } - - /// - /// Tests BuildItemGroup.Condition Set to Escape Characters - /// - [Test] - [Ignore("not yet implemented")] - public void ConditionSetToEscapableCharacters() - { - } - - /// - /// Tests BuildItemGroup.Condition Attempt Set on an Imported Project - /// - [Test] - [ExpectedException(typeof(InvalidOperationException))] - [Ignore("not yet implemented")] - public void ConditionSetOnImportedProject() - { - } - - /// - /// Tests BuildItemGroup.Condition Set, save to disk and verify - /// - [Test] - public void ConditionSaveProjectAfterSet() - { - project.LoadXml(ProjectContentWithOneBuildItemGroupThreeBuildItems); - BuildItemGroup group = GetBuildItemGroupFromProject(project, false); - group.Condition = "'t' == 'true'"; - - string expectedProjectContents = @" - - - - n1value1 - n1value2 - - - - n3value1 - - - - "; - - SaveProjectToDiskAndCompareAgainstExpectedContents(project, expectedProjectContents); - } - #endregion - - #region Count Tests - /// - /// Tests BuildItemGroup.Count when Several BuildItem Exist within a BuildItemGroup - /// - [Test] - public void CountGetWhenSeveralExist() - { - project.LoadXml(ProjectContentWithOneBuildItemGroupThreeBuildItems); - BuildItemGroup group = GetBuildItemGroupFromProject(project, false); - - Assertion.AssertEquals(3, group.Count); - } - - /// - /// Tests BuildItemGroup.Count when no BuildItems exist within a BuildItemGroup - /// - [Test] - [Ignore("not yet implemented")] - public void CountGetWhenNoneExist() - { - } - - /// - /// Tests BuildItemGroup.Count from an Imported BuildItemGroup - /// - [Test] - [Ignore("not yet implemented")] - public void CountGetFromImportedGroup() - { - } - - /// - /// Tests BuildItemGroup.Count from an In-memory BuildItemGroup - /// - [Test] - [Ignore("not yet implemented")] - public void CountGetFromInMemoryGroup() - { - } - - /// - /// Tests BuildItemGroup.Count after clearing it, expecting to be Zero - /// - [Test] - [Ignore("not yet implemented")] - public void CountAfterClear() - { - } - - /// - /// Tests BuildItemGroup.Count after removing 1 of the BuildItems - /// - [Test] - [Ignore("not yet implemented")] - public void CountAfterRemovingSomeItems() - { - } - - /// - /// Tests BuildItemGroup.Count after removing all of the BuildItems - /// - [Test] - [Ignore("not yet implemented")] - public void CountAfterRemovingAllItems() - { - } - #endregion - - #region IsImported Tests - /// - /// Tests BuildItemGroup.IsImported when BuildItemGroup does come from an imported project - /// - [Test] - [Ignore("not yet implemented")] - public void IsImportedExpectedTrue() - { - } - - /// - /// Tests BuildItemGroup.IsImported when BuildItemGroup does not come from an imported project (comes from main/parent project) - /// and no projects are imported. - /// - [Test] - [Ignore("not yet implemented")] - public void IsImportedExpectedFalseNoImportsExist() - { - } - - /// - /// Tests BuildItemGroup.IsImported when specific BuildItemGroup does not come from an imported project - /// but others are imported. - /// - [Test] - [Ignore("not yet implemented")] - public void IsImportedExpectedFalseImportsDoExist() - { - } - - /// - /// Tests BuildItemGroup.IsImported when all we have is an in memory BuildItemGroup - /// - [Test] - public void IsImportedInMemoryBuildItemGroup() - { - BuildItemGroup group = new BuildItemGroup(); - group.AddNewItem("n", "i"); - - Assertion.AssertEquals(false, group.IsImported); - } - #endregion - - #region Clone Tests - ////See BuildPropertyGroup Clone tests for specific examples for BuildItemGroup - - /// - /// Tests BuildItemGroup.Clone Deep - /// - [Test] - [Ignore("not yet implemented")] - public void CloneDeep() - { - } - - /// - /// Tests BuildItemGroup.Clone Deep with Clear on the Cloned group - /// - [Test] - [Ignore("not yet implemented")] - public void CloneDeepClear() - { - } - - /// - /// Tests BuildItemGroup.Clone Shallow - /// - [Test] - [Ignore("not yet implemented")] - public void CloneShallow() - { - } - - /// - /// Tests BuildItemGroup.Clone Shallow with Add new BuildItem - /// - [Test] - [Ignore("not yet implemented")] - public void CloneShallowAddItem() - { - } - - /// - /// Tests BuildItemGroup.Clone Shallow when you attempt a shallow clone of an XMLProject - /// - [Test] - [ExpectedException(typeof(InvalidOperationException))] - [Ignore("not yet implemented")] - public void CloneShallowWithXMLProject() - { - } - #endregion - - #region AddNewItem Tests - /// - /// Tests BuildItemGroup.AddNewItem for simple/basic case - /// - [Test] - public void AddNewItemNameSimple() - { - project.LoadXml(ProjectContentWithOneBuildItemGroupThreeBuildItems); - BuildItemGroup group = GetBuildItemGroupFromProject(project, false); - - group.AddNewItem("n4", "i4"); - - Dictionary items = GetDictionaryOfBuildItemsInProject(project, false); - Assertion.AssertEquals("i1", items["n1"]); - Assertion.AssertEquals("i2", items["n2"]); - Assertion.AssertEquals("i3", items["n3"]); - Assertion.AssertEquals("i4", items["n4"]); - } - - /// - /// Tests BuildItemGroup.AddNewItem of same name as existing item (which creates another item of the same name) - /// - [Test] - public void AddNewItemNameOfExistingItem() - { - project.LoadXml(ProjectContentWithOneBuildItemGroupThreeBuildItems); - BuildItemGroup group = GetBuildItemGroupFromProject(project, false); - - group.AddNewItem("n3", "iNew"); - - Dictionary items = GetDictionaryOfBuildItemsInProject(project, true); - Assertion.AssertEquals("i1", items["n1"]); - Assertion.AssertEquals("i2", items["n2"]); - Assertion.AssertEquals("i3", items["n3"]); - Assertion.AssertEquals("iNew", items["_n3"]); - } - - /// - /// Tests BuildItemGroup.AddNewItem with setting Name to null - /// - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void AddNewItemNameToNull() - { - project.LoadXml(ProjectContentWithOneBuildItemGroupThreeBuildItems); - BuildItemGroup group = GetBuildItemGroupFromProject(project, false); - - group.AddNewItem(null, "i"); - } - - /// - /// Tests BuildItemGroup.AddNewItem with setting Name to null on an in memory group - /// - [Test] - public void AddNewItemNameToNullMemoryGroup() - { - BuildItemGroup group = new BuildItemGroup(); - group.AddNewItem(null, "i"); - - Assertion.AssertEquals(1, group.Count); - } - - /// - /// Tests BuildItemGroup.AddNewItem with setting Name to an empty string - /// - [Test] - [ExpectedException(typeof(IndexOutOfRangeException))] - public void AddNewItemNameToEmptyString() - { - project.LoadXml(ProjectContentWithOneBuildItemGroupThreeBuildItems); - BuildItemGroup group = GetBuildItemGroupFromProject(project, false); - - group.AddNewItem(String.Empty, "i"); - } - - /// - /// Tests BuildItemGroup.AddNewItem with setting itemInclude to null - /// - [Test] - [ExpectedException(typeof(ArgumentNullException))] - [Ignore("not yet implemented")] - public void AddNewItemItemIncludeToNull() - { - } - - /// - /// Tests BuildItemGroup.AddNewItem with setting itemInclude to an empty string - /// - [Test] - [Ignore("not yet implemented")] - public void AddNewItemItemIncludeToEmptyString() - { - } - - /// - /// Tests BuildItemGroup.AddNewItem with simple Name and itemInclude - /// - [Test] - [Ignore("not yet implemented")] - public void AddNewItemSimpleNameItemInclude() - { - } - - /// - /// Tests BuildItemGroup.AddNewItem with simple Name and itemInclude as well as setting Treat Property Value as Literal to true - /// - [Test] - public void AddNewItemSimpleNameItemIncludeWithTreatPropertyValueAsLiteralTrue() - { - project.LoadXml(ProjectContentWithOneBuildItemGroupThreeBuildItems); - BuildItemGroup group = GetBuildItemGroupFromProject(project, false); - - group.AddNewItem("n4", EscapableCharacters, true); - - Dictionary items = GetDictionaryOfBuildItemsInProject(project, false); - Console.WriteLine("'{0}'", items["n4"].ToString()); - Assertion.AssertEquals(@"%25%2a%3f%40%24%28%29%3b\", items["n4"]); - } - - /// - /// Tests BuildItemGroup.AddNewItem with simple Name and itemInclude as well as setting Treat Property Value as Literal to false - /// - [Test] - public void AddNewItemSimpleNameItemIncludeWithTreatPropertyValueAsLiteralFalse() - { - project.LoadXml(ProjectContentWithOneBuildItemGroupThreeBuildItems); - BuildItemGroup group = GetBuildItemGroupFromProject(project, false); - - group.AddNewItem("n4", EscapableCharacters, false); - - Dictionary items = GetDictionaryOfBuildItemsInProject(project, false); - Console.WriteLine("'{0}'", items["n4"].ToString()); - Assertion.AssertEquals(EscapableCharacters, items["n4"]); - } - - /// - /// Tests BuildItemGroup.AddNewItem with special characters for the Name - /// - [Test] - [ExpectedException(typeof(ArgumentException))] - public void AddNewItemWithSpecialCharactersInName() - { - project.LoadXml(ProjectContentWithOneBuildItemGroupThreeBuildItems); - BuildItemGroup group = GetBuildItemGroupFromProject(project, false); - - group.AddNewItem(SpecialCharacters, "i"); - } - - /// - /// Tests BuildItemGroup.AddNewItem with special characters for the itemInclude - /// - [Test] - public void AddNewItemWithSpecialCharactersInValue() - { - project.LoadXml(ProjectContentWithOneBuildItemGroupThreeBuildItems); - BuildItemGroup group = GetBuildItemGroupFromProject(project, false); - - group.AddNewItem("n4", SpecialCharacters); - - Dictionary items = GetDictionaryOfBuildItemsInProject(project, false); - Assertion.AssertEquals(SpecialCharacters, items["n4"]); - } - - /// - /// Tests BuildItemGroup.AddNewItem within an in memory build item group - /// - [Test] - [Ignore("not yet implemented")] - public void AddNewItemToInMemoryGroup() - { - } - - /// - /// Tests BuildItemGroup.AddNewItem to an Imported Group, expected to fail - /// - [Test] - [Ignore("not yet implemented")] - public void AddNewItemToGroupWithinAnImportedProject() - { - } - - /// - /// Tests BuildItemGroup.AddNewItem to a Group, save to disk and verify - /// - [Test] - [Ignore("not yet implemented")] - public void AddNewItemSaveToDiskVerify() - { - } - #endregion - - #region RemoveItem Tests - /// - /// Tests BuildItemGroup.RemoveItem for simple/basic case - /// - [Test] - public void RemoveItemSimple() - { - project.LoadXml(ProjectContentWithOneBuildItemGroupThreeBuildItems); - BuildItemGroup group = GetBuildItemGroupFromProject(project, false); - - BuildItem item = GetSpecificBuildItemFromBuildItemGroup(group, "n2"); - group.RemoveItem(item); - - Assertion.AssertEquals(2, group.Count); - Dictionary items = GetDictionaryOfBuildItemsInProject(project, false); - Assertion.AssertEquals("i1", items["n1"]); - Assertion.AssertEquals("i3", items["n3"]); - } - - /// - /// Tests BuildItemGroup.RemoveItem by removing 1 of many items - /// - [Test] - public void RemoveItemOneOfSeveral() - { - BuildItemGroup group = new BuildItemGroup(); - BuildItem item = group.AddNewItem("n1", "i1"); - group.AddNewItem("n2", "i2"); - group.AddNewItem("n3", "i3"); - - group.RemoveItem(item); - - Assertion.AssertEquals(2, group.Count); - - Dictionary items = GetDictionaryOfBuildItemsInBuildItemsGroup(group); - Assertion.AssertEquals("i2", items["n2"]); - Assertion.AssertEquals("i3", items["n3"]); - } - - /// - /// Tests BuildItemGroup.RemoveItem by removing all of many - /// - [Test] - public void RemoveItemAllOfSeveral() - { - BuildItemGroup group = new BuildItemGroup(); - BuildItem[] item = new BuildItem[3]; - item[0] = group.AddNewItem("n1", "i1"); - item[1] = group.AddNewItem("n2", "i2"); - item[2] = group.AddNewItem("n3", "i3"); - - group.RemoveItem(item[0]); - group.RemoveItem(item[1]); - group.RemoveItem(item[2]); - - Assertion.AssertEquals(0, group.Count); - } - - /// - /// Tests BuildItemGroup.RemoveItem by attempting to remove an item that doesn't actually exist - /// - [Test] - [Ignore("not yet implemented")] - public void RemoveItemOfANonExistingItem() - { - } - - /// - /// Tests BuildItemGroup.RemoveItem by attempting to remove a property name that is null - /// - [Test] - public void RemoveItemWhenItemIsNull() - { - BuildItemGroup group = new BuildItemGroup(); - group.RemoveItem(null); - - Assertion.AssertEquals(0, group.Count); - } - - /// - /// Tests BuildItemGroup.RemoveItem by attempting to remove an item that is an empty string - /// - [Test] - [Ignore("not yet implemented")] - public void RemoveItemThatIsAnEmptyString() - { - } - - /// - /// Tests BuildItemGroup.RemoveItem from an Imported Group, expected to fail - /// - [Test] - [Ignore("not yet implemented")] - public void RemoveItemToGroupWithinAnImportedProject() - { - } - - /// - /// Tests BuildItemGroup.RemoveItem from a Group, save to disk and verify - /// - [Test] - [Ignore("not yet implemented")] - public void RemoveItemSaveToDiskVerify() - { - } - - #endregion - - #region RemoveItemAt Tests - //// RemoveItemAt(int index): index is zero based - - /// - /// Tests BuildItemGroup.RemoveItemAt simple/base case - /// - [Test] - public void RemoveItemAtSimple() - { - project.LoadXml(ProjectContentWithOneBuildItemGroupThreeBuildItems); - BuildItemGroup group = GetBuildItemGroupFromProject(project, false); - - group.RemoveItemAt(1); - - Assertion.AssertEquals(2, group.Count); - Dictionary items = GetDictionaryOfBuildItemsInProject(project, false); - Assertion.AssertEquals("i1", items["n1"]); - Assertion.AssertEquals("i3", items["n3"]); - } - - /// - /// Tests BuildItemGroup.RemoveItemAt first item in group - /// - [Test] - public void RemoveItemAtFirstItem() - { - BuildItemGroup group = new BuildItemGroup(); - group.AddNewItem("n1", "i1"); - group.AddNewItem("n2", "i2"); - group.AddNewItem("n3", "i3"); - - group.RemoveItemAt(0); - - Assertion.AssertEquals(2, group.Count); - - Dictionary items = GetDictionaryOfBuildItemsInBuildItemsGroup(group); - Assertion.AssertEquals("i2", items["n2"]); - Assertion.AssertEquals("i3", items["n3"]); - } - - /// - /// Tests the addition and removal of an evaluated item via its parent item group. - /// - /// Regression for bug: 170974 - /// - /// This method asserts broken behaviour - /// Contrast with RemoveEvaluatedItem2 for expected behaviours. - /// - [Test] - public void RemoveEvaluatedItem1() - { - try - { - List files = CompatibilityTestHelpers.CreateFiles(4, "foo", "foo", ObjectModelHelpers.TempProjectDir); - Project p = new Project(new Engine()); - BuildItemGroup group = p.AddNewItemGroup(); - group.AddNewItem("foos", Path.Combine(ObjectModelHelpers.TempProjectDir, "*.foo")); - object o = p.EvaluatedItems; // this causes the failure - group.RemoveItem(p.EvaluatedItems[0]); // Exception thrown here - Assertion.Fail("success as failure"); // should not get here due to exception above - } - catch (Exception e) - { - if (!(e.GetType().ToString().Contains("InternalErrorException"))) - { - Assertion.Fail(e.Message + " was thrown"); - } - else - { - Assertion.Assert("InternalErrorException was thrown", true); - } - } - finally - { - CompatibilityTestHelpers.CleanupDirectory(ObjectModelHelpers.TempProjectDir); - } - } - - /// - /// Tests the addition of an evaluated item via its parent item group and removal via its project object. - /// - /// Regression of 170974 - [Test] - public void RemoveEvaluatedItemSuccess() - { - try - { - string includePath = Path.Combine(ObjectModelHelpers.TempProjectDir, "*.foo"); - List files = CompatibilityTestHelpers.CreateFiles(4, "foo", "foo", ObjectModelHelpers.TempProjectDir); - Project p = new Project(new Engine()); - BuildItemGroup group = p.AddNewItemGroup(); - group.AddNewItem("foos", includePath); - object o = p.EvaluatedItems; - files.RemoveAt(files.IndexOf(p.EvaluatedItems[0].FinalItemSpec)); - p.RemoveItem(p.EvaluatedItems[0]); - int i = 0; - foreach (string fileName in files) - { - Assertion.AssertEquals(includePath, group[0].FinalItemSpec); - Assertion.AssertEquals(includePath, group[0].Include); - Assertion.AssertEquals(fileName, p.EvaluatedItems[i].Include); - Assertion.AssertEquals(fileName, p.EvaluatedItems[i].FinalItemSpec); - i++; - } - } - finally - { - CompatibilityTestHelpers.CleanupDirectory(ObjectModelHelpers.TempProjectDir); - } - } - - /// - /// Tests BuildItemGroup.RemoveItemAt last item in group - /// - [Test] - [Ignore("not yet implemented")] - public void RemoveItemAtLastItem() - { - } - - /// - /// Tests BuildItemGroup.RemoveItemAt middle item in group (of more then 3) - /// - [Test] - [Ignore("not yet implemented")] - public void RemoveItemAtMiddleItem() - { - } - - /// - /// Tests BuildItemGroup.RemoveItemAt attempt to remove non-existing item - /// Example, you have 3 items in your group, attempt to remove item 5 - /// - [Test] - [Ignore("not yet implemented")] - public void RemoveItemAtNonExistingItem() - { - } - - /// - /// Tests BuildItemGroup.RemoveItemAt attempt to remove an item from an Imported project - /// - [Test] - [Ignore("not yet implemented")] - public void RemoveItemAtFromImportedProject() - { - } - - /// - /// Tests BuildItemGroup.RemoveItemAt remove, save to disk and verify - /// - [Test] - [Ignore("not yet implemented")] - public void RemoveItemAtSaveToDiskAndVerify() - { - } - #endregion - - #region ToArray[] Tests - /// - /// Tests BuildItemGroup.ToArray[] simple case. Verify changing an item in the Array changes the actual item - /// in the group because the copies are NOT clones i.e. only the references are copied. - /// - [Test] - public void ToArrayChangeMadeToArray() - { - project.LoadXml(ProjectContentWithOneBuildItemGroupThreeBuildItems); - BuildItemGroup group = GetBuildItemGroupFromProject(project, false); - - BuildItem[] items = group.ToArray(); - Assertion.AssertEquals(3, items.Length); - - items[0].Include = "New"; - Dictionary groupItems = GetDictionaryOfBuildItemsInBuildItemsGroup(group); - Assertion.AssertEquals("New", items[0].Include); - Assertion.AssertEquals("New", groupItems["n1"]); - } - - /// - /// Tests BuildItemGroup.ToArray[] case where change is made to the BuildItemGroup and verify that - /// change is not reflected in the BuildItem Array. - /// - [Test] - public void ToArrayChangeMadeToGroup() - { - project.LoadXml(ProjectContentWithOneBuildItemGroupThreeBuildItems); - BuildItemGroup group = GetBuildItemGroupFromProject(project, false); - - BuildItem[] items = group.ToArray(); - Assertion.AssertEquals(3, items.Length); - - //// Change first item in group by removing it and re-adding it with a new itemInclude value - group.RemoveItemAt(0); - group.AddNewItem("n1", "New"); - - Dictionary groupItems = GetDictionaryOfBuildItemsInBuildItemsGroup(group); - Assertion.AssertEquals("i1", items[0].Include); - Assertion.AssertEquals("New", groupItems["n1"]); - } - - /// - /// Tests BuildItemGroup.ToArray[] attempt to make change to Array where group comes from an imported Project - /// - [Test] - [Ignore("not yet implemented")] - public void ToArrayOfImportedGroup() - { - } - - /// - /// Tests BuildItemGroup.ToArray[] make change to Array, save Project to disk and verify - /// change is included - /// - [Test] - [Ignore("not yet implemented")] - public void ToArrayChangeMadeSaveToDiskAndVerify() - { - } - #endregion - - #region BuildItem this[int index] Tests - /// - /// Tests BuildItem this[int index] { get } - /// - [Test] - public void ThisGet() - { - project.LoadXml(ProjectContentWithOneBuildItemGroupThreeBuildItems); - BuildItemGroup group = GetBuildItemGroupFromProject(project, false); - - Assertion.AssertEquals("n1", group[0].Name); - Assertion.AssertEquals("i1", group[0].Include); - Assertion.AssertEquals("e1", group[0].Exclude); - Assertion.AssertEquals("i1", group[0].FinalItemSpec); - Assertion.AssertEquals(String.Empty, group[0].Condition); - Assertion.AssertEquals(2, group[0].CustomMetadataCount); - - Assertion.AssertEquals("n2", group[1].Name); - Assertion.AssertEquals("i2", group[1].Include); - Assertion.AssertEquals(String.Empty, group[1].Exclude); - Assertion.AssertEquals("i2", group[1].FinalItemSpec); - Assertion.AssertEquals("'a2' == 'b2'", group[1].Condition); - Assertion.AssertEquals(0, group[1].CustomMetadataCount); - - Assertion.AssertEquals("n3", group[2].Name); - Assertion.AssertEquals("i3", group[2].Include); - Assertion.AssertEquals(String.Empty, group[2].Exclude); - Assertion.AssertEquals("i3", group[2].FinalItemSpec); - Assertion.AssertEquals(String.Empty, group[2].Condition); - Assertion.AssertEquals(1, group[2].CustomMetadataCount); - } - - /// - /// Tests BuildItem this[int index] { set } - /// - [Test] - public void ThisSet() - { - project.LoadXml(ProjectContentWithOneBuildItemGroupThreeBuildItems); - BuildItemGroup group = GetBuildItemGroupFromProject(project, false); - - group[0].Name = "n1New"; - group[1].Include = "i2New"; - group[2].Exclude = "e3New"; - group[0].Condition = "'true' == 'T'"; - group[1].SetMetadata("n2MetaNew", "n2valueNew"); - group[2].RemoveMetadata("n3Meta1"); - - Assertion.AssertEquals("n1New", group[0].Name); - Assertion.AssertEquals("i1", group[0].Include); - Assertion.AssertEquals("e1", group[0].Exclude); - Assertion.AssertEquals("i1", group[0].FinalItemSpec); - Assertion.AssertEquals("'true' == 'T'", group[0].Condition); - Assertion.AssertEquals(2, group[0].CustomMetadataCount); - - Assertion.AssertEquals("n2", group[1].Name); - Assertion.AssertEquals("i2New", group[1].Include); - Assertion.AssertEquals(String.Empty, group[1].Exclude); - Assertion.AssertEquals("i2New", group[1].FinalItemSpec); - Assertion.AssertEquals("'a2' == 'b2'", group[1].Condition); - Assertion.AssertEquals(1, group[1].CustomMetadataCount); - Assertion.AssertEquals("n2valueNew", group[1].GetEvaluatedMetadata("n2MetaNew")); - - Assertion.AssertEquals("n3", group[2].Name); - Assertion.AssertEquals("i3", group[2].Include); - Assertion.AssertEquals("e3New", group[2].Exclude); - Assertion.AssertEquals("i3", group[2].FinalItemSpec); - Assertion.AssertEquals(String.Empty, group[2].Condition); - Assertion.AssertEquals(0, group[2].CustomMetadataCount); - } - #endregion - - #region Helpers - /// - /// Gets a Dictionary List of BuildItems in your BuildItemGroup - /// - /// BuildItemGroup - /// A Dictionary List of BuildItems in your BuildItemGroup (Key = itemName, Value = itemInclude) - private static Dictionary GetDictionaryOfBuildItemsInBuildItemsGroup(BuildItemGroup group) - { - Dictionary items = new Dictionary(); - - foreach (BuildItem item in group) - { - items.Add(item.Name, item.Include); - } - - return items; - } - - /// - /// Gets a Dictionary List of BuildItems in your Project (Key = itemName, Value = itemInclude) - /// - /// Project - /// A Dictionary List of BuildItems in your project (Key = itemName, Value = itemInclude) - private static Dictionary GetDictionaryOfBuildItemsInProject(Project p, bool expectingDuplicateItem) - { - Dictionary items = new Dictionary(); - - foreach (BuildItemGroup group in p.ItemGroups) - { - foreach (BuildItem item in group) - { - try - { - items.Add(item.Name, item.Include); - } - catch (ArgumentException) - { - if (expectingDuplicateItem) - { - items.Add(String.Format("_{0}", item.Name), item.Include); - } - else - { - throw; - } - } - } - } - - return items; - } - - /// - /// Gets a List of all BuildItems within your Project - /// - /// Project - /// A List of strings of all BuildItems - private static List GetListOfBuildItems(Project p) - { - List items = new List(); - foreach (BuildItemGroup group in p.ItemGroups) - { - foreach (BuildItem item in group) - { - items.Add(item.Name); - } - } - - return items; - } - - /// - /// Gets you the specified BuildItem from a BuildItemGroup - /// - /// BuildItemGroup - /// The name of the BuildItem that you want - /// The specified BuildItem - private BuildItem GetSpecificBuildItemFromBuildItemGroup(BuildItemGroup group, string buildItemName) - { - foreach (BuildItem item in group) - { - if (String.Equals(item.Name, buildItemName, StringComparison.OrdinalIgnoreCase)) - { - return item; - } - } - - return null; - } - - /// - /// Gets you the BuildItemGroup from a Project - /// - /// Project that contains a BuildItemGroup - /// true if you want the BuildItemGroup that's Imported, false if not. When - /// not dealing with imported projects, assume false - /// A BuildItemGroup - private BuildItemGroup GetBuildItemGroupFromProject(Project p, bool importedGroup) - { - foreach (BuildItemGroup group in p.ItemGroups) - { - if (group.IsImported == importedGroup) - { - return group; - } - } - - return null; - } - - /// - /// Gets a Project that imports another Project - /// - /// Project Contents of the imported Project, to get default content, pass in an empty string - /// Project Contents of the Parent Project, to get default content, pass in an empty string - /// Project - private Project GetProjectThatImportsAnotherProject(string importProjectContents, string parentProjectContents) - { - if (String.IsNullOrEmpty(importProjectContents)) - { - importProjectContents = @" - - - - - n1Importedvalue1 - n1Importedvalue2 - - - - n3Importedvalue1 - - - - "; - } - - if (String.IsNullOrEmpty(parentProjectContents)) - { - parentProjectContents = @" - - - - - n2Mainvalue - - - - - "; - } - - ObjectModelHelpers.CreateFileInTempProjectDirectory("import.proj", importProjectContents); - ObjectModelHelpers.CreateFileInTempProjectDirectory("main.proj", parentProjectContents); - return ObjectModelHelpers.LoadProjectFileInTempProjectDirectory("main.proj", null); - } - - /// - /// Saves a given Project to disk and compares what's saved to disk with expected contents. Assertion handled within - /// ObjectModelHelpers.CompareProjectContents. - /// - /// Project to save - /// The Project content that you expect - private void SaveProjectToDiskAndCompareAgainstExpectedContents(Project p, string expectedProjectContents) - { - string savePath = Path.Combine(ObjectModelHelpers.TempProjectDir, "p.proj"); - p.Save(savePath); - - Engine e = new Engine(); - Project savedProject = new Project(e); - savedProject.Load(savePath); - - ObjectModelHelpers.CompareProjectContents(savedProject, expectedProjectContents); - ObjectModelHelpers.DeleteTempProjectDirectory(); - } - - #endregion - } -} diff --git a/src/Deprecated/Engine.UnitTests/Compatibility/BuildItem_Tests.cs b/src/Deprecated/Engine.UnitTests/Compatibility/BuildItem_Tests.cs deleted file mode 100644 index 6d6f10f2a5a..00000000000 --- a/src/Deprecated/Engine.UnitTests/Compatibility/BuildItem_Tests.cs +++ /dev/null @@ -1,2489 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.IO; -using System.Xml; -using System.Collections.Generic; -using NUnit.Framework; - -using Microsoft.Build.BuildEngine; -using Microsoft.Build.Framework; -using Microsoft.Build.UnitTests; -using System.Collections; - -namespace Microsoft.Build.UnitTests.OM.OrcasCompatibility -{ - /// - /// Test Fixture Class for the v9 Object Model Public Interface Compatibility Tests for the BuildItem Class. - /// - [TestFixture] - public sealed class BuildItem_Tests - { - #region Common Helpers - /// - /// Basic Project XML Content with One BuildItemGroup, which contain One BuildItem - /// - private const string ProjectContentOneItemGroupWithOneBuildItem = @" - - - - - - "; - - /// - /// Basic Project XML Conent with a BuildItemGroup, which contains one builditem with a condition - /// - private const string ProjectContentOneItemGroupWithOneBuildItemWithCondition = @" - - - - - - "; - - /// - /// Basic Project XML Content with One BuildItemGroup, which contains several BuildItems - /// - private const string ProjectContentOneItemGroupWithSeveralBuildItems = @" - - - - - - - - - "; - - /// - /// Basic Project XML Content with One BuildItemGroup, which contains several BuildItems - /// that have Includes and Excludes - /// - private const string ProjectContentOneItemGroupWithSeveralBuildItemsIncludesExcludes = @" - - - - - - - - - "; - - /// - /// Basic project XML Content with one BuildItemGroup, which contains one BuildItem - /// that has one custom metadata - /// - private const string ProjectContentOneItemGroupOneBuildItemOneMetadata = @" - - - - value - - - - "; - - /// - /// Basic Project XML Content with One BuildItemGroup, which contains one BuildItem - /// that has some Custom Metadata - /// - private const string ProjectContentOneItemGroupOneBuildItemWithCustomMetadata = @" - - - - a - b - c - - - - "; - - /// - /// String of Special Characters to use in tests - /// - private const string SpecialCharacters = "%24%40%3b%5c%25"; - - /// - /// String of EscapableCharacters to use in tests - /// - private const string EscapableCharacters = @"%*?@$();\"; - - /// - /// string array of all Reserved Names for BuildItem name - /// - private string[] reservedNames = new string[] - { - "VisualStudioProject", - "Target", - "PropertyGroup", - "Output", - "ItemGroup", - "UsingTask", - "ProjectExtensions", - "OnError", - "Choose", - "When", - "Otherwise" - }; - - /// - /// string array of all Build in BuildItem Metadata Names - /// - private string[] builtInMetadataNames = new string[] - { - "FullPath", - "RootDir", - "Filename", - "Extension", - "RelativeDir", - "Directory", - "RecursiveDir", - "Identity", - "ModifiedTime", - "CreatedTime", - "AccessedTime" - }; - - /// - /// Engine that is used through out test class - /// - private Engine engine; - - /// - /// Project that is used through out test class - /// - private Project project; - - /// - /// MockLogger that is used through out test class - /// - private MockLogger logger; - - /// - /// enum of test types to be able to enable helper methods to know which test type - /// - private enum TypeOfTest - { - /// - /// Used when test case is a BuildItem Constructor Test - /// - ConstructorTest, - - /// - /// Used when test case is a BuildItem.SetName Test - /// - SetNameTest, - - /// - /// Used when test case is a BuildItem.SetMetadataTest - /// - SetMetadataTest - } - - /// - /// Creates the engine and parent object. Also registers the mock logger. - /// - [SetUp()] - public void Initialize() - { - ObjectModelHelpers.DeleteTempProjectDirectory(); - - engine = new Engine(); - project = new Project(engine); - logger = new MockLogger(); - project.ParentEngine.RegisterLogger(logger); - } - - /// - /// Unloads projects and un-registers logger. - /// - [TearDown()] - public void Cleanup() - { - engine.UnloadProject(project); - engine.UnloadAllProjects(); - engine.UnregisterAllLoggers(); - - ObjectModelHelpers.DeleteTempProjectDirectory(); - } - #endregion - - #region Constructor Tests - /// - /// Tests BuildItem Constructor 'public BuildItem(string itemName, string itemInclude)' with simple strings - /// - [Test] - public void ConstructItemNameItemIncludeSimple() - { - BuildItem item = new BuildItem("n", "i"); - - Assertion.AssertEquals("n", item.Name); - Assertion.AssertEquals("i", item.FinalItemSpec); - } - - /// - /// Tests BuildItem Constructor 'public BuildItem(string itemName, string itemInclude)' with Empty String for itemName - /// - [Test] - [ExpectedException(typeof(IndexOutOfRangeException))] - public void ConstructItemNameEmptyString() - { - BuildItem item = new BuildItem(String.Empty, "i"); - } - - /// - /// Tests BuildItem Constructor 'public BuildItem(string itemName, string itemInclude)' with Empty String for itemInclude - /// - [Test] - public void ConstructItemIncludeEmptyString() - { - BuildItem item = new BuildItem("n", String.Empty); - - Assertion.AssertEquals("n", item.Name); - Assertion.AssertEquals(String.Empty, item.FinalItemSpec); - } - - /// - /// Tests BuildItem Constructor 'public BuildItem(string itemName, string itemInclude)' with null for itemInclude - /// - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void ConstructItemIncludeNull() - { - BuildItem item = new BuildItem("n", (string)null); - } - - /// - /// Tests BuildItem Contructor with non valid xml name - /// - /// cliffh and jaysh brought this up during dev10 development - [Test] - [ExpectedException(typeof(ArgumentException))] - public void ConstructItemInvalidXml() - { - BuildItem item = new BuildItem("1invalid", "i"); - } - - /// - /// Tests BuildItem Constructor 'public BuildItem(string itemName, string itemInclude)' by attempting to set itemName to all of the Reserved Names - /// - [Test] - public void ConstructItemNameReservedNames() - { - VerifyReservedNamesForBuildItemNameThrowExpectedException(TypeOfTest.ConstructorTest); - } - - /// - /// Tests BuildItem Constructor 'public BuildItem(string itemName, string itemInclude)' by attempting to set itemName with any of the Escape characters - /// - [Test] - public void ContructItemNameEscapableCharacters() - { - VerifyEscapeCharactersThrowExpectedException(TypeOfTest.ConstructorTest); - } - - /// - /// Tests BuildItem Constructor 'public BuildItem(string itemName, string itemInclude)' by setting itemInclude with all of the Escape characters - /// - [Test] - public void ContructItemIncludeEscapableCharacters() - { - BuildItem item = new BuildItem("n", EscapableCharacters); - Assertion.AssertEquals(EscapableCharacters, item.FinalItemSpec); - } - - /// - /// Tests BuildItem Constructor 'public BuildItem(string itemName, ITaskItem taskItem)' with simple strings - /// - [Test] - public void ConstructItemNameTaskItemSimple() - { - MockTaskItem taskItem = new MockTaskItem(); - BuildItem item = new BuildItem("n", taskItem); - - Assertion.AssertEquals("n", item.Name); - Assertion.AssertEquals("i", item.FinalItemSpec); - } - - /// - /// Tests BuildItem Constructor 'public BuildItem(string itemName, ITaskItem taskItem)' by passing in a null ITaskItem - /// - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void ConstructTaskItemNull() - { - ITaskItem taskItem = null; - BuildItem item = new BuildItem("n", taskItem); - } - - /// - /// Tests BuildItem Constructor case that after creating the BuildItem object, HasMetadata - /// will return false because it's not yet evaluated (special note in builditem.cs for this) - /// - [Test] - public void ConstructHasMetadata() - { - BuildItem item = new BuildItem("m", "v"); - - Assertion.AssertEquals(false, item.HasMetadata("m")); - Assertion.AssertEquals(string.Empty, item.GetEvaluatedMetadata("m")); - Assertion.AssertEquals(string.Empty, item.GetMetadata("m")); - Assertion.AssertEquals(builtInMetadataNames.Length, item.MetadataCount); - Assertion.AssertEquals(0, item.CustomMetadataCount); - } - #endregion - - #region Condition Tests - /// - /// Tests BuildItem.Condition Get for basic/simple case - /// - [Test] - public void ConditionGetSimple() - { - string projectContents = @" - - - - - - "; - - project.LoadXml(projectContents); - BuildItem item = GetSpecificBuildItem(project, "n"); - - Assertion.AssertEquals("'a' == 'b'", item.Condition); - } - - /// - /// Tests BuildItem.Condition Get when no condition exists - /// - [Test] - public void ConditionGetWhenNoCondition() - { - project.LoadXml(ProjectContentOneItemGroupWithOneBuildItem); - BuildItem item = GetSpecificBuildItem(project, "n"); - - Assertion.AssertEquals(String.Empty, item.Condition); - } - - /// - /// Tests BuildItem.Condition Get when Condition is an empty string - /// - [Test] - public void ConditionGetEmptyString() - { - string projectContents = @" - - - - - - "; - - project.LoadXml(projectContents); - BuildItem item = GetSpecificBuildItem(project, "n"); - - Assertion.AssertEquals(String.Empty, item.Condition); - } - - /// - /// Tests BuildItem.Condition Get from an imported Project - /// - [Test] - public void ConditionGetFromImportedProject() - { - string importProjectContents = @" - - - - - - "; - - Project p = GetProjectThatImportsAnotherProject(importProjectContents, null); - BuildItem item = GetSpecificBuildItem(p, "nImported"); - - Assertion.AssertEquals("'a' == 'b'", item.Condition); - } - - /// - /// Tests BuildItem.Condition Set when no provious exists - /// - [Test] - public void ConditionSetWhenNoPreviousConditionExists() - { - project.LoadXml(ProjectContentOneItemGroupWithOneBuildItem); - BuildItem item = GetSpecificBuildItem(project, "n"); - item.Condition = "'a' == 'aa'"; - - Assertion.AssertEquals("'a' == 'aa'", item.Condition); - } - - /// - /// Tests BuildItem.Condition Set when an existing condition exists, changing the condition - /// - [Test] - public void ConditionSetOverExistingCondition() - { - project.LoadXml(ProjectContentOneItemGroupWithOneBuildItemWithCondition); - BuildItem item = GetSpecificBuildItem(project, "n"); - item.Condition = "'true' == 't'"; - - Assertion.AssertEquals("'true' == 't'", item.Condition); - } - - /// - /// Tests BuildItem.Condition Set To Empty string - /// - [Test] - public void ConditionSetToEmptyString() - { - project.LoadXml(ProjectContentOneItemGroupWithOneBuildItemWithCondition); - BuildItem item = GetSpecificBuildItem(project, "n"); - item.Condition = String.Empty; - - Assertion.AssertEquals(String.Empty, item.Condition); - } - - /// - /// Tests BuildItem.Condition Set to null - /// - [Test] - public void ConditionSetToNull() - { - project.LoadXml(ProjectContentOneItemGroupWithOneBuildItemWithCondition); - BuildItem item = GetSpecificBuildItem(project, "n"); - item.Condition = null; - - Assertion.AssertEquals(String.Empty, item.Condition); - } - - /// - /// Tests BuildItem.Condition Set to Special Characters - /// - [Test] - public void ConditionSetToSpecialCharacters() - { - project.LoadXml(ProjectContentOneItemGroupWithOneBuildItemWithCondition); - BuildItem item = GetSpecificBuildItem(project, "n"); - item.Condition = SpecialCharacters; - - Assertion.AssertEquals(SpecialCharacters, item.Condition); - } - - /// - /// Tests BuildItem.Condition Set to Escape Characters - /// - [Test] - public void ConditionSetToEscapableCharacters() - { - project.LoadXml(ProjectContentOneItemGroupWithOneBuildItemWithCondition); - BuildItem item = GetSpecificBuildItem(project, "n"); - item.Condition = EscapableCharacters; - - Assertion.AssertEquals(EscapableCharacters, item.Condition); - } - - /// - /// Tests BuildItem.Condition Set on an Imported Project - /// - [Test] - [ExpectedException(typeof(InvalidOperationException))] - public void ConditionSetOnImportedProject() - { - Project p = GetProjectThatImportsAnotherProject(null, null); - BuildItem item = GetSpecificBuildItem(p, "nImported"); - item.Condition = "t"; - } - - /// - /// Tests BuildItem.Condition Set, save to disk and verify - /// - [Test] - public void ConditionSaveProjectAfterSet() - { - project.LoadXml(ProjectContentOneItemGroupWithOneBuildItemWithCondition); - BuildItem item = GetSpecificBuildItem(project, "n"); - item.Condition = "'t' == 'true'"; - - string expectedProjectContents = @" - - - - - - "; - - SaveProjectToDiskAndCompareAgainstExpectedContents(project, expectedProjectContents); - } - #endregion - - #region Include/Exclude Tests - /// - /// Tests BuildItem.Include/Exclude Get for simple case - /// - [Test] - public void IncludeExcludeGetSimple() - { - project.LoadXml(ProjectContentOneItemGroupWithSeveralBuildItemsIncludesExcludes); - BuildItem item = GetSpecificBuildItem(project, "n1"); - - Assertion.AssertEquals("i1", item.Include); - Assertion.AssertEquals("e1", item.Exclude); - } - - /// - /// Tests BuildItem.Include/Exclude Set for simple case - /// - [Test] - public void IncludeExcludeSetSimple() - { - project.LoadXml(ProjectContentOneItemGroupWithSeveralBuildItemsIncludesExcludes); - BuildItem item = GetSpecificBuildItem(project, "n1"); - - item.Include = "newinclude"; - item.Exclude = "newexclude"; - - Assertion.AssertEquals("newinclude", item.Include); - Assertion.AssertEquals("newexclude", item.Exclude); - } - - /// - /// Tests BuildItem.Include/Exclude Get on BuildItem that is from an imported Project - /// - [Test] - public void IncludeExcludeGetFromImportedProject() - { - Project p = GetProjectThatImportsAnotherProject(ProjectContentOneItemGroupWithSeveralBuildItemsIncludesExcludes, null); - BuildItem item = GetSpecificBuildItem(p, "n1"); - - Assertion.AssertEquals("i1", item.Include); - Assertion.AssertEquals("e1", item.Exclude); - } - - /// - /// Tests BuildItem.Include attempt Set for an Imported BuildItem - /// - [Test] - [ExpectedException(typeof(InvalidOperationException))] - public void IncludeSetImportedProject() - { - Project p = GetProjectThatImportsAnotherProject(ProjectContentOneItemGroupWithSeveralBuildItemsIncludesExcludes, null); - BuildItem item = GetSpecificBuildItem(p, "n1"); - - item.Include = "new"; - } - - /// - /// Tests BuildItem.Exclude attempt Set for an Imported Builditem - /// - [Test] - [ExpectedException(typeof(InvalidOperationException))] - public void ExcludeSetImportedProject() - { - Project p = GetProjectThatImportsAnotherProject(ProjectContentOneItemGroupWithSeveralBuildItemsIncludesExcludes, null); - BuildItem item = GetSpecificBuildItem(p, "n1"); - - item.Exclude = "new"; - } - - /// - /// Tests BuildItem.Include/Exclude Set to Empty String - /// - [Test] - public void IncludeExcludeSetToEmptyString() - { - project.LoadXml(ProjectContentOneItemGroupWithSeveralBuildItemsIncludesExcludes); - BuildItem item = GetSpecificBuildItem(project, "n1"); - - item.Include = String.Empty; - item.Exclude = String.Empty; - - Assertion.AssertEquals(String.Empty, item.Include); - Assertion.AssertEquals(String.Empty, item.Exclude); - } - - /// - /// Tests BuildItem.Include attempt to Set to Null - /// - [Test] - [ExpectedException(typeof(ArgumentException))] - public void IncludeSetToNull() - { - project.LoadXml(ProjectContentOneItemGroupWithSeveralBuildItemsIncludesExcludes); - BuildItem item = GetSpecificBuildItem(project, "n1"); - - item.Include = null; - } - - /// - /// Tests BuildItem.Exclude Set to null - /// - [Test] - public void ExcludeSetToNull() - { - project.LoadXml(ProjectContentOneItemGroupWithSeveralBuildItemsIncludesExcludes); - BuildItem item = GetSpecificBuildItem(project, "n1"); - - item.Exclude = null; - - Assertion.AssertEquals(String.Empty, item.Exclude); - } - - /// - /// Tests BuildItem.Exclude Get when No Exclude exists - /// - [Test] - public void ExcludeGetExcludeWhenNoExcludeExists() - { - project.LoadXml(ProjectContentOneItemGroupWithOneBuildItem); - BuildItem item = GetSpecificBuildItem(project, "n"); - - Assertion.AssertEquals(String.Empty, item.Exclude); - } - - /// - /// Tests BuildItem.Include/Exclude Set then save to disk and verify - /// - [Test] - public void IncludeExcludeSaveProjectAfterSet() - { - project.LoadXml(ProjectContentOneItemGroupWithSeveralBuildItemsIncludesExcludes); - BuildItem item = GetSpecificBuildItem(project, "n1"); - item.Include = "newinclude"; - item.Exclude = "newexclude"; - - string expectedProjectContents = @" - - - - - - - - - "; - - SaveProjectToDiskAndCompareAgainstExpectedContents(project, expectedProjectContents); - } - - /// - /// Tests BuildItem.Include/Exclude Set to Special Characters - /// - [Test] - public void IncludeExcludeSetToSpecialCharacters() - { - project.LoadXml(ProjectContentOneItemGroupWithSeveralBuildItemsIncludesExcludes); - BuildItem item = GetSpecificBuildItem(project, "n1"); - item.Include = SpecialCharacters; - item.Exclude = SpecialCharacters; - - Assertion.AssertEquals(SpecialCharacters, item.Include); - Assertion.AssertEquals(SpecialCharacters, item.Exclude); - } - - /// - /// Tests BuildItem.Include/Exclude Set to Escape Characters - /// - [Test] - public void IncludeExcludeSetToEscapableCharacters() - { - project.LoadXml(ProjectContentOneItemGroupWithSeveralBuildItemsIncludesExcludes); - BuildItem item = GetSpecificBuildItem(project, "n1"); - item.Include = EscapableCharacters; - item.Exclude = EscapableCharacters; - - Assertion.AssertEquals(EscapableCharacters, item.Include); - Assertion.AssertEquals(EscapableCharacters, item.Exclude); - } - #endregion - - #region FinalItemSpec Tests - /// - /// Tests BuildItem.FinalItemSpec Get when only one BuildItem exists - /// - [Test] - public void FinalItemSpecGetWhenOnlyOneBuildItem() - { - project.LoadXml(ProjectContentOneItemGroupWithOneBuildItem); - BuildItem item = GetSpecificBuildItem(project, "n"); - - Assertion.AssertEquals("i", item.FinalItemSpec); - } - - /// - /// Tests BuildItem.FinalItemSpec Get when several BuildItems exist - /// - [Test] - public void FinalItemSpecGetWhenMultipleBuildItems() - { - project.LoadXml(ProjectContentOneItemGroupWithSeveralBuildItems); - BuildItem item = GetSpecificBuildItem(project, "n2"); - - Assertion.AssertEquals("i2", item.FinalItemSpec); - } - - /// - /// Tests BuildItem.FinalItemSpec Get of a BuildItem that's from an imported project - /// - [Test] - public void FinalItemSpecFromImportedProject() - { - Project p = GetProjectThatImportsAnotherProject(null, null); - BuildItem item = GetSpecificBuildItem(p, "nImported"); - - Assertion.AssertEquals("iImported", item.FinalItemSpec); - } - #endregion - - #region IsImported Tests - /// - /// Tests BuildItem.IsImported when BuildItem does come from an imported project - /// - [Test] - public void IsImportedExpectedTrue() - { - Project p = GetProjectThatImportsAnotherProject(null, null); - BuildItem item = GetSpecificBuildItem(p, "nImported"); - - Assertion.AssertEquals(true, item.IsImported); - } - - /// - /// Tests BuildItem.IsImported when BuildItem does not come from an imported project - /// and no projects are imported. - /// - [Test] - public void IsImportedExpectedFalseNoImportsExist() - { - project.LoadXml(ProjectContentOneItemGroupWithOneBuildItem); - BuildItem item = GetSpecificBuildItem(project, "n"); - - Assertion.AssertEquals(false, item.IsImported); - } - - /// - /// Tests BuildItem.IsImported when specific BuildItem does not come from an imported project - /// but others are imported. - /// - [Test] - public void IsImportedExpectedFalseImportsDoExist() - { - Project p = GetProjectThatImportsAnotherProject(null, null); - BuildItem item = GetSpecificBuildItem(p, "nMain"); - - Assertion.AssertEquals(false, item.IsImported); - } - - /// - /// Tests BuildItem.IsImported when all we have is an in memory BuildItem - /// - [Test] - public void IsImportedInMemoryBuildItem() - { - BuildItem item = new BuildItem("n", "i"); - Assertion.AssertEquals(false, item.IsImported); - } - #endregion - - #region Name Tests - /// - /// Tests BuildItem.Name Set itemName to null - /// - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void NameSetToNull() - { - BuildItem item = new BuildItem("n", "i"); - item.Name = null; - } - - /// - /// Tests BuildItem.Name Get when itemName is set to null. - /// Verifying that Microsoft.Build.BuildEngine.Shared.InternalErrorException is thrown - /// - [Test] - public void NameGetWhenNull() - { - BuildItemNameGetSetNullExpectedToThrow(new BuildItem((string)null, "i"), false); - } - - /// - /// Tests BuildItem.Name Set to null when it's been initialized to null - /// Verifying that Microsoft.Build.BuildEngine.Shared.InternalErrorException is thrown - /// - [Test] - public void NameSetToNullAfterInitializingToNull() - { - BuildItemNameGetSetNullExpectedToThrow(new BuildItem((string)null, "i"), true); - } - - /// - /// Tests BuildItem.Name Attempting to Set to all of the Reserved Names - /// - [Test] - public void NameSetReservedNames() - { - VerifyReservedNamesForBuildItemNameThrowExpectedException(TypeOfTest.SetNameTest); - } - - /// - /// Tests BuildItem.Name Get when only one BuildItem exists - /// - [Test] - public void NameGetWithOneBuildItem() - { - project.LoadXml(ProjectContentOneItemGroupWithOneBuildItem); - BuildItem item = GetSpecificBuildItem(project, "n"); - - Assertion.AssertEquals("n", item.Name); - } - - /// - /// Tests BuildItem.Name when many BuildItems exist - /// - [Test] - public void NameGetWithManyBuildItems() - { - project.LoadXml(ProjectContentOneItemGroupWithSeveralBuildItems); - BuildItem item = GetSpecificBuildItem(project, "n2"); - - Assertion.AssertEquals("n2", item.Name); - } - - /// - /// Tests BuildItem.Name Set when only one BuildItem exists - /// - [Test] - public void NameSetWithOneBuildItem() - { - project.LoadXml(ProjectContentOneItemGroupWithOneBuildItem); - BuildItem item = GetSpecificBuildItem(project, "n"); - item.Name = "new"; - - Assertion.AssertEquals("new", item.Name); - } - - /// - /// Tests BuildItem.Name Set, save to disk and verify - /// - [Test] - public void NameSaveProjectAfterSet() - { - project.LoadXml(ProjectContentOneItemGroupWithOneBuildItem); - BuildItem item = GetSpecificBuildItem(project, "n"); - item.Name = "new"; - - string expectedProjectContents = @" - - - - - - "; - - SaveProjectToDiskAndCompareAgainstExpectedContents(project, expectedProjectContents); - } - - /// - /// Tests BuildItem.Name Get from an imported project - /// - [Test] - public void NameGetFromImportedProject() - { - Project p = GetProjectThatImportsAnotherProject(null, null); - BuildItem item = GetSpecificBuildItem(p, "nImported"); - - Assertion.AssertEquals("nImported", item.Name); - } - - /// - /// Tests BuildItem.Name Set on an imported Project - /// - [Test] - [ExpectedException(typeof(InvalidOperationException))] - public void NameSetFromImportedProject() - { - Project p = GetProjectThatImportsAnotherProject(null, null); - BuildItem item = GetSpecificBuildItem(p, "nImported"); - item.Name = "new"; - } - #endregion - - #region CustomMetadataCount & CustomMetadataNames Tests - /// - /// Tests BuildItem.CustomMetadataCount/CustomMetadataNames when some custom metadata exists - /// - [Test] - public void CustomMetadataCountNamesWithCustomMetadata() - { - project.LoadXml(ProjectContentOneItemGroupOneBuildItemWithCustomMetadata); - BuildItem item = GetSpecificBuildItem(project, "n"); - List list = (List)item.CustomMetadataNames; - - Assertion.AssertEquals(3, item.CustomMetadataCount); - Assertion.AssertEquals(true, list.Contains("a_Meta")); - Assertion.AssertEquals(true, list.Contains("b_Meta")); - Assertion.AssertEquals(true, list.Contains("c_Meta")); - VerifyBuiltInMetadataNamesExistOrNot(list, false); - } - - /// - /// Tests BuildItem.CustomMetadataCount/CustomMetadataNames when no custom metadata exists - /// - [Test] - public void CustomMetadataCountNamesWithNoCustomMetadata() - { - project.LoadXml(ProjectContentOneItemGroupWithOneBuildItem); - BuildItem item = GetSpecificBuildItem(project, "n"); - List list = (List)item.CustomMetadataNames; - - Assertion.AssertEquals(0, item.CustomMetadataCount); - Assertion.AssertEquals(0, list.Count); - } - - /// - /// Tests BuildItem.CustomMetadataCount/CustomMetadataNames when all Custom Metadata - /// comes only from an imported project. - /// - [Test] - public void CustomMetadataCountNamesWhenComingOnlyFromImportedProject() - { - string importProjectContents = @" - - - - ImportedMetaValue - - - - "; - - Project p = GetProjectThatImportsAnotherProject(importProjectContents, null); - - BuildItem itemImport = GetSpecificBuildItem(p, "nImported"); - List listImport = (List)itemImport.CustomMetadataNames; - Assertion.AssertEquals(1, itemImport.CustomMetadataCount); - Assertion.AssertEquals(true, listImport.Contains("ImportedMeta")); - VerifyBuiltInMetadataNamesExistOrNot(listImport, false); - - BuildItem itemParent = GetSpecificBuildItem(p, "nMain"); - List listParent = (List)itemParent.CustomMetadataNames; - Assertion.AssertEquals(0, itemParent.CustomMetadataCount); - VerifyBuiltInMetadataNamesExistOrNot(listParent, false); - } - - /// - /// Tests BuildItem.CustomMetadataCount/CustomMetadataNames when all Custom Metadata - /// comes only from the parent project, when a project is imported. - /// - [Test] - public void CustomMetadataCountNamesWhenComingOnlyFromParentProjectNoneFromImport() - { - string parentProjectContents = @" - - - - MainMetaValue - - - - - "; - - Project p = GetProjectThatImportsAnotherProject(null, parentProjectContents); - - BuildItem itemImport = GetSpecificBuildItem(p, "nImported"); - List listImport = (List)itemImport.CustomMetadataNames; - Assertion.AssertEquals(0, itemImport.CustomMetadataCount); - VerifyBuiltInMetadataNamesExistOrNot(listImport, false); - - BuildItem itemParent = GetSpecificBuildItem(p, "nMain"); - List listParent = (List)itemParent.CustomMetadataNames; - Assertion.AssertEquals(1, itemParent.CustomMetadataCount); - Assertion.AssertEquals(true, listParent.Contains("MainMeta")); - VerifyBuiltInMetadataNamesExistOrNot(listParent, false); - } - - /// - /// Tests BuildItem.CustomMetadataCount/CustomMetadataNames when all Custom Metadata - /// comes from both the parent project and an imported project. - /// - [Test] - public void CustomMetadataCountNamesWhenComingFromBothParentAndImportedProject() - { - string importProjectContents = @" - - - - ImportedMetaValue - - - - "; - - string parentProjectContents = @" - - - - MainMetaValue - - - - - "; - - Project p = GetProjectThatImportsAnotherProject(importProjectContents, parentProjectContents); - - BuildItem itemImport = GetSpecificBuildItem(p, "nImported"); - List listImport = (List)itemImport.CustomMetadataNames; - Assertion.AssertEquals(1, itemImport.CustomMetadataCount); - Assertion.AssertEquals(true, listImport.Contains("ImportedMeta")); - VerifyBuiltInMetadataNamesExistOrNot(listImport, false); - - BuildItem itemParent = GetSpecificBuildItem(p, "nMain"); - List listParent = (List)itemParent.CustomMetadataNames; - Assertion.AssertEquals(1, itemParent.CustomMetadataCount); - Assertion.AssertEquals(true, listParent.Contains("MainMeta")); - VerifyBuiltInMetadataNamesExistOrNot(listParent, false); - } - - /// - /// Tests BuildItem.CustomMetadataCount/CustomMetadataNames when no Custom Metadata - /// comes from the parent project or the imported project. - /// - [Test] - public void CustomMetadataCountNamesWhenNoneInBothParentAndImportedProject() - { - Project p = GetProjectThatImportsAnotherProject(null, null); - - BuildItem itemImport = GetSpecificBuildItem(p, "nImported"); - List listImport = (List)itemImport.CustomMetadataNames; - Assertion.AssertEquals(0, itemImport.CustomMetadataCount); - VerifyBuiltInMetadataNamesExistOrNot(listImport, false); - - BuildItem itemParent = GetSpecificBuildItem(p, "nMain"); - List listParent = (List)itemParent.CustomMetadataNames; - Assertion.AssertEquals(0, itemParent.CustomMetadataCount); - VerifyBuiltInMetadataNamesExistOrNot(listParent, false); - } - #endregion - - #region MetadataCount & MetadataNames Tests - /// - /// Tests BuildItem.MetadataCount/MetadataNames when some custom Metadata exists - /// - [Test] - public void MetadataCountNamesWithCustomMetadata() - { - string projectContents = @" - - - - a - b - c - - - - "; - - project.LoadXml(projectContents); - BuildItem item = GetSpecificBuildItem(project, "n"); - List list = (List)item.MetadataNames; - - Assertion.AssertEquals(builtInMetadataNames.Length + 3, item.MetadataCount); - Assertion.AssertEquals(true, list.Contains("a_Meta")); - Assertion.AssertEquals(true, list.Contains("b_Meta")); - Assertion.AssertEquals(true, list.Contains("c_Meta")); - VerifyBuiltInMetadataNamesExistOrNot(list, true); - } - - /// - /// Tests BuildItem.MetadataCount/MetadataNames when no custom Metadata exists - /// - [Test] - public void MetadataCountNamesWithNoCustomMetadata() - { - project.LoadXml(ProjectContentOneItemGroupWithOneBuildItem); - BuildItem item = GetSpecificBuildItem(project, "n"); - List list = (List)item.MetadataNames; - - Assertion.AssertEquals(builtInMetadataNames.Length, item.MetadataCount); - VerifyBuiltInMetadataNamesExistOrNot(list, true); - } - - /// - /// Tests BuildItem.MetadataCount/MetadataNames if an Imported project with no custom Metadata - /// - [Test] - public void MetadataCountNamesFromImportedProjectNoCustomMetadata() - { - Project p = GetProjectThatImportsAnotherProject(null, null); - - BuildItem itemImport = GetSpecificBuildItem(p, "nImported"); - List listImport = (List)itemImport.MetadataNames; - Assertion.AssertEquals(builtInMetadataNames.Length, itemImport.MetadataCount); - VerifyBuiltInMetadataNamesExistOrNot(listImport, true); - - BuildItem itemParent = GetSpecificBuildItem(p, "nMain"); - List listParent = (List)itemParent.MetadataNames; - Assertion.AssertEquals(builtInMetadataNames.Length, itemParent.MetadataCount); - VerifyBuiltInMetadataNamesExistOrNot(listParent, true); - } - - /// - /// Tests BuildItem.MetadataCount/MetadataNames if an Imported project with custom Metadata - /// - [Test] - public void MetadataCountNamesFromImportedProjectWithCustomMetadata() - { - string importProjectContents = @" - - - - ImportedMetaValue - - - - "; - - Project p = GetProjectThatImportsAnotherProject(importProjectContents, null); - - BuildItem itemImport = GetSpecificBuildItem(p, "nImported"); - List listImport = (List)itemImport.MetadataNames; - Assertion.AssertEquals(true, listImport.Contains("ImportedMeta")); - Assertion.AssertEquals(builtInMetadataNames.Length + 1, itemImport.MetadataCount); - VerifyBuiltInMetadataNamesExistOrNot(listImport, true); - - BuildItem itemParent = GetSpecificBuildItem(p, "nMain"); - List listParent = (List)itemParent.MetadataNames; - Assertion.AssertEquals(builtInMetadataNames.Length, itemParent.MetadataCount); - VerifyBuiltInMetadataNamesExistOrNot(listParent, true); - } - #endregion - - #region CopyCustomMetadataTo Tests - /// - /// Tests BuildItem.CopyCustomMetadataTo a BuildItem that doesn't contain any Custom Metadata - /// - [Test] - public void CopyCustomMetadataToBuildItemWithNoCustomMetadata() - { - project.LoadXml(ProjectContentOneItemGroupOneBuildItemWithCustomMetadata); - BuildItem itemFrom = GetSpecificBuildItem(project, "n"); - BuildItem itemTo = new BuildItem("otherN", "otherI"); - itemFrom.CopyCustomMetadataTo(itemTo); - - List listOther = (List)itemTo.CustomMetadataNames; - Assertion.AssertEquals(3, itemTo.CustomMetadataCount); - Assertion.AssertEquals(true, listOther.Contains("a_Meta")); - Assertion.AssertEquals(true, listOther.Contains("b_Meta")); - Assertion.AssertEquals(true, listOther.Contains("c_Meta")); - } - - /// - /// Tests BuildItem.CopyCustomMetadataTo a null BuildItem - /// - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void CopyCustomMetadataToNullBuildItem() - { - project.LoadXml(ProjectContentOneItemGroupOneBuildItemWithCustomMetadata); - BuildItem item = GetSpecificBuildItem(project, "n"); - BuildItem itemOther = null; - - item.CopyCustomMetadataTo(itemOther); - } - - /// - /// Tests BuildItem.CopyCustomMetadataTo by copying to self - /// - [Test] - public void CopyCustomMetadataToSelf() - { - project.LoadXml(ProjectContentOneItemGroupOneBuildItemWithCustomMetadata); - BuildItem item = GetSpecificBuildItem(project, "n"); - item.CopyCustomMetadataTo(item); - - List list = (List)item.CustomMetadataNames; - Assertion.AssertEquals(3, item.CustomMetadataCount); - Assertion.AssertEquals(true, list.Contains("a_Meta")); - Assertion.AssertEquals(true, list.Contains("b_Meta")); - Assertion.AssertEquals(true, list.Contains("c_Meta")); - } - - /// - /// Tests BuildItem.CopyCustomMetadataTo Another BuildItem within the same project - /// that doesn't contain any Custom Metadata. - /// - [Test] - public void CopyCustomMetadataToAnotherBuildItemWithNoCustomMetadataInSameProject() - { - string projectContents = @" - - - - a - b - - - - - "; - - project.LoadXml(projectContents); - BuildItem itemFrom = GetSpecificBuildItem(project, "n1"); - BuildItem itemTo = GetSpecificBuildItem(project, "n2"); - itemFrom.CopyCustomMetadataTo(itemTo); - - List list = (List)itemTo.CustomMetadataNames; - Assertion.AssertEquals(2, itemTo.CustomMetadataCount); - Assertion.AssertEquals(true, list.Contains("a_Meta")); - Assertion.AssertEquals(true, list.Contains("b_Meta")); - } - - /// - /// Tests BuildItem.CopyCustomMetadataTo Another BuildItem that contains different - /// Custom Metadata. - /// - [Test] - public void CopyCustomMetadataToAntherBuildItemWithAllOtherDifferentCustomMetadata() - { - string projectContents = @" - - - - a - b - - - c - d - - - - "; - - project.LoadXml(projectContents); - BuildItem itemFrom = GetSpecificBuildItem(project, "n1"); - BuildItem itemTo = GetSpecificBuildItem(project, "n2"); - itemFrom.CopyCustomMetadataTo(itemTo); - - List list = (List)itemTo.CustomMetadataNames; - Assertion.AssertEquals(4, itemTo.CustomMetadataCount); - Assertion.AssertEquals(true, list.Contains("a_Meta")); - Assertion.AssertEquals(true, list.Contains("b_Meta")); - Assertion.AssertEquals(true, list.Contains("c_Meta")); - Assertion.AssertEquals(true, list.Contains("d_Meta")); - } - - /// - /// Tests BuildItem.CopyCustomMetadataTo Another BuildItem that contains the same - /// Custom Metadata. - /// - [Test] - public void CopyCustomMetadataToAnotherBuildItemWithAllOtherSameCustomMetadata() - { - string projectContents = @" - - - - a - b - - - a - other - - - - "; - - project.LoadXml(projectContents); - BuildItem itemFrom = GetSpecificBuildItem(project, "n1"); - BuildItem itemTo = GetSpecificBuildItem(project, "n2"); - itemFrom.CopyCustomMetadataTo(itemTo); - - List list = (List)itemTo.CustomMetadataNames; - Assertion.AssertEquals(2, itemTo.CustomMetadataCount); - Assertion.AssertEquals(true, list.Contains("a_Meta")); - Assertion.AssertEquals(true, list.Contains("b_Meta")); - Assertion.AssertEquals("a", itemTo.GetMetadata("a_Meta")); - Assertion.AssertEquals("b", itemTo.GetMetadata("b_Meta")); - } - - /// - /// Tests BuildItem.CopyCustomMetadataTo Another BuildItem that contains some of the - /// same Custom Metadata and some different. - /// - [Test] - public void CopyCustomMetadataToAnotherBuildItemWithSomeOtherSameCustomMetadata() - { - string projectContents = @" - - - - a - b - c - d - - - b - c - e - f - - - - "; - - project.LoadXml(projectContents); - BuildItem itemFrom = GetSpecificBuildItem(project, "n1"); - BuildItem itemTo = GetSpecificBuildItem(project, "n2"); - itemFrom.CopyCustomMetadataTo(itemTo); - - List list = (List)itemTo.CustomMetadataNames; - Assertion.AssertEquals(6, itemTo.CustomMetadataCount); - Assertion.AssertEquals(true, list.Contains("a_Meta")); - Assertion.AssertEquals(true, list.Contains("b_Meta")); - Assertion.AssertEquals(true, list.Contains("c_Meta")); - Assertion.AssertEquals(true, list.Contains("d_Meta")); - Assertion.AssertEquals(true, list.Contains("e_Meta")); - Assertion.AssertEquals(true, list.Contains("f_Meta")); - } - - /// - /// Tests BuildItem.CopyCustomMetadataTo Another BuildItem that is not Imported, from - /// a BuildItem that is Imported. - /// - [Test] - public void CopyCustomMetadataToNonImportedBuildItemFromAnImportedBuildItem() - { - string importProjectContents = @" - - - - ImportedMetaValue - - - - "; - - string parentProjectContents = @" - - - - MainMetaValue - - - - - "; - - Project p = GetProjectThatImportsAnotherProject(importProjectContents, parentProjectContents); - BuildItem itemFrom = GetSpecificBuildItem(p, "nImported"); - BuildItem itemTo = GetSpecificBuildItem(p, "nMain"); - itemFrom.CopyCustomMetadataTo(itemTo); - - List list = (List)itemTo.CustomMetadataNames; - Assertion.AssertEquals(2, itemTo.CustomMetadataCount); - Assertion.AssertEquals(true, list.Contains("MainMeta")); - Assertion.AssertEquals(true, list.Contains("ImportedMeta")); - } - - /// - /// Tests BuildItem.CopyCustomMetadataTo A BuildItem that is Imported. - /// - [Test] - [ExpectedException(typeof(InvalidOperationException))] - public void CopyCustomMetadataToImportedBuildItem() - { - string importProjectContents = @" - - - - ImportedMetaValue - - - - "; - - string parentProjectContents = @" - - - - MainMetaValue - - - - - "; - - Project p = GetProjectThatImportsAnotherProject(importProjectContents, parentProjectContents); - BuildItem itemFrom = GetSpecificBuildItem(p, "nMain"); - BuildItem itemTo = GetSpecificBuildItem(p, "nImported"); - - itemFrom.CopyCustomMetadataTo(itemTo); - } - - /// - /// Tests BuildItem.CopyCustomMetadataTo - /// - [Test] - public void CopyCustomMetadataToAnotherBuildItemThenSaveToDisk() - { - string projectContents = @" - - - - a - b - - - c - - - - "; - - project.LoadXml(projectContents); - BuildItem itemFrom = GetSpecificBuildItem(project, "n1"); - BuildItem itemTo = GetSpecificBuildItem(project, "n2"); - itemFrom.CopyCustomMetadataTo(itemTo); - - string expectedProjectContents = @" - - - - a - b - - - c - a - b - - - - "; - - SaveProjectToDiskAndCompareAgainstExpectedContents(project, expectedProjectContents); - } - #endregion - - #region GetEvaluatedMetadata Tests - /// - /// Tests BuildItem.GetEvaluatedMetadata basic cases - /// - [Test] - public void GetEvaluatedMetadataSimple() - { - string projectContents = @" - - - - v - $(p) - - - - -

p1

-
-
- "; - - project.LoadXml(projectContents); - BuildItem item = GetSpecificBuildItem(project, "n"); - - Assertion.AssertEquals("v", item.GetEvaluatedMetadata("m1")); - Assertion.AssertEquals("$(p)", item.GetMetadata("m2")); - Assertion.AssertEquals("p1", item.GetEvaluatedMetadata("m2")); - Assertion.AssertEquals(String.Empty, item.GetEvaluatedMetadata("m3")); - } - - /// - /// Tests BuildItem.GetEvaluatedMetadata when BuildItem comes from an imported project - /// - [Test] - public void GetEvaluatedMetadataFromImportedProject() - { - string importProjectContents = @" - - - - v - $(p) - - - - "; - - string parentProjectContents = @" - - - - - - -

p1

-
-
- "; - - Project p = GetProjectThatImportsAnotherProject(importProjectContents, parentProjectContents); - BuildItem item = GetSpecificBuildItem(p, "nImported"); - - Assertion.AssertEquals("$(p)", item.GetMetadata("m2")); - Assertion.AssertEquals("p1", item.GetEvaluatedMetadata("m2")); - } - - /// - /// Tests BuildItem.GetEvaluatedMetadata when no property group exists to actually evaluate the Metadata against - /// - [Test] - public void GetEvaluatedMetadataNoPropertyToEvaluateAgainst() - { - string projectContents = @" - - - - $(p) - - - - "; - - project.LoadXml(projectContents); - BuildItem item = GetSpecificBuildItem(project, "n"); - - Assertion.AssertEquals(String.Empty, item.GetEvaluatedMetadata("m")); - } - #endregion - - #region GetMetadata Tests - /// - /// Tests BuildItem.GetMetadata simple/basic case - /// - [Test] - public void GetMetadataSimple() - { - project.LoadXml(ProjectContentOneItemGroupOneBuildItemOneMetadata); - BuildItem item = GetSpecificBuildItem(project, "n"); - - Assertion.AssertEquals("value", item.GetMetadata("Meta")); - } - - /// - /// Tests BuildItem.GetMetadata when Metadata Value is an empty string - /// - [Test] - public void GetMetadataWhenValueIsEmptyString() - { - string projectContent = @" - - - - - - - - "; - - project.LoadXml(projectContent); - BuildItem item = GetSpecificBuildItem(project, "n"); - - Assertion.AssertEquals("", item.GetMetadata("Meta")); - } - - /// - /// Tests BuildItem.GetMetadata when Metadate Value contains Special Characters - /// - [Test] - public void GetMetadataWhenValueContainsSpecialCharacters() - { - string projectContent = @" - - - - %24%40%3b%5c%25 - - - - "; - - project.LoadXml(projectContent); - BuildItem item = GetSpecificBuildItem(project, "n"); - - Assertion.AssertEquals(SpecialCharacters, item.GetMetadata("Meta")); - } - - /// - /// Tests BuildItem.GetMetadata when Metadata Value contains Escape Characters - /// - [Test] - public void GetMetadataWhenValueContainsEscapableCharacters() - { - string projectContent = @" - - - - %*?@$();\ - - - - "; - - project.LoadXml(projectContent); - BuildItem item = GetSpecificBuildItem(project, "n"); - - Assertion.AssertEquals(EscapableCharacters, item.GetMetadata("Meta")); - } - - /// - /// Tests BuildItem.GetMetadata when Metadata comes from an imported Project - /// - [Test] - public void GetMetadataWhenMetadataImportedProject() - { - string importProjectContents = @" - - - - ImportedMetaValue - - - - "; - - Project p = GetProjectThatImportsAnotherProject(importProjectContents, null); - BuildItem item = GetSpecificBuildItem(p, "nImported"); - - Assertion.AssertEquals("ImportedMetaValue", item.GetMetadata("ImportedMeta")); - } - - /// - /// Tests BuildItem.GetMetadata of a non-existing Metadata - /// - [Test] - public void GetMetadataOfMetadataThatDoesNotExist() - { - project.LoadXml(ProjectContentOneItemGroupOneBuildItemOneMetadata); - BuildItem item = GetSpecificBuildItem(project, "n"); - - Assertion.AssertEquals(String.Empty, item.GetMetadata("Not")); - } - - /// - /// Tests BuildItem.GetMetadata of a Built-In Metadata - /// - [Test] - public void GetMetadataFromBuiltInMetadata() - { - project.LoadXml(ProjectContentOneItemGroupOneBuildItemOneMetadata); - BuildItem item = GetSpecificBuildItem(project, "n"); - - Assertion.AssertEquals("i", item.GetMetadata(builtInMetadataNames[2])); - } - #endregion - - #region HasMetadata Tests - /// - /// Tests BuildItem.HasMetadata when BuildItem has custom Metadata - /// - [Test] - public void HasMetadataOnCustomMetadata() - { - project.LoadXml(ProjectContentOneItemGroupOneBuildItemWithCustomMetadata); - BuildItem item = GetSpecificBuildItem(project, "n"); - - Assertion.AssertEquals(true, item.HasMetadata("a_Meta")); - VerifyHasMetaDataOnBuiltInMetadata(item); - } - - /// - /// Tests BuildItem.HasMetadata when BuildItem only has Built in Metadata item (no custom) - /// - [Test] - public void HasMetadataOnBuiltInMetadataWithNoCustomMetadata() - { - project.LoadXml(ProjectContentOneItemGroupWithOneBuildItem); - BuildItem item = GetSpecificBuildItem(project, "n"); - VerifyHasMetaDataOnBuiltInMetadata(item); - } - - /// - /// Tests BuildItem.HasMetadata on Metadata that doesn't actually exist - /// - [Test] - public void HasMetadataOnNonExistingMetadata() - { - project.LoadXml(ProjectContentOneItemGroupWithOneBuildItem); - BuildItem item = GetSpecificBuildItem(project, "n"); - - Assertion.AssertEquals(false, item.HasMetadata("not")); - } - - /// - /// Tests BuildItem.HasMetadata on custom Metadata that has no value - /// - [Test] - public void HasMetadataOnCustomMetadataWithNoValue() - { - string projectContent = @" - - - - - - - - "; - - project.LoadXml(projectContent); - BuildItem item = GetSpecificBuildItem(project, "n"); - - Assertion.AssertEquals(true, item.HasMetadata("Meta")); - } - - /// - /// Tests BuildItem.HasMetadata on built in Metadata from an imported project - /// - [Test] - public void HasMetadataFromImportedProject() - { - string importProjectContent = @" - - - - - - - - "; - Project p = GetProjectThatImportsAnotherProject(importProjectContent, null); - BuildItem item = GetSpecificBuildItem(p, "n"); - - Assertion.AssertEquals(true, item.HasMetadata("Meta")); - VerifyHasMetaDataOnBuiltInMetadata(item); - } - #endregion - - #region RemoveMetadata Tests - /// - /// Tests BuildItem.RemoveMetadata for simple/basic case - /// - [Test] - public void RemoveMetadataSimple() - { - project.LoadXml(ProjectContentOneItemGroupOneBuildItemOneMetadata); - BuildItem item = GetSpecificBuildItem(project, "n"); - item.RemoveMetadata("Meta"); - - Assertion.AssertEquals(false, item.HasMetadata("Meta")); - } - - /// - /// Tests BuildItem.RemoveMetadata of a non existing Metadata, verify no exceptions are thrown. - /// - [Test] - public void RemoveMetadataOfNonExistingMetadata() - { - project.LoadXml(ProjectContentOneItemGroupOneBuildItemOneMetadata); - BuildItem item = GetSpecificBuildItem(project, "n"); - item.RemoveMetadata("Not"); - - Assertion.AssertEquals(false, item.HasMetadata("Not")); - Assertion.AssertEquals("value", item.GetMetadata("Meta")); - } - - /// - /// Tests BuildItem.RemoveMetadata of all built in Metadata, expected to fail - /// - [Test] - public void RemoveMetadataOfBuiltInMetadata() - { - project.LoadXml(ProjectContentOneItemGroupOneBuildItemOneMetadata); - BuildItem item = GetSpecificBuildItem(project, "n"); - - foreach (string s in builtInMetadataNames) - { - try - { - item.RemoveMetadata(s); - Assertion.Fail(String.Format("Built In Metadata '{0}' didn't throw the expected ArgumentException", s)); - } - catch (ArgumentException expected) - { - Assertion.AssertEquals(true, expected.Message.Contains(s)); - } - } - } - - /// - /// Tests BuildItem.RemoveMetadata of an imported Metadata, expected to fail - /// - [Test] - [ExpectedException(typeof(InvalidOperationException))] - public void RemoveMetadataFromImportedMetadata() - { - string importProjectContents = @" - - - - ImportedMetaValue - - - - "; - - Project p = GetProjectThatImportsAnotherProject(importProjectContents, null); - BuildItem item = GetSpecificBuildItem(p, "nImported"); - - item.RemoveMetadata("ImportedMeta"); - } - - /// - /// Tests BuildItem.RemoveMetadata after removal of metadata, save to disk and verify - /// - [Test] - public void RemoveMetadataSaveToDiskAndVerify() - { - project.LoadXml(ProjectContentOneItemGroupOneBuildItemOneMetadata); - BuildItem item = GetSpecificBuildItem(project, "n"); - item.RemoveMetadata("Meta"); - - string expectedProjectContents = @" - - - - - - - "; - - SaveProjectToDiskAndCompareAgainstExpectedContents(project, expectedProjectContents); - } - #endregion - - #region SetMetadata Tests - /// - /// Tests BuildItem.SetMetadata simple/basic case - /// - [Test] - public void SetMetadataSimple() - { - BuildItem item = new BuildItem("n", "i"); - item.SetMetadata("m", "v"); - - Assertion.AssertEquals(true, item.HasMetadata("m")); - Assertion.AssertEquals("v", item.GetMetadata("m")); - } - - /// - /// Tests BuildItem.SetMetadata on non-existing metadata (create new metadata) - /// - [Test] - public void SetMetadataOnNonExistingMetadata() - { - project.LoadXml(ProjectContentOneItemGroupOneBuildItemOneMetadata); - BuildItem item = GetSpecificBuildItem(project, "n"); - item.SetMetadata("m", "v"); - - Assertion.AssertEquals(true, item.HasMetadata("m")); - Assertion.AssertEquals("v", item.GetMetadata("m")); - } - - /// - /// Tests BuildItem.SetMetadata on an existing metadata (change metadata) - /// - [Test] - public void SetMetadataOnExistingMetadata() - { - project.LoadXml(ProjectContentOneItemGroupOneBuildItemOneMetadata); - BuildItem item = GetSpecificBuildItem(project, "n"); - item.SetMetadata("Meta", "v"); - - Assertion.AssertEquals("v", item.GetMetadata("Meta")); - } - - /// - /// Tests BuildItem.SetMetadata setting the metadata name to an empty string - /// - [Test] - [ExpectedException(typeof(ArgumentException))] - public void SetMetadataNameToEmptyString() - { - project.LoadXml(ProjectContentOneItemGroupOneBuildItemOneMetadata); - BuildItem item = GetSpecificBuildItem(project, "n"); - item.SetMetadata(String.Empty, "v"); - } - - /// - /// Tests BuildItem.SetMetadata setting the metadata value to an empty string - /// - [Test] - public void SetMetadataValueToEmptyString() - { - project.LoadXml(ProjectContentOneItemGroupOneBuildItemOneMetadata); - BuildItem item = GetSpecificBuildItem(project, "n"); - item.SetMetadata("m", String.Empty); - - Assertion.AssertEquals(true, item.HasMetadata("m")); - Assertion.AssertEquals(String.Empty, item.GetMetadata("m")); - } - - /// - /// Tests BuildItem.SetMetadata setting the metadata name to null - /// - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void SetMetadataNameToNull() - { - project.LoadXml(ProjectContentOneItemGroupOneBuildItemOneMetadata); - BuildItem item = GetSpecificBuildItem(project, "n"); - item.SetMetadata(null, "v"); - } - - /// - /// Tests BuildItem.SetMetadata setting the metadata value to null - /// - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void SetMetadataValueToNull() - { - project.LoadXml(ProjectContentOneItemGroupOneBuildItemOneMetadata); - BuildItem item = GetSpecificBuildItem(project, "n"); - item.SetMetadata("m", null); - } - - /// - /// Tests BuildItem.SetMetadata on an Imported Project - /// - [Test] - [ExpectedException(typeof(InvalidOperationException))] - public void SetMetadataOnImportedProject() - { - string importProjectContents = @" - - - - ImportedMetaValue - - - - "; - - Project p = GetProjectThatImportsAnotherProject(importProjectContents, null); - BuildItem item = GetSpecificBuildItem(p, "nImported"); - item.SetMetadata("m", "v"); - } - - /// - /// Tests BuildItem.SetMetadata Name with special characters - /// - [Test] - [ExpectedException(typeof(ArgumentException))] - public void SetMetadataNameWithSpecialCharacters() - { - project.LoadXml(ProjectContentOneItemGroupOneBuildItemOneMetadata); - BuildItem item = GetSpecificBuildItem(project, "n"); - item.SetMetadata(SpecialCharacters, "v"); - } - - /// - /// Tests BuildItem.SetMetadata Name with Reserved Name - /// - [Test] - public void SetMetadataNameWithReservedName() - { - VerifyReservedNamesForBuildItemNameThrowExpectedException(TypeOfTest.SetMetadataTest); - } - - /// - /// Tests BuildItem.SetMetadata Name with Escape Characters - /// - [Test] - public void SetMetadataNameWithEscapableCharacters() - { - VerifyEscapeCharactersThrowExpectedException(TypeOfTest.SetMetadataTest); - } - - /// - /// Tests BuildItem.SetMetadata Value with Escape Characters - /// - [Test] - public void SetMetadataValueWithEscapableCharacters() - { - project.LoadXml(ProjectContentOneItemGroupOneBuildItemOneMetadata); - BuildItem item = GetSpecificBuildItem(project, "n"); - item.SetMetadata("m", EscapableCharacters); - - Assertion.AssertEquals(true, item.HasMetadata("m")); - Assertion.AssertEquals(EscapableCharacters, item.GetMetadata("m")); - } - - /// - /// Tests BuildItem.SetMetadata, Save to disk and verify - /// - [Test] - public void SetMetadataSaveToDisk() - { - project.LoadXml(ProjectContentOneItemGroupOneBuildItemOneMetadata); - BuildItem item = GetSpecificBuildItem(project, "n"); - item.SetMetadata("Meta", "new"); - item.SetMetadata("m", "v"); - - string expectedProjectContents = @" - - - - new - v - - - - "; - - SaveProjectToDiskAndCompareAgainstExpectedContents(project, expectedProjectContents); - } - - /// - /// Tests BuildItem.SetMetadata TreatMetadataValueAsLiteral True/False - /// - [Test] - public void SetMetadataTreatMetadataValueAsLiteral() - { - project.LoadXml(ProjectContentOneItemGroupOneBuildItemOneMetadata); - BuildItem item = GetSpecificBuildItem(project, "n"); - item.SetMetadata("m1", @"%*?@$();\", true); - item.SetMetadata("m2", @"%*?@$();\", false); - - Assertion.AssertEquals(@"%25%2a%3f%40%24%28%29%3b\", item.GetMetadata("m1")); - Assertion.AssertEquals(@"%*?@$();\", item.GetMetadata("m2")); - } - #endregion - - #region Clone Tests - /// - /// Tests BuildItem.Clone for a BuildItem that's backed by XML - /// - [Test] - public void CloneBackedByXml() - { - string projectContents = @" - - - - value - - - - "; - - project.LoadXml(projectContents); - BuildItem item = GetSpecificBuildItem(project, "n"); - BuildItem clone = item.Clone(); - - Assertion.AssertEquals("n", clone.Name); - Assertion.AssertEquals("i", clone.Include); - Assertion.AssertEquals("e", clone.Exclude); - Assertion.AssertEquals("i", clone.FinalItemSpec); - Assertion.AssertEquals("'a' == 'b'", clone.Condition); - Assertion.AssertEquals("value", clone.GetMetadata("meta")); - Assertion.AssertEquals(1, clone.CustomMetadataCount); - Assertion.AssertEquals(builtInMetadataNames.Length + 1, clone.MetadataCount); - - clone.SetMetadata("newMeta", "newValue"); - - Assertion.AssertEquals(true, clone.HasMetadata("newMeta")); - Assertion.AssertEquals(true, item.HasMetadata("newMeta")); - } - - /// - /// Tests BuildItem.Clone for a Virtual BuildItem - /// - [Test] - public void CloneVirtual() - { - BuildItem item = new BuildItem("n", "i"); - item.SetMetadata("m1", "v1"); - item.SetMetadata("m2", "v2"); - BuildItem clone = item.Clone(); - - Assertion.AssertEquals("v1", clone.GetMetadata("m1")); - Assertion.AssertEquals("v2", clone.GetMetadata("m2")); - - clone.SetMetadata("m2", "newValue"); - - Assertion.AssertEquals("v2", item.GetMetadata("m2")); - Assertion.AssertEquals("newValue", clone.GetMetadata("m2")); - } - - /// - /// Tests BuildItem.Clone of an Imported BuildItem - /// - [Test] - public void CloneImportedBuildItem() - { - string importProjectContents = @" - - - - ImportedMetaValue - - - - "; - - Project p = GetProjectThatImportsAnotherProject(importProjectContents, null); - BuildItem item = GetSpecificBuildItem(p, "nImported"); - BuildItem clone = item.Clone(); - - Assertion.AssertEquals("ImportedMetaValue", clone.GetMetadata("ImportedMeta")); - Assertion.AssertEquals(true, clone.IsImported); - } - - /// - /// Tests BuildItem.Clone of a null BuildItem - /// - [Test] - [ExpectedException(typeof(NullReferenceException))] - public void CloneNull() - { - BuildItem item = null; - BuildItem clone = item.Clone(); - } - #endregion - - #region Helpers - /// - /// Verifies HasMetadata for all Built In Metadata for a specific BuildItem - /// - /// The BuildItem you want to verify against - private void VerifyHasMetaDataOnBuiltInMetadata(BuildItem item) - { - foreach (string s in builtInMetadataNames) - { - Assertion.AssertEquals(true, item.HasMetadata(s)); - } - } - - /// - /// Verifies within a BuildItem for Metadata, if the Built in MetadataNames exist or not - /// - /// List of strings of either BuildItem.MetadataNames or .CustomMetadataNames - /// true if you expect the Built in MetadataNames to exist, false if not - private void VerifyBuiltInMetadataNamesExistOrNot(List list, bool expectedToExist) - { - foreach (string s in builtInMetadataNames) - { - Assertion.AssertEquals(expectedToExist, list.Contains(s)); - } - } - - /// - /// Gets a Project that imports another Project - /// - /// Project Contents of the imported Project, to get default content, pass in an empty string - /// Project Contents of the Parent Project, to get default content, pass in an empty string - /// Project - private Project GetProjectThatImportsAnotherProject(string importProjectContents, string parentProjectContents) - { - if (String.IsNullOrEmpty(importProjectContents)) - { - importProjectContents = @" - - - - - - "; - } - - if (String.IsNullOrEmpty(parentProjectContents)) - { - parentProjectContents = @" - - - - - - - "; - } - - ObjectModelHelpers.CreateFileInTempProjectDirectory("import.proj", importProjectContents); - ObjectModelHelpers.CreateFileInTempProjectDirectory("main.proj", parentProjectContents); - return ObjectModelHelpers.LoadProjectFileInTempProjectDirectory("main.proj", null); - } - - /// - /// Gets a BuildItem based on the BuildItem.Name you specify - /// - /// Project p - /// BuildItem.Name that you want - /// A BuildItem - private BuildItem GetSpecificBuildItem(Project p, string buildItemName) - { - foreach (BuildItemGroup group in p.ItemGroups) - { - foreach (BuildItem item in group) - { - if (String.Equals(item.Name, buildItemName, StringComparison.OrdinalIgnoreCase)) - { - return item; - } - } - } - - return null; - } - - /// - /// Saves a given Project to disk and compares what's saved to disk with expected contents. Assertion handled within - /// ObjectModelHelpers.CompareProjectContents. - /// - /// Project to save - /// The Project content that you expect - private void SaveProjectToDiskAndCompareAgainstExpectedContents(Project p, string expectedProjectContents) - { - string savePath = Path.Combine(ObjectModelHelpers.TempProjectDir, "p.proj"); - p.Save(savePath); - - Engine e = new Engine(); - Project savedProject = new Project(e); - savedProject.Load(savePath); - - ObjectModelHelpers.CompareProjectContents(savedProject, expectedProjectContents); - ObjectModelHelpers.DeleteTempProjectDirectory(); - } - - /// - /// Call to set your BuildItem.Name to something valid after inializing it to null to verify - /// expected Microsoft.Build.BuildEngine.Shared.InternalErrorException is thrown. - /// - /// Your initialized BuiltItem - /// true if your doing a Set, false if your doing a Get - private void BuildItemNameGetSetNullExpectedToThrow(BuildItem item, bool setting) - { - try - { - if (setting) - { - item.Name = null; - } - else - { - string s = item.Name; - } - } - catch (Exception e) //// can't directly catch InternalErrorException because it's not publicly available - { - if (setting) - { - Assertion.AssertEquals(true, e.Message.Contains("Internal MSBuild Error: Set Name: Item has not been initialized.")); - } - else - { - Assertion.AssertEquals(true, e.Message.Contains("Internal MSBuild Error: Get Name: Item has not been initialized.")); - } - - return; - } - - Assertion.Fail("Expected Microsoft.Build.BuildEngine.Shared.InternalErrorException not thrown"); - } - - /// - /// Loops through all of the Reserved itemNames to ensure the expected 'InvalidOperationException' - /// is thrown and that the exception message contains the reserved itemName name. If any - /// unexpected exceptions are thrown, they are not directly handled, thus will fail the calling - /// unit test with the exception information. And, if no exception is thrown, Assertion.Fail - /// is called, because the InvalidOperationException should have been thrown. - /// - /// Type of test that you are calling from - private void VerifyReservedNamesForBuildItemNameThrowExpectedException(TypeOfTest testType) - { - foreach (string s in reservedNames) - { - try - { - if (testType == TypeOfTest.ConstructorTest) - { - BuildItem item = new BuildItem(s, "i"); - } - else if (testType == TypeOfTest.SetNameTest) - { - BuildItem item = new BuildItem("n", "i"); - item.Name = s; - } - else if (testType == TypeOfTest.SetMetadataTest) - { - BuildItem item = new BuildItem("n", "i"); - item.SetMetadata(s, "v"); - } - - Assertion.Fail(String.Format("Reserved itemName '{0}' didn't throw the expected InvalidOperationException", s)); - } - catch (InvalidOperationException expected) - { - Assertion.AssertEquals(true, expected.Message.Contains(s)); - } - } - } - - /// - /// Loops through all of the Escape Characters to ensure the expected 'ArgumentException' - /// is thrown and that the exception message contains the Escape Character. If any - /// unexpected exceptions are thrown, they are not directly handled, thus will fail the calling - /// unit test with the exception information. And, if no exception is thrown, Assertion.Fail - /// is called, because the ArgumentException should have been thrown. - /// - /// Type of test that you are calling from - private void VerifyEscapeCharactersThrowExpectedException(TypeOfTest testType) - { - foreach (char c in EscapableCharacters) - { - try - { - if (testType == TypeOfTest.ConstructorTest) - { - BuildItem item = new BuildItem(c.ToString(), "i"); - } - else if (testType == TypeOfTest.SetNameTest) - { - BuildItem item = new BuildItem("n", "i"); - item.Name = c.ToString(); - } - else if (testType == TypeOfTest.SetMetadataTest) - { - BuildItem item = new BuildItem("n", "i"); - item.SetMetadata(c.ToString(), "v"); - } - - Assertion.Fail(String.Format("Escape Character '{0}' didn't throw the expected ArgumentException", c.ToString())); - } - catch (ArgumentException expected) - { - Assertion.AssertEquals(true, expected.Message.Contains(c.ToString())); - } - } - } - - /// - /// Un-registers the existing logger and registers a new copy. - /// We will use this when we do multiple builds so that we can safely - /// assert on log messages for that particular build. - /// - private void ResetLogger() - { - engine.UnregisterAllLoggers(); - logger = new MockLogger(); - project.ParentEngine.RegisterLogger(logger); - } - - /// - /// Custom implementation of ITaskItem for unit testing - /// - internal class MockTaskItem : ITaskItem - { - #region ITaskItem Members - - /// - /// String ItemSpec - /// - public string ItemSpec - { - get - { - return "i"; - } - - set - { - // do nothing - } - } - - /// - /// Implementation of ICollection - /// - public ICollection MetadataNames - { - get - { - return new ArrayList(); - } - } - - /// - /// Implementation of MetadataCount - /// - public int MetadataCount - { - get { return 1; } - } - - /// - /// Implementation of GetMetaData - /// - /// attribute name - /// always just returns 'foo' - public string GetMetadata(string attributeName) - { - return "foo"; - } - - /// - /// Implementation of SetMetadata - /// - /// The attribute name - /// The attribute value - public void SetMetadata(string attributeName, string attributeValue) - { - // do nothing - } - - /// - /// Implementation of RemoveMetadata - /// - /// does nothing - public void RemoveMetadata(string attributeName) - { - // do nothing - } - - /// - /// Implementation of CopyMetadataTo - /// - /// does nothing - public void CopyMetadataTo(ITaskItem destinationItem) - { - // do nothing - } - - /// - /// Implementation of IDictionary - /// - /// An IDictionary - public IDictionary CloneCustomMetadata() - { - return new Hashtable(); - } - - #endregion - } - #endregion - } -} diff --git a/src/Deprecated/Engine.UnitTests/Compatibility/BuildPropertyGroupCollection_Tests.cs b/src/Deprecated/Engine.UnitTests/Compatibility/BuildPropertyGroupCollection_Tests.cs deleted file mode 100644 index f128a2e4a60..00000000000 --- a/src/Deprecated/Engine.UnitTests/Compatibility/BuildPropertyGroupCollection_Tests.cs +++ /dev/null @@ -1,344 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections.Generic; -using NUnit.Framework; - -using Microsoft.Build.BuildEngine; -using Microsoft.Build.Framework; -using Microsoft.Build.UnitTests; - -namespace Microsoft.Build.UnitTests.OM.OrcasCompatibility -{ - /// - /// Tests for BuildPropertyGroupCollection - /// - [TestFixture] - public class BuildPropertyGroupCollection_Tests - { - #region Helper Fields - /// - /// Basic Project Contents with 1 Property Group - /// - private string basicProjectContentsOnePropertyGroup = @" - - - v - - - "; - #endregion - - #region Count Tests - /// - /// Tests BuildPropertyGroupCollection Count when Zero property groups exist - /// - [Test] - public void CountZero() - { - string projectContents = @" - - - "; - - Project p = Build.UnitTests.ObjectModelHelpers.CreateInMemoryProject(projectContents); - - BuildPropertyGroupCollection groups = p.PropertyGroups; - Assertion.AssertEquals(0, groups.Count); - } - - /// - /// Tests BuildPropertyGroupCollection Count when One property group exists - /// - [Test] - public void CountOne() - { - Project p = Build.UnitTests.ObjectModelHelpers.CreateInMemoryProject(basicProjectContentsOnePropertyGroup); - - BuildPropertyGroupCollection groups = p.PropertyGroups; - Assertion.AssertEquals(1, groups.Count); - } - - /// - /// Tests BuildPropertyGroupCollection Count when Many property groups exist - /// - [Test] - public void CountMany() - { - string projectContents = @" - - - true - 4 - v1 - - - - bin\debug\ - v2 - - - - v3 - - - - v4 - - - - v5 - - - "; - - Project p = Build.UnitTests.ObjectModelHelpers.CreateInMemoryProject(projectContents); - - BuildPropertyGroupCollection groups = p.PropertyGroups; - Assertion.AssertEquals(5, groups.Count); - } - - /// - /// Tests BuildPropertyGroupCollection Count when all property groups come from an import - /// - [Test] - public void CountFromImports() - { - Project p = GetProjectWithTwoImportProjects(); - BuildPropertyGroupCollection groups = p.PropertyGroups; - - Assertion.AssertEquals(5, groups.Count); - } - - /// - /// Tests BuildPropertyGroupCollection Count that a Property Group that's created within a Target isn't included in the count - /// - [Test] - public void CountDoesntIncludeGroupCreatedInTarget() - { - string projectContent = @" - - - v1 - - - - v2 - - - - "; - Project p = ObjectModelHelpers.CreateInMemoryProject(projectContent); - BuildPropertyGroupCollection groups = p.PropertyGroups; - - Assertion.AssertEquals(1, groups.Count); - } - - /// - /// Tests BuildPropertyGroupCollection Count after adding a new Property Group - /// - [Test] - public void CountAfterAddingNewGroup() - { - Project p = Build.UnitTests.ObjectModelHelpers.CreateInMemoryProject(basicProjectContentsOnePropertyGroup); - p.AddNewPropertyGroup(true); - - BuildPropertyGroupCollection groups = p.PropertyGroups; - Assertion.AssertEquals(2, groups.Count); - } - - /// - /// Tests BuildPropertyGroupCollection Count after removing a newly added Property Group - /// - [Test] - public void CountAfterRemovingNewGroup() - { - Project p = Build.UnitTests.ObjectModelHelpers.CreateInMemoryProject(basicProjectContentsOnePropertyGroup); - BuildPropertyGroup newGroup = p.AddNewPropertyGroup(true); - p.RemovePropertyGroup(newGroup); - - BuildPropertyGroupCollection groups = p.PropertyGroups; - Assertion.AssertEquals(1, groups.Count); - } - - /// - /// Tests BuildPropertyGroupCollection Count after removing an existing Property Group from the Main project - /// - [Test] - public void CountAfterRemovingGroupFromMainProject() - { - Project p = GetProjectWithOneImportProject(); - - RemovePropertyGroupThatContainsSpecifiedBuildProperty(p, "main"); - - BuildPropertyGroupCollection groups = p.PropertyGroups; - Assertion.AssertEquals(1, groups.Count); - } - - /// - /// Tests BuildPropertyGroupCollection Count after attempting to removing an existing Property Group from an imported project - /// - [Test] - [ExpectedException(typeof(InvalidOperationException))] - public void CountAfterRemovingGroupFromImportedProject() - { - Project p = GetProjectWithOneImportProject(); - - RemovePropertyGroupThatContainsSpecifiedBuildProperty(p, "imported"); - } - #endregion - - #region CopyTo Tests - /// - /// Tests BuildPropertyGroupCollection CopyTo Basic case - /// - [Test] - public void CopyToSimple() - { - Project p = GetProjectWithTwoImportProjects(); - BuildPropertyGroupCollection groups = p.PropertyGroups; - - object[] array = new object[groups.Count]; - groups.CopyTo(array, 0); - - int count = 0; - foreach (BuildPropertyGroup group in groups) - { - Assertion.AssertEquals(array[count].ToString(), group.ToString()); - count++; - } - } - - /// - /// Tests BuildPropertyGroupCollection CopyTo when you attempt CopyTo into an Array that's not long enough - /// - [Test] - [ExpectedException(typeof(IndexOutOfRangeException))] - public void CopyToArrayThatsNotLargeEnough() - { - Project p = GetProjectWithTwoImportProjects(); - BuildPropertyGroupCollection groups = p.PropertyGroups; - - object[] array = new object[2]; ////groups.Count is 5 - groups.CopyTo(array, 0); - } - #endregion; - - #region IsSynchronized Tests - /// - /// Tests BuildPropertyGroupCollection IsSynchronized for the default case (you load a project p and get the build property group collection from p) - /// - [Test] - public void IsSynchronizedDefault() - { - Project p = GetProjectWithTwoImportProjects(); - BuildPropertyGroupCollection groups = p.PropertyGroups; - - Assertion.AssertEquals(false, groups.IsSynchronized); - } - #endregion - - #region Helper Methods - /// - /// Helper method to Remove a BuildPropertyGroup from a Project p by specifying a BuildProperty that is contained - /// within the BuildPropertyGroup that you want to remove - /// - /// Project - /// Name of the BuildProperty that you want to key off of - private static void RemovePropertyGroupThatContainsSpecifiedBuildProperty(Project p, string buildPropertyName) - { - foreach (BuildPropertyGroup group in p.PropertyGroups) - { - foreach (BuildProperty property in group) - { - if (String.Equals(property.Name, buildPropertyName, StringComparison.OrdinalIgnoreCase)) - { - p.RemovePropertyGroup(group); - return; - } - } - } - } - - /// - /// Helper Method to create a Main project that imports 1 other project. Each project contains only one Build Property Group - /// and each of those Build Property Groups contain a Build Property of a specific name (which is used as a flag/key) to - /// identify which Build Property Group we're working with. - /// - /// Project - private static Project GetProjectWithOneImportProject() - { - string importProjectContents = @" - - - v - - - "; - - string projectContents = @" - - -
v
-
- - - - -
- "; - - ObjectModelHelpers.DeleteTempProjectDirectory(); - ObjectModelHelpers.CreateFileInTempProjectDirectory("import1.proj", importProjectContents); - ObjectModelHelpers.CreateFileInTempProjectDirectory("main.proj", projectContents); - - Project p = ObjectModelHelpers.LoadProjectFileInTempProjectDirectory("main.proj", null); - return p; - } - - /// - /// Helper Method to create a Main project that imports 2 other projects, each with build property groups - /// - /// Project - private static Project GetProjectWithTwoImportProjects() - { - string subProjectContents = @" - - - v1 - - - v2 - - - "; - - string projectContents = @" - - - v - - - - - - - - "; - - ObjectModelHelpers.DeleteTempProjectDirectory(); - ObjectModelHelpers.CreateFileInTempProjectDirectory("import1.proj", subProjectContents); - ObjectModelHelpers.CreateFileInTempProjectDirectory("import2.proj", subProjectContents); - ObjectModelHelpers.CreateFileInTempProjectDirectory("main.proj", projectContents); - - Project p = ObjectModelHelpers.LoadProjectFileInTempProjectDirectory("main.proj", null); - return p; - } - #endregion - } -} diff --git a/src/Deprecated/Engine.UnitTests/Compatibility/BuildPropertyGroup_Tests.cs b/src/Deprecated/Engine.UnitTests/Compatibility/BuildPropertyGroup_Tests.cs deleted file mode 100644 index 14337bd8b66..00000000000 --- a/src/Deprecated/Engine.UnitTests/Compatibility/BuildPropertyGroup_Tests.cs +++ /dev/null @@ -1,1233 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections.Generic; -using NUnit.Framework; - -using Microsoft.Build.BuildEngine; -using Microsoft.Build.Framework; -using Microsoft.Build.UnitTests; - -namespace Microsoft.Build.UnitTests.OM.OrcasCompatibility -{ - /// - /// Tests for BuildPropertyGroup - /// - [TestFixture] - public class BuildPropertyGroup_Tests - { - #region Helper Fields - /// - /// Basic project content start - /// - private string basicProjectContentsBefore = @" - - - true - 4 - - - - v - - - "; - - /// - /// Basic project content with only one property group - /// - private string basicProjectContentsWithOnePropertyGroup = @" - - - v - - - "; - #endregion - - #region Constructor Tests - /// - /// Tests BuildPropertyGroup Contructor with no parameters - /// - [Test] - public void ConstructWithNothing() - { - BuildPropertyGroup group = new BuildPropertyGroup(); - - Assertion.AssertEquals(0, group.Count); - Assertion.AssertEquals(false, group.IsImported); - } - - /// - /// Tests BuildPropertyGroup Contructor with a simple project - /// - [Test] - public void ConstructWithSimpleProject() - { - Project p = Build.UnitTests.ObjectModelHelpers.CreateInMemoryProject(basicProjectContentsWithOnePropertyGroup); - BuildPropertyGroup group = new BuildPropertyGroup(p); - - Assertion.AssertEquals(0, group.Count); - Assertion.AssertEquals(false, group.IsImported); - } - - /// - /// Tests BuildPropertyGroup Contructor with a project that contains specific property groups and items - /// - [Test] - public void ConstructWithProject() - { - Project p = Build.UnitTests.ObjectModelHelpers.CreateInMemoryProject(basicProjectContentsBefore); - - List properties = GetListOfBuildProperties(p); - - Assertion.AssertEquals("p1", properties[0]); - Assertion.AssertEquals("p2", properties[1]); - Assertion.AssertEquals("p3", properties[2]); - } - #endregion - - #region Count Tests - /// - /// Tests BuildPropertyGroup Count with only one property set - /// - [Test] - public void CountOne() - { - BuildPropertyGroup group = new BuildPropertyGroup(); - group.SetProperty("n", "v"); - - Assertion.AssertEquals(1, group.Count); - Assertion.AssertEquals("v", group["n"].Value); - } - - /// - /// Tests BuildPropertyGroup Count with no properties set - /// - [Test] - public void CountZero() - { - BuildPropertyGroup group = new BuildPropertyGroup(); - - Assertion.AssertEquals(0, group.Count); - } - - /// - /// Tests BuildPropertyGroup Count after clearing it. - /// - [Test] - public void CountAfterClear() - { - BuildPropertyGroup group = new BuildPropertyGroup(); - group.SetProperty("n", "v"); - group.Clear(); - - Assertion.AssertEquals(0, group.Count); - } - - /// - /// Tests BuildPropertyGroup Count after removing 1 of the properties - /// - [Test] - public void CountAfterRemovingSomeProperties() - { - BuildPropertyGroup group = new BuildPropertyGroup(); - group.SetProperty("n1", "v1"); - group.SetProperty("n2", "v2"); - - group.RemoveProperty("n1"); - - Assertion.AssertEquals(1, group.Count); - } - - /// - /// Tests BuildPropertyGroup Count after removing 1 of the properties - /// - [Test] - public void CountAfterRemovingAllProperties() - { - BuildPropertyGroup group = new BuildPropertyGroup(); - group.SetProperty("n1", "v1"); - group.SetProperty("n2", "v2"); - group.SetProperty("n3", "v3"); - - group.RemoveProperty("n1"); - group.RemoveProperty("n2"); - group.RemoveProperty("n3"); - - Assertion.AssertEquals(0, group.Count); - } - #endregion - - #region Clone Tests - /// - /// Tests BuildPropertyGroup Clone Deep - /// - [Test] - public void CloneDeep() - { - BuildPropertyGroup group = new BuildPropertyGroup(); - group.SetProperty("n1", "v1"); - group.SetProperty("n2", "v2"); - - BuildPropertyGroup clone = group.Clone(true); - - Assertion.AssertEquals(2, clone.Count); - Assertion.AssertEquals(clone["n1"].Value, group["n1"].Value); - Assertion.AssertEquals(clone["n2"].Value, group["n2"].Value); - - group.SetProperty("n1", "new"); - - Assertion.AssertEquals("new", group["n1"].Value); - Assertion.AssertEquals("v1", clone["n1"].Value); - } - - /// - /// Tests BuildPropertyGroup Clone Deep with Clear - /// - [Test] - public void CloneDeepClear() - { - BuildPropertyGroup group = new BuildPropertyGroup(); - group.SetProperty("n1", "v1"); - group.SetProperty("n2", "v2"); - - BuildPropertyGroup clone = group.Clone(true); - clone.Clear(); - - Assertion.AssertEquals(0, clone.Count); - Assertion.AssertEquals(2, group.Count); - } - - /// - /// Tests BuildPropertyGroup Clone Shallow - /// - [Test] - public void CloneShallow() - { - BuildPropertyGroup group = new BuildPropertyGroup(); - group.SetProperty("n1", "v1"); - group.SetProperty("n2", "v2"); - - BuildPropertyGroup clone = group.Clone(false); - group["n1"].Value = "new"; - - Assertion.AssertEquals(2, clone.Count); - Assertion.AssertEquals(2, group.Count); - Assertion.AssertEquals("new", group["n1"].Value); - Assertion.AssertEquals("new", clone["n1"].Value); - Assertion.AssertEquals(clone["n2"].Value, group["n2"].Value); - } - - /// - /// Tests BuildPropertyGroup Clone Shallow with Set Property - /// - [Test] - public void CloneShallowSetProperty() - { - BuildPropertyGroup group = new BuildPropertyGroup(); - group.SetProperty("n1", "v1"); - group.SetProperty("n2", "v2"); - - BuildPropertyGroup clone = group.Clone(false); - - group.SetProperty("n1", "new"); - - Assertion.AssertEquals(2, clone.Count); - Assertion.AssertEquals(2, group.Count); - Assertion.AssertEquals("new", group["n1"].Value); - Assertion.AssertEquals("v1", clone["n1"].Value); - Assertion.AssertEquals(clone["n2"].Value, group["n2"].Value); - } - - /// - /// Tests BuildPropertyGroup Clone Shallow when you attempt a shallow clone of an XMLProject - /// - [Test] - [ExpectedException(typeof(InvalidOperationException))] - public void CloneShallowWithXMLProject() - { - Project p = Build.UnitTests.ObjectModelHelpers.CreateInMemoryProject(basicProjectContentsWithOnePropertyGroup); - - foreach (BuildPropertyGroup group in p.PropertyGroups) - { - BuildPropertyGroup clone = group.Clone(false); - } - } - #endregion - - #region SetProperty Tests - /// - /// Tests BuildPropertyGroup SetProperty Value to an empty string - /// - [Test] - public void SetPropertyEmptyValue() - { - BuildPropertyGroup group = new BuildPropertyGroup(); - group.SetProperty("n", String.Empty); - - Assertion.AssertEquals(1, group.Count); - Assertion.AssertEquals(String.Empty, group["n"].Value); - } - - /// - /// Tests BuildPropertyGroup SetProperty Value to null - /// - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void SetPropertyNullValue() - { - BuildPropertyGroup group = new BuildPropertyGroup(); - group.SetProperty("n", null); - } - - /// - /// Tests BuildPropertyGroup SetProperty Name to an empty string - /// - [Test] - [ExpectedException(typeof(ArgumentException))] - public void SetPropertyEmptyName() - { - BuildPropertyGroup group = new BuildPropertyGroup(); - group.SetProperty(String.Empty, "v"); - } - - /// - /// Tests BuildPropertyGroup SetProperty Name to null - /// - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void SetPropertyNullName() - { - BuildPropertyGroup group = new BuildPropertyGroup(); - group.SetProperty(null, "v"); - } - - /// - /// Tests BuildPropertyGroup SetProperty setting Name and Value to a simple value - /// - [Test] - public void SetPropertySimpleNameValue() - { - BuildPropertyGroup group = new BuildPropertyGroup(); - group.SetProperty("n", "v"); - - Assertion.AssertEquals("v", group["n"].Value); - } - - /// - /// Tests BuildPropertyGroup SetProperty with Treat Property Value as Literal set to true/false - /// - [Test] - public void SetPropertyTreatPropertyValueAsLiteral() - { - BuildPropertyGroup group = new BuildPropertyGroup(); - group.SetProperty("n1", @"%*?@$();\", true); - group.SetProperty("n2", @"%*?@$();\", false); - - Assertion.AssertEquals(@"%25%2a%3f%40%24%28%29%3b\", group["n1"].Value); - Assertion.AssertEquals(@"%*?@$();\", group["n2"].Value); - } - - /// - /// Tests BuildPropertyGroup SetProperty with Treat Property Value as Literal set to false - /// - [Test] - public void SetPropertyTreatPropertyValueAsLiteralFalse() - { - BuildPropertyGroup group = new BuildPropertyGroup(); - group.SetProperty("n", "v", false); - - Assertion.AssertEquals("v", group["n"].Value); - } - - /// - /// Tests BuildPropertyGroup SetProperty with a project p - /// - [Test] - public void SetPropertyWithProject() - { - Project p = Build.UnitTests.ObjectModelHelpers.CreateInMemoryProject(basicProjectContentsBefore); - - List properties = GetListOfBuildProperties(p); - properties[0] = "v"; - - Assertion.AssertEquals("v", properties[0]); - Assertion.AssertEquals("p2", properties[1]); - Assertion.AssertEquals("p3", properties[2]); - } - - /// - /// Tests BuildPropertyGroup SetProperty Value with special characters - /// - [Test] - public void SetPropertyValueWithSpecialCharacters() - { - BuildPropertyGroup group = new BuildPropertyGroup(); - group.SetProperty("n1", "%24"); - group.SetProperty("n2", "%40"); - group.SetProperty("n3", "%3b"); - group.SetProperty("n4", "%5c"); - group.SetProperty("n5", "%25"); - - Assertion.AssertEquals("$", group["n1"].FinalValue); - Assertion.AssertEquals("@", group["n2"].FinalValue); - Assertion.AssertEquals(";", group["n3"].FinalValue); - Assertion.AssertEquals(@"\", group["n4"].FinalValue); - Assertion.AssertEquals("%", group["n5"].FinalValue); - } - - /// - /// Tests BuildPropertyGroup SetProperty Name with special characters - /// - [Test] - [ExpectedException(typeof(ArgumentException))] - public void SetPropertyNameWithSpecialCharacters() - { - BuildPropertyGroup group = new BuildPropertyGroup(); - group.SetProperty("%24", "v"); - } - #endregion - - #region RemoveProperty Tests - /// - /// Tests BuildPropertyGroup RemoveProperty by removing 1 of many by name - /// - [Test] - public void RemovePropertyByNameOneOfSeveral() - { - BuildPropertyGroup group = new BuildPropertyGroup(); - group.SetProperty("n1", "v1"); - group.SetProperty("n2", "v2"); - group.SetProperty("n3", "v3"); - - group.RemoveProperty("n1"); - - Assertion.AssertEquals(2, group.Count); - Assertion.AssertNull(group["n1"]); - Assertion.AssertEquals("v2", group["n2"].Value); - Assertion.AssertEquals("v3", group["n3"].Value); - } - - /// - /// Tests BuildPropertyGroup RemoveProperty by removing all of many by name - /// - [Test] - public void RemovePropertyByNameAllOfSeveral() - { - BuildPropertyGroup group = new BuildPropertyGroup(); - group.SetProperty("n1", "v1"); - group.SetProperty("n2", "v2"); - group.SetProperty("n3", "v3"); - - group.RemoveProperty("n1"); - group.RemoveProperty("n2"); - group.RemoveProperty("n3"); - - Assertion.AssertEquals(0, group.Count); - Assertion.AssertNull(group["n1"]); - Assertion.AssertNull(group["n2"]); - Assertion.AssertNull(group["n3"]); - } - - /// - /// Tests BuildPropertyGroup RemoveProperty by attempting to remove a property that doesn't actually exist - /// - [Test] - public void RemovePropertyByNameOfANonExistingProperty() - { - BuildPropertyGroup group = new BuildPropertyGroup(); - group.SetProperty("n", "v"); - - group.RemoveProperty("not"); - - Assertion.AssertEquals(1, group.Count); - } - - /// - /// Tests BuildPropertyGroup RemoveProperty by attempting to remove a property name that is null - /// - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void RemovePropertyByNameWhenNameIsNull() - { - BuildPropertyGroup group = new BuildPropertyGroup(); - string name = null; - - group.RemoveProperty(name); - } - - /// - /// Tests BuildPropertyGroup RemoveProperty by attempting to remove a property name that is an empty string - /// - [Test] - public void RemovePropertyByNameThatIsAnEmptyString() - { - BuildPropertyGroup group = new BuildPropertyGroup(); - group.SetProperty("n", "v"); - - group.RemoveProperty(String.Empty); - - Assertion.AssertEquals(1, group.Count); - } - - /// - /// Tests BuildPropertyGroup RemoveProperty by removing 1 of several properties by BuildProperty - /// - [Test] - public void RemovePropertyByBuildPropertyOneOfSeveral() - { - BuildPropertyGroup group = new BuildPropertyGroup(); - group.SetProperty("n1", "v1"); - group.SetProperty("n2", "v2"); - group.SetProperty("n3", "v3"); - - BuildProperty property = GetSpecificBuildPropertyOutOfBuildPropertyGroup(group, "n2"); - - group.RemoveProperty(property); - - Assertion.AssertEquals(2, group.Count); - Assertion.AssertEquals("v1", group["n1"].Value); - Assertion.AssertNull(group["n2"]); - Assertion.AssertEquals("v3", group["n3"].Value); - } - - /// - /// Tests BuildPropertyGroup RemoveProperty by all of several properties by BuildProperty - /// - [Test] - public void RemovePropertyByBuildPropertyAllOfSeveral() - { - BuildPropertyGroup group = new BuildPropertyGroup(); - group.SetProperty("n1", "v1"); - group.SetProperty("n2", "v2"); - group.SetProperty("n3", "v3"); - - BuildProperty[] property = new BuildProperty[] - { - GetSpecificBuildPropertyOutOfBuildPropertyGroup(group, "n1"), - GetSpecificBuildPropertyOutOfBuildPropertyGroup(group, "n2"), - GetSpecificBuildPropertyOutOfBuildPropertyGroup(group, "n3") - }; - - group.RemoveProperty(property[0]); - group.RemoveProperty(property[1]); - group.RemoveProperty(property[2]); - - Assertion.AssertEquals(0, group.Count); - Assertion.AssertNull(group["n1"]); - Assertion.AssertNull(group["n2"]); - Assertion.AssertNull(group["n3"]); - } - - /// - /// Tests BuildPropertyGroup RemoveProperty of a null property - /// - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void RemovePropertyByBuildPropertyWithNullProperty() - { - BuildPropertyGroup group = new BuildPropertyGroup(); - BuildProperty property = null; - - group.RemoveProperty(property); - } - #endregion - - #region AddNewProperty Tests - /// - /// Tests BuildPropertyGroup AddNewProperty with setting Name to null - /// - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void AddNewPropertyNameToNull() - { - Project p = Build.UnitTests.ObjectModelHelpers.CreateInMemoryProject(basicProjectContentsBefore); - AddNewPropertyToEachPropertyGroup(p, null, "v"); - } - - /// - /// Tests BuildPropertyGroup AddNewProperty with setting Name to an empty string - /// - [Test] - [ExpectedException(typeof(ArgumentException))] - public void AddNewPropertyNameToEmptyString() - { - Project p = Build.UnitTests.ObjectModelHelpers.CreateInMemoryProject(basicProjectContentsBefore); - AddNewPropertyToEachPropertyGroup(p, string.Empty, "v"); - } - - /// - /// Tests BuildPropertyGroup AddNewProperty with setting Value to null - /// - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void AddNewPropertyValueToNull() - { - Project p = Build.UnitTests.ObjectModelHelpers.CreateInMemoryProject(basicProjectContentsBefore); - AddNewPropertyToEachPropertyGroup(p, "n", null); - } - - /// - /// Tests BuildPropertyGroup AddNewProperty with setting Value to an empty string - /// - [Test] - public void AddNewPropertyValueToEmptyString() - { - Project p = Build.UnitTests.ObjectModelHelpers.CreateInMemoryProject(basicProjectContentsBefore); - AddNewPropertyToEachPropertyGroup(p, "n", String.Empty); - - string projectContentsAfter = @" - - - true - 4 - - - - - v - - - - "; - - Build.UnitTests.ObjectModelHelpers.CompareProjectContents(p, projectContentsAfter); - } - - /// - /// Tests BuildPropertyGroup AddNewProperty with simple Name and Value - /// - [Test] - public void AddNewPropertySimpleNameValue() - { - Project p = Build.UnitTests.ObjectModelHelpers.CreateInMemoryProject(basicProjectContentsBefore); - AddNewPropertyToEachPropertyGroup(p, "n", "v"); - - string projectContentsAfter = @" - - - true - 4 - v - - - - v - v - - - "; - - Build.UnitTests.ObjectModelHelpers.CompareProjectContents(p, projectContentsAfter); - } - - /// - /// Tests BuildPropertyGroup AddNewProperty several sets - /// - [Test] - public void AddNewPropertySeveralNameValuePairs() - { - Project p = Build.UnitTests.ObjectModelHelpers.CreateInMemoryProject(basicProjectContentsBefore); - AddNewPropertyToEachPropertyGroup(p, "n1", "v1"); - AddNewPropertyToEachPropertyGroup(p, "n2", "v2"); - AddNewPropertyToEachPropertyGroup(p, "n3", "v3"); - AddNewPropertyToEachPropertyGroup(p, "n4", "v4"); - - string projectContentsAfter = @" - - - true - 4 - v1 - v2 - v3 - v4 - - - - v - v1 - v2 - v3 - v4 - - - "; - - Build.UnitTests.ObjectModelHelpers.CompareProjectContents(p, projectContentsAfter); - } - - /// - /// Tests BuildPropertyGroup AddNewProperty with simple Name and Value as well as setting Treat Property Value as Literal to true - /// - [Test] - public void AddNewPropertySimpleNameValueWithTreatPropertyValueAsLiteralTrue() - { - Project p = Build.UnitTests.ObjectModelHelpers.CreateInMemoryProject(basicProjectContentsBefore); - AddNewPropertyToEachPropertyGroupWithPropertyValueAsLiteral(p, "n", @"%*?@$();\", true); - - string projectContentsAfter = @" - - - true - 4 - %25%2a%3f%40%24%28%29%3b\ - - - - v - %25%2a%3f%40%24%28%29%3b\ - - - "; - - Build.UnitTests.ObjectModelHelpers.CompareProjectContents(p, projectContentsAfter); - } - - /// - /// Tests BuildPropertyGroup AddNewProperty with simple Name and Value as well as setting Treat Property Value as Literal to false - /// - [Test] - public void AddNewPropertySimpleNameValueWithTreatPropertyValueAsLiteralFalse() - { - Project p = Build.UnitTests.ObjectModelHelpers.CreateInMemoryProject(basicProjectContentsBefore); - AddNewPropertyToEachPropertyGroupWithPropertyValueAsLiteral(p, "n", @"%*?@$();\", false); - - string projectContentsAfter = @" - - - true - 4 - %*?@$();\ - - - - v - %*?@$();\ - - - "; - - Build.UnitTests.ObjectModelHelpers.CompareProjectContents(p, projectContentsAfter); - } - - /// - /// Tests BuildPropertyGroup AddNewProperty with special characters for the Name - /// - [Test] - [ExpectedException(typeof(ArgumentException))] - public void AddNewPropertyWithSpecialCharactersInName() - { - Project p = Build.UnitTests.ObjectModelHelpers.CreateInMemoryProject(basicProjectContentsWithOnePropertyGroup); - AddNewPropertyToEachPropertyGroup(p, "%25", "v1"); - } - - /// - /// Tests BuildPropertyGroup AddNewProperty with special characters for the Value - /// - [Test] - public void AddNewPropertyWithSpecialCharactersInValue() - { - Project p = Build.UnitTests.ObjectModelHelpers.CreateInMemoryProject(basicProjectContentsWithOnePropertyGroup); - AddNewPropertyToEachPropertyGroup(p, "n1", "%24%40%3b%5c%25"); - - Dictionary properties = GetDictionaryOfPropertiesInProject(p); - - Assertion.AssertEquals("%24%40%3b%5c%25", properties["n1"].ToString()); - } - - /// - /// Tests BuildPropertyGroup AddNewProperty with an in memory build property group - /// - [Test] - [ExpectedException(typeof(InvalidOperationException))] - public void AddNewPropertyToInMemoryGroup() - { - BuildPropertyGroup group = new BuildPropertyGroup(); - group.SetProperty("n1", "v1"); - - group.AddNewProperty("n3", "v3"); - } - #endregion - - #region Condition tests - /// - /// Tests BuildPropertyGroup Condition Get - /// - [Test] - public void ConditionGetWhenSetItXML() - { - string projectContents = @" - - - v1 - v2 - v3 - - - v4 - - - - - v5 - - - "; - - Project p = Build.UnitTests.ObjectModelHelpers.CreateInMemoryProject(projectContents); - - List conditions = GetListOfBuildPropertyGroupConditions(p); - - Assertion.AssertEquals(" '$(Foo)' == 'Bar' ", conditions[0].ToString()); - Assertion.AssertEquals(" '$(A)' == 'B' ", conditions[1].ToString()); - Assertion.AssertEquals("'$(C)' == 'D'", conditions[2].ToString()); - Assertion.AssertEquals(String.Empty, conditions[3].ToString()); - } - - /// - /// Tests BuildPropertyGroup Condition Set for a simple set - /// - [Test] - public void ConditionSetSimple() - { - Project p = ObjectModelHelpers.CreateInMemoryProject(basicProjectContentsWithOnePropertyGroup); - SetPropertyGroupConditionOnEachPropertyGroup(p, "'$(C)' == 'D'"); - - List conditions = GetListOfBuildPropertyGroupConditions(p); - - Assertion.AssertEquals("'$(C)' == 'D'", conditions[0].ToString()); - } - - /// - /// Tests BuildPropertyGroup Condition Set to multiple PropertyGroups - /// - [Test] - public void ConditionSetToMultipleGroups() - { - Project p = Build.UnitTests.ObjectModelHelpers.CreateInMemoryProject(basicProjectContentsBefore); - SetPropertyGroupConditionOnEachPropertyGroup(p, "'$(C)' == 'D'"); - - List conditions = GetListOfBuildPropertyGroupConditions(p); - - Assertion.AssertEquals("'$(C)' == 'D'", conditions[0].ToString()); - Assertion.AssertEquals("'$(C)' == 'D'", conditions[1].ToString()); - } - - /// - /// Tests BuildPropertyGroup Condition Set after setting the condition (setting two times in a row) - /// - [Test] - public void ConditionSetAfterSetting() - { - Project p = Build.UnitTests.ObjectModelHelpers.CreateInMemoryProject(basicProjectContentsWithOnePropertyGroup); - SetPropertyGroupConditionOnEachPropertyGroup(p, "'$(C)' == 'D'"); - SetPropertyGroupConditionOnEachPropertyGroup(p, " '$(Foo)' == 'Bar' "); - - List conditions = GetListOfBuildPropertyGroupConditions(p); - - Assertion.AssertEquals(" '$(Foo)' == 'Bar' ", conditions[0].ToString()); - } - - /// - /// Tests BuildPropertyGroup Condition Set with an escape character like lessthan - /// - [Test] - public void ConditionSetWithEscapeCharacter() - { - Project p = Build.UnitTests.ObjectModelHelpers.CreateInMemoryProject(basicProjectContentsWithOnePropertyGroup); - SetPropertyGroupConditionOnEachPropertyGroup(p, "'<' == 'D'"); - - List conditions = GetListOfBuildPropertyGroupConditions(p); - - Assertion.AssertEquals("'<' == 'D'", conditions[0].ToString()); - } - - /// - /// Tests BuildPropertyGroup Condition Set with Special Characters (; $ @ \ $ %) - /// - [Test] - public void ConditionSetWithSpecialCharacters() - { - Project p = Build.UnitTests.ObjectModelHelpers.CreateInMemoryProject(basicProjectContentsWithOnePropertyGroup); - SetPropertyGroupConditionOnEachPropertyGroup(p, "'%24A' == 'D'"); - - List conditions = GetListOfBuildPropertyGroupConditions(p); - - Assertion.AssertEquals("'%24A' == 'D'", conditions[0].ToString()); - } - #endregion - - #region IsImported Tests - /// - /// Tests BuildPropertyGroup IsImported when all BuildPropertyGroups are defined within main project - /// - [Test] - public void IsImportedAllFromMainProject() - { - string projectContents = @" - - - v1 - v2 - v3 - - - v4 - - - "; - - Project p = Build.UnitTests.ObjectModelHelpers.CreateInMemoryProject(projectContents); - - foreach (BuildPropertyGroup group in p.PropertyGroups) - { - Assertion.AssertEquals(false, group.IsImported); - } - } - - /// - /// Tests BuildPropertyGroup IsImported when all BuildPropertyGroups are defined within an import - /// - [Test] - public void IsImportedAllFromImportProject() - { - string projectContents = @" - - - - "; - - Project p = Build.UnitTests.ObjectModelHelpers.CreateInMemoryProject(projectContents); - foreach (BuildPropertyGroup group in p.PropertyGroups) - { - Assertion.AssertEquals(true, group.IsImported); - } - } - - /// - /// Tests BuildPropertyGroup IsImported when BuildPropertyGroups are defined within main project and an import - /// - [Test] - public void IsImportedFromMainProjectAndImported() - { - string projectContents = @" - - - v1 - v2 - v3 - - - v4 - - - - "; - - Project p = Build.UnitTests.ObjectModelHelpers.CreateInMemoryProject(projectContents); - - Assertion.AssertEquals(false, IsPropertyImported(p, "n1")); - Assertion.AssertEquals(false, IsPropertyImported(p, "n2")); - Assertion.AssertEquals(false, IsPropertyImported(p, "n3")); - Assertion.AssertEquals(false, IsPropertyImported(p, "n4")); - Assertion.AssertEquals(true, IsPropertyImported(p, "OutDir")); - Assertion.AssertEquals(true, IsPropertyImported(p, "ProjectExt")); - Assertion.AssertEquals(true, IsPropertyImported(p, "DefaultLanguageSourceExtension")); - } - - /// - /// Tests BuildPropertyGroup IsImported when BuildPropertyGroups are Virtual Property groups - /// - [Test] - public void IsImportedWithVirtualPropertyGroups() - { - BuildPropertyGroup group = new BuildPropertyGroup(); - group.SetProperty("n1", "v1"); - - foreach (BuildProperty property in group) - { - Assertion.AssertEquals(false, property.IsImported); - } - } - #endregion - - #region SetImportedPropertyGroupCondition tests - /// - /// Tests BuildPropertyGroup SetImportedPropertyGroupCondition setting to true - /// - [Test] - public void SetImportedPropertyGroupConditionTrue() - { - string projectContents = @" - - - - "; - - Project p = Build.UnitTests.ObjectModelHelpers.CreateInMemoryProject(projectContents); - foreach (BuildPropertyGroup group in p.PropertyGroups) - { - group.SetImportedPropertyGroupCondition("true"); - Assertion.AssertEquals("true", group.Condition); - } - } - - /// - /// Tests BuildPropertyGroup SetImportedPropertyGroupCondition setting to false - /// - [Test] - public void SetImportedPropertyGroupConditionFalse() - { - string projectContents = @" - - - - "; - - Project p = Build.UnitTests.ObjectModelHelpers.CreateInMemoryProject(projectContents); - foreach (BuildPropertyGroup group in p.PropertyGroups) - { - group.SetImportedPropertyGroupCondition("false"); - Assertion.AssertEquals("false", group.Condition); - } - } - - /// - /// Tests BuildPropertyGroup SetImportedPropertyGroupCondition setting general - /// - [Test] - public void SetImportedPropertyGroupCondition() - { - string projectContents = @" - - - - "; - - Project p = Build.UnitTests.ObjectModelHelpers.CreateInMemoryProject(projectContents); - foreach (BuildPropertyGroup group in p.PropertyGroups) - { - group.SetImportedPropertyGroupCondition("'$(C)' == 'D'"); - Assertion.AssertEquals("'$(C)' == 'D'", group.Condition); - } - } - - /// - /// Tests BuildPropertyGroup SetImportedPropertyGroupCondition setting to empty string - /// - [Test] - public void SetImportedPropertyGroupConditionToEmtpySTring() - { - string projectContents = @" - - - - "; - - Project p = Build.UnitTests.ObjectModelHelpers.CreateInMemoryProject(projectContents); - foreach (BuildPropertyGroup group in p.PropertyGroups) - { - group.SetImportedPropertyGroupCondition(String.Empty); - Assertion.AssertEquals(String.Empty, group.Condition); - } - } - - /// - /// Tests BuildPropertyGroup SetImportedPropertyGroupCondition setting to null - /// - [Test] - public void SetImportedPropertyGroupConditionToNull() - { - string projectContents = @" - - - - "; - - Project p = Build.UnitTests.ObjectModelHelpers.CreateInMemoryProject(projectContents); - foreach (BuildPropertyGroup group in p.PropertyGroups) - { - group.SetImportedPropertyGroupCondition(null); - Assertion.AssertEquals(String.Empty, group.Condition); - } - } - #endregion - - #region this[string propertyName] { get; set; } Tests - /// - /// Tests BuildPropertyGroup this[string propertyName] Get - /// - [Test] - public void ThisGet() - { - BuildPropertyGroup group = new BuildPropertyGroup(); - group.SetProperty("n1", "v1"); - group.SetProperty("n2", "v2"); - - Assertion.AssertEquals("v1", group["n1"].FinalValue); - Assertion.AssertEquals("v2", group["n2"].FinalValue); - } - - /// - /// Tests BuildPropertyGroup this[string propertyName] Set - /// - [Test] - public void ThisSet() - { - BuildPropertyGroup group = new BuildPropertyGroup(); - group.SetProperty("n1", "v"); - group.SetProperty("n2", group["n1"].FinalValue); - group["n1"].Value = "value"; - - Assertion.AssertEquals("value", group["n1"].FinalValue); - } - #endregion - - #region BuildPropertyGroup Helpers - /// - /// Tells you if your specified BuildProperty name within your Project is imported or not - /// - /// Project - /// BuildProperty name - /// true if specified BuildProject name is in a BuildPropertyGroup that is imported, false if not - private static bool IsPropertyImported(Project p, string propertyNameWanted) - { - foreach (BuildPropertyGroup group in p.PropertyGroups) - { - foreach (BuildProperty property in group) - { - if (String.Equals(property.Name, propertyNameWanted, StringComparison.OrdinalIgnoreCase)) - { - return group.IsImported; - } - } - } - - return false; - } - - /// - /// Gets a Dictionary List of properties in your project (Key = property.Name, Value = propery.Value) - /// - /// Project - /// A Dictionary List of properties in your project (Key = property.Name, Value = propery.Value) - private static Dictionary GetDictionaryOfPropertiesInProject(Project p) - { - Dictionary properties = new Dictionary(); - - foreach (BuildPropertyGroup group in p.PropertyGroups) - { - foreach (BuildProperty prop in group) - { - properties.Add(prop.Name, prop.Value); - } - } - - return properties; - } - - /// - /// Gets a List of all BuildProperties within your Project - /// - /// Project - /// A List of strings of all Build Properties - private static List GetListOfBuildProperties(Project p) - { - List properties = new List(); - foreach (BuildPropertyGroup group in p.PropertyGroups) - { - foreach (BuildProperty property in group) - { - properties.Add(property.Name); - } - } - - return properties; - } - - /// - /// Gets a List of all BuildPropertyGroup conditions in your Project - /// - /// Project - /// A List of strings of all Build Property Group conditions - private static List GetListOfBuildPropertyGroupConditions(Project p) - { - List conditions = new List(); - foreach (BuildPropertyGroup group in p.PropertyGroups) - { - conditions.Add(group.Condition); - } - - return conditions; - } - - /// - /// Helper method to set a PropertyGroup condition on all PropertyGroups within a Project - /// - /// Project - /// The condition you want to set, example "'$(C)' == 'D'" - private static void SetPropertyGroupConditionOnEachPropertyGroup(Project p, string condition) - { - foreach (BuildPropertyGroup group in p.PropertyGroups) - { - group.Condition = condition; - } - } - - /// - /// Helper method to add new property to BuildPropertyGroups within your project - /// - /// Project - /// String of the property name - /// String of the property value - private static void AddNewPropertyToEachPropertyGroup(Project p, string name, string value) - { - foreach (BuildPropertyGroup group in p.PropertyGroups) - { - group.AddNewProperty(name, value); - } - } - - /// - /// Helper method to add new property to BuildPropertyGroups within your project where you can set Property Value as Literal or not - /// - /// Project - /// String of the property name - /// String of the property value - /// true or false - private static void AddNewPropertyToEachPropertyGroupWithPropertyValueAsLiteral(Project p, string name, string value, bool treatPropertyValueAsLiteral) - { - foreach (BuildPropertyGroup group in p.PropertyGroups) - { - group.AddNewProperty(name, value, treatPropertyValueAsLiteral); - } - } - - /// - /// Gets a specific BuildProperty out of your BuildPropertyGroup - /// - /// Your BuildPropertyGroup - /// The BuildProperty name that you want - /// The BuildProperty of the BuildProperty name you requested - private static BuildProperty GetSpecificBuildPropertyOutOfBuildPropertyGroup(BuildPropertyGroup group, string propertyNameWanted) - { - foreach (BuildProperty property in group) - { - if (String.Equals(property.Name, propertyNameWanted, StringComparison.OrdinalIgnoreCase)) - { - return property; - } - } - - return null; - } - #endregion - } -} diff --git a/src/Deprecated/Engine.UnitTests/Compatibility/BuildProperty_Tests.cs b/src/Deprecated/Engine.UnitTests/Compatibility/BuildProperty_Tests.cs deleted file mode 100644 index f404cbe6a25..00000000000 --- a/src/Deprecated/Engine.UnitTests/Compatibility/BuildProperty_Tests.cs +++ /dev/null @@ -1,639 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - - -using System; -using System.Xml; -using System.Collections.Generic; -using NUnit.Framework; - -using Microsoft.Build.BuildEngine; -using Microsoft.Build.Framework; -using Microsoft.Build.UnitTests; - -namespace Microsoft.Build.UnitTests.OM.OrcasCompatibility -{ - /// - /// Tests for BuildProperty - /// - [TestFixture] - public class BuildProperty_Tests - { - #region Constructor Tests - /// - /// Tests BuildProperty Contructor with a simple string for Name and Value - /// - [Test] - public void ConstructWithSimpleStringNameAndValue() - { - BuildProperty property = new BuildProperty("n", "v"); - - Assertion.AssertEquals("n", property.Name); - Assertion.AssertEquals("v", property.Value); - } - - /// - /// Tests BuildProperty Contructor with a String.Empty for Name and a simple string for Value - /// - [Test] - [ExpectedException(typeof(ArgumentException))] - public void ConstructWithEmptyStringNameAndSpringStringValue() - { - BuildProperty property = new BuildProperty(String.Empty, "v"); - } - - /// - /// Tests BuildProperty Contructor with a simple string for Name and String.Empty for Value - /// - [Test] - public void ConstructWithSimpleStringNameAndEmptyStringValue() - { - BuildProperty property = new BuildProperty("n", String.Empty); - - Assertion.AssertEquals("n", property.Name); - Assertion.AssertEquals(String.Empty, property.Value); - } - - /// - /// Tests BuildProperty Contructor with null for Name and Value - /// - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void ConstructWithNullNameValue() - { - BuildProperty property = new BuildProperty(null, null); - } - - /// - /// Tests BuildProperty Contructor with non valid xml name - /// - /// cliffh and jaysh brought this up during dev10 development - [Test] - [ExpectedException(typeof(ArgumentException))] - public void SetNameToNonValidXml() - { - BuildProperty property = new BuildProperty("1invalid", "v"); - } - - /// - /// Tests BuildProperty Contructor with null for Name and a simple string for Value - /// - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void ConstructWithNullNameAndSimpleStringValue() - { - BuildProperty property = new BuildProperty(null, "v"); - } - - /// - /// Tests BuildProperty Contructor with a simple string for Name and null for Value - /// - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void ConstructWithSimpleStringNameAndNullValue() - { - BuildProperty property = new BuildProperty("n", null); - } - #endregion - - #region Value Tests - /// - /// Tests setting the BuildProperty Value to another string - /// - [Test] - public void SetValueToAnotherString() - { - BuildProperty property = new BuildProperty("n", "v"); - Assertion.AssertEquals("v", property.Value); - - // Set Value to another string - property.Value = "new"; - - Assertion.AssertEquals("new", property.Value); - } - - /// - /// Tests setting the BuildProperty Value to String.Empty - /// - [Test] - public void SetValueToEmptyString() - { - BuildProperty property = new BuildProperty("n", "v"); - Assertion.AssertEquals("v", property.Value); - - // Set Value to an empty string - property.Value = String.Empty; - - Assertion.AssertEquals(string.Empty, property.Value); - } - - /// - /// Tests setting the BuildProperty Value to null - /// - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void SetValueToNull() - { - BuildProperty property = new BuildProperty("n", "v"); - Assertion.AssertEquals("v", property.Value); - - property.Value = null; - } - #endregion - - #region Clone Tests - /// - /// Tests BuildProperty Clone for a Deep Clone - /// - [Test] - public void CloneDeep() - { - BuildProperty property = new BuildProperty("n", "v"); - BuildProperty clone = property.Clone(true); - - Assertion.AssertEquals(property.Name, clone.Name); - Assertion.AssertEquals(property.Value, clone.Value); - - property.Value = "new"; - clone.Value = "other"; - - Assertion.AssertEquals("other", clone.Value); - Assertion.AssertEquals("new", property.Value); - Assertion.AssertEquals("n", property.Name); - Assertion.AssertEquals("n", clone.Name); - } - - /// - /// Tests BuildProperty Clone for a Shallow Clone - /// - [Test] - public void CloneShallowOfImportedProject() - { - Project p = GetProjectWithProperties(); - - BuildProperty property = GetSpecificBuildPropertyFromProject(p, null, "outdir"); - - BuildProperty clone = property.Clone(false); - - Assertion.AssertEquals(property.Name, clone.Name); - Assertion.AssertEquals(property.Value, clone.Value); - } - - /// - /// Tests BuildProperty Clone for a Shallow Clone by attempting to change the value of a Build Property item - /// - [Test] - [ExpectedException(typeof(InvalidOperationException))] - public void CloneShallowAttemptToChangeValueOfImportedProject() - { - Project p = GetProjectWithProperties(); - - BuildProperty property = GetSpecificBuildPropertyFromProject(p, null, "outdir"); - - BuildProperty clone = property.Clone(false); - - Assertion.AssertEquals(property.Name, clone.Name); - Assertion.AssertEquals(property.Value, clone.Value); - - property.Value = "new"; - } - - /// - /// Tests BuildProperty Clone for a Shallow Clone of an in-memory property - /// - /// Suggestion for v10 OM - return the message in the InvalidOperationException on why this is invalid - /// Why this fails "it's just an in-memory property. We can't do a shallow clone for this type of property, - /// because there's no XML element for the clone to share." (this is only available from the code) - /// - /// - [Test] - [ExpectedException(typeof(InvalidOperationException))] - public void CloneShallow_Invalid() - { - BuildProperty property = new BuildProperty("n", "v"); - BuildProperty clone = property.Clone(false); - } - #endregion - - #region ToString Tests - /// - /// Tests BuildProperty ToString with a simple string Value - /// - [Test] - public void BuildPropertyToStringWithSimpleStringValue() - { - BuildProperty property = new BuildProperty("n", "v"); - Assertion.AssertEquals("v", property.ToString()); - } - - /// - /// Tests BuildProperty ToString with an String.Empty Value - /// - [Test] - public void BuildPropertyToStringWithEmptyStringValue() - { - BuildProperty property = new BuildProperty("n", String.Empty); - Assertion.AssertEquals(String.Empty, property.ToString()); - } - - /// - /// Tests BuildProperty ToString after modifying the Value - /// - [Test] - public void BuildPropertyToStringAfterModifyingValue() - { - BuildProperty property = new BuildProperty("n", "v"); - property.Value = "new"; - Assertion.AssertEquals("new", property.ToString()); - } - #endregion - - #region IsImported Tests - /// - /// Tests BuildProperty IsImported simple case - /// - [Test] - public void IsImportedExpectedFalse() - { - BuildProperty property = new BuildProperty("n", "v"); - Assertion.AssertEquals(false, property.IsImported); - } - - /// - /// Tests BuildProperty IsImported when build property is only imported - /// - [Test] - public void IsImportedExpectedTrueWhenOnlyFromImport() - { - Project p = GetProjectWithProperties(); - - BuildProperty property = GetSpecificBuildPropertyFromProject(p, null, "outdir"); - - Assertion.AssertEquals(true, property.IsImported); - } - - /// - /// Tests BuildProperty IsImported when build property is not imported - /// - [Test] - public void IsImportedExpectedFalseComesDirectlyFromProject() - { - Project p = GetProjectWithProperties(); - - BuildProperty property = GetSpecificBuildPropertyFromProject(p, null, "f"); - - Assertion.AssertEquals(false, property.IsImported); - } - - /// - /// Tests BuildProperty IsImported when build property comes directly from the project and is also imported - /// - [Test] - public void IsImportedExpectedTrueComesDirectlyFromProjectAndImport() - { - Project p = GetProjectWithProperties(new string[] { "234" }); - - BuildProperty property = GetSpecificBuildPropertyFromProject(p, null, "maxtargetpath"); - - Assertion.AssertEquals(true, property.IsImported); - } - - /// - /// Tests BuildProperty IsImported when build property is imported and comes directly from the project - /// - [Test] - public void IsImportedExpectedFalseComesFromImportAndDirectlyFromProject() - { - Project p = GetProjectWithProperties(new string[] { "234" }); - - BuildProperty property = GetSpecificBuildPropertyFromProject(p, null, "maxtargetpath", false); - - Assertion.AssertEquals(false, property.IsImported); - } - #endregion - - #region Condition Tests - /// - /// Tests BuildProperty Condition when a condition exists - /// - [Test] - public void ConditionGetWhenConditionExists() - { - string s = "v3"; - Project p = GetProjectWithProperties(new string[] { s }); - - BuildProperty property = GetSpecificBuildPropertyFromProject(p, null, "n3"); - - Assertion.AssertEquals("true", property.Condition); - } - - /// - /// Tests BuildProperty Condition when no condition exists - /// - [Test] - public void ConditionGetWhenNoConditionExists() - { - Project p = GetProjectWithProperties(); - - BuildProperty property = GetSpecificBuildPropertyFromProject(p, null, "f"); - - Assertion.AssertEquals(String.Empty, property.Condition); - } - - /// - /// Tests BuildProperty Condition, setting a condition when no previous condition exists - /// - [Test] - public void ConditionSetWhenNoConditionExists() - { - Project p = GetProjectWithProperties(); - - BuildProperty property = GetSpecificBuildPropertyFromProject(p, null, "f"); - property.Condition = "true"; - - Assertion.AssertEquals("true", property.Condition); - } - - /// - /// Tests BuildProperty Condition, setting a condition when no previous condition exists - /// - [Test] - public void ConditionSetWithNoPreviousCondition() - { - Project p = GetProjectWithProperties(); - - BuildProperty property = GetSpecificBuildPropertyFromProject(p, null, "f"); - property.Condition = "true"; - - Assertion.AssertEquals("true", property.Condition); - - p.Build(); - - BuildProperty prop = GetSpecificBuildPropertyFromProject(p, null, "f"); - Console.WriteLine("'{0}'", prop.Condition); - } - - /// - /// Tests BuildProperty Condition, setting a condition when a previous condition exists - /// - [Test] - public void ConditionChangingWhenConditionExists() - { - Project p = GetProjectWithProperties(); - - BuildProperty property = GetSpecificBuildPropertyFromProject(p, null, "b"); - property.Condition = "false"; - Assertion.AssertEquals("false", property.Condition); - } - - /// - /// Tests BuildProperty Condition when the Condition includes an Item Group - /// - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void ConditionItemGroupInAPropertyCondition() - { - string projectContent = @" - - - @(x) - - - - - - "; - Project p = ObjectModelHelpers.CreateInMemoryProject(projectContent); - - p.Build(new string[] { "t" }, null); - } - - /// - /// Tests BuildProperty Before/After a Build - /// - [Test] - public void BuildPropertyCreatedDuringBuild() - { - string projectContents = @" - - - - v - - - - "; - - Project p = ObjectModelHelpers.CreateInMemoryProject(projectContents); - - Assertion.AssertEquals(0, p.PropertyGroups.Count); - Assertion.AssertEquals(null, p.GetEvaluatedProperty("n")); - - p.Build(); - - Assertion.AssertEquals("v", p.GetEvaluatedProperty("n")); - Assertion.AssertEquals(0, p.PropertyGroups.Count); - } - #endregion - - #region FinalValue Tests - /// - /// Tests BuildProperty FinalValue when value is a simple string - /// - [Test] - public void FinalValueWithSimpleStringValue() - { - BuildProperty property = new BuildProperty("n", "v"); - Assertion.AssertEquals("v", property.FinalValue); - } - - /// - /// Tests BuildProperty FinalValue when value is an empty string - /// - [Test] - public void FinalValueWithEmptyStringValue() - { - BuildProperty property = new BuildProperty("n", String.Empty); - Assertion.AssertEquals(String.Empty, property.FinalValue); - } - - /// - /// Tests BuildProperty FinalValue when value comes from a project - /// - [Test] - public void FinalValueWithInProject() - { - Project p = GetProjectWithProperties(new string[] { "v1" }); - - BuildProperty property = GetSpecificBuildPropertyFromProject(p, null, "j"); - - Assertion.AssertEquals("v1", property.FinalValue); - } - - /// - /// Tests BuildProperty FinalValue when value contains escape characters - /// - [Test] - public void FinalValueWhereValueContainsEscapeCharacters() - { - Project p = GetProjectWithProperties(new string[] { "The&Fat&Cat&RanUpThe>Road<ToMeetTheThinDog" }); - - BuildProperty property = GetSpecificBuildPropertyFromProject(p, null, "j"); - - Assertion.AssertEquals("The&Fat&Cat&RanUpThe>Road - /// Tests static explicit operator string - ///
- [Test] - public void StaticExplicitOperatorString() - { - BuildProperty property = new BuildProperty("n", "v"); - Assertion.AssertEquals("v", (string)property); - } - - /// - /// Tests static explicit operator string when value is an empty string - /// - [Test] - public void StaticExplicitOperatorStringWithEmptyStringValue() - { - BuildProperty property = new BuildProperty("n", String.Empty); - Assertion.AssertEquals(String.Empty, (string)property); - } - - /// - /// Tests static explicit operator string when value comes from a project - /// - [Test] - public void StaticExplicitOperatorStringWithInProject() - { - Project p = GetProjectWithProperties(new string[] { "v1" }); - - BuildProperty property = GetSpecificBuildPropertyFromProject(p, null, "j"); - - Assertion.AssertEquals("v1", (string)property); - } - - /// - /// Tests static explicit operator string when value contains escape characters - /// - [Test] - public void StaticExplicitOperatorStringWhereValueContainsEscapeCharacters() - { - Project p = GetProjectWithProperties(new string[] { "The&Fat&Cat&RanUpThe>Road<ToMeetTheThinDog" }); - - BuildProperty property = GetSpecificBuildPropertyFromProject(p, null, "jar"); - - Assertion.AssertEquals("The&Fat&Cat&RanUpThe>Road - /// Gets a specified Build Projecty from a given project, assumes specified Property expected First - ///
- /// Project - /// BuildProperty - /// Specific Build Property that you want - /// The specified Build Property - private static BuildProperty GetSpecificBuildPropertyFromProject(Project p, BuildProperty property, string buildPropertyName) - { - return GetSpecificBuildPropertyFromProject(p, property, buildPropertyName, true); - } - - /// - /// Gets a specified Build Property from a given project - /// - /// Project - /// BuildProperty - /// Specific Build Property that you want - /// True if expected Property comes first, False expected property comes second - /// The specified Build Property - private static BuildProperty GetSpecificBuildPropertyFromProject(Project p, BuildProperty property, string buildPropertyName, bool expectedPropertyFirst) - { - foreach (BuildPropertyGroup group in p.PropertyGroups) - { - foreach (BuildProperty prop in group) - { - if (String.Equals(prop.Name, buildPropertyName, StringComparison.OrdinalIgnoreCase)) - { - property = prop; - if (expectedPropertyFirst) - { - break; - } - else - { - return property; - } - } - } - } - - return property; - } - - /// - /// Creates a Project with default XML Content - /// - /// Project p with default XML Content - private static Project GetProjectWithProperties() - { - return GetProjectWithProperties(new string[] { }); - } - - /// - /// Creates a Project with XML Content. Basic XML content is defined, you can pass in additional Build Properties - /// - /// Project p with default XML Content plus additional specified Build Property Items - private static Project GetProjectWithProperties(string[] propertyGroupBuildItemAtAddIntoContent) - { - string projectContent; - - if (propertyGroupBuildItemAtAddIntoContent.Length == 0) - { - projectContent = ObjectModelHelpers.CleanupFileContents(@" - - - fvalue - bvalue - - - "); - } - else - { - string contentToInsert = string.Empty; - foreach (string s in propertyGroupBuildItemAtAddIntoContent) - { - contentToInsert += s; - } - - projectContent = String.Format - (ObjectModelHelpers.CleanupFileContents( - @" - - fvalue - bvalue - {0} - - - "), - contentToInsert - ); - } - - Project p = Build.UnitTests.ObjectModelHelpers.CreateInMemoryProject(projectContent); - return p; - } - #endregion - } -} diff --git a/src/Deprecated/Engine.UnitTests/Compatibility/BuildTask_Tests.cs b/src/Deprecated/Engine.UnitTests/Compatibility/BuildTask_Tests.cs deleted file mode 100644 index bcf2cd1b28f..00000000000 --- a/src/Deprecated/Engine.UnitTests/Compatibility/BuildTask_Tests.cs +++ /dev/null @@ -1,1593 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.IO; -using System.Xml; -using System.Collections.Generic; -using NUnit.Framework; - -using Microsoft.Build.BuildEngine; -using Microsoft.Build.Framework; -using Microsoft.Build.UnitTests; - -namespace Microsoft.Build.UnitTests.OM.OrcasCompatibility -{ - /// - /// Test Fixture Class for the v9 Object Model Public Interface Compatibility Tests for the BuildTask Class. - /// - [TestFixture] - public sealed class BuildTask_Tests - { - #region Common Helpers - /// - /// Basic Project Contents with a Target 't' that contains 1 BuildTask 'Task' where - /// the BuildTask contains no parameters. - /// - private string ProjectContentsWithOneTask = ObjectModelHelpers.CleanupFileContents(@" - - - - - - "); - - /// - /// Engine that is used through out test class - /// - private Engine engine; - - /// - /// Project that is used through out test class - /// - private Project project; - - /// - /// MockLogger that is used through out test class - /// - private MockLogger logger; - - /// - /// Creates the engine and parent object. Also registers the mock logger. - /// - [SetUp()] - public void Initialize() - { - ObjectModelHelpers.DeleteTempProjectDirectory(); - - engine = new Engine(); - engine.DefaultToolsVersion = "4.0"; - project = new Project(engine); - logger = new MockLogger(); - project.ParentEngine.RegisterLogger(logger); - } - - /// - /// Unloads projects and un-registers logger. - /// - [TearDown()] - public void Cleanup() - { - engine.UnloadProject(project); - engine.UnloadAllProjects(); - engine.UnregisterAllLoggers(); - - ObjectModelHelpers.DeleteTempProjectDirectory(); - } - #endregion - - #region Condition Tests - /// - /// Tests BuildTask.Condition Get simple/basic case - /// - [Test] - public void ConditionGetSimple() - { - string projectContents = ObjectModelHelpers.CleanupFileContents(@" - - - - - - - "); - - project.LoadXml(projectContents); - BuildTask task = GetSpecificBuildTask(project, "t", "Task"); - - Assertion.AssertEquals("'a' == 'b'", task.Condition); - } - - /// - /// Tests BuildTask.Condition Get when Condition is an empty string - /// - [Test] - public void ConditionGetEmptyString() - { - string projectContents = ObjectModelHelpers.CleanupFileContents(@" - - - - - - - "); - - project.LoadXml(projectContents); - BuildTask task = GetSpecificBuildTask(project, "t", "Task"); - - Assertion.AssertEquals(String.Empty, task.Condition); - } - - /// - /// Tests BuildTask.Condition Get when condition contains special characters - /// - [Test] - public void ConditionGetSpecialCharacters() - { - string projectContents = ObjectModelHelpers.CleanupFileContents(@" - - - - - - - "); - - project.LoadXml(projectContents); - BuildTask task = GetSpecificBuildTask(project, "t", "Task"); - - Assertion.AssertEquals("%24%40%3b%5c%25", task.Condition); - } - - /// - /// Tests BuildTask.Condition Get from an imported project - /// - [Test] - public void ConditionGetFromImportedProject() - { - string importProjectContents = ObjectModelHelpers.CleanupFileContents(@" - - - - - - - "); - - Project p = GetProjectThatImportsAnotherProject(importProjectContents, null); - BuildTask task = GetSpecificBuildTask(p, "t2", "t2.Task"); - - Assertion.AssertEquals("'a' == 'b'", task.Condition); - } - - /// - /// Tests BuildTask.Condition Set when no previous exists - /// - [Test] - public void ConditionSetWhenNoPreviousConditionExists() - { - project.LoadXml(ProjectContentsWithOneTask); - BuildTask task = GetSpecificBuildTask(project, "t", "Task"); - - task.Condition = "'t' == 'f'"; - - Assertion.AssertEquals("'t' == 'f'", task.Condition); - } - - /// - /// Tests BuildTask.Condition Set when an existing condition exists, changing the condition - /// - [Test] - public void ConditionSetOverExistingCondition() - { - string projectContents = ObjectModelHelpers.CleanupFileContents(@" - - - - - - - "); - - project.LoadXml(projectContents); - BuildTask task = GetSpecificBuildTask(project, "t", "Task"); - - task.Condition = "'c' == 'd'"; - - Assertion.AssertEquals("'c' == 'd'", task.Condition); - } - - /// - /// Tests BuildTask.Condition Set to an empty string - /// - [Test] - public void ConditionSetToEmtpyString() - { - project.LoadXml(ProjectContentsWithOneTask); - BuildTask task = GetSpecificBuildTask(project, "t", "Task"); - - task.Condition = String.Empty; - - Assertion.AssertEquals(String.Empty, task.Condition); - } - - /// - /// Tests BuildTask.Condition Set to null - /// - [Test] - public void ConditionSetToNull() - { - project.LoadXml(ProjectContentsWithOneTask); - BuildTask task = GetSpecificBuildTask(project, "t", "Task"); - - task.Condition = null; - - Assertion.AssertEquals(String.Empty, task.Condition); - } - - /// - /// Tests BuildTask.Condition Set to Special Characters - /// - [Test] - public void ConditionSetToSpecialCharacters() - { - project.LoadXml(ProjectContentsWithOneTask); - BuildTask task = GetSpecificBuildTask(project, "t", "Task"); - - task.Condition = "%24%40%3b%5c%25"; - - Assertion.AssertEquals("%24%40%3b%5c%25", task.Condition); - } - - /// - /// Tests BuildTask.Condition Set on an Imported Project - /// - [Test] - [ExpectedException(typeof(InvalidOperationException))] - public void ConditionSetOnImportedProject() - { - Project p = GetProjectThatImportsAnotherProject(null, null); - BuildTask task = GetSpecificBuildTask(p, "t3", "t3.Task3"); - - task.Condition = "true"; - } - - /// - /// Tests BuildTask.Condition Set, save to disk and verify - /// - [Test] - public void ConditionSaveProjectAfterSet() - { - project.LoadXml(ProjectContentsWithOneTask); - BuildTask task = GetSpecificBuildTask(project, "t", "Task"); - - task.Condition = "'a' == 'b'"; - - string expectedProjectContents = ObjectModelHelpers.CleanupFileContents(@" - - - - - - "); - - SaveProjectToDiskAndCompareAgainstExpectedContents(project, expectedProjectContents); - } - #endregion - - #region ContinueOnError Tests - /// - /// Tests BuildTask.ContinueOnError Get for all cases that would return true - /// - [Test] - public void ContinueOnErrorGetTrue() - { - string projectContents = ObjectModelHelpers.CleanupFileContents(@" - - - - - - - - - - - - - "); - - project.LoadXml(projectContents); - List continueOnErrorResults = GetListOfContinueOnErrorResultsFromSpecificProject(project); - - Assertion.AssertEquals(true, continueOnErrorResults.TrueForAll(delegate(bool b) { return b; })); - } - - /// - /// Tests BuildTask.ContinueOnError Get for all cases that would return false - /// - [Test] - public void ContinueOnErrorGetFalse() - { - string projectContents = ObjectModelHelpers.CleanupFileContents(@" - - - - - - - - - - - - - "); - - project.LoadXml(projectContents); - List continueOnErrorResults = GetListOfContinueOnErrorResultsFromSpecificProject(project); - - Assertion.AssertEquals(true, continueOnErrorResults.TrueForAll(delegate(bool b) { return !b; })); - } - - /// - /// Tests BuildTask.ContinueOnError Get when value is an empty string - /// - [Test] - [ExpectedException(typeof(ArgumentException))] - public void ContinueOnErrorGetEmptyString() - { - string projectContents = ObjectModelHelpers.CleanupFileContents(@" - - - - - - "); - - project.LoadXml(projectContents); - BuildTask task = GetSpecificBuildTask(project, "t", "Task"); - - task.ContinueOnError.ToString(); - } - - /// - /// Tests BuildTask.ContinueOnError Get when value is something that won't return true or false - invalid - /// - [Test] - [ExpectedException(typeof(ArgumentException))] - public void ContinueOnErrorGetInvalid() - { - string projectContents = ObjectModelHelpers.CleanupFileContents(ObjectModelHelpers.CleanupFileContents(@" - - - - - - ")); - - project.LoadXml(projectContents); - BuildTask task = GetSpecificBuildTask(project, "t", "Task"); - - task.ContinueOnError.ToString(); - } - - /// - /// Tests BuildTask.ContinueOnError Get of a BuildTask from an imported Project - /// - [Test] - public void ContinueOnErrorGetFromImportedProject() - { - string importProjectContents = ObjectModelHelpers.CleanupFileContents(@" - - - - - - "); - - Project p = GetProjectThatImportsAnotherProject(importProjectContents, null); - BuildTask task = GetSpecificBuildTask(p, "t2", "t2.Task"); - - Assertion.AssertEquals(true, task.ContinueOnError); - } - - /// - /// Tests BuildTask.ContinueOnError Set when no previous ContinueOnError value exists - /// - [Test] - public void ContinueOnErrorSetWhenNoContinueOnErrorExists() - { - project.LoadXml(ProjectContentsWithOneTask); - BuildTask task = GetSpecificBuildTask(project, "t", "Task"); - task.ContinueOnError = true; - - Assertion.AssertEquals(true, task.ContinueOnError); - } - - /// - /// Tests BuildTask.ContinueOnError Set when a ContinueOnError value exists (basically changing from true to false) - /// - [Test] - public void ContinueOnErrorSetWhenContinueOnErrorExists() - { - string projectContents = ObjectModelHelpers.CleanupFileContents(@" - - - - - - "); - - project.LoadXml(projectContents); - BuildTask task = GetSpecificBuildTask(project, "t", "Task"); - task.ContinueOnError = false; - - Assertion.AssertEquals(false, task.ContinueOnError); - } - - /// - /// Tests BuildTask.ContinueOnError Set to true - /// - [Test] - public void ContinueOnErrorSetToTrue() - { - project.LoadXml(ProjectContentsWithOneTask); - BuildTask task = GetSpecificBuildTask(project, "t", "Task"); - task.ContinueOnError = true; - - Assertion.AssertEquals(true, task.ContinueOnError); - } - - /// - /// Tests BuildTask.ContinueOnError Set to false - /// - [Test] - public void ContinueOnErrorSetToFalse() - { - project.LoadXml(ProjectContentsWithOneTask); - BuildTask task = GetSpecificBuildTask(project, "t", "Task"); - task.ContinueOnError = false; - - Assertion.AssertEquals(false, task.ContinueOnError); - } - - /// - /// Tests BuildTask.ContinueOnError Set on an imported project - /// - [Test] - [ExpectedException(typeof(InvalidOperationException))] - public void ContinueOnErrorSetOnImportedProject() - { - Project p = GetProjectThatImportsAnotherProject(null, null); - BuildTask task = GetSpecificBuildTask(p, "t2", "t2.Task2"); - - task.ContinueOnError = true; - } - - /// - /// Tests BuildTask.ContinueOnError Set, then save to disk and verify - /// - [Test] - public void ContinueOnErrorSaveProjectAfterSet() - { - project.LoadXml(ProjectContentsWithOneTask); - BuildTask task = GetSpecificBuildTask(project, "t", "Task"); - - task.ContinueOnError = true; - - string expectedProjectContents = ObjectModelHelpers.CleanupFileContents(@" - - - - - - "); - - SaveProjectToDiskAndCompareAgainstExpectedContents(project, expectedProjectContents); - } - #endregion - - #region HostObject Tests - /// - /// Tests BuildTask.HostObject simple set and get with only one BuildTask - /// - [Test] - public void HostObjectSetGetOneTask() - { - string projectContents = ObjectModelHelpers.CleanupFileContents(@" - - - - - - "); - - project.LoadXml(projectContents); - BuildTask task = GetSpecificBuildTask(project, "t", "Message"); - - MockHostObject hostObject = new MockHostObject(); - task.HostObject = hostObject; - - Assertion.AssertSame(task.HostObject.ToString(), hostObject.ToString()); - } - - /// - /// Tests BuildTask.HostObject Set/Get with several BuildTasks - /// - [Test] - public void HostObjectSetGetMultipleTasks() - { - string projectContents = ObjectModelHelpers.CleanupFileContents(@" - - - - - - - "); - - project.LoadXml(projectContents); - BuildTask task1 = GetSpecificBuildTask(project, "t", "Message"); - BuildTask task2 = GetSpecificBuildTask(project, "t", "MyTask"); - - MockHostObject hostObject1 = new MockHostObject(); - MockHostObject hostObject2 = new MockHostObject(); - - task1.HostObject = hostObject1; - task2.HostObject = hostObject2; - - Assertion.AssertSame(task1.HostObject.ToString(), hostObject1.ToString()); - Assertion.AssertSame(task2.HostObject.ToString(), hostObject2.ToString()); - } - - /// - /// Tests BuildTask.HostObject Get before the Object Reference is set to an instance of an object - /// - [Test] - [ExpectedException(typeof(NullReferenceException))] - public void HostObjectGetBeforeObjectReferenceSet() - { - string projectContents = ObjectModelHelpers.CleanupFileContents(@" - - - - - - "); - - project.LoadXml(projectContents); - BuildTask task = GetSpecificBuildTask(project, "t", "Message"); - - task.HostObject.ToString(); - } - #endregion - - #region Name Tests - /// - /// Tests BuildTask.Name get when only one BuildTask exists - /// - [Test] - public void NameWithOneBuildTask() - { - string projectContents = ObjectModelHelpers.CleanupFileContents(@" - - - - - - "); - - project.LoadXml(projectContents); - BuildTask task = GetSpecificBuildTask(project, "t", "Task"); - - Assertion.AssertEquals("Task", task.Name); - } - - /// - /// Tests BuildTask.Name get when several BuildTasks exist within the same target - /// - [Test] - public void NameWithSeveralBuildTasksInSameTarget() - { - string projectContents = ObjectModelHelpers.CleanupFileContents(@" - - - - - - - - "); - - project.LoadXml(projectContents); - - Assertion.AssertEquals("Task1", GetSpecificBuildTask(project, "t", "Task1").Name); - Assertion.AssertEquals("Task2", GetSpecificBuildTask(project, "t", "Task2").Name); - Assertion.AssertEquals("Task3", GetSpecificBuildTask(project, "t", "Task3").Name); - } - - /// - /// Tests BuildTask.Name get when several BuildTasks exist within different targets - /// - [Test] - public void NameWithSeveralBuildTasksInDifferentTargets() - { - string projectContents = ObjectModelHelpers.CleanupFileContents(@" - - - - - - - - - - - - "); - - project.LoadXml(projectContents); - - Assertion.AssertEquals("t1.Task1", GetSpecificBuildTask(project, "t1", "t1.Task1").Name); - Assertion.AssertEquals("t2.Task1", GetSpecificBuildTask(project, "t2", "t2.Task1").Name); - Assertion.AssertEquals("t3.Task2", GetSpecificBuildTask(project, "t3", "t3.Task2").Name); - } - - /// - /// Tests BuildTask.Name get when BuildTask comes from an imported Project - /// - [Test] - public void NameOfBuildTaskFromImportedProject() - { - Project p = GetProjectThatImportsAnotherProject(null, null); - - Assertion.AssertEquals("t3.Task3", GetSpecificBuildTask(p, "t3", "t3.Task3").Name); - } - - /// - /// Tests BuildTask.Name get when BuildTask was just created - /// - [Test] - public void NameOfBuildTaskOfANewlyCreatedBuildTask() - { - string projectContents = ObjectModelHelpers.CleanupFileContents(@" - - - - "); - project.LoadXml(projectContents); - Target t = GetSpecificTargetFromProject(project, "t1", false); - BuildTask task = t.AddNewTask("Task"); - task.SetParameterValue("parameter", "value"); - - Assertion.AssertEquals("Task", GetSpecificBuildTask(project, "t1", "Task").Name); - } - #endregion - - #region Type Tests - /// - /// Tests BuildTask.Type when Task class exists (Message) - /// - [Test] - public void TypeTaskExists() - { - string projectContents = ObjectModelHelpers.CleanupFileContents(@" - - - - - - "); - - project.LoadXml(projectContents); - BuildTask task = GetSpecificBuildTask(project, "t", "Message"); - - Assertion.AssertEquals(0, String.Compare(task.Type.ToString(), "Microsoft.Build.Tasks.Message")); - } - - /// - /// Tests BuildTask.Type when Task class doesn't exists (MyFooTask) - /// - [Test] - [ExpectedException(typeof(InvalidOperationException))] - public void TypeTaskNotExists() - { - string projectContents = ObjectModelHelpers.CleanupFileContents(@" - - - - - - "); - - project.LoadXml(projectContents); - BuildTask task = GetSpecificBuildTask(project, "t", "MyFooTask"); - - Type t = task.Type; - } - - /// - /// Tests BuildTask.Type when BuildTask is null - /// - [Test] - [ExpectedException(typeof(NullReferenceException))] - public void TypeTaskIsNull() - { - project.LoadXml(ProjectContentsWithOneTask); - BuildTask task = null; - - Type t = task.Type; - } - #endregion - - #region AddOutputItem/AddOutputProperty Tests - /// - /// Tests BuildTask.AddOutputItem/AddOutputProperty by adding a new OutputItem/OutputProperty when none exist - /// - [Test] - public void AddOutputItemPropertyWhenNoOutputItemsPropertyExist() - { - project.LoadXml(ProjectContentsWithOneTask); - BuildTask task = GetSpecificBuildTask(project, "t", "Task"); - - task.AddOutputItem("ip", "in"); - task.AddOutputProperty("pp", "pn"); - - string expectedProjectContents = ObjectModelHelpers.CleanupFileContents(@" - - - - - - - - - "); - - SaveProjectToDiskAndCompareAgainstExpectedContents(project, expectedProjectContents); - } - - /// - /// Tests BuildTask.AddOutputItem/AddOutputProperty by adding a new OutputItem/OutputProperty when several exist - /// - [Test] - public void AddOutputItemPropertyWhenOutputItemsPropertiesExist() - { - string projectContents = ObjectModelHelpers.CleanupFileContents(@" - - - - - - - - - - - - - "); - - project.LoadXml(projectContents); - BuildTask task = GetSpecificBuildTask(project, "t", "Task"); - - task.AddOutputItem("ip4", "in4"); - task.AddOutputProperty("pp4", "pn4"); - - string expectedProjectContents = ObjectModelHelpers.CleanupFileContents(@" - - - - - - - - - - - - - - - "); - - SaveProjectToDiskAndCompareAgainstExpectedContents(project, expectedProjectContents); - } - - /// - /// Tests BuildTask.AddOutputItem/AddOutputProperty by adding a new OutputItem/OutputProperty - /// with the same values as an existing OutputItem/OutputProperty - /// - [Test] - public void AddOutputItemPropertyWithSameValuesAsExistingOutputItemProperty() - { - string projectContents = ObjectModelHelpers.CleanupFileContents(@" - - - - - - - - - "); - - project.LoadXml(projectContents); - BuildTask task = GetSpecificBuildTask(project, "t", "Task"); - - task.AddOutputItem("ip", "in"); - task.AddOutputProperty("pp", "pn"); - - string expectedProjectContents = ObjectModelHelpers.CleanupFileContents(@" - - - - - - - - - - - "); - - SaveProjectToDiskAndCompareAgainstExpectedContents(project, expectedProjectContents); - } - - /// - /// Tests BuildTask.AddOutputItem/AddOutputProperty by adding Empty Strings for the taskParameter and itemName/propertyName - /// - [Test] - public void AddOutputItemPropertyWithEmptyStrings() - { - project.LoadXml(ProjectContentsWithOneTask); - BuildTask task = GetSpecificBuildTask(project, "t", "Task"); - - task.AddOutputItem(String.Empty, String.Empty); - task.AddOutputProperty(String.Empty, String.Empty); - - string expectedProjectContents = ObjectModelHelpers.CleanupFileContents(@" - - - - - - - - - "); - - SaveProjectToDiskAndCompareAgainstExpectedContents(project, expectedProjectContents); - } - - /// - /// Tests BuildTask.AddOutputItem/AddOutputProperty by adding nulls for the taskParameter and itemName/propertyName - /// - [Test] - public void AddOutputItemPropertyWithNulls() - { - project.LoadXml(ProjectContentsWithOneTask); - BuildTask task = GetSpecificBuildTask(project, "t", "Task"); - - task.AddOutputItem(null, null); - task.AddOutputProperty(null, null); - - string expectedProjectContents = ObjectModelHelpers.CleanupFileContents(@" - - - - - - - - - "); - - SaveProjectToDiskAndCompareAgainstExpectedContents(project, expectedProjectContents); - } - - /// - /// Tests BuildTask.AddOutputItem/AddOutputProperty by passing in Special characters into the taskParameter and itemName/propertyName - /// - [Test] - public void AddOutputItemPropertyWithSpecialCharacters() - { - project.LoadXml(ProjectContentsWithOneTask); - BuildTask task = GetSpecificBuildTask(project, "t", "Task"); - - task.AddOutputItem("%24%40%3b%5c%25", "%24%40%3b%5c%25"); - task.AddOutputProperty("%24%40%3b%5c%25", "%24%40%3b%5c%25"); - - string expectedProjectContents = ObjectModelHelpers.CleanupFileContents(@" - - - - - - - - - "); - - SaveProjectToDiskAndCompareAgainstExpectedContents(project, expectedProjectContents); - } - - /// - /// Tests BuildTask.AddOutputItem by attempting to add an OutputItem to an imported Project - /// - [Test] - [ExpectedException(typeof(InvalidOperationException))] - public void AddOutputItemToImportedProject() - { - Project p = GetProjectThatImportsAnotherProject(null, null); - BuildTask task = GetSpecificBuildTask(p, "t2", "t2.Task2"); - - task.AddOutputItem("p", "n"); - } - - /// - /// Tests BuildTask.AddOutputProperty by attempting to add an OutputProperty to an imported Project - /// - [Test] - [ExpectedException(typeof(InvalidOperationException))] - public void AddOutputPropertyToImportedProject() - { - Project p = GetProjectThatImportsAnotherProject(null, null); - BuildTask task = GetSpecificBuildTask(p, "t2", "t2.Task2"); - - task.AddOutputProperty("p", "n"); - } - #endregion - - #region Execute Tests - /// - /// Tests BuildTask.Execute basic case where expected to be true - /// - [Test] - public void ExecuteExpectedTrue() - { - string projectContents = ObjectModelHelpers.CleanupFileContents(@" - - - - - - - - - "); - - project.LoadXml(projectContents); - BuildTask task = GetSpecificBuildTask(project, "t2", "Message"); - - Assertion.AssertEquals(0, String.Compare(task.Type.ToString(), "Microsoft.Build.Tasks.Message", StringComparison.OrdinalIgnoreCase)); - - Assertion.AssertEquals(true, task.Execute()); - Assertion.AssertEquals(true, logger.FullLog.Contains("t2.message")); - Assertion.AssertEquals(false, logger.FullLog.Contains("t1.message")); - } - - /// - /// Tests BuildTask.Execute where the BuildTask is null - /// - [Test] - [ExpectedException(typeof(NullReferenceException))] - public void ExecuteOnNullBuildTask() - { - project.LoadXml(ProjectContentsWithOneTask); - BuildTask task = null; - - task.Execute(); - } - - /// - /// Tests BuildTask.Execute where the BuildTask doesn't do anything - /// - [Test] - public void ExecuteOnTaskThatDoesNothing() - { - project.LoadXml(ProjectContentsWithOneTask); - BuildTask task = GetSpecificBuildTask(project, "t", "Task"); - - Assertion.AssertEquals(false, task.Execute()); - Assertion.AssertEquals(true, logger.FullLog.Contains("MSB4036")); - } - - /// - /// Tests BuildTask.Execute where Task comes from an Imported Project - /// - [Test] - public void ExecuteFromImportedProject() - { - string importProjectContents = ObjectModelHelpers.CleanupFileContents(@" - - - - - - "); - - string parentProjectContents = ObjectModelHelpers.CleanupFileContents(@" - - - - "); - - Project p = GetProjectThatImportsAnotherProject(importProjectContents, parentProjectContents); - BuildTask task = GetSpecificBuildTask(p, "t", "Message"); - - Assertion.AssertEquals(true, task.Execute()); - } - #endregion - - #region GetParameterNames Tests - /// - /// Tests BuildTask.GetParameterNames when only one parameter exists on the BuildTask - /// - [Test] - public void GetParameterNamesOnlyOneParameterExists() - { - string projectContents = ObjectModelHelpers.CleanupFileContents(@" - - - - - - "); - - project.LoadXml(projectContents); - BuildTask task = GetSpecificBuildTask(project, "t", "Task"); - string[] parameters = task.GetParameterNames(); - - Assertion.AssertEquals(1, parameters.Length); - Assertion.AssertEquals("parameter", parameters[0]); - } - - /// - /// Tests BuildTask.GetParameterNames when no parameters exist on the BuildTask - /// - [Test] - public void GetParameterNamesNoParametersExist() - { - string projectContents = ObjectModelHelpers.CleanupFileContents(@" - - - - - - "); - - project.LoadXml(projectContents); - BuildTask task = GetSpecificBuildTask(project, "t", "Task"); - string[] parameters = task.GetParameterNames(); - - Assertion.AssertEquals(0, parameters.Length); - } - - /// - /// Tests BuildTask.GetParameterNames when several parameters exist on the BuildTask - /// - [Test] - public void GetParameterNamesLotsOfParametersExist() - { - string projectContents = ObjectModelHelpers.CleanupFileContents(@" - - - - - - "); - - project.LoadXml(projectContents); - BuildTask task = GetSpecificBuildTask(project, "t", "Task"); - string[] parameters = task.GetParameterNames(); - - Assertion.AssertEquals(4, parameters.Length); - Assertion.AssertEquals("p1", parameters[0]); - Assertion.AssertEquals("p2", parameters[1]); - Assertion.AssertEquals("p3", parameters[2]); - Assertion.AssertEquals("p4", parameters[3]); - } - #endregion - - #region GetParameterValue Tests - /// - /// Tests BuildTask.GetParameterValue on one BuildTask - /// - [Test] - public void GetParameterValueOneBuildTaskWithOneParameter() - { - string projectContents = ObjectModelHelpers.CleanupFileContents(@" - - - - - - "); - - project.LoadXml(projectContents); - BuildTask task = GetSpecificBuildTask(project, "t", "Task"); - - Assertion.AssertEquals("value", task.GetParameterValue("parameter")); - } - - /// - /// Tests BuildTask.GetParameterValue when parameter value is special characters - /// - [Test] - public void GetParameterValueWhenSpecialCharacters() - { - string projectContents = ObjectModelHelpers.CleanupFileContents(@" - - - - - - "); - - project.LoadXml(projectContents); - BuildTask task = GetSpecificBuildTask(project, "t", "Task"); - - Assertion.AssertEquals("%24%40%3b%5c%25", task.GetParameterValue("parameter")); - } - - /// - /// Tests BuildTask.GetParameterValue when parameter value is an empty string - /// - [Test] - public void GetParameterValueWhenEmtpyString() - { - string projectContents = ObjectModelHelpers.CleanupFileContents(@" - - - - - - "); - - project.LoadXml(projectContents); - BuildTask task = GetSpecificBuildTask(project, "t", "Task"); - - Assertion.AssertEquals(String.Empty, task.GetParameterValue("parameter")); - } - - /// - /// Tests BuildTask.GetParameterValue when parameter value is the Special Task Attribute 'Condition' - /// - [Test] - [ExpectedException(typeof(ArgumentException))] - public void GetParameterValueWhenSpecialTaskAttributeCondition() - { - string projectContents = ObjectModelHelpers.CleanupFileContents(@" - - - - - - "); - - project.LoadXml(projectContents); - BuildTask task = GetSpecificBuildTask(project, "t", "Task"); - - task.GetParameterValue("Condition"); - } - - /// - /// Tests BuildTask.GetParameterValue when parameter value is the Special Task Attribute 'ContinueOnError' - /// - [Test] - [ExpectedException(typeof(ArgumentException))] - public void GetParameterValueWhenSpecialTaskAttributeContinueOnError() - { - string projectContents = ObjectModelHelpers.CleanupFileContents(@" - - - - - - "); - - project.LoadXml(projectContents); - BuildTask task = GetSpecificBuildTask(project, "t", "Task"); - - task.GetParameterValue("ContinueOnError"); - } - - /// - /// Tests BuildTask.GetParameterValue when parameter value is the Special Task Attribute 'xmlns' - /// - [Test] - [ExpectedException(typeof(ArgumentException))] - public void GetParameterValueWhenSpecialTaskAttributexmlns() - { - string projectContents = ObjectModelHelpers.CleanupFileContents(@" - - - - - - "); - - project.LoadXml(projectContents); - BuildTask task = GetSpecificBuildTask(project, "t", "Task"); - - task.GetParameterValue("xmlns"); - } - - /// - /// Tests BuildTask.GetParameterValue when parameter value comes from an imported Project - /// - [Test] - public void GetParameterValueFromImportedProject() - { - Project p = GetProjectThatImportsAnotherProject(null, null); - BuildTask task = GetSpecificBuildTask(p, "t3", "t3.Task3"); - - Assertion.AssertEquals("value", task.GetParameterValue("parameter")); - } - #endregion - - #region SetParameterValue Tests - /// - /// Tests BuildTask.SetParameterValue on one BuildTask, simple case - /// - [Test] - public void SetParameterValueSimple() - { - project.LoadXml(ProjectContentsWithOneTask); - BuildTask task = GetSpecificBuildTask(project, "t", "Task"); - - task.SetParameterValue("p", "v"); - - Assertion.AssertEquals("v", task.GetParameterValue("p")); - } - - /// - /// Tests BuildTask.SetParameterValue to null - /// - [Test] - public void SetParameterValueToNull() - { - project.LoadXml(ProjectContentsWithOneTask); - BuildTask task = GetSpecificBuildTask(project, "t", "Task"); - - task.SetParameterValue("p", null); - Assertion.AssertEquals(String.Empty, task.GetParameterValue("p")); - } - - /// - /// Tests BuildTask.SetParameterValue to an Empty String - /// - [Test] - public void SetParameterValueToEmptyString() - { - project.LoadXml(ProjectContentsWithOneTask); - BuildTask task = GetSpecificBuildTask(project, "t", "Task"); - - task.SetParameterValue("p", String.Empty); - - Assertion.AssertEquals(String.Empty, task.GetParameterValue("p")); - } - - /// - /// Tests BuildTask.SetParameterValue to special characters - /// - [Test] - public void SetParameterValueToSpecialCharacters() - { - project.LoadXml(ProjectContentsWithOneTask); - BuildTask task = GetSpecificBuildTask(project, "t", "Task"); - - task.SetParameterValue("p", "%24%40%3b%5c%25"); - } - - /// - /// Tests BuildTask.SetParameterValue to Special Task Attribute Condition - /// - [Test] - [ExpectedException(typeof(ArgumentException))] - public void SetParameterValueToSpecialTaskAttributeCondition() - { - project.LoadXml(ProjectContentsWithOneTask); - BuildTask task = GetSpecificBuildTask(project, "t", "Task"); - - task.SetParameterValue("Condition", "v"); - } - - /// - /// Tests BuildTask.SetParameterValue to Special Task Attribute ContinueOnError - /// - [Test] - [ExpectedException(typeof(ArgumentException))] - public void SetParameterValueToSpecialTaskAttributeContinueOnError() - { - project.LoadXml(ProjectContentsWithOneTask); - BuildTask task = GetSpecificBuildTask(project, "t", "Task"); - - task.SetParameterValue("ContinueOnError", "v"); - } - - /// - /// Tests BuildTask.SetParameterValue to Special Task Attribute xmlns - /// - [Test] - [ExpectedException(typeof(ArgumentException))] - public void SetParameterValueToSpecialTaskAttributexmlns() - { - project.LoadXml(ProjectContentsWithOneTask); - BuildTask task = GetSpecificBuildTask(project, "t", "Task"); - - task.SetParameterValue("xmlns", "v"); - } - - /// - /// Tests BuildTask.SetParameterValue on a BuildTask from an Imported Project - /// - [Test] - [ExpectedException(typeof(InvalidOperationException))] - public void SetParameterValueOnBuildTaskFromImportedProject() - { - Project p = GetProjectThatImportsAnotherProject(null, null); - BuildTask task = GetSpecificBuildTask(p, "t3", "t3.Task3"); - - task.SetParameterValue("p", "v"); - } - - /// - /// Tests BuildTask.SetParameterValue on a BuildTask parameter that already exists - /// - [Test] - public void SetParameterValueOnAnExistingParameter() - { - string projectContents = ObjectModelHelpers.CleanupFileContents(@" - - - - - - "); - - project.LoadXml(projectContents); - BuildTask task = GetSpecificBuildTask(project, "t", "Task"); - - task.SetParameterValue("parameter", "new"); - - Assertion.AssertEquals("new", task.GetParameterValue("parameter")); - } - - /// - /// Tests BuildTask.SetParameterValue, then save to disk and verify - /// - [Test] - public void SetParameterValueSaveProjectAfterSet() - { - project.LoadXml(ProjectContentsWithOneTask); - BuildTask task = GetSpecificBuildTask(project, "t", "Task"); - - task.SetParameterValue("parameter", "value"); - - string expectedProjectContents = ObjectModelHelpers.CleanupFileContents(@" - - - - - - "); - - SaveProjectToDiskAndCompareAgainstExpectedContents(project, expectedProjectContents); - } - - /// - /// Tests BuildTask.SetParameterValue by setting the parameter name to an empty string - /// - [Test] - [ExpectedException(typeof(ArgumentException))] - public void SetParameterValueWithParameterNameSetToEmptyString() - { - project.LoadXml(ProjectContentsWithOneTask); - BuildTask task = GetSpecificBuildTask(project, "t", "Task"); - - task.SetParameterValue(String.Empty, "v"); - } - - /// - /// Tests BuildTask.SetParameterValue by setting the parameter name to null - /// - [Test] - [ExpectedException(typeof(NullReferenceException))] - public void SetParameterValueWithParameterNameSetToNull() - { - project.LoadXml(ProjectContentsWithOneTask); - BuildTask task = GetSpecificBuildTask(project, "t", "Task"); - - task.SetParameterValue(null, "v"); - } - - /// - /// Tests BuildTask.SetParameterValue by setting the parameter name to special characters - /// - [Test] - [ExpectedException(typeof(XmlException))] - public void SetParameterValueWithParameterNameSetToSpecialCharacters() - { - project.LoadXml(ProjectContentsWithOneTask); - BuildTask task = GetSpecificBuildTask(project, "t", "Task"); - - task.SetParameterValue("%24%40%3b%5c%25", "v"); - } - - /// - /// Tests BuildTask.SetParameterValue with the Treat Parameter Value As Literal set to true/false - /// - [Test] - public void SetParameterValueTreatParameterValueAsLiteral() - { - project.LoadXml(ProjectContentsWithOneTask); - BuildTask task = GetSpecificBuildTask(project, "t", "Task"); - - task.SetParameterValue("p1", @"%*?@$();\", true); - task.SetParameterValue("p2", @"%*?@$();\", false); - Assertion.AssertEquals(@"%25%2a%3f%40%24%28%29%3b\", task.GetParameterValue("p1")); - Assertion.AssertEquals(@"%*?@$();\", task.GetParameterValue("p2")); - } - #endregion - - #region Helpers - /// - /// Gets a list of all ContinueOnError results within your project - /// - /// Project - /// List of bool results for all ContinueOnError BuildTasks within your project - private List GetListOfContinueOnErrorResultsFromSpecificProject(Project p) - { - List continueOnErrorResults = new List(); - foreach (Target t in project.Targets) - { - foreach (BuildTask task in t) - { - continueOnErrorResults.Add(task.ContinueOnError); - } - } - - return continueOnErrorResults; - } - - /// - /// Gets the specified BuildTask from your specified Project and Target - /// - /// Project - /// Target that contains the BuildTask that you want - /// BuildTask name that you want - /// The specified BuildTask - private BuildTask GetSpecificBuildTask(Project p, string targetNameThatContainsBuildTask, string buildTaskName) - { - foreach (Target t in p.Targets) - { - if (String.Equals(t.Name, targetNameThatContainsBuildTask, StringComparison.OrdinalIgnoreCase)) - { - foreach (BuildTask task in t) - { - if (String.Equals(task.Name, buildTaskName, StringComparison.OrdinalIgnoreCase)) - { - return task; - } - } - } - } - - return null; - } - - /// - /// Gets a specified Target from a Project - /// - /// Project - /// Target name of the Target you want - /// If you want the last instance of a target set to true - /// Target requested. null if specific target isn't found - private Target GetSpecificTargetFromProject(Project p, string nameOfTarget, bool lastInstance) - { - Target target = null; - foreach (Target t in p.Targets) - { - if (String.Equals(t.Name, nameOfTarget, StringComparison.OrdinalIgnoreCase)) - { - if (!lastInstance) - { - return t; - } - else - { - target = t; - } - } - } - - return target; - } - - /// - /// Saves a given Project to disk and compares what's saved to disk with expected contents. Assertion handled within - /// ObjectModelHelpers.CompareProjectContents. - /// - /// Project to save - /// The Project content that you expect - private void SaveProjectToDiskAndCompareAgainstExpectedContents(Project p, string expectedProjectContents) - { - string savePath = Path.Combine(ObjectModelHelpers.TempProjectDir, "p.proj"); - p.Save(savePath); - - Engine e = new Engine(); - Project savedProject = new Project(e); - savedProject.Load(savePath); - - ObjectModelHelpers.CompareProjectContents(savedProject, expectedProjectContents); - ObjectModelHelpers.DeleteTempProjectDirectory(); - } - - /// - /// Gets a Project that imports another Project - /// - /// Project Contents of the imported Project, to get default content, pass in an empty string - /// Project Contents of the Parent Project, to get default content, pass in an empty string - /// Project - private Project GetProjectThatImportsAnotherProject(string importProjectContents, string parentProjectContents) - { - if (String.IsNullOrEmpty(importProjectContents)) - { - importProjectContents = ObjectModelHelpers.CleanupFileContents(@" - - - - - - - - - "); - } - - if (String.IsNullOrEmpty(parentProjectContents)) - { - parentProjectContents = ObjectModelHelpers.CleanupFileContents(@" - - - - - - - "); - } - - ObjectModelHelpers.CreateFileInTempProjectDirectory("import.proj", importProjectContents); - ObjectModelHelpers.CreateFileInTempProjectDirectory("main.proj", parentProjectContents); - return ObjectModelHelpers.LoadProjectFileInTempProjectDirectory("main.proj", null); - } - - /// - /// Un-registers the existing logger and registers a new copy. - /// We will use this when we do multiple builds so that we can safely - /// assert on log messages for that particular build. - /// - private void ResetLogger() - { - engine.UnregisterAllLoggers(); - logger = new MockLogger(); - project.ParentEngine.RegisterLogger(logger); - } - - /// - /// MyHostObject class for testing BuildTask HostObject - /// - internal class MockHostObject : ITaskHost - { - } - #endregion - } -} diff --git a/src/Deprecated/Engine.UnitTests/Compatibility/CompatibilityTestData.cs b/src/Deprecated/Engine.UnitTests/Compatibility/CompatibilityTestData.cs deleted file mode 100644 index f0d85703be9..00000000000 --- a/src/Deprecated/Engine.UnitTests/Compatibility/CompatibilityTestData.cs +++ /dev/null @@ -1,406 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections.Generic; -using System.Text; - -using NUnit.Framework; - -using Microsoft.Build; -using Microsoft.Build.BuildEngine; -using Microsoft.Build.Framework; -using Microsoft.Build.UnitTests; - -namespace Microsoft.Build.UnitTests.OM.OrcasCompatibility -{ - /// - /// Class wrapper for static data items used in unit tests - /// - internal static class TestData - { - /// - /// Test Data Item - /// - internal const string ContentSimpleTools35 = @" - - - - - - "; - - /// - /// Test Data Item - /// - internal const string ContentUsingTaskName = @" - - - "; - - /// - /// Test Data Item - /// - internal const string ContentUsingTaskFile = @" - - - true - - - "; - - /// - /// Test Data Item - /// - internal const string ContentA = @" - - - xmlValue - - - "; - - /// - /// Test Data Item - /// - internal const string ContentImportA = @" - - - - "; - - /// - /// Test Data Item - /// - internal const string ContentImportB = @" - - - - "; - - /// - /// Test Data Item - /// - internal const string ContentImport1 = @" - - - - - - - - - - - - "; - - /// - /// Test Data Item - /// - internal const string ContentImport2 = @" - - - - - - - - - xmlvalue - - - "; - - /// - /// Test Data Item - /// - internal const string ContentSimpleTools35InitialTargets = @" - - - - - - - - - - - - - - - "; - - /// - /// Test Data Item - /// - internal const string ContentSimpleUTF16 = @" - - - - - - "; - - /// - /// Test Data Item - /// - internal const string ContentSimpleInvalidEncoding = @" - - - - - - "; - - /// - /// Test Data Item - /// - internal const string ContentSimpleCustomToolsVersion = @" - - - - - - "; - - /// - /// Test Data Item - /// - internal const string ContentSimpleInvalidXml = @" - - - - - - "; - - /// - /// Test Data Item - /// - internal const string ContentSimpleInvalidMSBuildXml = @" - - - - - - "; - - /// - /// Test Data Item - /// - internal const string Content3SimpleTargetsDefaultSpecified = @" - - - - - - - - - - - - "; - - /// - /// Test Data Item - /// - internal const string Content3SimpleTargetsNoDefaultSpecified = @" - - - - - - - - - - - - "; - - /// - /// Test Data Item - /// - internal const string ContentCreatePropertyTarget = @" - - - xmlValue - - - - - - - - - - - - - - - - - - "; - - /// - /// Test Data Item - /// - internal const string ContentCreateItemTarget = @" - - - - - - - - - - - - - - "; - - /// - /// Test Data Item - /// - internal const string ContentInvalidTargetsWithOutput = @" - - - - - - - - - - "; - - /// - /// Test Data Item - /// - internal const string ContentValidTargetsWithOutput = @" - - - y - - - - - - - - - - - - - u - - - - "; - - /// - /// Test Data Item - /// - internal const string ItemGroup = @" - - - - - - - "; - - /// - /// Test Data Item - /// - internal const string ItemGroup2 = @" - - - - - - - - - - - - - - - - - - "; - - /// - /// Test Data Item - /// - internal const string ItemGroup3 = @" - - - - - - - - u - - - - - - - - - - - - "; - - /// - /// Test Data Item - /// - internal const string PropertyGroup = @" - - - v1 - v2 - v3 - - "; - - /// - /// Test Data Item - /// - internal const string ContentMissingImports = @" - - - - "; - - /// - /// Test Data Item - /// - internal const string ContentExtensions = @" - - - v1 - v2 - - - "; - } -} diff --git a/src/Deprecated/Engine.UnitTests/Compatibility/CompatibilityTestHelpers.cs b/src/Deprecated/Engine.UnitTests/Compatibility/CompatibilityTestHelpers.cs deleted file mode 100644 index 4ed7cdfc03f..00000000000 --- a/src/Deprecated/Engine.UnitTests/Compatibility/CompatibilityTestHelpers.cs +++ /dev/null @@ -1,324 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System.Collections.Generic; -using System; -using System.IO; -using System.Security.Principal; -using System.Security.AccessControl; -using System.Xml; -using System.Xml.XPath; -using System.Reflection; -using NUnit.Framework; -using Microsoft.Build; -using Microsoft.Build.BuildEngine; -using Microsoft.Build.Framework; -using Microsoft.Build.UnitTests; - -namespace Microsoft.Build.UnitTests.OM.OrcasCompatibility -{ - /// - /// Compatiblity Unit Test Helper methods - /// - public static class CompatibilityTestHelpers - { - /// - /// path for the msbuild core xml shema - /// - internal static readonly string SchemaPathBuildCore = Path.Combine(SuiteBinPath, @"MSBuild\Microsoft.Build.Core.xsd"); - - /// - /// URI for the msbuild xml schema - /// - internal static readonly Uri SchemaUrlMSBuild = new Uri("http://schemas.microsoft.com/developer/msbuild/2003"); - - /// - /// Path for the msbuild xml schema - /// - internal static readonly string SchemaPathMSBuild = Path.Combine(SuiteBinPath, @"Microsoft.Build.xsd"); - - /// - /// Field for suitbinPath, reference SuiteBinPath instead. - /// - private static string suiteBinPath = null; - - /// - /// Get the path of the current suite binaries. One time derivation. - /// - internal static string SuiteBinPath - { - get - { - if (suiteBinPath == null) - { - suiteBinPath = Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().EscapedCodeBase).LocalPath); - } - - return suiteBinPath; - } - } - - /// - /// Creates p.proj on disk in default location with sample content. - /// - /// Project File Content as a Local system path - internal static string CreateTempProjectFile() - { - return CreateTempProjectFile(TestData.ContentSimpleTools35); - } - - /// - /// Overload for project file content. - /// - /// Project File Content - internal static string CreateTempProjectFile(string projContent) - { - return ObjectModelHelpers.CreateFileInTempProjectDirectory("p.proj", projContent); - } - - /// - /// Generate a C:\ drive path that is over a certain minimum length - /// - /// - internal static string GenerateLongPath(int minLength) - { - string folderName = "directory"; - string drive = @"C:" + Path.DirectorySeparatorChar; - string longPath = drive; - while (longPath.Length < (minLength + folderName.Length)) // does not consider slashes - { - longPath = Path.Combine(longPath, folderName + Path.DirectorySeparatorChar); - } - - return longPath; - } - - /// - /// Sets file system rights for the current user on a given file. - /// - internal static void SetFileAccessPermissions(string filePath, FileSystemRights rights, AccessControlType state) - { - if (!File.Exists(filePath)) - { - throw new FileNotFoundException(filePath + " not found. Cannot set permissions"); - } - - FileSecurity projectSecurity = File.GetAccessControl(filePath); - FileSystemAccessRule rule = - new FileSystemAccessRule(WindowsIdentity.GetCurrent().Name, rights, state); - projectSecurity.AddAccessRule(rule); - File.SetAccessControl(filePath, projectSecurity); - } - - /// - /// Deletes the given file from disk - /// - internal static void RemoveFile(string tempProjectFilePath) - { - if (File.Exists(tempProjectFilePath)) - { - File.Delete(tempProjectFilePath); - } - } - - /// - /// Remove a given directory and its content - /// - /// The directory to remove - internal static void CleanupDirectory(string targetDirectory) - { - foreach (string file in Directory.GetFiles(targetDirectory, "*.*", SearchOption.AllDirectories)) - { - File.Delete(file); - } - - if (Directory.Exists(targetDirectory) && - (Directory.GetFiles(targetDirectory, "*.*", SearchOption.AllDirectories).Length == 0)) - { - Directory.Delete(targetDirectory, true); - } - } - - /// - /// Create a number of files at a given location with certain naming conventions. - /// - /// The number of files to create - /// The base name of the file eg: the "foo" part of "foo1.bar", "foo2.bar" - /// File extension for all created files - /// The path to an existing or non-existing directory in which the files should be created - internal static List CreateFiles(int numberOfFiles, string baseName, string extension, string createInPath) - { - if (!Directory.Exists(createInPath)) - { - Directory.CreateDirectory(createInPath); - } - - List files = new List(); - for (int i = 0; i < numberOfFiles; i++) - { - string fileName = Path.Combine(createInPath, baseName + i + "." + extension); - File.Create(fileName).Close(); - files.Add(fileName); - } - - return files; - } - - /// - /// Search import collection and return the matched Import object - /// - internal static Import GetImportByProjectPath(ImportCollection imports, string projPath) - { - foreach (Import import in imports) - { - if (import.ProjectPath == projPath) - { - return import; - } - } - - return null; - } - - /// - /// Search xml documents for a node and count the occurances. - /// - /// Number of nodes found - internal static int CountNodesWithName(string projectXml, string nodeName) - { - return GetNodesWithName(projectXml, nodeName).Count; - } - - /// - /// Search project xml for a node by name and return them - /// - /// Number of nodes found - internal static XmlNodeList GetNodesWithName(string projectXml, string nodeName) - { - XmlDocument xmlDoc = new XmlDocument(); - xmlDoc.LoadXml(projectXml); - XmlNodeList nodes = xmlDoc.DocumentElement.SelectNodes("//msb:" + nodeName, GetNsManager(xmlDoc)); - - return nodes; - } - - /// - /// Find and return a specified BuildProperty from a given project - /// - internal static BuildProperty FindBuildProperty(Project p, string buildPropertyName) - { - foreach (BuildPropertyGroup propertyGroup in p.PropertyGroups) - { - foreach (BuildProperty property in propertyGroup) - { - if (String.Compare(property.Name, buildPropertyName, StringComparison.OrdinalIgnoreCase) == 0) - { - return property; - } - } - } - - return null; - } - - /// - /// Find and return a specified BuildPropertyGroup from a given BuildProperty in a project - /// - internal static BuildPropertyGroup FindBuildPropertyGroupThatContainsProperty(Project p, string buildPropertyName) - { - foreach (BuildPropertyGroup propertyGroup in p.GlobalProperties) - { - foreach (BuildProperty property in propertyGroup) - { - if (String.Compare(property.Name, buildPropertyName, StringComparison.OrdinalIgnoreCase) == 0) - { - return propertyGroup; - } - } - } - - return null; - } - - /// - /// Find and return a specified BuildItem from a given project - /// - internal static BuildItem FindBuildItem(Project p, string itemName) - { - foreach (BuildItemGroup itemGroup in p.ItemGroups) - { - foreach (BuildItem item in itemGroup) - { - if (String.Equals(item.Name, itemName, StringComparison.OrdinalIgnoreCase)) - { - return item; - } - } - } - - return null; - } - - /// - /// Iterate over a collection to find an import object matching on path - /// - internal static Import FindFirstMatchingImportByPath(ImportCollection importCollection, string pathToMatch) - { - foreach (Import import in importCollection) - { - if (import.ProjectPath.Equals(pathToMatch, StringComparison.OrdinalIgnoreCase)) - { - return import; - } - } - - return null; - } - - /// - /// Iterate over a collection to find an import object matching on path - /// - internal static Import FindFirstMatchingImportByEvaludatedPath(ImportCollection importCollection, string evaluatedPathToMatch) - { - foreach (Import import in importCollection) - { - if (import.EvaluatedProjectPath.Equals(evaluatedPathToMatch, StringComparison.OrdinalIgnoreCase)) - { - return import; - } - } - - return null; - } - - /// - /// Find and return the first UsingTask matching on taskName - /// - internal static UsingTask FindUsingTaskByName(string taskName, UsingTaskCollection usingTaskCollection) - { - foreach (UsingTask usingTask in usingTaskCollection) - { - if (String.Equals(usingTask.TaskName, taskName, StringComparison.CurrentCultureIgnoreCase)) - { - return usingTask; - } - } - - return null; - } - - /// - /// Construct a namespace manager - /// - private static XmlNamespaceManager GetNsManager(XmlDocument xmlDoc) - { - XmlNamespaceManager namespaceManager = new XmlNamespaceManager(xmlDoc.NameTable); - namespaceManager.AddNamespace("msb", CompatibilityTestHelpers.SchemaUrlMSBuild.ToString()); - return namespaceManager; - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/Compatibility/EngineFileUtilities_Tests.cs b/src/Deprecated/Engine.UnitTests/Compatibility/EngineFileUtilities_Tests.cs deleted file mode 100644 index 144f075a8af..00000000000 --- a/src/Deprecated/Engine.UnitTests/Compatibility/EngineFileUtilities_Tests.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections.Generic; -using System.Text; - -using NUnit.Framework; - -using Microsoft.Build; -using Microsoft.Build.BuildEngine; -using Microsoft.Build.Framework; -using Microsoft.Build.UnitTests; - -namespace Microsoft.Build.UnitTests.OM.OrcasCompatibility -{ - /// - /// Test Fixture Class for the v9 Object Model Public Interface Compatibility Tests for the EngineFileUtilities Class. - /// This is not a PRI 1 class for coverage - /// - [TestFixture] - public class EngineFileUtilities_Tests - { - /// - /// Test for thrown InternalErrorException when escaping a null string - /// - /// found by kevinpi, Managed Lanaguages Team - [Test] - public void EscapeString_Null() - { - try - { - Microsoft.Build.BuildEngine.Utilities.Escape(null); - Assertion.Fail(); // Should not get here. - } - catch (Exception e) - { - Assertion.AssertEquals(true, e.GetType().ToString().Contains("InternalErrorException")); - } - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/Compatibility/Engine_Tests.cs b/src/Deprecated/Engine.UnitTests/Compatibility/Engine_Tests.cs deleted file mode 100644 index 7a1a2d58135..00000000000 --- a/src/Deprecated/Engine.UnitTests/Compatibility/Engine_Tests.cs +++ /dev/null @@ -1,1913 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections; -using System.Collections.Generic; -using System.IO; -using System.Reflection; -using System.Xml; -using NUnit.Framework; - -using Microsoft.Build.BuildEngine; -using Microsoft.Build.BuildEngine.Shared; -using Microsoft.Build.Framework; -using Microsoft.Build.UnitTests; -using Microsoft.Win32; - -namespace Microsoft.Build.UnitTests.OM.OrcasCompatibility -{ - /// - /// Test Fixture Class for the v9 Object Model Public Interface Compatibility Tests for the Engine Class. - /// - [TestFixture] - public sealed class Engine_Tests - { - //// Note to CTI - http://msdn2.microsoft.com/en-us/library/microsoft.build.buildengine.engine.aspx is the - //// MSDN of the Engine Class. - #region Common Helpers - /// - /// String of Special Characters to use in tests - /// - private const string SpecialCharacters = "%24%40%3b%5c%25"; - - /// - /// String of EscapableCharacters to use in tests - /// - private const string EscapableCharacters = @"%*?@$();\"; - #endregion - - #region Constructor Tests - /// - /// Tests the Engine Constructor - Engine() and verifies the defaults - /// - [Test] - public void ConstructorEngineNoParameters() - { - Engine e = new Engine(); - - string binPath20 = GetBinPathFromRegistry("2.0"); - - if (binPath20 == null) - { - // if 2.0 can't be found in the registry, it's still the default, - // but we need to get it another way. - binPath20 = FrameworkLocationHelper.PathToDotNetFrameworkV20; - } - - if (binPath20 != null) - { - Assertion.AssertEquals("2.0", e.DefaultToolsVersion); - Assertion.AssertEquals(binPath20, e.BinPath); - } - else - { - Assertion.AssertEquals("4.0", e.DefaultToolsVersion); - Assertion.AssertEquals(GetBinPathFromRegistry("4.0"), e.BinPath); - } - - Assertion.AssertEquals(true, e.BuildEnabled); - Assertion.AssertEquals(false, e.IsBuilding); - Assertion.AssertEquals(false, e.OnlyLogCriticalEvents); - } - - /// - /// Tests the Engine Constructor - Engine(string binPath) with an Empty String - /// - [Test] - [ExpectedException(typeof(ArgumentException))] - public void ConstructorEngineBinPathEmptyString() - { - Engine e = new Engine(String.Empty); - } - - /// - /// Tests the Engine Constructor - Engine(string binPath) with null - /// - [Test] - public void ConstructorEngineBinPathNull() - { - Engine e = new Engine((string)null); - - string binPath20 = GetBinPathFromRegistry("2.0"); - - if (binPath20 == null) - { - binPath20 = FrameworkLocationHelper.PathToDotNetFrameworkV20; - } - - if (binPath20 != null) - { - // if 2.0 is in the registry, that's what the default is - Assertion.AssertEquals(binPath20, e.BinPath); - } - else - { - // Otherwise, the default binpath is 4.0 - Assertion.AssertEquals(GetBinPathFromRegistry("4.0"), e.BinPath); - } - } - - /// - /// Tests the Engine Constructor - Engine(string binPath) with binpath - /// set to the system root drive - /// - [Test] - public void ConstructorEngineBinPathRootDrive() - { - Engine e = new Engine(@"c:\"); - Assertion.AssertEquals(@"c:\", e.BinPath); - } - - /// - /// Tests the Engine Constructor - Engine(string binPath) with a simple path - /// that contains a trailing backslash. Verify trailing backslash is - /// removed. - /// - [Test] - public void ConstructorEngineBinPathSimplePathWithTrailingBackSlash() - { - Engine e = new Engine(@"c:\somepath\"); - Assertion.AssertEquals(@"c:\somepath", e.BinPath); - } - - /// - /// Tests the Engine Constructor - Engine(string binPath) with a simple path - /// that does not contain a trailing backslash - /// - [Test] - public void ConstructorEngineBinPathSimplePathWithoutTrailingBackSlash() - { - Engine e = new Engine(@"c:\somepath"); - Assertion.AssertEquals(@"c:\somepath", e.BinPath); - } - - /// - /// Tests the Engine Constructor - Engine(string binPath) with a long path - /// - [Test] - [ExpectedException(typeof(PathTooLongException))] - public void ConstructorEngineBinPathPathTooLong() - { - string path = CompatibilityTestHelpers.GenerateLongPath(1000); - Engine e = new Engine(path); - } - - /// - /// Tests the Engine Constructor - Engine(string binPath) with Special Characters - /// - [Test] - public void ConstructorEngineBinPathSpecialCharacters() - { - Engine e = new Engine(SpecialCharacters); - Assertion.AssertEquals(SpecialCharacters, e.BinPath); - } - - /// - /// Tests the Engine Constructor - Engine(string binPath) with Escapable Characters - /// - [Test] - [ExpectedException(typeof(ArgumentException))] - public void ConstructorEngineBinPathEscapableCharacters() - { - Engine e = new Engine(EscapableCharacters); - } - - /// - /// Tests the Engine Constructor - Engine(ToolsetDefinitionLocations locations) with ToolsetDefinitionLocations.None - /// - [Test] - [Ignore("nyi")] - public void ConstructorEngineToolsetDefinitionLocationsNone() - { - Engine e = new Engine(ToolsetDefinitionLocations.None); - //// Need to actually verify - } - - /// - /// Tests the Engine Constructor - Engine(ToolsetDefinitionLocations locations) with ToolsetDefinitionLocations.ConfigurationFile - /// - [Test] - [Ignore("nyi")] - public void ConstructorEngineToolsetDefinitionLocationsConfigurationFile() - { - Engine e = new Engine(ToolsetDefinitionLocations.ConfigurationFile); - //// Need to actually verify - } - - /// - /// Tests the Engine Constructor - Engine(ToolsetDefinitionLocations locations) with ToolsetDefinitionLocations.Registry - /// - [Test] - [Ignore("nyi")] - public void ConstructorEngineToolsetDefinitionLocationsRegistry() - { - Engine e = new Engine(ToolsetDefinitionLocations.Registry); - //// Need to actually verify - } - - /// - /// Tests the Engine Constructor - Engine(BuildPropertyGroup globalProperties) with a null BuildPropertyGroup - /// - [Test] - [Ignore("nyi")] - public void ConstructorEngineBuildPropertyGroupNull() - { - BuildPropertyGroup group = null; - Engine e = new Engine(group); - - Assertion.AssertEquals(0, e.GlobalProperties.Count); - } - - /// - /// Tests the Engine Constructor - Engine(BuildPropertyGroup globalProperties) with a BuildPropertyGroup - /// that contains one property - /// - [Test] - [Ignore("nyi")] - public void ConstructorEngineBuildPropertyGroupOneProperty() - { - } - - /// - /// Tests the Engine Constructor - Engine(BuildPropertyGroup globalProperties) with a BuildPropertyGroup - /// that contains many properties, some with conditions, etc. - /// - [Ignore("nyi")] - public void ConstructorEngineBuildPropertyGroupManyProperties() - { - } - - /// - /// Tests the Engine Constructor - Engine(BuildPropertyGroup globalProperties, ToolsetDefinitionLocations locations) - /// with valid BuildPropertyGroup and ToolsetDefinitionLocations set to ConfigurationFile - /// - [Test] - [Ignore("nyi")] - public void ConstructorEngineBuildPropertyGroupValidAndToolsetDefinitionLocationsConfigurationFile() - { - } - - /// - /// Tests the Engine Constructor - Engine(BuildPropertyGroup globalProperties, ToolsetDefinitionLocations locations) - /// with valid BuildPropertyGroup and ToolsetDefinitionLocations set to Registry - /// - [Test] - [Ignore("nyi")] - public void ConstructorEngineBuildPropertyGroupValidAndToolsetDefinitionLocationsRegistry() - { - } - - /// - /// Tests the Engine Constructor - Engine(BuildPropertyGroup globalProperties, ToolsetDefinitionLocations locations) - /// with valid BuildPropertyGroup and ToolsetDefinitionLocations set to None - /// - [Test] - [Ignore("nyi")] - public void ConstructorEngineBuildPropertyGroupValidAndToolsetDefinitionLocationsNone() - { - } - - /// - /// Tests the Engine Constructor - Engine(BuildPropertyGroup globalProperties, ToolsetDefinitionLocations locations, - /// int numberOfCpus, string localNodeProviderParameters) with simple, valid - /// values for each parameter (1 CPU) - /// - [Test] - [Ignore("nyi")] - public void ConstructorMultiProcAwareSimpleValid() - { - } - - /// - /// Tests the Engine Constructor - Engine(BuildPropertyGroup globalProperties, ToolsetDefinitionLocations locations, - /// int numberOfCpus, string localNodeProviderParameters) with simple, valid - /// values for each parameter (2 CPUs) - /// - [Test] - [Ignore("nyi")] - public void ConstructorMultiProcAware2CPUs() - { - } - - /// - /// Tests the Engine Constructor - Engine(BuildPropertyGroup globalProperties, ToolsetDefinitionLocations locations, - /// int numberOfCpus, string localNodeProviderParameters) with simple, valid - /// values for each parameter (0 CPUs) - /// - [Test] - [Ignore("nyi")] - public void ConstructorMultiProcAware0CPUs() - { - } - #endregion - - #region BinPath Tests - /// - /// Tests Engine.BinPath Get for basic path - /// - [Test] - public void BinPathGetBasic() - { - Engine e = new Engine(@"c:\somepath"); - Assertion.AssertEquals(@"c:\somepath", e.BinPath); - } - - /// - /// Tests Engine.BinPath Set to null - /// - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void BinPathSetNull() - { - Engine e = new Engine(); - e.BinPath = null; - } - - /// - /// Tests Engine.BinPath Set to Empty String - /// - [Test] - [ExpectedException(typeof(ArgumentException))] - public void BinPathSetEmptyString() - { - Engine e = new Engine(); - e.BinPath = String.Empty; - } - - /// - /// Tests Engine.BinPath Set to too long of a path - /// - [Test] - [ExpectedException(typeof(PathTooLongException))] - public void BinPathSetTooLongPath() - { - Engine e = new Engine(); - string path = CompatibilityTestHelpers.GenerateLongPath(1000); - e.BinPath = path; - } - - /// - /// Tests Engine.BinPath Set to Escapable Characters - /// - [Test] - [ExpectedException(typeof(ArgumentException))] - public void BinPathSetEscapableCharacters() - { - Engine e = new Engine(); - e.BinPath = EscapableCharacters; - } - - /// - /// Tests Engine.BinPath Set to raw drive letter - /// - [Test] - public void BinPathSetRawDriveLetter() - { - ExpectedSetValidBinPaths("C:", "C:"); - } - - /// - /// Tests Engine.BinPath Set to Drive - /// - [Test] - public void BinPathSetDriveLetter() - { - ExpectedSetValidBinPaths(@"C:\", @"C:\"); - } - - /// - /// Tests Engine.BinPath Set to Drive with extra trailing slash - /// - [Test] - public void BinPathSetDriveLetterExtraTrailingSlash() - { - ExpectedSetValidBinPaths(@"C:\\", @"C:\"); - } - - /// - /// Tests Engine.BinPath Set to root level folder no trailing slash - /// - [Test] - public void BinPathSetRootLevelFolder() - { - ExpectedSetValidBinPaths(@"C:\foo", @"C:\foo"); - } - - /// - /// Tests Engine.BinPath Set to root level folder with one trailing slash - /// - [Test] - public void BinPathSetRootLevelFolderOneTrailingSlash() - { - ExpectedSetValidBinPaths(@"C:\foo\", @"C:\foo"); - } - - /// - /// Tests Engine.BinPath Set to root level folder with two trailing slashes - /// - [Test] - public void BinPathSetRootLevelFolderTwoTrailingSlash() - { - ExpectedSetValidBinPaths(@"C:\foo\\", @"C:\foo\"); - } - - /// - /// Tests Engine.BinPath Set to UNC path no trailing slash - /// - [Test] - public void BinPathSetUNCPath() - { - ExpectedSetValidBinPaths(@"\\foo\share", @"\\foo\share"); - } - - /// - /// Tests Engine.BinPath Set to UNC path with one trailing slash - /// - [Test] - public void BinPathSetUNCPathOneTrailingSlash() - { - ExpectedSetValidBinPaths(@"\\foo\share\", @"\\foo\share"); - } - - /// - /// Tests Engine.BinPath Set to UNC path with two trailing slashes - /// - [Test] - public void BinPathSetUNCPathTwoTrailingSlash() - { - ExpectedSetValidBinPaths(@"\\foo\share\\", @"\\foo\share\"); - } - - /// - /// Tests Engine.BinPath Set to Special Characters - /// - [Test] - public void BinPathSetSpecialCharacters() - { - ExpectedSetValidBinPaths(SpecialCharacters, SpecialCharacters); - } - #endregion - - #region BuildEnabled Tests - /// - /// Tests Engine.BuildEnabled for the default case (expected to be true) - /// - [Test] - public void BuildEnabledDefault() - { - Engine e = new Engine(); - Assertion.AssertEquals(true, e.BuildEnabled); - } - - /// - /// Tests Engine.BuildEnabled Setting to false - /// - [Test] - public void BuildEnabledSetToFalse() - { - Engine e = new Engine(); - e.BuildEnabled = false; - - Assertion.AssertEquals(false, e.BuildEnabled); - } - - /// - /// Tests Engine.BuildEnabled Setting to true - /// - [Test] - [Ignore("nyi")] - public void BuildEnabledSetToTrue() - { - } - #endregion - - #region OnlyLogCriticalEvents Tests - /// - /// Tests Engine.OnlyLogCriticalEvents for the default case (expected to be false) - /// - [Test] - public void OnlyLogCriticalEventsDefault() - { - Engine e = new Engine(); - Assertion.AssertEquals(false, e.OnlyLogCriticalEvents); - } - - /// - /// Tests Engine.OnlyLogCriticalEvents Setting to false - /// - [Test] - [Ignore("nyi")] - public void OnlyLogCriticalEventsSetToFalse() - { - } - - /// - /// Tests Engine.OnlyLogCriticalEvents Setting to true - /// - [Test] - [Ignore("nyi")] - public void OnlyLogCriticalEventsSetToTrue() - { - } - #endregion - - #region DefaultToolsVersion Tests - /// - /// Tests Engine.DefaultToolsVersion Get default - /// - [Test] - public void DefaultToolsVersionGetDefault() - { - Engine e = new Engine(); - Assertion.AssertEquals("2.0", e.DefaultToolsVersion); - } - - /// - /// Tests Engine.DefaultToolsVersion attempt to Set to null - /// - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void DefaultToolsVersionSetToNull() - { - Engine e = new Engine(); - e.DefaultToolsVersion = null; - } - - /// - /// Tests Engine.DefaultToolsVersion Set to 3.5 - /// - [Test] - public void DefaultToolsVersionSetTo3Point5() - { - Engine e = new Engine(); - e.DefaultToolsVersion = "3.5"; - Assertion.AssertEquals("3.5", e.DefaultToolsVersion); - } - - /// - /// Tests Engine.DefaultToolsVersion Set to 2.0 - /// - [Test] - [Ignore("nyi")] - public void DefaultToolsVersionSetTo2Point0() - { - } - - /// - /// Tests Engine.DefaultToolsVersion attempt to set after loading project - /// - [Test] - [ExpectedException(typeof(InvalidOperationException))] - [Ignore("nyi")] - public void DefaultToolsVersionAttemptToSetAfterLoadingProject() - { - } - - /// - /// Tests Engine.DefaultToolsVersion attempt to Set to String.Empty - /// - [Test] - [ExpectedException(typeof(InvalidOperationException))] - [Ignore("nyi")] - public void DefaultToolsVersionSetToEmptyString() - { - } - #endregion - - #region IsBuilding Tests - /// - /// Tests Engine.IsBuilding, verifies when you've only just created the Engine object, that IsBuilding is false - /// - [Test] - public void IsBuildingAfterOnlyCreatingEngine() - { - Engine e = new Engine(); - Assertion.AssertEquals(false, e.IsBuilding); - } - - /// - /// Tests Engine.IsBuilding While a Build is taking place (expected true) - /// - [Test] - [Ignore("nyi")] - public void IsBuildingWhileABuildTakesPlace() - { - // likely, start build on another tread to allow you to verify during the build - } - - /// - /// Tests Engine.IsBuilding After a Build has completed (expected false) - /// - [Test] - [Ignore("nyi")] - public void IsBuildingAfterABuildCompletes() - { - } - #endregion - - #region GlobalProperties Tests - /// - /// Tests Engine.GlobalProperties Set to null - /// - [Test] - [Ignore("nyi")] - public void GlobalPropertiesSetNull() - { - } - - /// - /// Tests Engine.GlobalProperties Set to String.Empty - /// - [Test] - [Ignore("nyi")] - public void GlobalPropertiesSetEmptyString() - { - } - - /// - /// Tests Engine.GlobalProperties Set One Property - /// - [Test] - [Ignore("nyi")] - public void GlobalPropertiesSetOneProperty() - { - } - - /// - /// Tests Engine.GlobalProperties Set Multiple Properties - /// - [Test] - [Ignore("nyi")] - public void GlobalPropertiesSetMultipleProperties() - { - } - - /// - /// Tests Engine.GlobalProperties Attempt Set after Engine.Unload - /// - [Test] - [Ignore("nyi")] - public void GlobalPropertiesSetAfterUnloadingEngine() - { - } - - /// - /// Tests Engine.GlobalProperties Get when no Properties Exist - /// - [Test] - [Ignore("nyi")] - public void GlobalPropertiesGetWhenNonExist() - { - } - - /// - /// Tests Engine.GlobalProperties Get when only one property exists - /// - [Test] - [Ignore("nyi")] - public void GlobalPropertiesGetWhenOneExists() - { - } - - /// - /// Tests Engine.GlobalProperties Get when multiple properties exist - /// - [Test] - [Ignore("nyi")] - public void GlobalPropertiesGetWhenMultipleExist() - { - } - - /// - /// Tests Engine.GlobalProperties Get after Engine.Unload - /// - [Test] - [Ignore("nyi")] - public void GlobalPropertiesGetAfterUnloadingEngine() - { - } - #endregion - - #region Toolsets Tests - /// - /// Tests Engine.Toolsets when no toolsets exist (if it's possible to get into this state) - /// - [Test] - [Ignore("nyi")] - public void ToolsetsGetNoneExist() - { - } - - /// - /// Tests Engine.Toolsets when only one toolsets exist - /// - [Test] - [Ignore("nyi")] - public void ToolsetsGetWhenOnlyOneExists() - { - } - - /// - /// Tests Engine.Toolsets when Multiple Toolsets Exist - /// - [Test] - [Ignore("nyi")] - public void ToolsetsGetWhenMultipleExist() - { - } - #endregion - - #region BuildProject Group of Tests (grouped in sub regions based on overload) - #region BuildProject(Project project) Tests - /* - * Noting that BuildProject(Project project) calls - * BuildProject(project, targetnames[], targetOutputs, buildFlags) - * with (project, null, null, BuildSettings.None) - * where project is the project that you passed in. - */ - - /// - /// Tests Engine.BuildProject(project) - just pass in an empty project - /// - [Test] - [Ignore("nyi")] - public void BuildProjectWithEmptyProject() - { - } - - /// - /// Tests Engine.BuildProject(project) - with a null project - /// - [Test] - [Ignore("nyi")] - public void BuildProjectWithNullProject() - { - } - - /// - /// Tests Engine.BuildProject(project) - with in-memory project - /// - [Test] - [Ignore("nyi")] - public void BuildProjectWithInMemoryProject() - { - } - - /// - /// Tests Engine.BuildProject(project) - with project loaded from disk - /// - [Test] - [Ignore("nyi")] - public void BuildProjectWithProjectFromDisk() - { - } - - /// - /// Tests Engine.BuildProject(project) - with an imported project - /// - [Test] - [Ignore("nyi")] - public void BuildProjectWithImportedProject() - { - } - #endregion - - #region BuildProject(Project project, string targetName) Tests - /* - * Noting that BuildProject(Project project, string targetName) calls - * BuildProject(project, targetnames[], targetOutputs, buildFlags) - * with (project, targetName, null, BuildSettings.None) - * where project is the project that you passed in and targetNames[] is - * the targetName that you passed in. - */ - - /// - /// Tests Engine.BuildProject(project, targetName) - with empty project and valid target name - /// - [Test] - [Ignore("nyi")] - public void BuildProjectWithEmptyProjectValidTargetName() - { - } - - /// - /// Tests Engine.BuildProject(project, targetName) - with a null project and valid target name - /// - [Test] - [Ignore("nyi")] - public void BuildProjectWithNullProjectValidTargetName() - { - } - - /// - /// Tests Engine.BuildProject(project, targetName) - with in-memory project and valid target name - /// - [Test] - [Ignore("nyi")] - public void BuildProjectWithInMemoryProjectValidTargetName() - { - } - - /// - /// Tests Engine.BuildProject(project, targetName) - with project loaded from disk and valid target name - /// - [Test] - [Ignore("nyi")] - public void BuildProjectWithProjectFromDiskValidTargetName() - { - } - - /// - /// Tests Engine.BuildProject(project, targetName) - with an imported project and valid target name - /// - [Test] - [Ignore("nyi")] - public void BuildProjectWithImportedProjectValidTargetName() - { - } - - /// - /// Tests Engine.BuildProject(project, targetName) - with a project and an invalid target name (not null) - /// - [Test] - [Ignore("nyi")] - public void BuildProjectWithProjectAndInvalidTargetName() - { - } - - /// - /// Tests Engine.BuildProject(project, targetName) - with a project and an String.Empty target name - /// - [Test] - [Ignore("nyi")] - public void BuildProjectWithProjectAndEmptyStringTargetName() - { - } - #endregion - - #region BuildProject(Project project, string[] targetName) Tests - /* - * Noting that BuildProject(Project project, string[] targetName) calls - * BuildProject(project, targetnames[], targetOutputs, buildFlags) - * with (project, targetName[], null, BuildSettings.None) - * where project is the project that you passed in and targetNames[] is - * the targetName that you passed in. - */ - - /// - /// Tests Engine.BuildProject(project, targetName[]) - with project and an array of String.Empties - /// - [Test] - [Ignore("nyi")] - public void BuildProjectWithProjectAndEmptyTargetNameArray() - { - } - - /// - /// Tests Engine.BuildProject(project, targetName[]) - with project and an array of different target names - /// - [Test] - [Ignore("nyi")] - public void BuildProjectWithProjectAndSetOfDifferentTargetNames() - { - } - - /// - /// Tests Engine.BuildProject(project, targetName[]) - with project and an array of same target names - /// - [Test] - [Ignore("nyi")] - public void BuildProjectWithProjectAndSetOfSameTargetNames() - { - } - - /// - /// Tests Engine.BuildProject(project, targetName[]) - with project and an array of mixed valid, null, empty - /// - [Test] - [Ignore("nyi")] - public void BuildProjectWithProjectAndSetOfMixedTargetNames() - { - //// comment - string[] targetName should have some valid target names, some null, and some String.Empty - } - #endregion - - #region BuildProject(Project project, string[] targetName, IDictionary targetOutputs) Tests - /* - * Noting that BuildProject(Project project, string[] targetName, IDictionary targetOutputs) calls - * BuildProject(project, targetnames[], targetOutputs, buildFlags) - * with (project, targetName[], targetOutputs, BuildSettings.None) - * where project is the project that you passed in and targetNames[] is - * the targetName that you passed in and targetOutputs. - */ - - /// - /// Tests Engine.BuildProject(project, targetName[], targetOutputs) - where targetOutputs is just one Empty String. - /// - [Test] - [Ignore("nyi")] - public void BuildProjectWithEmptyStringTargetOutput() - { - } - - /// - /// Tests Engine.BuildProject(project, targetName[], targetOutputs) - where targetOutputs are a set of different/valid outputs - /// - [Test] - [Ignore("nyi")] - public void BuildProjectWithProjectAndDifferentValidOutputs() - { - } - - /// - /// Tests Engine.BuildProject(project, targetName[], targetOutputs) - where targetOutputs are a set of same/valid outputs - /// - [Test] - [Ignore("nyi")] - public void BuildProjectWithProjectAndSameValidOutputs() - { - } - - /// - /// Tests Engine.BuildProject(project, targetName[], targetOutputs) - where the targetOutputs set has one null entry, rest are valid - /// - [Test] - [Ignore("nyi")] - public void BuildProjectWithProjectAndMixedOutputsWithOneNull() - { - } - #endregion - - #region BuildProject(Project project, string[] targetName, IDictionary targetOutputs, BuildSettings buildFlags) Tests - /* - * Noting that all BuildProject() overloads, end up calling this method with buildFlags set to BuildSettings.None - * Therefore, here we only need to test the other BuildSettings choice, BuildSettings.DoNotResetPreviouslyBuiltTargets - */ - - /// - /// Tests Engine.BuildProject(project, targetName[], targetOutputs, buildFlags) - with BuildSettings.DoNotResetPreviouslyBuiltTargets - /// and null everything else (pass in null for all other parameters) - /// - [Test] - [Ignore("nyi")] - public void BuildProjectWithBuildSettingDoNotResetPreviouslyBuiltTargetsAndNullEverythingElse() - { - } - - /// - /// Tests Engine.BuildProject(project, targetName[], targetOutputs, buildFlags) - with BuildSettings.DoNotResetPreviouslyBuiltTargets - /// and valid, in-memory project, a single, valid targetname, and valid targetOutputs. - /// - [Test] - [Ignore("nyi")] - public void BuildProjectWithBuildSettingDoNotResetPreviouslyBuiltTargetsInMemoryProjectValidAllParams() - { - } - - /// - /// Tests Engine.BuildProject(project, targetName[], targetOutputs, buildFlags) - with BuildSettings.DoNotResetPreviouslyBuiltTargets - /// and valid, on disk project, several valid targetNames, and valid targetOutputs - /// - [Test] - [Ignore("nyi")] - public void BuildProjectWithBuildSettingDoNotResetPreviouslyBuiltTargetsOnDiskProjectValidAllParams() - { - } - #endregion - #endregion - - #region BuildProjectFile Group of Tests (grouped in sub regions based on overload) - #region BuildProjectFile(string projectFile) - /* This overload calls BuildProjectFile(projectFile, null, this.GlobalProperties, null, BuildSettings.None) - * as such, passing on the projectFile. - */ - - /// - /// Tests Engine.BuildProjectFile(projectFile) where projectfile string is an String.Empty - /// - [Test] - [ExpectedException(typeof(ArgumentException))] - public void BuildProjectFileEmptyString() - { - Engine e = new Engine(); - e.BuildProjectFile(String.Empty); - } - - /// - /// Tests Engine.BuildProjectFile(projectFile) where projectfile string is null - /// - [Test] - [Ignore("nyi")] - public void BuildProjectFileNull() - { - } - - /// - /// Tests Engine.BuildProjectFile(projectFile) where projectfile is a simple, valid file on disk - /// - [Test] - [Ignore("nyi")] - public void BuildProjectFileSimpleValidOnDisk() - { - } - - /// - /// Tests Engine.BuildProjectFile(projectFile) where projectfile exists on disk, but actual file - /// contents is empty (a blank file) - /// - [Test] - [Ignore("nyi")] - public void BuildProjectFileBlankProjectFile() - { - } - - /// - /// Tests Engine.BuildProjectFile(projectFile) where projectfile imports another project - /// - [Test] - [Ignore("nyi")] - public void BuildProjectFileImportsAnotherProject() - { - } - - /// - /// Tests Engine.BuildProjectFile(projectFile) where projectfile name has a long file name - /// - [Test] - [Ignore("nyi")] - public void BuildProjectFileLongFileName() - { - } - - /// - /// Tests Engine.BuildProjectFile(projectFile) where projectfile lives in deep folder location - /// - [Test] - [Ignore("nyi")] - public void BuildProjectFileDeepFolderLocation() - { - } - #endregion - - #region BuildProjectFile(string projectFile, string targetName) - /* This overload calls BuildProjectFile(projectFile, new string[] {targetName}, this.GlobalProperties, - * null, BuildSettings.None) as such, passing on the projectFile and your targetName. Because the - * null targetName is already covered in the BuildProjectFile(projectFile) overload, we don't - * need to test it again. - */ - - /// - /// Tests Engine.BuildProjectFile(projectFile, targetName) where targetName is an empty string - /// - [Test] - [Ignore("nyi")] - public void BuildProjectFileTargetNameEmptyString() - { - ////Engine e = new Engine(); - ////e.BuildProjectFile(@"c:\foo.proj", String.Empty); - } - - /// - /// Tests Engine.BuildProjectFile(projectFile, targetName) where targetName is valid (example, targetName = 'Build') - /// - [Test] - [Ignore("nyi")] - public void BuildProjectFileTargetNameValid() - { - } - - /// - /// Tests Engine.BuildProjectFile(projectFile, targetName) where targetName doesn't exist in project - /// - [Test] - [Ignore("nyi")] - public void BuildProjectFileTargetNameDoesNotExist() - { - } - #endregion - - #region BuildProjectFile(string projectFile, string[] targetNames) - /* This overload calls BuildProjectFile(projectFile, targetNames, this.GlobalProperties, - null, BuildSettings.None) as such, passing on the projectFile and your targetNames. Because the - * null targetNames is already covered in the BuildProjectFile(projectFile) overload, we don't - * need to test it again. - */ - - /// - /// Tests Engine.BuildProjectFile(projectFile, string[] targetNames) where targetNames is an array of empty strings - /// - [Test] - [Ignore("nyi")] - public void BuildProjectFileTargetNamesEmptyStrings() - { - } - - /// - /// Tests Engine.BuildProjectFile(projectFile, string[] targetNames) where targetNames is an array of all the same targets ({Build, Build, Build}) - /// - [Test] - [Ignore("nyi")] - public void BuildProjectFileTargetNamesAllSame() - { - } - - /// - /// Tests Engine.BuildProjectFile(projectFile, string[] targetNames) where targetNames is an array of all different targets - /// - [Test] - [Ignore("nyi")] - public void BuildProjectFileTargetNamesAllDifferent() - { - } - - /// - /// Tests Engine.BuildProjectFile(projectFile, string[] targetNames) where targetNames is an array of some same, some different - /// - [Test] - [Ignore("nyi")] - public void BuildProjectFileTargetNamesMixedSameAndDifferent() - { - } - - /// - /// Tests Engine.BuildProjectFile(projectFile, string[] targetNames) where targetNames is an array of different, non-existing targets - /// - [Test] - [Ignore("nyi")] - public void BuildProjectFileTargetNamesDifferentNonExisting() - { - } - - /// - /// Tests Engine.BuildProjectFile(projectFile, string[] targetNames) where targetNames is an array of some existing, some non-existing - /// - [Test] - [Ignore("nyi")] - public void BuildProjectFileTargetNamesSomeExistingSomeNonExisting() - { - } - #endregion - - #region BuildProjectFile(string projectFile, string[] targetNames, BuildPropertyGroup globalProperties) - /* This overload calls BuildProjectFile(projectFile, targetNames, globalProperties, - null, BuildSettings.None) as such, passing on the projectFile, your targetNames and globalProperties - */ - - /// - /// Tests Engine.BuildProjectFile(projectFile, string[] targetNames, BuildPropertyGroup globalProperties) - /// where globalProperties are null - /// - [Test] - [Ignore("nyi")] - public void BuildProjectFileGlobalPropertiesNull() - { - } - - /// - /// Tests Engine.BuildProjectFile(projectFile, string[] targetNames, BuildPropertyGroup globalProperties) - /// where globalProperties are valid, different - /// - [Test] - [Ignore("nyi")] - public void BuildProjectFileGlobalPropertiesValidDifferent() - { - } - - /// - /// Tests Engine.BuildProjectFile(projectFile, string[] targetNames, BuildPropertyGroup globalProperties) - /// where globalProperties are valid, same - /// - [Test] - [Ignore("nyi")] - public void BuildProjectFileGlobalPropertiesValidSame() - { - } - #endregion - - #region BuildProjectFile(string projectFile, string[] targetNames, BuildPropertyGroup globalProperties, IDictionary targetOutputs) - /* This overload calls BuildProjectFile(projectFile, targetNames, globalProperties, - targetOutputs, BuildSettings.None) as such, passing on the projectFile, your targetNames, globalProperties and - * targetOutputs. - */ - - /// - /// Tests Engine.BuildProjectFile(projectFile, string[] targetNames, BuildPropertyGroup globalProperties, IDictionary targetOutputs) - /// where targetOutputs are null - /// - [Test] - [Ignore("nyi")] - public void BuildProjectFileTargetOutputsNull() - { - } - - /// - /// Tests Engine.BuildProjectFile(projectFile, string[] targetNames, BuildPropertyGroup globalProperties, IDictionary targetOutputs) - /// where targetOutputs String.Empty - /// - [Test] - [Ignore("nyi")] - public void BuildProjectFileTargetOutputsEmptyString() - { - } - - /// - /// Tests Engine.BuildProjectFile(projectFile, string[] targetNames, BuildPropertyGroup globalProperties, IDictionary targetOutputs) - /// where targetOutputs simple valid - /// - [Test] - [Ignore("nyi")] - public void BuildProjectFileTargetOutputsValid() - { - } - - /// - /// Tests Engine.BuildProjectFile(projectFile, string[] targetNames, BuildPropertyGroup globalProperties, IDictionary targetOutputs) - /// where targetOutputs invalid - /// - [Test] - [Ignore("nyi")] - public void BuildProjectFileTargetOutputsInvalid() - { - } - #endregion - - #region BuildProjectFile(string projectFile, string[] targetNames, BuildPropertyGroup globalProperties, IDictionary targetOutputs, BuildSettings buildFlags) - /* This overload calls BuildProjectFile(projectFile, targetNames, globalProperties, targetOutputs, buildFlags, null) - * as such, passing on the projectFile, your targetNames, globalProperties, targetOutputs, and buildFlags. - * Since all previous overloads pass BuildSettings.None, we only need to test BuildSettings.DoNotResetPreviouslyBuiltTargets - */ - - /// - /// Tests Engine.BuildProjectFile(projectFile, string[] targetNames, BuildPropertyGroup globalProperties, - /// IDictionary targetOutputs, BuildSettings buildFlags) where - /// buildFlags set to DoNotResetPreviouslyBuiltTargets and all other - /// parameters are valid, project file on disk, with just a single target - /// - [Test] - [Ignore("nyi")] - public void BuildProjectFileBuildFlagsDoNotResetPreviouslyBuiltTargetsOneTargetName() - { - } - - /// - /// Tests Engine.BuildProjectFile(projectFile, string[] targetNames, BuildPropertyGroup globalProperties, - /// IDictionary targetOutputs, BuildSettings buildFlags) where - /// buildFlags set to DoNotResetPreviouslyBuiltTargets and all other - /// parameters are valid, project file on disk, with multiple different targetNames - /// - [Test] - [Ignore("nyi")] - public void BuildProjectFileBuildFlagsDoNotResetPreviouslyBuiltTargetsMultipleDifferentTargetNames() - { - } - - /// - /// Tests Engine.BuildProjectFile(projectFile, string[] targetNames, BuildPropertyGroup globalProperties, - /// IDictionary targetOutputs, BuildSettings buildFlags) where - /// buildFlags set to DoNotResetPreviouslyBuiltTargets and all other - /// parameters are valid, project file on disk, with multiple same targetNames - /// - [Test] - [Ignore("nyi")] - public void BuildProjectFileBuildFlagsDoNotResetPreviouslyBuiltTargetsMultipleSameTargetNames() - { - } - #endregion - - #region BuildProjectFile(string projectFile, string[] targetNames, BuildPropertyGroup globalProperties, IDictionary targetOutputs, BuildSettings buildFlags, string toolsVersion) - /* This is the method that all of the other BuildProjectFile overloads call (with null toolsVersion). Therefore, - * we don't need to re-test setting toolsVersion to null. - */ - - /// - /// Tests Engine.BuildProjectFile(projectFile, string[] targetNames, BuildPropertyGroup globalProperties, - /// IDictionary targetOutputs, BuildSettings buildFlags, string toolsVersion) - /// where toolsVersion Set to String.Empty - /// - [Test] - [Ignore("nyi")] - public void BuildProjectFileToolsVersionEmptyString() - { - } - - /// - /// Tests Engine.BuildProjectFile(projectFile, string[] targetNames, BuildPropertyGroup globalProperties, - /// IDictionary targetOutputs, BuildSettings buildFlags, string toolsVersion) - /// where toolsVersion Set to '2.0' - /// - [Test] - [Ignore("nyi")] - public void BuildProjectFileToolsVersion2Point0() - { - } - - /// - /// Tests Engine.BuildProjectFile(projectFile, string[] targetNames, BuildPropertyGroup globalProperties, - /// IDictionary targetOutputs, BuildSettings buildFlags, string toolsVersion) - /// where toolsVersion Set to '3.5' - /// - [Test] - [Ignore("nyi")] - public void BuildProjectFileToolsVersion3Point5() - { - } - - /// - /// Tests Engine.BuildProjectFile(projectFile, string[] targetNames, BuildPropertyGroup globalProperties, - /// IDictionary targetOutputs, BuildSettings buildFlags, string toolsVersion) - /// where toolsVersion Set to 'foobar' (invalid) - /// - [Test] - [Ignore("nyi")] - public void BuildProjectFileToolsVersionInvalid() - { - } - #endregion - #endregion - - #region BuildProjectFiles Tests - /* Noting, BuildProjectFiles is really for Building Multiple Projects in Parallel - * The following, commented out test method comes from the Dev Unit tests for this. - * I'm providing this as an example of what to do here. When complete, please delete - * the example Dev Unit test. - */ - #region Example Dev Unit Test For BuildProjectFiles() - //// Also, note in this example, there are examples of other Engine.Objects that should be - //// useful for you. RegisterDistributedLogger() tests below, you'll need to look at this - //// ***************START: Example Dev Unit test*************** - ////[Test] - ////public void BuildProjectFilesInParallel() - ////{ - //// //Gets the currently loaded assembly in which the specified class is defined - //// Assembly engineAssembly = Assembly.GetAssembly(typeof(Engine)); - //// string loggerClassName = "Microsoft.Build.BuildEngine.ConfigurableForwardingLogger"; - //// string loggerAssemblyName = engineAssembly.GetName().FullName; - //// LoggerDescription forwardingLoggerDescription = new LoggerDescription(loggerClassName, loggerAssemblyName, null, null, LoggerVerbosity.Normal); - - //// string[] fileNames = new string[10]; - //// string traversalProject = TraversalProjectFile("ABC"); - //// string[][] targetNamesPerProject = new string[fileNames.Length][]; - //// IDictionary[] targetOutPutsPerProject = new IDictionary[fileNames.Length]; - //// BuildPropertyGroup[] globalPropertiesPerProject = new BuildPropertyGroup[fileNames.Length]; - //// string[] tempfilesToDelete = new string[fileNames.Length]; - //// Engine engine = new Engine(null, ToolsetDefinitionLocations.ConfigurationFile | ToolsetDefinitionLocations.Registry, 4, "msbuildlocation=" + AppDomain.CurrentDomain.BaseDirectory); - //// engine.RegisterLogger(new ConsoleLogger(LoggerVerbosity.Normal)); - //// try - //// { - //// for (int i = 0; i < fileNames.Length; i++) - //// { - //// string[] ProjectFiles1 = CreateGlobalPropertyProjectFileWithExtension("ABC"); - //// fileNames[i] = ProjectFiles1[0]; - //// tempfilesToDelete[i] = ProjectFiles1[1]; - //// targetNamesPerProject[i] = new string[] { "Build" }; - //// } - - //// // Test building a traversal - //// engine.BuildProjectFile(traversalProject); - //// engine.Shutdown(); - - //// // Test building the same set of files in parallel - //// Console.Out.WriteLine("1:" + Process.GetCurrentProcess().MainModule.FileName); - //// Console.Out.WriteLine("2:" + AppDomain.CurrentDomain.BaseDirectory); - //// engine = new Engine(null, ToolsetDefinitionLocations.ConfigurationFile | ToolsetDefinitionLocations.Registry, 4, "msbuildlocation=" + AppDomain.CurrentDomain.BaseDirectory); - //// engine.RegisterDistributedLogger(new ConsoleLogger(LoggerVerbosity.Normal), forwardingLoggerDescription); - //// engine.BuildProjectFiles(fileNames, targetNamesPerProject, globalPropertiesPerProject, targetOutPutsPerProject, BuildSettings.None, new string[fileNames.Length]); - //// engine.Shutdown(); - - //// // Do the same using singleproc - //// engine = new Engine(null, ToolsetDefinitionLocations.ConfigurationFile | ToolsetDefinitionLocations.Registry, 4, "msbuildlocation=" + AppDomain.CurrentDomain.BaseDirectory); - //// engine.RegisterLogger(new ConsoleLogger(LoggerVerbosity.Normal)); - //// engine.BuildProjectFile(traversalProject); - //// engine.Shutdown(); - - //// engine = new Engine(null, ToolsetDefinitionLocations.ConfigurationFile | ToolsetDefinitionLocations.Registry, 1, "msbuildlocation=" + AppDomain.CurrentDomain.BaseDirectory); - //// engine.RegisterLogger(new ConsoleLogger(LoggerVerbosity.Normal)); - //// engine.BuildProjectFiles(fileNames, targetNamesPerProject, globalPropertiesPerProject, targetOutPutsPerProject, BuildSettings.None, new string[fileNames.Length]); - //// } - //// finally - //// { - //// engine.Shutdown(); - //// for (int i = 0; i < fileNames.Length; i++) - //// { - //// File.Delete(fileNames[i]); - //// File.Delete(tempfilesToDelete[i]); - //// } - //// File.Delete(traversalProject); - //// } - ////} - //// ***************END: example Dev unit test*************** - #endregion - //// Please delete example dev unit test when you complete all of the Engine class tests (not just this section) - - /// - /// Tests Engine.BuildProjectFiles(string[] projectFiles, string[][] targetNamesPerProject, - /// BuildPropertyGroup[] globalPropertiesPerProject, - /// IDictionary[] targetOutputsPerProject, BuildSettings buildFlags, - /// string [] toolsVersions) with several project files (no traversal projects) - /// with no Project to Project (P2P) references between set of projects - /// - [Test] - [Ignore("nyi")] - public void BuildProjectFilesSeveralProjects() - { - } - - /// - /// Tests Engine.BuildProjectFiles(string[] projectFiles, string[][] targetNamesPerProject, - /// BuildPropertyGroup[] globalPropertiesPerProject, - /// IDictionary[] targetOutputsPerProject, BuildSettings buildFlags, - /// string [] toolsVersions) with a single traversal project that - /// points to several projects (no P2P references) - /// - [Test] - [Ignore("nyi")] - public void BuildProjectFilesTraveralProjectWithProjectsNoP2Ps() - { - } - - /// - /// Tests Engine.BuildProjectFiles(string[] projectFiles, string[][] targetNamesPerProject, - /// BuildPropertyGroup[] globalPropertiesPerProject, - /// IDictionary[] targetOutputsPerProject, BuildSettings buildFlags, - /// string [] toolsVersions) with a single traversal project that points to - /// 4 projects (projects A, B, C and D) where A has a P2P to C, and B has - /// a P2P to D. - /// - [Test] - [Ignore("nyi")] - public void BuildProjectFilesTraveralProjectWithProjectsThatHaveP2Ps() - { - } - - /// - /// Tests Engine.BuildProjectFiles(string[] projectFiles, string[][] targetNamesPerProject, - /// BuildPropertyGroup[] globalPropertiesPerProject, - /// IDictionary[] targetOutputsPerProject, BuildSettings buildFlags, - /// string [] toolsVersions) with a traversal project, which in turn - /// points to several other traversal projects, each of which have their - /// own set of projects (some with P2Ps, some without) - /// - [Test] - [Ignore("nyi")] - public void BuildProjectFilesTraveralProjectPointingToTraveralProjectsWithProjects() - { - } - - //// Need to also add tests for each of the following error conditions that BuildProjectFiles() verifies before doing anything - //// error.VerifyThrowArgumentArraysSameLength(projectFiles, targetNamesPerProject, "projectFiles", "targetNamesPerProject"); - //// error.VerifyThrowArgument(projectFiles.Length > 0, "projectFilesEmpty"); - //// error.VerifyThrowArgumentArraysSameLength(projectFiles, globalPropertiesPerProject, "projectFiles", "globalPropertiesPerProject"); - //// error.VerifyThrowArgumentArraysSameLength(projectFiles, targetOutputsPerProject, "projectFiles", "targetOutputsPerProject"); - //// error.VerifyThrowArgumentArraysSameLength(projectFiles, toolsVersions, "projectFiles", "toolsVersions"); - #endregion - - #region CreateNewProject Tests - /// - /// Tests Engine.CreateNewProject() - /// - [Test] - [Ignore("nyi")] - public void CreateNewProject() - { - Engine e = new Engine(); - e.CreateNewProject(); - //// TODO - figure out how to verify CreateNewProject actually worked - } - #endregion - - #region GetLoadedProject Tests - /// - /// Tests Engine.GetLoadedProject(string projectFullFileName) with projectFullFileName set to Null - /// - [Test] - [Ignore("nyi")] - public void GetLoadedProjectNull() - { - } - - /// - /// Tests Engine.GetLoadedProject(string projectFullFileName) with projectFullFileName set to String.Empty - /// - [Test] - [Ignore("nyi")] - public void GetLoadedProjectEmptyString() - { - } - - /// - /// Tests Engine.GetLoadedProject(string projectFullFileName) with projectFullFileName set to a valid, existing - /// project file - /// - [Test] - [Ignore("nyi")] - public void GetLoadedProjectExisting() - { - } - - /// - /// Tests Engine.GetLoadedProject(string projectFullFileName) with projectFullFileName set to an non-existing - /// project file name, yet path exist - /// - [Test] - [Ignore("nyi")] - public void GetLoadedProjectNonExistingProjectFileValidPath() - { - } - - /// - /// Tests Engine.GetLoadedProject(string projectFullFileName) with projectFullFileName set to an non-existing - /// project file name where path also doesn't exist - /// - [Test] - [Ignore("nyi")] - public void GetLoadedProjectNonExistingProjectFileAndPath() - { - } - - /// - /// Tests Engine.GetLoadedProject(string projectFullFileName) with projectFullFileName set to an existing - /// project file name, but file contents is invalid (just random characters within file) - /// - [Test] - [Ignore("nyi")] - public void GetLoadedProjectExistingProjectFileInvalidFileContents() - { - } - - /// - /// Tests Engine.GetLoadedProject(string projectFullFileName) with projectFullFileName set to an existing - /// project file name, but file contents is empty - /// - [Test] - [Ignore("nyi")] - public void GetLoadedProjectExistingProjectFileEmptyFileContents() - { - } - #endregion - - #region RegisterDistributedLogger Tests - /// - /// Tests Engine.RegisterDistributedLogger(ILogger centralLogger, LoggerDescription forwardingLogger) when - /// passing in Nulls for both parameters - /// - [Test] - [Ignore("nyi")] - public void RegisterDistributedLoggerNullParams() - { - } - - /// - /// Tests Engine.RegisterDistributedLogger(ILogger centralLogger, LoggerDescription forwardingLogger) when - /// you have a valid centralLogger and forwardingLogger - /// - [Test] - [Ignore("nyi")] - public void RegisterDistributedLoggerValidCentralAndForwardingLoggers() - { - } - - /// - /// Tests Engine.RegisterDistributedLogger(ILogger centralLogger, LoggerDescription forwardingLogger) when - /// the CentralLogger has already been Registered, but the ForwardingLogger has not - /// - [Test] - [Ignore("nyi")] - public void RegisterDistributedLoggerCentralAlreadyRegisteredForwarindNot() - { - } - - /// - /// Tests Engine.RegisterDistributedLogger(ILogger centralLogger, LoggerDescription forwardingLogger) when - /// the CentralLogger has not been registered yet, but the ForwardingLogger has been registered - /// - [Test] - [Ignore("nyi")] - public void RegisterDistributedLoggerCentralNotForwardingAlreadyRegistered() - { - } - - /// - /// Tests Engine.RegisterDistributedLogger(ILogger centralLogger, LoggerDescription forwardingLogger) when - /// when both central and forwarding loggers have been registered already - /// - [Test] - [Ignore("nyi")] - public void RegisterDistributedLoggerBothAlreadyRegistered() - { - } - - /// - /// Tests Engine.RegisterDistributedLogger(ILogger centralLogger, LoggerDescription forwardingLogger) when - /// when you use the same logger for the central logger and the fowarding logger (not already registered) - /// - [Test] - [Ignore("nyi")] - public void RegisterDistributedLoggerSameLoggerForCentralAndForwarding() - { - } - #endregion - - #region RegisterLogger Tests - /// - /// Tests Engine.RegisterLogger(ILogger logger) with - /// - [Test] - [Ignore("nyi")] - public void RegisterLogger() - { - } - - /// - /// Tests Engine.RegisterLogger(ILogger logger) with null logger - /// - [Test] - [Ignore("nyi")] - public void RegisterLoggerNull() - { - } - - /// - /// Tests Engine.RegisterLogger(ILogger logger) with basic logger - /// - [Test] - [Ignore("nyi")] - public void RegisterLoggerBasicLogger() - { - } - - /// - /// Tests Engine.RegisterLogger(ILogger logger) with logger that's already been registered - /// - [Test] - [Ignore("nyi")] - public void RegisterLoggerLoggerAlreadyRegistered() - { - } - #endregion - - #region Shutdown Tests - /// - /// Tests Engine.Shutdown() when you've not loaded anything (basically just new up a new Engine - /// and shut it down - /// - [Test] - [Ignore("nyi")] - public void ShutdownWithNothingLoaded() - { - } - - /// - /// Tests Engine.Shutdown() when you've loaded a project, but never built (and don't unload project) - /// - [Test] - [Ignore("nyi")] - public void ShutdownAfterLoadingOnlyProject() - { - } - - /// - /// Tests Engine.Shutdown() when when you've loaded a project, built it, and unloaded it, then engine.shutdown() - /// - [Test] - [Ignore("nyi")] - public void ShutdownLoadProjectBuildUnloadProject() - { - } - - /// - /// Tests Engine.Shutdown() when when you've loaded a project, loggers, etc, no building, nothing unloaded - /// - [Test] - [Ignore("nyi")] - public void ShutdownLoadProjectLoggersNoBuild() - { - } - - /// - /// Tests Engine.Shutdown() when you've loaded a project, loggers, etc, built, then only unloaded the loggers, - /// project still loaded - /// - [Test] - [Ignore("nyi")] - public void ShutdownLoadProjectLoggersBuildUnloadOnlyLoggers() - { - } - - /// - /// Tests Engine.Shutdown() when you've loaded a project, loggers, etc, built, then unloaded everything - /// - [Test] - [Ignore("nyi")] - public void ShutdownLoadedBuiltUnloaded() - { - } - #endregion - - #region UnloadAllProjects Tests - /// - /// Tests Engine.UnloadAllProjects() when no projects are loaded - /// - [Test] - [Ignore("nyi")] - public void UnloadAllProjectsWhenNoProjectsLoaded() - { - } - - /// - /// Tests Engine.UnloadAllProjects() when only one project has been loaded - /// - [Test] - [Ignore("nyi")] - public void UnloadAllProjectsOneProjectLoaded() - { - } - - /// - /// Tests Engine.UnloadAllProjects() when Multiple projects are loaded - /// - [Test] - [Ignore("nyi")] - public void UnloadAllProjectsMultipleProjectsLoaded() - { - } - - /// - /// Tests Engine.UnloadAllProjects() when mix, some projects already unloaded, some still loaded - /// - [Test] - [Ignore("nyi")] - public void UnloadAllProjectsSomeProjectsUnloadedSomeProjectsLoaded() - { - } - - /// - /// Tests Engine.UnloadAllProjects() when when imported projects exist - /// - [Test] - [Ignore("nyi")] - public void UnloadAllProjectsWithImportedProjects() - { - } - - /// - /// Tests Engine.UnloadAllProjects() with a traversal project that references many projects, all loaded and have built - /// - [Test] - [Ignore("nyi")] - public void UnloadAllProjectsWithTraversalProject() - { - } - #endregion - - #region UnloadProject Tests - /// - /// Tests Engine.UnloadProject(Project project) simple project that has been loaded - /// - [Test] - [Ignore("nyi")] - public void UnloadProjectSimpleProject() - { - } - - /// - /// Tests Engine.UnloadProject(Project project) passing in null - /// - [Test] - [Ignore("nyi")] - public void UnloadProjectNull() - { - } - - /// - /// Tests Engine.UnloadProject(Project project) a project that hasn't been loaded - /// - [Test] - [Ignore("nyi")] - public void UnloadProjectANonLoadedProject() - { - } - - /// - /// Tests Engine.UnloadProject(Project project) an imported project from another project - /// - [Test] - [Ignore("nyi")] - public void UnloadProjectImportedProject() - { - } - - /// - /// Tests Engine.UnloadProject(Project project) a traversal project - /// - [Test] - [Ignore("nyi")] - public void UnloadProjectTraversalProject() - { - } - - /// - /// Tests Engine.UnloadProject(Project project) one of many Loaded Projects (ensure other loaded projects remain loaded) - /// - [Test] - [Ignore("nyi")] - public void UnloadProjectOneOfMany() - { - } - - /// - /// Tests Engine.UnloadProject(Project project) several projects, one at a time - /// - [Test] - [Ignore("nyi")] - public void UnloadProjectSeveralOneAtATime() - { - } - #endregion - - #region UnregisterAllLoggers Tests - /// - /// Tests Engine.UnregisterAllLoggers() when you have no loggers registered - /// - [Test] - [Ignore("nyi")] - public void UnregisterAllLoggersWhenNoLoggersAreRegistered() - { - } - - /// - /// Tests Engine.UnregisterAllLoggers() when you have only one logger registered - /// - [Test] - [Ignore("nyi")] - public void UnregisterAllLoggersWithOneLogger() - { - } - - /// - /// Tests Engine.UnregisterAllLoggers() when you have multiple loggers registered - /// - [Test] - [Ignore("nyi")] - public void UnregisterAllLoggersWithMultipleLoggers() - { - } - - /// - /// Tests Engine.UnregisterAllLoggers() when you have only Distributed Central and forwarding loggers registered - /// - [Test] - [Ignore("nyi")] - public void UnregisterAllLoggersWithDistributedLoggers() - { - } - #endregion - - #region Helper Methods - /// - /// blah - /// - /// a - /// a - private void ExpectedSetValidBinPaths(string binPath, string expectedResult) - { - Engine e = new Engine(); - e.BinPath = binPath; - Assertion.AssertEquals(expectedResult, e.BinPath); - } - - /// - /// Gets you the FX path string - /// - /// 2.0, 3.5, etc - /// Full path to the FX folder based on the toolsversion - private string GetBinPathFromRegistry(string toolsVersion) - { - // [HKLM]\SOFTWARE\Microsoft - // msbuild - // 3.5 - // @DefaultToolsVersion = 2.0 - // ToolsVersions - // 2.0 - // @MSBuildToolsPath = D:\SomeFolder - // 3.5 - // @MSBuildToolsPath = D:\SomeOtherFolder - // @MSBuildBinPath = D:\SomeOtherFolder - // @SomePropertyName = PropertyOtherValue - string toolsPath = (string)Registry.GetValue(@"hkey_local_machine\software\microsoft\msbuild\toolsversions\" + toolsVersion, "MSBuildToolsPath", null); - - if (toolsPath != null) - { - toolsPath = toolsPath.TrimEnd(new char[] { '\\' }); - } - - return toolsPath; - } - - #endregion - } -} diff --git a/src/Deprecated/Engine.UnitTests/Compatibility/ImportCollection_Tests.cs b/src/Deprecated/Engine.UnitTests/Compatibility/ImportCollection_Tests.cs deleted file mode 100644 index 59618157eba..00000000000 --- a/src/Deprecated/Engine.UnitTests/Compatibility/ImportCollection_Tests.cs +++ /dev/null @@ -1,425 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections.Generic; -using System.Text; -using System.IO; - -using NUnit.Framework; - -using Microsoft.Build; -using Microsoft.Build.BuildEngine; -using Microsoft.Build.Framework; -using Microsoft.Build.UnitTests; - -namespace Microsoft.Build.UnitTests.OM.OrcasCompatibility -{ - /// - /// Fixture Class for the v9 OM Public Interface Compatibility Tests. Import Class. - /// Also see Toolset tests in the Project test class. - /// - [TestFixture] - public class ImportCollection_Tests : AddNewImportTests - { - /// - /// Set the indirection for AddNewImport Tests - /// - public ImportCollection_Tests() - { - InvokeAddNewImportMethod = new AddNewImportDelegate(AddNewImportOverload); - } - - /// - /// Count Test. Increment Count on Import Add - /// - [Test] - public void Count_IncrementOnAdd() - { - string importPath = String.Empty; - try - { - importPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("import.proj", TestData.Content3SimpleTargetsDefaultSpecified); - Project p = new Project(); - Assertion.AssertEquals(0, p.Imports.Count); - p.Imports.AddNewImport(importPath, "true"); - Assertion.AssertEquals(0, p.Imports.Count); - object o = p.EvaluatedItems; - Assertion.AssertEquals(1, p.Imports.Count); - } - finally - { - CompatibilityTestHelpers.RemoveFile(importPath); - } - } - - /// - /// Count Test. Decrement\Reset Count to 0 on clear import list. - /// - [Test] - public void Count_DecrementOnRemove() - { - string importPath = String.Empty; - try - { - importPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("import.proj", TestData.Content3SimpleTargetsDefaultSpecified); - Project p = new Project(); - p.Imports.AddNewImport(importPath, "true"); - object o = p.EvaluatedItems; - Assertion.AssertEquals(1, p.Imports.Count); - p.Imports.RemoveImport(CompatibilityTestHelpers.FindFirstMatchingImportByPath(p.Imports, importPath)); - Assertion.AssertEquals(0, p.Imports.Count); - } - finally - { - CompatibilityTestHelpers.RemoveFile(importPath); - } - } - - /// - /// CopyTo Test, copy into array at index zero - /// - [Test] - public void CopyToStrong_IndexZero() - { - string importPath = String.Empty; - try - { - importPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("import.proj", TestData.Content3SimpleTargetsDefaultSpecified); - Project p = new Project(); - p.Imports.AddNewImport(importPath, "true"); - object o = p.EvaluatedItems; - Import import = CompatibilityTestHelpers.FindFirstMatchingImportByPath(p.Imports, importPath); - Import[] importArray = new Import[p.Imports.Count]; - p.Imports.CopyTo(importArray, 0); - Assertion.AssertEquals(p.Imports.Count, importArray.Length); - Assertion.AssertEquals(0, Array.IndexOf(importArray, import)); - Assertion.AssertEquals(true, object.ReferenceEquals(importArray[Array.IndexOf(importArray, import)], import)); - } - finally - { - CompatibilityTestHelpers.RemoveFile(importPath); - } - } - - /// - /// CopyTo Test, copy into array at an offset Index - /// - [Test] - public void CopyToStrong_OffsetIndex() - { - string importPath = String.Empty; - try - { - const int OffsetIndex = 2; - importPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("import.proj", TestData.Content3SimpleTargetsDefaultSpecified); - Project p = new Project(); - p.Imports.AddNewImport(importPath, "true"); - object o = p.EvaluatedItems; - Import import = CompatibilityTestHelpers.FindFirstMatchingImportByPath(p.Imports, importPath); - Import[] importArray = new Import[p.Imports.Count + OffsetIndex]; - p.Imports.CopyTo(importArray, OffsetIndex); - Assertion.AssertEquals(p.Imports.Count, importArray.Length - OffsetIndex); - Assertion.AssertNull(importArray[OffsetIndex - 1]); - Assertion.AssertEquals(true, 0 < Array.IndexOf(importArray, import)); - } - finally - { - CompatibilityTestHelpers.RemoveFile(importPath); - } - } - - /// - /// CopyTo Test, copy into array that is initialized too small to contain all imports - /// - [Test] - [ExpectedException(typeof(OverflowException))] - public void CopyToStrong_ArrayTooSmallImportsNotEvaludated() - { - string importPath = String.Empty; - try - { - importPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("import.proj", TestData.Content3SimpleTargetsDefaultSpecified); - Project p = new Project(); - p.Imports.AddNewImport(importPath, "true"); - p.Imports.CopyTo(new Toolset[p.Imports.Count - 1], 0); - } - finally - { - CompatibilityTestHelpers.RemoveFile(importPath); - } - } - - /// - /// CopyTo Test, copy into array that is initialized too small to contain all imports - /// - [Test] - [ExpectedException(typeof(ArgumentException))] - public void CopyToStrong_ArrayTooSmall() - { - string importPath = String.Empty; - try - { - importPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("import.proj", TestData.Content3SimpleTargetsDefaultSpecified); - Project p = new Project(); - p.Imports.AddNewImport(importPath, "true"); - object o = p.EvaluatedItems; - p.Imports.CopyTo(new Toolset[p.Imports.Count - 1], 0); - } - finally - { - CompatibilityTestHelpers.RemoveFile(importPath); - } - } - - /// - /// CopyTo Test, weak array, cast and narrow the return to import type - /// - [Test] - public void CopyToWeak_CastNarrowReturns() - { - string importPath = String.Empty; - try - { - importPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("import.proj", TestData.Content3SimpleTargetsDefaultSpecified); - Project p = new Project(); - p.Imports.AddNewImport(importPath, "true"); - object o = p.EvaluatedItems; - Import import = CompatibilityTestHelpers.FindFirstMatchingImportByPath(p.Imports, importPath); - Import[] importArray = new Import[p.Imports.Count]; - p.Imports.CopyTo(importArray, 0); - Assertion.AssertEquals(p.Imports.Count, importArray.Length); - Assertion.AssertEquals(0, Array.IndexOf(importArray, import)); - Assertion.AssertEquals(true, object.ReferenceEquals(importArray[Array.IndexOf(importArray, import)], import)); - } - finally - { - CompatibilityTestHelpers.RemoveFile(importPath); - } - } - - /// - /// CopyTo Test, store the return in weakly typed array - /// - [Test] - public void CopyToWeak_Simple() - { - string importPath = String.Empty; - try - { - importPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("import.proj", TestData.Content3SimpleTargetsDefaultSpecified); - Project p = new Project(new Engine()); - p.Imports.AddNewImport(importPath, "true"); - object o = p.EvaluatedItems; - Import import = CompatibilityTestHelpers.FindFirstMatchingImportByPath(p.Imports, importPath); - Array importArray = Array.CreateInstance(typeof(Import), p.Imports.Count); - p.Imports.CopyTo(importArray, 0); - Assertion.AssertEquals(p.Imports.Count, importArray.Length); - Assertion.AssertEquals(0, Array.IndexOf(importArray, import)); - } - finally - { - CompatibilityTestHelpers.RemoveFile(importPath); - } - } - - /// - /// RemoveImport Test, null - /// - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void RemoveImport_Null() - { - Project p = new Project(new Engine()); - p.Imports.RemoveImport(null); - } - - /// - /// RemoveImport Test, remove a import that belongs to a differnet project - /// - [Test] - [ExpectedException(typeof(InvalidOperationException))] - public void RemoveImport_Empty() - { - string importPath = String.Empty; - try - { - importPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("import.proj", TestData.Content3SimpleTargetsDefaultSpecified); - Project p = new Project(); - Project p2 = new Project(); - p.Imports.AddNewImport(importPath, "true"); - p2.Imports.AddNewImport(importPath, "true"); - object o = p.EvaluatedItems; - o = p2.EvaluatedItems; - Import import2 = CompatibilityTestHelpers.FindFirstMatchingImportByPath(p2.Imports, importPath); - p.Imports.RemoveImport(import2); // does not exist in this project - } - finally - { - CompatibilityTestHelpers.RemoveFile(importPath); - } - } - - /// - /// RemoveImport Test, remove a import and check dirty - /// - [Test] - public void RemoveImport_SimpleDirtyAfterRemove() - { - string importPath = String.Empty; - string projectPath = String.Empty; - try - { - importPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("import.proj", TestData.Content3SimpleTargetsDefaultSpecified); - projectPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("project.proj", TestData.Content3SimpleTargetsDefaultSpecified); - Project p = new Project(); - p.Imports.AddNewImport(importPath, "true"); - object o = p.EvaluatedItems; - Import import = CompatibilityTestHelpers.FindFirstMatchingImportByPath(p.Imports, importPath); - p.Save(projectPath); - Assertion.AssertEquals(false, p.IsDirty); - p.Imports.RemoveImport(import); - Assertion.AssertNull(CompatibilityTestHelpers.FindFirstMatchingImportByPath(p.Imports, importPath)); - Assertion.AssertEquals(true, p.IsDirty); - } - finally - { - CompatibilityTestHelpers.RemoveFile(importPath); - CompatibilityTestHelpers.RemoveFile(projectPath); - } - } - - /// - /// RemoveImport Test, try to remove an import that is not first order - /// - [Test] - [ExpectedException(typeof(InvalidOperationException))] - public void RemoveImport_ImportOfImport() - { - string project1 = String.Empty; - string importPathA = String.Empty; - string importPathB = String.Empty; - string importPathBFull = String.Empty; - try - { - project1 = ObjectModelHelpers.CreateFileInTempProjectDirectory("project.proj", TestData.ContentImportA); - importPathA = ObjectModelHelpers.CreateFileInTempProjectDirectory("importA.proj", TestData.ContentImportB); - importPathB = "importB.proj"; // as specified in TestData.ContentImportB xml - importPathBFull = ObjectModelHelpers.CreateFileInTempProjectDirectory(importPathB, TestData.ContentA); - Project p = new Project(); - p.Load(project1); - object o = p.EvaluatedProperties; - Import import = CompatibilityTestHelpers.FindFirstMatchingImportByPath(p.Imports, importPathB); - p.Imports.RemoveImport(import); - } - finally - { - CompatibilityTestHelpers.RemoveFile(project1); - CompatibilityTestHelpers.RemoveFile(importPathA); - CompatibilityTestHelpers.RemoveFile(importPathBFull); - } - } - - /// - /// Enumeration Test, manual iteration over ImportCollection using GetEnumerator(); - /// - [Test] - public void GetEnumerator() - { - string importPath = String.Empty; - string importPath2 = String.Empty; - try - { - importPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("import.proj", TestData.Content3SimpleTargetsDefaultSpecified); - importPath2 = ObjectModelHelpers.CreateFileInTempProjectDirectory("import2.proj", TestData.Content3SimpleTargetsDefaultSpecified); - Project p = new Project(); - p.Imports.AddNewImport(importPath, "true"); - p.Imports.AddNewImport(importPath2, "true"); - object o = p.EvaluatedItems; - Import[] importArray = new Import[p.Imports.Count]; - p.Imports.CopyTo(importArray, 0); - System.Collections.IEnumerator importEnum = p.Imports.GetEnumerator(); - int enumerationCounter = 0; - while (importEnum.MoveNext()) - { - Assertion.AssertEquals(true, object.ReferenceEquals(importArray[enumerationCounter], importEnum.Current)); - Assertion.AssertEquals(importArray[enumerationCounter].ProjectPath, ((Import)importEnum.Current).ProjectPath); - enumerationCounter++; - } - } - finally - { - CompatibilityTestHelpers.RemoveFile(importPath); - CompatibilityTestHelpers.RemoveFile(importPath2); - } - } - - /// - /// SyncRoot Test, Take a lock on SyncRoot then iterate over it. - /// - [Test] - public void SyncRoot() - { - string importPath = String.Empty; - string importPath2 = String.Empty; - try - { - importPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("import.proj", TestData.Content3SimpleTargetsDefaultSpecified); - importPath2 = ObjectModelHelpers.CreateFileInTempProjectDirectory("import2.proj", TestData.Content3SimpleTargetsDefaultSpecified); - Project p = new Project(); - p.Imports.AddNewImport(importPath, "true"); - p.Imports.AddNewImport(importPath2, "true"); - object o = p.EvaluatedItems; - Import[] importArray = new Import[p.Imports.Count]; - p.Imports.CopyTo(importArray, 0); - lock (p.Imports.SyncRoot) - { - int i = 0; - foreach (Import import in p.Imports) - { - Assertion.AssertEquals(importArray[i].ProjectPath, import.ProjectPath); - i++; - } - } - } - finally - { - CompatibilityTestHelpers.RemoveFile(importPath); - CompatibilityTestHelpers.RemoveFile(importPath2); - } - } - - /// - /// isSynchronized, is false : returned collection is not threadsafe. - /// - [Test] - public void IsSynchronized() - { - string importPath = String.Empty; - try - { - importPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("import.proj", TestData.Content3SimpleTargetsDefaultSpecified); - Project p = new Project(); - p.Imports.AddNewImport(importPath, "true"); - object o = p.EvaluatedItems; - Assertion.AssertEquals(false, p.Imports.IsSynchronized); - } - finally - { - CompatibilityTestHelpers.RemoveFile(importPath); - } - } - - /// - /// Indirection for common tests to p.AddNewImport - /// - private void AddNewImportOverload(Project p, string path, string condition) - { - p.Imports.AddNewImport(path, condition); - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/Compatibility/Import_Tests.cs b/src/Deprecated/Engine.UnitTests/Compatibility/Import_Tests.cs deleted file mode 100644 index 047d4385a1f..00000000000 --- a/src/Deprecated/Engine.UnitTests/Compatibility/Import_Tests.cs +++ /dev/null @@ -1,326 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections.Generic; -using System.Text; -using System.IO; - -using NUnit.Framework; - -using Microsoft.Build; -using Microsoft.Build.BuildEngine; -using Microsoft.Build.Framework; -using Microsoft.Build.UnitTests; - -namespace Microsoft.Build.UnitTests.OM.OrcasCompatibility -{ - /// - /// Fixture Class for the v9 OM Public Interface Compatibility Tests. Import Class. - /// Also see Toolset tests in the Project test class. - /// - [TestFixture] - public sealed class Import_Tests - { - /// - /// Condition Test, Simple Condition, assert only accessible after evaluation. - /// - [Test] - public void ConditionGet_Simple() - { - string importPath = String.Empty; - try - { - importPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("import.proj", TestData.Content3SimpleTargetsDefaultSpecified); - Project p = new Project(); - p.AddNewImport(importPath, "true"); - Import import = CompatibilityTestHelpers.FindFirstMatchingImportByPath(p.Imports, importPath); - Assertion.AssertNull("true", import); - object o = p.EvaluatedProperties; - import = CompatibilityTestHelpers.FindFirstMatchingImportByPath(p.Imports, importPath); - Assertion.AssertEquals("true", import.Condition); - } - finally - { - CompatibilityTestHelpers.RemoveFile(importPath); - } - } - - /// - /// Condition Test, Null condition. - /// - [Test] - public void ConditionGet_Null() - { - string importPath = string.Empty; - try - { - importPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("import.proj", TestData.Content3SimpleTargetsDefaultSpecified); - Project p = new Project(); - p.AddNewImport(importPath, null); - object o = p.EvaluatedProperties; - Import import = CompatibilityTestHelpers.FindFirstMatchingImportByPath(p.Imports, importPath); - Assertion.AssertNull(import.Condition); - } - finally - { - CompatibilityTestHelpers.RemoveFile(importPath); - } - } - - /// - /// Condition Test, Set Null condition, assert empty string back. - /// - [Test] - public void ConditionSet_Null() - { - string importPath = String.Empty; - try - { - importPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("import.proj", TestData.Content3SimpleTargetsDefaultSpecified); - Project p = new Project(); - p.AddNewImport(importPath, "true"); - object o = p.EvaluatedProperties; - Import import = CompatibilityTestHelpers.FindFirstMatchingImportByPath(p.Imports, importPath); - import.Condition = null; - Assertion.AssertEquals(String.Empty, import.Condition); - } - finally - { - CompatibilityTestHelpers.RemoveFile(importPath); - } - } - - /// - /// Condition Test, dirty wet set. - /// - [Test] - public void ConditionSet_DirtyWhenSet() - { - string projectPath = String.Empty; - string importPath = String.Empty; - try - { - projectPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("project.proj", TestData.Content3SimpleTargetsDefaultSpecified); - importPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("import.proj", TestData.Content3SimpleTargetsDefaultSpecified); - Project p = new Project(); - p.AddNewImport(importPath, "true"); - object o = p.EvaluatedProperties; - Import import = CompatibilityTestHelpers.FindFirstMatchingImportByPath(p.Imports, importPath); - p.Save(projectPath); - Assertion.AssertEquals(false, p.IsDirty); - import.Condition = "condition"; - Assertion.AssertEquals(true, p.IsDirty); - } - finally - { - CompatibilityTestHelpers.RemoveFile(importPath); - CompatibilityTestHelpers.RemoveFile(projectPath); - } - } - - /// - /// ProjectPath Test, get when set in the constructor. - /// - [Test] - public void ProjectPathGetWhenSetInCtor() - { - string importPath = String.Empty; - try - { - importPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("import.proj", TestData.Content3SimpleTargetsDefaultSpecified); - Project p = new Project(); - p.AddNewImport(importPath, "true"); - object o = p.EvaluatedProperties; - - // The verbosity of this assertion is to abstract the internal implentation of FindFirstMatchingImportByPath. - Assertion.AssertEquals(importPath, CompatibilityTestHelpers.FindFirstMatchingImportByPath(p.Imports, importPath).ProjectPath); - } - finally - { - CompatibilityTestHelpers.RemoveFile(importPath); - } - } - - /// - /// ProjectPath Test, get when set in ctor - /// - [Test] - public void EvaluatedProjectPathGetWhenSetInCtor() - { - string importPath = "importA.proj"; - string fullImportPath = ObjectModelHelpers.CreateFileInTempProjectDirectory(importPath, TestData.Content3SimpleTargetsDefaultSpecified); - string projectPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("project.proj", TestData.ContentImportA); - try - { - Project p = new Project(); - p.Load(projectPath); - - // The verbosity of this assertion is to abstract the internal implentation of FindFirstMatchingImportByPath. - Assertion.AssertEquals(fullImportPath, CompatibilityTestHelpers.FindFirstMatchingImportByPath(p.Imports, importPath).EvaluatedProjectPath); - } - finally - { - CompatibilityTestHelpers.RemoveFile(projectPath); - CompatibilityTestHelpers.RemoveFile(fullImportPath); - } - } - - /// - /// ProjectPath Test, get when set in loaded xml. - /// - [Test] - public void ProjectPathGetWhenSetInXML() - { - string projectPath = String.Empty; - string importPath = String.Empty; - string fullImportPath = String.Empty; - try - { - projectPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("project.proj", TestData.ContentImportA); - importPath = "importA.proj"; // as specified in xml - fullImportPath = ObjectModelHelpers.CreateFileInTempProjectDirectory(importPath, TestData.ContentA); - Project p = new Project(); - p.Load(projectPath); - Assertion.AssertEquals(importPath, CompatibilityTestHelpers.FindFirstMatchingImportByPath(p.Imports, importPath).ProjectPath); - } - finally - { - CompatibilityTestHelpers.RemoveFile(projectPath); - CompatibilityTestHelpers.RemoveFile(fullImportPath); - } - } - - /// - /// ProjectPath Test, set overriding ctor value. - /// - [Test] - public void ProjectPathSet() - { - string importPath = String.Empty; - try - { - importPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("import.proj", TestData.Content3SimpleTargetsDefaultSpecified); - Project p = new Project(); - p.AddNewImport(importPath, "true"); - object o = p.EvaluatedProperties; - Import import = CompatibilityTestHelpers.FindFirstMatchingImportByPath(p.Imports, importPath); - import.ProjectPath = @"c:\anotherPath"; - Assertion.AssertEquals(@"c:\anotherPath", import.ProjectPath); - } - finally - { - CompatibilityTestHelpers.RemoveFile(importPath); - } - } - - /// - /// ProjectPath Test, set overriding ctor value. - /// - [Test] - public void ProjectPathSet_Escaped() - { - string importPath = String.Empty; - try - { - importPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("import.proj", TestData.Content3SimpleTargetsDefaultSpecified); - Project p = new Project(); - p.AddNewImport(importPath, "true"); - object o = p.EvaluatedProperties; - Import import = CompatibilityTestHelpers.FindFirstMatchingImportByPath(p.Imports, importPath); - import.ProjectPath = @"%25%2a%3f%40%24%28%29%3b\"; - Assertion.AssertEquals(@"%25%2a%3f%40%24%28%29%3b\", import.ProjectPath); - } - finally - { - CompatibilityTestHelpers.RemoveFile(importPath); - } - } - - /// - /// IsImported Test, false when project is an import - /// - [Test] - public void IsImported_ProjectImport() - { - string importPath = String.Empty; - try - { - importPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("import.proj", TestData.Content3SimpleTargetsDefaultSpecified); - Project p = new Project(); - p.AddNewImport(importPath, "true"); - object o = p.EvaluatedProperties; - Import import = CompatibilityTestHelpers.FindFirstMatchingImportByPath(p.Imports, importPath); - Assertion.AssertEquals(false, import.IsImported); - } - finally - { - CompatibilityTestHelpers.RemoveFile(importPath); - } - } - - /// - /// IsImported Test, true when import is via an imported project. - /// - [Test] - public void IsImported_ProjectImportImport() - { - string project1 = String.Empty; - string importPathA = String.Empty; - string importPathB = String.Empty; - string importPathBFull = String.Empty; - try - { - project1 = ObjectModelHelpers.CreateFileInTempProjectDirectory("project.proj", TestData.ContentImportA); - importPathA = ObjectModelHelpers.CreateFileInTempProjectDirectory("importA.proj", TestData.ContentImportB); - importPathB = "importB.proj"; // as specified in TestData.ContentImportB xml - importPathBFull = ObjectModelHelpers.CreateFileInTempProjectDirectory(importPathB, TestData.ContentA); - Project p = new Project(); - p.Load(project1); - object o = p.EvaluatedProperties; - Import import = CompatibilityTestHelpers.FindFirstMatchingImportByPath(p.Imports, importPathB); - Assertion.AssertEquals(true, import.IsImported); - } - finally - { - CompatibilityTestHelpers.RemoveFile(project1); - CompatibilityTestHelpers.RemoveFile(importPathA); - CompatibilityTestHelpers.RemoveFile(importPathBFull); - } - } - - /// - /// ProjectPath Test, does not evaluate scalars - /// - [Test] - public void ProjectPathSet_ScalarValue() - { - string importPath = String.Empty; - string importPath2 = String.Empty; - try - { - importPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("import.proj", TestData.Content3SimpleTargetsDefaultSpecified); - importPath2 = ObjectModelHelpers.CreateFileInTempProjectDirectory("import2.proj", TestData.Content3SimpleTargetsDefaultSpecified); - Project p = new Project(); - p.AddNewImport(importPath, "true"); - p.SetProperty("path", importPath2); - object o = p.EvaluatedProperties; - BuildProperty path = CompatibilityTestHelpers.FindBuildProperty(p, "path"); - Import import = CompatibilityTestHelpers.FindFirstMatchingImportByPath(p.Imports, importPath); - import.ProjectPath = "$(path)"; - Assertion.AssertEquals("$(path)", import.ProjectPath); - o = p.EvaluatedProperties; - Assertion.AssertEquals(false, object.Equals(importPath2, import.EvaluatedProjectPath)); // V9 OM does not evaluate imports - } - finally - { - CompatibilityTestHelpers.RemoveFile(importPath); - CompatibilityTestHelpers.RemoveFile(importPath2); - } - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/Compatibility/InvalidProjectfileException_Tests.cs b/src/Deprecated/Engine.UnitTests/Compatibility/InvalidProjectfileException_Tests.cs deleted file mode 100644 index c557ff04b8c..00000000000 --- a/src/Deprecated/Engine.UnitTests/Compatibility/InvalidProjectfileException_Tests.cs +++ /dev/null @@ -1,318 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections.Generic; -using System.Text; -using System.IO; -using System.Xml; -using System.Xml.Serialization; -using System.Runtime.Serialization; -using System.Runtime.Serialization.Formatters.Binary; - -using NUnit.Framework; - -using Microsoft.Build; -using Microsoft.Build.BuildEngine; -using Microsoft.Build.Framework; -using Microsoft.Build.UnitTests; - -namespace Microsoft.Build.UnitTests.OM.OrcasCompatibility -{ - /// - /// Fixture Class for the v9 OM Public Interface Compatibility Tests. Import Class. - /// Also see Toolset tests in the Project test class. - /// - [TestFixture] - public class InvalidProjectfileException_Tests - { - /// - /// Ctor test, default construction is supported. - /// - [Test] - public void CtorDefault() - { - InvalidProjectFileException invalidProjectFileException = new InvalidProjectFileException(); - } - - /// - /// Ctor Test, with message - /// - [Test] - public void CtorMessageArity1() - { - InvalidProjectFileException invalidProjectFileException = new InvalidProjectFileException("Message"); - Assertion.AssertEquals("Message", invalidProjectFileException.Message); - Assertion.AssertEquals(0, invalidProjectFileException.LineNumber); - Assertion.AssertEquals(0, invalidProjectFileException.ColumnNumber); - } - - /// - /// Ctor Test, with null message - /// - [Test] - public void CtorMessageArity1_null() - { - string nullString = null; // typed null as to hit correct ctor overloaded. - InvalidProjectFileException invalidProjectFileException = new InvalidProjectFileException(nullString); - InvalidProjectFileException invalidProjectFileException2 = new InvalidProjectFileException(nullString, new Exception("MessageInner")); - } - - /// - /// Ctor Test, with an empty string message - /// - [Test] - public void CtorMessageArity1_empty() - { - InvalidProjectFileException invalidProjectFileException = new InvalidProjectFileException(String.Empty); - InvalidProjectFileException invalidProjectFileException2 = new InvalidProjectFileException(String.Empty, new Exception("MessageInner")); - } - - /// - /// Ctor Test, with message and inner exception - /// - [Test] - public void Ctor_Arity2InnerException() - { - InvalidProjectFileException invalidProjectFileException = new InvalidProjectFileException("Message", new Exception("MessageInner")); - Assertion.AssertEquals("Message", invalidProjectFileException.Message); - Assertion.AssertEquals("MessageInner", invalidProjectFileException.InnerException.Message); - Assertion.AssertEquals(0, invalidProjectFileException.LineNumber); - Assertion.AssertEquals(0, invalidProjectFileException.ColumnNumber); - } - - /// - /// Ctor Test, Construct with a mock project element. There is no way to test this on concrete project as the xml tree is internalised. - /// - [Test] - public void CtorArity4() - { - string message = "Message"; - InvalidProjectFileException invalidProjectFileException = - new InvalidProjectFileException(new XmlDocument().CreateElement("name"), message, "errorSubCategory", "errorCode", "HelpKeyword"); - Assertion.AssertEquals(String.Empty, invalidProjectFileException.ProjectFile); - - // preserve a bug in Orcas SP1: if projectFile is empty but non-null, extra spaces get added to the message. - Assertion.AssertEquals(message + " ", invalidProjectFileException.Message); - Assertion.AssertEquals("errorSubCategory", invalidProjectFileException.ErrorSubcategory); - Assertion.AssertEquals("errorCode", invalidProjectFileException.ErrorCode); - Assertion.AssertEquals("HelpKeyword", invalidProjectFileException.HelpKeyword); - Assertion.AssertEquals(0, invalidProjectFileException.LineNumber); - Assertion.AssertEquals(0, invalidProjectFileException.ColumnNumber); - } - - /// - /// Ctor Test, Construct with a mock project element and a Null message string - /// - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void CtorArity4_NullMessageString() - { - string message = null; - InvalidProjectFileException invalidProjectFileException = - new InvalidProjectFileException(new XmlDocument().CreateElement("name"), message, "subcategory", "ErrorCode", "HelpKeyword"); - Assertion.AssertEquals(String.Empty, invalidProjectFileException.ProjectFile); - Assertion.AssertEquals(message, invalidProjectFileException.Message); - Assertion.AssertNull(invalidProjectFileException.ErrorSubcategory); - Assertion.AssertEquals("ErrorCode", invalidProjectFileException.ErrorCode); - Assertion.AssertEquals("HelpKeyword", invalidProjectFileException.HelpKeyword); - Assertion.AssertEquals(0, invalidProjectFileException.LineNumber); - Assertion.AssertEquals(0, invalidProjectFileException.ColumnNumber); - } - - /// - /// Ctor Test - /// - [Test] - [ExpectedException(typeof(ArgumentException))] - public void CtorArity4_EmptyMessageString() - { - string message = String.Empty; - InvalidProjectFileException invalidProjectFileException = - new InvalidProjectFileException(new XmlDocument().CreateElement("Name"), message, String.Empty, String.Empty, String.Empty); - } - - /// - /// Ctor Testt - /// - [Test] - public void CtorArity4_EmptyStringOtherParams() - { - string message = "Message"; - InvalidProjectFileException invalidProjectFileException = - new InvalidProjectFileException(new XmlDocument().CreateElement("Name"), message, String.Empty, String.Empty, String.Empty); - Assertion.AssertEquals(String.Empty, invalidProjectFileException.ProjectFile); - - // preserve a bug in Orcas SP1: if projectFile is empty but non-null, extra spaces get added to the message. - Assertion.AssertEquals(message + " ", invalidProjectFileException.Message); - Assertion.AssertEquals(String.Empty, invalidProjectFileException.ErrorSubcategory); - Assertion.AssertEquals(String.Empty, invalidProjectFileException.ErrorCode); - Assertion.AssertEquals(String.Empty, invalidProjectFileException.HelpKeyword); - Assertion.AssertEquals(0, invalidProjectFileException.LineNumber); - Assertion.AssertEquals(0, invalidProjectFileException.ColumnNumber); - } - - /// - /// Ctor Test - /// - [Test] - public void CtorArity4_NullStringOtherParams() - { - string message = "Message"; - InvalidProjectFileException invalidProjectFileException = - new InvalidProjectFileException(new XmlDocument().CreateElement("Name"), message, null, null, null); - Assertion.AssertEquals(String.Empty, invalidProjectFileException.ProjectFile); - - // preserve a bug in Orcas SP1: if projectFile is empty but non-null, extra spaces get added to the message. - Assertion.AssertEquals(message + " ", invalidProjectFileException.Message); - Assertion.AssertEquals(null, invalidProjectFileException.ErrorSubcategory); - Assertion.AssertEquals(null, invalidProjectFileException.ErrorCode); - Assertion.AssertEquals(null, invalidProjectFileException.HelpKeyword); - } - - /// - /// Ctor Test - /// - [Test] - public void Ctor_Arity9PositveInts() - { - string message = "Message"; - string projectFile = @"c:\ProjectFile"; - InvalidProjectFileException invalidProjectFileException = - new InvalidProjectFileException(projectFile, 1, 10, 11, 12, message, "errorSubCategory", "errorCode", "HelpKeyword"); - Assertion.AssertEquals(message + " " + projectFile, invalidProjectFileException.Message); - Assertion.AssertEquals("errorSubCategory", invalidProjectFileException.ErrorSubcategory); - Assertion.AssertEquals("errorCode", invalidProjectFileException.ErrorCode); - Assertion.AssertEquals("HelpKeyword", invalidProjectFileException.HelpKeyword); - Assertion.AssertEquals(1, invalidProjectFileException.LineNumber); - Assertion.AssertEquals(10, invalidProjectFileException.ColumnNumber); - Assertion.AssertEquals(11, invalidProjectFileException.EndLineNumber); - Assertion.AssertEquals(12, invalidProjectFileException.EndColumnNumber); - } - - /// - /// Ctor Test, this enforces lack of bounds checking and the lack of range checking (end can come before start) - /// on the line and column number params. - /// - [Test] - public void CtorArity9NegativeInts() - { - string message = "Message"; - string projectFile = @"c:\ProjectFile"; - InvalidProjectFileException invalidProjectFileException = - new InvalidProjectFileException(projectFile, -1, -10, -11, -12, message, "errorSubCategory", "errorCode", "HelpKeyword"); - Assertion.AssertEquals(message + " " + projectFile, invalidProjectFileException.Message); - Assertion.AssertEquals("errorSubCategory", invalidProjectFileException.ErrorSubcategory); - Assertion.AssertEquals("errorCode", invalidProjectFileException.ErrorCode); - Assertion.AssertEquals("HelpKeyword", invalidProjectFileException.HelpKeyword); - Assertion.AssertEquals(-1, invalidProjectFileException.LineNumber); - Assertion.AssertEquals(-10, invalidProjectFileException.ColumnNumber); - Assertion.AssertEquals(-11, invalidProjectFileException.EndLineNumber); - Assertion.AssertEquals(-12, invalidProjectFileException.EndColumnNumber); - Assertion.AssertEquals(projectFile, invalidProjectFileException.ProjectFile); - } - - /// - /// BaseMessage, get and set - /// - [Test] - public void BaseMessage() - { - string message = "Message"; - InvalidProjectFileException invalidProjectFileException = - new InvalidProjectFileException("ProjectFile", 0, 0, 0, 0, message, "errorSubCategory", "errorCode", "HelpKeyword"); - Assertion.AssertEquals(message, invalidProjectFileException.BaseMessage); - } - - /// - /// XML Serialization Test, not supported, throws invalid operation Exception. - /// - [Test] - [ExpectedException(typeof(InvalidOperationException))] - public void SerializationXML() - { - InvalidProjectFileException toolSetException = new InvalidProjectFileException("Message", new Exception("innerException")); - MemoryStream memoryStream = null; - try - { - memoryStream = new MemoryStream(); - XmlSerializer xs = new XmlSerializer(typeof(InvalidProjectFileException)); - XmlTextWriter xmlTextWriter = new XmlTextWriter(memoryStream, Encoding.UTF8); - xs.Serialize(xmlTextWriter, toolSetException); - memoryStream = (MemoryStream)xmlTextWriter.BaseStream; - } - finally - { - memoryStream.Close(); - } - } - - /// - /// Binary Serialization Test, serialize the exception out and back in from a stream. This uses the protected constructor - /// - [Test] - public void SerializationBinary() - { - string message = "Message"; - string projectFile = @"c:\ProjectFile"; - MemoryStream memoryStream = null; - InvalidProjectFileException invalidProjectFileException = - new InvalidProjectFileException(projectFile, 1, 2, 3, 4, message, "errorSubCategory", "errorCode", "HelpKeyword"); - - try - { - memoryStream = new MemoryStream(); - IFormatter binaryForamtter = new BinaryFormatter(); - binaryForamtter.Serialize(memoryStream, invalidProjectFileException); - memoryStream.Position = 0; // reset pointer into stream for read - Object returnObj = binaryForamtter.Deserialize(memoryStream); - Assertion.Assert(returnObj is InvalidProjectFileException); - InvalidProjectFileException outException = ((InvalidProjectFileException)returnObj); - Assertion.AssertEquals(message + " " + projectFile, outException.Message); - Assertion.AssertEquals("errorSubCategory", outException.ErrorSubcategory); - Assertion.AssertEquals("errorCode", outException.ErrorCode); - Assertion.AssertEquals("HelpKeyword", outException.HelpKeyword); - Assertion.AssertEquals(1, outException.LineNumber); - Assertion.AssertEquals(2, outException.ColumnNumber); - Assertion.AssertEquals(3, outException.EndLineNumber); - Assertion.AssertEquals(4, outException.EndColumnNumber); - Assertion.AssertEquals(projectFile, outException.ProjectFile); - } - finally - { - memoryStream.Close(); - } - } - - /// - /// Binary Serialization Test, serialize the exception out and back in from a stream with an InnerException. This uses the protected constructor - /// - [Test] - public void SerializationBinaryInnerException() - { - MemoryStream memoryStream = null; - InvalidProjectFileException invalidProjectFileException = - new InvalidProjectFileException("Message", new Exception("innerException")); - try - { - memoryStream = new MemoryStream(); - IFormatter binaryForamtter = new BinaryFormatter(); - binaryForamtter.Serialize(memoryStream, invalidProjectFileException); - memoryStream.Position = 0; // reset pointer into stream for read - Object returnObj = binaryForamtter.Deserialize(memoryStream); - Assertion.Assert(returnObj is InvalidProjectFileException); - InvalidProjectFileException outException = ((InvalidProjectFileException)returnObj); - Assertion.AssertEquals("Message", outException.Message); - Assertion.AssertEquals("innerException", outException.InnerException.Message); - } - finally - { - memoryStream.Close(); - } - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/Compatibility/InvalidToolsetDefinitionException_Tests.cs b/src/Deprecated/Engine.UnitTests/Compatibility/InvalidToolsetDefinitionException_Tests.cs deleted file mode 100644 index dff8021ab7d..00000000000 --- a/src/Deprecated/Engine.UnitTests/Compatibility/InvalidToolsetDefinitionException_Tests.cs +++ /dev/null @@ -1,190 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.IO; -using System.Collections.Generic; -using System.Text; -using System.Xml; -using System.Xml.Serialization; -using System.Runtime.Serialization; -using System.Runtime.Serialization.Formatters.Binary; - -using NUnit.Framework; - -using Microsoft.Build.BuildEngine; -using Microsoft.Build.Framework; -using Microsoft.Build.UnitTests; - -namespace Microsoft.Build.UnitTests.OM.OrcasCompatibility -{ - /// - /// STUB Fixture Class for the v9 OM Public Interface Compatibility Tests. RemoteErrorException class - /// Also see Toolset tests in the Project test class. - /// - [TestFixture] - public class InvalidToolsetDefinitionException_Tests - { - /// - /// Ctor Test, ensure message is set. - /// - [Test] - public void CtorMessage() - { - InvalidToolsetDefinitionException toolSetException = new InvalidToolsetDefinitionException("Message"); - Assertion.AssertEquals("Message", toolSetException.Message); - } - - /// - /// Ctor Test, set a null message. We do not guard against this. - /// - [Test] - public void CtorMessage_Null() - { - InvalidToolsetDefinitionException toolSetException = new InvalidToolsetDefinitionException(null); - } - - /// - /// Ctor Test, ensure message is set to empty - /// - [Test] - public void CtorMessage_Empty() - { - InvalidToolsetDefinitionException toolSetException = new InvalidToolsetDefinitionException(String.Empty); - Assertion.AssertEquals(String.Empty, toolSetException.Message); - } - - /// - /// Ctor Test, set message and inner exception - /// - [Test] - public void CtorArity2InnerException() - { - InvalidToolsetDefinitionException toolSetException = new InvalidToolsetDefinitionException("Message", new Exception("Inner")); - Assertion.AssertEquals("Message", toolSetException.Message); - Assertion.AssertEquals("Inner", toolSetException.InnerException.Message); - } - - /// - /// Ctor Test,set message and error code - /// - [Test] - public void CtorArity2ErrorMessage() - { - InvalidToolsetDefinitionException toolSetException = new InvalidToolsetDefinitionException("Message", "Error"); - Assertion.AssertEquals("Message", toolSetException.Message); - Assertion.AssertEquals("Error", toolSetException.ErrorCode); - } - - /// - /// Ctor Test, set message error code and Inner excetion - /// - [Test] - public void CtorArity3() - { - InvalidToolsetDefinitionException toolSetException = new InvalidToolsetDefinitionException("Message", "Error", new Exception("Inner")); - Assertion.AssertEquals("Message", toolSetException.Message); - Assertion.AssertEquals("Error", toolSetException.ErrorCode); - Assertion.AssertEquals("Inner", toolSetException.InnerException.Message); - } - - /// - /// XML Serialization Test, not supported, throws invalid operation Exception. - /// - [Test] - [ExpectedException(typeof(InvalidOperationException))] - public void SerializationXML() - { - InvalidToolsetDefinitionException toolSetException = new InvalidToolsetDefinitionException("Message", "errorCode"); - MemoryStream memoryStream = null; - try - { - memoryStream = new MemoryStream(); - XmlSerializer xs = new XmlSerializer(typeof(InvalidToolsetDefinitionException)); - XmlTextWriter xmlTextWriter = new XmlTextWriter(memoryStream, Encoding.UTF8); - xs.Serialize(xmlTextWriter, toolSetException); - memoryStream = (MemoryStream)xmlTextWriter.BaseStream; - } - finally - { - memoryStream.Close(); - } - } - - /// - /// Binary Serialization Test, serialize the exception out and back in from a stream. This uses the protected constructor - /// - [Test] - public void SerializationBinary() - { - MemoryStream memoryStream = null; - InvalidToolsetDefinitionException toolSetException = new InvalidToolsetDefinitionException("Message", "errorCode"); - try - { - memoryStream = new MemoryStream(); - IFormatter binaryForamtter = new BinaryFormatter(); - binaryForamtter.Serialize(memoryStream, toolSetException); - memoryStream.Position = 0; // reset pointer into stream for read - Object returnObj = binaryForamtter.Deserialize(memoryStream); - Assertion.Assert(returnObj is InvalidToolsetDefinitionException); - Assertion.AssertEquals("Message", ((InvalidToolsetDefinitionException)returnObj).Message); - } - finally - { - memoryStream.Close(); - } - } - - /// - /// Binary Serialization Test, serialize a inherited exception out and back in from a stream. - /// - [Test] - public void ProtectedConstructorTest() - { - ExtendsInvalidToolsetDefinitionException toolSetException = new ExtendsInvalidToolsetDefinitionException("Message", "Error"); - MemoryStream memoryStream = null; - try - { - memoryStream = new MemoryStream(); - IFormatter binaryForamtter = new BinaryFormatter(); - binaryForamtter.Serialize(memoryStream, toolSetException); - memoryStream.Position = 0; // Reset pointer into stream for read - Object returnObj = binaryForamtter.Deserialize(memoryStream); - Assertion.Assert(returnObj is ExtendsInvalidToolsetDefinitionException); - Assertion.AssertEquals("Message", ((ExtendsInvalidToolsetDefinitionException)returnObj).Message); - Assertion.AssertEquals("Error", ((ExtendsInvalidToolsetDefinitionException)returnObj).ErrorCode); - } - finally - { - memoryStream.Close(); - } - } - - /// - /// Helper class to expose the protected constructor through extension - /// - [Serializable] - internal class ExtendsInvalidToolsetDefinitionException : InvalidToolsetDefinitionException, ISerializable - { - /// - /// Constructor that takes an MSBuild error code, Override - /// - public ExtendsInvalidToolsetDefinitionException(string message, string errorCode) - : base(message, errorCode) - { - } - - /// - /// Basic Constructor Override - /// - public ExtendsInvalidToolsetDefinitionException(SerializationInfo info, StreamingContext context) - : base(info, context) - { - } - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/Compatibility/Project_Tests.cs b/src/Deprecated/Engine.UnitTests/Compatibility/Project_Tests.cs deleted file mode 100644 index 1872557281b..00000000000 --- a/src/Deprecated/Engine.UnitTests/Compatibility/Project_Tests.cs +++ /dev/null @@ -1,3760 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.IO; -using System.Security.Principal; -using System.Security.AccessControl; -using System.Collections.Generic; -using System.Collections; -using System.Xml; -using System.Xml.XPath; -using System.Text; -using System.Threading; - -using NUnit.Framework; - -using Microsoft.Build; -using Microsoft.Build.BuildEngine; -using Microsoft.Build.BuildEngine.Shared; -using Microsoft.Build.Framework; -using Microsoft.Build.UnitTests; - -namespace Microsoft.Build.UnitTests.OM.OrcasCompatibility -{ - /// - /// Fixture Class for the v9 OM Public Interface Compatibility Tests. Project Class. - /// - public sealed class Project_Tests - { - /// - /// Tests for the Project Class Constructor - /// - [TestFixture] - public sealed class Constructor - { - /// - /// Constructor Test, with Engine object. - /// - [Test] - public void ConstructEngine() - { - Engine e = new Engine(); - Project p = new Project(); - Assertion.ReferenceEquals(e, p.ParentEngine); - } - - /// - /// Constructor Test, with Null Engine object. - /// - [Test] - public void ConstructEngine_Null() - { - Engine e = null; - Project p = new Project(e); - Assertion.AssertEquals(Engine.GlobalEngine, p.ParentEngine); - } - - /// - /// Constructor Test, with Engine Object, ToolsVersion empty. - /// - [Test] - [ExpectedException(typeof(ArgumentException))] - public void ConstructToolsVersion_Empty() - { - Project p = new Project(new Engine(), String.Empty); - } - - /// - /// Constructor Test, with Engine Object, ToolsVersion 2.0. - /// - [Test] - public void ConstructToolsVersionKnown_2_0() - { - Project p = new Project(new Engine(), "2.0"); - Assertion.AssertEquals("2.0", p.ToolsVersion); - } - - /// - /// Constructor Test, with Engine Object, ToolsVersion 3.5. - /// - [Test] - public void ConstructToolsVersionKnown_3_5() - { - if (FrameworkLocationHelper.PathToDotNetFrameworkV35 != null) - { - Project p = new Project(new Engine(), "3.5"); - Assertion.AssertEquals("3.5", p.ToolsVersion); - } - else - { - Assert.Ignore(".NET Framework 3.5 is required for this test, but is not installed."); - } - } - - /// - /// Constructor Test, with Engine Object, ToolsVersion 4.0. - /// - [Test] - public void ConstructToolsVersionKnown_4_0() - { - Project p = new Project(new Engine(), "4.0"); - Assertion.AssertEquals("4.0", p.ToolsVersion); - } - - /// - /// Constructor Test, Ensure IsValidate is false. - /// - [Test] - public void ConstructDefault_IsValidate_False() - { - Project p = new Project(new Engine()); - Assertion.AssertEquals(false, p.IsValidated); - } - - /// - /// Constructor Test, ensure HasUnsavedChanges is false. - /// - [Test] - public void ConstructDefault_IsDirty_False() - { - Project p = new Project(new Engine()); - Assertion.AssertEquals(false, p.IsDirty); - } - - /// - /// Constructor Test, Ensure BuildEnabled inherits from parent. - /// - [Test] - public void ConstructDefault_BuildEnabled_InheritParent() - { - Engine e = new Engine(); - e.BuildEnabled = true; - Project p = new Project(e); - Assertion.AssertEquals(true, p.ParentEngine.BuildEnabled); - Assertion.AssertEquals(p.ParentEngine.BuildEnabled, p.BuildEnabled); - } - - /// - /// Constructor Test, Ensure GloabalProperties inherits from parent engine - /// - [Test] - public void ConstructDefault_GlobalProperties_InheritParent() - { - Engine e = new Engine(); - e.GlobalProperties.SetProperty("name", "value"); - Project p = new Project(e); - Assertion.AssertEquals(p.ParentEngine.GlobalProperties.Count, p.GlobalProperties.Count); - Assertion.AssertEquals("value", p.ParentEngine.GlobalProperties["name"].Value); - } - - /// - /// Constructor Test, With Engine Object, unknown ToolsVersion 999999. - /// - [Test] - [ExpectedException(typeof(InvalidOperationException))] - public void ConstructToolsVersion_Unknown() - { - Project p = new Project(new Engine(), "999999"); - } - - /// - /// Constructor Test, with Engine object, known ToolsVersion 999999. - /// - [Test] - public void ConstructToolsVersion_Known() - { - Engine e = new Engine(); - e.Toolsets.Add(new Toolset("999999", @"c:\")); - e.DefaultToolsVersion = "999999"; - Project p = new Project(e, "999999"); - Assertion.AssertNotNull(p); - Assertion.AssertEquals("999999", p.ToolsVersion); - } - - /// - /// Constructor Test, with Engine object, Null ToolsVersion - /// - [Test] - public void ConstructToolsVersion_Null() - { - Project p = new Project(new Engine(), null); - Assertion.AssertNotNull(p.DefaultToolsVersion); - Assertion.AssertEquals(p.ParentEngine.DefaultToolsVersion, p.DefaultToolsVersion); - } - } - - /// - /// Tests for DefaultTools property - /// - [TestFixture] - public sealed class DefaultTools - { - // See Project constructor tests for additional interactions and tests. - - /// - /// DefaultToolsVersion, set and get in OM with known value. - /// - [Test] - public void DefaultToolsVersionSetGet_2_0() - { - Project p = new Project(new Engine()); - p.DefaultToolsVersion = "2.0"; - Assertion.AssertEquals("2.0", p.DefaultToolsVersion); - } - - /// - /// DefaultToolsVersion, assert is dirty after setting ToolsVersion. - /// - [Test] - public void DefaultToolsVersionIsDirtyAfterSet() - { - Project p = new Project(new Engine()); - Assertion.AssertEquals(false, p.IsDirty); - p.DefaultToolsVersion = "2.0"; - Assertion.AssertEquals(true, p.IsDirty); - } - - /// - /// DefaultToolsVersion, set and get in OM. Unknown value - /// - [Test] - public void DefaultToolsVersionSetGet_Unknown() - { - Project p = new Project(new Engine()); - p.DefaultToolsVersion = "999999"; - - // setting an unknown ToolsVersion will cause the DefaultToolsVersion (and ToolsVersion) - // to default to "4.0" - Assertion.AssertEquals("4.0", p.DefaultToolsVersion); - } - - /// - /// DefaultToolsVersion, set in XML, get in OM. Value 4.0 - /// - [Test] - public void DefaultToolsVersionGetWhenSetInXML_4_0() - { - Project p = ObjectModelHelpers.CreateInMemoryProject(TestData.Content3SimpleTargetsDefaultSpecified); - Assertion.AssertEquals("4.0", p.DefaultToolsVersion); - } - } - - /// - /// Tests for HasToolsVersionAttribute property - /// - [TestFixture] - public sealed class HasToolsVersionAttribute - { - /// - /// HasToolsVersionAttribute, load with tools version, check flag true. - /// - [Test] - public void HasToolsVersionAttributeFromDisk_True() - { - Project p = ObjectModelHelpers.CreateInMemoryProject(TestData.ContentSimpleTools35); - Assertion.AssertEquals(true, p.HasToolsVersionAttribute); - } - - /// - /// HasToolsVersionAttribute, set in OM, check flag false. - /// - [Test] - public void HasToolsVersionAttributeCreateInOM_False() - { - Engine e = new Engine(); - e.Toolsets.Add(new Toolset("999999", @"c:\")); - e.DefaultToolsVersion = "999999"; - Project p = new Project(e); - Assertion.AssertEquals("999999", p.ToolsVersion); - Assertion.AssertEquals(false, p.HasToolsVersionAttribute); - } - - /// - /// HasToolsVersionAttribute, create without tools version, check flag false. - /// - [Test] - public void HasToolsVersionAttribute_False() - { - Project p = new Project(new Engine()); - Assertion.AssertEquals(false, p.HasToolsVersionAttribute); - } - } - - /// - /// Tests for the ToolsVersion property - /// - [TestFixture] - public sealed class ToolsVersion - { - /// - /// ToolsVersion, set and get in OM. Value 3.5 - /// - [Test] - public void ToolsVersionGetWhenSetInXml_3_5() - { - if (FrameworkLocationHelper.PathToDotNetFrameworkV35 != null) - { - Project p = ObjectModelHelpers.CreateInMemoryProject(TestData.ContentSimpleTools35); - Assertion.AssertEquals("3.5", p.ToolsVersion); - } - else - { - Assert.Ignore(".NET Framework 3.5 is required for this test, but is not installed."); - } - } - - /// - /// ToolsVersion, set and get in OM. - /// - [Test] - public void ToolsVersionCompareWithDefault() - { - Project p = ObjectModelHelpers.CreateInMemoryProject(TestData.ContentSimpleTools35); - Assertion.AssertEquals(p.DefaultToolsVersion, p.ToolsVersion); - } - - /// - /// ToolsVersion, set and get in OM with known Value. - /// - [Test] - public void ToolsVersionGetWhenSetInXml_Custom_Unknown() - { - Project p = ObjectModelHelpers.CreateInMemoryProject(TestData.ContentSimpleCustomToolsVersion); - - // An unknown ToolsVersion was used, so we just sneakily reset it to 4.0 - Assertion.AssertEquals(p.ToolsVersion, "4.0"); - } - - /// - /// ToolsVersion, get from OM when set in Project object constructor - /// - [Test] - public void ToolsVersionGetWhenSetInProjectConstructor_3_5() - { - if (FrameworkLocationHelper.PathToDotNetFrameworkV35 != null) - { - Project p = new Project(new Engine(), "3.5"); - Assertion.AssertEquals("3.5", p.ToolsVersion); - } - else - { - Assert.Ignore(".NET Framework 3.5 is required for this test, but is not installed."); - } - } - - /// - /// ToolsVersion, get from OM when set in Project object constructor - /// - [Test] - public void ToolsVersionGetWhenSetInProjectConstructor_4_0() - { - Project p = new Project(new Engine(), "4.0"); - Assertion.AssertEquals("4.0", p.ToolsVersion); - } - } - - /// - /// Tests for the TargetCollection accessor - /// - [TestFixture] - public sealed class TargetsCollection - { - // More Tests in the target collection class. - - /// - /// Target Test, Get a list of targets - /// - [Test] - public void TargetCollectionGet() - { - Project p = new Project(new Engine()); - p.Targets.AddNewTarget("TestTarget"); - Assertion.AssertEquals(true, p.IsDirty); - Assertion.AssertEquals("TestTarget", p.Targets["TestTarget"].Name); - } - } - - /// - /// Tests for AddNewUsingTaskFromAssemblyFile, AddNewUsingTaskFromAssemblyName and UsingTaskCollection - /// - [TestFixture] - public sealed class UsingTask - { - /// - /// UsingTasks Tests, - /// - [Test] - public void AddNewUsingTaskFromAssemblyFileUsingTasksCollectionGet() - { - Project p = new Project(new Engine()); - p.AddNewUsingTaskFromAssemblyFile("UsingTaskName", @"c:\assembly.dll"); - object o = p.EvaluatedItems; // force evaluation of imported projects. - Assertion.AssertEquals(true, p.IsDirty); - XmlNodeList nl = CompatibilityTestHelpers.GetNodesWithName(p.Xml, "UsingTask"); - Assertion.AssertEquals(1, nl.Count); - Assertion.AssertEquals("UsingTaskName", nl[0].Attributes["TaskName"].Value); - Assertion.AssertEquals(@"c:\assembly.dll", nl[0].Attributes["AssemblyFile"].Value); - Assertion.AssertEquals(2, nl[0].Attributes.Count); // no condition; - } - - /// - /// AddNewUsingTask Test, adding an invalid assembly is okay - /// - [Test] - public void AddNewUsingTaskFromInvalidAssemblyNotEvaluated() - { - Project p = new Project(new Engine()); - p.AddNewUsingTaskFromAssemblyFile("taskName", @"invalid|.dll"); - Assertion.Assert("no exception", true); - } - - /// - /// AddNewUsingTask Test, adding an invalid assembly is okay, until you evaluate - /// - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void AddNewUsingTaskFromInvalidAssemblyEvaluated() - { - Project p = new Project(new Engine()); - p.AddNewUsingTaskFromAssemblyFile("taskName", @"invalid|.dll"); - object o = p.EvaluatedItems; // force evaluation of imported projects. - } - - /// - /// AddNewUsingTask Test, adding an invalid assembly is okay, until you evaluate - /// - [Test] - public void AddNewUsingTaskFromAssemblyName() - { - Project p = new Project(new Engine()); - p.AddNewUsingTaskFromAssemblyName("UsingTaskName", "UsingAssemblyName"); - object o = p.EvaluatedItems; // force evaluation of imported projects. - XmlNodeList nl = CompatibilityTestHelpers.GetNodesWithName(p.Xml, "UsingTask"); - Assertion.AssertEquals(1, nl.Count); - Assertion.AssertEquals("UsingTaskName", nl[0].Attributes["TaskName"].Value); - Assertion.AssertEquals("UsingAssemblyName", nl[0].Attributes["AssemblyName"].Value); - Assertion.AssertEquals(2, nl[0].Attributes.Count); // no condition; - } - } - - /// - /// Tests for HasUnsavedChanges TimeOfLastChange - /// - [TestFixture] - public sealed class Dirty - { - /// - /// MarkProjectAsDirty() set, HasUnsavedChanges get Test. - /// - [Test] - public void MarkProjectAsDirty_True() - { - Project p = new Project(new Engine()); - Assertion.AssertEquals(false, p.IsDirty); - p.MarkProjectAsDirty(); - Assertion.AssertEquals(true, p.IsDirty); - } - - /// - /// MarkProjectAsDirty() set, HasUnsavedChanges get Test. - /// - [Test] - public void MarkProjectAsDirty_False() - { - Project p = new Project(new Engine()); - p.MarkProjectAsDirty(); - Assertion.AssertEquals(true, p.IsDirty); - string projectPath = String.Empty; - try - { - projectPath = ObjectModelHelpers.CreateTempFileOnDisk(TestData.Content3SimpleTargetsDefaultSpecified); - p.Load(projectPath); - Assertion.AssertEquals(false, p.IsDirty); - } - finally - { - CompatibilityTestHelpers.RemoveFile(projectPath); - } - } - - /// - /// TimeOfLastChange Test, check time is changed when isDirty is called. - /// - [Test] - public void TimeOfLastDirtyMarkAsDirty() - { - Project p = new Project(new Engine()); - DateTime before = DateTime.Now; - Thread.Sleep(100); - p.MarkProjectAsDirty(); - Thread.Sleep(100); - DateTime after = DateTime.Now; - Assertion.AssertEquals(true, p.TimeOfLastDirty > before); - Assertion.AssertEquals(true, p.TimeOfLastDirty < after); - } - - /// - /// TimeOfLastChange Test, Check that dirty time is set at construction. - /// - [Test] - public void TimeOfLastDirtyAtConstruction() - { - DateTime before = DateTime.Now; - Thread.Sleep(100); - Project p = new Project(new Engine()); - Thread.Sleep(100); - DateTime after = DateTime.Now; - Assertion.AssertEquals(true, p.TimeOfLastDirty > before); - Assertion.AssertEquals(true, p.TimeOfLastDirty < after); - } - } - - /// - /// Tests for IsValidated, SchemaFile - /// - [TestFixture] - public sealed class Validation - { - /// - /// IsValidated test, get set:True - /// - [Test] - public void IsValidated_True() - { - Project p = new Project(new Engine()); - p.IsValidated = true; - Assertion.AssertEquals(true, p.IsValidated); - } - - /// - /// IsValidated test, get set:False - /// - [Test] - public void IsValidated_False() - { - Project p = new Project(new Engine()); - p.IsValidated = false; - Assertion.AssertEquals(false, p.IsValidated); - } - - /// - /// IsValidated test, get set:True - /// - [Test] - public void IsValidated_Default() - { - Project p = new Project(new Engine()); - Assertion.AssertEquals(false, p.IsValidated); - } - - /// - /// SchemaFile Test, get default - /// - [Test] - public void SchemaFileGetDefault() - { - Project p = new Project(new Engine()); - Assertion.AssertEquals(null, p.SchemaFile); - } - - /// - /// SchemaFile Test, set to null. - /// - [Test] - public void SchemaFileSet_Null() - { - Project p = new Project(new Engine()); - p.SchemaFile = null; - } - - /// - /// SchemaFile Test, set to url - /// - [Test] - public void SchemaFileSet_Url() - { - Project p = new Project(new Engine()); - p.SchemaFile = CompatibilityTestHelpers.SchemaPathMSBuild; - Assertion.AssertEquals(CompatibilityTestHelpers.SchemaPathMSBuild, p.SchemaFile); - } - - /// - /// SchemaFileIsValidated Test, validate valid project xml against a valid schema - /// - [Test] - public void SchemaFileIsValidatedDefaultSchema() - { - Project p = new Project(new Engine()); - p.IsValidated = true; - p.LoadXml(TestData.Content3SimpleTargetsDefaultSpecified); - } - - /// - /// SchemaFileIsValidated Test, validate valid project xml against valid schema - /// - [Test] - public void SchemaFileIsValidatedSchemaSpecified() - { - Project p = new Project(new Engine()); - p.IsValidated = true; - p.SchemaFile = CompatibilityTestHelpers.SchemaPathMSBuild; - p.LoadXml(TestData.Content3SimpleTargetsDefaultSpecified); - } - - /// - /// SchemaFileIsValidated Test, validate invalid project xml against valid schema - /// - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void SchemaFileIsValidatedSchemaSpecifiedInvalidXml_InMemory() - { - Project p = new Project(new Engine()); - p.IsValidated = true; - p.SchemaFile = CompatibilityTestHelpers.SchemaPathMSBuild; - p.LoadXml(TestData.ContentSimpleInvalidMSBuildXml); - } - - /// - /// SchemaFileIsValidated Test, Validate valid project xml against invalid schema - /// - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void SchemaFileIsValidatedValidXmlInvalidSchema() - { - Project p = new Project(new Engine()); - p.IsValidated = true; - p.SchemaFile = CompatibilityTestHelpers.SchemaPathBuildCore; // not the msbuild schema - p.LoadXml(TestData.ContentSimpleInvalidMSBuildXml); - } - - /// - /// SchemaFileIsValidated Test, setup valid project xml against invalid schema but turn - /// validation off so it never runs. - /// - [Test] - public void SchemaFileValidXmlInvalidSchema_IsValidatedFalse() - { - Project p = new Project(new Engine()); - p.IsValidated = false; - p.SchemaFile = CompatibilityTestHelpers.SchemaPathBuildCore; // not the msbuild schema - p.LoadXml(TestData.Content3SimpleTargetsDefaultSpecified); - } - - /// - /// SchemaFileIsValidated Test, validate invalid project file against valid schema - /// - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void SchemaFileIsValidatedSchemaSpecifiedInvalidXml_FromDisk() - { - string projectPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("file.proj", TestData.ContentSimpleInvalidMSBuildXml); - try - { - Project p = new Project(new Engine()); - p.IsValidated = true; - p.SchemaFile = CompatibilityTestHelpers.SchemaPathMSBuild; - p.Load(projectPath); - } - finally - { - CompatibilityTestHelpers.RemoveFile(projectPath); - } - } - - /// - /// SchemaFileIsValidated Test, validate a valid project file against valid schema - /// - [Test] - public void SchemaFileIsValidatedInteraction() - { - string projectPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("file.proj", TestData.Content3SimpleTargetsDefaultSpecified); - try - { - Project p = new Project(new Engine()); - p.IsValidated = true; - p.SchemaFile = CompatibilityTestHelpers.SchemaPathMSBuild; - p.Load(projectPath); - } - finally - { - CompatibilityTestHelpers.RemoveFile(projectPath); - } - } - } - - /// - /// Tests for Build ResetBuildStatus BuildFlags. - /// - [TestFixture] - public sealed class Build - { - /// - /// Build Test, Build the default target as specified in xml. - /// - [Test] - public void Build_DefaultTarget() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(TestData.Content3SimpleTargetsDefaultSpecified, logger); - p.Build(); - Assertion.AssertEquals(true, logger.FullLog.Contains("Executed Target Default")); - } - - /// - /// Build Test, build the default target (ie the first in the file) when no default is specified in the xml - /// - [Test] - public void Build_FirstTargetInFile() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(TestData.Content3SimpleTargetsNoDefaultSpecified, logger); - p.Build(); - Assertion.AssertEquals(true, logger.FullLog.Contains("Executed Target 1")); - } - - /// - /// Build Test, build a named target, overloading the default specified in the xml - /// - [Test] - public void Build_SpecifiedInOM() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(TestData.Content3SimpleTargetsDefaultSpecified, logger); - p.Build("Target1"); - Assertion.AssertEquals(true, logger.FullLog.Contains("Executed Target 1")); - } - - /// - /// Build Test, build named targets as param list (not implemented), overloading default. Expect Error. - /// - [Test] - public void Build_SpecifiedListAsParam() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(TestData.Content3SimpleTargetsDefaultSpecified, logger); - bool buildSuccessful = p.Build("Target1; Target2"); - Assertion.AssertEquals(false, buildSuccessful); - Assertion.AssertEquals(true, logger.FullLog.Contains("MSB4057")); - } - - /// - /// Build Test, overload the xml default target in the OM, then build - /// - [Test] - public void BuildOverloadDefaultTargetOM() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(TestData.Content3SimpleTargetsDefaultSpecified, logger); - p.DefaultTargets = "Target1; Target2"; - bool buildSuccessful = p.Build(); - Assertion.AssertEquals(true, buildSuccessful); - Assertion.AssertEquals(true, logger.FullLog.Contains("Executed Target 1")); - Assertion.AssertEquals(true, logger.FullLog.Contains("Executed Target 2")); - } - - /// - /// Build Test, build an array of targets where one target is invalid - /// - [Test] - public void BuildListInvalidTargets() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(TestData.Content3SimpleTargetsDefaultSpecified, logger); - bool buildSuccessful = p.Build(new string[] { "Target1", "TargetInvalid" }); - Assertion.AssertEquals(false, buildSuccessful); - Assertion.AssertEquals(true, logger.FullLog.Contains("Executed Target 1")); - Assertion.AssertEquals(true, logger.FullLog.Contains("error MSB4057")); - } - - /// - /// Build Test, build an array of valid targets - /// - [Test] - public void BuildListValidTargets() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(TestData.Content3SimpleTargetsDefaultSpecified, logger); - p.Build(new string[] { "Target1", "Target2" }); - Assertion.AssertEquals(true, logger.FullLog.Contains("Executed Target 1")); - Assertion.AssertEquals(true, logger.FullLog.Contains("Executed Target 2")); - } - - /// - /// Build Test, ensure initial and default targets get executed in the appropriate order - /// - [Test] - public void BuildExecutionprecedence() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(TestData.Content3SimpleTargetsNoDefaultSpecified, logger); - p.InitialTargets = "Target3"; - p.DefaultTargets = "Target1"; - p.Build(); - bool delta = logger.FullLog.IndexOf("Executed Target 3") < logger.FullLog.IndexOf("Executed Target 1"); - Assertion.AssertEquals(true, delta); - } - - /// - /// Build Test, ensure the precedented execution of initial targets in imported projects - /// - [Test] - public void BuildImportExecutionprecedence() - { - // Set up - MockLogger logger = new MockLogger(); - string projImport1 = ObjectModelHelpers.CreateFileInTempProjectDirectory("import1.proj", TestData.ContentImport1); - string projImport2 = ObjectModelHelpers.CreateFileInTempProjectDirectory("import2.proj", TestData.ContentImport2); - try - { - // Test - Project p = ObjectModelHelpers.CreateInMemoryProject(TestData.Content3SimpleTargetsNoDefaultSpecified, logger); - p.Imports.AddNewImport(projImport1, "true"); - p.Imports.AddNewImport(projImport2, "true"); - p.Build("ImportTarget1b"); - bool delta1 = logger.FullLog.IndexOf("Executed ImportTarget 1a") < logger.FullLog.IndexOf("Executed ImportTarget 2a"); - bool delta2 = logger.FullLog.IndexOf("Executed ImportTarget 2a") < logger.FullLog.IndexOf("Executed ImportTarget 1b"); - Assertion.AssertEquals(true, delta1); - Assertion.AssertEquals(true, delta2); - } - finally - { - // Tear down - CompatibilityTestHelpers.RemoveFile(projImport1); - CompatibilityTestHelpers.RemoveFile(projImport2); - } - } - - /// - /// Build Test, ensure that removed imports are not executed when building - /// - [Test] - public void BuildImportRemovedImport() - { - string projImport1 = String.Empty; - string projImport2 = String.Empty; - try - { - MockLogger logger = new MockLogger(); - projImport1 = ObjectModelHelpers.CreateFileInTempProjectDirectory("import1.proj", TestData.ContentImport1); - projImport2 = ObjectModelHelpers.CreateFileInTempProjectDirectory("import2.proj", TestData.ContentImport2); - Project p = ObjectModelHelpers.CreateInMemoryProject(TestData.Content3SimpleTargetsNoDefaultSpecified, logger); - p.Imports.AddNewImport(projImport1, "true"); - p.Imports.AddNewImport(projImport2, "true"); - object o = p.EvaluatedItems; // force evaluation of imported projects. - p.Imports.RemoveImport(CompatibilityTestHelpers.GetImportByProjectPath(p.Imports, projImport2)); - p.Build("ImportTarget1b"); - Assertion.AssertEquals(false, logger.FullLog.Contains("Executed ImportTarget 2a")); - } - finally - { - // Tear down - CompatibilityTestHelpers.RemoveFile(projImport1); - CompatibilityTestHelpers.RemoveFile(projImport2); - } - } - - /// - /// Build Test, a failed build target should not return its outputs. - /// - [Test] - public void BuildOutputInvalidTargets() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(TestData.ContentInvalidTargetsWithOutput, logger); - Hashtable outputs = new Hashtable(); - bool buildSuccessful = p.Build(new string[] { "Target1" }, outputs); - Assertion.AssertEquals(false, buildSuccessful); - Assertion.AssertEquals(0, outputs.Count); - } - - /// - /// Build Test, a successful build should return outputs - /// - [Test] - public void BuildOutputValidTargets() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(TestData.ContentValidTargetsWithOutput, logger); - Hashtable outputs = new Hashtable(); - bool buildSuccessful = p.Build(new string[] { "Target1" }, outputs); - Assertion.AssertEquals(true, buildSuccessful); - Assertion.AssertEquals(1, outputs.Count); - } - - /// - /// BuildTest, Ensure that the build skips cached targets where flag permits. - /// - [Test] - public void BuildIncrementalTargetExecutionFlag_On() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(TestData.Content3SimpleTargetsNoDefaultSpecified, logger); - p.Build("Target2"); - bool buildSuccessful = p.Build(new string[] { "Target1" }, null, BuildSettings.DoNotResetPreviouslyBuiltTargets); - Assertion.AssertEquals(true, buildSuccessful); - string skippedMessage = ResourceUtilities.FormatResourceString("TargetAlreadyCompleteSuccess", "Target2"); - Assertion.AssertEquals(true, logger.FullLog.Contains(skippedMessage)); - } - - /// - /// BuildTest, Ensure that .Build() rebuilds all targets, due to no permit flag. - /// - [Test] - public void BuildIncrementalTargetExecutionFlag_Off() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(TestData.Content3SimpleTargetsNoDefaultSpecified, logger); - p.Build("Target2"); - bool buildSuccessful = p.Build(new string[] { "Target1" }, null, BuildSettings.None); - - Assertion.AssertEquals(true, buildSuccessful); - string skippedMessage = ResourceUtilities.FormatResourceString("TargetAlreadyCompleteSuccess", "Target1"); - string skippedMessage2 = ResourceUtilities.FormatResourceString("TargetAlreadyCompleteSuccess", "Target2"); - string skippedMessage3 = ResourceUtilities.FormatResourceString("TargetAlreadyCompleteFailure", "Target1"); - string skippedMessage4 = ResourceUtilities.FormatResourceString("TargetAlreadyCompleteFailure", "Target2"); - Assertion.AssertEquals(false, logger.FullLog.Contains(skippedMessage)); - Assertion.AssertEquals(false, logger.FullLog.Contains(skippedMessage2)); - Assertion.AssertEquals(false, logger.FullLog.Contains(skippedMessage3)); - Assertion.AssertEquals(false, logger.FullLog.Contains(skippedMessage4)); - } - - /// - /// ResetBuildStatus Test, Ensure that .Build() does not skip cached targets after a reset, where flags permit. - /// - [Test] - public void BuildIncrementalTargetExecutionWithBuildResetFlag_On() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(TestData.Content3SimpleTargetsNoDefaultSpecified, logger); - p.Build("Target2"); - p.ResetBuildStatus(); // this is called in build anyway! - - bool buildSuccessful = p.Build(new string[] { "Target1" }, null, BuildSettings.DoNotResetPreviouslyBuiltTargets); - Assertion.AssertEquals(true, buildSuccessful); - string skippedMessage = ResourceUtilities.FormatResourceString("TargetAlreadyCompleteSuccess", "Target1"); - string skippedMessage2 = ResourceUtilities.FormatResourceString("TargetAlreadyCompleteSuccess", "Target2"); - string skippedMessage3 = ResourceUtilities.FormatResourceString("TargetAlreadyCompleteFailure", "Target1"); - string skippedMessage4 = ResourceUtilities.FormatResourceString("TargetAlreadyCompleteFailure", "Target2"); - Assertion.AssertEquals(false, logger.FullLog.Contains(skippedMessage)); - Assertion.AssertEquals(false, logger.FullLog.Contains(skippedMessage2)); - Assertion.AssertEquals(false, logger.FullLog.Contains(skippedMessage3)); - Assertion.AssertEquals(false, logger.FullLog.Contains(skippedMessage4)); - } - - /// - /// ResetBuildStatus Test, Ensure that .Build() automatically rebuilds all targets after a reset. No flags - /// - [Test] - public void BuildIncrementalTargetExecutionWithBuildResetFlag_Off() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(TestData.Content3SimpleTargetsNoDefaultSpecified, logger); - p.Build("Target2"); - p.ResetBuildStatus(); // this is called in build anyway! - bool buildSuccessful = p.Build(new string[] { "Target1" }, null, BuildSettings.None); - - Assertion.AssertEquals(true, buildSuccessful); - string skippedMessage = ResourceUtilities.FormatResourceString("TargetAlreadyCompleteSuccess", "Target1"); - string skippedMessage2 = ResourceUtilities.FormatResourceString("TargetAlreadyCompleteSuccess", "Target2"); - string skippedMessage3 = ResourceUtilities.FormatResourceString("TargetAlreadyCompleteFailure", "Target1"); - string skippedMessage4 = ResourceUtilities.FormatResourceString("TargetAlreadyCompleteFailure", "Target2"); - Assertion.AssertEquals(false, logger.FullLog.Contains(skippedMessage)); - Assertion.AssertEquals(false, logger.FullLog.Contains(skippedMessage2)); - Assertion.AssertEquals(false, logger.FullLog.Contains(skippedMessage3)); - Assertion.AssertEquals(false, logger.FullLog.Contains(skippedMessage4)); - } - - - /// - /// BuildTest, Check that all virtual items created by a target are removed on ResetBuildStatus(); - /// - [Test] - public void ResetBuildVirtualPropertyRemoval() - { - Project p = new Project(new Engine()); - p.LoadXml(TestData.ContentCreatePropertyTarget); - p.Build("CreatePropertyTarget"); - Assertion.AssertEquals("v", p.GetEvaluatedProperty("p")); - p.ResetBuildStatus(); - Assertion.AssertEquals(null, p.GetEvaluatedProperty("p")); - } - - /// - /// BuildTest, Check that all virtual properties changed by a target are reset on ResetBuildStatus(); - /// - [Test] - public void ResetBuildVirtualPropertyReset() - { - Project p = new Project(new Engine()); - p.LoadXml(TestData.ContentCreatePropertyTarget); - p.SetProperty("p", "v1"); - p.Build("CreatePropertyTarget"); - Assertion.AssertEquals("v", p.GetEvaluatedProperty("p")); - p.ResetBuildStatus(); - Assertion.AssertEquals("v1", p.GetEvaluatedProperty("p")); - } - - /// - /// BuildTest, Check that all virtual items created by a target are removed on ResetBuildStatus(); - /// - [Test] - public void ResetBuildVirtualItemRemoved() - { - Project p = new Project(new Engine()); - p.LoadXml(TestData.ContentCreateItemTarget); - p.Build("CreateItemTarget"); - Assertion.AssertEquals("i", p.EvaluatedItems[0].Include); - int preCount = p.EvaluatedItems.Count; - p.ResetBuildStatus(); - Assertion.AssertEquals(preCount - 1, p.EvaluatedItems.Count); - } - - /// - /// BuildTest, Check that all virtual items changed by a target are reset on ResetBuildStatus(); - /// - [Test] - public void ResetBuildVirtualItemReset() - { - Project p = new Project(new Engine()); - p.LoadXml(TestData.ContentCreateItemTarget); - p.AddNewItem("BuildItem", "i1"); - p.Build("CreateItemTarget"); - Assertion.AssertEquals("i1", p.EvaluatedItems[0].Include); - Assertion.AssertEquals("i", p.EvaluatedItems[1].Include); - int preCount = p.EvaluatedItems.Count; - p.ResetBuildStatus(); - Assertion.AssertEquals("i1", p.EvaluatedItems[0].Include); - Assertion.AssertEquals(preCount - 1, p.EvaluatedItems.Count); - } - } - - /// - /// Tests for BuildEnabled property. - /// - [TestFixture] - public sealed class BuildEnabled - { - /// - /// BuildEnabled Test, does project inherit from global engine, where value is default - /// - [Test] - public void BuildEnabledInheritGlobalEngine_Default() - { - Project p = new Project(); - Assertion.AssertEquals(true, p.BuildEnabled); - } - - /// - /// BuildEnabled Test, does project inherit from global engine, where value is false; - /// - [Test] - public void BuildEnabledInheritGlobalEngine_False() - { - Project p = new Project(); - Engine.GlobalEngine.BuildEnabled = false; - Assertion.AssertEquals(false, p.BuildEnabled); - } - - /// - /// BuildEnabled Test, does project inherit from global engine, where value is true; - /// - [Test] - public void BuildEnabledInheritGlobalEngine_True() - { - Project p = new Project(); - Engine.GlobalEngine.BuildEnabled = true; - Assertion.AssertEquals(true, p.BuildEnabled); - } - - /// - /// BuildEnabled Test, does project inherit from parent Engine, where value is default - /// - [Test] - public void BuildEnabledInheritParentEngine_Default() - { - Engine e = new Engine(); - Project p = new Project(e); - Assertion.AssertEquals(e.BuildEnabled, p.BuildEnabled); - } - - /// - /// BuildEnabled Test, project inheritance from parent Engine, where value is true. - /// - [Test] - public void BuildEnabledInheritParentEngine_True() - { - Engine e = new Engine(); - e.BuildEnabled = true; - Project p = new Project(e); - Assertion.AssertEquals(e.BuildEnabled, p.BuildEnabled); - } - - /// - /// BuildEnabled Test, project inheritance from parent Engine, where value is false. - /// - [Test] - public void BuildEnabledInheritParentEngine_False() - { - Engine e = new Engine(); - e.BuildEnabled = false; - Project p = new Project(e); - Assertion.AssertEquals(e.BuildEnabled, p.BuildEnabled); - } - - /// - /// BuildEnabled Test, getting and setting. - /// - [Test] - public void BuildEnabledSetGet() - { - Project p = new Project(new Engine()); - bool oldState = p.BuildEnabled; - p.BuildEnabled = !oldState; - Assertion.AssertEquals(!oldState, p.BuildEnabled); - } - } - - /// - /// ParentEngine Tests. - /// - [TestFixture] - public sealed class ParentEngine - { - // See Engine Test class for more tests. - - /// - /// IsValidated test, get set:True - /// - [Test] - public void ParentEngine_Get() - { - Engine e = new Engine(); - e.BinPath = @"c:\somepath"; - Project p = new Project(e); - Assertion.AssertEquals(@"c:\somepath", p.ParentEngine.BinPath); - } - } - - /// - /// Tests for the Encoding property - /// - [TestFixture] - public sealed class XmlEncoding - { - // More extensive tests of this property elsewhere in unit testing framework. - - /// - /// Encoding Test, Get, when set to default (UTF8) - /// - [Test] - public void Encoding_Get_Default_UTF8() - { - Project p = new Project(new Engine()); - Assertion.AssertEquals(Encoding.UTF8, p.Encoding); - } - - /// - /// Encoding Test, get when set to an invalid encoding - /// - [Test] - [ExpectedException(typeof(ArgumentException))] - public void Encoding_Get_Custom_Invalid() - { - Project p = new Project(new Engine()); - p.LoadXml(TestData.ContentSimpleInvalidEncoding); - Encoding e = p.Encoding; // This assignment throws the exception. - } - - /// - /// Encoding Test, get when set to invalid encoding - /// - [Test] - public void Encoding_Get_Custom_UTF16() - { - Project p = new Project(new Engine()); - p.LoadXml(TestData.ContentSimpleUTF16); - Assertion.AssertEquals(Encoding.Unicode, p.Encoding); - } - } - - /// - /// Tests for Load, LoadXml, Load TextReader. - /// - [TestFixture] - public sealed class Load - { - /// - /// Load Test, with Project File Name: String.Empty - /// - /// - /// - /// Project.cs - /// Before: ErrorUtilities.VerifyThrowArgument(projectFileName.Length > 0, "EmptyProjectFileName" +buildEventContext.ToString()); - /// After: ErrorUtilities.VerifyThrowArgument(projectFileName.Length > 0, "EmptyProjectFileName"); - /// Threw ArgumentException due to invalid keying into resources. - /// - /// - [Test] - [ExpectedException(typeof(ArgumentException))] - public void LoadProjectFileName_EmptyString() - { - Project p = new Project(new Engine()); - p.Load(String.Empty); - } - - /// - /// Load Test, with Project File Name: Null - /// - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void LoadProjectFileName_Null() - { - Project p = new Project(new Engine()); - p.Load((String)null); - } - - /// - /// Load Test, load a project file twice. Unload Previous project, dump from cache. - /// - /// - /// This is a test for nametable colissions on shared engines. - /// An Debug assertion was removed from Engine to prevent the assert from blocking suites. - /// - [Test] - public void LoadTwoProjectThatShareEngine() - { - string projectPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("project.proj", TestData.Content3SimpleTargetsDefaultSpecified); - try - { - Project p = new Project(); - p.Load(projectPath); - Project p2 = new Project(); - p2.Load(projectPath); - } - finally - { - CompatibilityTestHelpers.RemoveFile(projectPath); - } - } - - /// - /// Load Test, with Project File Name: Null - /// - /// - /// - This should throw ArgumentException, compare with AddNewImport() - /// - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void LoadProjectFile_FileContentEmpty() - { - // Setup - string tempProjectFilePath = null; - try - { - tempProjectFilePath = CompatibilityTestHelpers.CreateTempProjectFile(String.Empty); - - // Execute - Project p = new Project(new Engine()); - p.Load(tempProjectFilePath); - } - finally - { - // Tear down - CompatibilityTestHelpers.RemoveFile(tempProjectFilePath); - } - } - - /// - /// Load Test, with Valid Project File Name, which does not exist. - /// - /// - /// FileNotFound throws to expose ArgumentException in version v9 and earlier - /// versions post v9 should throw and expose FileNotFoundException - /// - [Test] - [ExpectedException(typeof(ArgumentException))] - public void LoadProjectFileName_DoesNotExist() - { - Project p = new Project(new Engine()); - p.Load("doesNotExist.proj"); // doesNotExist.proj does not exist on disk - } - - /// - /// Load Test, With Valid Project File Name. Standard Path - /// - [Test] - public void LoadProjectFileName_FileSystemPath() - { - string tempProjectFilePath = CompatibilityTestHelpers.CreateTempProjectFile(); - Project p = new Project(new Engine()); - p.Load(tempProjectFilePath); - Assertion.AssertEquals(true, p.Targets.Exists("TestTarget")); - CompatibilityTestHelpers.RemoveFile(tempProjectFilePath); - } - - /// - /// Load Test, Check FullFileName is set - /// - /// - /// - /// Regression Test for Bug VSWhidbey 415236 - /// - /// - [Test] - public void LoadProjectFileName_isFullFileNameSet() - { - string tempProjectFilePath = CompatibilityTestHelpers.CreateTempProjectFile(); - Project p = new Project(new Engine()); - p.Load(tempProjectFilePath); - Assertion.AssertEquals(tempProjectFilePath, p.FullFileName); - CompatibilityTestHelpers.RemoveFile(tempProjectFilePath); - } - - /// - /// Load Test, Check FullFileName is set - /// - /// - /// - /// Regression Test for Bug VSWhidbey 415236 - /// - /// - [Test] - public void LoadProjectFileName_DirtyIsFalse() - { - string tempProjectFilePath = CompatibilityTestHelpers.CreateTempProjectFile(); - Project p = new Project(new Engine()); - p.Load(tempProjectFilePath); - Assertion.AssertEquals(false, p.IsDirty); - CompatibilityTestHelpers.RemoveFile(tempProjectFilePath); - } - - /// - /// Load Test, With Valid solution file. - /// - [Test] - [Ignore("not yet implemented")] - public void LoadSolutionFile() - { - // NYI - } - - /// - /// Load Test, file contains invalid/corrupt XML - /// - [ExpectedException(typeof(InvalidProjectFileException))] - public void LoadProjectFile_ContainsInvalidXml() - { - string tempProjectFilePath = CompatibilityTestHelpers.CreateTempProjectFile(TestData.ContentSimpleInvalidXml); - try - { - Project p = new Project(new Engine()); - p.Load(tempProjectFilePath); - } - finally - { - CompatibilityTestHelpers.RemoveFile(tempProjectFilePath); - } - } - - /// - /// Load Test, With Valid Project File Name, which is locked for read access - /// - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void LoadProjectFile_UnauthorizedAccessException() - { - string tempProjectFilePath = CompatibilityTestHelpers.CreateTempProjectFile(TestData.ContentSimpleTools35); - CompatibilityTestHelpers.SetFileAccessPermissions(tempProjectFilePath, FileSystemRights.Read, AccessControlType.Deny); - Project p = new Project(new Engine()); - try - { - p.Load(tempProjectFilePath); - } - finally - { - CompatibilityTestHelpers.RemoveFile(tempProjectFilePath); - } - } - - /// - /// Load Test, InvalidXML Exception - /// - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void LoadProjectFile_XmlException() - { - string tempProjectFilePath = CompatibilityTestHelpers.CreateTempProjectFile(TestData.ContentSimpleInvalidXml); - CompatibilityTestHelpers.SetFileAccessPermissions(tempProjectFilePath, FileSystemRights.Read, AccessControlType.Deny); - Project p = new Project(new Engine()); - - try - { - p.Load(tempProjectFilePath); - } - finally - { - // Tear Down - CompatibilityTestHelpers.RemoveFile(tempProjectFilePath); - } - } - - /// - /// Load Test, Invalid Path - /// - [Test] - [ExpectedException(typeof(ArgumentException))] - public void LoadProjectFile_InvalidPath() - { - new Project().Load(@"|invalidpath\project.proj"); - } - - /// - /// Load Test, SecurityException - /// - [Test] - [Ignore("NYI")] - [ExpectedException(typeof(InvalidProjectFileException))] - public void LoadProjectFile_SecurityException() - { - // NYI - } - - /// - /// Load Test, NotSupportedException - /// - [Test] - [Ignore("NYI")] - [ExpectedException(typeof(InvalidProjectFileException))] - public void LoadProjectFile_NotSupportedException() - { - // NYI - } - - /// - /// Load Test, IOException - /// - [Test] - [Ignore("NYI")] - [ExpectedException(typeof(InvalidProjectFileException))] - public void LoadProjectFile_IOException() - { - // NYI - } - - /// - /// Load Test, With Path length over 256 Characters - /// - /// - /// The file refereced in this test does not exist, as it cannot be created in - /// the file system. - /// - [Test] - [ExpectedException(typeof(ArgumentException))] - public void LoadProjectFileName_OverMaxPath() - { - Project p = new Project(new Engine()); - p.Load(CompatibilityTestHelpers.GenerateLongPath(256) + "doesNotExist.proj"); // doesNotExist.proj does not exist - } - - /// - /// Load Test, Project Load with a file that has missing imports, and IgnoreMissingImports as true. - /// - [Test] - public void LoadProjectFileName_ProjectLoadSettings_IgnoreMissingImports() - { - string tempProjectFilePath = CompatibilityTestHelpers.CreateTempProjectFile(TestData.ContentMissingImports); - Project p = new Project(new Engine()); - p.Load(tempProjectFilePath, ProjectLoadSettings.IgnoreMissingImports); - Assertion.AssertNotNull(p); - CompatibilityTestHelpers.RemoveFile(tempProjectFilePath); - } - - /// - /// Load Test, Project Load with a file that has missing imports - /// - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void LoadProjectFileName_ProjectLoadSettings_CatchMissingImports() - { - string tempProjectFilePath = CompatibilityTestHelpers.CreateTempProjectFile(TestData.ContentMissingImports); - Project p = new Project(new Engine()); - try - { - p.Load(tempProjectFilePath, ProjectLoadSettings.None); - } - finally - { - // Tear Down - CompatibilityTestHelpers.RemoveFile(tempProjectFilePath); - } - } - - /// - /// Load Test, valid xml via a text reader - /// - [Test] - public void LoadTextReader_Valid() - { - Project p = new Project(new Engine()); - p.Load(new StringReader(TestData.ContentSimpleTools35)); - Assertion.AssertNotNull(p); - } - - /// - /// Load Test, valid xml via a text reader - /// - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void LoadProjectTextReader_Invalid() - { - Project p = new Project(new Engine()); - p.Load(new StringReader(TestData.ContentSimpleInvalidXml)); - } - - /// - /// Load Test, valid xml via a text reader, catch missing imports - /// - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void LoadProjectTextReader_CatchMissingImports() - { - Project p = new Project(new Engine()); - p.Load(new StringReader(TestData.ContentMissingImports), ProjectLoadSettings.None); - } - - /// - /// Load Test, null text reader - /// - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void LoadProjectTextReader_NullTextReader() - { - TextReader tr = null; - Project p = new Project(new Engine()); - p.Load(tr, ProjectLoadSettings.None); - } - - /// - /// Load Test, valid xml via a text reader, ignore missing imports - /// - [Test] - public void LoadProjectTextReader_IgnoreMissingImports() - { - Project p = new Project(new Engine()); - p.Load(new StringReader(TestData.ContentMissingImports), ProjectLoadSettings.IgnoreMissingImports); - } - - /// - /// LoadXml Test, from String of xml - /// - [Test] - public void LoadProjectXMLString_Valid() - { - Project p = new Project(); - p.LoadXml(TestData.Content3SimpleTargetsDefaultSpecified); - Assertion.AssertEquals(String.Empty, p.FullFileName); - } - - /// - /// Load Test, from a string of INVALID xml, - /// - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void LoadProjectXMLString_Invalid() - { - Project p = new Project(); - p.LoadXml(TestData.ContentSimpleInvalidXml); - } - - /// - /// Load Test, from a string of xml, catching missing imports - /// - [Test] - public void LoadProjectXMLString_CatchMissingImports() - { - Project p = new Project(); - p.LoadXml(TestData.ContentMissingImports, ProjectLoadSettings.IgnoreMissingImports); - Assertion.AssertNotNull(p); - } - - /// - /// Load Test, from a string of xml - /// - [Test] - public void LoadProjectXMLString_IsDirtyAfterLoad() - { - Project p = new Project(); - p.LoadXml(TestData.ContentMissingImports, ProjectLoadSettings.IgnoreMissingImports); - Assertion.AssertEquals(true, p.IsDirty); - } - - /// - /// Load Test, from a string of invalid xml - /// - [Test] - public void LoadProjectXMLString_IgnoreMissingImports() - { - Project p = new Project(); - p.LoadXml(TestData.ContentMissingImports, ProjectLoadSettings.IgnoreMissingImports); - Assertion.AssertNotNull(p); - } - } - - /// - /// Tests for Save, Save TextReader. - /// - [TestFixture] - public sealed class Save - { - /// - /// Save Test, Path is empty String - /// - [Test] - [ExpectedException(typeof(ArgumentException))] - public void SaveToFileFileName_EmptyString() - { - Project p = new Project(new Engine()); - p.Save(String.Empty); - } - - /// - /// Save Test, Path is null string - /// - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void SaveToFileFileName_Null() - { - Project p = new Project(new Engine()); - string s = null; - p.Save(s); - } - - /// - /// Save Test, simple save, verify on disk. - /// - [Test] - public void SaveToFile() - { - string savePath = String.Empty; - try - { - Project p = new Project(new Engine()); - savePath = ObjectModelHelpers.TempProjectDir + "\\" + "temp.proj"; - p.Save(savePath); - Project savedProject = new Project(); - savedProject.Load(savePath); - ObjectModelHelpers.CompareProjectContents(p, savedProject.Xml); - Assertion.AssertEquals(false, p.IsDirty); - } - finally - { - CompatibilityTestHelpers.RemoveFile(savePath); - } - } - - /// - /// Save Test, FullFileName picks up the new file path after save. - /// - [Test] - public void SaveToFileProjectFullFileNameUpdates() - { - string savePath = String.Empty; - try - { - Project p = new Project(new Engine()); - p.FullFileName = ObjectModelHelpers.TempProjectDir + "\\" + "temp.proj"; - savePath = ObjectModelHelpers.TempProjectDir + "\\" + "temp2.proj"; - p.Save(savePath); - Assertion.AssertEquals(true, File.Exists(p.FullFileName)); - } - finally - { - CompatibilityTestHelpers.RemoveFile(savePath); - } - } - - /// - /// Save Test, a dirty project is clean afer a save. - /// - [Test] - public void SaveToFileNotDirtyAfterSave() - { - string savePath = String.Empty; - try - { - Project p = new Project(new Engine()); - p.Targets.AddNewTarget("newTarget"); - savePath = ObjectModelHelpers.TempProjectDir + "\\" + "temp2.proj"; - p.Save(savePath); - Assertion.AssertEquals(false, p.IsDirty); - } - finally - { - CompatibilityTestHelpers.RemoveFile(savePath); - } - } - - /// - /// Save Test, using an invalid filename. - /// - [Test] - [ExpectedException(typeof(ArgumentException))] - public void SaveInvalidFileName() - { - string savePath = String.Empty; - try - { - Project p = new Project(new Engine()); - savePath = ObjectModelHelpers.TempProjectDir + "\\" + "invalid|.proj"; - p.Save(savePath); - CompatibilityTestHelpers.RemoveFile(savePath); - } - finally - { - CompatibilityTestHelpers.RemoveFile(savePath); - } - } - - /// - /// Save Test, With Path length over 256 Characters - /// - /// - /// The file refereced in this test does not exist, as it cannot be created in - /// the file system. - /// - [Test] - [ExpectedException(typeof(PathTooLongException))] - public void SaveValidFileName_OverMaxPath() - { - Project p = new Project(new Engine()); - p.Save(CompatibilityTestHelpers.GenerateLongPath(256) + "doesNotExist.proj"); // doesNotExist.proj does not exist - } - - /// - /// Save Test, using valid Encoding - /// - [Test] - public void SaveWithEncoding() - { - string savePath = String.Empty; - try - { - Project p = new Project(new Engine()); - p.LoadXml(TestData.ContentSimpleUTF16); - savePath = ObjectModelHelpers.TempProjectDir + "\\" + "temp.proj"; - p.Save(savePath); - p.Load(savePath); - Assertion.AssertEquals(Encoding.Unicode, p.Encoding); - } - finally - { - CompatibilityTestHelpers.RemoveFile(savePath); - } - } - - /// - /// Save Test, overloading the encoding with new valid encoding - /// - [Test] - public void SaveWithOverloadedEncoding() - { - Project p = new Project(new Engine()); - p.LoadXml(TestData.ContentSimpleUTF16); - string savePath = ObjectModelHelpers.TempProjectDir + "\\" + "temp.proj"; - p.Save(savePath, Encoding.UTF8); - p.Load(savePath); - Assertion.AssertEquals(Encoding.UTF8, p.Encoding); - CompatibilityTestHelpers.RemoveFile(savePath); - } - - /// - /// Save Test, using Invalid Encoding - /// - [Test] - [ExpectedException(typeof(ArgumentException))] - public void SaveWithInvalidEncoding() - { - Project p = new Project(new Engine()); - p.LoadXml(TestData.ContentSimpleInvalidEncoding); - string savePath = ObjectModelHelpers.TempProjectDir + "\\" + "temp.proj"; - p.Save(savePath); - CompatibilityTestHelpers.RemoveFile(savePath); - } - - /// - /// Save Test, using valid XmlWriter - /// - [Test] - public void SaveXmlWriter_Valid() - { - Project p = new Project(new Engine()); - p.LoadXml(TestData.ContentSimpleTools35); - StringBuilder stringBuilder = new StringBuilder(); - StringWriter stringReader = new StringWriter(stringBuilder); - p.Save(stringReader); - ObjectModelHelpers.CompareProjectContents(p, stringReader.ToString()); - } - - /// - /// Save Test, using invalid stringWriter - /// - [Test] - [ExpectedException(typeof(NullReferenceException))] - public void SaveXmlWriter_Null() - { - Project p = new Project(new Engine()); - p.LoadXml(TestData.ContentSimpleTools35); - StringWriter stringWriter = null; - p.Save(stringWriter); - } - } - - /// - /// Tests for the xml property. - /// - [TestFixture] - public sealed class Xml - { - /// - /// Xml Test, get Xml after load - /// - [Test] - public void Xml_Get() - { - Project p = new Project(); - p.LoadXml(TestData.ContentSimpleTools35); - ObjectModelHelpers.CompareProjectContents(p, TestData.ContentSimpleTools35); // Asserts in here - } - - /// - /// Xml Test, get Xml after change to OM - /// - [Test] - public void Xml_GetAfterOMChange() - { - Project p = new Project(); - p.LoadXml(TestData.ContentSimpleTools35); - p.Targets.AddNewTarget("newTarget"); - Assertion.AssertEquals(true, p.Xml.Contains("newTarget")); - } - } - - /// - /// Tests for the DefaultTargets Property. - /// - [TestFixture] - public sealed class DefaultTargets - { - /// - /// DefaultTargets Test, Set and Get through OM - /// - [Test] - public void DefaultTargets_SetGetTarget() - { - Project p = ObjectModelHelpers.CreateInMemoryProject(TestData.Content3SimpleTargetsDefaultSpecified); - p.DefaultTargets = "TestTarget1"; - p.Build(); - Assertion.AssertEquals("TestTarget1", p.DefaultTargets); - } - - /// - /// DefaultTargets Test, Get from OM, where set from property on project xml element. - /// - [Test] - public void DefaultTargetsGetWhenSetInXml() - { - Project p = ObjectModelHelpers.CreateInMemoryProject(TestData.Content3SimpleTargetsDefaultSpecified); - Assertion.AssertEquals("TestTargetDefault", p.DefaultTargets); - } - - /// - /// DefaultTargets Test, Get in XMl where set in OM - /// - [Test] - public void DefaultTargetsSetInOMGetInXml() - { - Project p = ObjectModelHelpers.CreateInMemoryProject(TestData.Content3SimpleTargetsNoDefaultSpecified); - p.DefaultTargets = "DefaultTargetName"; - XmlDocument xdoc = new XmlDocument(); - xdoc.LoadXml(p.Xml); - Assertion.AssertEquals("DefaultTargetName", xdoc.DocumentElement.GetAttribute("DefaultTargets")); - } - - /// - /// DefaultTargets Test, Get from OM, where set from property on project xml element. - /// - [Test] - public void DefaultTargetsGetWhenNotExplicitySetInXml() - { - Project p = ObjectModelHelpers.CreateInMemoryProject(TestData.Content3SimpleTargetsNoDefaultSpecified); - Assertion.AssertEquals(String.Empty, p.DefaultTargets); - } - - /// - /// DefaultTargets Test, Set where defaultTargets contains a target that does not exist. - /// - [Test] - public void DefaultTargetsSetMissingTarget() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(TestData.Content3SimpleTargetsDefaultSpecified, logger); - p.DefaultTargets = "missingTarget"; - p.Build(); - Assertion.AssertEquals(true, logger.FullLog.Contains("MSB4057")); // error MSB4057, the target does not exist - } - - /// - /// DefaultTargets Test, where defaultTargets list contain null targets. - /// - [Test] - public void DefaultTargetsSetNullItemsInTargetList() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(TestData.Content3SimpleTargetsDefaultSpecified, logger); - p.DefaultTargets = ";;Target1"; - p.Build(); - Assertion.AssertEquals(true, logger.FullLog.Contains("Executed Target 1")); - } - - /// - /// DefaultTargets Test, where value contains escaped delimters - /// - [Test] - public void DefaultTargetsSpecialCharacterDelimiter() - { - // Setup - MockLogger logger = new MockLogger(); - - // Execute - Project p = ObjectModelHelpers.CreateInMemoryProject(TestData.Content3SimpleTargetsDefaultSpecified, logger); - p.DefaultTargets = "TestTarget%3bTestTarget1"; - p.Build(); - - // Test - Assertion.AssertEquals(true, logger.FullLog.Contains("MSB4057")); // error MSB4057, the target "TestTarget;TestTarget1" does not exist - } - - /// - /// DefaultTargets Test, set to an invalid target name - /// - [Test] - public void DefaultTargetsSpecialCharactersInTargetName() - { - // Execute - Project p = new Project(new Engine()); - p.DefaultTargets = "valid@target;$\\valid;%valid()"; - Assertion.AssertEquals("valid@target; $\\valid; %valid()", p.DefaultTargets); // note whitespace - } - - /// - /// DefaultTargets Test, where value contains empty items and - /// excess whitespace around target names - /// - [Test] - public void DefaultTargetsExcessWhitespace() - { - // Setup - MockLogger logger = new MockLogger(); - - // Execute - Project p = ObjectModelHelpers.CreateInMemoryProject(TestData.Content3SimpleTargetsDefaultSpecified, logger); - p.DefaultTargets = "; ; ; Target1 "; - p.Build(); - - // Test - Assertion.AssertEquals(true, logger.FullLog.Contains("Executed Target 1")); - } - - /// - /// DefaultTargets Test, set to null - /// - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void DefaultTargetsSetNullString() - { - // Execute - Project p = ObjectModelHelpers.CreateInMemoryProject(TestData.ContentSimpleTools35); - p.DefaultTargets = null; - } - - /// - /// DefaultTargets Test, project should be flagged as ditry when default targets are set - /// - [Test] - public void DefaultTargets_IsDirtyWhenSet() - { - // Execute - Project p = ObjectModelHelpers.CreateInMemoryProject(TestData.ContentSimpleTools35); - p.DefaultTargets = "newTarget"; - Assertion.AssertEquals(true, p.IsDirty); - } - } - - /// - /// Tests for the FullfileName Property. - /// - [TestFixture] - public sealed class FullFileName - { - /// - /// FullFileName Test, set then get - /// - [Test] - public void FullFileNameSetGet() - { - Project p = new Project(new Engine()); - p.FullFileName = "newname.proj"; - Assertion.AssertEquals(p.FullFileName, "newname.proj"); - } - - /// - /// FullFileName Test, assert is empty when in memory - /// - [Test] - public void FullFileNameEmptyWhenConstructed() - { - Project p = new Project(new Engine()); - Assertion.AssertEquals(String.Empty, p.FullFileName); - } - - /// - /// FullFileName Test, get when set on load - /// - [Test] - public void FullFileNameGetWhenLoaded() - { - string path = CompatibilityTestHelpers.CreateTempProjectFile(TestData.Content3SimpleTargetsDefaultSpecified); - Project p = new Project(new Engine()); - p.Load(path); - Assertion.AssertEquals(path, p.FullFileName); - } - - /// - /// FullFileName Test, not dirty after set - /// - [Test] - public void FullFileNameSetProjectIsNotDirtyAfter() - { - Project p = new Project(new Engine()); - p.FullFileName = "newname.proj"; - Assertion.AssertEquals(false, p.IsDirty); - } - } - - /// - /// Tests for the Intial Targets Property. - /// - [TestFixture] - public sealed class InitialTargets - { - /// - /// InitialTargets Test, set then get - /// - [Test] - public void InitialTargetsSetGet() - { - Project p = new Project(new Engine()); - p.InitialTargets = "testTarget"; - Assertion.AssertEquals("testTarget", p.InitialTargets); - } - - /// - /// InitialTargets Test, set then get - /// - [Test] - public void InitialTargetsSetGetMultiple() - { - Project p = new Project(new Engine()); - p.InitialTargets = "testTarget; testTarget2"; - Assertion.AssertEquals("testTarget; testTarget2", p.InitialTargets); - } - - /// - /// InitialTargets Test, - /// - [Test] - public void InitialTargetsSetGetMultipleSpecialcharacters() - { - Project p = new Project(new Engine()); - p.InitialTargets = "@testTarget; %3btestTarget2"; - Assertion.AssertEquals("@testTarget; %3btestTarget2", p.InitialTargets); - } - - /// - /// InitialTargets Test, - /// - [Test] - public void InitialTargetsGetWhenSetInXml() - { - Project p = ObjectModelHelpers.CreateInMemoryProject(TestData.ContentSimpleTools35InitialTargets); - Assertion.AssertEquals(true, p.InitialTargets.Contains("InitialTarget")); - } - - /// - /// InitialTargets Test, - /// - [Test] - public void InitialTargetsIsDirtyWhenSet() - { - Project p = new Project(new Engine()); - p.InitialTargets = "testTarget"; - Assertion.AssertEquals(true, p.IsDirty); - } - - /// - /// InitialTargets Test, - /// - [Test] - public void InitialTargetsSetInOMGetInXml() - { - Project p = ObjectModelHelpers.CreateInMemoryProject(TestData.ContentSimpleTools35); - p.InitialTargets = "InitialTarget"; - XmlDocument xdoc = new XmlDocument(); - xdoc.LoadXml(p.Xml); - Assertion.AssertEquals("InitialTarget", xdoc.DocumentElement.GetAttribute("InitialTargets")); - } - } - - /// - /// Tests for SetBuildProperty, GetConditionedPropertyValues, Group manipulation - /// - [TestFixture] - public sealed class Properties - { - /// - /// RemoveAllPropertyGroups Test, check removal of groups defined in xml, imports and the om. - /// - [Test] - public void RemoveAllPropertyGroups() - { - string importedProjFilePath = String.Empty; - try - { - Project p = ObjectModelHelpers.CreateInMemoryProject(TestData.Content3SimpleTargetsDefaultSpecified); - importedProjFilePath = ObjectModelHelpers.CreateTempFileOnDisk(TestData.PropertyGroup); - p.AddNewImport(importedProjFilePath, "true"); - p.AddNewPropertyGroup(true); - p.AddNewPropertyGroup(true); - object o = p.EvaluatedItems; - Assertion.AssertEquals(3, p.PropertyGroups.Count); - p.RemoveAllPropertyGroups(); - Assertion.AssertEquals(1, p.PropertyGroups.Count); // import remains - } - finally - { - CompatibilityTestHelpers.RemoveFile(importedProjFilePath); - } - } - - /// - /// RemoveImportedPropertyGroup Test, remove on wrong project - /// - [Test] - [ExpectedException(typeof(InvalidOperationException))] - public void RemoveImportedPropertyGroupInvalidOp() - { - string importedProjFilename = String.Empty; - string mainProjFilename = String.Empty; - try - { - importedProjFilename = ObjectModelHelpers.CreateTempFileOnDisk(TestData.PropertyGroup); - mainProjFilename = ObjectModelHelpers.CreateTempFileOnDisk(TestData.Content3SimpleTargetsDefaultSpecified); - Project mainProject = new Project(new Engine()); - Project importedProject = new Project(mainProject.ParentEngine); - mainProject.Load(mainProjFilename); - importedProject.Load(importedProjFilename); - BuildPropertyGroup removalGroup = importedProject.AddNewPropertyGroup(true); - mainProject.RemoveImportedPropertyGroup(removalGroup); - } - finally - { - CompatibilityTestHelpers.RemoveFile(importedProjFilename); - CompatibilityTestHelpers.RemoveFile(mainProjFilename); - } - } - - /// - /// RemoveImportedPropertyGroup Test, remove on correct project - /// - [Test] - public void RemoveImportedPropertyGroup() - { - string importedProjFilename = String.Empty; - string mainProjFilename = String.Empty; - try - { - importedProjFilename = ObjectModelHelpers.CreateTempFileOnDisk(TestData.PropertyGroup); - mainProjFilename = ObjectModelHelpers.CreateTempFileOnDisk(TestData.Content3SimpleTargetsDefaultSpecified); - Project mainProject = new Project(new Engine()); - Project importedProject = new Project(mainProject.ParentEngine); - mainProject.SetImportedProperty("property", "value", "true", importedProject); - mainProject.Load(mainProjFilename); - } - finally - { - CompatibilityTestHelpers.RemoveFile(importedProjFilename); - CompatibilityTestHelpers.RemoveFile(mainProjFilename); - } - } - - /// - /// RemovePropertyGroup Test, typical remove - /// - [Test] - public void RemovePropertyGroup() - { - string mainProjFilename = String.Empty; - try - { - mainProjFilename = ObjectModelHelpers.CreateTempFileOnDisk(TestData.PropertyGroup); - Project mainProject = new Project(new Engine()); - BuildPropertyGroup groupToRemove = mainProject.AddNewPropertyGroup(true); - Assertion.AssertEquals(1, mainProject.PropertyGroups.Count); - mainProject.RemovePropertyGroup(groupToRemove); - Assertion.AssertEquals(0, mainProject.PropertyGroups.Count); - } - finally - { - CompatibilityTestHelpers.RemoveFile(mainProjFilename); - } - } - - /// - /// RemovePropertyGroup Test, remove a null group - /// - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void RemovePropertyGroup_null() - { - Project mainProject = new Project(new Engine()); - BuildPropertyGroup groupToRemove = null; - mainProject.RemovePropertyGroup(groupToRemove); - } - - /// - /// GetConditionedPropertyValues Test, where key is null. - /// - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void GetConditionedPropertyValues_Null() - { - Project p = new Project(); - string[] values = p.GetConditionedPropertyValues(null); - } - - /// - /// Test the RemoveAllPropertyGroups method. - /// - /// RGoel - [Test] - public void RemoveAllPropertyGroupsWithChoose() - { - // ************************************ - // BEFORE - // ************************************ - string original = @" - - - - c:\foobar - - - - - - c:\foobar - - - - - c:\foobar - - - - - - "; - - // ************************************ - // AFTER - // ************************************ - string expected = @" - - - - - - - - - - - "; - - Project project = ObjectModelHelpers.CreateInMemoryProject(original); - Assertion.AssertEquals(3, project.PropertyGroups.Count); - - project.RemoveAllPropertyGroups(); - - Assertion.AssertEquals(0, project.PropertyGroups.Count); - ObjectModelHelpers.CompareProjectContents(project, expected); - } - - /// - /// Test the RemoveAllPropertyGroupsByCondition method. - /// - /// RGoel - [Test] - public void RemoveAllPropertyGroupsByConditionWithChoose() - { - // ************************************ - // BEFORE - // ************************************ - string original = @" - - - - c:\foobar - - - - c:\foobar - - - - - - c:\foobar - - - - c:\foobar - - - - - c:\foobar - - - - c:\foobar - - - - - - "; - - // ************************************ - // AFTER - // ************************************ - string expected = @" - - - - c:\foobar - - - - - - c:\foobar - - - - - c:\foobar - - - - - - "; - - Project project = ObjectModelHelpers.CreateInMemoryProject(original); - Assertion.AssertEquals(6, project.PropertyGroups.Count); - - project.RemovePropertyGroupsWithMatchingCondition("'$(x)'=='y'"); - - Assertion.AssertEquals(3, project.PropertyGroups.Count); - ObjectModelHelpers.CompareProjectContents(project, expected); - } - - /// - /// RemovePropertyGroupsWithMatchingCondition, where condition matches imported group - /// and is not removed. - /// - [Test] - public void RemovePropertyGroupsWithMatchingConditionMatchInImported_False() - { - string importedProjFilename = String.Empty; - string mainProjFilename = String.Empty; - try - { - importedProjFilename = ObjectModelHelpers.CreateTempFileOnDisk(TestData.PropertyGroup); - mainProjFilename = ObjectModelHelpers.CreateTempFileOnDisk(TestData.Content3SimpleTargetsDefaultSpecified); - Project mainProject = new Project(new Engine()); - Project importedProject = new Project(mainProject.ParentEngine); - mainProject.Load(mainProjFilename); - importedProject.Load(importedProjFilename); - Assertion.AssertEquals(0, mainProject.PropertyGroups.Count); - mainProject.RemovePropertyGroupsWithMatchingCondition("true"); - Assertion.AssertEquals(0, mainProject.PropertyGroups.Count); - } - finally - { - CompatibilityTestHelpers.RemoveFile(importedProjFilename); - CompatibilityTestHelpers.RemoveFile(mainProjFilename); - } - } - - /// - /// RemovePropertyGroupsWithMatchingCondition, where condition matches imported group - /// and is not removed. - /// - [Test] - public void RemovePropertyGroupsWithMatchingConditionMatchInImported_True() - { - string importedProjFilename = String.Empty; - string mainProjFilename = String.Empty; - try - { - importedProjFilename = ObjectModelHelpers.CreateTempFileOnDisk(TestData.PropertyGroup); - mainProjFilename = ObjectModelHelpers.CreateTempFileOnDisk(TestData.Content3SimpleTargetsDefaultSpecified); - Project mainProject = new Project(new Engine()); - Project importedProject = new Project(mainProject.ParentEngine); - mainProject.Load(mainProjFilename); - importedProject.Load(importedProjFilename); - BuildPropertyGroup referenceGroup = mainProject.AddNewPropertyGroup(true); - referenceGroup.Condition = "true"; - mainProject.SetImportedProperty("newp", "newv", "true", importedProject); - Assertion.AssertEquals(2, mainProject.PropertyGroups.Count); - mainProject.RemovePropertyGroupsWithMatchingCondition("true", true); - Assertion.AssertEquals(0, mainProject.PropertyGroups.Count); - } - finally - { - CompatibilityTestHelpers.RemoveFile(importedProjFilename); - CompatibilityTestHelpers.RemoveFile(mainProjFilename); - } - } - - /// - /// RemovePropertyGroupsWithMatchingCondition, where condition matches a lcoal - /// group and can be removed - /// - [Test] - public void RemovePropertyGroupsWithMatchingCondition_MatchInProject() - { - string mainProjFilename = String.Empty; - try - { - mainProjFilename = ObjectModelHelpers.CreateTempFileOnDisk(TestData.PropertyGroup); - Project mainProject = new Project(new Engine()); - mainProject.Load(mainProjFilename); - Assertion.AssertEquals(1, mainProject.PropertyGroups.Count); - mainProject.RemovePropertyGroupsWithMatchingCondition("true"); - Assertion.AssertEquals(0, mainProject.PropertyGroups.Count); - } - finally - { - CompatibilityTestHelpers.RemoveFile(mainProjFilename); - } - } - - /// - /// GetConditionedPropertyValues Test, where key is empty string - /// - [Test] - public void GetConditionedPropertyValues_EmptyString() - { - Project p = new Project(); - string[] values = p.GetConditionedPropertyValues(String.Empty); - Assertion.AssertEquals(0, values.Length); - } - - /// - /// GetConditionedPropertyValues Test, where key does not exists - /// - [Test] - public void GetConditionedPropertyValues_Missing() - { - Project p = new Project(); - string[] values = p.GetConditionedPropertyValues("doesnotExist"); - Assertion.AssertEquals(0, values.Length); - } - - /// - /// SetProperty Test, add a property that does not exist - /// - [Test] - public void SetPropertyAddingNew() - { - Project p = new Project(); - p.SetProperty("property_name", "v"); - p.SetProperty("property_name2", "v2"); - object o = p.EvaluatedItems; - Assertion.AssertEquals("v", p.GetEvaluatedProperty("property_name")); - Assertion.AssertEquals("v2", p.GetEvaluatedProperty("property_name2")); - Assertion.AssertEquals(true, p.Xml.Contains("property_name")); - Assertion.AssertEquals(true, p.Xml.Contains("property_name2")); - } - - /// - /// SetProperty Test, test that the project is dirty after set - /// - [Test] - public void SetPropertyDirtyAfterSet() - { - Project p = new Project(); - p.SetProperty("property_name", "v"); - Assertion.AssertEquals(true, p.IsDirty); - } - - /// - /// SetProperty Test, test that property is set in a new group before th import element - /// - [Test] - public void SetPropertyBeforeImportDoesNotExists() - { - string importPath = String.Empty; - try - { - Project p = ObjectModelHelpers.CreateInMemoryProject(TestData.Content3SimpleTargetsNoDefaultSpecified); - importPath = ObjectModelHelpers.CreateTempFileOnDisk(TestData.ContentCreatePropertyTarget); - p.AddNewImport(importPath, "true"); - p.SetProperty("n", "vNew", null, PropertyPosition.UseExistingOrCreateAfterLastPropertyGroup); - object o = p.EvaluatedItems; - Assertion.AssertEquals(true, p.Xml.IndexOf("vNew") < p.Xml.IndexOf("Import")); - } - finally - { - CompatibilityTestHelpers.RemoveFile(importPath); - } - } - - /// - /// SetProperty Test, test that the project is dirty after set - /// - [Test] - public void SetPropertyAfterImportDoesNotExists() - { - string importPath = String.Empty; - try - { - Project p = ObjectModelHelpers.CreateInMemoryProject(TestData.Content3SimpleTargetsNoDefaultSpecified); - importPath = ObjectModelHelpers.CreateTempFileOnDisk(TestData.ContentCreatePropertyTarget); - p.AddNewImport(importPath, "true"); - p.SetProperty("n", "vNew", null, PropertyPosition.UseExistingOrCreateAfterLastImport); - object o = p.EvaluatedItems; - Assertion.AssertEquals(true, p.Xml.IndexOf("vNew") > p.Xml.IndexOf("Import")); - } - finally - { - CompatibilityTestHelpers.RemoveFile(importPath); - } - } - - /// - /// SetProperty Test, test existing items before will be used ahead of createing a new one after an import - /// - [Test] - public void SetPropertyAfterImportWherePropertyExistsBefore() - { - string importPath = String.Empty; - try - { - Project p = ObjectModelHelpers.CreateInMemoryProject(TestData.ContentCreatePropertyTarget); - importPath = ObjectModelHelpers.CreateTempFileOnDisk(TestData.ContentImport1); - p.AddNewImport(importPath, "true"); - p.SetProperty("n", "vNew", null, PropertyPosition.UseExistingOrCreateAfterLastImport); - object o = p.EvaluatedItems; - Assertion.AssertEquals(true, p.Xml.IndexOf("vNew") < p.Xml.IndexOf("Import")); - } - finally - { - CompatibilityTestHelpers.RemoveFile(importPath); - } - } - - /// - /// SetProperty Test, set when codition is null - /// - [Test] - public void SetPropertyCondition_Null() - { - Project p = new Project(); - p.SetProperty("n", "v", null); - Assertion.AssertEquals("v", p.GetEvaluatedProperty("n")); - } - - /// - /// SetProperty Test, set when codition is String.Empty - /// - [Test] - public void SetPropertyCondition_Empty() - { - Project p = new Project(); - p.SetProperty("n", "v", String.Empty); - Assertion.AssertEquals("v", p.GetEvaluatedProperty("n")); - } - - /// - /// SetProperty Test, set when codition evaluates to true - /// - [Test] - public void SetPropertyCondition_True() - { - Project p = new Project(); - p.SetProperty("n", "v", "1 == 1"); - Assertion.AssertEquals("v", p.GetEvaluatedProperty("n")); - } - - /// - /// SetProperty Test, set when codition evaluates to false - /// - [Test] - public void SetPropertyCondition_False() - { - Project p = new Project(); - p.SetProperty("n", "v", "false"); - Assertion.AssertNull(p.GetEvaluatedProperty("n")); - } - - /// - /// SetProperty Test, set to a scalar variable - /// - [Test] - public void SetPropertyTreatAsScalar() - { - Project p = new Project(); - ////p.SetProperty("$n", "v", null, null, true); - } - - /// - /// SetProperty Test, set a property that exists - /// - [Test] - public void SetPropertySetExisting() - { - Project p = new Project(); - p.SetProperty("property_name", "v"); - p.SetProperty("property_name", "v2"); - Assertion.AssertEquals("v2", p.GetEvaluatedProperty("property_name")); - Assertion.AssertEquals(true, p.Xml.Contains("property_name")); - Assertion.AssertEquals(true, p.IsDirty); - } - - /// - /// SetProperty Test, null name - /// - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void SetPropertySetName_Null() - { - Project p = new Project(); - string name = null; - p.SetProperty(name, "v"); - } - - /// - /// SetProperty Test, null name - /// - [Test] - [ExpectedException(typeof(ArgumentException))] - public void SetPropertySetName_Empty() - { - Project p = new Project(); - p.SetProperty(String.Empty, "v"); - } - - /// - /// SetProperty Test, null value - /// - [Test] - [ExpectedException(typeof(ArgumentException))] - public void SetPropertySet_ValueNull() - { - Project p = new Project(); - string value = null; - p.SetProperty("n", value); - } - - /// - /// SetProperty Test, empty value - /// - [Test] - public void SetPropertySetValue_Empty() - { - Project p = new Project(); - p.SetProperty("n", String.Empty); - } - - /// - /// SetProperty Test, with literal and escaped characters - /// - [Test] - public void SetPropertySetValue_literals() - { - Project p = new Project(); - p.SetProperty("literalFalse", @"%25%2a%3f%40%24%28%29%3b\", "true", PropertyPosition.UseExistingOrCreateAfterLastImport, false); - p.SetProperty("literalTrue", @"%25%2a%3f%40%24%28%29%3b\", "true", PropertyPosition.UseExistingOrCreateAfterLastImport, true); - p.SetProperty("nonLiteralFalse", @"%*?@$();\", "true", PropertyPosition.UseExistingOrCreateAfterLastImport, false); - p.SetProperty("nonLiteralTrue", @"%*?@$();\", "true", PropertyPosition.UseExistingOrCreateAfterLastImport, true); - Assertion.AssertEquals(@"%*?@$();\", p.GetEvaluatedProperty("literalFalse")); - Assertion.AssertEquals(@"%*?@$();\", p.GetEvaluatedProperty("nonLiteralTrue")); - Assertion.AssertEquals(@"%25%2a%3f%40%24%28%29%3b\", p.GetEvaluatedProperty("literalTrue")); - Assertion.AssertEquals(@"%*?@;\", p.GetEvaluatedProperty("nonLiteralFalse")); - } - - /// - /// AddNewPropertyGroup Test, check flags and addition. - /// - [Test] - public void AddNewPropertyGroup() - { - Project p = new Project(); - BuildPropertyGroup buildPropertyGroup = p.AddNewPropertyGroup(true); - buildPropertyGroup.AddNewProperty("n", "v"); - buildPropertyGroup.Condition = "true"; - Assertion.AssertEquals(true, p.Xml.Contains("")); - Assertion.AssertEquals(1, p.PropertyGroups.Count); - Assertion.AssertEquals(true, p.IsDirty); - } - - /// - /// AddNewProperty, where group is not persisted. - /// - [Test] - [ExpectedException(typeof(InvalidOperationException))] - public void AddNewProperty_InvalidOp() - { - BuildPropertyGroup buildPropertyGroup = new BuildPropertyGroup(); - buildPropertyGroup.AddNewProperty("n", "v"); - } - - /// - /// AddNewPropertyGroup Test, before other groups - /// - /// If "insertAtEnd", is inserted at the very end. Otherwise, - /// we add the new property group just after the last property group in the - /// main project file. If there are currently no property groups in the main - /// project file, we add this one to the very beginning of the project file. - /// - [Test] - public void AddNewPropertyGroupBeforeWithOneOtherPropertyGroup() - { - Project p = new Project(); - BuildPropertyGroup buildPropertyGroup1 = p.AddNewPropertyGroup(true); - buildPropertyGroup1.Condition = "true"; - BuildPropertyGroup buildPropertyGroup2 = p.AddNewPropertyGroup(false); - buildPropertyGroup2.Condition = "false"; - Assertion.AssertEquals(true, p.Xml.IndexOf("") < p.Xml.IndexOf("")); - Assertion.AssertEquals(2, p.PropertyGroups.Count); - } - - /// - /// AddNewPropertyGroup Test, before other groups - /// - /// If "insertAtEnd", is inserted at the very end. Otherwise, - /// we add the new property group just after the last property group in the - /// main project file. If there are currently no property groups in the main - /// project file, we add this one to the very beginning of the project file. - /// - [Test] - public void AddNewPropertyGroupBeforeOneOtherPropertyGroupAndAUsingTask() - { - Project p = new Project(); - BuildPropertyGroup buildPropertyGroup1 = p.AddNewPropertyGroup(true); - buildPropertyGroup1.Condition = "true"; - p.AddNewImport("p", "c"); - BuildPropertyGroup buildPropertyGroup2 = p.AddNewPropertyGroup(false); - buildPropertyGroup2.Condition = "false"; - Assertion.AssertEquals(true, p.Xml.IndexOf("") < p.Xml.IndexOf("")); - Assertion.AssertEquals(true, p.Xml.IndexOf("") < p.Xml.IndexOf("")); - Assertion.AssertEquals(2, p.PropertyGroups.Count); - } - - /// - /// AddNewPropertyGroup Test, add after other groups - /// - [Test] - public void AddNewPropertyGroupAfter() - { - Project p = new Project(); - BuildPropertyGroup buildPropertyGroup1 = p.AddNewPropertyGroup(false); - buildPropertyGroup1.Condition = "true"; - BuildPropertyGroup buildPropertyGroup2 = p.AddNewPropertyGroup(true); - buildPropertyGroup2.Condition = "false"; - Assertion.AssertEquals(true, p.Xml.IndexOf("") < p.Xml.IndexOf("")); - Assertion.AssertEquals(2, p.PropertyGroups.Count); - Assertion.AssertEquals(true, p.IsDirty); - } - - /// - /// AddNewPropertyGroup Test, not after, no existing property groups. - /// Should go at very beginning. - /// - [Test] - public void AddNewPropertyGroupNotAFter() - { - Project p = new Project(); - p.AddNewImport("p", "c"); - BuildPropertyGroup buildPropertyGroup1 = p.AddNewPropertyGroup(false); - - Assertion.AssertEquals(true, p.Xml.IndexOf("") < p.Xml.IndexOf("")); - } - - /// - /// GlobalProperties Test, Get collection - /// - [Test] - public void GlobalPropertiesGet() - { - Project p = new Project(); - p.GlobalProperties.SetProperty("a", "b"); - - Assertion.AssertEquals(1, p.GlobalProperties.Count); - } - - /// - /// GlobalProperties Test, set to null - /// - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void GlobalPropertiesSet_null() - { - Project p = new Project(); - p.GlobalProperties = null; - } - - /// - /// AddNewPropertyGroup Test, ensure that object is cloned into the setter; - /// - [Test] - public void GlobalPropertiesSet() - { - Project p = new Project(); - BuildPropertyGroup newBuildPropertyGroup = new BuildPropertyGroup(); - p.GlobalProperties = newBuildPropertyGroup; - Assertion.AssertEquals(false, newBuildPropertyGroup.Equals(p.GlobalProperties)); - } - - /// - /// PropertyGroups Test, get PropertyGroupsCollection - /// - [Test] - public void PropertyGroupsGet() - { - Project p = new Project(); - p.LoadXml(TestData.PropertyGroup); - p.SetProperty("n", "v"); - p.AddNewPropertyGroup(false); - BuildPropertyGroupCollection buildPropertyGroups = p.PropertyGroups; - Assertion.AssertEquals(3, buildPropertyGroups.Count); - Assertion.AssertEquals(true, buildPropertyGroups.Equals(p.PropertyGroups)); - } - } - - /// - /// Tests for AddNewImport method, RemoveImport method, Imports property, SetImportedProperty - /// - [TestFixture] - public sealed class Import : AddNewImportTests - { - /// - /// Set the indirection for AddNewImport Tests - /// - public Import() - { - InvokeAddNewImportMethod = new AddNewImportDelegate(AddNewImportOverload); - } - - /// - /// Import Test, Get Import - /// - [Test] - public void ImportsGet() - { - string importPath = String.Empty; - try - { - Project p = new Project(new Engine()); - importPath = ObjectModelHelpers.CreateTempFileOnDisk(TestData.ContentSimpleTools35InitialTargets); - p.AddNewImport(importPath, null); - object o = p.EvaluatedItems; // force evaluation of imported projects. - Assertion.AssertEquals(1, p.Imports.Count); - } - finally - { - CompatibilityTestHelpers.RemoveFile(importPath); - } - } - - /// - /// SetImportedProperty Test - /// - [Test] - public void SetImportedProperty() - { - string importPath = String.Empty; - string mainProjectPath = String.Empty; - try - { - importPath = ObjectModelHelpers.CreateTempFileOnDisk(TestData.Content3SimpleTargetsDefaultSpecified); - mainProjectPath = ObjectModelHelpers.CreateTempFileOnDisk(TestData.PropertyGroup); - - Project mainProject = new Project(new Engine()); - Project importedProject = new Project(mainProject.ParentEngine); - mainProject.Load(mainProjectPath); - importedProject.Load(importPath); - mainProject.SetImportedProperty("p", "v", "1 == 1", importedProject); - Assertion.AssertEquals("v", mainProject.GetEvaluatedProperty("p")); - } - finally - { - CompatibilityTestHelpers.RemoveFile(importPath); - CompatibilityTestHelpers.RemoveFile(mainProjectPath); - } - } - - /// - /// SetImportedProperty set imported properties and track the - /// change through the import from the main project - /// - [Test] - public void SetImportedPropertyThatExists() - { - string importedProjFilename = String.Empty; - string mainProjFilename = String.Empty; - try - { - importedProjFilename = ObjectModelHelpers.CreateTempFileOnDisk(TestData.PropertyGroup); - mainProjFilename = ObjectModelHelpers.CreateTempFileOnDisk(TestData.Content3SimpleTargetsDefaultSpecified); - Project mainProject = new Project(new Engine()); - Project importedProject = new Project(mainProject.ParentEngine); - mainProject.Load(mainProjFilename); - importedProject.Load(importedProjFilename); - Assertion.AssertEquals("v1", importedProject.GetEvaluatedProperty("n1")); - Assertion.AssertEquals(null, mainProject.GetEvaluatedProperty("n1")); - mainProject.SetImportedProperty("n1", "newV", "1 == 1", importedProject); - Assertion.AssertEquals("newV", mainProject.GetEvaluatedProperty("n1")); - Assertion.AssertEquals("newV", importedProject.GetEvaluatedProperty("n1")); - } - finally - { - CompatibilityTestHelpers.RemoveFile(importedProjFilename); - CompatibilityTestHelpers.RemoveFile(mainProjFilename); - } - } - - /// - /// SetProperty Test, with literal and escaped characters - /// - [Test] - public void SetPropertySetValueLiteralFlag() - { - string importedProjFilename = String.Empty; - string mainProjFilename = String.Empty; - try - { - importedProjFilename = ObjectModelHelpers.CreateTempFileOnDisk(TestData.PropertyGroup); - mainProjFilename = ObjectModelHelpers.CreateTempFileOnDisk(TestData.Content3SimpleTargetsDefaultSpecified); - Project mainProject = new Project(new Engine()); - Project importedProject = new Project(mainProject.ParentEngine); - mainProject.Load(mainProjFilename); - importedProject.Load(importedProjFilename); - mainProject.SetImportedProperty("n1", "newV", "true", importedProject, PropertyPosition.UseExistingOrCreateAfterLastImport, true); - mainProject.SetImportedProperty("literalFalse", @"%25%2a%3f%40%24%28%29%3b\", "true", importedProject, PropertyPosition.UseExistingOrCreateAfterLastImport, false); - mainProject.SetImportedProperty("literalTrue", @"%25%2a%3f%40%24%28%29%3b\", "true", importedProject, PropertyPosition.UseExistingOrCreateAfterLastImport, true); - mainProject.SetImportedProperty("nonLiteralFalse", @"%*?@$();\", "true", importedProject, PropertyPosition.UseExistingOrCreateAfterLastImport, false); - mainProject.SetImportedProperty("nonLiteralTrue", @"%*?@$();\", "true", importedProject, PropertyPosition.UseExistingOrCreateAfterLastImport, true); - - Assertion.AssertEquals(@"%*?@$();\", mainProject.GetEvaluatedProperty("literalFalse")); - Assertion.AssertEquals(@"%*?@$();\", mainProject.GetEvaluatedProperty("nonLiteralTrue")); - Assertion.AssertEquals(@"%25%2a%3f%40%24%28%29%3b\", mainProject.GetEvaluatedProperty("literalTrue")); - Assertion.AssertEquals(@"%*?@;\", mainProject.GetEvaluatedProperty("nonLiteralFalse")); - } - finally - { - CompatibilityTestHelpers.RemoveFile(importedProjFilename); - CompatibilityTestHelpers.RemoveFile(mainProjFilename); - } - } - - /// - /// SetImportedProperty Test, null property name - /// - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void SetImportedPropertyName_Null() - { - string importedProjFilename = String.Empty; - string mainProjFilename = String.Empty; - try - { - importedProjFilename = ObjectModelHelpers.CreateTempFileOnDisk(TestData.PropertyGroup); - mainProjFilename = ObjectModelHelpers.CreateTempFileOnDisk(TestData.Content3SimpleTargetsDefaultSpecified); - Project mainProject = new Project(new Engine()); - Project importedProject = new Project(mainProject.ParentEngine); - mainProject.Load(mainProjFilename); - importedProject.Load(importedProjFilename); - mainProject.SetImportedProperty(null, "newV", "1 == 1", importedProject); - } - finally - { - CompatibilityTestHelpers.RemoveFile(importedProjFilename); - CompatibilityTestHelpers.RemoveFile(mainProjFilename); - } - } - - /// - /// SetImportedProperty Test, null property value - /// - [Test] - [ExpectedException(typeof(ArgumentException))] - public void SetImportedPropertyValue_Null() - { - string importedProjFilename = String.Empty; - string mainProjFilename = String.Empty; - try - { - importedProjFilename = ObjectModelHelpers.CreateTempFileOnDisk(TestData.PropertyGroup); - mainProjFilename = ObjectModelHelpers.CreateTempFileOnDisk(TestData.Content3SimpleTargetsDefaultSpecified); - Project mainProject = new Project(new Engine()); - Project importedProject = new Project(mainProject.ParentEngine); - mainProject.Load(mainProjFilename); - importedProject.Load(importedProjFilename); - mainProject.SetImportedProperty("n1", null, "1 == 1", importedProject); - } - finally - { - CompatibilityTestHelpers.RemoveFile(importedProjFilename); - CompatibilityTestHelpers.RemoveFile(mainProjFilename); - } - } - - /// - /// SetImportedProperty Test, null condition - /// - [Test] - public void SetImportedPropertyCondition_Null() - { - string importedProjFilename = String.Empty; - string mainProjFilename = String.Empty; - try - { - importedProjFilename = ObjectModelHelpers.CreateTempFileOnDisk(TestData.PropertyGroup); - mainProjFilename = ObjectModelHelpers.CreateTempFileOnDisk(TestData.Content3SimpleTargetsDefaultSpecified); - Project mainProject = new Project(new Engine()); - Project importedProject = new Project(mainProject.ParentEngine); - mainProject.Load(mainProjFilename); - importedProject.Load(importedProjFilename); - mainProject.SetImportedProperty("n1", "newV", null, importedProject); - Assertion.AssertEquals("newV", importedProject.GetEvaluatedProperty("n1")); - } - finally - { - CompatibilityTestHelpers.RemoveFile(importedProjFilename); - CompatibilityTestHelpers.RemoveFile(mainProjFilename); - } - } - - /// - /// Indirection for common tests to p.AddNewImport - /// - private void AddNewImportOverload(Project p, string path, string condition) - { - p.AddNewImport(path, condition); - } - } - - /// - /// Tests for ProjectExtensions - /// - [TestFixture] - public sealed class ProjectExtensions - { - /// - /// GetProjectExtensions Test, where item id exists - /// - [Test] - public void PGetProjectExtensionsExistingItem() - { - Project p = ObjectModelHelpers.CreateInMemoryProject(TestData.ContentExtensions); - Assertion.AssertEquals("v1", p.GetProjectExtensions("id1")); - } - - /// - /// GetProjectExtensions where Extentions element is missing - /// - [Test] - public void PGetProjectExtensionsWhenNoProjectExtensionsElement() - { - Project p = ObjectModelHelpers.CreateInMemoryProject(TestData.Content3SimpleTargetsDefaultSpecified); - Assertion.AssertEquals(String.Empty, p.GetProjectExtensions("id1")); - } - - /// - /// GetProjectExtensions Test, where item id does not exist - /// - [Test] - public void GetProjectExtensionsWhereElementofIdMissing() - { - Project p = ObjectModelHelpers.CreateInMemoryProject(TestData.Content3SimpleTargetsDefaultSpecified); - Assertion.AssertEquals(String.Empty, p.GetProjectExtensions("idMissing")); - } - - /// - /// GetProjectExtensions Test, check that namespace attributes are removed from nodes under an Id. - /// - [Test] - public void GetProjectExtensionsNodePurgeNamespace() - { - Project p = ObjectModelHelpers.CreateInMemoryProject(TestData.ContentExtensions); - Assertion.AssertEquals(false, p.GetProjectExtensions("id3").Contains(CompatibilityTestHelpers.SchemaUrlMSBuild.ToString())); - } - - /// - /// SetProjectExtensions Test, where item id exists - /// - [Test] - public void SetProjectExtensionsExistingItem_Valid() - { - Project p = ObjectModelHelpers.CreateInMemoryProject(TestData.ContentExtensions); - p.SetProjectExtensions("id1", "vNew"); - Assertion.AssertEquals("vNew", p.GetProjectExtensions("id1")); - } - - /// - /// SetProjectExtensions Test, where ProjectExtensions node does not exist - /// - [Test] - public void SetProjectExtensionsProjectExtensionMissing() - { - Project p = new Project(); - p.SetProjectExtensions("id1", "vNew"); - Assertion.AssertEquals("vNew", p.GetProjectExtensions("id1")); - Assertion.AssertEquals(true, p.Xml.Contains("ProjectExtensions")); - } - - /// - /// SetProjectExtensions Test, where item id does not exist - /// - [Test] - [ExpectedException(typeof(NullReferenceException))] // Ew - public void SetProjectExtensionsNewItem_Null() - { - Project p = ObjectModelHelpers.CreateInMemoryProject(TestData.ContentExtensions); - string nodeId = null; - p.SetProjectExtensions(nodeId, "vNew"); - } - } - - /// - /// Tests for EvaluatedItems EvaluatedItemsIgnoringCondition - /// - [TestFixture] - public sealed class EvaluatedItems - { - /// - /// EvaluatedItems, add an item, check addition to OM and xml - /// - [Test] - public void EvaluatedItemsAdding() - { - Project p = new Project(); - p.AddNewItem("namedItem", "v"); - Assertion.AssertEquals(1, p.EvaluatedItems.Count); - Assertion.AssertEquals("namedItem", p.EvaluatedItems[0].Name); - Assertion.AssertEquals(true, p.Xml.Contains("namedItem")); - } - - /// - /// EvaluatedItems Test, add two items with same name - /// - [Test] - public void EvaluatedItemsAddingTwice() - { - Project p = new Project(); - p.AddNewItem("n", "v"); - p.AddNewItem("n", "v2"); - Assertion.AssertEquals(2, p.EvaluatedItems.Count); - Assertion.AssertEquals("v", p.EvaluatedItems[0].Include); - Assertion.AssertEquals("v2", p.EvaluatedItems[1].Include); - } - - /// - /// EvaluatedItems, should return a cloned type, not a reference - /// - [Test] - public void EvaluatedItemsClonedReturns() - { - Project p = new Project(); - p.AddNewItem("n", "v"); - BuildItemGroup group1 = p.EvaluatedItems; - Assertion.AssertEquals(true, p.IsDirty); - BuildItemGroup group2 = p.EvaluatedItems; - Assertion.AssertEquals(false, Object.ReferenceEquals(group1, group2)); - } - - /// - /// EvaluatedItems, Compare evaluated items when filtered on condition - /// - [Test] - public void EvaluatedItemsIgnoreCondition() - { - Project p = ObjectModelHelpers.CreateInMemoryProject(TestData.ItemGroup); - Assertion.AssertEquals(3, p.EvaluatedItemsIgnoringCondition.Count); - Assertion.AssertEquals(2, p.EvaluatedItems.Count); - } - } - - /// - /// Tests for BuildItem Collection Groups and their manipulation - /// - [TestFixture] - public sealed class BuildItems - { - /// - /// AddNewItem Test, pass in a a null item name - /// - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void AddNewItemName_Null() - { - Project p = new Project(); - p.AddNewItem(null, "include"); - } - - /// - /// AddNewItem Test, pass in an empty item name - /// - [Test] - [ExpectedException(typeof(ArgumentException))] - public void AddNewItemName_Empty() - { - Project p = new Project(); - p.AddNewItem(String.Empty, "include"); - } - - /// - /// AddNewItem Test, pass in an empty include value - /// - [Test] - [ExpectedException(typeof(ArgumentException))] - public void AddNewItemInclude_Empty() - { - Project p = new Project(); - p.AddNewItem("include", String.Empty); - } - - /// - /// AddNewItem Test, pass in a a null item name - /// - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void AddNewItemInclude_Null() - { - Project p = new Project(); - p.AddNewItem("item", null); - } - - /// - /// AddNewItem Test, gets added to local project rather than imported - /// - [Test] - public void AddNewItemPrecidence_Local() - { - Project mainProject = ObjectModelHelpers.CreateInMemoryProject(TestData.ItemGroup3); - Project importedProject = new Project(mainProject.ParentEngine); - importedProject.LoadXml(TestData.ItemGroup); - mainProject.AddNewItem("newItem", "i"); - Assertion.AssertEquals(true, mainProject.Xml.IndexOf("newItem") > 0); - } - - /// - /// AddNewItem Test, gets added to last group with no condition that has items of the same type - /// - [Test] - public void AddNewItemIncludePrecidece_NoCondition() - { - Project mainProject = ObjectModelHelpers.CreateInMemoryProject(TestData.ItemGroup3); - XmlDocument xmldoc = new XmlDocument(); - xmldoc.LoadXml(mainProject.Xml); - mainProject.AddNewItem("i", "x"); - - Assertion.AssertEquals(true, CompatibilityTestHelpers.GetNodesWithName(mainProject.Xml, "ItemGroup")[2].InnerXml.Contains("Include=\"x\"")); - } - - /// - /// AddNewItem Test, ensure item is added to first Item group with items of same type - /// - [Test] - public void AddNewItemIncludePrecidece_SameTypes() - { - Project p = ObjectModelHelpers.CreateInMemoryProject(TestData.ItemGroup2); - p.AddNewItem("i2", "d"); - XmlDocument xmldoc = new XmlDocument(); - xmldoc.LoadXml(p.Xml); - Assertion.AssertEquals(true, CompatibilityTestHelpers.GetNodesWithName(p.Xml, "ItemGroup")[1].InnerXml.Contains("Include=\"d\"")); - } - - /// - /// AddNewItem Test, doesn't match anything that exists so create a new group - /// - [Test] - public void AddNewItemIncludePrecidece_NewGroup() - { - Project p = ObjectModelHelpers.CreateInMemoryProject(TestData.ItemGroup2); - XmlDocument xmldoc = new XmlDocument(); - xmldoc.LoadXml(p.Xml); - Assertion.AssertEquals(3, p.ItemGroups.Count); - p.AddNewItem("unique", "d"); - Assertion.AssertEquals(4, p.ItemGroups.Count); - } - - /// - /// AddNewItem Test, doesn't match anything that exists so create a new group - /// - [Test] - public void AddNewItemEscaping() - { - Project p = new Project(); - string escaped = @"%25%2a%3f%40%24%28%29%3b\"; - string unescaped = @"%*?@$();\"; - BuildItem buildItem1 = p.AddNewItem("escapedTrue", escaped, true); - BuildItem buildItem2 = p.AddNewItem("escapedFalse", escaped, false); - BuildItem buildItem3 = p.AddNewItem("unescapedTrue", unescaped, true); - BuildItem buildItem4 = p.AddNewItem("unescapedFalse", unescaped, false); - - Assertion.AssertEquals(escaped, buildItem1.FinalItemSpec); - Assertion.AssertEquals(unescaped, buildItem2.FinalItemSpec); - Assertion.AssertEquals(unescaped, buildItem3.FinalItemSpec); - Assertion.AssertEquals(@"\", buildItem4.FinalItemSpec); - } - - /// - /// Tests BuildItemGroup.RemoveItem from an Evaluated and Expanded Group. Wildcard With a preceeding call to EvaluatedItems - /// - /// Regression for bug:170974 - /// - /// This method asserts broken behaviour - /// Should remove the evaluated item foo.foo. As *.foo has been expanded, the persisted item should be foo1.foo. - /// - [Test] - public void RemoveEvaluatedItemAfterExpansionFails() - { - try - { - CompatibilityTestHelpers.CreateFiles(2, "foo", "foo", ObjectModelHelpers.TempProjectDir); - Project p = new Project(); - object o = p.EvaluatedItems; // this causes failure - p.AddNewItem("foos", Path.Combine(ObjectModelHelpers.TempProjectDir, "*.foo")); - p.RemoveItem(p.EvaluatedItems[0]); // Exception thrown here - Assertion.Fail("success as failure"); // should not get here due to exception above - } - catch (Exception e) - { - // ExpectedException cannot be asserted as InternalErrorExceptions are internally scoped. - Assertion.AssertEquals(true, e.GetType().ToString().Contains("InternalErrorException")); - } - finally - { - CompatibilityTestHelpers.CleanupDirectory(ObjectModelHelpers.TempProjectDir); - } - } - - /// - /// Tests BuildItemGroup.RemoveItem from a Evaluated and Expanded Group. Delimited List. With a preceeding call to EvaluatedItems - /// - /// Regression for bug:170974 - /// - /// This method asserts broken behaviour - /// Should remove the evaluated item foo.foo. As *.foo has been expanded, the persisted item should be foo.foo, - /// and so this should be removed from the xml too. A persisted build item should remain for bar.bar with no evaluated children - /// - [Test] - public void RemoveEvaluatedItemDelimtedFails() - { - try - { - CompatibilityTestHelpers.CreateFiles(1, "foo", "foo", ObjectModelHelpers.TempProjectDir); - Project p = new Project(); - object o = p.EvaluatedItems; // this causes the failure - p.AddNewItem("foos", Path.Combine(ObjectModelHelpers.TempProjectDir, "foo.foo;bar.bar")); - p.RemoveItem(p.EvaluatedItems[0]); // Exception thrown here - Assertion.Fail("success as failure"); // should not get here due to exception above - } - catch (Exception e) - { - if (!(e.GetType().ToString().Contains("InternalErrorException"))) - { - Assertion.Fail(e.Message + " was thrown"); - } - else - { - Assertion.Assert("InternalErrorException was thrown", true); - } - } - finally - { - CompatibilityTestHelpers.CleanupDirectory(ObjectModelHelpers.TempProjectDir); - } - } - - /// - /// Tests BuildItemGroup.RemoveItem from a Evaluated and Expanded Group. Delimited List. *Without* a preceeding call to EvaluatedItems - /// - /// Regression for bug:170974 - [Test] - public void RemoveEvaluatedItemDelimitedSuccess() - { - try - { - CompatibilityTestHelpers.CreateFiles(1, "foo", "foo", ObjectModelHelpers.TempProjectDir); - Project p = new Project(); - p.AddNewItem("foos", Path.Combine(ObjectModelHelpers.TempProjectDir, "foo.foo,bar.bar")); - p.RemoveItem(p.EvaluatedItems[0]); - Assertion.AssertEquals(0, p.EvaluatedItems.Count); - } - finally - { - CompatibilityTestHelpers.CleanupDirectory(ObjectModelHelpers.TempProjectDir); - } - } - - /// - /// Tests BuildItemGroup.RemoveItem from an Evaluated and Expanded Group. *Without* a preceeding call to EvaluatedItems - /// - /// Regression for bug:170974 - [Test] - public void RemoveEvaluatedItemAfterExpansionSuccess() - { - try - { - int numberOfFoos = 5; - CompatibilityTestHelpers.CreateFiles(numberOfFoos, "foo", "foo", ObjectModelHelpers.TempProjectDir); - CompatibilityTestHelpers.CreateFiles(1, "bar", "bar", ObjectModelHelpers.TempProjectDir); - Project p = new Project(); - p.AddNewItem("foos", Path.Combine(ObjectModelHelpers.TempProjectDir, "*.foo")); - p.RemoveItem(p.EvaluatedItems[0]); - Assertion.AssertEquals(true, p.EvaluatedItems[0].Include.Contains("foo1.foo")); - Assertion.AssertEquals(numberOfFoos - 1, p.EvaluatedItems.Count); - } - finally - { - CompatibilityTestHelpers.CleanupDirectory(ObjectModelHelpers.TempProjectDir); - } - } - - /// - /// AddNewItem Test, doesn't match anything that exists so create a new group - /// - [Test] - public void RemoveItem() - { - Project p = new Project(); - BuildItem buildItem1 = p.AddNewItem("n", "i", true); - Assertion.AssertNotNull(CompatibilityTestHelpers.FindBuildItem(p, "n")); - p.RemoveItem(buildItem1); - Assertion.AssertNull(CompatibilityTestHelpers.FindBuildItem(p, "n")); - } - - /// - /// RemoveItem Test, remove null - /// - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void RemoveItem_null() - { - Project p = new Project(); - p.AddNewItem("n", "i", true); - BuildItem buildItem1 = null; - p.RemoveItem(buildItem1); - } - - /// - /// RemoveItem Test, remove non related project - /// - [Test] - [ExpectedException(typeof(InvalidOperationException))] - public void RemoveItem_IsNotRelatedToProject() - { - Project p = new Project(); - BuildItem buildItem = new BuildItem("n", "i"); - p.RemoveItem(buildItem); - } - - /// - /// RemoveItem Test, remove imported project - /// - [Test] - [ExpectedException(typeof(InvalidOperationException))] - public void RemoveItem_IsNotImported() - { - Project p = new Project(); - Project i = new Project(p.ParentEngine); - BuildItem buildItem = i.AddNewItem("n", "i"); - p.RemoveItem(buildItem); - } - - /// - /// RemoveItem Test, dirty after removal - /// - [Test] - public void RemoveItemDirtyAfterRemove() - { - string projectPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("save.proj", String.Empty); - try - { - Project p = new Project(); - BuildItem buildItem = p.AddNewItem("n", "i"); - p.Save(projectPath); - Assertion.AssertEquals(false, p.IsDirty); - p.RemoveItem(buildItem); - Assertion.AssertEquals(true, p.IsDirty); - } - finally - { - CompatibilityTestHelpers.RemoveFile(projectPath); - } - } - - /// - /// RemoveItem Test, check that itemgroup is removed if removed item - /// was the last in the group. - /// - [Test] - public void RemoveItemLastInGroup() - { - Project p = new Project(); - BuildItem buildItem = p.AddNewItem("n", "i"); - Assertion.AssertEquals(1, p.ItemGroups.Count); - p.RemoveItem(buildItem); - Assertion.AssertEquals(0, p.ItemGroups.Count); - } - - /// - /// RemoveItemsByName Test, no exception on removing null items - /// - [Test] - public void RemoveItemsByName_Null() - { - Project p = ObjectModelHelpers.CreateInMemoryProject(TestData.ItemGroup2); - string nullstring = null; - p.RemoveItemsByName(nullstring); - } - - /// - /// RemoveItemsByName Test, remove a named item when items are concete and virtual. - /// - [Test] - public void RemoveItemsByNameXmlAndVirtual() - { - Project p = ObjectModelHelpers.CreateInMemoryProject(TestData.ItemGroup2); - p.AddNewItem("j", "virtual"); - p.RemoveItemsByName("j"); - } - - /// - /// ItemGroups Test, Assert colection contains virutal an concrete items - /// - [Test] - public void ItemGroupsGet() - { - Project p = ObjectModelHelpers.CreateInMemoryProject(TestData.ItemGroup2); - p.AddNewItem("item", "include"); - Assertion.AssertEquals(4, p.ItemGroups.Count); - } - - /// - /// GetEvaluatedItemsByName Test, returns an empty group if name is null. - /// - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void GetEvaluatedItemsByName_Null() - { - Project p = new Project(); - string name = null; - BuildItemGroup emptyGroup = p.GetEvaluatedItemsByName(name); - } - - /// - /// GetEvaluatedItemsByName Test, look for an item name that does not exist - /// - [Test] - public void GetEvaluatedItemsByNameDoesNotExistItem() - { - Project p = new Project(); - string name = "notFound"; - BuildItemGroup emptyGroup = p.GetEvaluatedItemsByName(name); - Assertion.AssertEquals(0, emptyGroup.Count); - } - - /// - /// GetEvaluatedItemsByName Test, Only return items that match condition - /// - [Test] - public void GetEvaluatedItemsByNameTwoItems() - { - Project p = new Project(); - string name = "new"; - p.SetProperty("condition", "false"); - BuildItem buildItem = p.AddNewItem(name, "i1"); - buildItem.Condition = "$(condition)"; - p.AddNewItem(name, "i2"); - BuildItemGroup foundGroup = p.GetEvaluatedItemsByName(name); - Assertion.AssertEquals(1, foundGroup.Count); - } - - /// - /// GetEvaluatedItemsByName Test, return all items regardless of condition. - /// - [Test] - public void GetEvaluatedItemsByNameIgnoringCondition() - { - Project p = new Project(); - string name = "new"; - BuildItem buildItem = p.AddNewItem(name, "i1"); - p.AddNewItem(name, "i2"); - p.SetProperty("condition", "false"); - buildItem.Condition = "$(condition)"; - BuildItemGroup foundGroup = p.GetEvaluatedItemsByNameIgnoringCondition(name); - Assertion.AssertEquals(2, foundGroup.Count); - } - - /// - /// RemoveAllItemGroups Test, Remove all Item groups - /// - [Test] - public void RemoveAllItemGroups() - { - Project p = new Project(); - p.AddNewItem("item", "i"); - Assertion.AssertEquals(1, p.ItemGroups.Count); - p.RemoveAllItemGroups(); - Assertion.AssertEquals(0, p.ItemGroups.Count); - } - - /// - /// RemoveAllItemGroups Test, project - /// - [Test] - public void RemoveAllItemGroupsDirtyAfterRemove() - { - Project p = new Project(); - p.AddNewItem("item", "i"); - Assertion.AssertEquals(1, p.ItemGroups.Count); - p.RemoveAllItemGroups(); - Assertion.AssertEquals(0, p.ItemGroups.Count); - } - - /// - /// RemoveItemGroup Test, ensure removeal does not remove an imported project - /// - [Test] - [ExpectedException(typeof(InvalidOperationException))] - public void RemoveItemGroup_Imported() - { - Project p = new Project(); - Project i = new Project(p.ParentEngine); - BuildItemGroup buildItemGroup = i.AddNewItemGroup(); - p.RemoveItemGroup(buildItemGroup); - } - - /// - /// RemoveItemGroup Test, Remove a null - /// - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void RemoveItemGroup_NullGroup() - { - Project p = new Project(); - BuildItemGroup buildItemGroup = null; - p.RemoveItemGroup(buildItemGroup); - } - - /// - /// RemoveItemGroupsWithMatchingCondition Test, - /// - [Test] - public void RemoveItemGroupsWithMatchingCondition() - { - Project p = new Project(); - BuildItemGroup buildItemGroup = p.AddNewItemGroup(); - buildItemGroup.Condition = "true"; - p.AddNewItemGroup(); - Assertion.AssertEquals(2, p.ItemGroups.Count); - p.RemoveItemGroupsWithMatchingCondition("true"); - Assertion.AssertEquals(1, p.ItemGroups.Count); - } - - /// - /// RemoveItemGroup Test, Remove a group that isn't in the projkect - /// - [Test] - [ExpectedException(typeof(InvalidOperationException))] - public void RemoveItemGroup_NotInProject() - { - Project p = new Project(); - BuildItemGroup buildItemGroup1 = new BuildItemGroup(); - p.RemoveItemGroup(buildItemGroup1); - } - - /// - /// AddNewItemGroup Test, Check addition of item groups in order - /// - [Test] - public void AddNewItemGroup() - { - Project p = ObjectModelHelpers.CreateInMemoryProject(TestData.ItemGroup2); - Assertion.AssertEquals(3, p.ItemGroups.Count); - BuildItemGroup buildItemGroup1 = p.AddNewItemGroup(); - buildItemGroup1.Condition = "identify1"; - BuildItemGroup buildItemGroup2 = p.AddNewItemGroup(); - buildItemGroup2.Condition = "identify2"; - Assertion.AssertEquals(5, p.ItemGroups.Count); - Assertion.AssertEquals(true, p.Xml.IndexOf("identify1") < p.Xml.IndexOf("identify2")); - } - - /// - /// AddNewItemGroup Test, Check Addition of group after import elements - /// - [Test] - public void AddNewItemGroupAfterImports() - { - Project p = ObjectModelHelpers.CreateInMemoryProject(TestData.ItemGroup2); - Project imported = new Project(p.ParentEngine); - imported.LoadXml(TestData.ContentCreateItemTarget); - Assertion.AssertEquals(3, p.ItemGroups.Count); - BuildItemGroup buildItemGroup2 = p.AddNewItemGroup(); - buildItemGroup2.Condition = "identify2"; - Assertion.AssertEquals(4, p.ItemGroups.Count); - Assertion.AssertEquals(true, p.Xml.IndexOf("import") < p.Xml.IndexOf("identify2")); - } - - /// - /// AddNewItemGroup Test, Check Addition of group after propety group - /// - [Test] - public void AddNewItemGroupAfterPropertyGroup() - { - Project p = ObjectModelHelpers.CreateInMemoryProject(TestData.ContentValidTargetsWithOutput); - Project imported = new Project(p.ParentEngine); - imported.LoadXml(TestData.ContentCreateItemTarget); - Assertion.AssertEquals(0, p.ItemGroups.Count); - BuildItemGroup buildItemGroup = p.AddNewItemGroup(); - buildItemGroup.Condition = "identify"; - Assertion.AssertEquals(1, p.ItemGroups.Count); - Assertion.AssertEquals(true, p.Xml.IndexOf("") < p.Xml.IndexOf("identify")); - Assertion.AssertEquals(true, p.Xml.IndexOf("Target") > p.Xml.IndexOf("identify")); - } - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/Compatibility/TargetCollection_Tests.cs b/src/Deprecated/Engine.UnitTests/Compatibility/TargetCollection_Tests.cs deleted file mode 100644 index c8cbac228f7..00000000000 --- a/src/Deprecated/Engine.UnitTests/Compatibility/TargetCollection_Tests.cs +++ /dev/null @@ -1,557 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.IO; -using System.Xml; -using System.Reflection; -using System.Collections.Generic; -using NUnit.Framework; - -using Microsoft.Build.BuildEngine; -using Microsoft.Build.Framework; -using Microsoft.Build.UnitTests; - -namespace Microsoft.Build.UnitTests.OM.OrcasCompatibility -{ - /// - /// Tests for TargetCollection - /// - [TestFixture] - public class TargetCollection_Tests - { - #region Common Helpers - /// - /// Basic project content with several targets, where depends on targets is used - /// - private const string ProjectContentSeveralTargets = @" - - - - - - - - - - - - - - - - "; - - /// - /// Basic project content with no targets - an emtpy project - /// - private const string ProjectContentNoTargets = @" - - - "; - - /// - /// Engine that is used through out test class - /// - private Engine engine; - - /// - /// Project that is used through out test class - /// - private Project project; - - /// - /// Creates the engine and parent object. - /// - [SetUp()] - public void Initialize() - { - ObjectModelHelpers.DeleteTempProjectDirectory(); - - engine = new Engine(); - project = new Project(engine); - } - - /// - /// Unloads projects - /// - [TearDown()] - public void Cleanup() - { - engine.UnloadProject(project); - engine.UnloadAllProjects(); - - ObjectModelHelpers.DeleteTempProjectDirectory(); - } - #endregion - - #region Count Tests - /// - /// Tests TargetCollection.Count with many targets - /// - [Test] - public void CountMany() - { - project.LoadXml(ProjectContentSeveralTargets); - TargetCollection targets = project.Targets; - - Assertion.AssertEquals(5, targets.Count); - } - - /// - /// Tests TargetCollection.Count with some targets that are imported - /// - [Test] - public void CountWithImportedTargets() - { - string importProjectContents = @" - - - - - - - "; - - string projectContents = @" - - - - - - - "; - - Project p = GetProjectThatImportsAnotherProject(importProjectContents, projectContents); - TargetCollection targets = p.Targets; - - Assertion.AssertEquals(3, targets.Count); - } - - /// - /// Tests TargetCollection.Count when the imported project and parent project both contain - /// a target of the same name. - /// - [Test] - public void CountWhenImportedAndParentBothContainSameTarget() - { - string importProjectContents = @" - - - - - - "; - - string parentProjectContents = @" - - - - - - - "; - - Project p = GetProjectThatImportsAnotherProject(importProjectContents, parentProjectContents); - TargetCollection targets = p.Targets; - - Assertion.AssertEquals(1, targets.Count); - } - - /// - /// Tests TargetCollection.Count when no targets exist - /// - [Test] - public void CountWithNoTargets() - { - project.LoadXml(ProjectContentNoTargets); - TargetCollection targets = project.Targets; - - Assertion.AssertEquals(0, targets.Count); - } - - /// - /// Tests TargetCollection.Count after adding a new target - /// - [Test] - public void CountAfterAddingNewTarget() - { - project.LoadXml(ProjectContentSeveralTargets); - project.Targets.AddNewTarget("t6"); - - TargetCollection targets = project.Targets; - Assertion.AssertEquals(6, targets.Count); - } - - /// - /// Tests TargetCollection.Count after removing a target - /// - [Test] - public void CountAfterRemovingTarget() - { - project.LoadXml(ProjectContentSeveralTargets); - Target t = GetSpecificTargetFromProject(project, "t5"); - project.Targets.RemoveTarget(t); - - TargetCollection targets = project.Targets; - Assertion.AssertEquals(4, targets.Count); - } - #endregion - - #region Exists Tests - /// - /// Tests TargetCollection.Exists when target exists - /// - [Test] - public void ExistsWhenTargetExists() - { - project.LoadXml(ProjectContentSeveralTargets); - TargetCollection targets = project.Targets; - - Assertion.AssertEquals(true, targets.Exists("t2")); - } - - /// - /// Tests TargetCollection.Exists when target doesn't exist - /// - [Test] - public void ExistsWhenTargetDoesNotExist() - { - project.LoadXml(ProjectContentSeveralTargets); - TargetCollection targets = project.Targets; - - Assertion.AssertEquals(false, targets.Exists("tNot")); - } - - /// - /// Tests TargetCollection.Exists of an imported target - /// - [Test] - public void ExistsOfImportedTarget() - { - Project p = GetProjectThatImportsAnotherProject(null, null); - TargetCollection targets = p.Targets; - - Assertion.AssertEquals(true, targets.Exists("t4")); - } - - /// - /// Tests TargetCollection.Exists of a target that comes from an import as well as parent project - /// - [Test] - public void ExistsWhenImportedTargetAndParentTargetHaveSameName() - { - string importProjectContents = @" - - - - - - "; - - string parentProjectContents = @" - - - - - - - - "; - - Project p = GetProjectThatImportsAnotherProject(importProjectContents, parentProjectContents); - TargetCollection targets = p.Targets; - - Assertion.AssertEquals(true, targets.Exists("t1")); - } - #endregion - - #region AddNewTarget Tests - /// - /// Tests TargetCollection.AddNewTarget by adding a new target - /// - [Test] - public void AddNewTargetSimple() - { - project.LoadXml(ProjectContentSeveralTargets); - TargetCollection targets = project.Targets; - targets.AddNewTarget("tNew"); - - Assertion.AssertEquals(true, targets.Exists("tNew")); - Assertion.AssertEquals(6, targets.Count); - } - - /// - /// Tests TargetCollection.AddNewTarget by adding a new target of the same name - /// - [Test] - public void AddNewTargetWhenTargetOfSameNameAlreadyExists() - { - project.LoadXml(ProjectContentSeveralTargets); - TargetCollection targets = project.Targets; - targets.AddNewTarget("t1"); - - Assertion.AssertEquals(true, targets.Exists("t1")); - Assertion.AssertEquals(5, targets.Count); - } - - /// - /// Tests TargetCollection.AddNewTarget by adding a new target with an String.Empty name - /// - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void AddNewTargetEmptyStringName() - { - project.LoadXml(ProjectContentSeveralTargets); - TargetCollection targets = project.Targets; - targets.AddNewTarget(String.Empty); - } - - /// - /// Tests TargetCollection.AddNewTarget by adding a new target with a null name - /// - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void AddNewTargetNullName() - { - project.LoadXml(ProjectContentSeveralTargets); - TargetCollection targets = project.Targets; - targets.AddNewTarget(null); - } - - /// - /// Tests TargetCollection.AddNewTarget by adding a new target with special characters in the name - /// - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void AddNewTargetSpecialCharacterName() - { - project.LoadXml(ProjectContentSeveralTargets); - TargetCollection targets = project.Targets; - targets.AddNewTarget("%24%40%3b%5c%25"); - } - - /// - /// Tests TargetCollection.AddNewTarget by adding a new target to a project with no other targets - /// - [Test] - public void AddNewTargetWhenNoOtherTargetsExist() - { - project.LoadXml(ProjectContentNoTargets); - TargetCollection targets = project.Targets; - targets.AddNewTarget("t"); - - Assertion.AssertEquals(true, targets.Exists("t")); - Assertion.AssertEquals(1, targets.Count); - } - #endregion - - #region RemoveTarget Tests - /// - /// Tests TargetCollection.RemoveTarget by removing an existing target - /// - [Test] - public void RemoveTargetOfExistingTarget() - { - project.LoadXml(ProjectContentSeveralTargets); - TargetCollection targets = project.Targets; - targets.RemoveTarget(GetSpecificTargetFromProject(project, "t1")); - - Assertion.AssertEquals(false, targets.Exists("t1")); - } - - /// - /// Tests TargetCollection.RemoveTarget passing in null - /// - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void RemoveTargetNull() - { - project.LoadXml(ProjectContentSeveralTargets); - TargetCollection targets = project.Targets; - targets.RemoveTarget(null); - } - - /// - /// Tests TargetCollection.RemoveTarget of an imported target - /// - [Test] - [ExpectedException(typeof(InvalidOperationException))] - public void RemoveTargetFromImport() - { - Project p = GetProjectThatImportsAnotherProject(null, null); - TargetCollection targets = p.Targets; - targets.RemoveTarget(GetSpecificTargetFromProject(p, "t2")); - } - #endregion - - #region CopyTo Tests - /// - /// Tests TargetCollection.CopyTo basic case - /// - [Test] - public void CopyToSimple() - { - project.LoadXml(ProjectContentSeveralTargets); - TargetCollection targets = project.Targets; - - object[] array = new object[targets.Count]; - targets.CopyTo(array, 0); - - List listOfTargets = new List(); - foreach (Target t in array) - { - listOfTargets.Add(t.Name); - } - - // This originates in a hashtable, whose ordering is undefined - // and indeed changes in CLR4 - listOfTargets.Sort(); - - Assertion.AssertEquals(targets["t1"].Name, listOfTargets[0]); - Assertion.AssertEquals(targets["t2"].Name, listOfTargets[1]); - Assertion.AssertEquals(targets["t3"].Name, listOfTargets[2]); - Assertion.AssertEquals(targets["t4"].Name, listOfTargets[3]); - Assertion.AssertEquals(targets["t5"].Name, listOfTargets[4]); - } - - /// - /// Tests TargetCollection.CopyTo passing in a null - /// - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void CopyToNull() - { - project.LoadXml(ProjectContentSeveralTargets); - TargetCollection targets = project.Targets; - - targets.CopyTo(null, 0); - } - - /// - /// Tests TargetCollection.CopyTo when you attempt CopyTo into an Array that's not long enough - /// - [Test] - [ExpectedException(typeof(ArgumentException))] - public void CopyToArrayThatsNotLargeEnough() - { - project.LoadXml(ProjectContentSeveralTargets); - TargetCollection targets = project.Targets; - - object[] array = new object[2]; - targets.CopyTo(array, 0); - } - #endregion - - #region IsSynchronized Tests - /// - /// Tests TargetCollection.IsSynchronized for the default case - /// - [Test] - public void IsSynchronizedDefault() - { - project.LoadXml(ProjectContentSeveralTargets); - TargetCollection targets = project.Targets; - - Assertion.AssertEquals(false, targets.IsSynchronized); - } - #endregion - - #region TargetThis Tests - /// - /// Tests TargetCollection["targetname"].property where no imports exist - /// - [Test] - public void TargetThisNoImports() - { - project.LoadXml(ProjectContentSeveralTargets); - TargetCollection targets = project.Targets; - - Assertion.AssertEquals("in", targets["t1"].Inputs); - Assertion.AssertEquals("out", targets["t1"].Outputs); - Assertion.AssertEquals(false, targets["t2"].IsImported); - Assertion.AssertEquals("'true' == 'true'", targets["t2"].Condition); - Assertion.AssertEquals("t3", targets["t2"].DependsOnTargets); - Assertion.AssertEquals("t2", targets["t2"].Name); - } - - /// - /// Tests TargetCollection["targetname"].property where imports exist - /// - [Test] - public void TargetThisWithImports() - { - Project p = GetProjectThatImportsAnotherProject(null, null); - TargetCollection targets = p.Targets; - - Assertion.AssertEquals("in", targets["t3"].Inputs); - Assertion.AssertEquals("out", targets["t3"].Outputs); - Assertion.AssertEquals(true, targets["t3"].IsImported); - Assertion.AssertEquals("'true' == 'true'", targets["t3"].Condition); - Assertion.AssertEquals("t2", targets["t3"].DependsOnTargets); - Assertion.AssertEquals("t3", targets["t3"].Name); - } - #endregion - - #region Helpers - /// - /// Gets a specified Target from a Project - /// - /// Project - /// Target name of the Target you want - /// Target requested. null if specific target isn't found - private Target GetSpecificTargetFromProject(Project p, string nameOfTarget) - { - foreach (Target t in p.Targets) - { - if (String.Equals(t.Name, nameOfTarget, StringComparison.OrdinalIgnoreCase)) - { - return t; - } - } - - return null; - } - - /// - /// Gets a Project that imports another Project - /// - /// Project Contents of the imported Project, to get default content, pass in an empty string - /// Project Contents of the Parent Project, to get default content, pass in an empty string - /// Project - private Project GetProjectThatImportsAnotherProject(string importProjectContents, string parentProjectContents) - { - if (String.IsNullOrEmpty(importProjectContents)) - { - importProjectContents = @" - - - - - - "; - } - - if (String.IsNullOrEmpty(parentProjectContents)) - { - parentProjectContents = @" - - - - - - - "; - } - - ObjectModelHelpers.CreateFileInTempProjectDirectory("import.proj", importProjectContents); - ObjectModelHelpers.CreateFileInTempProjectDirectory("main.proj", parentProjectContents); - return ObjectModelHelpers.LoadProjectFileInTempProjectDirectory("main.proj", null); - } - #endregion - } -} diff --git a/src/Deprecated/Engine.UnitTests/Compatibility/Target_Tests.cs b/src/Deprecated/Engine.UnitTests/Compatibility/Target_Tests.cs deleted file mode 100644 index 7668dea1cc5..00000000000 --- a/src/Deprecated/Engine.UnitTests/Compatibility/Target_Tests.cs +++ /dev/null @@ -1,1263 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.IO; -using System.Xml; -using System.Reflection; -using System.Collections.Generic; -using NUnit.Framework; - -using Microsoft.Build.BuildEngine; -using Microsoft.Build.Framework; -using Microsoft.Build.UnitTests; - -namespace Microsoft.Build.UnitTests.OM.OrcasCompatibility -{ - /// - /// Tests for Target - /// - [TestFixture] - public class Target_Tests - { - #region Common Helpers - /// - /// Basic project content with 1 Target - /// - private const string ProjectContentsOneTarget = @" - - - - "; - - /// - /// Basic project content with 1 Target that contains an Input and an Output - /// - private const string ProjectContentOneTargetWithInputsOutputs = @" - - - - "; - - /// - /// Basic project content with 1 Target that contains a Message Task - /// - private const string ProjectContentOneTargetWithTask = @" - - - - - - "; - - /// - /// Basic project content with 3 Targets - /// - private const string ProjectContentsSeveralTargets = @" - - - - - - "; - - /// - /// Basic project content with 3 Targets that contain a Message Task - /// - private const string ProjectContentsSeveralTargetsWithTask = @" - - - - - - - - - - - - "; - - /// - /// Basic project content with 3 targets, each that contain an Input, Output, and Condition - /// - private const string ProjectContentSeveralTargetsWithInputsOutputsConditions = @" - - - - - - "; - - /// - /// Basic project content with several targets, where depends on targets is used - /// - private const string ProjectContentSeveralTargetsWithDependsOnTargets = @" - - - - - - - - - - - - - - - - "; - - /// - /// Engine that is used through out test class - /// - private Engine engine; - - /// - /// Project that is used through out test class - /// - private Project project; - - /// - /// MockLogger that is used through out test class - /// - private MockLogger logger; - - /// - /// Creates the engine and parent object. Also registers the mock logger. - /// - [SetUp()] - public void Initialize() - { - ObjectModelHelpers.DeleteTempProjectDirectory(); - - engine = new Engine(); - engine.DefaultToolsVersion = "4.0"; - project = new Project(engine); - logger = new MockLogger(); - project.ParentEngine.RegisterLogger(logger); - } - - /// - /// Unloads projects and un-registers logger. - /// - [TearDown()] - public void Cleanup() - { - engine.UnloadProject(project); - engine.UnloadAllProjects(); - engine.UnregisterAllLoggers(); - - ObjectModelHelpers.DeleteTempProjectDirectory(); - } - #endregion - - #region Inputs/Outputs Tests - /// - /// Tests Target.Inputs/Outputs Get Inputs/Outputs when they've not been set - /// - [Test] - public void InputsOutputsGetWhenUnset() - { - Target t = project.Targets.AddNewTarget("t1"); - - Assertion.AssertEquals(String.Empty, t.Inputs); - Assertion.AssertEquals(String.Empty, t.Outputs); - } - - /// - /// Tests Target.Inputs/Outputs Get Inputs/Outputs when they've been set to an empty string - /// - [Test] - public void InputsOutputsGetWhenSetEmptyString() - { - Target t = project.Targets.AddNewTarget("t1"); - t.Inputs = String.Empty; - t.Outputs = String.Empty; - - Assertion.AssertEquals(String.Empty, t.Inputs); - Assertion.AssertEquals(String.Empty, t.Outputs); - } - - /// - /// Tests Target.Inputs/Outputs Get Inputs/Outputs when they've been set to null - /// - [Test] - public void InputsOutputsGetWhenSetNull() - { - Target t = project.Targets.AddNewTarget("t1"); - t.Inputs = null; - t.Outputs = null; - - Assertion.AssertEquals(String.Empty, t.Inputs); - Assertion.AssertEquals(String.Empty, t.Outputs); - } - - /// - /// Tests Target.Inputs/Outputs Get Inputs/Outputs when they're set to simple valid string - /// - [Test] - public void InputsOutputsGetWhenSetToValidString() - { - Target t = project.Targets.AddNewTarget("t1"); - t.Inputs = "input"; - t.Outputs = "output"; - - Assertion.AssertEquals("input", t.Inputs); - Assertion.AssertEquals("output", t.Outputs); - } - - /// - /// Tests Target.Inputs/Outputs Set Inputs/Outputs to string that contains special characters - /// - [Test] - public void InputsOutputsSetWithSpecialCharacters() - { - Target t = project.Targets.AddNewTarget("t1"); - t.Inputs = "%24%40%3b%5c%25"; - t.Outputs = "%24%40%3b%5c%25"; - - Assertion.AssertEquals("%24%40%3b%5c%25", t.Inputs); - Assertion.AssertEquals("%24%40%3b%5c%25", t.Outputs); - } - - /// - /// Tests Target.Inputs/Outputs Get Inputs/Outputs from a pre-existing Target - /// - [Test] - public void InputsOutputsGetOfExistingTarget() - { - project.LoadXml(ProjectContentOneTargetWithInputsOutputs); - Target t = GetSpecificTargetFromProject(project, "t1"); - - Assertion.AssertEquals("in", t.Inputs); - Assertion.AssertEquals("out", t.Outputs); - } - - /// - /// Tests Target.Inputs/Outputs Get Inputs/Outputs from a pre-existing Target that has no Inputs/Outputs - /// - [Test] - public void InputsOutputsGetOfExistingTargetThatDoesntContainThem() - { - project.LoadXml(ProjectContentsOneTarget); - Target t = GetSpecificTargetFromProject(project, "t1"); - - Assertion.AssertEquals("", t.Inputs); - Assertion.AssertEquals("", t.Outputs); - } - - /// - /// Tests Target.Inputs/Outputs Set Inputs/Outputs on a pre-existing Target that has no Inputs/Outputs - /// - [Test] - public void InputsOutputsSetOnExistingTargetThatDoesntContainThem() - { - project.LoadXml(ProjectContentsOneTarget); - Target t = GetSpecificTargetFromProject(project, "t1"); - t.Inputs = "in"; - t.Outputs = "out"; - - Assertion.AssertEquals("in", t.Inputs); - Assertion.AssertEquals("out", t.Outputs); - } - - /// - /// Tests Target.Inputs/Outputs Set (change) Inputs/Outputs on a pre-existing Target - /// - [Test] - public void InputsOutputsSetOfExistingTargetThatAlreadyContainThem() - { - project.LoadXml(ProjectContentOneTargetWithInputsOutputs); - Target t = GetSpecificTargetFromProject(project, "t1"); - t.Inputs = "newin"; - t.Outputs = "newout"; - - Assertion.AssertEquals("newin", t.Inputs); - Assertion.AssertEquals("newout", t.Outputs); - } - - /// - /// Tests Target.Inputs/Outputs Get from an imported Target - /// - [Test] - public void InputsOutputsGetFromAnImportedTarget() - { - Project p = GetProjectWithOneImportProject(); - Target t = GetSpecificTargetFromProject(p, "t1"); - - Assertion.AssertEquals("in", t.Inputs); - Assertion.AssertEquals("out", t.Outputs); - } - - /// - /// Tests Target.Inputs/Outputs Set Inputs on an imported Target - /// - [Test] - [ExpectedException(typeof(InvalidOperationException))] - public void InputsOutputsSetInputOnAnImportedTarget() - { - Project p = GetProjectWithOneImportProject(); - Target t = GetSpecificTargetFromProject(p, "t1"); - t.Inputs = "newin"; - } - - /// - /// Tests Target.Inputs/Outputs Set Outputs on an imported Target - /// - [Test] - [ExpectedException(typeof(InvalidOperationException))] - public void InputsOutputsSetOutputOnAnImportedTarget() - { - Project p = GetProjectWithOneImportProject(); - Target t = GetSpecificTargetFromProject(p, "t1"); - t.Outputs = "newout"; - } - - /// - /// Tests Target.Inputs/Outputs Set, then save to disk and verify - /// - [Test] - public void InputsOutputsSaveProjectAfterSet() - { - project.LoadXml(ProjectContentOneTargetWithInputsOutputs); - - Target t = GetSpecificTargetFromProject(project, "t1"); - t.Inputs = "newin"; - t.Outputs = "newout"; - - string expectedProjectContents = @" - - - - "; - - SaveProjectToDiskAndCompareAgainstExpectedContents(project, expectedProjectContents); - } - - /// - /// Tests Target.Inputs/Outputs Set on an already existing Target that has been Built - /// - [Test] - public void InputsOutputsSetOnAnAlreadyBuiltTarget() - { - string projectContents = @" - - - - - - "; - - project.LoadXml(projectContents); - project.Build("t1"); - - Target t = GetSpecificTargetFromProject(project, "t1"); - t.Inputs = "newin"; - t.Outputs = "newout"; - - Assertion.AssertEquals("newin", t.Inputs); - Assertion.AssertEquals("newout", t.Outputs); - } - - /// - /// Tests Target.Inputs/Outputs Set to String where string contains metadata - /// - [Test] - public void InputsOutputsSetToStringWithMetadata() - { - string projectContents = @" - - - - 1 - - - 2 - - - - - - - "; - - project.LoadXml(projectContents); - project.Build("t1"); - - ResetLogger(); - - Target t = GetSpecificTargetFromProject(project, "t1"); - t.Inputs = "%(SomeItem.metadata)"; - t.Outputs = @"@(SomeItem->'%(metadata)')"; - - ITaskItem[] outputItems = BuildAndGatherOutputs("t1"); - - Assertion.AssertEquals(true, logger.FullLog.Contains("afoo")); - Assertion.AssertEquals(true, logger.FullLog.Contains("bfoo")); - Assertion.AssertEquals("1", outputItems[0].ToString()); - Assertion.AssertEquals("2", outputItems[1].ToString()); - } - #endregion - - #region Name Tests - /// - /// Tests Target.Name after Adding a new Target of that newly added Target - /// - [Test] - public void NameAfterAddingNewTarget() - { - Target t = project.Targets.AddNewTarget("t1"); - - Assertion.AssertEquals("t1", t.Name); - } - - /// - /// Tests Target.Name of an existing Target - /// - [Test] - public void NameOfExistingTargetWhenOnlyOneExists() - { - project.LoadXml(ProjectContentsOneTarget); - Target t = GetSpecificTargetFromProject(project, "t1"); - - Assertion.AssertEquals("t1", t.Name); - } - - /// - /// Tests Target.Name of an imported target - /// - [Test] - public void NameOfAnImportedTarget() - { - Project p = GetProjectWithOneImportProject(); - Target t = GetSpecificTargetFromProject(p, "t1"); - - Assertion.AssertEquals("t1", t.Name); - } - - /// - /// Tests Target.Name of a newly added target when existing targets exist - /// - [Test] - public void NameAfterAddingNewTargetWhenOtherExistingTargetsExist() - { - project.LoadXml(ProjectContentsOneTarget); - project.Targets.AddNewTarget("new"); - Target t = GetSpecificTargetFromProject(project, "new"); - - Assertion.AssertEquals("new", t.Name); - } - - /// - /// Tests Target.Name of 1 of many existing Targets - /// - [Test] - public void NameOfExistingTargetWhenManyExists() - { - project.LoadXml(ProjectContentsSeveralTargets); - Target t = GetSpecificTargetFromProject(project, "t2"); - - Assertion.AssertEquals("t2", t.Name); - } - - /// - /// Tests Target.Name Set, then save to disk and verify - /// - [Test] - public void NameSaveProjectAfterSet() - { - project.LoadXml(ProjectContentOneTargetWithInputsOutputs); - Target t = project.Targets.AddNewTarget("tnew"); - - string expectedProjectContents = @" - - - - - "; - - SaveProjectToDiskAndCompareAgainstExpectedContents(project, expectedProjectContents); - } - #endregion - - #region Condition Tests - /// - /// Tests Target.Condition Get from an existing project target - /// - [Test] - public void ConditionGetFromExistingProjectTarget() - { - project.LoadXml(ProjectContentSeveralTargetsWithInputsOutputsConditions); - Target t = GetSpecificTargetFromProject(project, "t1"); - - Assertion.AssertEquals("'A' == 'A'", t.Condition); - } - - /// - /// Tests Target.Condition Set on an existing project target - /// - [Test] - public void ConditionSetOnExistingProjectTarget() - { - project.LoadXml(ProjectContentSeveralTargetsWithInputsOutputsConditions); - Target t = GetSpecificTargetFromProject(project, "t1"); - t.Condition = "'A' == 'B'"; - - Assertion.AssertEquals("'A' == 'B'", t.Condition); - } - - /// - /// Tests Target.Condition Set on a newly added target - /// - [Test] - public void ConditionSetOnNewlyAddedTarget() - { - project.LoadXml(ProjectContentSeveralTargetsWithInputsOutputsConditions); - Target t = project.Targets.AddNewTarget("t4"); - t.Condition = "'true' == 'true'"; - - Assertion.AssertEquals("'true' == 'true'", t.Condition); - } - - /// - /// Tests Target.Condition Set, then save to disk and verify - /// - [Test] - public void ConditionSetSaveProjectAfterSet() - { - project.LoadXml(ProjectContentOneTargetWithInputsOutputs); - Target t = GetSpecificTargetFromProject(project, "t1"); - t.Condition = "'A' == 'B'"; - - string expectedProjectContents = @" - - - - "; - - SaveProjectToDiskAndCompareAgainstExpectedContents(project, expectedProjectContents); - } - - /// - /// Tests Target.Condition Set with special characters - /// - [Test] - public void ConditionSetWithSpecialCharacters() - { - project.LoadXml(ProjectContentSeveralTargetsWithInputsOutputsConditions); - Target t = GetSpecificTargetFromProject(project, "t1"); - t.Condition = "'%24%40%3b%5c%25' == '%24%40%3b%5c%25'"; - - Assertion.AssertEquals("'%24%40%3b%5c%25' == '%24%40%3b%5c%25'", t.Condition); - } - - /// - /// Tests Target.Condition Set to an empty string - /// - [Test] - public void ConditionSetToEmptyString() - { - project.LoadXml(ProjectContentsOneTarget); - Target t = GetSpecificTargetFromProject(project, "t1"); - t.Condition = String.Empty; - - Assertion.AssertEquals(String.Empty, t.Condition); - } - - /// - /// Tests Target.Condition Set to null - /// - [Test] - public void ConditionSetToNull() - { - project.LoadXml(ProjectContentsOneTarget); - Target t = GetSpecificTargetFromProject(project, "t1"); - t.Condition = null; - - Assertion.AssertEquals(String.Empty, t.Condition); - } - - /// - /// Tests Target.Condition Get from an imported Target - /// - [Test] - public void ConditionGetFromAnImportedTarget() - { - Project p = GetProjectWithOneImportProject(); - Target t = GetSpecificTargetFromProject(p, "t1"); - - Assertion.AssertEquals("'true' == 'true'", t.Condition); - } - - /// - /// Tests Target.Condition Set on an imported Target - /// - [Test] - [ExpectedException(typeof(InvalidOperationException))] - public void ConditionSetOnAnImportedTarget() - { - Project p = GetProjectWithOneImportProject(); - Target t = GetSpecificTargetFromProject(p, "t1"); - t.Condition = "'B' == 'B'"; - } - #endregion - - #region AddNewTask Tests - /// - /// Tests Target.AddNewTask by adding a new task with a simple string name - /// - [Test] - public void AddNewTaskSimpleTaskNameString() - { - project.LoadXml(ProjectContentsOneTarget); - Target t = GetSpecificTargetFromProject(project, "t1"); - - BuildTask task = t.AddNewTask("Message"); - task.SetParameterValue("Text", "t1.task"); - - Assertion.AssertEquals(true, project.Build("t1")); - Assertion.AssertEquals(true, logger.FullLog.Contains("t1.task")); - } - - /// - /// Tests Target.AddNewTask by adding a new task, then save to disk and verify - /// - [Test] - public void AddNewTaskSaveProjectAfterSet() - { - project.LoadXml(ProjectContentsOneTarget); - Target t = GetSpecificTargetFromProject(project, "t1"); - - BuildTask task = t.AddNewTask("Message"); - task.SetParameterValue("Text", "t1.task"); - - string expectedProjectContents = @" - - - - - - "; - - SaveProjectToDiskAndCompareAgainstExpectedContents(project, expectedProjectContents); - } - - /// - /// Tests Target.AddNewTask by attempting to add a new task with an Empty String name - /// - [Test] - [ExpectedException(typeof(ArgumentException))] - public void AddNewTaskWithEmptyTaskname() - { - project.LoadXml(ProjectContentsOneTarget); - Target t = GetSpecificTargetFromProject(project, "t1"); - - t.AddNewTask(String.Empty); - } - - /// - /// Tests Target.AddNewTask by attempting to add a new task with a null name - /// - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void AddNewTaskWithNullTaskname() - { - project.LoadXml(ProjectContentsOneTarget); - Target t = GetSpecificTargetFromProject(project, "t1"); - - t.AddNewTask(null); - } - - /// - /// Tests Target.AddNewTask by attempting to add a new task to an imported target - /// - [Test] - [ExpectedException(typeof(InvalidOperationException))] - public void AddNewTaskAttemptToAddToImportedTarget() - { - Project p = GetProjectWithOneImportProject(); - Target t = GetSpecificTargetFromProject(p, "t1"); - - t.AddNewTask("Message"); - } - - /// - /// Tests Target.AddNewTask by attempting to add a new task with name that contains special characters - /// - [Test] - [ExpectedException(typeof(XmlException))] - public void AddNewTaskWithSpecialCharactersInTaskname() - { - project.LoadXml(ProjectContentsOneTarget); - Target t = GetSpecificTargetFromProject(project, "t1"); - - t.AddNewTask("%24%40%3b%5c%25"); - } - - /// - /// Tests Target.AddNewTask by adding several new tasks to the same target - /// - [Test] - public void AddNewTaskSeveralToOneTarget() - { - project.LoadXml(ProjectContentsOneTarget); - Target t = GetSpecificTargetFromProject(project, "t1"); - - BuildTask[] task = new BuildTask[3]; - task[0] = t.AddNewTask("Message"); - task[0].SetParameterValue("Text", "t1.task1"); - task[1] = t.AddNewTask("Message"); - task[1].SetParameterValue("Text", "t1.task2"); - task[2] = t.AddNewTask("Message"); - task[2].SetParameterValue("Text", "t1.task3"); - - Assertion.AssertEquals(true, project.Build("t1")); - Assertion.AssertEquals(true, logger.FullLog.Contains("t1.task1")); - Assertion.AssertEquals(true, logger.FullLog.Contains("t1.task2")); - Assertion.AssertEquals(true, logger.FullLog.Contains("t1.task3")); - } - - /// - /// Tests Target.AddNewTask by adding a new task to several different targets - /// - [Test] - public void AddNewTaskSeveralToDifferentTargets() - { - project.LoadXml(ProjectContentsSeveralTargets); - - BuildTask[] task = new BuildTask[3]; - Target[] t = new Target[3]; - t[0] = GetSpecificTargetFromProject(project, "t1"); - task[0] = t[0].AddNewTask("Message"); - task[0].SetParameterValue("Text", "t1.task1"); - - t[1] = GetSpecificTargetFromProject(project, "t2"); - task[1] = t[1].AddNewTask("Message"); - task[1].SetParameterValue("Text", "t2.task1"); - - t[2] = GetSpecificTargetFromProject(project, "t3"); - task[2] = t[2].AddNewTask("Message"); - task[2].SetParameterValue("Text", "t3.task1"); - - Assertion.AssertEquals(true, project.Build(new string[] { "t1", "t2", "t3" })); - Assertion.AssertEquals(true, logger.FullLog.Contains("t1.task1")); - Assertion.AssertEquals(true, logger.FullLog.Contains("t2.task1")); - Assertion.AssertEquals(true, logger.FullLog.Contains("t3.task1")); - } - - /// - /// Tests Target.AddNewTask by adding a new task to a target that already contains a task - /// - [Test] - public void AddNewTaskToATargetThatContainsAPreExistingTask() - { - project.LoadXml(ProjectContentOneTargetWithTask); - Target t = GetSpecificTargetFromProject(project, "t1"); - BuildTask task = t.AddNewTask("Message"); - task.SetParameterValue("Text", "t1.task2"); - - Assertion.AssertEquals(true, project.Build("t1")); - Assertion.AssertEquals(true, logger.FullLog.Contains("t1.task1")); - Assertion.AssertEquals(true, logger.FullLog.Contains("t1.task2")); - } - #endregion - - #region RemoveTask Tests - /// - /// Tests Target.RemoveTask of an existing Task - /// - [Test] - public void RemoveTaskRemoveExistingTask() - { - project.LoadXml(ProjectContentOneTargetWithTask); - Target t = GetSpecificTargetFromProject(project, "t1"); - BuildTask task = GetSpecificTaskWithinTarget(t, "Message"); - - t.RemoveTask(task); - - Assertion.AssertEquals(true, project.Build("t1")); - Assertion.AssertEquals(false, logger.FullLog.Contains("t1.task1")); - } - - /// - /// Tests Target.RemoveTask of a newly added Task - /// - [Test] - public void RemoveTaskRemoveNewlyAddedTask() - { - project.LoadXml(ProjectContentsOneTarget); - Target t = GetSpecificTargetFromProject(project, "t1"); - BuildTask task = t.AddNewTask("Message"); - task.SetParameterValue("Text", "t1.task1"); - - t.RemoveTask(task); - - Assertion.AssertEquals(true, project.Build("t1")); - Assertion.AssertEquals(false, logger.FullLog.Contains("t1.task1")); - } - - /// - /// Tests Target.RemoveTask by attemptying to remove a null task - /// - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void RemoveTaskWhereTaskIsNull() - { - project.LoadXml(ProjectContentsOneTarget); - Target t = GetSpecificTargetFromProject(project, "t1"); - BuildTask task = null; - - t.RemoveTask(task); - } - - /// - /// Tests Target.RemoveTask by attempting to remove a task from another target - /// - [Test] - [ExpectedException(typeof(InvalidOperationException))] - public void RemoveTaskAttemptWithTaskThatsInAnotherTarget() - { - project.LoadXml(ProjectContentsSeveralTargetsWithTask); - Target t1 = GetSpecificTargetFromProject(project, "t1"); - BuildTask task1 = GetSpecificTaskWithinTarget(t1, "Message"); - Target t2 = GetSpecificTargetFromProject(project, "t2"); - - t2.RemoveTask(task1); - } - - /// - /// Tests Target.RemoveTask by attempting to remove a task from an imported target - /// - [Test] - [ExpectedException(typeof(InvalidOperationException))] - public void RemoveTaskAttemptRemovalOfAnImportedTask() - { - Project p = GetProjectWithOneImportProject(); - Target t = GetSpecificTargetFromProject(p, "t1"); - BuildTask task = GetSpecificTaskWithinTarget(t, "Message"); - - t.RemoveTask(task); - } - #endregion - - #region DependsOnTargets Tests - /// - /// Tests Target.DependsOnTargets Get from existing target - /// - [Test] - public void DependsOnTargetGetExisting() - { - project.LoadXml(ProjectContentSeveralTargetsWithDependsOnTargets); - Target t = GetSpecificTargetFromProject(project, "t3"); - - Assertion.AssertEquals("t4", t.DependsOnTargets); - } - - /// - /// Tests Target.DependsOnTargets Set from existing target - /// - [Test] - public void DependsOnTargetSetExisting() - { - project.LoadXml(ProjectContentSeveralTargetsWithDependsOnTargets); - Target t = GetSpecificTargetFromProject(project, "t3"); - - t.DependsOnTargets = "t1"; - - Assertion.AssertEquals("t1", t.DependsOnTargets); - } - - /// - /// Tests Target.DependsOnTargets Saving to Disk after setting - /// - [Test] - public void DependsOnTargetSaveAfterSet() - { - project.LoadXml(ProjectContentSeveralTargetsWithDependsOnTargets); - Target t = GetSpecificTargetFromProject(project, "t3"); - t.DependsOnTargets = "t1"; - - string expectedProjectContents = @" - - - - - - - - - - - - - - - - "; - - SaveProjectToDiskAndCompareAgainstExpectedContents(project, expectedProjectContents); - } - - /// - /// Tests Target.DependsOnTargets Building after Set - /// - [Test] - public void DependsOnTargetSetThenBuild() - { - project.LoadXml(ProjectContentSeveralTargetsWithDependsOnTargets); - Target t = GetSpecificTargetFromProject(project, "t2"); - t.DependsOnTargets = "t4"; - - Assertion.AssertEquals(true, project.Build("t1")); - Assertion.AssertEquals(true, logger.FullLog.Contains("t2.task")); - Assertion.AssertEquals(false, logger.FullLog.Contains("t3.task")); - Assertion.AssertEquals(true, logger.FullLog.Contains("t4.task")); - Assertion.AssertEquals(false, logger.FullLog.Contains("t5.task")); - } - - /// - /// Tests Target.DependsOnTargets Setting to a non-existing Target and then Build - /// - [Test] - public void DependsOnTargetSetToNonExistingTargetBuild() - { - project.LoadXml(ProjectContentSeveralTargetsWithDependsOnTargets); - Target t = GetSpecificTargetFromProject(project, "t1"); - t.DependsOnTargets = "tNot"; - - Assertion.AssertEquals(false, project.Build("t1")); - Assertion.AssertEquals(true, logger.FullLog.Contains("MSB4057")); - } - - /// - /// Tests Target.DependsOnTargets Get of a newly created target - /// - [Test] - public void DependsOnTargetGetNewlyCreated() - { - project.LoadXml(ProjectContentSeveralTargetsWithDependsOnTargets); - Target t = project.Targets.AddNewTarget("tNew"); - - Assertion.AssertEquals(String.Empty, t.DependsOnTargets); - } - - /// - /// Tests Target.DependsOnTargets Set of a newly created target - /// - [Test] - public void DependsOnTargetSetNewlyCreated() - { - project.LoadXml(ProjectContentSeveralTargetsWithDependsOnTargets); - Target t = project.Targets.AddNewTarget("tNew"); - t.DependsOnTargets = "t5"; - - Assertion.AssertEquals("t5", t.DependsOnTargets); - Assertion.AssertEquals(true, project.Build("tNew")); - Assertion.AssertEquals(true, logger.FullLog.Contains("t5.task")); - } - - /// - /// Tests Target.DependsOnTarget Set to an empty string - /// - [Test] - public void DependsOnTargetSetToEmptyString() - { - project.LoadXml(ProjectContentSeveralTargetsWithDependsOnTargets); - Target t = GetSpecificTargetFromProject(project, "t1"); - t.DependsOnTargets = String.Empty; - - Assertion.AssertEquals(String.Empty, t.DependsOnTargets); - } - - /// - /// Tests Target.DependsOnTarget Set to null - /// - [Test] - public void DependsOnTargetSetToNull() - { - project.LoadXml(ProjectContentSeveralTargetsWithDependsOnTargets); - Target t = GetSpecificTargetFromProject(project, "t1"); - t.DependsOnTargets = null; - - Assertion.AssertEquals(String.Empty, t.DependsOnTargets); - } - - /// - /// Tests Target.DependsOnTarget Set to special characters - /// - [Test] - public void DependsOnTargetSetToSpecialCharacters() - { - project.LoadXml(ProjectContentSeveralTargetsWithDependsOnTargets); - Target t = GetSpecificTargetFromProject(project, "t1"); - t.DependsOnTargets = "%24%40%3b%5c%25"; - - Assertion.AssertEquals("%24%40%3b%5c%25", t.DependsOnTargets); - } - - /// - /// Tests Target.DependsOnTarget Get of an imported Target - /// - [Test] - public void DependsOnTargetGetFromImportedTarget() - { - Project p = GetProjectWithOneImportProject(); - Target t = GetSpecificTargetFromProject(p, "tImported"); - - Assertion.AssertEquals("t1", t.DependsOnTargets); - } - - /// - /// Tests Target.DependsOnTarget Set on an imported Target - /// - [Test] - [ExpectedException(typeof(InvalidOperationException))] - public void DependsOnTargetSetFromImportedTarget() - { - Project p = GetProjectWithOneImportProject(); - Target t = GetSpecificTargetFromProject(p, "tImported"); - - t.DependsOnTargets = "t"; - } - #endregion - - #region IsImported Tests - /// - /// Tests Target.IsImported of an imported target - /// - [Test] - public void IsImportedOfAnImportedTarget() - { - Project p = GetProjectWithOneImportProject(); - Target t = GetSpecificTargetFromProject(p, "tImported"); - - Assertion.AssertEquals(true, t.IsImported); - } - - /// - /// Tests Target.IsImported of an target that is not imported - /// - [Test] - public void IsImportedOfANonImportedTarget() - { - project.LoadXml(ProjectContentsOneTarget); - Target t = GetSpecificTargetFromProject(project, "t1"); - - Assertion.AssertEquals(false, t.IsImported); - } - - /// - /// Tests Target.IsImported where the Main project and Imported project both - /// contain target t1, but the imported target t1 comes after the main - /// target t1. - /// - [Test] - public void IsImportedTargetOfSameNameInBothWhereImportedComesLast() - { - string importProjectContents = @" - - - - - - "; - - string projectContents = @" - - - - - - - "; - - ObjectModelHelpers.CreateFileInTempProjectDirectory("import.proj", importProjectContents); - ObjectModelHelpers.CreateFileInTempProjectDirectory("main.proj", projectContents); - Project p = ObjectModelHelpers.LoadProjectFileInTempProjectDirectory("main.proj", null); - - Target t = GetSpecificTargetFromProject(p, "t1", true); - - Assertion.AssertEquals(true, t.IsImported); - } - - /// - /// Tests Target.IsImported where the Main project and Imported project both - /// contain target t1, but the imported target t1 comes before the main - /// target t1. - /// - [Test] - public void IsImportedTargetOfSameNameInBothWhereImportedComesFirst() - { - string importProjectContents = @" - - - - - - "; - - string projectContents = @" - - - - - - - "; - - ObjectModelHelpers.CreateFileInTempProjectDirectory("import.proj", importProjectContents); - ObjectModelHelpers.CreateFileInTempProjectDirectory("main.proj", projectContents); - Project p = ObjectModelHelpers.LoadProjectFileInTempProjectDirectory("main.proj", null); - - Target t = GetSpecificTargetFromProject(p, "t1", true); - - Assertion.AssertEquals(false, t.IsImported); - } - #endregion - - #region Helpers - /// - /// Gets you a specific BuildTask from a specific Target - /// - /// Target that contains your BuildTask - /// The name of the BuildTask you want - /// The BuildTask you requested - private static BuildTask GetSpecificTaskWithinTarget(Target t, string taskNameYouWant) - { - foreach (BuildTask task in t) - { - if (String.Equals(task.Name, taskNameYouWant, StringComparison.OrdinalIgnoreCase)) - { - return task; - } - } - - return null; - } - - /// - /// Saves a given Project to disk and compares what's saved to disk with expected contents. Assertion handled within - /// ObjectModelHelpers.CompareProjectContents. - /// - /// Project to save - /// The Project content that you expect - private static void SaveProjectToDiskAndCompareAgainstExpectedContents(Project p, string expectedProjectContents) - { - string savePath = Path.Combine(ObjectModelHelpers.TempProjectDir, "p.proj"); - p.Save(savePath); - - Engine e = new Engine(); - Project savedProject = new Project(e); - savedProject.Load(savePath); - - ObjectModelHelpers.CompareProjectContents(savedProject, expectedProjectContents); - ObjectModelHelpers.DeleteTempProjectDirectory(); - } - - /// - /// Helper Method to create a Main project that imports 1 other project. Each project contains a Target that - /// also contains a BuildTask. - /// - /// Project - private static Project GetProjectWithOneImportProject() - { - string importProjectContents = @" - - - - - - - "; - - string projectContents = @" - - - - - - - "; - - ObjectModelHelpers.CreateFileInTempProjectDirectory("import1.proj", importProjectContents); - ObjectModelHelpers.CreateFileInTempProjectDirectory("main.proj", projectContents); - Project p = ObjectModelHelpers.LoadProjectFileInTempProjectDirectory("main.proj", null); - - return p; - } - - /// - /// Gets a specified Target from a Project - /// - /// Project - /// Target name of the Target you want - /// Target requested. null if specific target isn't found - private Target GetSpecificTargetFromProject(Project p, string nameOfTarget) - { - return GetSpecificTargetFromProject(p, nameOfTarget, false); - } - - /// - /// Gets a specified Target from a Project - /// - /// Project - /// Target name of the Target you want - /// If you want the last instance of a target set to true - /// Target requested. null if specific target isn't found - private Target GetSpecificTargetFromProject(Project p, string nameOfTarget, bool lastInstance) - { - Target target = null; - foreach (Target t in p.Targets) - { - if (String.Equals(t.Name, nameOfTarget, StringComparison.OrdinalIgnoreCase)) - { - if (!lastInstance) - { - return t; - } - else - { - target = t; - } - } - } - - return target; - } - - /// - /// Builds the specified target and return the outputs - /// - /// The Target that you want to build, like 'Build', 'Rebuild', etc - /// outputs - private ITaskItem[] BuildAndGatherOutputs(string targetToBuild) - { - Dictionary outputs = new Dictionary(); - project.Build(new string[] { targetToBuild }, outputs); - ITaskItem[] outputItems = (ITaskItem[])outputs[targetToBuild]; - return outputItems; - } - - /// - /// Un-registers the existing logger and registers a new copy. - /// We will use this when we do multiple builds so that we can safely - /// assert on log messages for that particular build. - /// - private void ResetLogger() - { - engine.UnregisterAllLoggers(); - logger = new MockLogger(); - project.ParentEngine.RegisterLogger(logger); - } - #endregion - } -} diff --git a/src/Deprecated/Engine.UnitTests/Compatibility/ToolSet_Tests.cs b/src/Deprecated/Engine.UnitTests/Compatibility/ToolSet_Tests.cs deleted file mode 100644 index 18f16e6a9c5..00000000000 --- a/src/Deprecated/Engine.UnitTests/Compatibility/ToolSet_Tests.cs +++ /dev/null @@ -1,214 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.IO; - -using NUnit.Framework; - -using Microsoft.Build; -using Microsoft.Build.BuildEngine; -using Microsoft.Build.Framework; -using Microsoft.Build.UnitTests; - -namespace Microsoft.Build.UnitTests.OM.OrcasCompatibility -{ - /// - /// Fixture Class for the v9 OM Public Interface Compatibility Tests. Toolset Class. - /// Also see Toolset tests in the Project test class. - /// - [TestFixture] - public sealed class Toolset_Tests - { - /// - /// Toolset Test. Construct, null Tools version - /// - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void ToolsetNullToolsVersion() - { - Toolset toolset = new Toolset(null, "c:\aPath"); - } - - /// - /// Toolset Test. Construct, empty Tools version - /// - [Test] - [ExpectedException(typeof(ArgumentException))] - public void ToolsetEmptyToolsVersion() - { - Toolset toolset = new Toolset(String.Empty, "c:\aPath"); - } - - /// - /// Toolset Test. Construct, empty Tools path - /// - [Test] - [ExpectedException(typeof(ArgumentException))] - public void ToolsetEmptyToolsPath() - { - Toolset toolset = new Toolset("toolset", String.Empty); - } - - /// - /// Toolset Test. Construct, null Tools path - /// - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void ToolsetNullToolsPath() - { - Toolset toolset = new Toolset("toolset", null); - } - - /// - /// Toolset Test. Construct, special chars in tools version - /// - [Test] - public void ToolsetEscapedVersions() - { - string escaped = @"%25%2a%3f%40%24%28%29%3b\"; - string unescaped = @"%*?@$();\"; - Toolset toolsetEscaped = new Toolset(escaped, @"c:\aPath"); - Toolset toolsetUnescaped = new Toolset(unescaped, @"c:\aPath"); - Assertion.AssertEquals(escaped, toolsetEscaped.ToolsVersion); - Assertion.AssertEquals(unescaped, toolsetUnescaped.ToolsVersion); - } - - /// - /// Toolset Test. Load toolset from scalar does not evaluate - /// - [Test] - public void ToolsetScalar() - { - Project p = new Project(); - p.SetProperty("version", "number"); - BuildProperty versionProperty = CompatibilityTestHelpers.FindBuildProperty(p, "version"); - p.ParentEngine.Toolsets.Add(new Toolset("scalar", @"$(version)")); - object o = p.EvaluatedProperties; - Assertion.AssertEquals(false, Object.Equals(versionProperty.Value, p.ParentEngine.Toolsets["scalar"].ToolsVersion)); - } - - /// - /// Toolset Test. Construct, overlong path - /// - [Test] - [ExpectedException(typeof(PathTooLongException))] - public void ToolsetLongPath() - { - string longPath = CompatibilityTestHelpers.GenerateLongPath(256); - Toolset toolset = new Toolset("toolset", longPath); - } - - /// - /// Toolset Test. Construct, invalid path - /// - [Test] - public void ToolsetInvalidPath() - { - string invalidPath = @"c:\invalid|path"; - Toolset toolset = new Toolset("toolset", invalidPath); - } - - /// - /// Toolset Test. Construct, import build properties, also tests getting BuildPropertGroups - /// - [Test] - public void ToolsetImportProperties() - { - BuildPropertyGroup buildPropertyGroup = new BuildPropertyGroup(); - buildPropertyGroup.SetProperty("n", "v"); - Toolset toolset = new Toolset("toolversion", "c:\aPath", buildPropertyGroup); - Assertion.AssertEquals(1, toolset.BuildProperties.Count); - } - - /// - /// Toolset Test. Construct, import null build properties - /// - [Test] - public void ToolsetImportPropertiesNull() - { - BuildPropertyGroup buildPropertyGroup = null; - Toolset toolset = new Toolset("toolversion", "c:\aPath", buildPropertyGroup); - Assertion.AssertEquals(0, toolset.BuildProperties.Count); - } - - /// - /// Toolset Test. Enforce a deep clone, clone properties and their groups too. - /// - [Test] - public void ToolsetClone() - { - Toolset toolset = new Toolset("toolversion", "c:\aPath"); - toolset.BuildProperties.SetProperty("n", "v"); - Toolset toolset2 = toolset.Clone(); - Assertion.AssertEquals(false, object.ReferenceEquals(toolset, toolset2)); - Assertion.AssertEquals(false, object.ReferenceEquals(toolset.BuildProperties["n"], toolset2.BuildProperties["n"])); - Assertion.AssertEquals(false, object.ReferenceEquals(toolset.BuildProperties, toolset2.BuildProperties)); - Assertion.AssertEquals(toolset.ToolsPath, toolset2.ToolsPath); - Assertion.AssertEquals(toolset.ToolsVersion, toolset2.ToolsVersion); - } - - /// - /// Toolset Test. Get version - /// - [Test] - public void ToolVersionGet() - { - Toolset toolset = new Toolset("toolversion", "c:\aPath"); - Assertion.AssertEquals("toolversion", toolset.ToolsVersion); - } - - /// - /// Toolset Test. Get Path (note stripping of the last slash) - /// - [Test] - public void ToolPathGetTrailingSlash() - { - Toolset toolset = new Toolset("toolversion", @"c:\aPath\"); - Assertion.AssertEquals(@"c:\aPath", toolset.ToolsPath); - } - - /// - /// Toolset Test. Get Path (root path, don't strip slash) - /// - [Test] - public void ToolPathGetRootPath() - { - Toolset toolset = new Toolset("toolversion", @"c:\"); - Assertion.AssertEquals(@"c:\", toolset.ToolsPath); - } - - /// - /// Toolset Test. Set special properties bofore add - /// - [Test] - public void ToolVersionPropertiesSpecialProperties() - { - Engine e = new Engine(); - Toolset toolset = new Toolset("toolversion", "c:\aPath"); - toolset.BuildProperties.SetProperty("msbuildpath", "newValue"); - toolset.BuildProperties.SetProperty("msbuildtoolspath", "newValue"); - e.Toolsets.Add(toolset); - Assertion.AssertEquals("newValue", e.Toolsets["toolversion"].BuildProperties["msbuildpath"].Value); - Assertion.AssertEquals("newValue", e.Toolsets["toolversion"].BuildProperties["msbuildtoolspath"].Value); - } - - /// - /// Toolset Test. Cannot set a property on toolset after adding it to the eninge - /// - [Test] - public void ToolVersionPropertiesSetafterAddingToolset() - { - Engine e = new Engine(); - Toolset toolset = new Toolset("toolversion", "c:\aPath"); - e.Toolsets.Add(toolset); - e.Toolsets["toolversion"].BuildProperties.SetProperty("n", "v"); - e.Toolsets.Add(toolset); - Assertion.AssertNull(e.Toolsets["toolversion"].BuildProperties["n"]); - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/Compatibility/ToolsetCollection_Tests.cs b/src/Deprecated/Engine.UnitTests/Compatibility/ToolsetCollection_Tests.cs deleted file mode 100644 index 35055c8c6a4..00000000000 --- a/src/Deprecated/Engine.UnitTests/Compatibility/ToolsetCollection_Tests.cs +++ /dev/null @@ -1,338 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections.Generic; -using System.Text; - -using NUnit.Framework; - -using Microsoft.Build; -using Microsoft.Build.BuildEngine; -using Microsoft.Build.Framework; -using Microsoft.Build.UnitTests; - -namespace Microsoft.Build.UnitTests.OM.OrcasCompatibility -{ - /// - /// Fixture Class for the v9 OM Public Interface Compatibility Tests. ToolsetCollection Class. - /// Also see Toolset tests in the Project test class. - /// - [TestFixture] - public class ToolsetCollection_Tests - { - /// - /// Add Test, simple add - /// - [Test] - public void Add() - { - Engine e = new Engine(); - - int defaultToolsetCount = e.Toolsets.Count; - e.Toolsets.Add(new Toolset("version", @"c:\path")); - Assertion.AssertEquals(defaultToolsetCount + 1, e.Toolsets.Count); - } - - /// - /// Add Test, simple add assert overwrite - /// - [Test] - public void AddTwiceOverWrite() - { - Engine e = new Engine(); - - int defaultToolsetCount = e.Toolsets.Count; - e.Toolsets.Add(new Toolset("version", @"c:\path")); - e.Toolsets.Add(new Toolset("version", @"c:\path")); - Assertion.AssertEquals(defaultToolsetCount + 1, e.Toolsets.Count); - } - - /// - /// Add Test, add a null toolset - /// - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void AddNullToolset() - { - Engine e = new Engine(); - Toolset toolset = null; - e.Toolsets.Add(toolset); - } - - /// - /// Clear Test, this is a not supported method - /// - [Test] - [ExpectedException(typeof(NotSupportedException))] - public void Clear() - { - Engine e = new Engine(); - e.Toolsets.Clear(); - } - - /// - /// ToolsetCollection Test, Indexing simple - /// - [Test] - public void ToolsetIndex() - { - Engine e = new Engine(); - e.Toolsets.Add(new Toolset("version", @"c:\path")); - Assertion.AssertEquals("version", e.Toolsets["version"].ToolsVersion); - } - - /// - /// ToolsetCollection Test, Indexing where index is null - /// - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void ToolsetIndex_Null() - { - Engine e = new Engine(); - string toolsVersion = e.Toolsets[null].ToolsVersion; - } - - /// - /// ToolsetCollection Test, Indexing where index does not exist - /// - [Test] - [ExpectedException(typeof(NullReferenceException))] - public void ToolsetIndex_NotFound() - { - Engine e = new Engine(); - string toolsVersion = e.Toolsets["NotFound"].ToolsVersion; - } - - /// - /// ToolsetCollection Test, Indexing Empty string - /// - [Test] - [ExpectedException(typeof(ArgumentException))] - public void ToolsetIndex_EmptyString() - { - Engine e = new Engine(); - string toolsVersion = e.Toolsets[String.Empty].ToolsVersion; - } - - /// - /// ToolsetCollection Test, returned object by index is clone of origional. - /// - [Test] - public void ToolsetIndex_AssertClonedReturn() - { - Engine e = new Engine(); - Toolset toolSet = new Toolset("version", @"c:\path"); - e.Toolsets.Add(toolSet); - Toolset toolset2 = e.Toolsets["version"]; - Assertion.AssertEquals(false, object.ReferenceEquals(toolSet, toolset2)); - } - - /// - /// Count Test. Increments on add - /// - /// We cannot test decrements because Clear() and Remove() are not supported - [Test] - public void CountIncrement() - { - Engine e = new Engine(); - Toolset toolSet = new Toolset("version", @"c:\path"); - int defaultCount = e.Toolsets.Count; - e.Toolsets.Add(toolSet); - Assertion.AssertEquals(defaultCount + 1, e.Toolsets.Count); - } - - /// - /// Remove Test. Assert method not supported - /// - [Test] - [ExpectedException(typeof(NotSupportedException))] - public void Remove() - { - Engine e = new Engine(); - Toolset toolSet = new Toolset("version", @"c:\path"); - e.Toolsets.Add(toolSet); - e.Toolsets.Remove(toolSet); - } - - /// - /// IsReadOnly test. Always returns false. - /// - [Test] - public void IsReadOnly() - { - Engine e = new Engine(); - Toolset toolSet = new Toolset("version", @"c:\path"); - Assertion.AssertEquals(false, e.Toolsets.IsReadOnly); - } - - /// - /// Contains Test, by object that is in collection - /// - [Test] - public void ContainsObject_found() - { - Engine e = new Engine(); - Toolset toolset1 = new Toolset("v1", @"c:\path"); - Toolset toolset2 = new Toolset("v2", @"c:\path"); - e.Toolsets.Add(toolset1); - e.Toolsets.Add(toolset2); - - Assertion.AssertEquals(true, e.Toolsets.Contains(toolset1)); - } - - /// - /// Contains Test, by object that is not in collection - /// - [Test] - public void ContainsObject_notFound() - { - Engine e = new Engine(); - Toolset toolSetToAdd = new Toolset("v1", @"c:\path"); - Toolset toolSetNotAdded = new Toolset("v2", @"c:\path"); - e.Toolsets.Add(toolSetToAdd); - Assertion.AssertEquals(false, e.Toolsets.Contains(toolSetNotAdded)); - } - - /// - /// Contains Test, by object. - /// - [Test] - public void ContainsToolsVersion_found() - { - Engine e = new Engine(); - Toolset toolset1 = new Toolset("v1", @"c:\path"); - Toolset toolset2 = new Toolset("v2", @"c:\path"); - e.Toolsets.Add(toolset1); - e.Toolsets.Add(toolset2); - Assertion.AssertEquals(true, e.Toolsets.Contains("v1")); - } - - /// - /// Contains Test, by object. - /// - [Test] - public void ContainsToolsVersion_notFound() - { - Engine e = new Engine(); - Toolset toolset1 = new Toolset("v1", @"c:\path"); - Toolset toolset2 = new Toolset("v2", @"c:\path"); - e.Toolsets.Add(toolset1); - e.Toolsets.Add(toolset2); - Assertion.AssertEquals(false, e.Toolsets.Contains("notthere")); - } - - /// - /// Contains Test, by object. - /// - [Test] - public void ContainsToolsVersion_escapedVersions() - { - Engine e = new Engine(); - string escaped = @"%25%2a%3f%40%24%28%29%3b\"; - string unescaped = @"%*?@$();\"; - Toolset toolSetEscaped = new Toolset(escaped, @"c:\path"); - Toolset toolSetUnescaped = new Toolset(unescaped, @"c:\path"); - e.Toolsets.Add(toolSetEscaped); - e.Toolsets.Add(toolSetUnescaped); - Assertion.AssertEquals(true, e.Toolsets.Contains(escaped)); - Assertion.AssertEquals(true, e.Toolsets.Contains(unescaped)); - } - - /// - /// CopyTo Test, copy into array at index zero - /// - [Test] - public void CopyToTest_IndexZero() - { - Engine e = new Engine(); - Toolset toolset1 = new Toolset("v1", @"c:\path"); - Toolset toolset2 = new Toolset("v2", @"c:\path"); - e.Toolsets.Add(toolset1); - e.Toolsets.Add(toolset2); - Toolset[] toolsetArray = new Toolset[e.Toolsets.Count]; - e.Toolsets.CopyTo(toolsetArray, 0); - Assertion.AssertEquals(e.Toolsets.Count, toolsetArray.Length); - Assertion.AssertEquals(true, 0 < Array.IndexOf(toolsetArray, toolset1)); - Assertion.AssertEquals(true, 0 < Array.IndexOf(toolsetArray, toolset2)); - Assertion.AssertEquals(true, object.ReferenceEquals(toolsetArray[Array.IndexOf(toolsetArray, toolset2)], toolset2)); - } - - /// - /// CopyTo Test, copy into array at offset Index - /// - [Test] - public void CopyToTest_OffsetIndex() - { - const int OffsetIndex = 2; - Engine e = new Engine(); - Toolset toolset1 = new Toolset("v1", @"c:\path"); - Toolset toolset2 = new Toolset("v2", @"c:\path"); - e.Toolsets.Add(toolset1); - Toolset[] toolsetArray = new Toolset[e.Toolsets.Count + OffsetIndex]; - e.Toolsets.CopyTo(toolsetArray, OffsetIndex); - Assertion.AssertEquals(e.Toolsets.Count, toolsetArray.Length - OffsetIndex); - Assertion.AssertNull(toolsetArray[OffsetIndex - 1]); - Assertion.AssertEquals(true, 0 < Array.IndexOf(toolsetArray, toolset1)); - } - - /// - /// CopyTo Test, copy into array that is initialized too small to contain all toolsets, - /// at index zero - /// - [Test] - [ExpectedException(typeof(ArgumentException))] - public void CopyToTest_ArrayTooSmall() - { - Engine e = new Engine(); - Toolset toolset1 = new Toolset("v1", @"c:\path"); - e.Toolsets.Add(toolset1); - e.Toolsets.CopyTo(new Toolset[e.Toolsets.Count - 1], 0); - } - - /// - /// Enumeration Test, manual iteration over ToolsetCollection using GetEnumerator(); - /// - [Test] - public void GetEnumerator() - { - Engine e = new Engine(); - Toolset toolset1 = new Toolset("v1", @"c:\path"); - Toolset[] toolsetArray = new Toolset[e.Toolsets.Count]; - e.Toolsets.CopyTo(toolsetArray, 0); - IEnumerator toolsetEnum = e.Toolsets.GetEnumerator(); - int enumerationCounter = 0; - while (toolsetEnum.MoveNext()) - { - Assertion.AssertEquals(true, object.ReferenceEquals(toolsetArray[enumerationCounter], toolsetEnum.Current)); - Assertion.AssertEquals(toolsetArray[enumerationCounter].ToolsVersion, toolsetEnum.Current.ToolsVersion); - enumerationCounter++; - } - } - - /// - /// ToolsVersions Test, get all ToolsVersions through ToolsVersions enumerable interface. - /// - [Test] - public void ToolsVersions() - { - Engine e = new Engine(); - Toolset toolset1 = new Toolset("v1", @"c:\path"); - IEnumerable toolsVersions = e.Toolsets.ToolsVersions; - Toolset[] toolsetArray = new Toolset[e.Toolsets.Count]; - e.Toolsets.CopyTo(toolsetArray, 0); - int counter = 0; - foreach (string toolsVersion in toolsVersions) - { - Assertion.AssertEquals(toolsetArray[counter].ToolsVersion, toolsVersion); - counter++; - } - - Assertion.AssertEquals(toolsetArray.Length, counter); - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/Compatibility/UsingTaskCollection_Tests.cs b/src/Deprecated/Engine.UnitTests/Compatibility/UsingTaskCollection_Tests.cs deleted file mode 100644 index 5f65032a302..00000000000 --- a/src/Deprecated/Engine.UnitTests/Compatibility/UsingTaskCollection_Tests.cs +++ /dev/null @@ -1,226 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.IO; -using System.Xml; -using System.Collections.Generic; - -using NUnit.Framework; - -using Microsoft.Build.BuildEngine; -using Microsoft.Build.Framework; -using Microsoft.Build.UnitTests; - -namespace Microsoft.Build.UnitTests.OM.OrcasCompatibility -{ - /// - /// Fixture Class for the v9 OM Public Interface Compatibility Tests. UsingTaskCollection Class. - /// Also see Toolset tests in the Project test class. - /// - [TestFixture] - public class UsingTaskCollection_Tests - { - /// - /// Imports Cache issue causes xml not to be loaded - /// This is a test case to reproduce some quirkiness found when running tests out of order. - /// - [Test] - public void ImportsUsingTask() - { - string importPath = String.Empty; - try - { - importPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("import.proj", TestData.Content3SimpleTargetsDefaultSpecified); - Project p = new Project(); - p.Save(importPath); // required to reproduce - importPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("import.proj", TestData.ContentUsingTaskFile); - Project p2 = new Project(); // new Engine() here fixes testcase - p2.AddNewImport(importPath, "true"); - object o = p2.EvaluatedProperties; // evaluate the import - Assertion.AssertNull(CompatibilityTestHelpers.FindUsingTaskByName("TaskName", p2.UsingTasks)); // fails to find task - } - finally - { - CompatibilityTestHelpers.RemoveFile(importPath); - } - } - - /// - /// Count Test. Increment Count on Import Add in OM - /// - [Test] - public void Count_IncrementOnAddFile() - { - Project p = new Project(new Engine()); - Assertion.AssertEquals(0, p.UsingTasks.Count); - p.AddNewUsingTaskFromAssemblyFile("TaskName", "AssemblyFile.dll"); - Assertion.AssertEquals(0, p.UsingTasks.Count); - object o = p.EvaluatedProperties; - Assertion.AssertEquals(1, p.UsingTasks.Count); - } - - /// - /// Count Test. Increment Count on Import Add in OM - /// - [Test] - public void Count_IncrementOnAddName() - { - Project p = new Project(new Engine()); - Assertion.AssertEquals(0, p.UsingTasks.Count); - p.AddNewUsingTaskFromAssemblyName("TaskName", "AssemblyName"); - Assertion.AssertEquals(0, p.UsingTasks.Count); - object o = p.EvaluatedProperties; - Assertion.AssertEquals(1, p.UsingTasks.Count); - } - - /// - /// Count Test. Increment Count on Import Add in XML - /// - [Test] - public void Count_IncrementOnAddFileXml() - { - string projectPath = String.Empty; - try - { - projectPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("import.proj", TestData.ContentUsingTaskFile); - Project p = new Project(new Engine()); - Assertion.AssertEquals(0, p.UsingTasks.Count); - p.Load(projectPath); - Assertion.AssertEquals(1, p.UsingTasks.Count); - } - finally - { - CompatibilityTestHelpers.RemoveFile(projectPath); - } - } - - /// - /// Count Test. Decrement\Reset Count to 0 on reload project xml - /// - [Test] - public void Count_DecrementOnRemove() - { - Project p = new Project(new Engine()); - p.AddNewUsingTaskFromAssemblyFile("TaskName", "AssemblyFile.dll"); - object o = p.EvaluatedProperties; - Assertion.AssertEquals(1, p.UsingTasks.Count); - p.LoadXml(TestData.ContentSimpleTools35); - Assertion.AssertEquals(0, p.UsingTasks.Count); - o = p.EvaluatedProperties; - Assertion.AssertEquals(0, p.UsingTasks.Count); - } - - /// - /// IsSynchronized Test - /// - [Test] - public void IsSynchronized() - { - Project p = new Project(new Engine()); - p.AddNewUsingTaskFromAssemblyFile("TaskName", "AssemblyFile.dll"); - Assertion.AssertEquals(false, p.UsingTasks.IsSynchronized); - } - - /// - /// SyncRoot Test, ensure that SyncRoot returns and we can take a lock on it. - /// - [Test] - public void SyncRoot() - { - Project p = new Project(new Engine()); - p.AddNewUsingTaskFromAssemblyFile("TaskName1", "AssemblyFile1.dll"); - p.AddNewUsingTaskFromAssemblyFile("TaskName2", "AssemblyFile2.dll"); - UsingTask[] usingTasks = new UsingTask[p.UsingTasks.Count]; - p.UsingTasks.CopyTo(usingTasks, 0); - lock (p.UsingTasks.SyncRoot) - { - int i = 0; - foreach (UsingTask usingTask in p.UsingTasks) - { - Assertion.AssertEquals(usingTasks[i].AssemblyFile, usingTask.AssemblyFile); - i++; - } - } - } - - /// - /// SyncRoot Test, copy into a strongly typed array and assert content against the source collection. - /// - [Test] - public void CopyTo_ZeroIndex() - { - Project p = new Project(new Engine()); - p.AddNewUsingTaskFromAssemblyFile("TaskName1", "AssemblyFile1.dll"); - p.AddNewUsingTaskFromAssemblyFile("TaskName2", "AssemblyFile2.dll"); - UsingTask[] usingTasks = new UsingTask[p.UsingTasks.Count]; - p.UsingTasks.CopyTo(usingTasks, 0); - int i = 0; - foreach (UsingTask usingTask in p.UsingTasks) - { - Assertion.AssertEquals(usingTasks[i].AssemblyFile, usingTask.AssemblyFile); - i++; - } - } - - /// - /// SyncRoot Test, copy into a strongly typed array and assert content against the source collection. - /// - [Test] - public void CopyTo_OffsetIndex() - { - int offSet = 3; - Project p = new Project(new Engine()); - p.AddNewUsingTaskFromAssemblyFile("TaskName1", "AssemblyFile1.dll"); - p.AddNewUsingTaskFromAssemblyFile("TaskName2", "AssemblyFile2.dll"); - UsingTask[] taskArray = new UsingTask[p.UsingTasks.Count + offSet]; - p.UsingTasks.CopyTo(taskArray, offSet); - int i = offSet - 1; - Assertion.AssertNull(taskArray[offSet - 1]); - foreach (UsingTask usingTask in p.UsingTasks) - { - Assertion.AssertEquals(taskArray[i].AssemblyFile, usingTask.AssemblyFile); - i++; - } - } - - /// - /// SyncRoot Test, copy into a strongly typed array with an offset where the array is too small - /// - [Test] - [ExpectedException(typeof(ArgumentException))] - public void CopyTo_OffsetIndexArrayTooSmall() - { - int offSet = 3; - Project p = new Project(new Engine()); - p.AddNewUsingTaskFromAssemblyFile("TaskName1", "AssemblyFile1.dll"); - p.AddNewUsingTaskFromAssemblyFile("TaskName2", "AssemblyFile2.dll"); - UsingTask[] usingTasks = new UsingTask[p.UsingTasks.Count]; - p.UsingTasks.CopyTo(usingTasks, offSet); - } - - /// - /// Copy to a weakly typed array, no offset. Itterate over collection - /// - [Test] - public void CopyTo_WeakAndGetEnumerator() - { - Project p = new Project(new Engine()); - p.AddNewUsingTaskFromAssemblyFile("TaskName1", "AssemblyFile1.dll"); - p.AddNewUsingTaskFromAssemblyFile("TaskName2", "AssemblyFile2.dll"); - Array taskArray = Array.CreateInstance(typeof(UsingTask), p.UsingTasks.Count); - p.UsingTasks.CopyTo(taskArray, 0); - Assertion.AssertEquals(p.UsingTasks.Count, taskArray.Length); - int i = 0; - foreach (UsingTask usingTask in p.UsingTasks) - { - Assertion.AssertEquals(((UsingTask)taskArray.GetValue(i)), usingTask.AssemblyFile); - i++; - } - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/Compatibility/UsingTask_Tests.cs b/src/Deprecated/Engine.UnitTests/Compatibility/UsingTask_Tests.cs deleted file mode 100644 index 1d3cc395fa9..00000000000 --- a/src/Deprecated/Engine.UnitTests/Compatibility/UsingTask_Tests.cs +++ /dev/null @@ -1,317 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.IO; -using System.Xml; -using System.Collections.Generic; - -using NUnit.Framework; - -using Microsoft.Build.BuildEngine; -using Microsoft.Build.Framework; -using Microsoft.Build.UnitTests; - -namespace Microsoft.Build.UnitTests.OM.OrcasCompatibility -{ - /// - /// Test Fixture Class for the v9 Object Model Public Interface Compatibility Tests for the UsingTask Class. - /// - [TestFixture] - public class UsingTask_Tests - { - #region AssemblyName - /// - /// AssemblyName test, set AssemblyName to a simple value in ctor then get. - /// - [Test] - public void GetAssemblyName() - { - Project p = new Project(new Engine()); - p.AddNewUsingTaskFromAssemblyName("TaskName", "AssemblyName"); - object o = p.EvaluatedItems; - Assertion.AssertEquals("AssemblyName", CompatibilityTestHelpers.FindUsingTaskByName("TaskName", p.UsingTasks).AssemblyName); - } - - /// - /// AssemblyName test, set AssemblyName to special escaped characters in ctor then get. - /// - [Test] - public void GetAssemblyNameSpecialCharsEscaped() - { - Project p = new Project(new Engine()); - p.AddNewUsingTaskFromAssemblyName("TaskName", @"%25%2a%3f%40%24%28%29%3b\"); - object o = p.EvaluatedItems; - Assertion.AssertEquals(@"%25%2a%3f%40%24%28%29%3b\", CompatibilityTestHelpers.FindUsingTaskByName("TaskName", p.UsingTasks).AssemblyName); - } - - /// - /// AssemblyName test, set AssemblyName to special non-escaped characters in ctor then get. - /// - [Test] - public void GetAssemblyNameSpecialChars() - { - Project p = new Project(); - p.AddNewUsingTaskFromAssemblyName("TaskName", @"%*?@$();\"); - object o = p.EvaluatedItems; - Assertion.AssertEquals(@"%*?@$();\", CompatibilityTestHelpers.FindUsingTaskByName("TaskName", p.UsingTasks).AssemblyName); - } - - /// - /// AssemblyName test,, set AssemblyName to a scalar that has no property defined in the project, then get. - /// - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void GetAssemblyNameScalarThatIsNotSet() - { - Project p = new Project(new Engine()); - p.AddNewUsingTaskFromAssemblyName("TaskName", @"$(assemblyName)"); - object o = p.EvaluatedItems; - Assertion.AssertEquals(@"$(assemblyName)", CompatibilityTestHelpers.FindUsingTaskByName("TaskName", p.UsingTasks).AssemblyName); - } - - /// - /// AssemblyName test, set AssemblyName to scalar that is defined in the project, then get. Does not evaluate - /// - [Test] - public void GetAssemblyNameScalarEvaluation() - { - string assemblyName = "$(assemblyName)"; - Project p = new Project(); - p.SetProperty("assemblyName", "aName"); - object o = p.EvaluatedItems; - p.AddNewUsingTaskFromAssemblyName("TaskName", assemblyName); - o = p.EvaluatedItems; - Assertion.AssertEquals(assemblyName, CompatibilityTestHelpers.FindUsingTaskByName("TaskName", p.UsingTasks).AssemblyName); - } - - #endregion - - #region AssemblyFile - /// - /// AssemblyFile test, simple set in ctor then get. - /// - [Test] - public void GetAssemblyFileName() - { - string assemblyFileName = "FileName.dll"; - Assertion.AssertNotNull(SetandGetAssemblyFileName(assemblyFileName)); - } - - /// - /// AssemblyFile test, set special escaped characters in ctor then get. - /// - [Test] - public void GetAssemblyFileNameSpecialCharsEscaped() - { - string assemblyFileName = @"%25%2a%3f%40%24%28%29%3b\"; - Assertion.AssertNotNull(SetandGetAssemblyFileName(assemblyFileName)); - } - - /// - /// AssemblyFile test, set special non-escaped characters in ctor then get. - /// - [Test] - public void GetAssemblyFileNameSpecialChars() - { - string assemblyFileName = @"%*?@$();\"; - Assertion.AssertNotNull(SetandGetAssemblyFileName(assemblyFileName)); - } - - /// - /// AssemblyFile test, set to a scalar that has no property defined in the project, then get. - /// - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void GetAssemblyFileNameScalarThatIsNotSet() - { - string assemblyFileName = "$(fileName)"; - Assertion.AssertNotNull(SetandGetAssemblyFileName(assemblyFileName)); - } - - /// - /// AssemblyFile test, set to scalar that is defined in the project, then get. Does Not Evaluate - /// - [Test] - public void GetAssemblyFileNameScalarEvaluation() - { - string assemblyFileName = "$(fileName)"; - Project p = new Project(new Engine()); - p.SetProperty("fileName", "aFileName"); - object o = p.EvaluatedItems; - p.AddNewUsingTaskFromAssemblyFile("TaskName", assemblyFileName); - o = p.EvaluatedItems; - Assertion.AssertEquals(assemblyFileName, CompatibilityTestHelpers.FindUsingTaskByName("TaskName", p.UsingTasks).AssemblyFile); - } - - /// - /// AssemblyFile Test, get assembly file name, where the path is is over windows max path - /// - [Test] - public void GetAssemblyFileNamePathTooLong() - { - string assemblyFileName = Path.Combine(CompatibilityTestHelpers.GenerateLongPath(255), "assemblyFileName.dll"); - Assertion.AssertEquals(assemblyFileName, SetandGetAssemblyFileName(assemblyFileName)); - } - - /// - /// Condition Test, get the usingtask conidtion when set in the xml - /// - [Test] - public void GetUsingTaskAssemblyFile_SetInXml() - { - Project p = new Project(new Engine()); - p.LoadXml(TestData.ContentUsingTaskFile); - object o = p.EvaluatedItems; - Assertion.AssertEquals("AssemblyName.dll", CompatibilityTestHelpers.FindUsingTaskByName("TaskName", p.UsingTasks).AssemblyFile); - } - - #endregion - - #region TaskName - - /// - /// TaskName Test, simple get - /// - [Test] - public void GetTaskName_SetInXml() - { - Project p = new Project(); - p.LoadXml(TestData.ContentUsingTaskFile); - object o = p.EvaluatedItems; - Assertion.AssertNotNull(CompatibilityTestHelpers.FindUsingTaskByName("TaskName", p.UsingTasks)); - } - - /// - /// TaskName Test, scalars are not evaluated - /// - [Test] - public void GetTaskNameScalar() - { - Project p = new Project(new Engine()); - p.AddNewUsingTaskFromAssemblyName("$(name)", "assemblyName"); - p.SetProperty("name", "TaskName"); - object o = p.EvaluatedItems; - Assertion.AssertNotNull(CompatibilityTestHelpers.FindUsingTaskByName("$(name)", p.UsingTasks)); - } - - /// - /// TaskName Test, scalars are not evaluated - /// - [Test] - public void GetTaskNameSpeicalChars() - { - Project p = new Project(); - p.AddNewUsingTaskFromAssemblyName(@"%*?@$();\", "assemblyName"); - object o = p.EvaluatedItems; - Assertion.AssertNotNull(CompatibilityTestHelpers.FindUsingTaskByName(@"%*?@$();\", p.UsingTasks)); - } - - /// - /// TaskName Test, scalars are not evaluated - /// - [Test] - public void GetTaskNameSpeicalCharsEscaped() - { - Project p = new Project(new Engine()); - p.AddNewUsingTaskFromAssemblyName(@"%25%2a%3f%40%24%28%29%3b\", "assemblyName"); - object o = p.EvaluatedItems; - Assertion.AssertNotNull(CompatibilityTestHelpers.FindUsingTaskByName(@"%25%2a%3f%40%24%28%29%3b\", p.UsingTasks)); - } - - #endregion - - #region IsImported - - /// - /// IsImported Test, assert true for an improted file. - /// - [Test] - public void IsImported_true() - { - string importPath = String.Empty; - try - { - importPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("import.proj", TestData.ContentUsingTaskName); - Project p = new Project(new Engine()); - p.AddNewImport(importPath, "true"); - Object o = p.EvaluatedProperties; - Import import = CompatibilityTestHelpers.FindFirstMatchingImportByPath(p.Imports, importPath); - import.Condition = null; - Assertion.AssertEquals(true, CompatibilityTestHelpers.FindUsingTaskByName("TaskName", p.UsingTasks).IsImported); - } - finally - { - CompatibilityTestHelpers.RemoveFile(importPath); - } - } - - /// - /// IsImported Test, assert true for an imported file. - /// - [Test] - public void IsImported_false() - { - Project p = new Project(new Engine()); - p.LoadXml(TestData.ContentUsingTaskFile); - object o = p.EvaluatedProperties; - Assertion.AssertEquals(false, CompatibilityTestHelpers.FindUsingTaskByName("TaskName", p.UsingTasks).IsImported); - } - - #endregion - - #region Condition - - /// - /// Condition Test, get condition when set in xml - /// - [Test] - public void GetConditionSimple() - { - Project p = new Project(); - p.LoadXml(TestData.ContentUsingTaskName); - object o = p.EvaluatedProperties; - Assertion.AssertEquals("true", CompatibilityTestHelpers.FindUsingTaskByName("TaskName", p.UsingTasks).Condition); - } - - /// - /// Condition Test, get when conditionis an expression - /// - [Test] - public void GetConditionExpression() - { - Project p = new Project(); - p.LoadXml(TestData.ContentUsingTaskFile); - Assertion.AssertEquals("$(value)==true", CompatibilityTestHelpers.FindUsingTaskByName("TaskName", p.UsingTasks).Condition); - } - - /// - /// Condition Test, get condition in OM when set in xml - /// - [Test] - public void GetUsingTaskCondition_SetInXml() - { - Project p = new Project(); - p.LoadXml(TestData.ContentUsingTaskName); - Assertion.AssertEquals("true", CompatibilityTestHelpers.FindUsingTaskByName("TaskName", p.UsingTasks).Condition); - } - - #endregion - - /// - /// Set an assembly file name, then retrieve it. - /// - private string SetandGetAssemblyFileName(string assemblyFileName) - { - Project p = new Project(); - p.AddNewUsingTaskFromAssemblyFile("TaskName", assemblyFileName); - object o = p.EvaluatedItems; - UsingTask usingTask = CompatibilityTestHelpers.FindUsingTaskByName("TaskName", p.UsingTasks); - return usingTask.AssemblyFile; - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/ConfigureableForwardingLogger_Tests.cs b/src/Deprecated/Engine.UnitTests/ConfigureableForwardingLogger_Tests.cs deleted file mode 100644 index 50fae87fea3..00000000000 --- a/src/Deprecated/Engine.UnitTests/ConfigureableForwardingLogger_Tests.cs +++ /dev/null @@ -1,234 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections.Generic; -using System.Text; - -using NUnit.Framework; -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine; - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class ConfigureableForwardingLogger_Tests - { - private BuildFinishedEventArgs buildFinished = new BuildFinishedEventArgs("Message", "Keyword", true); - private BuildStartedEventArgs buildStarted = new BuildStartedEventArgs("Message", "Help"); - private BuildMessageEventArgs lowMessage = new BuildMessageEventArgs("Message", "help", "sender", MessageImportance.Low); - private BuildMessageEventArgs normalMessage = new BuildMessageEventArgs("Message2", "help", "sender", MessageImportance.Normal); - private BuildMessageEventArgs highMessage = new BuildMessageEventArgs("Message3", "help", "sender", MessageImportance.High); - private TaskStartedEventArgs taskStarted = new TaskStartedEventArgs("message", "help", "projectFile", "taskFile", "taskName"); - private TaskFinishedEventArgs taskFinished = new TaskFinishedEventArgs("message", "help", "projectFile", "taskFile", "taskName", true); - private TaskCommandLineEventArgs commandLine = new TaskCommandLineEventArgs("commandLine", "taskName", MessageImportance.Low); - private BuildWarningEventArgs warning = new BuildWarningEventArgs("SubCategoryForSchemaValidationErrors", "MSB4000", "file", 1, 2, 3, 4, "message", "help", "sender"); - private BuildErrorEventArgs error = new BuildErrorEventArgs("SubCategoryForSchemaValidationErrors", "MSB4000", "file", 1, 2, 3, 4, "message", "help", "sender"); - private TargetStartedEventArgs targetStarted = new TargetStartedEventArgs("message", "help", "targetName", "ProjectFile", "targetFile"); - private TargetFinishedEventArgs targetFinished = new TargetFinishedEventArgs("message", "help", "targetName", "ProjectFile", "targetFile", true); - private ProjectStartedEventArgs projectStarted = new ProjectStartedEventArgs(-1, "message", "help", "ProjectFile", "targetNames", null, null, null); - private ProjectFinishedEventArgs projectFinished = new ProjectFinishedEventArgs("message", "help", "ProjectFile", true); - private ExternalProjectStartedEventArgs externalStartedEvent = new ExternalProjectStartedEventArgs("message", "help", "senderName", "projectFile", "targetNames"); - - internal class TestForwardingLogger : ConfigurableForwardingLogger - { - internal TestForwardingLogger() - { - forwardedEvents = new List(); - } - internal List forwardedEvents; - protected override void ForwardToCentralLogger(BuildEventArgs e) - { - forwardedEvents.Add(e); - } - } - - [TestFixtureSetUp] - public void FixtureSetup() - { - BuildEventContext context = new BuildEventContext(1, 2, 3, 4); - error.BuildEventContext = context; - warning.BuildEventContext = context; - targetStarted.BuildEventContext = context; - targetFinished.BuildEventContext = context; - } - - [Test] - public void ForwardingLoggingEventsBasedOnVerbosity() - { - - EventSource source = new EventSource(); - TestForwardingLogger logger = new TestForwardingLogger(); - logger.BuildEventRedirector = null; - logger.Parameters = "BUILDSTARTEDEVENT"; - logger.Initialize(source, 4); - RaiseEvents(source); - Assert.IsTrue(logger.forwardedEvents.Count == 1); - - logger = new TestForwardingLogger(); - logger.BuildEventRedirector = null; - logger.Verbosity = LoggerVerbosity.Quiet; - logger.Initialize(source, 4); - RaiseEvents(source); - Assert.IsTrue(logger.forwardedEvents.Count == 2); - Assert.IsTrue(logger.forwardedEvents.Contains(error)); - Assert.IsTrue(logger.forwardedEvents.Contains(warning)); - - logger = new TestForwardingLogger(); - logger.BuildEventRedirector = null; - logger.Verbosity = LoggerVerbosity.Minimal; - logger.Initialize(source, 4); - RaiseEvents(source); - Assert.IsTrue(logger.forwardedEvents.Count == 3); - Assert.IsTrue(logger.forwardedEvents.Contains(error)); - Assert.IsTrue(logger.forwardedEvents.Contains(warning)); - Assert.IsTrue(logger.forwardedEvents.Contains(highMessage)); - - logger = new TestForwardingLogger(); - logger.BuildEventRedirector = null; - logger.Verbosity = LoggerVerbosity.Normal; - logger.Initialize(source, 4); - RaiseEvents(source); - Assert.IsTrue(logger.forwardedEvents.Count == 8); - Assert.IsTrue(logger.forwardedEvents.Contains(error)); - Assert.IsTrue(logger.forwardedEvents.Contains(warning)); - Assert.IsTrue(logger.forwardedEvents.Contains(highMessage)); - Assert.IsTrue(logger.forwardedEvents.Contains(normalMessage)); - Assert.IsTrue(logger.forwardedEvents.Contains(projectStarted)); - Assert.IsTrue(logger.forwardedEvents.Contains(projectFinished)); - Assert.IsTrue(logger.forwardedEvents.Contains(targetStarted)); - Assert.IsTrue(logger.forwardedEvents.Contains(targetFinished)); - - logger = new TestForwardingLogger(); - logger.BuildEventRedirector = null; - logger.Verbosity = LoggerVerbosity.Detailed; - logger.Initialize(source, 4); - RaiseEvents(source); - Assert.IsTrue(logger.forwardedEvents.Count == 12); - Assert.IsTrue(logger.forwardedEvents.Contains(error)); - Assert.IsTrue(logger.forwardedEvents.Contains(warning)); - Assert.IsTrue(logger.forwardedEvents.Contains(highMessage)); - Assert.IsTrue(logger.forwardedEvents.Contains(lowMessage)); - Assert.IsTrue(logger.forwardedEvents.Contains(normalMessage)); - Assert.IsTrue(logger.forwardedEvents.Contains(projectStarted)); - Assert.IsTrue(logger.forwardedEvents.Contains(projectFinished)); - Assert.IsTrue(logger.forwardedEvents.Contains(targetStarted)); - Assert.IsTrue(logger.forwardedEvents.Contains(targetFinished)); - Assert.IsTrue(logger.forwardedEvents.Contains(taskStarted)); - Assert.IsTrue(logger.forwardedEvents.Contains(taskFinished)); - Assert.IsTrue(logger.forwardedEvents.Contains(commandLine)); - - logger = new TestForwardingLogger(); - logger.BuildEventRedirector = null; - logger.Verbosity = LoggerVerbosity.Diagnostic; - logger.Initialize(source, 4); - RaiseEvents(source); - Assert.IsTrue(logger.forwardedEvents.Count == 13); - Assert.IsTrue(logger.forwardedEvents.Contains(error)); - Assert.IsTrue(logger.forwardedEvents.Contains(warning)); - Assert.IsTrue(logger.forwardedEvents.Contains(highMessage)); - Assert.IsTrue(logger.forwardedEvents.Contains(lowMessage)); - Assert.IsTrue(logger.forwardedEvents.Contains(normalMessage)); - Assert.IsTrue(logger.forwardedEvents.Contains(projectStarted)); - Assert.IsTrue(logger.forwardedEvents.Contains(projectFinished)); - Assert.IsTrue(logger.forwardedEvents.Contains(targetStarted)); - Assert.IsTrue(logger.forwardedEvents.Contains(targetFinished)); - Assert.IsTrue(logger.forwardedEvents.Contains(taskStarted)); - Assert.IsTrue(logger.forwardedEvents.Contains(taskFinished)); - Assert.IsTrue(logger.forwardedEvents.Contains(externalStartedEvent)); - Assert.IsTrue(logger.forwardedEvents.Contains(commandLine)); - } - - [Test] - public void ForwardingLoggingPerformanceSummary() - { - - EventSource source = new EventSource(); - TestForwardingLogger logger = new TestForwardingLogger(); - logger.BuildEventRedirector = null; - logger.Parameters = "PERFORMANCESUMMARY"; - logger.Verbosity = LoggerVerbosity.Quiet; - logger.Initialize(source, 4); - RaiseEvents(source); - Assert.IsTrue(logger.forwardedEvents.Count == 8); - Assert.IsTrue(logger.forwardedEvents.Contains(error)); - Assert.IsTrue(logger.forwardedEvents.Contains(warning)); - Assert.IsTrue(logger.forwardedEvents.Contains(projectStarted)); - Assert.IsTrue(logger.forwardedEvents.Contains(projectFinished)); - Assert.IsTrue(logger.forwardedEvents.Contains(targetStarted)); - Assert.IsTrue(logger.forwardedEvents.Contains(targetFinished)); - Assert.IsTrue(logger.forwardedEvents.Contains(taskStarted)); - Assert.IsTrue(logger.forwardedEvents.Contains(taskFinished)); - - } - - [Test] - public void ForwardingLoggingNoSummary() - { - - EventSource source = new EventSource(); - TestForwardingLogger logger = new TestForwardingLogger(); - logger.BuildEventRedirector = null; - logger.Verbosity = LoggerVerbosity.Normal; - logger.Parameters = "NOSUMMARY"; - logger.Initialize(source, 4); - RaiseEvents(source); - Assert.IsTrue(logger.forwardedEvents.Count == 8); - Assert.IsTrue(logger.forwardedEvents.Contains(error)); - Assert.IsTrue(logger.forwardedEvents.Contains(warning)); - Assert.IsTrue(logger.forwardedEvents.Contains(highMessage)); - Assert.IsTrue(logger.forwardedEvents.Contains(normalMessage)); - Assert.IsTrue(logger.forwardedEvents.Contains(projectStarted)); - Assert.IsTrue(logger.forwardedEvents.Contains(projectFinished)); - Assert.IsTrue(logger.forwardedEvents.Contains(targetStarted)); - Assert.IsTrue(logger.forwardedEvents.Contains(targetFinished)); - } - - [Test] - public void ForwardingLoggingShowCommandLine() - { - - EventSource source = new EventSource(); - TestForwardingLogger logger = new TestForwardingLogger(); - logger.BuildEventRedirector = null; - logger.Verbosity = LoggerVerbosity.Normal; - logger.Parameters = "SHOWCOMMANDLINE"; - logger.Initialize(source, 4); - RaiseEvents(source); - Assert.IsTrue(logger.forwardedEvents.Count == 9); - Assert.IsTrue(logger.forwardedEvents.Contains(error)); - Assert.IsTrue(logger.forwardedEvents.Contains(warning)); - Assert.IsTrue(logger.forwardedEvents.Contains(highMessage)); - Assert.IsTrue(logger.forwardedEvents.Contains(normalMessage)); - Assert.IsTrue(logger.forwardedEvents.Contains(projectStarted)); - Assert.IsTrue(logger.forwardedEvents.Contains(projectFinished)); - Assert.IsTrue(logger.forwardedEvents.Contains(targetStarted)); - Assert.IsTrue(logger.forwardedEvents.Contains(targetFinished)); - Assert.IsTrue(logger.forwardedEvents.Contains(commandLine)); - } - - private void RaiseEvents(EventSource source) - { - source.RaiseBuildStartedEvent(null, buildStarted); - source.RaiseProjectStartedEvent(null, projectStarted); - source.RaiseTargetStartedEvent(null, targetStarted); - source.RaiseTaskStartedEvent(null, taskStarted); - source.RaiseMessageEvent(null, lowMessage); - source.RaiseMessageEvent(null, normalMessage); - source.RaiseMessageEvent(null, highMessage); - source.RaiseMessageEvent(null, commandLine); - source.RaiseCustomEvent(null, externalStartedEvent); - source.RaiseWarningEvent(null, warning); - source.RaiseErrorEvent(null, error); - source.RaiseTaskFinishedEvent(null, taskFinished); - source.RaiseTargetFinishedEvent(null, targetFinished); - source.RaiseProjectFinishedEvent(null, projectFinished); - source.RaiseBuildFinishedEvent(null, buildFinished); - } - - } -} diff --git a/src/Deprecated/Engine.UnitTests/ConsoleLogger_Tests.cs b/src/Deprecated/Engine.UnitTests/ConsoleLogger_Tests.cs deleted file mode 100644 index 1950b531777..00000000000 --- a/src/Deprecated/Engine.UnitTests/ConsoleLogger_Tests.cs +++ /dev/null @@ -1,2238 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Text; -using System.IO; -using System.Reflection; -using System.Collections; -using System.Globalization; - -using NUnit.Framework; - -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class ConsoleLoggerTest - { - private class SimulatedConsole - { - private StringBuilder simulatedConsole; - - internal SimulatedConsole() - { - simulatedConsole = new StringBuilder(); - } - - internal void Clear() - { - simulatedConsole = new StringBuilder(); - } - - public override string ToString() - { - return simulatedConsole.ToString(); - } - - internal void Write(string s) - { - simulatedConsole.Append(s); - } - - internal void WriteLine(string s) - { - Write(s); - Write(Environment.NewLine); - } - - internal void SetColor(ConsoleColor c) - { - switch(c) - { - case ConsoleColor.Red: - simulatedConsole.Append(""); - break; - - case ConsoleColor.Yellow: - simulatedConsole.Append(""); - break; - - case ConsoleColor.Cyan: - simulatedConsole.Append(""); - break; - - case ConsoleColor.DarkGray: - simulatedConsole.Append(""); - break; - - case ConsoleColor.Green: - simulatedConsole.Append(""); - break; - - default: - simulatedConsole.Append(""); - break; - } - } - - internal void ResetColor() - { - simulatedConsole.Append(""); - } - - public static implicit operator string(SimulatedConsole sc) - { - return sc.ToString(); - } - } - - private static void SingleMessageTest(LoggerVerbosity v, MessageImportance j, bool shouldPrint) - { - for (int i = 1; i <= 2; i++) - { - SimulatedConsole sc = new SimulatedConsole(); - EventSource es = new EventSource(); - ConsoleLogger L = new ConsoleLogger(v, - sc.Write, null, null); - L.Initialize(es, i); - string msg = "my 1337 message"; - - BuildMessageEventArgs be = new BuildMessageEventArgs(msg, "help", "sender", j); - be.BuildEventContext = new BuildEventContext(1, 2, 3, 4); - es.RaiseMessageEvent(null, be); - - if (i == 2 && v == LoggerVerbosity.Diagnostic) - { - string context =ResourceUtilities.FormatResourceString("BuildEventContext", LogFormatter.FormatLogTimeStamp(be.Timestamp), 0) + ">"; - msg = context + ResourceUtilities.FormatResourceString("TaskMessageWithId", "my 1337 message", be.BuildEventContext.TaskId); - } - else if (i == 2 && v == LoggerVerbosity.Detailed) - { - string context = ResourceUtilities.FormatResourceString("BuildEventContext", string.Empty, 0) + ">"; - msg = context + "my 1337 message"; - } - else if (i == 2) - { - msg = " " + msg; - } - - Assertion.AssertEquals(shouldPrint ? msg + Environment.NewLine : String.Empty, sc.ToString()); - } - } - - private sealed class MyCustomBuildEventArgs : CustomBuildEventArgs - { - internal MyCustomBuildEventArgs() - : base() - { - // do nothing - } - - internal MyCustomBuildEventArgs(string message) - : base(message, null, null) - { - // do nothing - } - } - - class MyCustomBuildEventArgs2 : CustomBuildEventArgs { } - - /// - /// We should not crash when given a null message, etc. - /// - [Test] - public void NullEventFields() - { - EventSource es = new EventSource(); - SimulatedConsole sc = new SimulatedConsole(); - ConsoleLogger L = new ConsoleLogger(LoggerVerbosity.Diagnostic, - sc.Write, sc.SetColor, - sc.ResetColor); - L.Initialize(es); - - // Not all parameters are null here, but that's fine, we assume the engine will never - // fire a ProjectStarted without a project name, etc. - es.RaiseBuildStartedEvent(null, new BuildStartedEventArgs(null, null)); - es.RaiseProjectStartedEvent(null, new ProjectStartedEventArgs(null, null, "p", null, null, null)); - es.RaiseTargetStartedEvent(null, new TargetStartedEventArgs(null, null, "t", null, null)); - es.RaiseTaskStartedEvent(null, new TaskStartedEventArgs(null, null, null, null, "task")); - es.RaiseMessageEvent(null, new BuildMessageEventArgs(null, null, null, MessageImportance.High)); - es.RaiseWarningEvent(null, new BuildWarningEventArgs(null, null, null, 0, 0, 0, 0, null, null, null)); - es.RaiseErrorEvent(null, new BuildErrorEventArgs(null, null, null, 0, 0, 0, 0, null, null, null)); - es.RaiseTaskFinishedEvent(null, new TaskFinishedEventArgs(null, null, null, null, "task", true)); - es.RaiseTargetFinishedEvent(null, new TargetFinishedEventArgs(null, null, "t", null, null, true)); - es.RaiseProjectFinishedEvent(null, new ProjectFinishedEventArgs(null, null, "p", true)); - es.RaiseBuildFinishedEvent(null, new BuildFinishedEventArgs(null, null, true)); - es.RaiseAnyEvent(null, new BuildFinishedEventArgs(null, null, true)); - es.RaiseStatusEvent(null, new BuildFinishedEventArgs(null, null, true)); - es.RaiseCustomEvent(null, new MyCustomBuildEventArgs2()); - // No exception raised - } - - [Test] - public void NullEventFieldsParallel() - { - EventSource es = new EventSource(); - SimulatedConsole sc = new SimulatedConsole(); - ConsoleLogger L = new ConsoleLogger(LoggerVerbosity.Diagnostic, - sc.Write, sc.SetColor, - sc.ResetColor); - L.Initialize(es, 2); - BuildEventContext buildEventContext = new BuildEventContext(1, 2, 3, 4); - - BuildStartedEventArgs bse = new BuildStartedEventArgs(null, null); - bse.BuildEventContext = buildEventContext; - ProjectStartedEventArgs pse = new ProjectStartedEventArgs(-1, null, null, "p", null, null, null, buildEventContext); - pse.BuildEventContext = buildEventContext; - TargetStartedEventArgs trse = new TargetStartedEventArgs(null, null, "t", null, null); - trse.BuildEventContext = buildEventContext; - TaskStartedEventArgs tase = new TaskStartedEventArgs(null, null, null, null, "task"); - tase.BuildEventContext = buildEventContext; - BuildMessageEventArgs bmea = new BuildMessageEventArgs(null, null, null, MessageImportance.High); - bmea.BuildEventContext = buildEventContext; - BuildWarningEventArgs bwea = new BuildWarningEventArgs(null, null, null, 0, 0, 0, 0, null, null, null); - bwea.BuildEventContext = buildEventContext; - BuildErrorEventArgs beea = new BuildErrorEventArgs(null, null, null, 0, 0, 0, 0, null, null, null); - beea.BuildEventContext = buildEventContext; - TaskFinishedEventArgs trfea = new TaskFinishedEventArgs(null, null, null, null, "task", true); - trfea.BuildEventContext = buildEventContext; - TargetFinishedEventArgs tafea = new TargetFinishedEventArgs(null, null, "t", null, null, true); - tafea.BuildEventContext = buildEventContext; - ProjectFinishedEventArgs pfea = new ProjectFinishedEventArgs(null, null, "p", true); - pfea.BuildEventContext = buildEventContext; - BuildFinishedEventArgs bfea = new BuildFinishedEventArgs(null, null, true); - bfea.BuildEventContext = buildEventContext; - MyCustomBuildEventArgs2 mcea = new MyCustomBuildEventArgs2(); - mcea.BuildEventContext = buildEventContext; - - - // Not all parameters are null here, but that's fine, we assume the engine will never - // fire a ProjectStarted without a project name, etc. - es.RaiseBuildStartedEvent(null, bse); - es.RaiseProjectStartedEvent(null, pse); - es.RaiseTargetStartedEvent(null, trse); - es.RaiseTaskStartedEvent(null, tase); - es.RaiseMessageEvent(null, bmea); - es.RaiseWarningEvent(null, bwea); - es.RaiseErrorEvent(null, beea); - es.RaiseTaskFinishedEvent(null, trfea); - es.RaiseTargetFinishedEvent(null, tafea); - es.RaiseProjectFinishedEvent(null, pfea); - es.RaiseBuildFinishedEvent(null, bfea); - es.RaiseAnyEvent(null, bfea); - es.RaiseStatusEvent(null, bfea); - es.RaiseCustomEvent(null, mcea); - // No exception raised - } - - [Test] - public void TestVerbosityLessThan() - { - Assertion.AssertEquals( true, - (new SerialConsoleLogger(LoggerVerbosity.Quiet)).IsVerbosityAtLeast(LoggerVerbosity.Quiet)); - Assertion.AssertEquals( false, - (new SerialConsoleLogger(LoggerVerbosity.Quiet)).IsVerbosityAtLeast(LoggerVerbosity.Minimal)); - Assertion.AssertEquals( false, - (new SerialConsoleLogger(LoggerVerbosity.Quiet)).IsVerbosityAtLeast(LoggerVerbosity.Normal)); - Assertion.AssertEquals( false, - (new SerialConsoleLogger(LoggerVerbosity.Quiet)).IsVerbosityAtLeast(LoggerVerbosity.Detailed)); - Assertion.AssertEquals( false, - (new SerialConsoleLogger(LoggerVerbosity.Quiet)).IsVerbosityAtLeast(LoggerVerbosity.Diagnostic)); - - Assertion.AssertEquals( true, - (new SerialConsoleLogger(LoggerVerbosity.Minimal)).IsVerbosityAtLeast(LoggerVerbosity.Quiet)); - Assertion.AssertEquals( true, - (new SerialConsoleLogger(LoggerVerbosity.Minimal)).IsVerbosityAtLeast(LoggerVerbosity.Minimal)); - Assertion.AssertEquals( false, - (new SerialConsoleLogger(LoggerVerbosity.Minimal)).IsVerbosityAtLeast(LoggerVerbosity.Normal)); - Assertion.AssertEquals( false, - (new SerialConsoleLogger(LoggerVerbosity.Minimal)).IsVerbosityAtLeast(LoggerVerbosity.Detailed)); - Assertion.AssertEquals( false, - (new SerialConsoleLogger(LoggerVerbosity.Minimal)).IsVerbosityAtLeast(LoggerVerbosity.Diagnostic)); - - Assertion.AssertEquals( true, - (new SerialConsoleLogger(LoggerVerbosity.Normal)).IsVerbosityAtLeast(LoggerVerbosity.Quiet)); - Assertion.AssertEquals( true, - (new SerialConsoleLogger(LoggerVerbosity.Normal)).IsVerbosityAtLeast(LoggerVerbosity.Minimal)); - Assertion.AssertEquals( true, - (new SerialConsoleLogger(LoggerVerbosity.Normal)).IsVerbosityAtLeast(LoggerVerbosity.Normal)); - Assertion.AssertEquals( false, - (new SerialConsoleLogger(LoggerVerbosity.Normal)).IsVerbosityAtLeast(LoggerVerbosity.Detailed)); - Assertion.AssertEquals( false, - (new SerialConsoleLogger(LoggerVerbosity.Normal)).IsVerbosityAtLeast(LoggerVerbosity.Diagnostic)); - - Assertion.AssertEquals( true, - (new SerialConsoleLogger(LoggerVerbosity.Detailed)).IsVerbosityAtLeast(LoggerVerbosity.Quiet)); - Assertion.AssertEquals( true, - (new SerialConsoleLogger(LoggerVerbosity.Detailed)).IsVerbosityAtLeast(LoggerVerbosity.Minimal)); - Assertion.AssertEquals( true, - (new SerialConsoleLogger(LoggerVerbosity.Detailed)).IsVerbosityAtLeast(LoggerVerbosity.Normal)); - Assertion.AssertEquals( true, - (new SerialConsoleLogger(LoggerVerbosity.Detailed)).IsVerbosityAtLeast(LoggerVerbosity.Detailed)); - Assertion.AssertEquals( false, - (new SerialConsoleLogger(LoggerVerbosity.Detailed)).IsVerbosityAtLeast(LoggerVerbosity.Diagnostic)); - - Assertion.AssertEquals( true, - (new SerialConsoleLogger(LoggerVerbosity.Diagnostic)).IsVerbosityAtLeast(LoggerVerbosity.Quiet)); - Assertion.AssertEquals( true, - (new SerialConsoleLogger(LoggerVerbosity.Diagnostic)).IsVerbosityAtLeast(LoggerVerbosity.Minimal)); - Assertion.AssertEquals( true, - (new SerialConsoleLogger(LoggerVerbosity.Diagnostic)).IsVerbosityAtLeast(LoggerVerbosity.Normal)); - Assertion.AssertEquals( true, - (new SerialConsoleLogger(LoggerVerbosity.Diagnostic)).IsVerbosityAtLeast(LoggerVerbosity.Detailed)); - Assertion.AssertEquals( true, - (new SerialConsoleLogger(LoggerVerbosity.Diagnostic)).IsVerbosityAtLeast(LoggerVerbosity.Diagnostic)); - - Assertion.AssertEquals(true, - (new ParallelConsoleLogger(LoggerVerbosity.Quiet)).IsVerbosityAtLeast(LoggerVerbosity.Quiet)); - Assertion.AssertEquals(false, - (new ParallelConsoleLogger(LoggerVerbosity.Quiet)).IsVerbosityAtLeast(LoggerVerbosity.Minimal)); - Assertion.AssertEquals(false, - (new ParallelConsoleLogger(LoggerVerbosity.Quiet)).IsVerbosityAtLeast(LoggerVerbosity.Normal)); - Assertion.AssertEquals(false, - (new ParallelConsoleLogger(LoggerVerbosity.Quiet)).IsVerbosityAtLeast(LoggerVerbosity.Detailed)); - Assertion.AssertEquals(false, - (new ParallelConsoleLogger(LoggerVerbosity.Quiet)).IsVerbosityAtLeast(LoggerVerbosity.Diagnostic)); - - Assertion.AssertEquals(true, - (new ParallelConsoleLogger(LoggerVerbosity.Minimal)).IsVerbosityAtLeast(LoggerVerbosity.Quiet)); - Assertion.AssertEquals(true, - (new ParallelConsoleLogger(LoggerVerbosity.Minimal)).IsVerbosityAtLeast(LoggerVerbosity.Minimal)); - Assertion.AssertEquals(false, - (new ParallelConsoleLogger(LoggerVerbosity.Minimal)).IsVerbosityAtLeast(LoggerVerbosity.Normal)); - Assertion.AssertEquals(false, - (new ParallelConsoleLogger(LoggerVerbosity.Minimal)).IsVerbosityAtLeast(LoggerVerbosity.Detailed)); - Assertion.AssertEquals(false, - (new ParallelConsoleLogger(LoggerVerbosity.Minimal)).IsVerbosityAtLeast(LoggerVerbosity.Diagnostic)); - - Assertion.AssertEquals(true, - (new ParallelConsoleLogger(LoggerVerbosity.Normal)).IsVerbosityAtLeast(LoggerVerbosity.Quiet)); - Assertion.AssertEquals(true, - (new ParallelConsoleLogger(LoggerVerbosity.Normal)).IsVerbosityAtLeast(LoggerVerbosity.Minimal)); - Assertion.AssertEquals(true, - (new ParallelConsoleLogger(LoggerVerbosity.Normal)).IsVerbosityAtLeast(LoggerVerbosity.Normal)); - Assertion.AssertEquals(false, - (new ParallelConsoleLogger(LoggerVerbosity.Normal)).IsVerbosityAtLeast(LoggerVerbosity.Detailed)); - Assertion.AssertEquals(false, - (new ParallelConsoleLogger(LoggerVerbosity.Normal)).IsVerbosityAtLeast(LoggerVerbosity.Diagnostic)); - - Assertion.AssertEquals(true, - (new ParallelConsoleLogger(LoggerVerbosity.Detailed)).IsVerbosityAtLeast(LoggerVerbosity.Quiet)); - Assertion.AssertEquals(true, - (new ParallelConsoleLogger(LoggerVerbosity.Detailed)).IsVerbosityAtLeast(LoggerVerbosity.Minimal)); - Assertion.AssertEquals(true, - (new ParallelConsoleLogger(LoggerVerbosity.Detailed)).IsVerbosityAtLeast(LoggerVerbosity.Normal)); - Assertion.AssertEquals(true, - (new ParallelConsoleLogger(LoggerVerbosity.Detailed)).IsVerbosityAtLeast(LoggerVerbosity.Detailed)); - Assertion.AssertEquals(false, - (new ParallelConsoleLogger(LoggerVerbosity.Detailed)).IsVerbosityAtLeast(LoggerVerbosity.Diagnostic)); - - Assertion.AssertEquals(true, - (new ParallelConsoleLogger(LoggerVerbosity.Diagnostic)).IsVerbosityAtLeast(LoggerVerbosity.Quiet)); - Assertion.AssertEquals(true, - (new ParallelConsoleLogger(LoggerVerbosity.Diagnostic)).IsVerbosityAtLeast(LoggerVerbosity.Minimal)); - Assertion.AssertEquals(true, - (new ParallelConsoleLogger(LoggerVerbosity.Diagnostic)).IsVerbosityAtLeast(LoggerVerbosity.Normal)); - Assertion.AssertEquals(true, - (new ParallelConsoleLogger(LoggerVerbosity.Diagnostic)).IsVerbosityAtLeast(LoggerVerbosity.Detailed)); - Assertion.AssertEquals(true, - (new ParallelConsoleLogger(LoggerVerbosity.Diagnostic)).IsVerbosityAtLeast(LoggerVerbosity.Diagnostic)); - } - - /// - /// Test of single message printing - /// - /// t-jeffv - [Test] - public void SingleMessageTests_quiet_low() - { - SingleMessageTest(LoggerVerbosity.Quiet, - MessageImportance.Low, false); - } - - [Test] - public void SingleMessageTests_quiet_medium() - { - SingleMessageTest(LoggerVerbosity.Quiet, - MessageImportance.Normal, false); - } - - [Test] - public void SingleMessageTests_quiet_high() - { - SingleMessageTest(LoggerVerbosity.Quiet, - MessageImportance.High, false); - } - - [Test] - public void SingleMessageTests_medium_low() - { - SingleMessageTest(LoggerVerbosity.Minimal, - MessageImportance.Low, false); - } - - [Test] - public void SingleMessageTests_medium_medium() - { - SingleMessageTest(LoggerVerbosity.Minimal, - MessageImportance.Normal, false); - } - - [Test] - public void SingleMessageTests_medium_high() - { - SingleMessageTest(LoggerVerbosity.Minimal, - MessageImportance.High, true); - } - - [Test] - public void SingleMessageTests_normal_low() - { - SingleMessageTest(LoggerVerbosity.Normal, - MessageImportance.Low, false); - } - - [Test] - public void SingleMessageTests_normal_medium() - { - SingleMessageTest(LoggerVerbosity.Normal, - MessageImportance.Normal, true); - } - - [Test] - public void SingleMessageTests_normal_high() - { - SingleMessageTest(LoggerVerbosity.Normal, - MessageImportance.High, true); - } - - [Test] - public void SingleMessageTests_detailed_low() - { - SingleMessageTest(LoggerVerbosity.Detailed, - MessageImportance.Low, true); - } - - [Test] - public void SingleMessageTests_detailed_medium() - { - SingleMessageTest(LoggerVerbosity.Detailed, - MessageImportance.Normal, true); - } - - [Test] - public void SingleMessageTests_detailed_high() - { - SingleMessageTest(LoggerVerbosity.Detailed, - MessageImportance.High, true); - } - - [Test] - public void SingleMessageTests_diagnostic_low() - { - SingleMessageTest(LoggerVerbosity.Diagnostic, - MessageImportance.Low, true); - } - - [Test] - public void SingleMessageTests_diagnostic_medium() - { - SingleMessageTest(LoggerVerbosity.Diagnostic, - MessageImportance.Normal, true); - } - - [Test] - public void SingleMessageTests_diagnostic_high() - { - SingleMessageTest(LoggerVerbosity.Diagnostic, - MessageImportance.High, true); - } - - [Test] - public void ErrorColorTest() - { - EventSource es = new EventSource(); - SimulatedConsole sc = new SimulatedConsole(); - - ConsoleLogger L = new ConsoleLogger(LoggerVerbosity.Quiet, sc.Write, sc.SetColor, sc.ResetColor); - L.Initialize(es); - - BuildErrorEventArgs beea = new BuildErrorEventArgs("VBC", "31415", "file.vb", 42, 0, 0, 0, "Some long message", "help", "sender"); - es.RaiseErrorEvent(null, beea); - Assertion.AssertEquals("file.vb(42): VBC error 31415: Some long message" + Environment.NewLine + "", sc.ToString()); - } - - [Test] - public void ErrorColorTestParallel() - { - EventSource es = new EventSource(); - SimulatedConsole sc = new SimulatedConsole(); - - ConsoleLogger L = new ConsoleLogger(LoggerVerbosity.Quiet, - sc.Write, sc.SetColor, - sc.ResetColor); - L.Initialize(es, 4); - - BuildErrorEventArgs beea = new BuildErrorEventArgs("VBC", - "31415", "file.vb", 42, 0, 0, 0, - "Some long message", "help", "sender"); - - beea.BuildEventContext = new BuildEventContext(1, 2, 3, 4); - - es.RaiseErrorEvent(null, beea); - - Assertion.AssertEquals( - "file.vb(42): VBC error 31415: Some long message" + - Environment.NewLine +"", - sc.ToString()); - } - - [Test] - public void WarningColorTest() - { - EventSource es = new EventSource(); - SimulatedConsole sc = new SimulatedConsole(); - ConsoleLogger L = new ConsoleLogger(LoggerVerbosity.Quiet, - sc.Write, sc.SetColor, - sc.ResetColor); - L.Initialize(es); - - BuildWarningEventArgs bwea = new BuildWarningEventArgs("VBC", - "31415", "file.vb", 42, 0, 0, 0, - "Some long message", "help", "sender"); - - es.RaiseWarningEvent(null, bwea); - - Assertion.AssertEquals( - "file.vb(42): VBC warning 31415: Some long message" + - Environment.NewLine + "", - sc.ToString()); - } - - [Test] - public void WarningColorTestParallel() - { - EventSource es = new EventSource(); - SimulatedConsole sc = new SimulatedConsole(); - ConsoleLogger L = new ConsoleLogger(LoggerVerbosity.Quiet, - sc.Write, sc.SetColor, - sc.ResetColor); - L.Initialize(es, 2); - - BuildWarningEventArgs bwea = new BuildWarningEventArgs("VBC", - "31415", "file.vb", 42, 0, 0, 0, - "Some long message", "help", "sender"); - - bwea.BuildEventContext = new BuildEventContext(1, 2, 3, 4); - es.RaiseWarningEvent(null, bwea); - - Assertion.AssertEquals( - "file.vb(42): VBC warning 31415: Some long message" + - Environment.NewLine + "", - sc.ToString()); - } - - [Test] - public void LowMessageColorTest() - { - EventSource es = new EventSource(); - SimulatedConsole sc = new SimulatedConsole(); - ConsoleLogger L = new ConsoleLogger(LoggerVerbosity.Diagnostic, - sc.Write, sc.SetColor, - sc.ResetColor); - L.Initialize(es); - - BuildMessageEventArgs msg = - new BuildMessageEventArgs("text", "help", "sender", - MessageImportance.Low); - - es.RaiseMessageEvent(null, msg); - - Assertion.AssertEquals( - "text" + - Environment.NewLine + "", - sc.ToString()); - } - - [Test] - public void TestQuietWithHighMessage() - { - for (int i = 1; i <= 2; i++) - { - EventSource es = new EventSource(); - SimulatedConsole sc = new SimulatedConsole(); - ConsoleLogger L = new ConsoleLogger(LoggerVerbosity.Quiet, - sc.Write, sc.SetColor, - sc.ResetColor); - L.Initialize(es, i); - - BuildEventContext buildEventContext = new BuildEventContext(1, 2, 3, 4); - - BuildStartedEventArgs bse = new BuildStartedEventArgs("bs", null); - bse.BuildEventContext = buildEventContext; - es.RaiseBuildStartedEvent(null, bse); - - ProjectStartedEventArgs pse = new ProjectStartedEventArgs(1,"ps", null, "fname", "", null, null,new BuildEventContext(1, 1, 1, 1)); - pse.BuildEventContext = buildEventContext; - es.RaiseProjectStartedEvent(null, pse); - - TargetStartedEventArgs trse = new TargetStartedEventArgs("ts", null, "trname", "pfile", "tfile"); - trse.BuildEventContext = buildEventContext; - es.RaiseTargetStartedEvent(null, trse); - - TaskStartedEventArgs tase = new TaskStartedEventArgs("tks", null, "tname", "tfname", "tsname"); - tase.BuildEventContext = buildEventContext; - es.RaiseTaskStartedEvent(null, tase); - - BuildMessageEventArgs bmea = new BuildMessageEventArgs("foo!", null, "sender", MessageImportance.High); - bmea.BuildEventContext = buildEventContext; - es.RaiseMessageEvent(null, bmea); - - TaskFinishedEventArgs tafea = new TaskFinishedEventArgs("tkf", null, "fname", "tsname", "tfname", true); - tafea.BuildEventContext = buildEventContext; - es.RaiseTaskFinishedEvent(null, tafea); - - TargetFinishedEventArgs trfea = new TargetFinishedEventArgs("tf", null, "trname", "fname", "tfile", true); - trfea.BuildEventContext = buildEventContext; - es.RaiseTargetFinishedEvent(null, trfea); - - ProjectFinishedEventArgs pfea = new ProjectFinishedEventArgs("pf", null, "fname", true); - pfea.BuildEventContext = buildEventContext; - es.RaiseProjectFinishedEvent(null, pfea); - - BuildFinishedEventArgs bfea = new BuildFinishedEventArgs("bf", null, true); - bfea.BuildEventContext = buildEventContext; - es.RaiseBuildFinishedEvent(null, bfea); - - Assertion.AssertEquals(String.Empty, sc.ToString()); - } - } - - [Test] - public void TestQuietWithError() - { - for (int i = 1; i <= 2; i++) - { - EventSource es = new EventSource(); - SimulatedConsole sc = new SimulatedConsole(); - ConsoleLogger L = new ConsoleLogger(LoggerVerbosity.Quiet, - sc.Write, sc.SetColor, sc.ResetColor); - L.Initialize(es, i); - - BuildEventContext buildEventContext = new BuildEventContext(1, 2, 3, 4); - - BuildStartedEventArgs bse = new BuildStartedEventArgs("bs", null); - bse.BuildEventContext = buildEventContext; - es.RaiseBuildStartedEvent(null, bse); - - ProjectStartedEventArgs pse = new ProjectStartedEventArgs(-1,"ps", null, "fname", "", null, null, new BuildEventContext(1, 2, 3, 4)); - pse.BuildEventContext = buildEventContext; - es.RaiseProjectStartedEvent(null, pse); - - TargetStartedEventArgs trse = new TargetStartedEventArgs("ts", null, "trname", "pfile", "tfile"); - trse.BuildEventContext = buildEventContext; - es.RaiseTargetStartedEvent(null, trse); - - TaskStartedEventArgs tase = new TaskStartedEventArgs("tks", null, "tname", "tfname", "tsname"); - tase.BuildEventContext = buildEventContext; - es.RaiseTaskStartedEvent(null, tase); - - BuildErrorEventArgs beea = new BuildErrorEventArgs("VBC", - "31415", "file.vb", 42, 0, 0, 0, - "Some long message", "help", "sender"); - - beea.BuildEventContext = buildEventContext; - es.RaiseErrorEvent(null, beea); - - TaskFinishedEventArgs tafea = new TaskFinishedEventArgs("tkf", null, "fname", "tsname", "tfname", true); - tafea.BuildEventContext = buildEventContext; - es.RaiseTaskFinishedEvent(null, tafea); - - TargetFinishedEventArgs trfea = new TargetFinishedEventArgs("tf", null, "trname", "fname", "tfile", true); - trfea.BuildEventContext = buildEventContext; - es.RaiseTargetFinishedEvent(null, trfea); - - ProjectFinishedEventArgs pfea = new ProjectFinishedEventArgs("pf", null, "fname", true); - pfea.BuildEventContext = buildEventContext; - es.RaiseProjectFinishedEvent(null, pfea); - - BuildFinishedEventArgs bfea = new BuildFinishedEventArgs("bf", null, true); - bfea.BuildEventContext = buildEventContext; - es.RaiseBuildFinishedEvent(null, bfea); - - Console.WriteLine("=="); - Console.WriteLine(sc.ToString()); - Console.WriteLine("=="); - - if (i == 1) - { - Assertion.AssertEquals( - "" + BaseConsoleLogger.projectSeparatorLine + Environment.NewLine + - ResourceUtilities.FormatResourceString("ProjectStartedPrefixForTopLevelProjectWithDefaultTargets", "fname") + Environment.NewLine + Environment.NewLine + - "file.vb(42): VBC error 31415: Some long message" + Environment.NewLine + - "pf" + Environment.NewLine + - "", - sc.ToString()); - } - else - { - Assertion.AssertEquals( - "file.vb(42): VBC error 31415: Some long message" + Environment.NewLine + "", - sc.ToString()); - } - } - } - - /// - /// Quiet build with a warning; project finished should appear - /// but not target finished - /// - /// danmose - [Test] - public void TestQuietWithWarning() - { - for (int i = 1; i <= 2; i++) - { - EventSource es = new EventSource(); - SimulatedConsole sc = new SimulatedConsole(); - ConsoleLogger L = new ConsoleLogger(LoggerVerbosity.Quiet, - sc.Write, sc.SetColor, sc.ResetColor); - L.Initialize(es, i); - - BuildEventContext buildEventContext = new BuildEventContext(1, 2, 3, 4); - - BuildStartedEventArgs bse = new BuildStartedEventArgs("bs", null); - bse.BuildEventContext = buildEventContext; - es.RaiseBuildStartedEvent(null, bse); - - ProjectStartedEventArgs pse = new ProjectStartedEventArgs(-1, "ps", null, "fname", "", null, null, new BuildEventContext(1, 2, 3, 4)); - pse.BuildEventContext = buildEventContext; - es.RaiseProjectStartedEvent(null, pse); - - TargetStartedEventArgs trse = new TargetStartedEventArgs("ts", null, "trname", "pfile", "tfile"); - trse.BuildEventContext = buildEventContext; - es.RaiseTargetStartedEvent(null, trse); - - TaskStartedEventArgs tase = new TaskStartedEventArgs("tks", null, "tname", "tfname", "tsname"); - tase.BuildEventContext = buildEventContext; - es.RaiseTaskStartedEvent(null, tase); - - BuildWarningEventArgs beea = new BuildWarningEventArgs("VBC", - "31415", "file.vb", 42, 0, 0, 0, - "Some long message", "help", "sender"); - - - beea.BuildEventContext = buildEventContext; - es.RaiseWarningEvent(null, beea); - - TaskFinishedEventArgs tafea = new TaskFinishedEventArgs("tkf", null, "fname", "tsname", "tfname", true); - tafea.BuildEventContext = buildEventContext; - es.RaiseTaskFinishedEvent(null, tafea); - - TargetFinishedEventArgs trfea = new TargetFinishedEventArgs("tf", null, "trname", "fname", "tfile", true); - trfea.BuildEventContext = buildEventContext; - es.RaiseTargetFinishedEvent(null, trfea); - - ProjectFinishedEventArgs pfea = new ProjectFinishedEventArgs("pf", null, "fname", true); - pfea.BuildEventContext = buildEventContext; - es.RaiseProjectFinishedEvent(null, pfea); - - BuildFinishedEventArgs bfea = new BuildFinishedEventArgs("bf", null, true); - bfea.BuildEventContext = buildEventContext; - es.RaiseBuildFinishedEvent(null, bfea); - - Console.WriteLine("=="); - Console.WriteLine(sc.ToString()); - Console.WriteLine("=="); - - if (i == 1) - { - Assertion.AssertEquals( - "" + BaseConsoleLogger.projectSeparatorLine + Environment.NewLine + - ResourceUtilities.FormatResourceString("ProjectStartedPrefixForTopLevelProjectWithDefaultTargets", "fname") + Environment.NewLine + Environment.NewLine + - "file.vb(42): VBC warning 31415: Some long message" + Environment.NewLine + - "pf" + Environment.NewLine + - "", - sc.ToString()); - } - else - { - Assertion.AssertEquals( - "file.vb(42): VBC warning 31415: Some long message" + Environment.NewLine + "", - sc.ToString()); - } - } - } - - /// - /// Minimal with no errors or warnings should emit nothing. - /// - [Test] - public void TestMinimalWithNormalMessage() - { - for (int i = 1; i <= 2; i++) - { - EventSource es = new EventSource(); - SimulatedConsole sc = new SimulatedConsole(); - ConsoleLogger L = new ConsoleLogger(LoggerVerbosity.Minimal, - sc.Write, sc.SetColor, - sc.ResetColor); - L.Initialize(es, i); - - BuildEventContext buildEventContext = new BuildEventContext(1, 2, 3, 4); - - BuildStartedEventArgs bse = new BuildStartedEventArgs("bs", null); - bse.BuildEventContext = buildEventContext; - es.RaiseBuildStartedEvent(null, bse); - - ProjectStartedEventArgs pse = new ProjectStartedEventArgs(1,"ps", null, "fname", "", null, null, new BuildEventContext(1, 1, 1, 1)); - pse.BuildEventContext = buildEventContext; - es.RaiseProjectStartedEvent(null, pse); - - TargetStartedEventArgs trse = new TargetStartedEventArgs("ts", null, "trname", "pfile", "tfile"); - trse.BuildEventContext = buildEventContext; - es.RaiseTargetStartedEvent(null, trse); - - TaskStartedEventArgs tase = new TaskStartedEventArgs("tks", null, "tname", "tfname", "tsname"); - tase.BuildEventContext = buildEventContext; - es.RaiseTaskStartedEvent(null, tase); - - BuildMessageEventArgs bmea = new BuildMessageEventArgs("foo!", null, "sender", MessageImportance.Normal); - bmea.BuildEventContext = buildEventContext; - es.RaiseMessageEvent(null, bmea); - - TaskFinishedEventArgs tafea = new TaskFinishedEventArgs("tkf", null, "fname", "tsname", "tfname", true); - tafea.BuildEventContext = buildEventContext; - es.RaiseTaskFinishedEvent(null, tafea); - - TargetFinishedEventArgs trfea = new TargetFinishedEventArgs("tf", null, "trname", "fname", "tfile", true); - trfea.BuildEventContext = buildEventContext; - es.RaiseTargetFinishedEvent(null, trfea); - - ProjectFinishedEventArgs pfea = new ProjectFinishedEventArgs("pf", null, "fname", true); - pfea.BuildEventContext = buildEventContext; - es.RaiseProjectFinishedEvent(null, pfea); - - BuildFinishedEventArgs bfea = new BuildFinishedEventArgs("bf", null, true); - bfea.BuildEventContext = buildEventContext; - es.RaiseBuildFinishedEvent(null, bfea); - - Assertion.AssertEquals(String.Empty, sc.ToString()); - } - } - - /// - /// Minimal with error should emit project started, the error, and project finished - /// - [Test] - public void TestMinimalWithError() - { - for (int i = 1; i <= 2; i++) - { - EventSource es = new EventSource(); - SimulatedConsole sc = new SimulatedConsole(); - ConsoleLogger L = new ConsoleLogger(LoggerVerbosity.Minimal, - sc.Write, sc.SetColor, sc.ResetColor); - L.Initialize(es, i); - - BuildEventContext buildEventContext = new BuildEventContext(1, 2, 3, 4); - - BuildStartedEventArgs bse = new BuildStartedEventArgs("bs", null); - bse.BuildEventContext = buildEventContext; - es.RaiseBuildStartedEvent(null, bse); - - ProjectStartedEventArgs pse = new ProjectStartedEventArgs(-1, "ps", null, "fname", "", null, null, new BuildEventContext(1, 2, 3, 4)); - pse.BuildEventContext = buildEventContext; - es.RaiseProjectStartedEvent(null, pse); - - TargetStartedEventArgs trse = new TargetStartedEventArgs("ts", null, "trname", "pfile", "tfile"); - trse.BuildEventContext = buildEventContext; - es.RaiseTargetStartedEvent(null, trse); - - TaskStartedEventArgs tase = new TaskStartedEventArgs("tks", null, "tname", "tfname", "tsname"); - tase.BuildEventContext = buildEventContext; - es.RaiseTaskStartedEvent(null, tase); - - BuildErrorEventArgs beea = new BuildErrorEventArgs("VBC", - "31415", "file.vb", 42, 0, 0, 0, - "Some long message", "help", "sender"); - - beea.BuildEventContext = buildEventContext; - es.RaiseErrorEvent(null, beea); - - TaskFinishedEventArgs tafea = new TaskFinishedEventArgs("tkf", null, "fname", "tsname", "tfname", true); - tafea.BuildEventContext = buildEventContext; - es.RaiseTaskFinishedEvent(null, tafea); - - TargetFinishedEventArgs trfea = new TargetFinishedEventArgs("tf", null, "trname", "fname", "tfile", true); - trfea.BuildEventContext = buildEventContext; - es.RaiseTargetFinishedEvent(null, trfea); - - ProjectFinishedEventArgs pfea = new ProjectFinishedEventArgs("pf", null, "fname", true); - pfea.BuildEventContext = buildEventContext; - es.RaiseProjectFinishedEvent(null, pfea); - - BuildFinishedEventArgs bfea = new BuildFinishedEventArgs("bf", null, true); - bfea.BuildEventContext = buildEventContext; - es.RaiseBuildFinishedEvent(null, bfea); - - Console.WriteLine("=="); - Console.WriteLine(sc.ToString()); - Console.WriteLine("=="); - - if (i == 1) - { - Assertion.AssertEquals( - "" + BaseConsoleLogger.projectSeparatorLine + Environment.NewLine + - ResourceUtilities.FormatResourceString("ProjectStartedPrefixForTopLevelProjectWithDefaultTargets", "fname") + Environment.NewLine + Environment.NewLine + - "file.vb(42): VBC error 31415: Some long message" + Environment.NewLine + - "pf" + Environment.NewLine + - "", - sc.ToString()); - } - else - { - Assertion.AssertEquals( - "file.vb(42): VBC error 31415: Some long message" + Environment.NewLine + "", - sc.ToString()); - } - } - } - - /// - /// Minimal with warning should emit project started, the warning, and project finished - /// - /// danmose - [Test] - public void TestMinimalWithWarning() - { - for (int i = 1; i <= 2; i++) - { - EventSource es = new EventSource(); - SimulatedConsole sc = new SimulatedConsole(); - ConsoleLogger L = new ConsoleLogger(LoggerVerbosity.Quiet, - sc.Write, sc.SetColor, sc.ResetColor); - L.Initialize(es, i); - - BuildEventContext buildEventContext = new BuildEventContext(1, 2, 3, 4); - - BuildStartedEventArgs bse = new BuildStartedEventArgs("bs", null); - bse.BuildEventContext = buildEventContext; - es.RaiseBuildStartedEvent(null, bse); - - ProjectStartedEventArgs pse = new ProjectStartedEventArgs(-1, "ps", null, "fname", "", null, null, new BuildEventContext(1, 2, 3, 4)); - pse.BuildEventContext = buildEventContext; - es.RaiseProjectStartedEvent(null, pse); - - TargetStartedEventArgs trse = new TargetStartedEventArgs("ts", null, "trname", "pfile", "tfile"); - trse.BuildEventContext = buildEventContext; - es.RaiseTargetStartedEvent(null, trse); - - TaskStartedEventArgs tase = new TaskStartedEventArgs("tks", null, "tname", "tfname", "tsname"); - tase.BuildEventContext = buildEventContext; - es.RaiseTaskStartedEvent(null, tase); - - BuildWarningEventArgs beea = new BuildWarningEventArgs("VBC", - "31415", "file.vb", 42, 0, 0, 0, - "Some long message", "help", "sender"); - - - beea.BuildEventContext = buildEventContext; - es.RaiseWarningEvent(null, beea); - - TaskFinishedEventArgs tafea = new TaskFinishedEventArgs("tkf", null, "fname", "tsname", "tfname", true); - tafea.BuildEventContext = buildEventContext; - es.RaiseTaskFinishedEvent(null, tafea); - - TargetFinishedEventArgs trfea = new TargetFinishedEventArgs("tf", null, "trname", "fname", "tfile", true); - trfea.BuildEventContext = buildEventContext; - es.RaiseTargetFinishedEvent(null, trfea); - - ProjectFinishedEventArgs pfea = new ProjectFinishedEventArgs("pf", null, "fname", true); - pfea.BuildEventContext = buildEventContext; - es.RaiseProjectFinishedEvent(null, pfea); - - BuildFinishedEventArgs bfea = new BuildFinishedEventArgs("bf", null, true); - bfea.BuildEventContext = buildEventContext; - es.RaiseBuildFinishedEvent(null, bfea); - - Console.WriteLine("=="); - Console.WriteLine(sc.ToString()); - Console.WriteLine("=="); - - if (i == 1) - { - Assertion.AssertEquals( - "" + BaseConsoleLogger.projectSeparatorLine + Environment.NewLine + - ResourceUtilities.FormatResourceString("ProjectStartedPrefixForTopLevelProjectWithDefaultTargets", "fname") + Environment.NewLine + Environment.NewLine + - "file.vb(42): VBC warning 31415: Some long message" + Environment.NewLine + - "pf" + Environment.NewLine + - "", - sc.ToString()); - } - else - { - Assertion.AssertEquals( - "file.vb(42): VBC warning 31415: Some long message" + Environment.NewLine + "", - sc.ToString()); - } - } - } - - /// - /// Minimal with warning should emit project started, the warning, and project finished - /// - /// danmose - [Test] - public void TestDirectEventHandlers() - { - for (int i = 1; i <= 2; i++) - { - EventSource es = new EventSource(); - SimulatedConsole sc = new SimulatedConsole(); - ConsoleLogger L = new ConsoleLogger(LoggerVerbosity.Quiet, - sc.Write, sc.SetColor, sc.ResetColor); - L.Initialize(es, i); - - BuildEventContext buildEventContext = new BuildEventContext(1, 2, 3, 4); - - BuildStartedEventArgs bse = new BuildStartedEventArgs("bs", null); - bse.BuildEventContext = buildEventContext; - L.BuildStartedHandler(null, bse); - - ProjectStartedEventArgs pse = new ProjectStartedEventArgs(-1, "ps", null, "fname", "", null, null, new BuildEventContext(1, 2, 3, 4)); - pse.BuildEventContext = buildEventContext; - L.ProjectStartedHandler(null, pse); - - TargetStartedEventArgs trse = new TargetStartedEventArgs("ts", null, "trname", "pfile", "tfile"); - trse.BuildEventContext = buildEventContext; - L.TargetStartedHandler(null, trse); - - TaskStartedEventArgs tase = new TaskStartedEventArgs("tks", null, "tname", "tfname", "tsname"); - tase.BuildEventContext = buildEventContext; - L.TaskStartedHandler(null, tase); - - BuildWarningEventArgs beea = new BuildWarningEventArgs("VBC", - "31415", "file.vb", 42, 0, 0, 0, - "Some long message", "help", "sender"); - - - beea.BuildEventContext = buildEventContext; - L.WarningHandler(null, beea); - - TaskFinishedEventArgs tafea = new TaskFinishedEventArgs("tkf", null, "fname", "tsname", "tfname", true); - tafea.BuildEventContext = buildEventContext; - L.TaskFinishedHandler(null, tafea); - - TargetFinishedEventArgs trfea = new TargetFinishedEventArgs("tf", null, "trname", "fname", "tfile", true); - trfea.BuildEventContext = buildEventContext; - L.TargetFinishedHandler(null, trfea); - - ProjectFinishedEventArgs pfea = new ProjectFinishedEventArgs("pf", null, "fname", true); - pfea.BuildEventContext = buildEventContext; - L.ProjectFinishedHandler(null, pfea); - - BuildFinishedEventArgs bfea = new BuildFinishedEventArgs("bf", null, true); - bfea.BuildEventContext = buildEventContext; - L.BuildFinishedHandler(null, bfea); - - Console.WriteLine("=="); - Console.WriteLine(sc.ToString()); - Console.WriteLine("=="); - - if (i == 1) - { - Assertion.AssertEquals( - "" + BaseConsoleLogger.projectSeparatorLine + Environment.NewLine + - ResourceUtilities.FormatResourceString("ProjectStartedPrefixForTopLevelProjectWithDefaultTargets", "fname") + Environment.NewLine + Environment.NewLine + - "file.vb(42): VBC warning 31415: Some long message" + Environment.NewLine + - "pf" + Environment.NewLine + - "", - sc.ToString()); - } - else - { - Assertion.AssertEquals( - "file.vb(42): VBC warning 31415: Some long message" + Environment.NewLine + "", - sc.ToString()); - } - } - } - - [Test] - public void SingleLineFormatNoop() - { - string s = "foo"; - SerialConsoleLogger cl = new SerialConsoleLogger(); - - string ss = cl.IndentString(s, 0); - - //should be a no-op - Assertion.AssertEquals("foo" + Environment.NewLine, ss); - } - - [Test] - public void MultilineFormatWindowsLineEndings() - { - string newline = "\r\n"; - string s = "foo" + newline + "bar" + - newline + "baz" + newline; - SerialConsoleLogger cl = new SerialConsoleLogger(); - - string ss = cl.IndentString(s, 4); - - //should convert lines to system format - Assertion.AssertEquals(" foo" + Environment.NewLine + - " bar" + Environment.NewLine + - " baz" + Environment.NewLine + - " " + Environment.NewLine, ss); - } - - [Test] - public void MultilineFormatUnixLineEndings() - { - string s = "foo\nbar\nbaz\n"; - SerialConsoleLogger cl = new SerialConsoleLogger(); - - string ss = cl.IndentString(s, 0); - - //should convert lines to system format - Assertion.AssertEquals("foo" + Environment.NewLine + - "bar" + Environment.NewLine + - "baz" + Environment.NewLine + Environment.NewLine, ss); - } - - [Test] - public void MultilineFormatMixedLineEndings() - { - string s = "foo" + "\r\n\r\n" + "bar" + "\n" + "baz" + "\n\r\n\n" + - "jazz" + "\r\n" + "razz" + "\n\n" + "matazz" + "\n" + "end"; - - SerialConsoleLogger cl = new SerialConsoleLogger(); - - string ss = cl.IndentString(s, 0); - - //should convert lines to system format - Assertion.AssertEquals("foo" + Environment.NewLine + Environment.NewLine + - "bar" + Environment.NewLine + - "baz" + Environment.NewLine + Environment.NewLine + Environment.NewLine + - "jazz" + Environment.NewLine + - "razz" + Environment.NewLine + Environment.NewLine + - "matazz" + Environment.NewLine + - "end" + Environment.NewLine, ss); - } - - [Test] - public void NestedProjectMinimal() - { - EventSource es = new EventSource(); - SimulatedConsole sc = new SimulatedConsole(); - ConsoleLogger L = new ConsoleLogger(LoggerVerbosity.Minimal, - sc.Write, sc.SetColor, sc.ResetColor); - L.Initialize(es, 1); - - es.RaiseBuildStartedEvent(null, - new BuildStartedEventArgs("bs", null)); - - //Clear time dependant build started message - sc.Clear(); - - es.RaiseProjectStartedEvent(null, - new ProjectStartedEventArgs("ps1", null, "fname1", "", null, null)); - - es.RaiseTargetStartedEvent(null, - new TargetStartedEventArgs("ts", null, - "trname", "fname", "tfile")); - - es.RaiseProjectStartedEvent(null, - new ProjectStartedEventArgs("ps2", null, "fname2", "", null, null)); - - Assertion.AssertEquals(string.Empty, sc.ToString()); - - BuildErrorEventArgs beea = new BuildErrorEventArgs("VBC", - "31415", "file.vb", 42, 0, 0, 0, - "Some long message", "help", "sender"); - - es.RaiseErrorEvent(null, beea); - - Assertion.AssertEquals( - "" + BaseConsoleLogger.projectSeparatorLine + Environment.NewLine + - ResourceUtilities.FormatResourceString("ProjectStartedPrefixForTopLevelProjectWithDefaultTargets", "fname1") + Environment.NewLine + - Environment.NewLine + "" + - "" + BaseConsoleLogger.projectSeparatorLine + Environment.NewLine + - ResourceUtilities.FormatResourceString("ProjectStartedPrefixForNestedProjectWithDefaultTargets", "fname1", "fname2") + Environment.NewLine + - Environment.NewLine + "" + - "" + "file.vb(42): VBC error 31415: Some long message" + - Environment.NewLine + "", - sc.ToString()); - } - - [Test] - public void NestedProjectNormal() - { - EventSource es = new EventSource(); - SimulatedConsole sc = new SimulatedConsole(); - ConsoleLogger L = new ConsoleLogger(LoggerVerbosity.Normal, - sc.Write, sc.SetColor, sc.ResetColor); - L.Initialize(es); - - es.RaiseBuildStartedEvent(null, - new BuildStartedEventArgs("bs", null)); - - - //Clear time dependant build started message - string expectedOutput = null; - string actualOutput = null; - sc.Clear(); - - es.RaiseProjectStartedEvent(null, - new ProjectStartedEventArgs("ps1", null, "fname1", "", null, null)); - - #region Check - expectedOutput = - "" + BaseConsoleLogger.projectSeparatorLine + Environment.NewLine + - ResourceUtilities.FormatResourceString("ProjectStartedPrefixForTopLevelProjectWithDefaultTargets", "fname1") + Environment.NewLine + - Environment.NewLine + ""; - actualOutput = sc.ToString(); - - Assertion.AssertEquals(expectedOutput, actualOutput); - Console.WriteLine("1 [" + expectedOutput + "] [" + actualOutput + "]"); - sc.Clear(); - #endregion - - es.RaiseTargetStartedEvent(null, - new TargetStartedEventArgs("ts", null, - "tarname", "fname", "tfile")); - #region Check - expectedOutput = String.Empty; - actualOutput = sc.ToString(); - - Console.WriteLine("2 [" + expectedOutput + "] [" + actualOutput + "]"); - Assertion.AssertEquals(expectedOutput, actualOutput); - sc.Clear(); - #endregion - - es.RaiseTaskStartedEvent(null, new TaskStartedEventArgs("", "", "", "", "Exec")); - es.RaiseProjectStartedEvent(null, - new ProjectStartedEventArgs("ps2", null, "fname2", "", null, null)); - - #region Check - expectedOutput = - "" + ResourceUtilities.FormatResourceString("TargetStartedPrefix", "tarname") + Environment.NewLine + "" - + "" + " " + BaseConsoleLogger.projectSeparatorLine - + Environment.NewLine + - " " + ResourceUtilities.FormatResourceString("ProjectStartedPrefixForNestedProjectWithDefaultTargets", "fname1", "fname2") + Environment.NewLine + - Environment.NewLine + ""; - actualOutput = sc.ToString(); - - Console.WriteLine("3 [" + expectedOutput + "] [" + actualOutput + "]"); - Assertion.AssertEquals(expectedOutput, actualOutput); - sc.Clear(); - #endregion - - es.RaiseProjectFinishedEvent(null, - new ProjectFinishedEventArgs("pf2", null, "fname2", true)); - es.RaiseTaskFinishedEvent(null, new TaskFinishedEventArgs("", "", "", "", "Exec", true)); - - #region Check - expectedOutput = String.Empty; - actualOutput = sc.ToString(); - - Console.WriteLine("4 [" + expectedOutput + "] [" + actualOutput + "]"); - Assertion.AssertEquals(expectedOutput, actualOutput); - sc.Clear(); - #endregion - - es.RaiseTargetFinishedEvent(null, - new TargetFinishedEventArgs("tf", null, "tarname", "fname", "tfile", true)); - - #region Check - expectedOutput = String.Empty; - actualOutput = sc.ToString(); - - Console.WriteLine("5 [" + expectedOutput + "] [" + actualOutput + "]"); - Assertion.AssertEquals(expectedOutput, actualOutput); - sc.Clear(); - #endregion - - es.RaiseProjectFinishedEvent(null, - new ProjectFinishedEventArgs("pf1", null, "fname1", true)); - - #region Check - expectedOutput = String.Empty; - actualOutput = sc.ToString(); - - Console.WriteLine("6 [" + expectedOutput + "] [" + actualOutput + "]"); - Assertion.AssertEquals(expectedOutput, actualOutput); - sc.Clear(); - #endregion - - es.RaiseBuildFinishedEvent(null, - new BuildFinishedEventArgs("bf", null, true)); - - #region Check - expectedOutput = "" + Environment.NewLine + "bf" + - Environment.NewLine + "" + - " " + ResourceUtilities.FormatResourceString("WarningCount", 0) + - Environment.NewLine + "" + - " " + ResourceUtilities.FormatResourceString("ErrorCount", 0) + - Environment.NewLine + "" + - Environment.NewLine; - - // Would like to add... - // + ResourceUtilities.FormatResourceString("TimeElapsed", String.Empty); - // ...but this assumes that the time goes on the far right in every locale. - - actualOutput = sc.ToString().Substring(0, expectedOutput.Length); - - Console.WriteLine("7 [" + expectedOutput + "] [" + actualOutput + "]"); - Assertion.AssertEquals(expectedOutput, actualOutput); - sc.Clear(); - #endregion - - } - - [Test] - public void CustomDisplayedAtDetailed() - { - EventSource es = new EventSource(); - SimulatedConsole sc = new SimulatedConsole(); - ConsoleLogger L = new ConsoleLogger(LoggerVerbosity.Detailed, - sc.Write, null, null); - L.Initialize(es); - - MyCustomBuildEventArgs c = - new MyCustomBuildEventArgs("msg"); - - es.RaiseCustomEvent(null, c); - - Assertion.AssertEquals("msg" + Environment.NewLine, - sc.ToString()); - } - - [Test] - public void CustomDisplayedAtDiagnosticMP() - { - EventSource es = new EventSource(); - SimulatedConsole sc = new SimulatedConsole(); - ConsoleLogger L = new ConsoleLogger(LoggerVerbosity.Diagnostic, - sc.Write, null, null); - L.Initialize(es,2); - - MyCustomBuildEventArgs c = - new MyCustomBuildEventArgs("msg"); - c.BuildEventContext = new BuildEventContext(1, 1, 1, 1); - es.RaiseCustomEvent(null, c); - - Assertion.Assert(sc.ToString().Contains("msg")); - } - - [Test] - public void CustomNotDisplayedAtNormal() - { - EventSource es = new EventSource(); - SimulatedConsole sc = new SimulatedConsole(); - ConsoleLogger L = new ConsoleLogger(LoggerVerbosity.Normal, - sc.Write, null, null); - L.Initialize(es); - - MyCustomBuildEventArgs c = - new MyCustomBuildEventArgs("msg"); - - es.RaiseCustomEvent(null, c); - - Assertion.AssertEquals(String.Empty, sc.ToString()); - } - - /// - /// Create some properties and log them - /// - /// - /// - private void WriteAndValidateProperties(BaseConsoleLogger cl, SimulatedConsole sc, bool expectToSeeLogging) - { - - Hashtable properties = new Hashtable(); - properties.Add("prop1", "val1"); - properties.Add("prop2", "val2"); - string prop1 = string.Empty; - string prop2 = string.Empty; - - if (cl is SerialConsoleLogger) - { - ArrayList propertyList = ((SerialConsoleLogger) cl).ExtractPropertyList(properties); - ((SerialConsoleLogger)cl).WriteProperties(propertyList); - prop1 = String.Format(CultureInfo.CurrentCulture, "{0,-30} = {1}", "prop1", "val1"); - prop2 = String.Format(CultureInfo.CurrentCulture, "{0,-30} = {1}", "prop2", "val2"); - } - else - { - BuildEventArgs buildEvent = new BuildErrorEventArgs("", "", "", 0, 0, 0, 0, "", "", ""); - buildEvent.BuildEventContext = new BuildEventContext(1, 2, 3, 4); - ((ParallelConsoleLogger)cl).WriteProperties(buildEvent, properties); - prop1 = String.Format(CultureInfo.CurrentCulture, "{0} = {1}", "prop1", "val1"); - prop2 = String.Format(CultureInfo.CurrentCulture, "{0} = {1}", "prop2", "val2"); - } - string log = sc.ToString(); - - Console.WriteLine("[" + log + "]"); - - - // Being careful not to make locale assumptions here, eg about sorting - if (expectToSeeLogging) - { - Assertion.Assert(log.Contains(prop1)); - Assertion.Assert(log.Contains(prop2)); - } - else - { - Assertion.Assert(!log.Contains(prop1)); - Assertion.Assert(!log.Contains(prop2)); - } - } - - /// - /// Basic test of properties list display - /// - [Test] - public void DisplayPropertiesList() - { - SimulatedConsole sc = new SimulatedConsole(); - SerialConsoleLogger cl = new SerialConsoleLogger(LoggerVerbosity.Diagnostic, sc.Write, null, null); - - WriteAndValidateProperties(cl, sc, true); - - sc = new SimulatedConsole(); - ParallelConsoleLogger cl2 = new ParallelConsoleLogger(LoggerVerbosity.Diagnostic, sc.Write, null, null); - - WriteAndValidateProperties(cl2, sc, true); - } - - /// - /// Basic test of properties list not being displayed except in Diagnostic - /// - [Test] - public void DoNotDisplayPropertiesListInDetailed() - { - SimulatedConsole sc = new SimulatedConsole(); - SerialConsoleLogger cl = new SerialConsoleLogger(LoggerVerbosity.Detailed, sc.Write, null, null); - - WriteAndValidateProperties(cl, sc, false); - - sc = new SimulatedConsole(); - ParallelConsoleLogger cl2 = new ParallelConsoleLogger(LoggerVerbosity.Detailed, sc.Write, null, null); - - WriteAndValidateProperties(cl2, sc, false); - - } - - /// - /// Basic test of properties list not being displayed when disabled - /// - [Test] - public void DoNotDisplayPropertiesListIfDisabled() - { - SimulatedConsole sc = new SimulatedConsole(); - SerialConsoleLogger cl = new SerialConsoleLogger(LoggerVerbosity.Diagnostic, sc.Write, null, null); - cl.Parameters = "noitemandpropertylist"; - cl.ParseParameters(); - - WriteAndValidateProperties(cl, sc, false); - - sc = new SimulatedConsole(); - ParallelConsoleLogger cl2 = new ParallelConsoleLogger(LoggerVerbosity.Diagnostic, sc.Write, null, null); - cl2.Parameters = "noitemandpropertylist"; - cl2.ParseParameters(); - - WriteAndValidateProperties(cl, sc, false); - } - - /// - /// Create some items and log them - /// - /// - private void WriteAndValidateItems(BaseConsoleLogger cl, SimulatedConsole sc, bool expectToSeeLogging) - { - Hashtable items = new Hashtable(); - items.Add("type", (ITaskItem)new TaskItem("spec")); - items.Add("type2", (ITaskItem)new TaskItem("spec2")); - - string item1type = string.Empty; - string item2type = string.Empty; - string item1spec = string.Empty; - string item2spec = string.Empty; - - if (cl is SerialConsoleLogger) - { - SortedList itemList = ((SerialConsoleLogger)cl).ExtractItemList(items); - ((SerialConsoleLogger)cl).WriteItems(itemList); - item1spec = "spec" + Environment.NewLine; - item2spec = "spec2" + Environment.NewLine; - } - else - { - BuildEventArgs buildEvent = new BuildErrorEventArgs("", "", "", 0, 0, 0, 0, "", "", ""); - buildEvent.BuildEventContext = new BuildEventContext(1, 2, 3, 4); - ((ParallelConsoleLogger)cl).WriteItems(buildEvent, items); - item1spec = Environment.NewLine + " spec" + Environment.NewLine; - item2spec = Environment.NewLine + " spec2" + Environment.NewLine; - } - - item1type = "type" + Environment.NewLine; - item2type = "type2" + Environment.NewLine; - - string log = sc.ToString(); - - Console.WriteLine("[" + log + "]"); - - - - // Being careful not to make locale assumptions here, eg about sorting - if (expectToSeeLogging) - { - Assertion.Assert(log.Contains(item1type)); - Assertion.Assert(log.Contains(item2type)); - Assertion.Assert(log.Contains(item1spec)); - Assertion.Assert(log.Contains(item2spec)); - } - else - { - Assertion.Assert(!log.Contains(item1type)); - Assertion.Assert(!log.Contains(item2type)); - Assertion.Assert(!log.Contains(item1spec)); - Assertion.Assert(!log.Contains(item2spec)); - } - } - - /// - /// Verify passing in an empty item list does not print anything out - /// - /// - [Test] - public void WriteItemsEmptyList() - { - Hashtable items = new Hashtable(); - - for (int i = 0; i < 2; i++) - { - BaseConsoleLogger cl = null; - SimulatedConsole sc = new SimulatedConsole(); - if (i == 0) - { - cl = new SerialConsoleLogger(LoggerVerbosity.Diagnostic, sc.Write, null, null); - } - else - { - cl = new ParallelConsoleLogger(LoggerVerbosity.Diagnostic, sc.Write, null, null); - } - - if (cl is SerialConsoleLogger) - { - SortedList itemList = ((SerialConsoleLogger)cl).ExtractItemList(items); - ((SerialConsoleLogger)cl).WriteItems(itemList); - } - else - { - BuildEventArgs buildEvent = new BuildErrorEventArgs("", "", "", 0, 0, 0, 0, "", "", ""); - buildEvent.BuildEventContext = new BuildEventContext(1, 2, 3, 4); - ((ParallelConsoleLogger)cl).WriteItems(buildEvent, items); - } - - string log = sc.ToString(); - - // There should be nothing in the log - Assert.IsTrue(log.Length == 0, "Iteration of I: " + i); - Console.WriteLine("Iteration of i: " + i + "[" + log + "]"); - } - } - - /// - /// Verify passing in an empty item list does not print anything out - /// - /// - [Test] - public void WritePropertiesEmptyList() - { - Hashtable properties = new Hashtable(); - - - for (int i = 0; i < 2; i++) - { - BaseConsoleLogger cl = null; - SimulatedConsole sc = new SimulatedConsole(); - if (i == 0) - { - cl = new SerialConsoleLogger(LoggerVerbosity.Diagnostic, sc.Write, null, null); - } - else - { - cl = new ParallelConsoleLogger(LoggerVerbosity.Diagnostic, sc.Write, null, null); - } - - if (cl is SerialConsoleLogger) - { - ArrayList propertyList = ((SerialConsoleLogger)cl).ExtractPropertyList(properties); - ((SerialConsoleLogger)cl).WriteProperties(propertyList); - } - else - { - BuildEventArgs buildEvent = new BuildErrorEventArgs("", "", "", 0, 0, 0, 0, "", "", ""); - buildEvent.BuildEventContext = new BuildEventContext(1, 2, 3, 4); - ((ParallelConsoleLogger)cl).WriteProperties(buildEvent, properties); - } - - string log = sc.ToString(); - - // There should be nothing in the log - Assert.IsTrue(log.Length == 0, "Iteration of I: " + i); - Console.WriteLine("Iteration of i: " + i + "[" + log + "]"); - } - } - - /// - /// Basic test of item list display - /// - [Test] - public void DisplayItemsList() - { - SimulatedConsole sc = new SimulatedConsole(); - SerialConsoleLogger cl = new SerialConsoleLogger(LoggerVerbosity.Diagnostic, sc.Write, null, null); - - WriteAndValidateItems(cl, sc, true); - - sc = new SimulatedConsole(); - ParallelConsoleLogger cl2 = new ParallelConsoleLogger(LoggerVerbosity.Diagnostic, sc.Write, null, null); - - WriteAndValidateItems(cl2, sc, true); - } - - /// - /// Basic test of item list not being displayed except in Diagnostic - /// - [Test] - public void DoNotDisplayItemListInDetailed() - { - SimulatedConsole sc = new SimulatedConsole(); - SerialConsoleLogger cl = new SerialConsoleLogger(LoggerVerbosity.Detailed, sc.Write, null, null); - - WriteAndValidateItems(cl, sc, false); - - sc = new SimulatedConsole(); - ParallelConsoleLogger cl2 = new ParallelConsoleLogger(LoggerVerbosity.Detailed, sc.Write, null, null); - - WriteAndValidateItems(cl2, sc, false); - } - - /// - /// Basic test of item list not being displayed when disabled - /// - [Test] - public void DoNotDisplayItemListIfDisabled() - { - SimulatedConsole sc = new SimulatedConsole(); - SerialConsoleLogger cl = new SerialConsoleLogger(LoggerVerbosity.Diagnostic, sc.Write, null, null); - cl.Parameters = "noitemandpropertylist"; - cl.ParseParameters(); - - WriteAndValidateItems(cl, sc, false); - - sc = new SimulatedConsole(); - ParallelConsoleLogger cl2 = new ParallelConsoleLogger(LoggerVerbosity.Diagnostic, sc.Write, null, null); - cl2.Parameters = "noitemandpropertylist"; - cl2.ParseParameters(); - - WriteAndValidateItems(cl2, sc, false); - } - - [Test] - public void ParametersEmptyTests() - { - SimulatedConsole sc = new SimulatedConsole(); - SerialConsoleLogger L = new SerialConsoleLogger(LoggerVerbosity.Normal, sc.Write, null, null); - - L.Parameters = ""; - L.ParseParameters(); - Assertion.Assert(L.ShowSummary == false); - - L.Parameters = null; - L.ParseParameters(); - Assertion.Assert(L.ShowSummary == false); - - sc = new SimulatedConsole(); - ParallelConsoleLogger cl2 = new ParallelConsoleLogger(LoggerVerbosity.Diagnostic, sc.Write, null, null); - cl2.Parameters = "noitemandpropertylist"; - cl2.ParseParameters(); - - WriteAndValidateItems(cl2, sc, false); - } - - [Test] - public void ParametersParsingTests() - { - SimulatedConsole sc = new SimulatedConsole(); - SerialConsoleLogger L = new SerialConsoleLogger(LoggerVerbosity.Normal, sc.Write, null, null); - - L.Parameters = "NoSuMmaRy"; - L.ParseParameters(); - Assertion.Assert(L.ShowSummary == false); - - L.Parameters = ";;NoSuMmaRy;"; - L.ParseParameters(); - Assertion.Assert(L.ShowSummary == false); - - sc = new SimulatedConsole(); - ParallelConsoleLogger L2 = new ParallelConsoleLogger(LoggerVerbosity.Normal, sc.Write, null, null); - - L2.Parameters = "NoSuMmaRy"; - L2.ParseParameters(); - Assertion.Assert(L2.ShowSummary == false); - - L2.Parameters = ";;NoSuMmaRy;"; - L2.ParseParameters(); - Assertion.Assert(L2.ShowSummary == false); - } - - /// - /// ResetConsoleLoggerState should reset the state of the console logger - /// - [Test] - public void ResetConsoleLoggerStateTestBasic() - { - // Create an event source - EventSource es = new EventSource(); - //Create a simulated console - SimulatedConsole sc = new SimulatedConsole(); - - // error and warning string for 1 error and 1 warning - // errorString = 1 Error(s) - // warningString = 1 Warning(s) - string errorString = ResourceUtilities.FormatResourceString("ErrorCount", 1); - string warningString = ResourceUtilities.FormatResourceString("WarningCount", 1); - - // Create a ConsoleLogger with Normal verbosity - ConsoleLogger L = new ConsoleLogger(LoggerVerbosity.Normal, - sc.Write, sc.SetColor, sc.ResetColor); - // Initialize ConsoleLogger - L.Initialize(es); - - // BuildStarted Event - es.RaiseBuildStartedEvent(null, - new BuildStartedEventArgs("bs", null)); - - // Introduce a warning - BuildWarningEventArgs bwea = new BuildWarningEventArgs("VBC", - "31415", "file.vb", 42, 0, 0, 0, - "Some long message", "help", "sender"); - - es.RaiseWarningEvent(null, bwea); - - // Introduce an error - BuildErrorEventArgs beea = new BuildErrorEventArgs("VBC", - "31415", "file.vb", 42, 0, 0, 0, - "Some long message", "help", "sender"); - - es.RaiseErrorEvent(null, beea); - - // BuildFinished Event - es.RaiseBuildFinishedEvent(null, - new BuildFinishedEventArgs("bf", - null, true)); - - // Log so far - string actualLog = sc.ToString(); - - Console.WriteLine("=="); - Console.WriteLine(sc.ToString()); - Console.WriteLine("=="); - - // Verify that the log has correct error and warning string - Assertion.Assert(actualLog.Contains(errorString)); - Assertion.Assert(actualLog.Contains(warningString)); - Assertion.Assert(actualLog.Contains("")); - Assertion.Assert(actualLog.Contains("")); - - // Clear the log obtained so far - sc.Clear(); - - // BuildStarted event - es.RaiseBuildStartedEvent(null, - new BuildStartedEventArgs("bs", null)); - - // BuildFinished - es.RaiseBuildFinishedEvent(null, - new BuildFinishedEventArgs("bf", - null, true)); - // Log so far - actualLog = sc.ToString(); - - Console.WriteLine("=="); - Console.WriteLine(sc.ToString()); - Console.WriteLine("=="); - - // Verify that the error and warning from the previous build is not - // reported in the subsequent build - Assertion.Assert(!actualLog.Contains(errorString)); - Assertion.Assert(!actualLog.Contains(warningString)); - Assertion.Assert(!actualLog.Contains("")); - Assertion.Assert(!actualLog.Contains("")); - - // errorString = 0 Error(s) - // warningString = 0 Warning(s) - errorString = ResourceUtilities.FormatResourceString("ErrorCount", 0); - warningString = ResourceUtilities.FormatResourceString("WarningCount", 0); - - // Verify that the log has correct error and warning string - Assertion.Assert(actualLog.Contains(errorString)); - Assertion.Assert(actualLog.Contains(warningString)); - } - - /// - /// ConsoleLogger::Initialize() should reset the state of the console logger - /// - [Test] - public void ResetConsoleLoggerState_Initialize() - { - // Create an event source - EventSource es = new EventSource(); - //Create a simulated console - SimulatedConsole sc = new SimulatedConsole(); - - // error and warning string for 1 error and 1 warning - // errorString = 1 Error(s) - // warningString = 1 Warning(s) - string errorString = ResourceUtilities.FormatResourceString("ErrorCount", 1); - string warningString = ResourceUtilities.FormatResourceString("WarningCount", 1); - - // Create a ConsoleLogger with Normal verbosity - ConsoleLogger L = new ConsoleLogger(LoggerVerbosity.Normal, - sc.Write, sc.SetColor, sc.ResetColor); - // Initialize ConsoleLogger - L.Initialize(es); - - // BuildStarted Event - es.RaiseBuildStartedEvent(null, - new BuildStartedEventArgs("bs", null)); - - // Introduce a warning - BuildWarningEventArgs bwea = new BuildWarningEventArgs("VBC", - "31415", "file.vb", 42, 0, 0, 0, - "Some long message", "help", "sender"); - - es.RaiseWarningEvent(null, bwea); - - // Introduce an error - BuildErrorEventArgs beea = new BuildErrorEventArgs("VBC", - "31415", "file.vb", 42, 0, 0, 0, - "Some long message", "help", "sender"); - - es.RaiseErrorEvent(null, beea); - - // NOTE: We don't call the es.RaiseBuildFinishedEvent(...) here as this - // would call ResetConsoleLoggerState and we will fail to detect if Initialize() - // is not calling it. - - // Log so far - string actualLog = sc.ToString(); - - Console.WriteLine("=="); - Console.WriteLine(sc.ToString()); - Console.WriteLine("=="); - - // Verify that the log has correct error and warning string - Assertion.Assert(actualLog.Contains("")); - Assertion.Assert(actualLog.Contains("")); - - // Clear the log obtained so far - sc.Clear(); - - //Initilialize (This should call ResetConsoleLoggerState(...)) - L.Initialize(es); - - // BuildStarted event - es.RaiseBuildStartedEvent(null, - new BuildStartedEventArgs("bs", null)); - - // BuildFinished - es.RaiseBuildFinishedEvent(null, - new BuildFinishedEventArgs("bf", - null, true)); - // Log so far - actualLog = sc.ToString(); - - Console.WriteLine("=="); - Console.WriteLine(sc.ToString()); - Console.WriteLine("=="); - - // Verify that the error and warning from the previous build is not - // reported in the subsequent build - Assertion.Assert(!actualLog.Contains("")); - Assertion.Assert(!actualLog.Contains("")); - - // errorString = 0 Error(s) - errorString = ResourceUtilities.FormatResourceString("ErrorCount", 0); - // warningString = 0 Warning(s) - warningString = ResourceUtilities.FormatResourceString("WarningCount", 0); - - // Verify that the log has correct error and warning string - Assertion.Assert(actualLog.Contains(errorString)); - Assertion.Assert(actualLog.Contains(warningString)); - } - - /// - /// ResetConsoleLoggerState should reset PerformanceCounters - /// - [Test] - public void ResetConsoleLoggerState_PerformanceCounters() - { - for (int i = 1; i <= 2; i++) - { - EventSource es = new EventSource(); - //Create a simulated console - SimulatedConsole sc = new SimulatedConsole(); - // Create a ConsoleLogger with Normal verbosity - ConsoleLogger L = new ConsoleLogger(LoggerVerbosity.Normal, sc.Write, sc.SetColor, sc.ResetColor); - // Initialize ConsoleLogger - L.Parameters = "Performancesummary"; - L.Initialize(es, i); - // prjPerfString = Project Performance Summary: - string prjPerfString = ResourceUtilities.FormatResourceString("ProjectPerformanceSummary", null); - // targetPerfString = Target Performance Summary: - string targetPerfString = ResourceUtilities.FormatResourceString("TargetPerformanceSummary", null); - // taskPerfString = Task Performance Summary: - string taskPerfString = ResourceUtilities.FormatResourceString("TaskPerformanceSummary", null); - - // BuildStarted Event - es.RaiseBuildStartedEvent(null, new BuildStartedEventArgs("bs", null)); - //Project Started Event - ProjectStartedEventArgs project1Started = new ProjectStartedEventArgs(1, null, null, "p", "t", null, null, new BuildEventContext(BuildEventContext.InvalidNodeId, BuildEventContext.InvalidTargetId, BuildEventContext.InvalidProjectContextId, BuildEventContext.InvalidTaskId)); - project1Started.BuildEventContext = new BuildEventContext(1, 1, 1, 1); - es.RaiseProjectStartedEvent(null, project1Started); - TargetStartedEventArgs targetStarted1 = new TargetStartedEventArgs(null, null, "t", null, null); - targetStarted1.BuildEventContext = project1Started.BuildEventContext; - // TargetStarted Event - es.RaiseTargetStartedEvent(null, targetStarted1); - - TaskStartedEventArgs taskStarted1 = new TaskStartedEventArgs(null, null, null, null, "task"); - taskStarted1.BuildEventContext = project1Started.BuildEventContext; - // TaskStarted Event - es.RaiseTaskStartedEvent(null, taskStarted1); - - BuildMessageEventArgs messsage1 = new BuildMessageEventArgs(null, null, null, MessageImportance.High); - messsage1.BuildEventContext = project1Started.BuildEventContext; - // Message Event - es.RaiseMessageEvent(null, messsage1); - TaskFinishedEventArgs taskFinished1 = new TaskFinishedEventArgs(null, null, null, null, "task", true); - taskFinished1.BuildEventContext = project1Started.BuildEventContext; - // TaskFinished Event - es.RaiseTaskFinishedEvent(null, taskFinished1); - - TargetFinishedEventArgs targetFinished1 = new TargetFinishedEventArgs(null, null, "t", null, null, true); - targetFinished1.BuildEventContext = project1Started.BuildEventContext; - // TargetFinished Event - es.RaiseTargetFinishedEvent(null, targetFinished1); - - ProjectStartedEventArgs project2Started = new ProjectStartedEventArgs(2, null, null, "p2", "t2", null, null, project1Started.BuildEventContext); - //Project Started Event - project2Started.BuildEventContext = new BuildEventContext(2, 2, 2, 2); - es.RaiseProjectStartedEvent(null, project2Started); - TargetStartedEventArgs targetStarted2 = new TargetStartedEventArgs(null, null, "t2", null, null); - targetStarted2.BuildEventContext = project2Started.BuildEventContext; - // TargetStarted Event - es.RaiseTargetStartedEvent(null, targetStarted2); - - TaskStartedEventArgs taskStarted2 = new TaskStartedEventArgs(null, null, null, null, "task2"); - taskStarted2.BuildEventContext = project2Started.BuildEventContext; - // TaskStarted Event - es.RaiseTaskStartedEvent(null, taskStarted2); - - BuildMessageEventArgs messsage2 = new BuildMessageEventArgs(null, null, null, MessageImportance.High); - messsage2.BuildEventContext = project2Started.BuildEventContext; - // Message Event - es.RaiseMessageEvent(null, messsage2); - TaskFinishedEventArgs taskFinished2 = new TaskFinishedEventArgs(null, null, null, null, "task2", true); - taskFinished2.BuildEventContext = project2Started.BuildEventContext; - // TaskFinished Event - es.RaiseTaskFinishedEvent(null, taskFinished2); - - TargetFinishedEventArgs targetFinished2 = new TargetFinishedEventArgs(null, null, "t2", null, null, true); - targetFinished2.BuildEventContext = project2Started.BuildEventContext; - // TargetFinished Event - es.RaiseTargetFinishedEvent(null, targetFinished2); - - ProjectFinishedEventArgs finished2 = new ProjectFinishedEventArgs(null, null, "p2", true); - finished2.BuildEventContext = project2Started.BuildEventContext; - // ProjectFinished Event - es.RaiseProjectFinishedEvent(null, finished2); // BuildFinished Event - - ProjectFinishedEventArgs finished1 = new ProjectFinishedEventArgs(null, null, "p", true); - finished1.BuildEventContext = project1Started.BuildEventContext; - // ProjectFinished Event - es.RaiseProjectFinishedEvent(null, finished1); // BuildFinished Event - es.RaiseBuildFinishedEvent(null, - new BuildFinishedEventArgs("bf", - null, true)); - // Log so far - string actualLog = sc.ToString(); - - Console.WriteLine("=="); - Console.WriteLine(sc.ToString()); - Console.WriteLine("=="); - - // Verify that the log has perf summary - // Project perf summary - Assertion.Assert(actualLog.Contains(prjPerfString)); - // Target perf summary - Assertion.Assert(actualLog.Contains(targetPerfString)); - // Task Perf summary - Assertion.Assert(actualLog.Contains(taskPerfString)); - - // Clear the log obtained so far - sc.Clear(); - - // BuildStarted event - es.RaiseBuildStartedEvent(null, - new BuildStartedEventArgs("bs", null)); - // BuildFinished - es.RaiseBuildFinishedEvent(null, - new BuildFinishedEventArgs("bf", - null, true)); - // Log so far - actualLog = sc.ToString(); - - Console.WriteLine("=="); - Console.WriteLine(sc.ToString()); - Console.WriteLine("=="); - - // Verify that the log doesn't have perf summary - Assertion.Assert(!actualLog.Contains(prjPerfString)); - Assertion.Assert(!actualLog.Contains(targetPerfString)); - Assertion.Assert(!actualLog.Contains(taskPerfString)); - } - } - - - [Test] - public void DeferredMessages() - { - EventSource es = new EventSource(); - //Create a simulated console - SimulatedConsole sc = new SimulatedConsole(); - // Create a ConsoleLogger with Detailed verbosity - ConsoleLogger L = new ConsoleLogger(LoggerVerbosity.Detailed, sc.Write, sc.SetColor, sc.ResetColor); - L.Initialize(es, 2); - es.RaiseBuildStartedEvent(null, new BuildStartedEventArgs("bs", null)); - TaskCommandLineEventArgs messsage1 = new TaskCommandLineEventArgs("Message", null, MessageImportance.High); - messsage1.BuildEventContext = new BuildEventContext(1, 1, 1, 1); - // Message Event - es.RaiseMessageEvent(null, messsage1); - es.RaiseBuildFinishedEvent(null, - new BuildFinishedEventArgs("bf", - null, true)); - string actualLog = sc.ToString(); - Assertion.Assert(actualLog.Contains(ResourceUtilities.FormatResourceString("DeferredMessages"))); - - es = new EventSource(); - sc = new SimulatedConsole(); - // Create a ConsoleLogger with Normal verbosity - L = new ConsoleLogger(LoggerVerbosity.Normal, sc.Write, sc.SetColor, sc.ResetColor); - L.Initialize(es, 2); - es.RaiseBuildStartedEvent(null, new BuildStartedEventArgs("bs", null)); - BuildMessageEventArgs messsage2 = new BuildMessageEventArgs("Message", null, null, MessageImportance.High); - messsage2.BuildEventContext = new BuildEventContext(1, 1, 1, 1); - // Message Event - es.RaiseMessageEvent(null, messsage2); - es.RaiseBuildFinishedEvent(null, - new BuildFinishedEventArgs("bf", - null, true)); - actualLog = sc.ToString(); - Assertion.Assert(actualLog.Contains(ResourceUtilities.FormatResourceString("DeferredMessagesAvailiable"))); - - es = new EventSource(); - sc = new SimulatedConsole(); - // Create a ConsoleLogger with Normal verbosity - L = new ConsoleLogger(LoggerVerbosity.Normal, sc.Write, sc.SetColor, sc.ResetColor); - L.Initialize(es, 2); - es.RaiseBuildStartedEvent(null, new BuildStartedEventArgs("bs", null)); - messsage2 = new BuildMessageEventArgs("Message", null, null, MessageImportance.High); - messsage2.BuildEventContext = new BuildEventContext(1, 1, 1, 1); - // Message Event - es.RaiseMessageEvent(null, messsage2); - ProjectStartedEventArgs project = new ProjectStartedEventArgs(1,"Hello,","HI","None","Build",null,null, messsage1.BuildEventContext); - project.BuildEventContext = messsage1.BuildEventContext; - es.RaiseProjectStartedEvent(null, project); - es.RaiseBuildFinishedEvent(null, - new BuildFinishedEventArgs("bf", - null, true)); - actualLog = sc.ToString(); - Assertion.Assert(actualLog.Contains("Message")); - } - - [Test] - public void VerifyMPLoggerSwitch() - { - for (int i = 0; i < 2; i++) - { - EventSource es = new EventSource(); - //Create a simulated console - SimulatedConsole sc = new SimulatedConsole(); - // Create a ConsoleLogger with Normal verbosity - ConsoleLogger L = new ConsoleLogger(LoggerVerbosity.Normal, sc.Write, sc.SetColor, sc.ResetColor); - //Make sure the MPLogger switch will property work on both Initialize methods - L.Parameters = "EnableMPLogging"; - if (i == 0) - { - L.Initialize(es, 1); - } - else - { - L.Initialize(es); - } - es.RaiseBuildStartedEvent(null, new BuildStartedEventArgs("bs", null)); - BuildEventContext context = new BuildEventContext(1, 1, 1, 1); - BuildEventContext context2 = new BuildEventContext(2, 2, 2, 2); - - ProjectStartedEventArgs project = new ProjectStartedEventArgs(1, "Hello,", "HI", "None", "Build", null, null, context); - project.BuildEventContext = context; - es.RaiseProjectStartedEvent(null, project); - - TargetStartedEventArgs targetStarted1 = new TargetStartedEventArgs(null, null, "t", null, null); - targetStarted1.BuildEventContext = context; - es.RaiseTargetStartedEvent(null, targetStarted1); - - BuildMessageEventArgs messsage1 = new BuildMessageEventArgs("Message", null, null, MessageImportance.High); - messsage1.BuildEventContext = context; - es.RaiseMessageEvent(null, messsage1); - string actualLog = sc.ToString(); - string resourceString = ResourceUtilities.FormatResourceString("ProjectStartedTopLevelProjectWithTargetNames", "None", 1, "Build"); - Assertion.Assert(actualLog.Contains(resourceString)); - } - } - - [Test] - public void TestPrintTargetNamePerMessage() - { - EventSource es = new EventSource(); - //Create a simulated console - SimulatedConsole sc = new SimulatedConsole(); - // Create a ConsoleLogger with Normal verbosity - ConsoleLogger L = new ConsoleLogger(LoggerVerbosity.Normal, sc.Write, sc.SetColor, sc.ResetColor); - L.Initialize(es, 2); - es.RaiseBuildStartedEvent(null, new BuildStartedEventArgs("bs", null)); - BuildEventContext context =new BuildEventContext(1, 1, 1, 1); - BuildEventContext context2 =new BuildEventContext(2, 2, 2, 2); - - ProjectStartedEventArgs project = new ProjectStartedEventArgs(1, "Hello,", "HI", "None", "Build", null, null, context); - project.BuildEventContext = context; - es.RaiseProjectStartedEvent(null, project); - - ProjectStartedEventArgs project2 = new ProjectStartedEventArgs(2, "Hello,", "HI", "None", "Build", null, null, context2); - project2.BuildEventContext = context2; - es.RaiseProjectStartedEvent(null, project2); - - TargetStartedEventArgs targetStarted1 = new TargetStartedEventArgs(null, null, "t", null, null); - targetStarted1.BuildEventContext = context; - es.RaiseTargetStartedEvent(null, targetStarted1); - - TargetStartedEventArgs targetStarted2 = new TargetStartedEventArgs(null, null, "t2", null, null); - targetStarted2.BuildEventContext = context2; - es.RaiseTargetStartedEvent(null, targetStarted2); - - BuildMessageEventArgs messsage1 = new BuildMessageEventArgs("Message", null, null,MessageImportance.High); - messsage1.BuildEventContext = context; - BuildMessageEventArgs messsage2 = new BuildMessageEventArgs("Message2", null, null, MessageImportance.High); - messsage2.BuildEventContext = context2; - BuildMessageEventArgs messsage3 = new BuildMessageEventArgs("Message3", null, null, MessageImportance.High); - messsage3.BuildEventContext = context; - es.RaiseMessageEvent(null, messsage1); - es.RaiseMessageEvent(null, messsage2); - es.RaiseMessageEvent(null, messsage3); - string actualLog = sc.ToString(); - Assertion.Assert(actualLog.Contains("t:")); - } - - /// - /// Verify that in the MP case and the older serial logger that there is no extra newline after the project done event. - /// We cannot verify there is a newline after the project done event for the MP single proc log because - /// nunit is showing up as an unknown output type, this causes us to not print the newline because we think it may be to a - /// text file. - /// - [Test] - public void TestNewLineAfterProjectFinished() - { - - for (int i = 0; i < 3; i++) - { - Console.Out.WriteLine("Iteration of I is {" + i + "}"); - - - EventSource es = new EventSource(); - //Create a simulated console - SimulatedConsole sc = new SimulatedConsole(); - ConsoleLogger L = new ConsoleLogger(LoggerVerbosity.Normal, sc.Write, sc.SetColor, sc.ResetColor); - - if (i < 2) - { - // On the second pass through use the MP single proc logger - if (i == 1) - { - - L.Parameters = "EnableMPLogging"; - } - // Use the old single proc logger - L.Initialize(es, 1); - } - else - { - // Use the parallel logger - L.Initialize(es, 2); - } - - es.RaiseBuildStartedEvent(null, new BuildStartedEventArgs("bs", null)); - BuildEventContext context = new BuildEventContext(1, 1, 1, 1); - - ProjectStartedEventArgs project = new ProjectStartedEventArgs(1, "Hello,", "HI", "None", "Build", null, null, context); - project.BuildEventContext = context; - es.RaiseProjectStartedEvent(null, project); - - TargetStartedEventArgs targetStarted1 = new TargetStartedEventArgs(null, null, "t", null, null); - targetStarted1.BuildEventContext = context; - es.RaiseTargetStartedEvent(null, targetStarted1); - - BuildMessageEventArgs messsage1 = new BuildMessageEventArgs("Message", null, null, MessageImportance.High); - messsage1.BuildEventContext = context; - es.RaiseMessageEvent(null, messsage1); - - ProjectFinishedEventArgs projectFinished = new ProjectFinishedEventArgs("Finished,", "HI", "projectFile", true); - projectFinished.BuildEventContext = context; - es.RaiseProjectFinishedEvent(null, projectFinished); - - string actualLog = sc.ToString(); - - switch(i) - { - case 0: - // There is no project finished event printed in normal verbosity - Assertion.Assert(!actualLog.Contains(projectFinished.Message)); - break; - // In both case 1 and case 2 verify that there is no extra newline after the done event (this is because the nunit console is seen as an unknown device - // and we do not want the extra newline in something other than a console device. - case 1: - case 2: - Assertion.Assert(actualLog.Contains(ResourceUtilities.FormatResourceString("ProjectFinishedPrefixWithTargetNamesMultiProc", "None", "Build") + Environment.NewLine)); - Assertion.Assert(!actualLog.Contains(ResourceUtilities.FormatResourceString("ProjectFinishedPrefixWithTargetNamesMultiProc", "None", "Build") + Environment.NewLine + Environment.NewLine)); - break; - } - } - } - - } -} - diff --git a/src/Deprecated/Engine.UnitTests/CopyOnWriteHashtable_Tests.cs b/src/Deprecated/Engine.UnitTests/CopyOnWriteHashtable_Tests.cs deleted file mode 100644 index 0a277eee44a..00000000000 --- a/src/Deprecated/Engine.UnitTests/CopyOnWriteHashtable_Tests.cs +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections; -using System.Text; -using NUnit.Framework; -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class CopyOnWriteHashtable_Tests - { - [Test] - public void Basic() - { - CopyOnWriteHashtable c = new CopyOnWriteHashtable(StringComparer.OrdinalIgnoreCase); - CopyOnWriteHashtable b = (CopyOnWriteHashtable)c.Clone(); - CopyOnWriteHashtable a = (CopyOnWriteHashtable)b.Clone(); - - c["Foo"] = "Bar"; - - // Just wrote to 'c' so it should contain data. - Assertion.Assert(c.ContainsKey("Foo")); - - // Writing to a depended upon hashtable should not be visible to the dependents. - Assertion.Assert(!a.ContainsKey("Foo")); - Assertion.Assert(!b.ContainsKey("Foo")); - } - - [Test] - public void Regress_SettingWhenValueNull() - { - CopyOnWriteHashtable c = new CopyOnWriteHashtable(StringComparer.OrdinalIgnoreCase); - CopyOnWriteHashtable refc = new CopyOnWriteHashtable(c, StringComparer.OrdinalIgnoreCase); - Hashtable h = new Hashtable(); - - refc["key"] = null; - h["key"] = null; - - Assertion.AssertEquals(h.ContainsKey("key"), refc.ContainsKey("key")); - Assertion.Assert(!c.ContainsKey("key")); - } - - - [Test] - [ExpectedException(typeof(InternalErrorException))] - public void Regress450669_CaseSensitiveBatch_WeDontAllowChangingCaseOnCopiedHashTable() - { - CopyOnWriteHashtable c = new CopyOnWriteHashtable(StringComparer.OrdinalIgnoreCase); - CopyOnWriteHashtable refc = new CopyOnWriteHashtable(c, StringComparer.Ordinal); // Different case. - } - - [Test] - public void Regress450669_CaseSensitiveBatch_HashtableCopyRespectsComparer() - { - Hashtable c = new Hashtable(StringComparer.OrdinalIgnoreCase); - c["key"] = null; - CopyOnWriteHashtable refc = new CopyOnWriteHashtable(c, StringComparer.OrdinalIgnoreCase); - - Assertion.Assert(c.ContainsKey("kEy")); - Assertion.Assert(refc.ContainsKey("kEy")); - } - - /// - /// Missing unittest found by mutation testing. - /// REASON TEST WASN'T ORIGINALLY PRESENT: (Note 1) - /// - /// In this test, verify that a CopyOnWriteHashtable passed through the constructor that - /// accepts an IDictionary results in a shallow copy not a deep copy. - /// - [Test] - public void Regress_Mutation_ConstructThroughDictionaryIsShallowCopy() - { - CopyOnWriteHashtable c = new CopyOnWriteHashtable(StringComparer.OrdinalIgnoreCase); - CopyOnWriteHashtable refc = new CopyOnWriteHashtable((IDictionary)c, StringComparer.OrdinalIgnoreCase); - - Assertion.Assert(refc.IsShallowCopy); - } - - /// - /// Missing unittest found by mutation testing. - /// REASON TEST WASN'T ORIGINALLY PRESENT: (Note 1) - /// - /// In this test, verify that writing a value that exists already in a shallow copy - /// doesn't cause a deep copy of the hash table. - /// - [Test] - public void Regress_Mutation_WritingSameValueShouldNotCauseDeepCopy() - { - CopyOnWriteHashtable c = new CopyOnWriteHashtable(StringComparer.OrdinalIgnoreCase); - c["answer"] = "yes"; - CopyOnWriteHashtable refc = new CopyOnWriteHashtable(c, StringComparer.OrdinalIgnoreCase); - - Assertion.Assert(refc.IsShallowCopy); - refc["answer"] = "yes"; - Assertion.Assert(refc.IsShallowCopy); // Setting the same value should not cause a deep copy. - } - - - /// - /// Missing unittest found by mutation testing. - /// REASON TEST WASN'T ORIGINALLY PRESENT: This is a design change, we require a string comparer - /// in all cases because we can't construct a deep copy without always knowing what string - /// comparer to use. - /// - /// In this test, try to construct a CopyOnWriteHashtable with no string comparer. - /// - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void Regress_Mutation_MustHaveNonNullStringComparer() - { - CopyOnWriteHashtable c = new CopyOnWriteHashtable(null); - } - - /// - /// Missing unittest found by mutation testing. - /// REASON TEST WASN'T ORIGINALLY PRESENT: This is a design change, we require a string comparer - /// in all cases because we can't construct a deep copy without always knowing what string - /// comparer to use. - /// - /// In this test, try to construct a CopyOnWriteHashtable with no string comparer. - /// - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void Regress_Mutation_MustHaveNonNullStringComparer2() - { - CopyOnWriteHashtable c = new CopyOnWriteHashtable(null, null); - } - - /// - /// Missing unittest found by mutation testing. - /// REASON TEST WASN'T ORIGINALLY PRESENT: Missed test. - /// - /// In this test, make sure Clear works on shallow-copy hashtable. - /// - [Test] - public void Regress_Mutation_ClearReadOnlyData() - { - CopyOnWriteHashtable c = new CopyOnWriteHashtable(StringComparer.OrdinalIgnoreCase); - c["key"] = "value"; - CopyOnWriteHashtable refc = new CopyOnWriteHashtable(c, StringComparer.OrdinalIgnoreCase); - - Assertion.Assert(refc.ContainsKey("key")); - Assertion.Assert(refc.IsShallowCopy); - c.Clear(); - Assertion.Assert(refc.ContainsKey("key")); - Assertion.Assert(!c.ContainsKey("key")); - } - - /* - * Root cause analysis: reasons for missing tests: - * - * (Note 1) It was intended that the user of CopyOnWriteHashtable should not be able to detect - * whether a shallow copy or deep copy was made. So there was no way to unittest this. - * This test required adding 'IsShallowCopy' to detect this case. - * - */ - } -} diff --git a/src/Deprecated/Engine.UnitTests/DualQueue_Tests.cs b/src/Deprecated/Engine.UnitTests/DualQueue_Tests.cs deleted file mode 100644 index a534f048eb9..00000000000 --- a/src/Deprecated/Engine.UnitTests/DualQueue_Tests.cs +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections.Generic; -using System.Collections; -using System.Text; -using System.Threading; -using NUnit.Framework; -using Microsoft.Build.BuildEngine; -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class DualQueue_Tests - { - /// - /// Test the dual queue with multiple writers and only one reader - /// - /// cmann - [Test] - public void TestQueueEnqueueMultipleWriterOneReader() - { - // Queue which will contain elements added using a single Enqueue per item - DualQueue stringQueue = new DualQueue(); - // Queue which will contain elements added using an EnqueueArray for a group of Items - DualQueue stringQueueTwo = new DualQueue(); - // List of strings which are supposed to be in the queue - List stringsSupposedToBeInQueue = new List(); - // List of strings which are supposed to be in the queue which uses EnQueueArray - List stringsSupposedToBeInQueueTwo = new List(); - - // Array containing our set of ManualResetEvents which is the number of threads we are going to use - ManualResetEvent[] waitHandles = new ManualResetEvent[50]; - for (int i = 0; i < waitHandles.Length; i++) - { - waitHandles[i] = new ManualResetEvent(false); - ThreadPool.QueueUserWorkItem( - delegate(object state) - { - // Create three non repeating strings to put in the the different queues - string string1 = System.Guid.NewGuid().ToString(); - string string2 = System.Guid.NewGuid().ToString(); - string string3 = System.Guid.NewGuid().ToString(); - - stringQueue.Enqueue(string1); - lock (stringsSupposedToBeInQueue) - { - stringsSupposedToBeInQueue.Add(string1); - } - - stringQueueTwo.EnqueueArray(new string[] { string2, string3 }); - lock (stringsSupposedToBeInQueueTwo) - { - stringsSupposedToBeInQueueTwo.Add(string2); - stringsSupposedToBeInQueueTwo.Add(string3); - } - - // Say we are done the thread - ((ManualResetEvent)state).Set(); - }, waitHandles[i]); - } - - // Wait for all of the threads to complete - foreach (ManualResetEvent resetEvent in waitHandles) - { - resetEvent.WaitOne(); - } - - // Pop off items from the queue and make sure that we got all of out items back out - int numberOfItemsInQueue = 0; - string result = null; - while ((result = stringQueue.Dequeue()) != null) - { - Assert.IsTrue(stringsSupposedToBeInQueue.Contains(result),string.Format("Expected {0} to be in the queue but it was not",result)); - stringsSupposedToBeInQueue.Remove(result); - numberOfItemsInQueue++; - } - Assert.IsTrue(stringsSupposedToBeInQueue.Count == 0, "Expected all strings to be removed but they were not"); - // The number of items we processed should be the same as the number of EnQueues we did - Assert.IsTrue(numberOfItemsInQueue == waitHandles.Length,"Expected the number of items in the queue to be the same as the number of Enqueues but it was not"); - - // Pop off items from the queue and make sure that we got all of out items back out - int numberOfItemsInQueueTwo = 0; - string result2 = null; - while ((result2 = stringQueueTwo.Dequeue()) != null) - { - Assert.IsTrue(stringsSupposedToBeInQueueTwo.Contains(result2), string.Format("Expected {0} to be in the queue number 2 but it was not", result2)); - stringsSupposedToBeInQueueTwo.Remove(result2); - numberOfItemsInQueueTwo++; - } - Assert.IsTrue(stringsSupposedToBeInQueueTwo.Count == 0, "Expected all strings to be removed in queue 2 but they were not"); - // The number of items we processed should be the same as the number of EnQueues we did - Assert.IsTrue(numberOfItemsInQueueTwo == waitHandles.Length*2, "Expected the number of items in the queue 2 to be the same as the number of Enqueues but it was not"); - - // Clear the queue - stringQueue.Clear(); - Assert.IsTrue(stringQueue.Count == 0, "The count should be zero after clearing the queue"); - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/EngineLoggingServices_Tests.cs b/src/Deprecated/Engine.UnitTests/EngineLoggingServices_Tests.cs deleted file mode 100644 index 0bed8bf8274..00000000000 --- a/src/Deprecated/Engine.UnitTests/EngineLoggingServices_Tests.cs +++ /dev/null @@ -1,1448 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections.Generic; -using System.Collections; -using System.Text; -using System.Threading; -using NUnit.Framework; -using Microsoft.Build.BuildEngine; -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine.Shared; -using System.Diagnostics; -using System.Reflection; - -// All of these tests were created by Chris Mann and Jeff Callahan -namespace Microsoft.Build.UnitTests -{ - #region EngineLoggingHelper - /// - /// This class is a basic implementation of EngineLoggingServices so that we can try and test the abstract EngineLoggingServices - /// class without a lot of other methods being added - /// - internal class EngineLoggingServicesHelper : EngineLoggingServices - { - /// - /// Reading queue - /// - DualQueue currentQueueBuildEvent; - /// - /// Reading queue - /// - DualQueue currentQueueNodeEvent; - - internal EngineLoggingServicesHelper() - { - base.Initialize(new ManualResetEvent(false)); - } - - /// - /// We dont need to do anything to process events, we just want to get what events are in the queue - /// - internal override bool ProcessPostedLoggingEvents() - { - currentQueueBuildEvent = loggingQueueOfBuildEvents; - currentQueueNodeEvent = loggingQueueOfNodeEvents; - - return true; - } - - /// - /// Note that this "get" indirectly calls GetCurrentReadingQueue() which - /// returns references to distinct queues on sequential calls; in other - /// words this property has side effects on the internal data structures. - /// - internal DualQueue GetCurrentQueueBuildEvents() - { - ProcessPostedLoggingEvents(); - return currentQueueBuildEvent; - } - - /// - /// Note that this "get" indirectly calls GetCurrentReadingQueue() which - /// returns references to distinct queues on sequential calls; in other - /// words this property has side effects on the internal data structures. - /// - internal DualQueue GetCurrentQueueNodeEvents() - { - ProcessPostedLoggingEvents(); - return loggingQueueOfNodeEvents; - } - - } - #endregion - - [TestFixture] - public class EngineLoggingServices_Tests - { - // A simple implementation of the abstract class EngineLoggingServices - EngineLoggingServicesHelper engineLoggingServicesHelper; - - /// - /// Generate a generic BuildErrorEventArgs - /// - /// message to put in the event - /// Event - private BuildErrorEventArgs GenerateBuildErrorEventArgs(string message) - { - return new BuildErrorEventArgs("SubCategory", "code", null, 0, 1, 2, 3, message, "Help", "EngineLoggingServicesTest"); - } - - /// - /// Generate a generic BuildWarningEventArgs - /// - /// message to put in the event - /// Event - private BuildWarningEventArgs GenerateBuildWarningEventArgs(string message) - { - return new BuildWarningEventArgs("SubCategory", "code", null, 0, 1, 2, 3, message, "warning", "EngineLoggingServicesTest"); - } - - /// - /// Generate a generic BuildMessageEventArgs - /// - /// message to put in the event - /// importance for the message - /// Event - private BuildMessageEventArgs GenerateBuildMessageEventArgs(string message, MessageImportance importance) - { - return new BuildMessageEventArgs(message, "HelpKeyword", "senderName", importance); - } - - /// - /// A basic event derived from the abstract class CustomBuildEventArgs - /// - class MyCustomBuildEventArgs : CustomBuildEventArgs - { - public MyCustomBuildEventArgs() : base() { } - public MyCustomBuildEventArgs(string message) : base(message, "HelpKeyword", "SenderName") { } - } - - /// - /// A custom BuildEventArgs derived from a CustomBuildEventArgs - /// - /// message to put in the event - /// - private MyCustomBuildEventArgs GenerateBuildCustomEventArgs(string message) - { - return new MyCustomBuildEventArgs("testCustomBuildEvent"); - } - - [SetUp] - public void SetUp() - { - engineLoggingServicesHelper = new EngineLoggingServicesHelper(); - } - - [TearDown] - public void TearDown() - { - engineLoggingServicesHelper = null; - } - - #region TestEventBasedLoggingMethods - /// - /// Test the logging of and ErrorEvent - /// - [Test] - public void LogErrorEvent() - { - List eventList = new List(); - - // Log a number of events and then make sure that queue at the end contains all of those events - for (int i = 0; i < 10; i++) - { - BuildErrorEventArgs eventToAdd = GenerateBuildErrorEventArgs("ErrorMessage" + i); - eventList.Add(eventToAdd); - engineLoggingServicesHelper.LogErrorEvent(eventToAdd); - } - - // Get the logging queue after we have logged a number of messages - DualQueue currentQueue = engineLoggingServicesHelper.GetCurrentQueueBuildEvents(); - - // Assert that every event we sent to the logger exists in the queue - Assert.IsTrue(eventList.TrueForAll(delegate(BuildEventArgs args) - { - return currentQueue.Contains(args); - }), "Expected to find all events sent to LogErrorEvent"); - - // Assert that every event in the queue is of the correct type - AssertForEachEventInQueue(currentQueue, IsInstanceOfType); - } - - /// - /// Test the case where null events are attempted to be logged - /// - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void LogErrorEventNullEvent() - { - engineLoggingServicesHelper.LogErrorEvent(null); - } - - /// - /// Test warning events - /// - [Test] - public void LogWarningEvent() - { - List eventList = new List(); - - // Log a number of events - for (int i = 0; i < 10; i++) - { - BuildWarningEventArgs eventToAdd = GenerateBuildWarningEventArgs("WarningMessage" + i); - eventList.Add(eventToAdd); - engineLoggingServicesHelper.LogWarningEvent(eventToAdd); - } - - // Get the logged event queue from the "logger" - DualQueue currentQueue = engineLoggingServicesHelper.GetCurrentQueueBuildEvents(); - - // Assert that every event we sent to the logger now exists in the queue - Assert.IsTrue(eventList.TrueForAll(delegate(BuildEventArgs args) - { - return currentQueue.Contains(args); - }), "Expected to find all events sent to LogWarningEvent"); - - // Assert that every event in the queue is of the correct type - AssertForEachEventInQueue(currentQueue, IsInstanceOfType); - } - - /// - /// Test the case where we attempt to log a null warning event - /// - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void LogWarningEventNullEvent() - { - engineLoggingServicesHelper.LogWarningEvent(null); - } - - /// - /// Test the case where we try and log a null message event - /// - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void LogMessageEventNullEvent() - { - // Try and log a null when we are only going to log critical events - try - { - engineLoggingServicesHelper.OnlyLogCriticalEvents = true; - engineLoggingServicesHelper.LogMessageEvent(null); - engineLoggingServicesHelper.OnlyLogCriticalEvents = false; - } - catch (Exception e) - { - Assert.Fail(e.Message + " Should not throw exception if OnlyLogCriticalEvents is true"); - } - - // Should throw an exception as OnlyLogCriticalEvents is false and the null check is performed - engineLoggingServicesHelper.LogMessageEvent(null); - } - - /// - /// Test that we can log message events - /// - [Test] - public void LogMessageEvent() - { - List eventList = new List(); - - // Log a number of message events and keep track of the events we tried to log - for (int i = 0; i < 10; i++) - { - BuildMessageEventArgs eventToAdd = GenerateBuildMessageEventArgs("MessageMessage" + i, MessageImportance.Normal); - eventList.Add(eventToAdd); - engineLoggingServicesHelper.LogMessageEvent(eventToAdd); - } - - // Get the queue of the events logged by the logger - DualQueue currentQueue = engineLoggingServicesHelper.GetCurrentQueueBuildEvents(); - - // Assert that every event we sent to the logger exists in the logging queue - Assert.IsTrue(eventList.TrueForAll(delegate(BuildEventArgs args) - { - return currentQueue.Contains(args); - }), "Expected to find all events sent to LogMessageEvent"); - - // Assert that every event in the queue is of the correct type - AssertForEachEventInQueue(currentQueue, IsInstanceOfType); - } - - /// - /// Test the case where we try and log a null event - /// - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void PostLoggingEventNullEvent() - { - BuildEventArgs nullEvent = null; - engineLoggingServicesHelper.PostLoggingEvent(nullEvent); - } - - /// - /// Test the case where we try and log a null CustomEvent - /// - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void LogCustomEventNullEvent() - { - engineLoggingServicesHelper.LogCustomEvent(null); - } - - /// - /// Test that we can log CustomEvents - /// - [Test] - public void LogCustomEvent() - { - List eventList = new List(); - - // Log a number of events and keep track of which events we sent to the logger - for (int i = 0; i < 10; i++) - { - MyCustomBuildEventArgs eventToAdd = GenerateBuildCustomEventArgs("CustomMessage" + i); - eventList.Add(eventToAdd); - engineLoggingServicesHelper.LogCustomEvent(eventToAdd); - } - - // Get the current queue of the logger - DualQueue currentQueue = engineLoggingServicesHelper.GetCurrentQueueBuildEvents(); - - // Assert that every event we sent to the logger exists in the logging queue - Assert.IsTrue(eventList.TrueForAll(delegate(BuildEventArgs args) - { - return currentQueue.Contains(args); - }), "Expected to find all events sent to logcustomevent"); - - // Assert that every event in the queue is of the correct type - AssertForEachEventInQueue(currentQueue, IsInstanceOfType); - } - - /// - /// Test that when we send an event to the logger we should see that same event in the queue - /// - [Test] - public void PostLoggingEventCustomEvent() - { - BuildEventArgs testBuildEventArgs = GenerateBuildCustomEventArgs("CustomMessage"); - engineLoggingServicesHelper.PostLoggingEvent(testBuildEventArgs); - Assert.IsTrue(engineLoggingServicesHelper.GetCurrentQueueBuildEvents().Contains(testBuildEventArgs), "Expected to find event sent to postloggingevent"); - } - - /// - /// Test that when we send an event to the logger we should see that same event in the queue - /// - [Test] - public void PostLoggingEventErrorEvent() - { - BuildEventArgs testBuildEventArgs = GenerateBuildErrorEventArgs("testErrorBuildEvent"); - engineLoggingServicesHelper.PostLoggingEvent(testBuildEventArgs); - Assert.IsTrue(engineLoggingServicesHelper.GetCurrentQueueBuildEvents().Contains(testBuildEventArgs), "Expected to find event we sent to postloggingevent"); - - } - - /// - /// Test that when we send an event to the logger we should see that same event in the queue - /// - [Test] - public void PostLoggingEventWarningEvent() - { - BuildEventArgs testBuildEventArgs = GenerateBuildWarningEventArgs("testWarningBuildEvent"); - engineLoggingServicesHelper.PostLoggingEvent(testBuildEventArgs); - Assert.IsTrue(engineLoggingServicesHelper.GetCurrentQueueBuildEvents().Contains(testBuildEventArgs), "Expected to find event sent to postloggingevent"); - } - - /// - /// Test that when we send an event to the logger we should see that same event in the queue - /// - [Test] - public void PostLoggingEventMessageEvent() - { - BuildEventArgs testBuildEventArgs = GenerateBuildMessageEventArgs("testMessageBuildEvent", MessageImportance.Normal); - engineLoggingServicesHelper.PostLoggingEvent(testBuildEventArgs); - Assert.IsTrue(engineLoggingServicesHelper.GetCurrentQueueBuildEvents().Contains(testBuildEventArgs), "Expected to find event sent to postloggingevent"); - } - - /// - /// Test that when we send an multiple event to the logger on multiple threads, we should everyone one of those event in the queue - /// - [Test] - public void PostLoggingEventMultiThreaded() - { - List eventsAdded = new List(); - - // Add a number of events on multiple threads - ManualResetEvent[] waitHandles = new ManualResetEvent[10]; - for (int i = 0; i < waitHandles.Length; i++) - { - waitHandles[i] = new ManualResetEvent(false); - ThreadPool.QueueUserWorkItem( - delegate(object state) - { - for (int j = 0; j < 4; j++) - { - BuildEventArgs testBuildEventArgs = GenerateBuildMessageEventArgs("testMessageBuildEvent" + i + "_" + j, MessageImportance.Normal); - lock (eventsAdded) - { - eventsAdded.Add(testBuildEventArgs); - } - engineLoggingServicesHelper.PostLoggingEvent(testBuildEventArgs); - } - ((ManualResetEvent)state).Set(); - }, waitHandles[i]); - } - - // Wait for the threads to finish - foreach (ManualResetEvent resetEvent in waitHandles) - { - resetEvent.WaitOne(); - } - - // Get the current queue - DualQueue currentQueue = engineLoggingServicesHelper.GetCurrentQueueBuildEvents(); - - // Assert that every event we sent to the logger on the multiple threads is in the queue at the end - Assert.IsTrue(eventsAdded.TrueForAll(delegate(BuildEventArgs args) - { - return currentQueue.Contains(args); - }), "Expected to find all events added to queue on multiple threads to be in the queue at the end"); - } - #endregion - - #region TestLogCommentMethods - /// - /// Test logging a null comment to the logger - /// - [Test] - public void LogCommentFromTextNullMessage() - { - // Test the case where we are trying to log a null and we are also trying to log only critical events - try - { - engineLoggingServicesHelper.OnlyLogCriticalEvents = true; - engineLoggingServicesHelper.LogCommentFromText(null,MessageImportance.Low, null); - engineLoggingServicesHelper.OnlyLogCriticalEvents = false; - } - catch (Exception e) - { - Assert.Fail(e.Message + " Should not throw exception if OnlyLogCriticalEvents is true"); - } - - // Would have tested the case where null was passed and critical events is false, but this would cause an assertion window - // to popup thereby failing the test - } - - /// - /// Test logging messages to the logger - /// - [Test] - public void LogCommentFromTextGoodMessages() - { - // Send a message, this message should be posted to the queue - engineLoggingServicesHelper.LogCommentFromText(null, MessageImportance.Low, "Message"); - engineLoggingServicesHelper.LogCommentFromText(null, MessageImportance.Low, string.Empty); - - // Make sure that the one message got posted to the queue - DualQueue currentQueue = engineLoggingServicesHelper.GetCurrentQueueBuildEvents(); - Assert.IsTrue(currentQueue.Count == 2, "Expected to find two events on the queue"); - AssertForEachEventInQueue(currentQueue, IsInstanceOfType); - - } - - /// - /// Test logging message comments to the logger - /// - [Test] - public void LogCommentGoodMessages() - { - // Send a message while not logging critical events, since comments are not considered critical they should - // not show up in the queue - engineLoggingServicesHelper.OnlyLogCriticalEvents = true; - engineLoggingServicesHelper.LogComment((BuildEventContext)null, MessageImportance.Normal, "ErrorConvertedIntoWarning"); - engineLoggingServicesHelper.LogComment((BuildEventContext)null, MessageImportance.Normal, "ErrorConvertedIntoWarning", 3); - engineLoggingServicesHelper.LogComment((BuildEventContext)null, "ErrorConvertedIntoWarning"); - engineLoggingServicesHelper.LogComment((BuildEventContext)null, "ErrorCount", 3); - Assert.IsTrue(engineLoggingServicesHelper.GetCurrentQueueBuildEvents().Count == 0, "Expected to find no events on the queue"); - - // Sent the message while we are logging events, even non critical ones. - engineLoggingServicesHelper.OnlyLogCriticalEvents = false; - engineLoggingServicesHelper.LogComment((BuildEventContext)null, MessageImportance.Normal, "ErrorConvertedIntoWarning"); - engineLoggingServicesHelper.LogComment((BuildEventContext)null, MessageImportance.Normal, "ErrorConvertedIntoWarning", 3); - engineLoggingServicesHelper.LogComment((BuildEventContext)null, "ErrorConvertedIntoWarning"); - engineLoggingServicesHelper.LogComment((BuildEventContext)null, "ErrorCount", 3); - - // Get the queue from the logger - DualQueue currentQueue = engineLoggingServicesHelper.GetCurrentQueueBuildEvents(); - - // Make sure we got all the events we sent to the logger - Assert.IsTrue(currentQueue.Count == 4, "Expected to find four events on the queue"); - - // Make sure that every event in the queue is of the correct type - AssertForEachEventInQueue(currentQueue, IsInstanceOfType); - } - #endregion - - #region TestStartedFinished - /// - /// Test logging the build started event - /// - [Test] - public void LogBuildStarted() - { - engineLoggingServicesHelper.LogBuildStarted(); - DualQueue currentQueue = engineLoggingServicesHelper.GetCurrentQueueBuildEvents(); - Assert.IsTrue(currentQueue.Count == 1, "Expected to find one event in the queue"); - AssertForEachEventInQueue(currentQueue, IsInstanceOfType); - - } - - /// - /// Test logging the build finished event - /// - [Test] - public void LogBuildFinished() - { - engineLoggingServicesHelper.LogBuildFinished(true); - engineLoggingServicesHelper.LogBuildFinished(false); - DualQueue currentQueue = engineLoggingServicesHelper.GetCurrentQueueBuildEvents(); - Assert.IsTrue(currentQueue.Count == 2, "Expected to find two events in the queue"); - AssertForEachEventInQueue(currentQueue, IsInstanceOfType); - } - - /// - /// Checks to make sure that the event passed in is an instance of TType - /// - /// Type of event which should be found - /// Event to check against TType - public void IsInstanceOfType(BuildEventArgs e) - { - Assert.IsTrue(typeof(TType).IsInstanceOfType(e), "Expected event to be a " + typeof(TType).Name); - } - - /// - /// Check that every event in the queue is of the correct event type - /// - /// queue to check - /// An action which determines wheather or not a queue item is correct - private void AssertForEachEventInQueue(DualQueue queue, Action action) - { - BuildEventArgs eventArgs; - - while((eventArgs = queue.Dequeue())!=null) - { - action(eventArgs); - } - } - - /// - /// Test logging of the task started event - /// - [Test] - public void LogTaskStarted() - { - // Test the logging while only logging critical events - engineLoggingServicesHelper.OnlyLogCriticalEvents = true; - engineLoggingServicesHelper.LogTaskStarted(null, "taskName", "projectFile", "projectFileOfTaskNode"); - Assert.IsTrue(engineLoggingServicesHelper.GetCurrentQueueBuildEvents().Count == 0, "Expected to find no events in the queue"); - - // Test logging while logging all events - engineLoggingServicesHelper.OnlyLogCriticalEvents = false; - engineLoggingServicesHelper.LogTaskStarted(null, "taskName", "projectFile", "projectFileOfTaskNode"); - DualQueue currentQueue = engineLoggingServicesHelper.GetCurrentQueueBuildEvents(); - Assert.IsTrue(currentQueue.Count == 1, "Expected to find one event in the queue"); - AssertForEachEventInQueue(currentQueue, IsInstanceOfType); - } - - /// - /// Test that the TaskFinished event logs correctly - /// - [Test] - public void LogTaskFinished() - { - // Test the logging while only logging critical events - engineLoggingServicesHelper.OnlyLogCriticalEvents = true; - engineLoggingServicesHelper.LogTaskFinished(null, "taskName", "projectFile", "projectFileOfTaskNode", true); - Assert.IsTrue(engineLoggingServicesHelper.GetCurrentQueueBuildEvents().Count == 0, "Expected to find no events in the queue"); - - // Test logging while logging all events - engineLoggingServicesHelper.OnlyLogCriticalEvents = false; - engineLoggingServicesHelper.LogTaskFinished(null, "taskName", "projectFile", "projectFileOfTaskNode", true); - DualQueue currentQueue = engineLoggingServicesHelper.GetCurrentQueueBuildEvents(); - Assert.IsTrue(currentQueue.Count == 1, "Expected to find one event in the queue"); - AssertForEachEventInQueue(currentQueue, IsInstanceOfType); - } - - /// - /// Test that the TargetStarted event logs correctly - /// - [Test] - public void LogTargetStarted() - { - // Test logging while only logging critical events - engineLoggingServicesHelper.OnlyLogCriticalEvents = true; - engineLoggingServicesHelper.LogTargetStarted(null, "TargetName", "projectFile", "projectFileOfTargetNode"); - Assert.IsTrue(engineLoggingServicesHelper.GetCurrentQueueBuildEvents().Count == 0, "Expected to find no events in the queue"); - - // Test logging while logging all events - engineLoggingServicesHelper.OnlyLogCriticalEvents = false; - engineLoggingServicesHelper.LogTargetStarted(null, "targetName", "projectFile", "projectFileOfTargetNode"); - DualQueue currentQueue = engineLoggingServicesHelper.GetCurrentQueueBuildEvents(); - Assert.IsTrue(currentQueue.Count == 1, "Expected to find one event in the queue"); - AssertForEachEventInQueue(currentQueue, IsInstanceOfType); - } - - /// - /// Test that TargetFinished logs correctly - /// - [Test] - public void LogTargetFinished() - { - // Test logging while only logging critical events - engineLoggingServicesHelper.OnlyLogCriticalEvents = true; - engineLoggingServicesHelper.LogTargetFinished(null, "TargetName", "projectFile", "projectFileOfTargetNode", true); - Assert.IsTrue(engineLoggingServicesHelper.GetCurrentQueueBuildEvents().Count == 0, "Expected to find no events in the queue"); - - // Test logging while logging all events, even non critical ones - engineLoggingServicesHelper.OnlyLogCriticalEvents = false; - engineLoggingServicesHelper.LogTargetFinished(null, "TargetName", "projectFile", "projectFileOfTargetNode", true); - DualQueue currentQueue = engineLoggingServicesHelper.GetCurrentQueueBuildEvents(); - Assert.IsTrue(currentQueue.Count == 1, "Expected to find one event in the queue"); - AssertForEachEventInQueue(currentQueue, IsInstanceOfType); - } - - /// - /// Test logging the ProjectStarted event - /// - [Test] - public void LogProjectStarted() - { - // Test logging while only logging critical events - engineLoggingServicesHelper.OnlyLogCriticalEvents = true; - engineLoggingServicesHelper.LogProjectStarted(-1, null, null, "projectFile", "targetNames", null, null); - Assert.IsTrue(engineLoggingServicesHelper.GetCurrentQueueBuildEvents().Count == 0, "Expected to find no events in the queue"); - - // Test logging while logging all events, even non critical ones - engineLoggingServicesHelper.OnlyLogCriticalEvents = false; - engineLoggingServicesHelper.LogProjectStarted(-1, null, null, "projectFile", "targetNames", null, null); - DualQueue currentQueue = engineLoggingServicesHelper.GetCurrentQueueBuildEvents(); - Assert.IsTrue(currentQueue.Count == 1, "Expected to find one event in the queue"); - AssertForEachEventInQueue(currentQueue, IsInstanceOfType); - } - - /// - /// Test logging the ProjectFinished event - /// - [Test] - public void LogProjectFinished() - { - // Test logging while only logging critical events - engineLoggingServicesHelper.OnlyLogCriticalEvents = true; - engineLoggingServicesHelper.LogProjectFinished(null, "projectFile", true); - Assert.IsTrue(engineLoggingServicesHelper.GetCurrentQueueBuildEvents().Count == 0, "Expected no events in queue but found some"); - - //Test logging while logging all events, even non critical ones - engineLoggingServicesHelper.OnlyLogCriticalEvents = false; - engineLoggingServicesHelper.LogProjectFinished(null, "projectFile", true); - DualQueue currentQueue = engineLoggingServicesHelper.GetCurrentQueueBuildEvents(); - Assert.IsTrue(currentQueue.Count == 1, "Expected find one item in the queue"); - AssertForEachEventInQueue(currentQueue, IsInstanceOfType); - } - #endregion - - #region LoggingMethodTests - - [Test] - public void LogTaskWarningFromException() - { - engineLoggingServicesHelper.LogTaskWarningFromException(null, new Exception("testException"), new BuildEventFileInfo("noFile"), "taskName"); - engineLoggingServicesHelper.LogTaskWarningFromException(null, null, new BuildEventFileInfo("noFile"), "taskName"); - DualQueue currentQueue = engineLoggingServicesHelper.GetCurrentQueueBuildEvents(); - Assert.IsTrue(currentQueue.Count == 2, "Expected two warnings in queue items"); - AssertForEachEventInQueue(currentQueue, IsInstanceOfType); - } - - [Test] - public void LogErrorWithoutSubcategoryResourceName() - { - engineLoggingServicesHelper.OnlyLogCriticalEvents = true; - engineLoggingServicesHelper.LogError(null, new BuildEventFileInfo("file"), "BuildTargetCompletely", "target"); - DualQueue currentQueue = engineLoggingServicesHelper.GetCurrentQueueBuildEvents(); - Assert.IsTrue(currentQueue.Count == 1, "Expected one event in queue!"); - AssertForEachEventInQueue(currentQueue, IsInstanceOfType); - } - - [Test] - public void LogErrorWithSubcategoryResourceName() - { - engineLoggingServicesHelper.OnlyLogCriticalEvents = true; - engineLoggingServicesHelper.LogError(null, "SubCategoryForSchemaValidationErrors", new BuildEventFileInfo("file"), "BuildTargetCompletely", "target"); - DualQueue currentQueue = engineLoggingServicesHelper.GetCurrentQueueBuildEvents(); - Assert.IsTrue(currentQueue.Count == 1, "Expected one event in queue!"); - AssertForEachEventInQueue(currentQueue, IsInstanceOfType); - } - - [Test] - public void LogErrorFromText() - { - engineLoggingServicesHelper.OnlyLogCriticalEvents = true; - engineLoggingServicesHelper.LogErrorFromText(null, "SubCategoryForSchemaValidationErrors", "MSB4000", "helpKeyword", new BuildEventFileInfo("file"), "error"); - DualQueue currentQueue = engineLoggingServicesHelper.GetCurrentQueueBuildEvents(); - Assert.IsTrue(currentQueue.Count == 1, "Expected one event in queue!"); - AssertForEachEventInQueue(currentQueue, IsInstanceOfType); - } - - [Test] - public void LogWarningWithoutSubcategoryResourceName() - { - engineLoggingServicesHelper.OnlyLogCriticalEvents = true; - engineLoggingServicesHelper.LogWarning(null, new BuildEventFileInfo("file"), "BuildTargetCompletely", "target"); - DualQueue currentQueue = engineLoggingServicesHelper.GetCurrentQueueBuildEvents(); - Assert.IsTrue(currentQueue.Count == 1, "Expected one event in queue!"); - AssertForEachEventInQueue(currentQueue, IsInstanceOfType); - } - - [Test] - public void LogWarningWithSubcategoryResourceName() - { - engineLoggingServicesHelper.OnlyLogCriticalEvents = true; - engineLoggingServicesHelper.LogWarning(null, "SubCategoryForSchemaValidationErrors", new BuildEventFileInfo("file"), "BuildTargetCompletely", "target"); - DualQueue currentQueue = engineLoggingServicesHelper.GetCurrentQueueBuildEvents(); - Assert.IsTrue(currentQueue.Count == 1, "Expected one event in queue!"); - AssertForEachEventInQueue(currentQueue, IsInstanceOfType); - } - - [Test] - public void LogWarningFromText() - { - engineLoggingServicesHelper.OnlyLogCriticalEvents = true; - engineLoggingServicesHelper.LogWarningFromText(null, "SubCategoryForSchemaValidationErrors", "MSB4000", "helpKeyword", new BuildEventFileInfo("file"), "Warning"); - DualQueue currentQueue = engineLoggingServicesHelper.GetCurrentQueueBuildEvents(); - Assert.IsTrue(currentQueue.Count == 1, "Expected one event in queue!"); - AssertForEachEventInQueue(currentQueue, IsInstanceOfType); - } - - [Test] - public void LogInvalidProjectFileError() - { - engineLoggingServicesHelper.OnlyLogCriticalEvents = true; - engineLoggingServicesHelper.LogInvalidProjectFileError(null, new InvalidProjectFileException()); - engineLoggingServicesHelper.LogInvalidProjectFileError(null, new InvalidProjectFileException("invalidProjectFile")); - InvalidProjectFileException invalidProjectFileException = new InvalidProjectFileException("anotherInvalidProjectFile"); - invalidProjectFileException.HasBeenLogged = true; - engineLoggingServicesHelper.LogInvalidProjectFileError(null, invalidProjectFileException); - DualQueue currentQueue = engineLoggingServicesHelper.GetCurrentQueueBuildEvents(); - Assert.IsTrue(currentQueue.Count == 2, "Expected two errors in Queue"); - AssertForEachEventInQueue(currentQueue, IsInstanceOfType); - } - - [Test] - public void LogFatalBuildError() - { - engineLoggingServicesHelper.OnlyLogCriticalEvents = true; - engineLoggingServicesHelper.LogFatalBuildError(null, new Exception("exception1!"), new BuildEventFileInfo("file1")); - engineLoggingServicesHelper.LogFatalBuildError(null, new Exception("exception2!"), new BuildEventFileInfo("file2")); - engineLoggingServicesHelper.LogFatalBuildError(null, new Exception("exception3!"), new BuildEventFileInfo("file3")); - DualQueue currentQueue = engineLoggingServicesHelper.GetCurrentQueueBuildEvents(); - Assert.IsTrue(currentQueue.Count == 3, "Expected three errors in Queue"); - AssertForEachEventInQueue(currentQueue, IsInstanceOfType); - } - - [Test] - public void LogFatalError() - { - engineLoggingServicesHelper.OnlyLogCriticalEvents = true; - engineLoggingServicesHelper.LogFatalError(null, new Exception("exception1"), new BuildEventFileInfo("file1"), "BuildTargetCompletely", "target1"); - engineLoggingServicesHelper.LogFatalError(null, new Exception("exception2"), new BuildEventFileInfo("file2"), "BuildTargetCompletely", "target2"); - engineLoggingServicesHelper.LogFatalError(null, new Exception("exception3"), new BuildEventFileInfo("file3"), "BuildTargetCompletely", "target3"); - DualQueue currentQueue = engineLoggingServicesHelper.GetCurrentQueueBuildEvents(); - Assert.IsTrue(currentQueue.Count == 3, "Expected three errors in Queue"); - AssertForEachEventInQueue(currentQueue, IsInstanceOfType); - - } - - [Test] - public void LogFatalTaskError() - { - engineLoggingServicesHelper.OnlyLogCriticalEvents = true; - engineLoggingServicesHelper.LogFatalTaskError(null, new Exception("exception1"), new BuildEventFileInfo("file1"), "task1"); - engineLoggingServicesHelper.LogFatalTaskError(null, new Exception("exception2"), new BuildEventFileInfo("file2"), "task2"); - engineLoggingServicesHelper.LogFatalTaskError(null, new Exception("exception3"), new BuildEventFileInfo("file3"), "task3"); - DualQueue currentQueue = engineLoggingServicesHelper.GetCurrentQueueBuildEvents(); - Assert.IsTrue(currentQueue.Count == 3, "Expected three errors in Queue"); - AssertForEachEventInQueue(currentQueue, IsInstanceOfType); - } - #endregion - - #region InProcLoggingTests - - internal class VerifyEventSourceHelper - { - public VerifyEventSourceHelper() - { - sourceForEvents = new EventSource(); - sourceForEvents.AnyEventRaised += new AnyEventHandler(this.AnyEventRaised); - sourceForEvents.BuildFinished += new BuildFinishedEventHandler(this.BuildFinished); - sourceForEvents.BuildStarted += new BuildStartedEventHandler(this.BuildStarted); - sourceForEvents.CustomEventRaised += new CustomBuildEventHandler(this.CustomEventRaised); - sourceForEvents.ErrorRaised += new BuildErrorEventHandler(this.ErrorRaised); - sourceForEvents.MessageRaised += new BuildMessageEventHandler(this.MessageRaised); - sourceForEvents.ProjectFinished += new ProjectFinishedEventHandler(this.ProjectFinished); - sourceForEvents.ProjectStarted += new ProjectStartedEventHandler(this.ProjectStarted); - sourceForEvents.TargetFinished += new TargetFinishedEventHandler(this.TargetFinished); - sourceForEvents.TargetStarted += new TargetStartedEventHandler(this.TargetStarted); - sourceForEvents.TaskFinished += new TaskFinishedEventHandler(this.TaskFinished); - sourceForEvents.TaskStarted += new TaskStartedEventHandler(this.TaskStarted); - sourceForEvents.WarningRaised += new BuildWarningEventHandler(this.WarningRaised); - sourceForEvents.StatusEventRaised += new BuildStatusEventHandler(this.StatusRaised); - ClearEvents(); - } - - public void ClearEvents() - { - eventsRaisedHash = new Hashtable(); - eventsRaisedHash.Add("messageRaised", false); - eventsRaisedHash.Add("errorRaised", false); - eventsRaisedHash.Add("warningRaised", false); - eventsRaisedHash.Add("buildStarted", false); - eventsRaisedHash.Add("buildStatus", false); - eventsRaisedHash.Add("buildFinished", false); - eventsRaisedHash.Add("projectStarted", false); - eventsRaisedHash.Add("projectFinished", false); - eventsRaisedHash.Add("targetStarted", false); - eventsRaisedHash.Add("targetFinished", false); - eventsRaisedHash.Add("taskStarted", false); - eventsRaisedHash.Add("taskFinished", false); - eventsRaisedHash.Add("customEventRaised", false); - eventsRaisedHash.Add("anyEventRaised", false); - eventsRaisedHash.Add("statusRaised", false); - - } - #region Fields - Hashtable eventsRaisedHash; - public EventSource sourceForEvents; - #endregion - #region EventHandlers - public void MessageRaised(object sender, BuildMessageEventArgs arg) - { - eventsRaisedHash["messageRaised"] = true; - } - - public void StatusRaised(object sender, BuildStatusEventArgs arg) - { - eventsRaisedHash["statusRaised"] = true; - } - public void ErrorRaised(object sender, BuildErrorEventArgs arg) - { - eventsRaisedHash["errorRaised"] = true; - } - public void WarningRaised(object sender, BuildWarningEventArgs arg) - { - eventsRaisedHash["warningRaised"] = true; - } - public void BuildStarted(object sender, BuildStartedEventArgs arg) - { - eventsRaisedHash["buildStarted"] = true; - } - public void BuildFinished(object sender, BuildFinishedEventArgs arg) - { - eventsRaisedHash["buildFinished"] = true; - } - public void ProjectStarted(object sender, ProjectStartedEventArgs arg) - { - eventsRaisedHash["projectStarted"] = true; - } - public void ProjectFinished(object sender, ProjectFinishedEventArgs arg) - { - eventsRaisedHash["projectFinished"] = true; - } - public void TargetStarted(object sender, TargetStartedEventArgs arg) - { - eventsRaisedHash["targetStarted"] = true; - } - public void TargetFinished(object sender, TargetFinishedEventArgs arg) - { - eventsRaisedHash["targetFinished"] = true; - } - public void TaskStarted(object sender, TaskStartedEventArgs arg) - { - eventsRaisedHash["taskStarted"] = true; - } - public void TaskFinished(object sender, TaskFinishedEventArgs arg) - { - eventsRaisedHash["taskFinished"] = true; - } - public void CustomEventRaised(object sender, CustomBuildEventArgs arg) - { - eventsRaisedHash["customEventRaised"] = true; - } - public void AnyEventRaised(object sender, BuildEventArgs arg) - { - eventsRaisedHash["anyEventRaised"] = true; - } - #endregion - - #region Assertions - public void AssertEventsAndNoOthers(params string[] eventList) - { - List events = new List(eventList); - foreach (string eventKey in eventList) - { - Assert.IsTrue(eventsRaisedHash[eventKey] != null, string.Format("Key {0} was not found in events list", eventKey)); - } - - foreach (string key in eventsRaisedHash.Keys) - { - - if (events.Contains(key)) - { - Assert.IsTrue((bool)(eventsRaisedHash[key]) == true, string.Format("Key {0} Should have been true", key)); - continue; - } - Assert.IsFalse((bool)(eventsRaisedHash[key]) == true, string.Format("Key {0} Should not have been true", key)); - } - } - #endregion - } - internal class MyCustomBuildErrorEventArgs : BuildErrorEventArgs - { - public MyCustomBuildErrorEventArgs() - : base() - { - } - } - - internal class MyCustomBuildWarningEventArgs : BuildWarningEventArgs - { - public MyCustomBuildWarningEventArgs() - : base() - { - } - } - - internal class MyCustomBuildMessageEventArgs : BuildMessageEventArgs - { - public MyCustomBuildMessageEventArgs() - : base() - { - } - } - - internal class MyCustomBuildEventArg : BuildEventArgs - { - public MyCustomBuildEventArg() - : base() - { - } - } - - internal class MyCustomStatusEventArg : BuildStatusEventArgs - { - public MyCustomStatusEventArg() - : base() - { - } - } - - [Test] - public void InProcProcessPostedLoggingEvents() - { - - VerifyEventSourceHelper eventSourceHelper = new VerifyEventSourceHelper(); - - List engines = new List(); - EngineLoggingServicesInProc inProcLoggingServicesEventsAllEvents = new EngineLoggingServicesInProc(eventSourceHelper.sourceForEvents, false, new ManualResetEvent(false)); - EngineLoggingServicesInProc inProcLoggingServicesEventsOnlyCriticalEvents = new EngineLoggingServicesInProc(eventSourceHelper.sourceForEvents, true, new ManualResetEvent(false)); - engines.Add(inProcLoggingServicesEventsAllEvents); - engines.Add(inProcLoggingServicesEventsOnlyCriticalEvents); - - foreach (EngineLoggingServicesInProc inProcLoggingServicesEvents in engines) - { - inProcLoggingServicesEvents.PostLoggingEvent(new BuildMessageEventArgs("Message", "help", "sender", MessageImportance.Low)); - inProcLoggingServicesEvents.ProcessPostedLoggingEvents(); - eventSourceHelper.AssertEventsAndNoOthers("anyEventRaised", "messageRaised"); - eventSourceHelper.ClearEvents(); - - inProcLoggingServicesEvents.PostLoggingEvent(new TaskStartedEventArgs("message", "help", "projectFile", "taskFile", "taskName")); - inProcLoggingServicesEvents.ProcessPostedLoggingEvents(); - eventSourceHelper.AssertEventsAndNoOthers("anyEventRaised", "taskStarted", "statusRaised"); - eventSourceHelper.ClearEvents(); - - inProcLoggingServicesEvents.PostLoggingEvent(new TaskFinishedEventArgs("message", "help", "projectFile", "taskFile", "taskName", true)); - inProcLoggingServicesEvents.ProcessPostedLoggingEvents(); - eventSourceHelper.AssertEventsAndNoOthers("anyEventRaised", "taskFinished", "statusRaised"); - eventSourceHelper.ClearEvents(); - - inProcLoggingServicesEvents.PostLoggingEvent(new TaskCommandLineEventArgs("commandLine", "taskName", MessageImportance.Low)); - inProcLoggingServicesEvents.ProcessPostedLoggingEvents(); - eventSourceHelper.AssertEventsAndNoOthers("anyEventRaised", "messageRaised"); - eventSourceHelper.ClearEvents(); - - inProcLoggingServicesEvents.PostLoggingEvent(new BuildWarningEventArgs("SubCategoryForSchemaValidationErrors", "MSB4000", "file", 1, 2, 3, 4, "message", "help", "sender")); - inProcLoggingServicesEvents.ProcessPostedLoggingEvents(); - eventSourceHelper.AssertEventsAndNoOthers("anyEventRaised", "warningRaised"); - eventSourceHelper.ClearEvents(); - - inProcLoggingServicesEvents.PostLoggingEvent(new BuildErrorEventArgs("SubCategoryForSchemaValidationErrors", "MSB4000", "file", 1, 2, 3, 4, "message", "help", "sender")); - inProcLoggingServicesEvents.ProcessPostedLoggingEvents(); - eventSourceHelper.AssertEventsAndNoOthers("anyEventRaised", "errorRaised"); - eventSourceHelper.ClearEvents(); - - inProcLoggingServicesEvents.PostLoggingEvent(new TargetStartedEventArgs("message", "help", "targetName", "ProjectFile", "targetFile")); - inProcLoggingServicesEvents.ProcessPostedLoggingEvents(); - eventSourceHelper.AssertEventsAndNoOthers("anyEventRaised", "targetStarted", "statusRaised"); - eventSourceHelper.ClearEvents(); - - inProcLoggingServicesEvents.PostLoggingEvent(new TargetFinishedEventArgs("message", "help", "targetName", "ProjectFile", "targetFile", true)); - inProcLoggingServicesEvents.ProcessPostedLoggingEvents(); - eventSourceHelper.AssertEventsAndNoOthers("anyEventRaised", "targetFinished", "statusRaised"); - eventSourceHelper.ClearEvents(); - - inProcLoggingServicesEvents.PostLoggingEvent(new ProjectStartedEventArgs(-1, "message", "help", "ProjectFile", "targetNames", null, null, null)); - inProcLoggingServicesEvents.ProcessPostedLoggingEvents(); - eventSourceHelper.AssertEventsAndNoOthers("anyEventRaised", "projectStarted", "statusRaised"); - eventSourceHelper.ClearEvents(); - - inProcLoggingServicesEvents.PostLoggingEvent(new ProjectFinishedEventArgs("message", "help", "ProjectFile", true)); - inProcLoggingServicesEvents.ProcessPostedLoggingEvents(); - eventSourceHelper.AssertEventsAndNoOthers("anyEventRaised", "projectFinished", "statusRaised"); - eventSourceHelper.ClearEvents(); - - inProcLoggingServicesEvents.PostLoggingEvent(new BuildStartedEventArgs("message", "help")); - inProcLoggingServicesEvents.ProcessPostedLoggingEvents(); - eventSourceHelper.AssertEventsAndNoOthers("anyEventRaised", "buildStarted", "statusRaised"); - eventSourceHelper.ClearEvents(); - - inProcLoggingServicesEvents.PostLoggingEvent(new BuildFinishedEventArgs("message", "help", true)); - inProcLoggingServicesEvents.ProcessPostedLoggingEvents(); - eventSourceHelper.AssertEventsAndNoOthers("anyEventRaised", "buildFinished", "statusRaised"); - eventSourceHelper.ClearEvents(); - - inProcLoggingServicesEvents.PostLoggingEvent(new ExternalProjectStartedEventArgs("message", "help", "senderName", "projectFile", "targetNames")); - inProcLoggingServicesEvents.ProcessPostedLoggingEvents(); - eventSourceHelper.AssertEventsAndNoOthers("anyEventRaised", "customEventRaised"); - eventSourceHelper.ClearEvents(); - - inProcLoggingServicesEvents.PostLoggingEvent(new ExternalProjectFinishedEventArgs("message", "help", "senderName", "projectFile", true)); - inProcLoggingServicesEvents.ProcessPostedLoggingEvents(); - eventSourceHelper.AssertEventsAndNoOthers("anyEventRaised", "customEventRaised"); - eventSourceHelper.ClearEvents(); - - inProcLoggingServicesEvents.PostLoggingEvent(new MyCustomBuildEventArgs()); - inProcLoggingServicesEvents.ProcessPostedLoggingEvents(); - eventSourceHelper.AssertEventsAndNoOthers("anyEventRaised", "customEventRaised"); - eventSourceHelper.ClearEvents(); - - inProcLoggingServicesEvents.PostLoggingEvent(new MyCustomBuildErrorEventArgs()); - inProcLoggingServicesEvents.ProcessPostedLoggingEvents(); - eventSourceHelper.AssertEventsAndNoOthers("anyEventRaised", "errorRaised"); - eventSourceHelper.ClearEvents(); - - inProcLoggingServicesEvents.PostLoggingEvent(new MyCustomBuildWarningEventArgs()); - inProcLoggingServicesEvents.ProcessPostedLoggingEvents(); - eventSourceHelper.AssertEventsAndNoOthers("anyEventRaised", "warningRaised"); - eventSourceHelper.ClearEvents(); - - inProcLoggingServicesEvents.PostLoggingEvent(new MyCustomBuildMessageEventArgs()); - inProcLoggingServicesEvents.ProcessPostedLoggingEvents(); - eventSourceHelper.AssertEventsAndNoOthers("anyEventRaised", "messageRaised"); - eventSourceHelper.ClearEvents(); - - inProcLoggingServicesEvents.PostLoggingEvent(new MyCustomStatusEventArg()); - inProcLoggingServicesEvents.ProcessPostedLoggingEvents(); - eventSourceHelper.AssertEventsAndNoOthers("anyEventRaised", "statusRaised"); - eventSourceHelper.ClearEvents(); - } - } - - - - [Test] - public void TestCheckForFlushing() - { - - VerifyEventSourceHelper eventSourceHelper = new VerifyEventSourceHelper(); - ManualResetEvent flushEvent = new ManualResetEvent(false); - - EngineLoggingServicesInProc inProcLoggingServicesEventsAllEvents = new EngineLoggingServicesInProc(eventSourceHelper.sourceForEvents, false, flushEvent); - - Assert.IsFalse(inProcLoggingServicesEventsAllEvents.NeedsFlush(DateTime.Now.Ticks), "Didn't expect to need a flush because of time passed"); - - Assert.IsTrue(inProcLoggingServicesEventsAllEvents.NeedsFlush(DateTime.Now.Ticks + EngineLoggingServices.flushTimeoutInTicks + 1), "Expect to need a flush because of time passed"); - - for (int i = 0; i < 1001; i++) - { - inProcLoggingServicesEventsAllEvents.PostLoggingEvent(new BuildMessageEventArgs("Message", "help", "sender", MessageImportance.Low)); - } - - Assert.IsTrue(inProcLoggingServicesEventsAllEvents.NeedsFlush(0), "Expect to need a flush because of number of events"); - - // Expect the handle to be signaled - long currentTicks = DateTime.Now.Ticks; - flushEvent.WaitOne(5000, false); - Assert.IsTrue((DateTime.Now.Ticks - currentTicks) / TimeSpan.TicksPerMillisecond < 4900, "Expected the handle to be signaled"); - } - - [Test] - public void LocalForwardingOfLoggingEvents() - { - VerifyEventSourceHelper eventSourceHelper = new VerifyEventSourceHelper(); - EngineLoggingServicesInProc inProcLoggingServicesEventsAllEvents = new EngineLoggingServicesInProc(eventSourceHelper.sourceForEvents, false, new ManualResetEvent(false)); - - VerifyEventSourceHelper localForwardingSourceHelper = new VerifyEventSourceHelper(); - VerifyEventSourceHelper centralLoggerEventSource = new VerifyEventSourceHelper(); - inProcLoggingServicesEventsAllEvents.RegisterEventSource(EngineLoggingServicesInProc.LOCAL_FORWARDING_EVENTSOURCE, localForwardingSourceHelper.sourceForEvents); - inProcLoggingServicesEventsAllEvents.RegisterEventSource(EngineLoggingServicesInProc.FIRST_AVAILABLE_LOGGERID, centralLoggerEventSource.sourceForEvents); - - // Create a local forwarding logger and initialize it - ConfigurableForwardingLogger localForwardingLogger = new ConfigurableForwardingLogger(); - EventRedirector newRedirector = new EventRedirector(EngineLoggingServicesInProc.FIRST_AVAILABLE_LOGGERID, inProcLoggingServicesEventsAllEvents); - localForwardingLogger.BuildEventRedirector = newRedirector; - localForwardingLogger.Parameters = "TARGETSTARTEDEVENT;TARGETFINISHEDEVENT"; - localForwardingLogger.Initialize(localForwardingSourceHelper.sourceForEvents); - - // Verify that BuildStarted event is delivered both to the forwarding logger and ILoggers and - // that the forwarding logger forwards it to the central logger - inProcLoggingServicesEventsAllEvents.PostLoggingEvent(new TargetStartedEventArgs("message", "help", "targetName", "ProjectFile", "targetFile")); - inProcLoggingServicesEventsAllEvents.ProcessPostedLoggingEvents(); - eventSourceHelper.AssertEventsAndNoOthers("anyEventRaised", "targetStarted", "statusRaised"); - localForwardingSourceHelper.AssertEventsAndNoOthers("anyEventRaised", "targetStarted", "statusRaised"); - inProcLoggingServicesEventsAllEvents.ProcessPostedLoggingEvents(); - centralLoggerEventSource.AssertEventsAndNoOthers("anyEventRaised", "targetStarted", "statusRaised"); - localForwardingSourceHelper.ClearEvents(); - centralLoggerEventSource.ClearEvents(); - eventSourceHelper.ClearEvents(); - - // Verify that BuildFinished event is delivered both to the forwarding logger and ILoggers and - // that the forwarding logger forwards it to the central logger - inProcLoggingServicesEventsAllEvents.PostLoggingEvent(new TargetFinishedEventArgs("message", "help", "targetName", "ProjectFile", "targetFile", true)); - inProcLoggingServicesEventsAllEvents.ProcessPostedLoggingEvents(); - eventSourceHelper.AssertEventsAndNoOthers("anyEventRaised", "targetFinished", "statusRaised"); - localForwardingSourceHelper.AssertEventsAndNoOthers("anyEventRaised", "targetFinished", "statusRaised"); - inProcLoggingServicesEventsAllEvents.ProcessPostedLoggingEvents(); - centralLoggerEventSource.AssertEventsAndNoOthers("anyEventRaised", "targetFinished", "statusRaised"); - localForwardingSourceHelper.ClearEvents(); - centralLoggerEventSource.ClearEvents(); - eventSourceHelper.ClearEvents(); - - // Verify that events that are not forwarded are not delivered to the central logger - inProcLoggingServicesEventsAllEvents.PostLoggingEvent(new BuildMessageEventArgs("Message", "help", "sender", MessageImportance.Low)); - inProcLoggingServicesEventsAllEvents.ProcessPostedLoggingEvents(); - eventSourceHelper.AssertEventsAndNoOthers("anyEventRaised", "messageRaised"); - localForwardingSourceHelper.AssertEventsAndNoOthers("anyEventRaised", "messageRaised"); - inProcLoggingServicesEventsAllEvents.ProcessPostedLoggingEvents(); - centralLoggerEventSource.AssertEventsAndNoOthers(); - localForwardingSourceHelper.ClearEvents(); - centralLoggerEventSource.ClearEvents(); - eventSourceHelper.ClearEvents(); - - // Verify that external events with no logger id are not delivered to the forwarding or central loggers - inProcLoggingServicesEventsAllEvents.PostLoggingEvent(new NodeLoggingEvent(new BuildMessageEventArgs("Message", "help", "sender", MessageImportance.Low))); - inProcLoggingServicesEventsAllEvents.ProcessPostedLoggingEvents(); - eventSourceHelper.AssertEventsAndNoOthers("anyEventRaised", "messageRaised"); - localForwardingSourceHelper.AssertEventsAndNoOthers(); - centralLoggerEventSource.AssertEventsAndNoOthers(); - localForwardingSourceHelper.ClearEvents(); - centralLoggerEventSource.ClearEvents(); - eventSourceHelper.ClearEvents(); - - // Verify that external events with logger id are only delivered to central logger - inProcLoggingServicesEventsAllEvents.PostLoggingEvent - (new NodeLoggingEventWithLoggerId(new BuildMessageEventArgs("Message", "help", "sender", MessageImportance.Low), 2)); - inProcLoggingServicesEventsAllEvents.ProcessPostedLoggingEvents(); - eventSourceHelper.AssertEventsAndNoOthers(); - localForwardingSourceHelper.AssertEventsAndNoOthers(); - centralLoggerEventSource.AssertEventsAndNoOthers("anyEventRaised", "messageRaised"); - localForwardingSourceHelper.ClearEvents(); - centralLoggerEventSource.ClearEvents(); - eventSourceHelper.ClearEvents(); - } - - [Test] - public void ConfigurationByEngine() - { - VerifyEventSourceHelper eventSourceHelper = new VerifyEventSourceHelper(); - EngineLoggingServicesInProc inProcLoggingServicesEventsAllEvents = new EngineLoggingServicesInProc(eventSourceHelper.sourceForEvents, false, new ManualResetEvent(false)); - VerifyEventSourceHelper eventSourcePrivateHelper = new VerifyEventSourceHelper(); - EngineLoggingServicesInProc inProcLoggingServicesEventsAllEventsPrivate = new EngineLoggingServicesInProc(eventSourcePrivateHelper.sourceForEvents, false, new ManualResetEvent(false)); - - Engine buildEngine = new Engine(); - buildEngine.LoggingServices = inProcLoggingServicesEventsAllEvents; - - // Create a logger that points at the private engine service (we'll use that logger as the central logger) - ConfigurableForwardingLogger localLogger = new ConfigurableForwardingLogger(); - EventRedirector newRedirector = new EventRedirector(EngineLoggingServicesInProc.FIRST_AVAILABLE_LOGGERID, inProcLoggingServicesEventsAllEventsPrivate); - localLogger.BuildEventRedirector = newRedirector; - localLogger.Parameters = "TARGETSTARTEDEVENT;TARGETFINISHEDEVENT"; - inProcLoggingServicesEventsAllEventsPrivate.RegisterEventSource(EngineLoggingServicesInProc.FIRST_AVAILABLE_LOGGERID, eventSourcePrivateHelper.sourceForEvents); - - string filename = null; - Assembly assembly = Assembly.Load("MICROSOFT.BUILD.ENGINE"); - filename = assembly.Location; - Console.WriteLine("Using the following engine assembly: " + filename); - - LoggerDescription description = new LoggerDescription("ConfigurableForwardingLogger", null, filename, "TARGETSTARTEDEVENT;TARGETFINISHEDEVENT", LoggerVerbosity.Normal); - - buildEngine.RegisterDistributedLogger(localLogger, description); - - // Verify that BuildStarted event is delivered both to the forwarding logger and ILoggers and - // that the forwarding logger forwards it to the central logger - inProcLoggingServicesEventsAllEvents.PostLoggingEvent(new TargetStartedEventArgs("message", "help", "targetName", "ProjectFile", "targetFile")); - inProcLoggingServicesEventsAllEvents.ProcessPostedLoggingEvents(); - eventSourceHelper.AssertEventsAndNoOthers("anyEventRaised", "targetStarted", "statusRaised"); - inProcLoggingServicesEventsAllEvents.ProcessPostedLoggingEvents(); - inProcLoggingServicesEventsAllEventsPrivate.ProcessPostedLoggingEvents(); - eventSourcePrivateHelper.AssertEventsAndNoOthers("anyEventRaised", "targetStarted", "statusRaised"); - eventSourcePrivateHelper.ClearEvents(); - eventSourceHelper.ClearEvents(); - - - // Verify that BuildFinished event is delivered both to the forwarding logger and ILoggers and - // that the forwarding logger forwards it to the central logger - inProcLoggingServicesEventsAllEvents.PostLoggingEvent( - new TargetFinishedEventArgs("message", "help", "targetName", "ProjectFile", "targetFile", true)); - inProcLoggingServicesEventsAllEvents.ProcessPostedLoggingEvents(); - eventSourceHelper.AssertEventsAndNoOthers("anyEventRaised", "targetFinished", "statusRaised"); - inProcLoggingServicesEventsAllEvents.ProcessPostedLoggingEvents(); - inProcLoggingServicesEventsAllEventsPrivate.ProcessPostedLoggingEvents(); - eventSourcePrivateHelper.AssertEventsAndNoOthers("anyEventRaised", "targetFinished", "statusRaised"); - eventSourcePrivateHelper.ClearEvents(); - eventSourceHelper.ClearEvents(); - - // Verify that events that are not forwarded are not delivered to the central logger - inProcLoggingServicesEventsAllEvents.PostLoggingEvent(new BuildMessageEventArgs("Message", "help", "sender", MessageImportance.Low)); - inProcLoggingServicesEventsAllEvents.ProcessPostedLoggingEvents(); - eventSourceHelper.AssertEventsAndNoOthers("anyEventRaised", "messageRaised"); - inProcLoggingServicesEventsAllEvents.ProcessPostedLoggingEvents(); - inProcLoggingServicesEventsAllEventsPrivate.ProcessPostedLoggingEvents(); - eventSourcePrivateHelper.AssertEventsAndNoOthers(); - eventSourcePrivateHelper.ClearEvents(); - eventSourceHelper.ClearEvents(); - - // Verify that external events with no logger id are not delivered to the forwarding or central loggers - inProcLoggingServicesEventsAllEvents.PostLoggingEvent(new NodeLoggingEvent(new BuildMessageEventArgs("Message", "help", "sender", MessageImportance.Low))); - inProcLoggingServicesEventsAllEvents.ProcessPostedLoggingEvents(); - eventSourceHelper.AssertEventsAndNoOthers("anyEventRaised", "messageRaised"); - inProcLoggingServicesEventsAllEvents.ProcessPostedLoggingEvents(); - inProcLoggingServicesEventsAllEventsPrivate.ProcessPostedLoggingEvents(); - eventSourcePrivateHelper.AssertEventsAndNoOthers(); - eventSourcePrivateHelper.ClearEvents(); - eventSourceHelper.ClearEvents(); - - // Verify that external events with logger id are only delivered to central logger - inProcLoggingServicesEventsAllEvents.PostLoggingEvent - (new NodeLoggingEventWithLoggerId( - new TargetFinishedEventArgs("message", "help", "targetName", "ProjectFile", "targetFile", true), 2)); - inProcLoggingServicesEventsAllEvents.ProcessPostedLoggingEvents(); - eventSourceHelper.AssertEventsAndNoOthers(); - inProcLoggingServicesEventsAllEvents.ProcessPostedLoggingEvents(); - inProcLoggingServicesEventsAllEventsPrivate.ProcessPostedLoggingEvents(); - eventSourcePrivateHelper.AssertEventsAndNoOthers("anyEventRaised", "targetFinished", "statusRaised"); - eventSourcePrivateHelper.ClearEvents(); - eventSourceHelper.ClearEvents(); - } - - #endregion - - #region OutProcLoggingTest - - /// - /// Test logging the out of proc logger by sending events to the logger and check - /// the inproc logger queue which is the eventual handler of the events - /// - [Test] - public void OutProcLoggingTest() - { - - VerifyEventSourceHelper eventSourceHelper = new VerifyEventSourceHelper(); - EngineLoggingServicesInProc inProcLoggingServicesEventsAllEvents = new EngineLoggingServicesInProc(eventSourceHelper.sourceForEvents, false, new ManualResetEvent(false)); - - - Engine buildEngine = new Engine(); - buildEngine.LoggingServices = inProcLoggingServicesEventsAllEvents; - - EngineCallback outProcessorProxy = new EngineCallback(buildEngine); - int nodeId = buildEngine.GetNextNodeId(); - Node parentNode = new Node(nodeId, new LoggerDescription[0], outProcessorProxy, null, - ToolsetDefinitionLocations.ConfigurationFile | ToolsetDefinitionLocations.Registry, String.Empty); - - - EngineLoggingServicesOutProc loggingServicesOutProc = new EngineLoggingServicesOutProc(parentNode, new ManualResetEvent(false)); - - loggingServicesOutProc.PostLoggingEvent(new BuildMessageEventArgs("Message", "help", "sender", MessageImportance.Low)); - loggingServicesOutProc.ProcessPostedLoggingEvents(); - inProcLoggingServicesEventsAllEvents.ProcessPostedLoggingEvents(); - eventSourceHelper.AssertEventsAndNoOthers("anyEventRaised", "messageRaised"); - eventSourceHelper.ClearEvents(); - - loggingServicesOutProc.PostLoggingEvent(new TaskStartedEventArgs("message", "help", "projectFile", "taskFile", "taskName")); - loggingServicesOutProc.ProcessPostedLoggingEvents(); - inProcLoggingServicesEventsAllEvents.ProcessPostedLoggingEvents(); - eventSourceHelper.AssertEventsAndNoOthers("anyEventRaised", "taskStarted", "statusRaised"); - eventSourceHelper.ClearEvents(); - - loggingServicesOutProc.PostLoggingEvent(new TaskFinishedEventArgs("message", "help", "projectFile", "taskFile", "taskName", true)); - loggingServicesOutProc.ProcessPostedLoggingEvents(); - inProcLoggingServicesEventsAllEvents.ProcessPostedLoggingEvents(); - eventSourceHelper.AssertEventsAndNoOthers("anyEventRaised", "taskFinished", "statusRaised"); - eventSourceHelper.ClearEvents(); - - loggingServicesOutProc.PostLoggingEvent(new TaskCommandLineEventArgs("commandLine", "taskName", MessageImportance.Low)); - loggingServicesOutProc.ProcessPostedLoggingEvents(); - inProcLoggingServicesEventsAllEvents.ProcessPostedLoggingEvents(); - eventSourceHelper.AssertEventsAndNoOthers("anyEventRaised", "messageRaised"); - eventSourceHelper.ClearEvents(); - - loggingServicesOutProc.PostLoggingEvent(new BuildWarningEventArgs("SubCategoryForSchemaValidationErrors", "MSB4000", "file", 1, 2, 3, 4, "message", "help", "sender")); - loggingServicesOutProc.ProcessPostedLoggingEvents(); - inProcLoggingServicesEventsAllEvents.ProcessPostedLoggingEvents(); - eventSourceHelper.AssertEventsAndNoOthers("anyEventRaised", "warningRaised"); - eventSourceHelper.ClearEvents(); - - loggingServicesOutProc.PostLoggingEvent(new BuildErrorEventArgs("SubCategoryForSchemaValidationErrors", "MSB4000", "file", 1, 2, 3, 4, "message", "help", "sender")); - loggingServicesOutProc.ProcessPostedLoggingEvents(); - inProcLoggingServicesEventsAllEvents.ProcessPostedLoggingEvents(); - eventSourceHelper.AssertEventsAndNoOthers("anyEventRaised", "errorRaised"); - eventSourceHelper.ClearEvents(); - - loggingServicesOutProc.PostLoggingEvent(new TargetStartedEventArgs("message", "help", "targetName", "ProjectFile", "targetFile")); - loggingServicesOutProc.ProcessPostedLoggingEvents(); - inProcLoggingServicesEventsAllEvents.ProcessPostedLoggingEvents(); - eventSourceHelper.AssertEventsAndNoOthers("anyEventRaised", "targetStarted", "statusRaised"); - eventSourceHelper.ClearEvents(); - - loggingServicesOutProc.PostLoggingEvent(new TargetFinishedEventArgs("message", "help", "targetName", "ProjectFile", "targetFile", true)); - loggingServicesOutProc.ProcessPostedLoggingEvents(); - inProcLoggingServicesEventsAllEvents.ProcessPostedLoggingEvents(); - eventSourceHelper.AssertEventsAndNoOthers("anyEventRaised", "targetFinished", "statusRaised"); - eventSourceHelper.ClearEvents(); - - loggingServicesOutProc.PostLoggingEvent(new ProjectStartedEventArgs(-1, "message", "help", "ProjectFile", "targetNames", null, null, null)); - loggingServicesOutProc.ProcessPostedLoggingEvents(); - inProcLoggingServicesEventsAllEvents.ProcessPostedLoggingEvents(); - eventSourceHelper.AssertEventsAndNoOthers("anyEventRaised", "projectStarted", "statusRaised"); - eventSourceHelper.ClearEvents(); - - loggingServicesOutProc.PostLoggingEvent(new ProjectFinishedEventArgs("message", "help", "ProjectFile", true)); - loggingServicesOutProc.ProcessPostedLoggingEvents(); - inProcLoggingServicesEventsAllEvents.ProcessPostedLoggingEvents(); - eventSourceHelper.AssertEventsAndNoOthers("anyEventRaised", "projectFinished", "statusRaised"); - eventSourceHelper.ClearEvents(); - - loggingServicesOutProc.PostLoggingEvent(new BuildStartedEventArgs("message", "help")); - loggingServicesOutProc.ProcessPostedLoggingEvents(); - inProcLoggingServicesEventsAllEvents.ProcessPostedLoggingEvents(); - eventSourceHelper.AssertEventsAndNoOthers("anyEventRaised", "buildStarted", "statusRaised"); - eventSourceHelper.ClearEvents(); - - loggingServicesOutProc.PostLoggingEvent(new BuildFinishedEventArgs("message", "help", true)); - loggingServicesOutProc.ProcessPostedLoggingEvents(); - inProcLoggingServicesEventsAllEvents.ProcessPostedLoggingEvents(); - eventSourceHelper.AssertEventsAndNoOthers("anyEventRaised", "buildFinished", "statusRaised"); - eventSourceHelper.ClearEvents(); - - loggingServicesOutProc.PostLoggingEvent(new ExternalProjectStartedEventArgs("message", "help", "senderName", "projectFile", "targetNames")); - loggingServicesOutProc.ProcessPostedLoggingEvents(); - inProcLoggingServicesEventsAllEvents.ProcessPostedLoggingEvents(); - eventSourceHelper.AssertEventsAndNoOthers("anyEventRaised", "customEventRaised"); - eventSourceHelper.ClearEvents(); - - loggingServicesOutProc.PostLoggingEvent(new ExternalProjectFinishedEventArgs("message", "help", "senderName", "projectFile", true)); - loggingServicesOutProc.ProcessPostedLoggingEvents(); - inProcLoggingServicesEventsAllEvents.ProcessPostedLoggingEvents(); - eventSourceHelper.AssertEventsAndNoOthers("anyEventRaised", "customEventRaised"); - eventSourceHelper.ClearEvents(); - - loggingServicesOutProc.PostLoggingEvent(new MyCustomBuildEventArgs()); - loggingServicesOutProc.ProcessPostedLoggingEvents(); - inProcLoggingServicesEventsAllEvents.ProcessPostedLoggingEvents(); - eventSourceHelper.AssertEventsAndNoOthers("anyEventRaised", "customEventRaised"); - eventSourceHelper.ClearEvents(); - - loggingServicesOutProc.PostLoggingEvent(new MyCustomBuildErrorEventArgs()); - loggingServicesOutProc.ProcessPostedLoggingEvents(); - inProcLoggingServicesEventsAllEvents.ProcessPostedLoggingEvents(); - eventSourceHelper.AssertEventsAndNoOthers("anyEventRaised", "errorRaised"); - eventSourceHelper.ClearEvents(); - - loggingServicesOutProc.PostLoggingEvent(new MyCustomBuildWarningEventArgs()); - loggingServicesOutProc.ProcessPostedLoggingEvents(); - inProcLoggingServicesEventsAllEvents.ProcessPostedLoggingEvents(); - eventSourceHelper.AssertEventsAndNoOthers("anyEventRaised", "warningRaised"); - eventSourceHelper.ClearEvents(); - - loggingServicesOutProc.PostLoggingEvent(new MyCustomBuildMessageEventArgs()); - loggingServicesOutProc.ProcessPostedLoggingEvents(); - inProcLoggingServicesEventsAllEvents.ProcessPostedLoggingEvents(); - eventSourceHelper.AssertEventsAndNoOthers("anyEventRaised", "messageRaised"); - eventSourceHelper.ClearEvents(); - - loggingServicesOutProc.PostLoggingEvent(new MyCustomBuildMessageEventArgs()); - loggingServicesOutProc.PostLoggingEvent(new MyCustomBuildWarningEventArgs()); - loggingServicesOutProc.PostLoggingEvent(new MyCustomBuildErrorEventArgs()); - loggingServicesOutProc.ProcessPostedLoggingEvents(); - inProcLoggingServicesEventsAllEvents.ProcessPostedLoggingEvents(); - eventSourceHelper.AssertEventsAndNoOthers("anyEventRaised", "messageRaised", "warningRaised", "errorRaised"); - eventSourceHelper.ClearEvents(); - - // Check that node logging events are forwarded correctly with Id - loggingServicesOutProc.PostLoggingEvent(new NodeLoggingEventWithLoggerId(new BuildMessageEventArgs("Message", "help", "sender", MessageImportance.Low), 0)); - loggingServicesOutProc.ProcessPostedLoggingEvents(); - inProcLoggingServicesEventsAllEvents.ProcessPostedLoggingEvents(); - eventSourceHelper.AssertEventsAndNoOthers("anyEventRaised", "messageRaised"); - eventSourceHelper.ClearEvents(); - - // Check that node logging events are forwarded correctly with no Id - loggingServicesOutProc.PostLoggingEvent(new NodeLoggingEvent(new BuildMessageEventArgs("Message", "help", "sender", MessageImportance.Low))); - loggingServicesOutProc.ProcessPostedLoggingEvents(); - inProcLoggingServicesEventsAllEvents.ProcessPostedLoggingEvents(); - eventSourceHelper.AssertEventsAndNoOthers("anyEventRaised", "messageRaised"); - eventSourceHelper.ClearEvents(); - - // Register another event source and test that events are delivered correctly - VerifyEventSourceHelper privateEventSourceHelper1 = new VerifyEventSourceHelper(); - VerifyEventSourceHelper privateEventSourceHelper2 = new VerifyEventSourceHelper(); - inProcLoggingServicesEventsAllEvents.RegisterEventSource(EngineLoggingServicesInProc.FIRST_AVAILABLE_LOGGERID, privateEventSourceHelper1.sourceForEvents); - inProcLoggingServicesEventsAllEvents.RegisterEventSource(EngineLoggingServicesInProc.FIRST_AVAILABLE_LOGGERID + 1, privateEventSourceHelper2.sourceForEvents); - - // Check that node logging events are forwarded correctly with Id - loggingServicesOutProc.PostLoggingEvent(new NodeLoggingEventWithLoggerId(new BuildMessageEventArgs("Message", "help", "sender", MessageImportance.Low), 0)); - loggingServicesOutProc.ProcessPostedLoggingEvents(); - inProcLoggingServicesEventsAllEvents.ProcessPostedLoggingEvents(); - eventSourceHelper.AssertEventsAndNoOthers("anyEventRaised", "messageRaised"); - eventSourceHelper.ClearEvents(); - - //send a lot of events to test the event batching - for (int i = 0; i < 600; i++) - { - loggingServicesOutProc.PostLoggingEvent(new NodeLoggingEventWithLoggerId(new BuildMessageEventArgs("Message", "help", "sender", MessageImportance.Low), 0)); - } - loggingServicesOutProc.ProcessPostedLoggingEvents(); - inProcLoggingServicesEventsAllEvents.ProcessPostedLoggingEvents(); - eventSourceHelper.AssertEventsAndNoOthers("anyEventRaised", "messageRaised"); - eventSourceHelper.ClearEvents(); - - // Check that the events are correctly sorted when posted with different logger ids - loggingServicesOutProc.PostLoggingEvent(new BuildMessageEventArgs("Message", "help", "sender", MessageImportance.Low)); - loggingServicesOutProc.PostLoggingEvent(new NodeLoggingEventWithLoggerId(new BuildStartedEventArgs("message", "help"), EngineLoggingServicesInProc.FIRST_AVAILABLE_LOGGERID)); - loggingServicesOutProc.PostLoggingEvent(new NodeLoggingEventWithLoggerId(new TargetFinishedEventArgs("message", "help", "targetName", "ProjectFile", "targetFile", true), - EngineLoggingServicesInProc.FIRST_AVAILABLE_LOGGERID +1)); - loggingServicesOutProc.ProcessPostedLoggingEvents(); - inProcLoggingServicesEventsAllEvents.ProcessPostedLoggingEvents(); - privateEventSourceHelper1.AssertEventsAndNoOthers("anyEventRaised", "statusRaised", "buildStarted"); - privateEventSourceHelper2.AssertEventsAndNoOthers("anyEventRaised", "statusRaised", "targetFinished"); - eventSourceHelper.AssertEventsAndNoOthers("anyEventRaised", "messageRaised" ); - eventSourceHelper.ClearEvents(); - - } - - #endregion - } -} diff --git a/src/Deprecated/Engine.UnitTests/EngineProxy_Tests.cs b/src/Deprecated/Engine.UnitTests/EngineProxy_Tests.cs deleted file mode 100644 index 972fb0ebc53..00000000000 --- a/src/Deprecated/Engine.UnitTests/EngineProxy_Tests.cs +++ /dev/null @@ -1,817 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections.Generic; -using System.IO; -using System.Reflection; -using System.Text; -using System.Xml; - -using NUnit.Framework; - -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine; -using Microsoft.Build.BuildEngine.Shared; -using System.Collections; - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class EngineProxy_Tests - { - EngineProxy engineProxy; - EngineProxy engineProxy2; - MockTaskExecutionModule taskExecutionModule; - MockTaskExecutionModule taskExecutionModule2; - Engine engine; - string project1 = "Project1"; - string project2 = "Project2"; - - [SetUp] - public void SetUp() - { - // Whole bunch of setup code. - XmlElement taskNode = new XmlDocument().CreateElement("MockTask"); - LoadedType taskClass = new LoadedType(typeof(MockTask), new AssemblyLoadInfo(typeof(MockTask).Assembly.FullName, null)); - engine = new Engine(@"c:\"); - Project project = new Project(engine); - EngineCallback engineCallback = new EngineCallback(engine); - taskExecutionModule = new MockTaskExecutionModule(engineCallback); - int handleId = engineCallback.CreateTaskContext(project, null, null, taskNode, EngineCallback.inProcNode, new BuildEventContext(BuildEventContext.InvalidNodeId, BuildEventContext.InvalidTargetId, BuildEventContext.InvalidProjectContextId, BuildEventContext.InvalidTaskId)); - TaskEngine taskEngine = new TaskEngine - ( - taskNode, - null, /* host object */ - "In Memory", - project.FullFileName, - engine.LoggingServices, - handleId, - taskExecutionModule, - null - ); - taskEngine.TaskClass = taskClass; - - engineProxy = new EngineProxy(taskExecutionModule, handleId, project.FullFileName, project.FullFileName, engine.LoggingServices, null); - taskExecutionModule2 = new MockTaskExecutionModule(engineCallback, TaskExecutionModule.TaskExecutionModuleMode.MultiProcFullNodeMode); - engineProxy2 = new EngineProxy(taskExecutionModule2, handleId, project.FullFileName, project.FullFileName, engine.LoggingServices, null); - - } - - [TearDown] - public void TearDownAttribute() - { - engine.Shutdown(); - engineProxy = null; - engineProxy2 = null; - engine = null; - } - - - /// - /// Class which implements a simple custom build error - /// - [Serializable] - internal class MyCustomBuildErrorEventArgs : BuildErrorEventArgs - { - - internal MyCustomBuildErrorEventArgs - ( - string message - ) - : base(null, null, null, 0, 0, 0, 0, message, null, null) - { - } - - internal string FXCopRule - { - get - { - return fxcopRule; - } - set - { - fxcopRule = value; - } - } - - private string fxcopRule; - } - - /// - /// Custom logger which will be used for testing - /// - internal class MyCustomLogger : ILogger - { - public LoggerVerbosity Verbosity - { - get - { - return LoggerVerbosity.Normal; - } - set - { - } - } - - public string Parameters - { - get - { - return String.Empty; - } - set - { - } - } - - public void Initialize(IEventSource eventSource) - { - eventSource.ErrorRaised += new BuildErrorEventHandler(MyCustomErrorHandler); - eventSource.WarningRaised += new BuildWarningEventHandler(MyCustomWarningHandler); - eventSource.MessageRaised += new BuildMessageEventHandler(MyCustomMessageHandler); - eventSource.CustomEventRaised += new CustomBuildEventHandler(MyCustomBuildHandler); - eventSource.AnyEventRaised += new AnyEventHandler(eventSource_AnyEventRaised); - } - - void eventSource_AnyEventRaised(object sender, BuildEventArgs e) - { - if (e.Message != null) - { - Console.Out.WriteLine("AnyEvent:"+e.Message.ToString()); - } - } - - public void Shutdown() - { - } - - internal void MyCustomErrorHandler(object s, BuildErrorEventArgs e) - { - numberOfError++; - this.lastError = e; - if (e.Message != null) - { - Console.Out.WriteLine("CustomError:"+e.Message.ToString()); - } - } - - internal void MyCustomWarningHandler(object s, BuildWarningEventArgs e) - { - numberOfWarning++; - this.lastWarning = e; - if (e.Message != null) - { - Console.Out.WriteLine("CustomWarning:" + e.Message.ToString()); - } - } - - internal void MyCustomMessageHandler(object s, BuildMessageEventArgs e) - { - numberOfMessage++; - this.lastMessage = e; - if (e.Message != null) - { - Console.Out.WriteLine("CustomMessage:" + e.Message.ToString()); - } - } - - internal void MyCustomBuildHandler(object s, CustomBuildEventArgs e) - { - numberOfCustom++; - this.lastCustom = e; - if (e.Message != null) - { - Console.Out.WriteLine("CustomEvent:" + e.Message.ToString()); - } - } - internal BuildErrorEventArgs lastError = null; - internal BuildWarningEventArgs lastWarning = null; - internal BuildMessageEventArgs lastMessage = null; - internal CustomBuildEventArgs lastCustom = null; - internal int numberOfError = 0; - internal int numberOfWarning =0; - internal int numberOfMessage = 0; - internal int numberOfCustom = 0; - } - - /// - /// Makes sure that if a task tries to log a custom error event that subclasses our own - /// BuildErrorEventArgs, that the subclass makes it all the way to the logger. In other - /// words, the engine should not try to read data out of the event args and construct - /// its own. Bug VSWhidbey 440801. - /// - [Test] - public void CustomBuildErrorEventIsPreserved() - { - - MyCustomLogger myLogger = new MyCustomLogger(); - engine.RegisterLogger(myLogger); - // Create a custom build event args that derives from MSBuild's BuildErrorEventArgs. - // Set a custom field on this event (FXCopRule). - MyCustomBuildErrorEventArgs fxcopError = new MyCustomBuildErrorEventArgs("Your code is bad."); - fxcopError.FXCopRule = "CodeBadnessViolation"; - - // Log the custom event args. (Pretend that the task actually did this.) - engineProxy.LogErrorEvent(fxcopError); - engine.LoggingServices.ProcessPostedLoggingEvents(); - - // Make sure our custom logger received the actual custom event and not some fake. - Assertion.Assert("Expected Custom Error Event", myLogger.lastError is MyCustomBuildErrorEventArgs); - - // Make sure the special fields in the custom event match what we originally logged. - fxcopError = myLogger.lastError as MyCustomBuildErrorEventArgs; - Assertion.AssertEquals("Your code is bad.", fxcopError.Message); - Assertion.AssertEquals("CodeBadnessViolation", fxcopError.FXCopRule); - } - - /// - /// Test that error events are correctly logged - /// - [Test] - public void TestLogErrorEvent() - { - - MyCustomLogger myLogger = new MyCustomLogger(); - engine.RegisterLogger(myLogger); - - engineProxy.UpdateContinueOnError(false); - // Log the custom event args. (Pretend that the task actually did this.) - engineProxy.LogErrorEvent(new BuildErrorEventArgs("SubCategory", "code", null, 0, 1, 2, 3, "message", "Help", "Sender")); - engine.LoggingServices.ProcessPostedLoggingEvents(); - - // Make sure our custom logger received the actual custom event and not some fake. - Assertion.Assert("Expected Error Event", myLogger.lastError is BuildErrorEventArgs); - Assertion.Assert("Expected line number to be 0", myLogger.lastError.LineNumber == 0); - - - engineProxy.UpdateContinueOnError(true); - // Log the custom event args. (Pretend that the task actually did this.) - engineProxy.LogErrorEvent(new BuildErrorEventArgs("SubCategory", "code", null, 0, 1, 2, 3, "message", "Help", "Sender")); - engine.LoggingServices.ProcessPostedLoggingEvents(); - - // Make sure our custom logger received the actual custom event and not some fake. - Assertion.Assert("Expected Warning Event", myLogger.lastWarning is BuildWarningEventArgs); - Assertion.Assert("Expected line number to be 0", myLogger.lastWarning.LineNumber == 0); - } - - /// - /// Test that a null error event will cause an exception - /// - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void TestLogErrorEventNull() - { - MyCustomLogger myLogger = new MyCustomLogger(); - engine.RegisterLogger(myLogger); - engineProxy.UpdateContinueOnError(true); - engineProxy.LogErrorEvent(null); - engine.LoggingServices.ProcessPostedLoggingEvents(); - } - - /// - /// Test that a null error event will cause an exception - /// - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void TestLogErrorEventNull2() - { - MyCustomLogger myLogger = new MyCustomLogger(); - engine.RegisterLogger(myLogger); - engineProxy.UpdateContinueOnError(false); - engineProxy.LogErrorEvent(null); - engine.LoggingServices.ProcessPostedLoggingEvents(); - } - /// - /// Test that warnings are logged properly - /// - [Test] - public void TestLogWarningEvent() - { - - MyCustomLogger myLogger = new MyCustomLogger(); - engine.RegisterLogger(myLogger); - - // Log the custom event args. (Pretend that the task actually did this.) - engineProxy.LogWarningEvent(new BuildWarningEventArgs("SubCategory", "code", null, 0, 1, 2, 3, "message", "Help", "Sender")); - engine.LoggingServices.ProcessPostedLoggingEvents(); - - // Make sure our custom logger received the actual custom event and not some fake. - Assertion.Assert("Expected Warning Event", myLogger.lastWarning is BuildWarningEventArgs); - Assertion.Assert("Expected line number to be 0", myLogger.lastWarning.LineNumber == 0); - } - - /// - /// Test that messages are logged properly - /// - [Test] - public void TestLogMessageEvent() - { - MyCustomLogger myLogger = new MyCustomLogger(); - engine.RegisterLogger(myLogger); - - // Log the custom event args. (Pretend that the task actually did this.) - engineProxy.LogMessageEvent(new BuildMessageEventArgs("message", "HelpKeyword", "senderName", MessageImportance.High)); - engine.LoggingServices.ProcessPostedLoggingEvents(); - - // Make sure our custom logger received the actual custom event and not some fake. - Assertion.Assert("Expected Message Event", myLogger.lastMessage is BuildMessageEventArgs); - Assertion.Assert("Expected Message importance to be high", myLogger.lastMessage.Importance == MessageImportance.High); - } - [Serializable] - class MyCustomBuildEventArgs : CustomBuildEventArgs - { - public MyCustomBuildEventArgs() : base() { } - public MyCustomBuildEventArgs(string message) : base(message, "HelpKeyword", "SenderName") { } - } - /// - /// Test that custom events are logged properly - /// - [Test] - public void TestLogCustomEvent() - { - MyCustomLogger myLogger = new MyCustomLogger(); - engine.RegisterLogger(myLogger); - - // Log the custom event args. (Pretend that the task actually did this.) - engineProxy.LogCustomEvent(new MyCustomBuildEventArgs("testCustomBuildEvent")); - engine.LoggingServices.ProcessPostedLoggingEvents(); - - // Make sure our custom logger received the actual custom event and not some fake. - Assertion.Assert("Expected custom build Event", myLogger.lastCustom is CustomBuildEventArgs); - Assertion.AssertEquals("testCustomBuildEvent", myLogger.lastCustom.Message); - } - /// - /// Test the building of a single project file - /// - [Test] - public void BuildProjectFile() - { - string[] targets; - MyCustomLogger myLogger = new MyCustomLogger(); - engine.RegisterLogger(myLogger); - Dictionary globalProperties = new Dictionary(); - targets = new string[1]; - targets[0] = "Build"; - Assert.IsTrue(engineProxy.BuildProjectFile(project1, targets, null, new Dictionary()), "Expected Build 2 to work"); - } - /// - /// Test the building of multiple files in parallel - /// - [Test] - public void BuildProjectFilesInParallel() - { - string[] targets; - string[] projects; - Dictionary globalProperties = new Dictionary(); - targets = new string[1]; - targets[0] = "Build"; - projects = new string[2]; - projects[0] = project2; - projects[1] = project1; - Dictionary[] dictionaryList = new Dictionary[2]; - dictionaryList[0] = new Dictionary(); - dictionaryList[1] = new Dictionary(); - Dictionary[] globalPropertiesArray = new Dictionary[2]; - globalProperties.Add("MyGlobalProp", "SomePropertyText"); - globalPropertiesArray[0] = globalProperties; - globalPropertiesArray[1] = globalProperties; - string[] toolVersions = new string[] { null, null }; - Assert.IsTrue(engineProxy.BuildProjectFilesInParallel(projects, targets, globalPropertiesArray, dictionaryList, toolVersions, false, false)); - } - - [Test] - public void ContinueOnErrorShouldConvertErrorsToWarnings() - { - MockLogger logger = ObjectModelHelpers.BuildProjectExpectSuccess(@" - - - - - - - - - - - - "); - - Assertion.AssertEquals("Expected zero errors", 0, logger.ErrorCount); - Assertion.AssertEquals("Expected one warning", 1, logger.WarningCount); - } - /// - /// Check that the properties are correctly set and retreived - /// - [Test] - public void Properties() - { - Assert.IsTrue(engineProxy.LineNumberOfTaskNode == 0, "Expected LineNumberOfTaskNode to be 0"); - Assert.IsTrue(engineProxy.ColumnNumberOfTaskNode == 0, "Expected ColumnNumberOfTaskNode to be 0"); - Assert.IsTrue(string.Compare(engineProxy.ProjectFileOfTaskNode, string.Empty, StringComparison.OrdinalIgnoreCase) == 0, "Expected ProjectFileOfTaskNode to be empty"); - } - - /// - /// Verify IsRunningMultipleNodes - /// - [Test] - public void IsRunningMultipleNodes() - { - // Verify TEM is running singleProc mode before we can test to make sure EngineProxy is correctly using the value - Assertion.Assert("Expected TEM to be running singleProcMode", taskExecutionModule.GetExecutionModuleMode() == TaskExecutionModule.TaskExecutionModuleMode.SingleProcMode); - Assertion.Assert("Expected EngineProxy for TEM running in singleProc mode to return false for IsRunningMultipleNodes", engineProxy.IsRunningMultipleNodes == false); - - // Verify TEM is running MultiProc mode before we can test to make sure EngineProxy is correctly using the value - TaskExecutionModule.TaskExecutionModuleMode moduleMode = taskExecutionModule2.GetExecutionModuleMode(); - Assertion.Assert("Expected TEM to be not be running SingleProcMode",moduleMode != TaskExecutionModule.TaskExecutionModuleMode.SingleProcMode); - Assertion.Assert("Expected EngineProxy for TEM running in MultiProc mode to return true for IsRunningMultipleNodes", engineProxy2.IsRunningMultipleNodes); - } - - #region ToolsVersion tests - - private ITaskItem ToolsVersionTestHelper(string parentProjectToolsVersionInProject, - string parentProjectToolsVersionOverride, - string toolsVersionPassedToEngineProxy) - { - Engine engine = new Engine(Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().EscapedCodeBase).LocalPath)); - engine.AddToolset(new Toolset("44.0", "someToolsPath")); - engine.AddToolset(new Toolset("55.0", "anotherToolsPath")); - engine.AddToolset(new Toolset("66.0", "yetanotherToolsPath")); - - // The child project declares its ToolsVersion - string childProjectFullPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("child.proj", @" - - - - $(MSBuildToolsPath) - $(MSBuildBinPath) - - - - - "); - - // The parent project doesn't declare its ToolsVersion, and its ToolsVersion is not overridden - string parentProjectContent = @" targetOutputs = - new Dictionary(StringComparer.OrdinalIgnoreCase); - - EngineProxy engineProxy = CreateEngineProxyWithDummyTaskEngine(engine, parentProject); - bool success = engineProxy.BuildProjectFile - (childProjectFullPath, null, null, targetOutputs, toolsVersionPassedToEngineProxy); - - ITaskItem toolsVersionItem = targetOutputs["Build"][0]; - - Assertion.Assert("Expected a successful build!", success); - - return toolsVersionItem; - } - - /// - /// Basic test using the toolsVersion to override the child's toolsVersion. - /// - [Test] - public void ToolsVersionCanBeOverriddenUsingBuildProjectFile() - { - ITaskItem toolsVersionItem = ToolsVersionTestHelper(null, null, "55.0"); - - Assertion.AssertEquals("55.0", toolsVersionItem.ItemSpec); - Assertion.Assert("ToolsPath should've been 'anotherToolsPath'.", - 0 == String.Compare(toolsVersionItem.GetMetadata("ToolsPath"), "anotherToolsPath", StringComparison.OrdinalIgnoreCase)); - Assertion.Assert("BinPath should've been 'anotherToolsPath'.", - 0 == String.Compare(toolsVersionItem.GetMetadata("BinPath"), "anotherToolsPath", StringComparison.OrdinalIgnoreCase)); - } - - /// - /// If toolsVersion is not passed to BuildProjectFile, and the parent project - /// is building with a toolsVersion override, then the child project should - /// inherit that toolsVersion override. - /// - [Test] - public void UseParentProjectToolsVersionOverrideIfNotOverriddenByTask() - { - ITaskItem toolsVersionItem = ToolsVersionTestHelper(null, "55.0", null); - - Assertion.AssertEquals("55.0", toolsVersionItem.ItemSpec); - Assertion.Assert("ToolsPath should've been 'anotherToolsPath'.", - 0 == String.Compare(toolsVersionItem.GetMetadata("ToolsPath"), "anotherToolsPath", StringComparison.OrdinalIgnoreCase)); - Assertion.Assert("BinPath should've been 'anotherToolsPath'.", - 0 == String.Compare(toolsVersionItem.GetMetadata("BinPath"), "anotherToolsPath", StringComparison.OrdinalIgnoreCase)); - - } - - /// - /// If a toolsVersion override was previously specified on the command line or - /// a prior call to the MSBuild task, the toolsVersion specified on this - /// task call should still take highest precedence. - /// - [Test] - public void ToolsVersionFromTaskWinsEvenIfParentProjectUsingOverride() - { - ITaskItem toolsVersionItem = ToolsVersionTestHelper(null, "66.0", "55.0"); - - Assertion.AssertEquals("55.0", toolsVersionItem.ItemSpec); - Assertion.Assert("ToolsPath should've been 'anotherToolsPath'.", - 0 == String.Compare(toolsVersionItem.GetMetadata("ToolsPath"), "anotherToolsPath", StringComparison.OrdinalIgnoreCase)); - Assertion.Assert("BinPath should've been 'anotherToolsPath'.", - 0 == String.Compare(toolsVersionItem.GetMetadata("BinPath"), "anotherToolsPath", StringComparison.OrdinalIgnoreCase)); - - } - - /// - /// If no override was specified previously or here on BuildProjectFile, should use the - /// value from the <Project /> element of the child. - /// This is probably adequately tested elsewhere, but it doesn't hurt to cover here as well. - /// - [Test] - public void ToolsVersionFromProjectElementUsedIfNoOverride() - { - ITaskItem toolsVersionItem = ToolsVersionTestHelper("66.0", null, null); - - Assertion.AssertEquals("44.0", toolsVersionItem.ItemSpec); - Assertion.Assert("ToolsPath should've been 'someToolsPath'.", - 0 == String.Compare(toolsVersionItem.GetMetadata("ToolsPath"), "someToolsPath", StringComparison.OrdinalIgnoreCase)); - Assertion.Assert("BinPath should've been 'someToolsPath'.", - 0 == String.Compare(toolsVersionItem.GetMetadata("BinPath"), "someToolsPath", StringComparison.OrdinalIgnoreCase)); - - } - - /// - /// The toolsVersion override should be honored even when building a solution file. - /// - [Test] - public void ToolsVersionRespectedWhenBuildingASolution() - { - ObjectModelHelpers.DeleteTempProjectDirectory(); - - Engine engine = new Engine(Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().EscapedCodeBase).LocalPath)); - - // We've intentionally assigned the correct BinPath value to the tools version '3.5' since later - // we will request the engine build the solution with that tools version, and the engine will - // need to locate the default tasks. If the override we're going to specify isn't in fact applied, - // the engine will try to load the tasks from the bogus toolpath, and that will fail the solution build, - // so this test will fail. - engine.AddToolset(new Toolset("3.5", engine.BinPath)); - engine.AddToolset(new Toolset("2.0", "anotherToolsPath")); - - string solutionFileContents = - @" - Microsoft Visual Studio Solution File, Format Version 9.00 - # Visual Studio 2005 - Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|AnyCPU = Debug|AnyCPU - Release|AnyCPU = Release|AnyCPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - EndGlobal - "; - - string solutionFullPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("ConsoleApplication1.sln", solutionFileContents); - - // The parent project doesn't declare its ToolsVersion, and its ToolsVersion is not overridden - string parentProjectContent = @""; - Project parentProject = - ObjectModelHelpers.CreateInMemoryProject(engine, parentProjectContent, null); - - EngineProxy engineProxy = CreateEngineProxyWithDummyTaskEngine(engine, parentProject); - bool success = engineProxy.BuildProjectFile - (solutionFullPath, null, null, null, "3.5"); - - Assertion.Assert("Expected a successful build!", success); - } - - /// - /// If the project we've been asked to build has the same full path, global properties, - /// and toolsVersion as those of another loaded Project, we should simply pass this - /// call along to that loaded Project object. - /// - [Test] - [Ignore("undone")] - public void UseSameProjectObjectIfChildIsEquivalent() - { - // UNDONE -- need new msbuild task - // Engine engine = new Engine(Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().EscapedCodeBase).LocalPath)); - // engine.AddToolset(new Toolset("44.0", "someToolsPath"); - // engine.AddToolset(new Toolset("55.0", "anotherToolsPath"); - // engine.AddToolset(new Toolset("66.0", "yetnotherToolsPath"); - - // string childProjectFullPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("child.proj", @" - // - // - // - // - // - // - // - // - // - // "); - - // Project parentProject = new Project(engine, "55.0"); - - // parentProject.GlobalProperties.SetProperty("foo", "bar"); - // Hashtable propertiesTable = new Hashtable(); - // propertiesTable.Add("foo", "bar"); - - // Dictionary targetOutputs = - // new Dictionary(StringComparer.OrdinalIgnoreCase); - - // // Now build through engineProxy, passing the same set of global properties in - // EngineProxy engineProxy = CreateEngineProxyWithDummyTaskEngine(engine, parentProject); - // bool success = engineProxy.BuildProjectFile - // (childProjectFullPath, new string[] { "BuildTarget" }, propertiesTable, targetOutputs, "55.0"); - // Assertion.Assert("Expected a successful build!", success); - // success = engineProxy.BuildProjectFile - // (childProjectFullPath, new string[] { "OtherTarget" }, propertiesTable, targetOutputs, "55.0"); - // Assertion.Assert("Expected a successful build!", success); - - // Assertion.AssertEquals(1, targetOutputs["OtherTarget"].Length); - // ITaskItem toolsVersionItem = targetOutputs["OtherTarget"][0]; - // Assertion.AssertEquals("BuildTargetRan", toolsVersionItem.ItemSpec); - } - - /// - /// If the project we've been asked to build has different full path, global properties, - /// and toolsVersion as those of other loaded Projects, we should create a new project object. - /// - [Test] - [Ignore("undone")] - public void UseDifferentProjectObjectIfChildIsNotEquivalent() - { - // UNDONE - } - - /// - /// If the project we've been asked to build has the same full path, global properties, - /// and toolsVersion as those of another loaded Project, we should simply pass this - /// call along to that loaded Project object. - /// - [Test] - [Ignore("undone")] - public void UseSameProjectObjectIfUsingCallTarget() - { - // UNDONE - } - - internal EngineProxy CreateEngineProxyWithDummyTaskEngine(Engine e, Project p) - { - // UNDONE need a real handle Id and a real TEM pointer - XmlElement taskNode = new XmlDocument().CreateElement("MockTask"); - - BuildRequest request = new BuildRequest(EngineCallback.invalidEngineHandle, "mockproject", null, (BuildPropertyGroup)null, null, -1, false, false); - ProjectBuildState context = new ProjectBuildState(request, new ArrayList(), new BuildEventContext(0, 0, 0, 0)); - int handleId = e.EngineCallback.CreateTaskContext(p, null, context, taskNode, 0, new BuildEventContext(0, 0, 0, 0)); - TaskEngine taskEngine = new TaskEngine - ( - taskNode, - null, /* host object */ - p.FullFileName, - p.FullFileName, - e.LoggingServices, - handleId, - e.NodeManager.TaskExecutionModule, - new BuildEventContext(0, 0, 0, 0) - ); - e.Scheduler.Initialize(new INodeDescription[] { null }); - return new EngineProxy(e.NodeManager.TaskExecutionModule, handleId, p.FullFileName, p.FullFileName, e.LoggingServices, new BuildEventContext(0, 0, 0, 0)); - } - - #endregion - - #region SerializationTests - - internal class CustomEvent : CustomBuildEventArgs - { - internal CustomEvent() { } - } - - internal class CustomMessageEvent : BuildMessageEventArgs - { - internal CustomMessageEvent() { } - } - - internal class CustomErrorEvent : BuildErrorEventArgs - { - internal CustomErrorEvent() { } - } - - internal class CustomWarningEvent : BuildWarningEventArgs - { - internal CustomWarningEvent() { } - } - - [Test] - public void TestCustomEventException() - { - MyCustomLogger myLogger = new MyCustomLogger(); - engine.RegisterLogger(myLogger); - engineProxy2.LogCustomEvent(new CustomEvent()); - engine.LoggingServices.ProcessPostedLoggingEvents(); - Assertion.AssertNull("Expected customEvent to be null", myLogger.lastCustom); - Assertion.AssertNotNull("Expected WarningEvent Not to be null", myLogger.lastWarning); - Assertion.AssertEquals(1, myLogger.numberOfWarning); - Assertion.AssertEquals(0, myLogger.numberOfCustom); - myLogger = null; - - myLogger = new MyCustomLogger(); - engine.RegisterLogger(myLogger); - engineProxy.LogCustomEvent(new CustomEvent()); - engine.LoggingServices.ProcessPostedLoggingEvents(); - Assertion.AssertNotNull("Expected customEvent to Not be null", myLogger.lastCustom); - Assertion.AssertNull("Expected WarningEvent to be null", myLogger.lastWarning); - Assertion.AssertEquals(0, myLogger.numberOfWarning); - Assertion.AssertEquals(1, myLogger.numberOfCustom); - myLogger = null; - } - - [Test] - public void TestCustomErrorEventException() - { - MyCustomLogger myLogger = new MyCustomLogger(); - engine.RegisterLogger(myLogger); - engineProxy2.LogErrorEvent(new CustomErrorEvent()); - engine.LoggingServices.ProcessPostedLoggingEvents(); - Assertion.AssertNull("Expected customErrorEvent to be null", myLogger.lastError); - Assertion.AssertNotNull("Expected WarningEvent Not to be null", myLogger.lastWarning); - Assertion.AssertEquals(1, myLogger.numberOfWarning); - Assertion.AssertEquals(0, myLogger.numberOfError); - myLogger = null; - - myLogger = new MyCustomLogger(); - engine.RegisterLogger(myLogger); - engineProxy.LogErrorEvent(new CustomErrorEvent()); - engine.LoggingServices.ProcessPostedLoggingEvents(); - Assertion.AssertNotNull("Expected customErrorEvent to not be null", myLogger.lastError); - Assertion.AssertNull("Expected WarningEvent to be null", myLogger.lastWarning); - Assertion.AssertEquals(1, myLogger.numberOfError); - Assertion.AssertEquals(0, myLogger.numberOfWarning); - myLogger = null; - } - [Test] - public void TestCustomWarningEventException() - { - MyCustomLogger myLogger = new MyCustomLogger(); - engine.RegisterLogger(myLogger); - engineProxy2.LogWarningEvent(new CustomWarningEvent()); - engine.LoggingServices.ProcessPostedLoggingEvents(); - Assertion.AssertNotNull("Expected WarningEvent Not to be null", myLogger.lastWarning); - Assertion.AssertEquals(1, myLogger.numberOfWarning); - myLogger = null; - - myLogger = new MyCustomLogger(); - engine.RegisterLogger(myLogger); - engineProxy.LogWarningEvent(new CustomWarningEvent()); - engine.LoggingServices.ProcessPostedLoggingEvents(); - Assertion.AssertNotNull("Expected WarningEvent Not to be null", myLogger.lastWarning); - Assertion.AssertEquals(1, myLogger.numberOfWarning); - myLogger = null; - } - [Test] - public void TestCustomMessageEventException() - { - MyCustomLogger myLogger = new MyCustomLogger(); - engine.RegisterLogger(myLogger); - engineProxy2.LogMessageEvent(new CustomMessageEvent()); - engine.LoggingServices.ProcessPostedLoggingEvents(); - Assertion.AssertNull("Expected customMessageEvent to be null", myLogger.lastMessage); - Assertion.AssertNotNull("Expected WarningEvent Not to be null", myLogger.lastWarning); - Assertion.AssertEquals(0, myLogger.numberOfMessage); - Assertion.AssertEquals(1, myLogger.numberOfWarning); - myLogger = null; - - myLogger = new MyCustomLogger(); - engine.RegisterLogger(myLogger); - engineProxy.LogMessageEvent(new CustomMessageEvent()); - engine.LoggingServices.ProcessPostedLoggingEvents(); - Assertion.AssertNotNull("Expected customMessageEvent to not be null", myLogger.lastMessage); - Assertion.AssertNull("Expected WarningEvent to be null", myLogger.lastWarning); - Assertion.AssertEquals(1, myLogger.numberOfMessage); - Assertion.AssertEquals(0, myLogger.numberOfWarning); - myLogger = null; - } - #endregion - } -} diff --git a/src/Deprecated/Engine.UnitTests/Engine_Tests.cs b/src/Deprecated/Engine.UnitTests/Engine_Tests.cs deleted file mode 100644 index 09d0fc9d8fb..00000000000 --- a/src/Deprecated/Engine.UnitTests/Engine_Tests.cs +++ /dev/null @@ -1,1209 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Configuration; -using System.Diagnostics; -using System.IO; -using System.Xml; -using System.Threading; -using System.Reflection; - -using NUnit.Framework; - -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine; -using Microsoft.Build.BuildEngine.Shared; - - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class Engine_Tests - { - [Test] - public void TestMSBuildForwardPropertiesFromChild() - { - Environment.SetEnvironmentVariable("MSBuildForwardPropertiesFromChild", null); - Engine childEngine = new Engine(new BuildPropertyGroup(), new ToolsetDefinitionLocations(), 3, true, 3, string.Empty, string.Empty); - string[] propertiesToSerialize = childEngine.PropertyListToSerialize; - Assert.IsNull(propertiesToSerialize, "Expected propertiesToSerialize to be null"); - childEngine.Shutdown(); - - Environment.SetEnvironmentVariable("MSBuildForwardPropertiesFromChild", string.Empty); - childEngine = new Engine(new BuildPropertyGroup(), new ToolsetDefinitionLocations(), 3, true, 3, string.Empty, string.Empty); - propertiesToSerialize = childEngine.PropertyListToSerialize; - Assert.IsNull(propertiesToSerialize, "Expected propertiesToSerialize to be null"); - childEngine.Shutdown(); - - Environment.SetEnvironmentVariable("MSBuildForwardPropertiesFromChild", "Platform;Configuration"); - childEngine = new Engine(new BuildPropertyGroup(), new ToolsetDefinitionLocations(), 3, true, 3, string.Empty, string.Empty); - propertiesToSerialize = childEngine.PropertyListToSerialize; - Assert.IsTrue(string.Compare(propertiesToSerialize[0], "Platform") == 0); - Assert.IsTrue(string.Compare(propertiesToSerialize[1], "Configuration") == 0); - Assert.IsTrue(propertiesToSerialize.Length == 2); - childEngine.Shutdown(); - - Environment.SetEnvironmentVariable("MSBuildForwardPropertiesFromChild", "Platform;;;;;;;;;;Configuration"); - childEngine = new Engine(new BuildPropertyGroup(), new ToolsetDefinitionLocations(), 3, true, 3, string.Empty, string.Empty); - propertiesToSerialize = childEngine.PropertyListToSerialize; - Assert.IsTrue(string.Compare(propertiesToSerialize[0], "Platform") == 0); - Assert.IsTrue(string.Compare(propertiesToSerialize[1], "Configuration") == 0); - Assert.IsTrue(propertiesToSerialize.Length == 2); - childEngine.Shutdown(); - - Environment.SetEnvironmentVariable("MSBuildForwardPropertiesFromChild", "Platform;"); - childEngine = new Engine(new BuildPropertyGroup(), new ToolsetDefinitionLocations(), 3, true, 3, string.Empty, string.Empty); - propertiesToSerialize = childEngine.PropertyListToSerialize; - Assert.IsTrue(string.Compare(propertiesToSerialize[0], "Platform") == 0); - Assert.IsTrue(propertiesToSerialize.Length == 1); - childEngine.Shutdown(); - - Environment.SetEnvironmentVariable("MSBuildForwardPropertiesFromChild", "Platform"); - childEngine = new Engine(new BuildPropertyGroup(), new ToolsetDefinitionLocations(), 3, true, 3, string.Empty, string.Empty); - propertiesToSerialize = childEngine.PropertyListToSerialize; - Assert.IsTrue(string.Compare(propertiesToSerialize[0], "Platform") == 0); - Assert.IsTrue(propertiesToSerialize.Length == 1); - childEngine.Shutdown(); - - Environment.SetEnvironmentVariable("MSBuildForwardPropertiesFromChild", ";Platform"); - childEngine = new Engine(new BuildPropertyGroup(), new ToolsetDefinitionLocations(), 3, true, 3, string.Empty, string.Empty); - propertiesToSerialize = childEngine.PropertyListToSerialize; - Assert.IsTrue(string.Compare(propertiesToSerialize[0], "Platform") == 0); - Assert.IsTrue(propertiesToSerialize.Length == 1); - childEngine.Shutdown(); - - - Environment.SetEnvironmentVariable("MSBuildForwardPropertiesFromChild", ";Platform;"); - childEngine = new Engine(new BuildPropertyGroup(), new ToolsetDefinitionLocations(), 3, true, 3, string.Empty, string.Empty); - propertiesToSerialize = childEngine.PropertyListToSerialize; - Assert.IsTrue(string.Compare(propertiesToSerialize[0], "Platform") == 0); - Assert.IsTrue(propertiesToSerialize.Length == 1); - childEngine.Shutdown(); - } - - [Test] - public void DefaultToolsVersionInitializedWithBinPath() - { - Engine e = new Engine(@"C:\binpath"); - Assertion.AssertEquals(Constants.defaultToolsVersion, e.DefaultToolsVersion); - Assertion.AssertEquals(@"C:\binpath", e.Toolsets[Constants.defaultToolsVersion].ToolsPath); - } - - [Test] - public void TestTEMBatchSizeSettings() - { - Engine e = new Engine(@"C:\binpath"); - EngineLoggingServicesHelper loggingServicesHelper = new EngineLoggingServicesHelper(); - e.LoggingServices = loggingServicesHelper; - EngineCallback engineCallback = new EngineCallback(e); - Environment.SetEnvironmentVariable("MSBUILDREQUESTBATCHSIZE", "-4"); - TaskExecutionModule TEM = new TaskExecutionModule(engineCallback, TaskExecutionModule.TaskExecutionModuleMode.MultiProcFullNodeMode, false); - DualQueue currentQueue = loggingServicesHelper.GetCurrentQueueBuildEvents(); - BuildEventArgs currentEvent = currentQueue.Dequeue(); - Assertion.Assert("Expected event to be a warning event", currentEvent is BuildWarningEventArgs); - Assertion.Assert(String.Compare(ResourceUtilities.FormatResourceString("BatchRequestSizeOutOfRange", "-4"), ((BuildWarningEventArgs)currentEvent).Message, StringComparison.OrdinalIgnoreCase) == 0); - - e = new Engine(@"C:\binpath"); - loggingServicesHelper = new EngineLoggingServicesHelper(); - e.LoggingServices = loggingServicesHelper; - engineCallback = new EngineCallback(e); - Environment.SetEnvironmentVariable("MSBUILDREQUESTBATCHSIZE", "0"); - TEM = new TaskExecutionModule(engineCallback, TaskExecutionModule.TaskExecutionModuleMode.MultiProcFullNodeMode, false); - currentQueue = loggingServicesHelper.GetCurrentQueueBuildEvents(); - currentEvent = currentQueue.Dequeue(); - Assertion.Assert("Expected event to be a warning event", currentEvent is BuildWarningEventArgs); - Assertion.Assert(String.Compare(ResourceUtilities.FormatResourceString("BatchRequestSizeOutOfRange", "0"), ((BuildWarningEventArgs)currentEvent).Message, StringComparison.OrdinalIgnoreCase) == 0); - - e = new Engine(@"C:\binpath"); - loggingServicesHelper = new EngineLoggingServicesHelper(); - e.LoggingServices = loggingServicesHelper; - engineCallback = new EngineCallback(e); - Environment.SetEnvironmentVariable("MSBUILDREQUESTBATCHSIZE", int.MaxValue.ToString()); - TEM = new TaskExecutionModule(engineCallback, TaskExecutionModule.TaskExecutionModuleMode.MultiProcFullNodeMode, false); - currentQueue = loggingServicesHelper.GetCurrentQueueBuildEvents(); - Assertion.Assert(currentQueue.Count == 0); - - e = new Engine(@"C:\binpath"); - loggingServicesHelper = new EngineLoggingServicesHelper(); - e.LoggingServices = loggingServicesHelper; - engineCallback = new EngineCallback(e); - Environment.SetEnvironmentVariable("MSBUILDREQUESTBATCHSIZE", "4"); - TEM = new TaskExecutionModule(engineCallback, TaskExecutionModule.TaskExecutionModuleMode.MultiProcFullNodeMode, false); - currentQueue = loggingServicesHelper.GetCurrentQueueBuildEvents(); - Assertion.Assert(currentQueue.Count == 0); - - e = new Engine(@"C:\binpath"); - loggingServicesHelper = new EngineLoggingServicesHelper(); - e.LoggingServices = loggingServicesHelper; - engineCallback = new EngineCallback(e); - Environment.SetEnvironmentVariable("MSBUILDREQUESTBATCHSIZE", "Giberish"); - TEM = new TaskExecutionModule(engineCallback, TaskExecutionModule.TaskExecutionModuleMode.MultiProcFullNodeMode, false); - currentQueue = loggingServicesHelper.GetCurrentQueueBuildEvents(); - currentEvent = currentQueue.Dequeue(); - Assertion.Assert("Expected event to be a warning event", currentEvent is BuildWarningEventArgs); - Assertion.Assert(String.Compare(ResourceUtilities.FormatResourceString("BatchRequestSizeOutOfRange", "Giberish"), ((BuildWarningEventArgs)currentEvent).Message, StringComparison.OrdinalIgnoreCase) == 0); - } - - [Test] - [ExpectedException(typeof(InvalidOperationException))] - public void SettingDefaultToolsVersionThrowsIfProjectsAlreadyLoaded() - { - Engine e = new Engine(ToolsetDefinitionLocations.None); - - try - { - e.AddToolset(new Toolset("1.0", "someToolsPath")); - e.AddToolset(new Toolset("2.0", "someToolsPath")); - e.DefaultToolsVersion = "1.0"; // OK - } - catch(InvalidOperationException) - { - // Make sure the first one doesn't throw - Assertion.Assert(false); - } - - try - { - string p1Path = ObjectModelHelpers.CreateFileInTempProjectDirectory("p1.csproj", @""); - Project p1 = new Project(e); - p1.Load(p1Path); - - e.DefaultToolsVersion = "2.0"; // Throws - } - finally - { - ObjectModelHelpers.DeleteTempProjectDirectory(); - } - } - - [Test] - public void AddingAnExistingToolsVersionDirtiesLoadedProjects() - { - try - { - Engine e = new Engine(ToolsetDefinitionLocations.None); - e.AddToolset(new Toolset("2.0", "someToolsPath")); - e.AddToolset(new Toolset("3.0", "anotherToolsPath")); - - string p1Path = ObjectModelHelpers.CreateFileInTempProjectDirectory("p1.csproj", @""); - string p2Path = ObjectModelHelpers.CreateFileInTempProjectDirectory("p2.csproj", @""); - - Project p1 = new Project(e, "2.0"); - p1.Load(p1Path); - Project p2 = new Project(e, "3.0"); - p2.Load(p2Path); - - Assertion.Assert("Expected p1.IsDirty to be false", !p1.IsDirty); - Assertion.Assert("Expected p2.IsDirty to be false", !p2.IsDirty); - - e.AddToolset(new Toolset("2.0", "someTotallyDifferentToolsPath")); - - Assertion.Assert("Expected p1.IsDirty to be true", p1.IsDirty); - Assertion.Assert("Expected p2.IsDirty to be false", !p2.IsDirty); - - } - finally - { - ObjectModelHelpers.DeleteTempProjectDirectory(); - } - } - - [Test] - public void BinPathAfterDefaultToolsVersionChange() - { - Engine e = new Engine(ToolsetDefinitionLocations.None); - e.AddToolset(new Toolset("orcas", @"C:\OrcasBinPath")); - e.DefaultToolsVersion = "Orcas"; - Assertion.AssertEquals(@"C:\OrcasBinPath", e.BinPath); - Assertion.AssertEquals("Orcas", e.DefaultToolsVersion); - } - - [Test] - public void GetToolsVersionNames() - { - // Check the contents of GetToolsVersions on engine creation - Engine e = new Engine(ToolsetDefinitionLocations.None); - - List toolsVersions = new List(e.Toolsets.ToolsVersions); - Assertion.AssertEquals(1, toolsVersions.Count); - Assertion.AssertEquals(Constants.defaultToolsVersion, toolsVersions[0]); - - // Check the contents after adding two more tools versions - e.Toolsets.Add(new Toolset("Whidbey", @"C:\WhidbeyPath")); - e.Toolsets.Add(new Toolset("orcas", @"C:\OrcasBinPath")); - - Dictionary toolsVersionNamesDictionary = new Dictionary(StringComparer.OrdinalIgnoreCase); - foreach (string name in e.Toolsets.ToolsVersions) - { - toolsVersionNamesDictionary[name] = null; - } - - Assertion.AssertEquals(3, toolsVersionNamesDictionary.Count); - Assertion.AssertEquals(true, toolsVersionNamesDictionary.ContainsKey(Constants.defaultToolsVersion)); - Assertion.AssertEquals(true, toolsVersionNamesDictionary.ContainsKey("Whidbey")); - Assertion.AssertEquals(true, toolsVersionNamesDictionary.ContainsKey("Orcas")); - } - - [Test] - public void GetToolsetSettings() - { - Engine e = new Engine(@"C:\binpath"); - - e.Toolsets.Add(new Toolset("Whidbey", @"C:\WhidbeyPath")); - BuildPropertyGroup properties = new BuildPropertyGroup(); - properties.SetProperty("foo", "bar"); - e.Toolsets.Add(new Toolset("orcas", @"C:\OrcasBinPath", properties)); - - Toolset ts1 = e.Toolsets["Whidbey"]; - Toolset ts2 = e.Toolsets["Orcas"]; - - Assertion.AssertEquals(@"C:\WhidbeyPath", ts1.ToolsPath); - Assertion.AssertEquals(@"C:\OrcasBinPath", ts2.ToolsPath); - Assertion.AssertEquals(0, ts1.BuildProperties.Count); - Assertion.AssertEquals(1, ts2.BuildProperties.Count); - Assertion.AssertEquals("bar", ts2.BuildProperties["foo"].Value); - } - - [Test] - public void GetToolsetProxiesToolset() - { - Engine e = new Engine(@"C:\binpath"); - - e.Toolsets.Add(new Toolset("Whidbey", @"C:\WhidbeyPath")); - - BuildPropertyGroup properties = new BuildPropertyGroup(); - properties.SetProperty("foo", "bar"); - e.Toolsets.Add(new Toolset("orcas", @"C:\OrcasBinPath", properties)); - - Toolset ts1 = e.Toolsets["orcas"]; - ts1.BuildProperties["foo"].Value = "bar2"; - ts1.BuildProperties.SetProperty("foo2", "bar3"); - Assertion.AssertEquals("bar2", ts1.BuildProperties["foo"].Value); - Assertion.AssertEquals("bar3", ts1.BuildProperties["foo2"].Value); - - // Get it again, should be unchanged - Toolset ts1b = e.Toolsets["orcas"]; - Assertion.AssertEquals("bar", ts1b.BuildProperties["foo"].Value); - Assertion.AssertNull(ts1b.BuildProperties["foo2"]); - } - - /// - /// Check the code that assigns values to MSBuildBinPath - /// - [Test] - public void MSBuildBinPath() - { - Engine engine = new Engine(); - - engine.BinPath = @"C:"; - Assertion.AssertEquals(@"C:", engine.BinPath); // the user should be able to pass in a raw drive letter - engine.BinPath = @"C:\"; - Assertion.AssertEquals(@"C:\", engine.BinPath); - engine.BinPath = @"C:\\"; - Assertion.AssertEquals(@"C:\", engine.BinPath); - - engine.BinPath = @"C:\foo"; - Assertion.AssertEquals(@"C:\foo", engine.BinPath); - engine.BinPath = @"C:\foo\"; - Assertion.AssertEquals(@"C:\foo", engine.BinPath); - engine.BinPath = @"C:\foo\\"; - Assertion.AssertEquals(@"C:\foo\", engine.BinPath); // trim at most one slash - - engine.BinPath = @"\\foo\share"; - Assertion.AssertEquals(@"\\foo\share", engine.BinPath); - engine.BinPath = @"\\foo\share\"; - Assertion.AssertEquals(@"\\foo\share", engine.BinPath); - engine.BinPath = @"\\foo\share\\"; - Assertion.AssertEquals(@"\\foo\share\", engine.BinPath); // trim at most one slash - } - - /// - /// When a project fails to load successfully, the engine should not be tracking it. - /// Bug VSWhidbey 415236. - /// - [Test] - public void MalformedProjectDoesNotGetAddedToEngine - ( - ) - { - Engine myEngine = new Engine(@"c:\"); - Project myProject = myEngine.CreateNewProject(); - - // Create a temp file to be used as our project file. - string projectFile = Path.GetTempFileName(); - try - { - // Write some garbage into a project file. - File.WriteAllText(projectFile, "blah"); - Assertion.AssertNull("Engine should not know about project before project has been loaded", - myEngine.GetLoadedProject(projectFile)); - - int exceptionCount = 0; - - // Load the garbage project file. We should get an exception. - try - { - myProject.Load(projectFile); - } - catch (InvalidProjectFileException) - { - exceptionCount++; - } - - Assertion.AssertEquals("Should have received invalid project file exception.", 1, exceptionCount); - - Assertion.AssertNull("Engine should not know about project if project load failed.", - myEngine.GetLoadedProject(projectFile)); - } - finally - { - // Get a little extra code coverage - myEngine.UnregisterAllLoggers(); - myEngine.UnloadAllProjects(); - - File.Delete(projectFile); - } - } - - /// - /// Engine.BuildProjectFile method with project file specified does not honor global properties set in the engine object - /// Bug VSWhidbey 570988. - /// - [Test] - public void BuildProjectFileWithGlobalPropertiesSetInEngineObjectWithProjectFileSpecified - ( - ) - { - MockEngine myEngine = new MockEngine(); - string projectFile = CreateGlobalPropertyProjectFile(); - try - { - myEngine.GlobalProperties.SetProperty("MyGlobalProp", "SomePropertyText"); - myEngine.BuildProjectFile(projectFile); - myEngine.AssertLogContains("SomePropertyText"); - } - finally - { - myEngine.UnregisterAllLoggers(); - myEngine.UnloadAllProjects(); - File.Delete(projectFile); - } - } - - /// - /// Engine.BuildProjectFile method with project file and target specified does not honor global properties set in the engine object - /// Bug VSWhidbey 570988. - /// - [Test] - public void BuildProjectFileWithGlobalPropertiesSetInEngineObjectWithProjectFileAndTargetSpecified - ( - ) - { - MockEngine myEngine = new MockEngine(); - string projectFile = CreateGlobalPropertyProjectFile(); - try - { - myEngine.GlobalProperties.SetProperty("MyGlobalProp", "SomePropertyText"); - myEngine.BuildProjectFile(projectFile, "Build"); - myEngine.AssertLogContains("SomePropertyText"); - } - finally - { - myEngine.UnregisterAllLoggers(); - myEngine.UnloadAllProjects(); - File.Delete(projectFile); - } - } - - /// - /// Engine.BuildProjectFile method with project file and target list specified does not honor global properties set in the engine object - /// Bug VSWhidbey 570988. - /// - [Test] - public void BuildProjectFileWithGlobalPropertiesSetInEngineObjectWithProjectFileAndTargetListSpecified - ( - ) - { - string[] targets; - MockEngine myEngine = new MockEngine(); - string projectFile = CreateGlobalPropertyProjectFile(); - try - { - targets = new string[1]; - targets[0] = "Build"; - myEngine.GlobalProperties.SetProperty("MyGlobalProp", "SomePropertyText"); - myEngine.BuildProjectFile(projectFile, targets); - myEngine.AssertLogContains("SomePropertyText"); - } - finally - { - myEngine.UnregisterAllLoggers(); - myEngine.UnloadAllProjects(); - File.Delete(projectFile); - } - } - - - /// - /// Try building a project where the global properties passed in are null. The project should build and not crash - /// - [Test] - public void BuildProjectFileWithNullGlobalProperties - ( - ) - { - string[] targets; - MockEngine myEngine = new MockEngine(); - string projectFile = CreateGlobalPropertyProjectFile(); - try - { - targets = new string[1]; - targets[0] = "Build"; - bool result = myEngine.BuildProjectFile(projectFile, targets, null); - myEngine.AssertLogDoesntContain("SomePropertyText"); - Assert.IsTrue(result); - } - finally - { - myEngine.UnregisterAllLoggers(); - myEngine.UnloadAllProjects(); - File.Delete(projectFile); - } - } - - - /// - /// Test building multiple projects in paralle using the object model, both individual projects and traversal projects - /// - [Test] - [Ignore("Commenting this out as it sporadically fails. It is not clear what scenarios we will support for the reshipped MSBuild engine and we will decide in beta 2.")] - public void BuildProjectFilesInParallel() - { - - //Gets the currently loaded assembly in which the specified class is defined - Assembly engineAssembly = Assembly.GetAssembly(typeof(Engine)); - string loggerClassName = "Microsoft.Build.BuildEngine.ConfigurableForwardingLogger"; - string loggerAssemblyName = engineAssembly.GetName().FullName; - LoggerDescription forwardingLoggerDescription = new LoggerDescription(loggerClassName, loggerAssemblyName, null, null, LoggerVerbosity.Normal); - - string[] fileNames = new string[10]; - string traversalProject = TraversalProjectFile("ABC"); - string[][] targetNamesPerProject = new string[fileNames.Length][]; - IDictionary[] targetOutPutsPerProject = new IDictionary[fileNames.Length]; - BuildPropertyGroup[] globalPropertiesPerProject = new BuildPropertyGroup[fileNames.Length]; - string[] tempfilesToDelete = new string[fileNames.Length]; - Engine engine = new Engine(null, ToolsetDefinitionLocations.ConfigurationFile | ToolsetDefinitionLocations.Registry, 4, "msbuildlocation="+AppDomain.CurrentDomain.BaseDirectory); - engine.RegisterLogger(new ConsoleLogger(LoggerVerbosity.Normal)); - try - { - for (int i = 0; i < fileNames.Length; i++) - { - string[] ProjectFiles1 = CreateGlobalPropertyProjectFileWithExtension("ABC"); - fileNames[i] = ProjectFiles1[0]; - tempfilesToDelete[i] = ProjectFiles1[1]; - targetNamesPerProject[i] = new string[] { "Build" }; - } - - // Test building a traversal - - engine.BuildProjectFile(traversalProject); - engine.Shutdown(); - - // Test building the same set of files in parallel - Console.Out.WriteLine("1:"+Process.GetCurrentProcess().MainModule.FileName); - Console.Out.WriteLine("2:" + AppDomain.CurrentDomain.BaseDirectory); - engine = new Engine(null, ToolsetDefinitionLocations.ConfigurationFile | ToolsetDefinitionLocations.Registry, 4, "msbuildlocation="+ AppDomain.CurrentDomain.BaseDirectory); - engine.RegisterDistributedLogger(new ConsoleLogger(LoggerVerbosity.Normal), forwardingLoggerDescription); - engine.BuildProjectFiles(fileNames, targetNamesPerProject, globalPropertiesPerProject, targetOutPutsPerProject, BuildSettings.None, new string[fileNames.Length]); - engine.Shutdown(); - - // Do the same using singleproc - engine = new Engine(null, ToolsetDefinitionLocations.ConfigurationFile | ToolsetDefinitionLocations.Registry, 4, "msbuildlocation="+ AppDomain.CurrentDomain.BaseDirectory); - engine.RegisterLogger(new ConsoleLogger(LoggerVerbosity.Normal)); - engine.BuildProjectFile(traversalProject); - engine.Shutdown(); - - engine = new Engine(null, ToolsetDefinitionLocations.ConfigurationFile | ToolsetDefinitionLocations.Registry, 1, "msbuildlocation="+ AppDomain.CurrentDomain.BaseDirectory); - engine.RegisterLogger(new ConsoleLogger(LoggerVerbosity.Normal)); - engine.BuildProjectFiles(fileNames, targetNamesPerProject, globalPropertiesPerProject, targetOutPutsPerProject, BuildSettings.None, new string[fileNames.Length]); - - } - finally - { - engine.Shutdown(); - for (int i = 0; i < fileNames.Length; i++) - { - File.Delete(fileNames[i]); - File.Delete(tempfilesToDelete[i]); - } - File.Delete(traversalProject); - } - } - - - /// - /// Test building multiple projects in parallel using the OM. Try building multiple project builds on the same engine. - /// - [Test] - [Ignore("Commenting this out as it sporadically fails. It is not clear what scenarios we will support for the reshipped MSBuild engine and we will decide in beta 2.")] - public void BuildProjectFilesInParallel2() - { - string[] fileNames = new string[10]; - string[] fileNames2 = new string[10]; - string[] fileNamesLeafs = new string[10]; - string[] childTraversals = new string[10]; - string parentTraversal = TraversalProjectFile("CTrav"); - string traversalProject = TraversalProjectFile("ABC"); - - string[][] targetNamesPerProject = new string[fileNames.Length][]; - IDictionary[] targetOutPutsPerProject = new IDictionary[fileNames.Length]; - BuildPropertyGroup[] globalPropertiesPerProject = new BuildPropertyGroup[fileNames.Length]; - - string[] tempfilesToDelete = new string[fileNames.Length]; - string[] tempfilesToDelete2 = new string[fileNames.Length]; - string[] tempfilesToDelete3 = new string[fileNames.Length]; - string[] tempfilesToDelete4 = new string[fileNames.Length]; - Engine engine = new Engine(null, ToolsetDefinitionLocations.ConfigurationFile | ToolsetDefinitionLocations.Registry, 4, "msbuildlocation="+ AppDomain.CurrentDomain.BaseDirectory); - try - { - for (int i = 0; i < fileNames.Length; i++) - { - string[] ProjectFiles1 = CreateGlobalPropertyProjectFileWithExtension("ABC"); - string[] ProjectFiles2 = CreateGlobalPropertyProjectFileWithExtension("DEF"); - string[] FileNamesLeafs = CreateGlobalPropertyProjectFileWithExtension("LEAF"); - string[] ChildTraversals = CreateSingleProjectTraversalFileWithExtension(FileNamesLeafs[0],"CTrav"); - - fileNames[i] = ProjectFiles1[0]; - fileNames2[i] = ProjectFiles2[0]; - fileNamesLeafs[i] = FileNamesLeafs[0]; - childTraversals[i] = ChildTraversals[0]; - - tempfilesToDelete[i] = ProjectFiles1[1]; - tempfilesToDelete2[i] = ProjectFiles2[1]; - tempfilesToDelete3[i] = FileNamesLeafs[1]; - tempfilesToDelete4[i] = ChildTraversals[1]; - targetNamesPerProject[i] = new string[] { "Build" }; - } - - - // Try building a traversal project that had other traversals - - engine.RegisterLogger(new ConsoleLogger(LoggerVerbosity.Normal)); - engine.BuildProjectFile(parentTraversal, new string[] { "Build" }, new BuildPropertyGroup(), null, BuildSettings.None, "3.5"); - engine.Shutdown(); - - engine = new Engine(null, ToolsetDefinitionLocations.ConfigurationFile | ToolsetDefinitionLocations.Registry, 4, "msbuildlocation="+ AppDomain.CurrentDomain.BaseDirectory); - engine.RegisterLogger(new ConsoleLogger(LoggerVerbosity.Normal)); - // Try building the same traversal project on the same engine one after another - engine.BuildProjectFile(traversalProject); - engine.BuildProjectFile(traversalProject); - engine.Shutdown(); - - // Try building the same set of project files on the same engine one after another - engine = new Engine(null, ToolsetDefinitionLocations.ConfigurationFile | ToolsetDefinitionLocations.Registry, 4, "msbuildlocation="+ AppDomain.CurrentDomain.BaseDirectory); - engine.RegisterLogger(new ConsoleLogger(LoggerVerbosity.Normal)); - engine.BuildProjectFiles(fileNames, targetNamesPerProject, globalPropertiesPerProject, targetOutPutsPerProject, BuildSettings.None, new string[fileNames.Length]); - engine.BuildProjectFiles(fileNames, targetNamesPerProject, globalPropertiesPerProject, targetOutPutsPerProject, BuildSettings.None, new string[fileNames.Length]); - engine.Shutdown(); - - // Try building a set of project files, then the same set as a traversal on the same engine - engine = new Engine(null, ToolsetDefinitionLocations.ConfigurationFile | ToolsetDefinitionLocations.Registry, 4, "msbuildlocation="+ AppDomain.CurrentDomain.BaseDirectory); - engine.RegisterLogger(new ConsoleLogger(LoggerVerbosity.Normal)); - engine.BuildProjectFiles(fileNames2, targetNamesPerProject, globalPropertiesPerProject, targetOutPutsPerProject, BuildSettings.None, new string[fileNames.Length]); - engine.BuildProjectFile(traversalProject); - engine.Shutdown(); - - - // Try building a traversal, then the same files which are in the traversal in parallel on the same engine - engine = new Engine(null, ToolsetDefinitionLocations.ConfigurationFile | ToolsetDefinitionLocations.Registry, 4, "msbuildlocation="+ AppDomain.CurrentDomain.BaseDirectory); - engine.RegisterLogger(new ConsoleLogger(LoggerVerbosity.Normal)); - engine.BuildProjectFile(traversalProject); - engine.BuildProjectFiles(fileNames2, targetNamesPerProject, globalPropertiesPerProject, targetOutPutsPerProject, BuildSettings.None, new string[fileNames.Length]); - engine.Shutdown(); - /* Do the same as above using single proc */ - - // Try building the same traversal project on the same engine one after another - engine = new Engine(null, ToolsetDefinitionLocations.ConfigurationFile | ToolsetDefinitionLocations.Registry, 1, "msbuildlocation="+ AppDomain.CurrentDomain.BaseDirectory); - engine.RegisterLogger(new ConsoleLogger(LoggerVerbosity.Normal)); - engine.BuildProjectFile(traversalProject); - engine.BuildProjectFile(traversalProject); - engine.Shutdown(); - - // Try building the same set of project files on the same engine one after another - engine = new Engine(null, ToolsetDefinitionLocations.ConfigurationFile | ToolsetDefinitionLocations.Registry, 1, "msbuildlocation="+ AppDomain.CurrentDomain.BaseDirectory); - engine.RegisterLogger(new ConsoleLogger(LoggerVerbosity.Normal)); - engine.BuildProjectFiles(fileNames, targetNamesPerProject, globalPropertiesPerProject, targetOutPutsPerProject, BuildSettings.None, new string[fileNames.Length]); - engine.BuildProjectFiles(fileNames, targetNamesPerProject, globalPropertiesPerProject, targetOutPutsPerProject, BuildSettings.None, new string[fileNames.Length]); - engine.Shutdown(); - - // Try building a set of project files, then the same set as a traversal on the same engine - engine = new Engine(null, ToolsetDefinitionLocations.ConfigurationFile | ToolsetDefinitionLocations.Registry, 1, "msbuildlocation="+ AppDomain.CurrentDomain.BaseDirectory); - engine.RegisterLogger(new ConsoleLogger(LoggerVerbosity.Normal)); - engine.BuildProjectFiles(fileNames2, targetNamesPerProject, globalPropertiesPerProject, targetOutPutsPerProject, BuildSettings.None, new string[fileNames.Length]); - engine.BuildProjectFile(traversalProject); - engine.Shutdown(); - - // Try building a traversal, then the same files which are in the traversal in parallel on the same engine - engine = new Engine(null, ToolsetDefinitionLocations.ConfigurationFile | ToolsetDefinitionLocations.Registry, 4, "msbuildlocation="+ AppDomain.CurrentDomain.BaseDirectory); - engine.RegisterLogger(new ConsoleLogger(LoggerVerbosity.Normal)); - engine.BuildProjectFile(traversalProject); - engine.BuildProjectFiles(fileNames2, targetNamesPerProject, globalPropertiesPerProject, targetOutPutsPerProject, BuildSettings.None, new string[fileNames.Length]); - } - finally - { - engine.Shutdown(); - for (int i = 0; i < fileNames.Length; i++) - { - File.Delete(fileNames[i]); - File.Delete(fileNames2[i]); - File.Delete(fileNamesLeafs[i]); - File.Delete(childTraversals[i]); - File.Delete(tempfilesToDelete[i]); - File.Delete(tempfilesToDelete2[i]); - File.Delete(tempfilesToDelete3[i]); - File.Delete(tempfilesToDelete4[i]); - } - File.Delete(traversalProject); - } - } - - private string CreateGlobalPropertyProjectFile() - { - string projectFileContents = ObjectModelHelpers.CleanupFileContents(@" - - - - - - "); - string projectFile = Path.GetTempFileName(); - using (StreamWriter fileStream = - new StreamWriter(projectFile)) - { - fileStream.Write(projectFileContents); - } - return projectFile; - } - - - /// - /// Create a new project file that outputs a property - /// - /// - private string[] CreateGlobalPropertyProjectFileWithExtension(string extension) - { - string projectFileContents = @" - - - - - - "; - string tempFile = Path.GetTempFileName(); - string projectFile = tempFile + extension; - using (StreamWriter fileStream = - new StreamWriter(projectFile)) - { - fileStream.Write(projectFileContents); - } - return new string[] { projectFile, tempFile }; - } - - private string[] CreateSingleProjectTraversalFileWithExtension(string projectName, string extension) - { - string projectFileContents = @" - - "; - projectFileContents = projectFileContents + @" - - - - - - - "; - string tempFile = Path.GetTempFileName(); - string projectFile = tempFile + extension; - using (StreamWriter fileStream = - new StreamWriter(projectFile)) - { - fileStream.Write(projectFileContents); - } - return new string[] { projectFile, tempFile }; - } - - private string TraversalProjectFile(string extensionForChildProjects) - { - - string projectFileContents = @" - - "; - projectFileContents = projectFileContents + @" - - - - - - - "; - string projectFile = Path.GetTempFileName(); - using (StreamWriter fileStream = - new StreamWriter(projectFile)) - { - fileStream.Write(projectFileContents); - } - return projectFile; - } - - [Test] - public void RestoringProjectIdFromCache() - { - string childProject = ObjectModelHelpers.CreateTempFileOnDisk(@" - - - - - - - "); - - string mainProject = ObjectModelHelpers.CreateTempFileOnDisk(@" - - - - - - - ", childProject); - - ProjectIdLogger logger = new ProjectIdLogger(); - Engine engine = new Engine(); - engine.RegisterLogger(logger); - - Project project = new Project(engine, "4.0"); - project.Load(mainProject); - - bool success = project.Build(null, null); - Assertion.Assert("Build failed. See Standard Out tab for details", success); - - Assert.AreEqual(3, logger.ProjectStartedEvents.Count); - // Project ID should be preserved between runs - Assert.AreEqual(logger.ProjectStartedEvents[1].ProjectId, logger.ProjectStartedEvents[2].ProjectId); - // Project context ID should be different for every entry into the project. - Assert.AreNotEqual(logger.ProjectStartedEvents[1].BuildEventContext.ProjectContextId, logger.ProjectStartedEvents[2].BuildEventContext.ProjectContextId); - } - - /// - /// Build a project where the global properties of the child project is poorly formatted. - /// - [Test] - public void BuildProjectWithPoorlyFormattedGlobalProperty() - { - string childProject = ObjectModelHelpers.CreateTempFileOnDisk(@" - - - - - - "); - - string mainProject = ObjectModelHelpers.CreateTempFileOnDisk(@" - - - - ``=1 - - - - - - - ", childProject); - - ProjectIdLogger logger = new ProjectIdLogger(); - Engine engine = new Engine(); - engine.RegisterLogger(logger); - - Project project = new Project(engine, "4.0"); - project.Load(mainProject); - - bool success = project.Build(null, null); - Assertion.Assert("Build succeeded and should have failed. See Standard Out tab for details", !success); - } - - /// - /// Build a project where the global properties of the child project is a reserved property. - /// - [Test] - public void BuildProjectWithReservedGlobalProperty() - { - string childProject = ObjectModelHelpers.CreateTempFileOnDisk(@" - - - - "); - - string mainProject = ObjectModelHelpers.CreateTempFileOnDisk(@" - - - - - - Target=1 - - - ", childProject); - - ProjectIdLogger logger = new ProjectIdLogger(); - Engine engine = new Engine(); - engine.RegisterLogger(logger); - - Project project = new Project(engine, "4.0"); - project.Load(mainProject); - - bool success = project.Build(null, null); - Assertion.Assert("Build succeded and should have failed. See Standard Out tab for details", !success); - } - - /// - /// We should use the Prjects tools version if a particular tools version is not specified. - /// - [Test] - public void ProjectShouldBuildUsingProjectToolsVersion() - { - try - { - string projectContent = - @" - - - - - - "; - MockLogger logger = new MockLogger(); - Engine e = new Engine(); - e.RegisterLogger(logger); - - string p1Path = ObjectModelHelpers.CreateFileInTempProjectDirectory("p1.proj", projectContent); - - Project p1 = new Project(e); - p1.Load(p1Path); - p1.Build(); - - logger.AssertLogContains("[a=" + ObjectModelHelpers.MSBuildDefaultToolsVersion + "]"); - Assertion.Assert("Cachescope should have an entry with " + ObjectModelHelpers.MSBuildDefaultToolsVersion, e.CacheManager.GetCacheScope(p1Path, new BuildPropertyGroup(), ObjectModelHelpers.MSBuildDefaultToolsVersion, CacheContentType.BuildResults) != null); - - } - finally - { - ObjectModelHelpers.DeleteTempProjectDirectory(); - } - } - - /// - /// We should use the default tools version if a particular tools version is not specified. - /// - [Test] - public void ProjectShouldUseDefaultToolsVersionIfOneIsNotSpecified() - { - try - { - string projectContent = - @" - - - - - - "; - MockLogger logger = new MockLogger(); - Engine e = new Engine(); - e.RegisterLogger(logger); - - string p1Path = ObjectModelHelpers.CreateFileInTempProjectDirectory("p1.proj", projectContent); - - Project p1 = new Project(e); - p1.Load(p1Path); - p1.Build(); - - Assertion.Assert("Cachescope should have an entry with default tools version", e.CacheManager.GetCacheScope(p1Path, new BuildPropertyGroup(), e.DefaultToolsVersion, CacheContentType.BuildResults) != null); - - } - finally - { - ObjectModelHelpers.DeleteTempProjectDirectory(); - } - } - - - /// - /// Project built using MSBuild task should use the default tools version if one is not specified. - /// - [Test] - public void ProjectBuiltUsingMSBuildTaskShouldBuildUsingDefaultToolsVersionIfOneIsNotSpecified() - { - try - { - string projectContent = - @" - - - - - - - "; - string projectContent2 = - @" - - - - - - "; - - MockLogger logger = new MockLogger(); - Engine e = new Engine(); - e.RegisterLogger(logger); - - string p1Path = ObjectModelHelpers.CreateFileInTempProjectDirectory("p1.proj", projectContent); - string p2Path = ObjectModelHelpers.CreateFileInTempProjectDirectory("p2.proj", projectContent2); - - Project p1 = new Project(e); - p1.Load(p1Path); - p1.Build(); - - logger.AssertLogContains("[a="+ ObjectModelHelpers.MSBuildDefaultToolsVersion + "]"); - Assertion.Assert("Cachescope should have an entry with 4.0", e.CacheManager.GetCacheScope(p1Path, new BuildPropertyGroup(), ObjectModelHelpers.MSBuildDefaultToolsVersion, CacheContentType.BuildResults) != null); - Assertion.Assert("Cachescope should have an entry with default tools version", e.CacheManager.GetCacheScope(p2Path, new BuildPropertyGroup(), e.DefaultToolsVersion, CacheContentType.BuildResults) != null); - - } - finally - { - ObjectModelHelpers.DeleteTempProjectDirectory(); - } - } - - /// - /// Project built using MSBuild task should use the default tools version if one is not specified. - /// - [Test] - public void ProjectBuiltUsingMSBuildTaskShouldUseProjectToolsVersionIfOneIsSpecified() - { - try - { - string projectContent = - @" - - - - - - - "; - string projectContent2 = - @" - - - - - - "; - - MockLogger logger = new MockLogger(); - Engine e = new Engine(); - e.RegisterLogger(logger); - - string p1Path = ObjectModelHelpers.CreateFileInTempProjectDirectory("p1.proj", projectContent); - string p2Path = ObjectModelHelpers.CreateFileInTempProjectDirectory("p2.proj", projectContent2); - - Project p1 = new Project(e); - p1.Load(p1Path); - p1.Build(); - - logger.AssertLogContains("[a="+ ObjectModelHelpers.MSBuildDefaultToolsVersion + "]"); - logger.AssertLogContains("[b="+ ObjectModelHelpers.MSBuildDefaultToolsVersion + "]"); - Assertion.Assert("Cachescope should have an entry with " + ObjectModelHelpers.MSBuildDefaultToolsVersion, e.CacheManager.GetCacheScope(p1Path, new BuildPropertyGroup(), ObjectModelHelpers.MSBuildDefaultToolsVersion, CacheContentType.BuildResults) != null); - Assertion.Assert("Cachescope should have an entry with " + ObjectModelHelpers.MSBuildDefaultToolsVersion, e.CacheManager.GetCacheScope(p2Path, new BuildPropertyGroup(), ObjectModelHelpers.MSBuildDefaultToolsVersion, CacheContentType.BuildResults) != null); - - } - finally - { - ObjectModelHelpers.DeleteTempProjectDirectory(); - } - } - - - /// - /// Project built using MSBuild task should use the tools version scecified in the task. - /// - [Test] - public void ProjectBuiltUsingMSBuildTaskAndToolsVersionShouldUseTheOneSpecifiedInMSBuildTask() - { - try - { - string projectContent = - @" - - - - - - - - - "; - string projectContent2 = - @" - - - - - - "; - - MockLogger logger = new MockLogger(); - Engine e = new Engine(); - e.RegisterLogger(logger); - - string p1Path = ObjectModelHelpers.CreateFileInTempProjectDirectory("p1.proj", projectContent); - string p2Path = ObjectModelHelpers.CreateFileInTempProjectDirectory("p2.proj", projectContent2); - - Project p1 = new Project(e); - p1.Load(p1Path); - p1.Build(); - - logger.AssertLogContains("[a=" + ObjectModelHelpers.MSBuildDefaultToolsVersion + "]"); - logger.AssertLogContains("[b=2.0]"); - logger.AssertLogContains("[b=" + ObjectModelHelpers.MSBuildDefaultToolsVersion + "]"); - Assertion.Assert("Cachescope should have an entry with " + ObjectModelHelpers.MSBuildDefaultToolsVersion, e.CacheManager.GetCacheScope(p1Path, new BuildPropertyGroup(), ObjectModelHelpers.MSBuildDefaultToolsVersion, CacheContentType.BuildResults) != null); - Assertion.Assert("Cachescope should have an entry with 2.0", e.CacheManager.GetCacheScope(p2Path, new BuildPropertyGroup(), "2.0", CacheContentType.BuildResults) != null); - Assertion.Assert("Cachescope should have an entry with " + ObjectModelHelpers.MSBuildDefaultToolsVersion, e.CacheManager.GetCacheScope(p2Path, new BuildPropertyGroup(), ObjectModelHelpers.MSBuildDefaultToolsVersion, CacheContentType.BuildResults) != null); - } - finally - { - ObjectModelHelpers.DeleteTempProjectDirectory(); - } - } - - /// - /// OverridingToolsVersion in Project should be false if the build request tools version and the project's tools version are the same - /// - [Test] - public void ProjectToolsVersionOverwriteIsFalse() - { - try - { - string projectContent = - @" - - - - - - - - - "; - string projectContent2 = - @" - - - - - - "; - - MockLogger logger = new MockLogger(); - Engine e = new Engine(); - e.RegisterLogger(logger); - - string p1Path = ObjectModelHelpers.CreateFileInTempProjectDirectory("p1.proj", projectContent); - string p2Path = ObjectModelHelpers.CreateFileInTempProjectDirectory("p2.proj", projectContent2); - - Project p1 = new Project(e); - p1.Load(p1Path); - p1.Build(); - - logger.AssertLogContains("[a="+ ObjectModelHelpers.MSBuildDefaultToolsVersion + "]"); - logger.AssertLogContains("[b=" + ObjectModelHelpers.MSBuildDefaultToolsVersion + "]"); - - Assertion.Assert("Cachescope should have an entry with " + ObjectModelHelpers.MSBuildDefaultToolsVersion, e.CacheManager.GetCacheScope(p1Path, new BuildPropertyGroup(), ObjectModelHelpers.MSBuildDefaultToolsVersion, CacheContentType.BuildResults) != null); - Assertion.Assert("Cachescope should have an entry with " + ObjectModelHelpers.MSBuildDefaultToolsVersion, e.CacheManager.GetCacheScope(p2Path, new BuildPropertyGroup(), ObjectModelHelpers.MSBuildDefaultToolsVersion, CacheContentType.BuildResults) != null); - } - finally - { - ObjectModelHelpers.DeleteTempProjectDirectory(); - } - } - - /// - /// OverridingToolsVersion in Project should be true if the build request tools version and the project's tools version are not the same - /// - [Test] - public void ProjectToolsVersionOverwriteIsTrue() - { - try - { - string projectContent = - @" - - - - - - - - - "; - string projectContent2 = - @" - - - - - - "; - - MockLogger logger = new MockLogger(); - Engine e = new Engine(); - e.RegisterLogger(logger); - - string p1Path = ObjectModelHelpers.CreateFileInTempProjectDirectory("p1.proj", projectContent); - string p2Path = ObjectModelHelpers.CreateFileInTempProjectDirectory("p2.proj", projectContent2); - - Project p1 = new Project(e, "2.0"); - p1.Load(p1Path); - p1.Build(); - - logger.AssertLogContains("[a=2.0]"); - logger.AssertLogContains("[b=2.0]"); - - Assertion.Assert("Cachescope should have an entry with 2.0", e.CacheManager.GetCacheScope(p1Path, new BuildPropertyGroup(), "2.0", CacheContentType.BuildResults) != null); - Assertion.Assert("Cachescope should have an entry with 2.0", e.CacheManager.GetCacheScope(p2Path, new BuildPropertyGroup(), "2.0", CacheContentType.BuildResults) != null); - } - finally - { - ObjectModelHelpers.DeleteTempProjectDirectory(); - } - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/EscapingInProjects_Tests.cs b/src/Deprecated/Engine.UnitTests/EscapingInProjects_Tests.cs deleted file mode 100644 index 1bc062ea883..00000000000 --- a/src/Deprecated/Engine.UnitTests/EscapingInProjects_Tests.cs +++ /dev/null @@ -1,964 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.IO; -using System.Collections.Generic; -using System.Text; -using System.Reflection; - -using NUnit.Framework; - -using Microsoft.Build.UnitTests; - -using Microsoft.Build.Utilities; -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine; -using Microsoft.Build.UnitTests.Project_Tests; - -namespace Microsoft.Build.UnitTests.EscapingInProjects_Tests -{ - /// - /// Test task that just logs the parameters it receives. - /// - /// RGoel - public class MyTestTask : Task - { - private ITaskItem taskItemParam; - public ITaskItem TaskItemParam - { - get - { - return taskItemParam; - } - - set - { - taskItemParam = value; - } - } - - override public bool Execute() - { - if (TaskItemParam != null) - { - Log.LogMessageFromText("Received TaskItemParam: " + TaskItemParam.ItemSpec, MessageImportance.High); - } - - return true; - } - } - - [TestFixture] - public class SimpleScenarios - { - /// - /// Make sure I can define a property with escaped characters and pass it into - /// a string parameter of a task, in this case the Message task. - /// - /// RGoel - [Test] - public void SemicolonInPropertyPassedIntoStringParam() - { - MockLogger logger = ObjectModelHelpers.BuildProjectExpectSuccess(@" - - - abc %3b def %3b ghi - - - - - - "); - - logger.AssertLogContains("Property value is 'abc ; def ; ghi'"); - } - - /// - /// Make sure I can define a property with escaped characters and pass it into - /// an ITaskItem[] task parameter. - /// - [Test] - public void SemicolonInPropertyPassedIntoITaskItemParam() - { - MockLogger logger = ObjectModelHelpers.BuildProjectExpectSuccess(String.Format(@" - - - - - - - abc %3b def %3b ghi - - - - - - - - - ", new Uri(Assembly.GetExecutingAssembly().EscapedCodeBase).LocalPath)); - - logger.AssertLogContains("Received TaskItemParam: 123 abc ; def ; ghi 789"); - } - - /// - /// If I try to add a new item to a project, and my new item's Include has an unescaped semicolon - /// in it, then we shouldn't try to match it up against any existing wildcards. This is a really - /// bizarre scenario ... the caller probably meant to escape the semicolon. - /// - /// RGoel - [Test] - public void AddNewItemWithSemicolon() - { - // ************************************ - // BEFORE - // ************************************ - string projectOriginalContents = @" - - - - - - "; - - - // ************************************ - // AFTER - // ************************************ - string projectNewExpectedContents = @" - - - - - - - "; - - BuildItem newItem = AddItem.AddNewItemHelper(projectOriginalContents, - projectNewExpectedContents, "MyWildCard", "foo;bar.weirdo"); - - Assertion.AssertEquals("Newly added item should have correct ItemName", "MyWildCard", newItem.Name); - Assertion.AssertEquals("Newly added item should have correct Include", "foo;bar.weirdo", newItem.Include); - } - - /// - /// If I try to add a new item to a project, and my new item's Include has a property that - /// contains an unescaped semicolon in it, then we shouldn't try to match it up against any existing - /// wildcards. - /// - /// RGoel - [Test] - public void AddNewItemWithPropertyContainingSemicolon() - { - // ************************************ - // BEFORE - // ************************************ - string projectOriginalContents = @" - - - foo;bar - - - - - - "; - - - // ************************************ - // AFTER - // ************************************ - string projectNewExpectedContents = @" - - - foo;bar - - - - - - - "; - - BuildItem newItem = AddItem.AddNewItemHelper(projectOriginalContents, - projectNewExpectedContents, "MyWildCard", "$(FilenameWithSemicolon).weirdo"); - - Assertion.AssertEquals("Newly added item should have correct ItemName", "MyWildCard", newItem.Name); - Assertion.AssertEquals("Newly added item should have correct Include", "$(FilenameWithSemicolon).weirdo", newItem.Include); - } - - /// - /// If I try to modify an item in a project, and my new item's Include has an unescaped semicolon - /// in it, then we shouldn't try to match it up against any existing wildcards. This is a really - /// bizarre scenario ... the caller probably meant to escape the semicolon. - /// - /// RGoel - [Test] - public void ModifyItemIncludeSemicolon() - { - // Populate the project directory with three physical files on disk -- a.weirdo, b.weirdo, c.weirdo. - ModifyItem.CreateThreeWeirdoFilesHelper(); - - // ************************************ - // BEFORE - // ************************************ - string projectOriginalContents = @" - - - - - - - - "; - - - // ************************************ - // AFTER - // ************************************ - string projectNewExpectedContents = @" - - - - - - - - - - "; - - // Change b.weirdo to foo;bar.weirdo. - ModifyItem.ModifyItemIncludeHelper(projectOriginalContents, projectNewExpectedContents, - "b.weirdo", "foo;bar.weirdo"); - - ModifyItem.CleanupWeirdoFilesHelper(); - } - - /// - /// If I try to modify an item in a project, and my new item's Include has an escaped semicolon - /// in it, and it matches the existing wildcard, then we shouldn't need to modify the project file. - /// - /// RGoel - [Test] - public void ModifyItemIncludeEscapedSemicolon() - { - // Populate the project directory with three physical files on disk -- a.weirdo, b.weirdo, c.weirdo. - ModifyItem.CreateThreeWeirdoFilesHelper(); - - // ************************************ - // BEFORE - // ************************************ - string projectOriginalContents = @" - - - - - - - - "; - - - // ************************************ - // AFTER - // ************************************ - string projectNewExpectedContents = @" - - - - - - - - "; - - // Change b.weirdo to foo;bar.weirdo. - ModifyItem.ModifyItemIncludeHelper(projectOriginalContents, projectNewExpectedContents, - "b.weirdo", "foo%253Bbar.weirdo"); - - ModifyItem.CleanupWeirdoFilesHelper(); - } - - /// - /// If I try to modify an item in a project, and my new item's Include has a property that - /// contains an unescaped semicolon in it, then we shouldn't try to match it up against any existing - /// wildcards. - /// - /// RGoel - [Test] - public void ModifyItemAddPropertyContainingSemicolon() - { - // Populate the project directory with three physical files on disk -- a.weirdo, b.weirdo, c.weirdo. - ModifyItem.CreateThreeWeirdoFilesHelper(); - - // ************************************ - // BEFORE - // ************************************ - string projectOriginalContents = @" - - - - foo;bar - - - - - - - - "; - - - // ************************************ - // AFTER - // ************************************ - string projectNewExpectedContents = @" - - - - foo;bar - - - - - - - - - - "; - - // Change b.weirdo to foo;bar.weirdo. - ModifyItem.ModifyItemIncludeHelper(projectOriginalContents, projectNewExpectedContents, - "b.weirdo", "$(FileNameWithSemicolon).weirdo"); - - ModifyItem.CleanupWeirdoFilesHelper(); - } - - /// - /// Make sure that character escaping works as expected when adding a new item that matches - /// an existing wildcarded item in the project file. - /// - /// RGoel - [Test] - public void AddNewItemThatMatchesWildcard1() - { - // ************************************ - // BEFORE - // ************************************ - string projectOriginalContents = @" - - - - - - "; - - - // ************************************ - // AFTER - // ************************************ - string projectNewExpectedContents = @" - - - - - - "; - - BuildItem newItem = AddItem.AddNewItemHelper(projectOriginalContents, - projectNewExpectedContents, "MyWildCard", "foo%253bbar.weirdo"); - - Assertion.AssertEquals("Newly added item should have correct ItemName", "MyWildCard", newItem.Name); - Assertion.AssertEquals("Newly added item should have correct Include", "*.weirdo", newItem.Include); - Assertion.AssertEquals("Newly added item should have correct FinalItemSpec", "foo%253bbar.weirdo", newItem.FinalItemSpecEscaped); - Assertion.AssertEquals("Newly added item should have correct FinalItemSpec", "foo%3bbar.weirdo", newItem.FinalItemSpec); - } - - /// - /// Make sure that character escaping works as expected when adding a new item that matches - /// an existing wildcarded item in the project file. - /// - /// RGoel - [Test] - public void AddNewItemThatMatchesWildcard2() - { - // ************************************ - // BEFORE - // ************************************ - string projectOriginalContents = @" - - - - - - "; - - - // ************************************ - // AFTER - // ************************************ - string projectNewExpectedContents = @" - - - - - - "; - - BuildItem newItem = AddItem.AddNewItemHelper(projectOriginalContents, - projectNewExpectedContents, "MyWildCard", "foobar.AAA%253bBBB"); - - Assertion.AssertEquals("Newly added item should have correct ItemName", "MyWildCard", newItem.Name); - Assertion.AssertEquals("Newly added item should have correct Include", "*.AAA%253bBBB", newItem.Include); - Assertion.AssertEquals("Newly added item should have correct FinalItemSpec", "foobar.AAA%253bBBB", newItem.FinalItemSpecEscaped); - Assertion.AssertEquals("Newly added item should have correct FinalItemSpec", "foobar.AAA%3bBBB", newItem.FinalItemSpec); - } - - /// - /// Make sure that all inferred task outputs (those that are determined without actually - /// executing the task) are left escaped when they become real items in the engine, and - /// they only get unescaped when fed into a subsequent task. - /// - /// RGoel - [Test] - public void InferEscapedOutputsFromTask() - { - string inputFile = ObjectModelHelpers.CreateTempFileOnDisk(""); - string outputFile = ObjectModelHelpers.CreateTempFileOnDisk(""); - - try - { - MockLogger logger = ObjectModelHelpers.BuildProjectExpectSuccess(String.Format(@" - - - - - - - - - - - - - - - - ", inputFile, outputFile)); - - logger.AssertLogContains("Resources = aaa%3bbbb.resx;ccc%3bddd.resx"); - } - finally - { - File.Delete(inputFile); - File.Delete(outputFile); - } - } - - /// - /// Do an item transform, where the transform expression contains an unescaped semicolon as well - /// as an escaped percent sign. - /// - /// RGoel - [Test] - public void ItemTransformContainingSemicolon() - { - MockLogger logger = ObjectModelHelpers.BuildProjectExpectSuccess(@" - - - - - - - - - '%(FileName);%(FileName)%253b%(FileName)%(Extension)',' ')'` /> - - - - "); - - logger.AssertLogContains("Transformed item list: 'X;X%3bX.txt Y;Y%3bY.txt Z;Z%3bZ.txt'"); - } - - /// - /// Test that we can pass in global properties containing escaped characters. - /// - /// RGoel - [Test] - public void GlobalPropertyWithEscapedCharacters() - { - MockLogger logger = new MockLogger(); - Project project = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - ", logger); - - project.GlobalProperties.SetProperty("MyGlobalProperty", "foo%253bbar"); - - bool success = project.Build(null, null); - Assertion.Assert("Build failed. See Standard Out tab for details", success); - - logger.AssertLogContains("MyGlobalProperty = 'foo%3bbar'"); - } - } - - [TestFixture] - public class FullProjectsUsingMicrosoftCommonTargets - { - /// - /// Regression test for bug VSWhidbey 282492: - /// ESCAPING: Escaping in conditionals is broken. - /// - /// RGoel - [Test] - public void SemicolonInConfiguration() - { - ObjectModelHelpers.DeleteTempProjectDirectory(); - - // --------------------- - // Foo.csproj - // --------------------- - ObjectModelHelpers.CreateFileInTempProjectDirectory("foo.csproj", @" - - - Debug - AnyCPU - Library - ClassLibrary16 - - - bin\a%3bb%27c\ - - - - - - - - "); - - // --------------------- - // Class1.cs - // --------------------- - ObjectModelHelpers.CreateFileInTempProjectDirectory("Class1.cs", @" - namespace ClassLibrary16 - { - public class Class1 - { - } - } - "); - - // Create a logger. - MockLogger logger = new MockLogger(); - - Project project = ObjectModelHelpers.LoadProjectFileInTempProjectDirectory("foo.csproj", logger); - - // Build the default targets using the Configuration "a;b'c". - project.GlobalProperties.SetProperty("Configuration", "a;b'c", true /* literal value */); - bool success = project.Build(null, null); - Assertion.Assert("Build failed. See Standard Out tab for details", success); - - ObjectModelHelpers.AssertFileExistsInTempProjectDirectory(@"obj\a;b'c\ClassLibrary16.dll"); - ObjectModelHelpers.AssertFileExistsInTempProjectDirectory(@"bin\a;b'c\ClassLibrary16.dll"); - - logger.AssertLogContains(String.Format("foo -> {0}", Path.Combine(ObjectModelHelpers.TempProjectDir, @"bin\a;b'c\ClassLibrary16.dll"))); - } - - /// - /// Regression test for bug VSWhidbey 157204: - /// ESCAPING: CopyBuildTarget target fails if the output assembly name contains a semicolon or single-quote - /// - /// RGoel - [Test] - public void SemicolonInAssemblyName() - { - ObjectModelHelpers.DeleteTempProjectDirectory(); - - // --------------------- - // Foo.csproj - // --------------------- - ObjectModelHelpers.CreateFileInTempProjectDirectory("foo.csproj", @" - - - Debug - AnyCPU - Library - Class%3bLibrary16 - - - bin\Debug\ - - - - - - - - "); - - // --------------------- - // Class1.cs - // --------------------- - ObjectModelHelpers.CreateFileInTempProjectDirectory("Class1.cs", @" - namespace ClassLibrary16 - { - public class Class1 - { - } - } - "); - - MockLogger log = ObjectModelHelpers.BuildTempProjectFileExpectSuccess("foo.csproj"); - - Assertion.Assert(@"Did not find expected file obj\debug\Class;Library16.dll", - File.Exists(Path.Combine(ObjectModelHelpers.TempProjectDir, @"obj\debug\Class;Library16.dll"))); - Assertion.Assert(@"Did not find expected file obj\debug\Class;Library16.pdb", - File.Exists(Path.Combine(ObjectModelHelpers.TempProjectDir, @"obj\debug\Class;Library16.pdb"))); - Assertion.Assert(@"Did not find expected file bin\debug\Class;Library16.dll", - File.Exists(Path.Combine(ObjectModelHelpers.TempProjectDir, @"bin\debug\Class;Library16.dll"))); - Assertion.Assert(@"Did not find expected file bin\debug\Class;Library16.pdb", - File.Exists(Path.Combine(ObjectModelHelpers.TempProjectDir, @"bin\debug\Class;Library16.pdb"))); - - log.AssertLogContains(String.Format("foo -> {0}", Path.Combine(ObjectModelHelpers.TempProjectDir, @"bin\Debug\Class;Library16.dll"))); - } - - /// - /// Regression test for bug VSWhidbey 157236: - /// ESCAPING: Conversion Issue: Properties with $(xxx) as literals are not being converted correctly - /// - /// RGoel - [Test] - public void DollarSignInAssemblyName() - { - ObjectModelHelpers.DeleteTempProjectDirectory(); - - // --------------------- - // Foo.csproj - // --------------------- - ObjectModelHelpers.CreateFileInTempProjectDirectory("foo.csproj", @" - - - Debug - AnyCPU - Library - Class%24%28prop%29Library16 - - - bin\Debug\ - - - - - - - - "); - - // --------------------- - // Class1.cs - // --------------------- - ObjectModelHelpers.CreateFileInTempProjectDirectory("Class1.cs", @" - namespace ClassLibrary16 - { - public class Class1 - { - } - } - "); - - MockLogger log = ObjectModelHelpers.BuildTempProjectFileExpectSuccess("foo.csproj"); - - Assertion.Assert(@"Did not find expected file obj\debug\Class$(prop)Library16.dll", - File.Exists(Path.Combine(ObjectModelHelpers.TempProjectDir, @"obj\debug\Class$(prop)Library16.dll"))); - Assertion.Assert(@"Did not find expected file obj\debug\Class$(prop)Library16.pdb", - File.Exists(Path.Combine(ObjectModelHelpers.TempProjectDir, @"obj\debug\Class$(prop)Library16.pdb"))); - Assertion.Assert(@"Did not find expected file bin\debug\Class$(prop)Library16.dll", - File.Exists(Path.Combine(ObjectModelHelpers.TempProjectDir, @"bin\debug\Class$(prop)Library16.dll"))); - Assertion.Assert(@"Did not find expected file bin\debug\Class$(prop)Library16.pdb", - File.Exists(Path.Combine(ObjectModelHelpers.TempProjectDir, @"bin\debug\Class$(prop)Library16.pdb"))); - - log.AssertLogContains(String.Format("foo -> {0}", Path.Combine(ObjectModelHelpers.TempProjectDir, @"bin\Debug\Class$(prop)Library16.dll"))); - } - - /// - /// Regression test for bug VSWhidbey 146010 and related bugs. This is the case when one of the - /// source code files in the project has a filename containing a semicolon. - /// - /// RGoel - [Test] - public void SemicolonInSourceCodeFilename() - { - ObjectModelHelpers.DeleteTempProjectDirectory(); - - // --------------------- - // Foo.csproj - // --------------------- - ObjectModelHelpers.CreateFileInTempProjectDirectory("foo.csproj", @" - - - Debug - AnyCPU - Library - ClassLibrary16 - - - bin\Debug\ - - - - - - - - "); - - // --------------------- - // Class1.cs - // --------------------- - ObjectModelHelpers.CreateFileInTempProjectDirectory("Class;1.cs", @" - namespace ClassLibrary16 - { - public class Class1 - { - } - } - "); - - MockLogger log = ObjectModelHelpers.BuildTempProjectFileExpectSuccess("foo.csproj"); - - Assertion.Assert(@"Did not find expected file obj\debug\ClassLibrary16.dll", - File.Exists(Path.Combine(ObjectModelHelpers.TempProjectDir, @"obj\debug\ClassLibrary16.dll"))); - Assertion.Assert(@"Did not find expected file obj\debug\ClassLibrary16.pdb", - File.Exists(Path.Combine(ObjectModelHelpers.TempProjectDir, @"obj\debug\ClassLibrary16.pdb"))); - Assertion.Assert(@"Did not find expected file bin\debug\ClassLibrary16.dll", - File.Exists(Path.Combine(ObjectModelHelpers.TempProjectDir, @"bin\debug\ClassLibrary16.dll"))); - Assertion.Assert(@"Did not find expected file bin\debug\ClassLibrary16.pdb", - File.Exists(Path.Combine(ObjectModelHelpers.TempProjectDir, @"bin\debug\ClassLibrary16.pdb"))); - - log.AssertLogContains(String.Format("foo -> {0}", Path.Combine(ObjectModelHelpers.TempProjectDir, @"bin\Debug\ClassLibrary16.dll"))); - } - - /// - /// Build a .SLN file using MSBuild. The .SLN and the projects contained within - /// have all sorts of different characters in their name (courtesy of DanMose who apparently - /// just ran his fingers up and down the on the upper row of his keyboard :) ). There - /// is even a P2P reference between the two projects in the .SLN. - /// - /// RGoel - [Test] - public void SolutionWithLotsaDifferentCharacters() - { - if (ToolLocationHelper.GetPathToDotNetFramework(TargetDotNetFrameworkVersion.Version35) == null) - { - Assert.Ignore(".NET Framework 3.5 is required to be installed for this test, but it is not installed."); - } - - ObjectModelHelpers.DeleteTempProjectDirectory(); - - // --------------------------------------------------------------------- - // Console;!@(foo)'^(Application1.sln - // --------------------------------------------------------------------- - ObjectModelHelpers.CreateFileInTempProjectDirectory( - @"SLN;!@(foo)'^1\Console;!@(foo)'^(Application1.sln", - - @"Microsoft Visual Studio Solution File, Format Version 10.00 - # Visual Studio 2005 - Project(`{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}`) = `Cons.ole;!@(foo)'^(Application1`, `Console;!@(foo)'^(Application1\Cons.ole;!@(foo)'^(Application1.csproj`, `{770F2381-8C39-49E9-8C96-0538FA4349A7}` - EndProject - Project(`{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}`) = `Class;!@(foo)'^(Library1`, `Class;!@(foo)'^(Library1\Class;!@(foo)'^(Library1.csproj`, `{0B4B78CC-C752-43C2-BE9A-319D20216129}` - EndProject - Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {770F2381-8C39-49E9-8C96-0538FA4349A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {770F2381-8C39-49E9-8C96-0538FA4349A7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {770F2381-8C39-49E9-8C96-0538FA4349A7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {770F2381-8C39-49E9-8C96-0538FA4349A7}.Release|Any CPU.Build.0 = Release|Any CPU - {0B4B78CC-C752-43C2-BE9A-319D20216129}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0B4B78CC-C752-43C2-BE9A-319D20216129}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0B4B78CC-C752-43C2-BE9A-319D20216129}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0B4B78CC-C752-43C2-BE9A-319D20216129}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - EndGlobal - "); - - // --------------------------------------------------------------------- - // Console;!@(foo)'^(Application1.csproj - // --------------------------------------------------------------------- - ObjectModelHelpers.CreateFileInTempProjectDirectory( - @"SLN;!@(foo)'^1\Console;!@(foo)'^(Application1\Cons.ole;!@(foo)'^(Application1.csproj", - - @" - - - Debug - AnyCPU - 8.0.50510 - 2.0 - {770F2381-8C39-49E9-8C96-0538FA4349A7} - Exe - Properties - Console____foo____Application1 - Console%3b!%40%28foo%29%27^%28Application1 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - {0B4B78CC-C752-43C2-BE9A-319D20216129} - Class%3b!%40%28foo%29%27^%28Library1 - - - - - "); - - // --------------------------------------------------------------------- - // Program.cs - // --------------------------------------------------------------------- - ObjectModelHelpers.CreateFileInTempProjectDirectory( - @"SLN;!@(foo)'^1\Console;!@(foo)'^(Application1\Program.cs", - - @" - using System; - using System.Collections.Generic; - using System.Text; - - namespace Console____foo____Application1 - { - class Program - { - static void Main(string[] args) - { - Class____foo____Library1.Class1 foo = new Class____foo____Library1.Class1(); - } - } - } - "); - - // --------------------------------------------------------------------- - // Class;!@(foo)'^(Library1.csproj - // --------------------------------------------------------------------- - ObjectModelHelpers.CreateFileInTempProjectDirectory( - @"SLN;!@(foo)'^1\Class;!@(foo)'^(Library1\Class;!@(foo)'^(Library1.csproj", - - @" - - - Debug - AnyCPU - 8.0.50510 - 2.0 - {0B4B78CC-C752-43C2-BE9A-319D20216129} - Library - Properties - Class____foo____Library1 - Class%3b!%40%28foo%29%27^%28Library1 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - $(ManagedAssembly) - - - - - "); - - // --------------------------------------------------------------------- - // Class1.cs - // --------------------------------------------------------------------- - ObjectModelHelpers.CreateFileInTempProjectDirectory( - @"SLN;!@(foo)'^1\Class;!@(foo)'^(Library1\Class1.cs", - - @" - namespace Class____foo____Library1 - { - public class Class1 - { - } - } - "); - - // Cons.ole;!@(foo)'^(Application1 - string targetForFirstProject = "Cons_ole_!__foo__^_Application1"; - MockLogger log = ObjectModelHelpers.BuildTempProjectFileWithTargetsExpectSuccess(@"SLN;!@(foo)'^1\Console;!@(foo)'^(Application1.sln", new string[] { targetForFirstProject }, new BuildPropertyGroup()); - - Assertion.Assert(@"Did not find expected file Console;!@(foo)'^(Application1.exe", - File.Exists(Path.Combine(ObjectModelHelpers.TempProjectDir, - @"SLN;!@(foo)'^1\Console;!@(foo)'^(Application1\bin\debug\Console;!@(foo)'^(Application1.exe"))); - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/EventArgsFormatting_Tests.cs b/src/Deprecated/Engine.UnitTests/EventArgsFormatting_Tests.cs deleted file mode 100644 index b16138705af..00000000000 --- a/src/Deprecated/Engine.UnitTests/EventArgsFormatting_Tests.cs +++ /dev/null @@ -1,149 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using NUnit.Framework; -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.UnitTests -{ - /// - /// These tests are repeated in the Utilities unit test assembly. We know that this isn't - /// too useful, because both Engine and Utilities pull the code from the same Shared file. But it - /// gets a bunch of lines of extra coverage of Engine that we weren't otherwise getting, and - /// in theory at least the implementation in Engine should be tested too. - /// - [TestFixture] - public class EventArgsFormattingTests - { - [Test] - public void NoLineInfoFormatEventMessage() - { - // Testing the method in Shared.EventArgsFormatting directly - string s = EventArgsFormatting.FormatEventMessage("error", "CS", - "Missing ;", "312", "source.cs", 0, 0, 0, 0, 0); - Assertion.AssertEquals( - "source.cs : CS error 312: Missing ;", s); - } - - // Valid forms for line/col number patterns: - // (line) or (line-line) or (line,col) or (line,col-col) or (line,col,line,col) - [Test] - public void LineNumberRange() - { - string s = EventArgsFormatting.FormatEventMessage("error", "CS", - "Missing ;", "312", "source.cs", 1, 2, 0, 0, 0); - Assertion.AssertEquals( - "source.cs(1-2): CS error 312: Missing ;", s); - } - - [Test] - public void ColumnNumberRange() - { - string s = EventArgsFormatting.FormatEventMessage("error", "CS", - "Missing ;", "312", "source.cs", 0, 0, 1, 2, 0); - Assertion.AssertEquals( - "source.cs : CS error 312: Missing ;", s); - } - - [Test] - public void LineAndColumnNumberRange() - { - string s = EventArgsFormatting.FormatEventMessage("error", "CS", - "Missing ;", "312", "source.cs", 1, 2, 3, 4, 0); - Assertion.AssertEquals( - "source.cs(1,3,2,4): CS error 312: Missing ;", s); - } - - [Test] - public void LineAndColumnNumberRange2() - { - string s = EventArgsFormatting.FormatEventMessage("error", "CS", - "Missing ;", "312", "source.cs", 1, 0, 3, 4, 0); - Assertion.AssertEquals( - "source.cs(1,3-4): CS error 312: Missing ;", s); - } - - [Test] - public void LineAndColumnNumberRange3() - { - string s = EventArgsFormatting.FormatEventMessage("error", "CS", - "Missing ;", "312", "source.cs", 1, 2, 3, 0, 0); - Assertion.AssertEquals( - "source.cs(1-2,3): CS error 312: Missing ;", s); - } - - [Test] - public void LineAndColumnNumberRange4() - { - string s = EventArgsFormatting.FormatEventMessage("error", "CS", - "Missing ;", "312", "source.cs", 1, 2, 0, 3, 0); - Assertion.AssertEquals( - "source.cs(1-2): CS error 312: Missing ;", s); - } - - [Test] - public void LineAndColumnNumberRange5() - { - string s = EventArgsFormatting.FormatEventMessage("error", "CS", - "Missing ;", "312", "source.cs", 1, 0, 2, 0, 0); - Assertion.AssertEquals( - "source.cs(1,2): CS error 312: Missing ;", s); - } - - [Test] - public void BasicFormatEventMessage() - { - // Testing the method in Shared.EventArgsFormatting directly - string s = EventArgsFormatting.FormatEventMessage("error", "CS", - "Missing ;", "312", "source.cs", 42, 0, 0, 0, 0); - Assertion.AssertEquals( - "source.cs(42): CS error 312: Missing ;", s); - } - - [Test] - public void EscapeCarriageReturnMessages() - { - BuildErrorEventArgs error = new BuildErrorEventArgs("CS", "312", "source.cs", 42, 0, 0, 0, "message\r Hello", "help", "sender"); - BuildWarningEventArgs warning = new BuildWarningEventArgs("CS", "312", "source.cs", 42, 0, 0, 0, "message\r Hello", "help", "sender"); - // Testing the method in Shared.EventArgsFormatting directly - string errorString = EventArgsFormatting.FormatEventMessage(error, true); - string warningString = EventArgsFormatting.FormatEventMessage(warning, true); - string errorString2 = EventArgsFormatting.FormatEventMessage(error, false); - string warningString2 = EventArgsFormatting.FormatEventMessage(warning, false); - Assertion.AssertEquals("source.cs(42): CS error 312: message\\r Hello", errorString); - Assertion.AssertEquals("source.cs(42): CS warning 312: message\\r Hello", warningString); - - Assertion.AssertEquals("source.cs(42): CS error 312: message\r Hello", errorString2); - Assertion.AssertEquals("source.cs(42): CS warning 312: message\r Hello", warningString2); - } - - [Test] - public void ExactLocationFormatEventMessage() - { - // Testing the method in Shared.EventArgsFormatting directly - string s = EventArgsFormatting.FormatEventMessage("error", "CS", - "Missing ;", "312", "source.cs", 233, 236, 4, 8, 0); - Assertion.AssertEquals( - "source.cs(233,4,236,8): CS error 312: Missing ;", s); - - } - - [Test] - public void NullMessage() - { - // Testing the method in Shared.EventArgsFormatting directly - string s = EventArgsFormatting.FormatEventMessage("error", "CS", - null, "312", "source.cs", 233, 236, 4, 8, 0); - // No exception was thrown - - } - } -} - diff --git a/src/Deprecated/Engine.UnitTests/Expander_Tests.cs b/src/Deprecated/Engine.UnitTests/Expander_Tests.cs deleted file mode 100644 index aff4a25012c..00000000000 --- a/src/Deprecated/Engine.UnitTests/Expander_Tests.cs +++ /dev/null @@ -1,1937 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Xml; -using System.Reflection; -using System.Collections; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text.RegularExpressions; - -using NUnit.Framework; - -using Microsoft.Build.Framework; -using BuildEngine = Microsoft.Build.BuildEngine; -using Microsoft.Build.BuildEngine; -using Microsoft.Win32; -using System.Text; -using System.IO; - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class Expander_Tests - { - [Test] - public void ExpandAllIntoTaskItems0() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - Expander expander = new Expander(pg); - - List itemsOut = expander.ExpandAllIntoTaskItems("", null); - - ObjectModelHelpers.AssertItemsMatch("", itemsOut.ToArray()); - } - - [Test] - public void ExpandAllIntoTaskItems1() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - Expander expander = new Expander(pg); - - List itemsOut = expander.ExpandAllIntoTaskItems("foo", null); - - ObjectModelHelpers.AssertItemsMatch(@"foo", itemsOut.ToArray()); - } - - [Test] - public void ExpandAllIntoTaskItems2() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - Expander expander = new Expander(pg); - - List itemsOut = expander.ExpandAllIntoTaskItems("foo;bar;", null); - - ObjectModelHelpers.AssertItemsMatch(@" - foo - bar - ", itemsOut.ToArray()); - } - - [Test] - public void ExpandAllIntoTaskItems3() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - - BuildItemGroup ig = new BuildItemGroup(); - ig.AddItem(new BuildItem("Compile", "foo.cs")); - ig.AddItem(new BuildItem("Compile", "bar.cs")); - - BuildItemGroup ig2 = new BuildItemGroup(); - ig2.AddItem(new BuildItem("Resource", "bing.resx")); - - Hashtable itemsByType = new Hashtable(StringComparer.OrdinalIgnoreCase); - itemsByType["Compile"] = ig; - itemsByType["Resource"] = ig2; - - Expander expander = new Expander(pg, itemsByType); - - List itemsOut = expander.ExpandAllIntoTaskItems("foo;bar;@(compile);@(resource)", null); - - ObjectModelHelpers.AssertItemsMatch(@" - foo - bar - foo.cs - bar.cs - bing.resx - ", itemsOut.ToArray()); - } - - [Test] - public void ExpandAllIntoTaskItems4() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - pg.SetProperty("a", "aaa"); - pg.SetProperty("b", "bbb"); - pg.SetProperty("c", "cc;dd"); - - Expander expander = new Expander(pg); - - List itemsOut = expander.ExpandAllIntoTaskItems("foo$(a);$(b);$(c)", null); - - ObjectModelHelpers.AssertItemsMatch(@" - fooaaa - bbb - cc - dd - ", itemsOut.ToArray()); - } - - [Test] - public void ExpandAllIntoBuildItems() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - pg.SetProperty("a", "aaa"); - pg.SetProperty("b", "bbb"); - pg.SetProperty("c", "cc;dd"); - - Expander expander = new Expander(pg); - - List itemsOut = expander.ExpandAllIntoBuildItems("foo$(a);$(b);$(c);$(d", null); - - Assertion.AssertEquals(5, itemsOut.Count); - } - - /// - /// Regression test for bug 517356. When there are literally zero items declared - /// in the project, we should continue to expand item list references to empty-string - /// rather than not expand them at all. - /// - /// RGoel - [Test] - public void ZeroItemsInProjectExpandsToEmpty() - { - MockLogger logger = ObjectModelHelpers.BuildProjectExpectSuccess(@" - - - - - - - - "); - - logger.AssertLogDoesntContain("This target should NOT run."); - - logger = ObjectModelHelpers.BuildProjectExpectSuccess(@" - - - - - - - - - - - - "); - - logger.AssertLogContains("Item list foo contains abc"); - } - - [Test] - public void ItemIncludeContainsMultipleItemReferences() - { - MockLogger logger = ObjectModelHelpers.BuildProjectExpectSuccess(@" - - - Library - - - - '%(filename).obj')`/> - '%(filename).obj')`/> - - - - - - - - - "); - - logger.AssertLogContains("Property OutputType=Library"); - logger.AssertLogContains("Item ObjFiles=foo.obj;bar.obj"); - logger.AssertLogContains("Item CleanFiles=foo.obj;bar.obj"); - } - - /// - /// Creates a set of complicated item metadata and properties, and items to exercise - /// the Expander class. The data here contains escaped characters, metadata that - /// references properties, properties that reference items, and other complex scenarios. - /// - /// - /// - /// - /// - /// RGoel - private void CreateComplexPropertiesItemsMetadata - ( - out ReadOnlyLookup readOnlyLookup, - out Dictionary itemMetadata - ) - { - itemMetadata = new Dictionary(StringComparer.OrdinalIgnoreCase); - itemMetadata["Culture"] = "abc%253bdef;$(Gee_Aych_Ayee)"; - itemMetadata["Language"] = "english"; - - BuildPropertyGroup pg = new BuildPropertyGroup(); - pg.SetProperty("Gee_Aych_Ayee", "ghi"); - pg.SetProperty("OutputPath", @"\jk ; l\mno%253bpqr\stu"); - pg.SetProperty("TargetPath", "@(IntermediateAssembly->'%(RelativeDir)')"); - - BuildItemGroup intermediateAssemblyItemGroup = new BuildItemGroup(); - BuildItem i1 = intermediateAssemblyItemGroup.AddNewItem("IntermediateAssembly", @"subdir1\engine.dll"); - i1.SetMetadata("aaa", "111"); - BuildItem i2 = intermediateAssemblyItemGroup.AddNewItem("IntermediateAssembly", @"subdir2\tasks.dll"); - i2.SetMetadata("bbb", "222"); - - BuildItemGroup contentItemGroup = new BuildItemGroup(); - BuildItem i3 = contentItemGroup.AddNewItem("Content", "splash.bmp"); - i3.SetMetadata("ccc", "333"); - - BuildItemGroup resourceItemGroup = new BuildItemGroup(); - BuildItem i4 = resourceItemGroup.AddNewItem("Resource", "string$(p).resx"); - i4.SetMetadata("ddd", "444"); - BuildItem i5 = resourceItemGroup.AddNewItem("Resource", "dialogs%253b.resx"); - i5.SetMetadata("eee", "555"); - - BuildItemGroup contentItemGroup2 = new BuildItemGroup(); - BuildItem i6 = contentItemGroup2.AddNewItem("Content", "about.bmp"); - i6.SetMetadata("fff", "666"); - - Hashtable secondaryItemsByName = new Hashtable(StringComparer.OrdinalIgnoreCase); - secondaryItemsByName["Resource"] = resourceItemGroup; - secondaryItemsByName["Content"] = contentItemGroup2; - - Lookup lookup = LookupHelpers.CreateLookup(pg, secondaryItemsByName); - - // Add primary items - lookup.EnterScope(); - lookup.PopulateWithItems("IntermediateAssembly", intermediateAssemblyItemGroup); - lookup.PopulateWithItems("Content", contentItemGroup); - - readOnlyLookup = new ReadOnlyLookup(lookup); - } - - /// - /// Exercises ExpandAllIntoTaskItems with a complex set of data. - /// - /// RGoel - [Test] - public void ExpandAllIntoTaskItemsComplex() - { - ReadOnlyLookup lookup; - Dictionary itemMetadata; - CreateComplexPropertiesItemsMetadata(out lookup, out itemMetadata); - - Expander expander = new Expander(lookup, itemMetadata); - - List taskItems = expander.ExpandAllIntoTaskItems( - "@(Resource->'%(Filename)') ; @(Content) ; @(NonExistent) ; $(NonExistent) ; %(NonExistent) ; " + - "$(OutputPath) ; $(TargetPath) ; %(Language)_%(Culture)", - (new XmlDocument()).CreateAttribute("dummy")); - - // the following items are passed to the TaskItem constructor, and thus their ItemSpecs should be - // in escaped form. - ObjectModelHelpers.AssertItemsMatch(@" - string$(p): ddd=444 - dialogs%253b: eee=555 - splash.bmp: ccc=333 - \jk - l\mno%253bpqr\stu - subdir1\: aaa=111 - subdir2\: bbb=222 - english_abc%253bdef - ghi - ", taskItems.ToArray()); - } - - /// - /// Exercises ExpandAllIntoString with a complex set of data. - /// - /// RGoel - [Test] - public void ExpandAllIntoStringComplex() - { - ReadOnlyLookup lookup; - Dictionary itemMetadata; - CreateComplexPropertiesItemsMetadata(out lookup, out itemMetadata); - - Expander expander = new Expander(lookup, itemMetadata); - - XmlAttribute xmlattribute = (new XmlDocument()).CreateAttribute("dummy"); - xmlattribute.Value = "@(Resource->'%(Filename)') ; @(Content) ; @(NonExistent) ; $(NonExistent) ; %(NonExistent) ; " + - "$(OutputPath) ; $(TargetPath) ; %(Language)_%(Culture)"; - - Assertion.AssertEquals( - @"string$(p);dialogs%3b ; splash.bmp ; ; ; ; \jk ; l\mno%3bpqr\stu ; subdir1\;subdir2\ ; english_abc%3bdef;ghi", - expander.ExpandAllIntoString(xmlattribute.Value, xmlattribute)); - - Assertion.AssertEquals( - @"string$(p);dialogs%3b ; splash.bmp ; ; ; ; \jk ; l\mno%3bpqr\stu ; subdir1\;subdir2\ ; english_abc%3bdef;ghi", - expander.ExpandAllIntoString(xmlattribute)); - } - - /// - /// Exercises ExpandAllIntoString with a complex set of data. - /// - /// RGoel - [Test] - public void ExpandAllIntoStringLeaveEscapedComplex() - { - ReadOnlyLookup lookup; - Dictionary itemMetadata; - CreateComplexPropertiesItemsMetadata(out lookup, out itemMetadata); - - Expander expander = new Expander(lookup, itemMetadata); - - XmlAttribute xmlattribute = (new XmlDocument()).CreateAttribute("dummy"); - xmlattribute.Value = "@(Resource->'%(Filename)') ; @(Content) ; @(NonExistent) ; $(NonExistent) ; %(NonExistent) ; " + - "$(OutputPath) ; $(TargetPath) ; %(Language)_%(Culture)"; - - Assertion.AssertEquals( - @"string$(p);dialogs%253b ; splash.bmp ; ; ; ; \jk ; l\mno%253bpqr\stu ; subdir1\;subdir2\ ; english_abc%253bdef;ghi", - expander.ExpandAllIntoStringLeaveEscaped(xmlattribute.Value, xmlattribute)); - - Assertion.AssertEquals( - @"string$(p);dialogs%253b ; splash.bmp ; ; ; ; \jk ; l\mno%253bpqr\stu ; subdir1\;subdir2\ ; english_abc%253bdef;ghi", - expander.ExpandAllIntoStringLeaveEscaped(xmlattribute)); - } - - /// - /// Exercises ExpandAllIntoString with a string that does not need expanding. - /// In this case the expanded string should be reference identical to the passed in string. - /// - [Test] - public void ExpandAllIntoStringExpectIdenticalReference() - { - ReadOnlyLookup lookup; - Dictionary itemMetadata; - CreateComplexPropertiesItemsMetadata(out lookup, out itemMetadata); - - Expander expander = new Expander(lookup, itemMetadata); - - XmlAttribute xmlattribute = (new XmlDocument()).CreateAttribute("dummy"); - - // Create a *non-literal* string. If we used a literal string, the CLR might (would) intern - // it, which would mean that Expander would inevitably return a reference to the same string. - // In real builds, the strings will never be literals, and we want to test the behavior in - // that situation. - xmlattribute.Value = "abc123" + new Random().Next(); - string expandedString = expander.ExpandAllIntoStringLeaveEscaped(xmlattribute.Value, xmlattribute); - - // Verify neither string got interned, so that this test is meaningful - Assertion.Assert(null == string.IsInterned(xmlattribute.Value)); - Assertion.Assert(null == string.IsInterned(expandedString)); - - // Finally verify Expander indeed didn't create a new string. - Assertion.Assert(Object.ReferenceEquals(xmlattribute.Value, expandedString)); - } - - /// - /// Exercises ExpandAllIntoString with a complex set of data and various expander options - /// - [Test] - public void ExpandAllIntoStringExpanderOptions() - { - ReadOnlyLookup lookup; - Dictionary itemMetadata; - CreateComplexPropertiesItemsMetadata(out lookup, out itemMetadata); - - string value = @"@(Resource->'%(Filename)') ; @(Content) ; @(NonExistent) ; $(NonExistent) ; %(NonExistent) ; $(OutputPath) ; $(TargetPath) ; %(Language)_%(Culture)"; - - Expander expander = new Expander(lookup, itemMetadata, ExpanderOptions.ExpandProperties); - - Assertion.AssertEquals(@"@(Resource->'%(Filename)') ; @(Content) ; @(NonExistent) ; ; %(NonExistent) ; \jk ; l\mno%3bpqr\stu ; @(IntermediateAssembly->'%(RelativeDir)') ; %(Language)_%(Culture)", expander.ExpandAllIntoString(value, null)); - - expander = new Expander(expander, ExpanderOptions.ExpandPropertiesAndMetadata); - - Assertion.AssertEquals(@"@(Resource->'%(Filename)') ; @(Content) ; @(NonExistent) ; ; ; \jk ; l\mno%3bpqr\stu ; @(IntermediateAssembly->'%(RelativeDir)') ; english_abc%3bdef;ghi", expander.ExpandAllIntoString(value, null)); - - expander = new Expander(expander, ExpanderOptions.ExpandAll); - - Assertion.AssertEquals(@"string$(p);dialogs%3b ; splash.bmp ; ; ; ; \jk ; l\mno%3bpqr\stu ; subdir1\;subdir2\ ; english_abc%3bdef;ghi", expander.ExpandAllIntoString(value, null)); - - expander = new Expander(expander, ExpanderOptions.ExpandItems); - - Assertion.AssertEquals(@"string$(p);dialogs%3b ; splash.bmp ; ; $(NonExistent) ; %(NonExistent) ; $(OutputPath) ; $(TargetPath) ; %(Language)_%(Culture)", expander.ExpandAllIntoString(value, null)); - } - - /// - /// Exercises ExpandAllIntoStringList with a complex set of data. - /// - /// RGoel - [Test] - public void ExpandAllIntoStringListComplex() - { - ReadOnlyLookup lookup; - Dictionary itemMetadata; - CreateComplexPropertiesItemsMetadata(out lookup, out itemMetadata); - - Expander expander = new Expander(lookup, itemMetadata); - - XmlAttribute xmlattribute = (new XmlDocument()).CreateAttribute("dummy"); - xmlattribute.Value = "@(Resource->'%(Filename)') ; @(Content) ; @(NonExistent) ; $(NonExistent) ; %(NonExistent) ; " + - "$(OutputPath) ; $(TargetPath) ; %(Language)_%(Culture)"; - - List expanded = expander.ExpandAllIntoStringList(xmlattribute.Value, xmlattribute); - - Assertion.AssertEquals(9, expanded.Count); - Assertion.AssertEquals(@"string$(p)", expanded[0]); - Assertion.AssertEquals(@"dialogs%3b", expanded[1]); - Assertion.AssertEquals(@"splash.bmp", expanded[2]); - Assertion.AssertEquals(@"\jk", expanded[3]); - Assertion.AssertEquals(@"l\mno%3bpqr\stu", expanded[4]); - Assertion.AssertEquals(@"subdir1\", expanded[5]); - Assertion.AssertEquals(@"subdir2\", expanded[6]); - Assertion.AssertEquals(@"english_abc%3bdef", expanded[7]); - Assertion.AssertEquals(@"ghi", expanded[8]); - - expanded = expander.ExpandAllIntoStringList(xmlattribute); - - Assertion.AssertEquals(9, expanded.Count); - Assertion.AssertEquals(@"string$(p)", expanded[0]); - Assertion.AssertEquals(@"dialogs%3b", expanded[1]); - Assertion.AssertEquals(@"splash.bmp", expanded[2]); - Assertion.AssertEquals(@"\jk", expanded[3]); - Assertion.AssertEquals(@"l\mno%3bpqr\stu", expanded[4]); - Assertion.AssertEquals(@"subdir1\", expanded[5]); - Assertion.AssertEquals(@"subdir2\", expanded[6]); - Assertion.AssertEquals(@"english_abc%3bdef", expanded[7]); - Assertion.AssertEquals(@"ghi", expanded[8]); - } - - /// - /// Exercises ExpandAllIntoStringListLeaveEscaped with a complex set of data. - /// - /// RGoel - [Test] - public void ExpandAllIntoStringListLeaveEscapedComplex() - { - ReadOnlyLookup lookup; - Dictionary itemMetadata; - CreateComplexPropertiesItemsMetadata(out lookup, out itemMetadata); - - Expander expander = new Expander(lookup, itemMetadata); - - XmlAttribute xmlattribute = (new XmlDocument()).CreateAttribute("dummy"); - xmlattribute.Value = "@(Resource->'%(Filename)') ; @(Content) ; @(NonExistent) ; $(NonExistent) ; %(NonExistent) ; " + - "$(OutputPath) ; $(TargetPath) ; %(Language)_%(Culture)"; - - List expanded = expander.ExpandAllIntoStringListLeaveEscaped(xmlattribute.Value, xmlattribute); - - Assertion.AssertEquals(9, expanded.Count); - Assertion.AssertEquals(@"string$(p)", expanded[0]); - Assertion.AssertEquals(@"dialogs%253b", expanded[1]); - Assertion.AssertEquals(@"splash.bmp", expanded[2]); - Assertion.AssertEquals(@"\jk", expanded[3]); - Assertion.AssertEquals(@"l\mno%253bpqr\stu", expanded[4]); - Assertion.AssertEquals(@"subdir1\", expanded[5]); - Assertion.AssertEquals(@"subdir2\", expanded[6]); - Assertion.AssertEquals(@"english_abc%253bdef", expanded[7]); - Assertion.AssertEquals(@"ghi", expanded[8]); - - expanded = expander.ExpandAllIntoStringListLeaveEscaped(xmlattribute); - - Assertion.AssertEquals(9, expanded.Count); - Assertion.AssertEquals(@"string$(p)", expanded[0]); - Assertion.AssertEquals(@"dialogs%253b", expanded[1]); - Assertion.AssertEquals(@"splash.bmp", expanded[2]); - Assertion.AssertEquals(@"\jk", expanded[3]); - Assertion.AssertEquals(@"l\mno%253bpqr\stu", expanded[4]); - Assertion.AssertEquals(@"subdir1\", expanded[5]); - Assertion.AssertEquals(@"subdir2\", expanded[6]); - Assertion.AssertEquals(@"english_abc%253bdef", expanded[7]); - Assertion.AssertEquals(@"ghi", expanded[8]); - } - - /// - /// Expand property function that takes a null argument - /// - [Test] - public void PropertyFunctionNullArgument() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - - Expander expander = new Expander(pg); - - string result = expander.ExpandAllIntoStringLeaveEscaped("$([System.Convert]::ChangeType('null',$(SomeStuff.GetType())))", null); - - Assertion.AssertEquals("null", result); - } - - /// - /// Expand property function that returns a null - /// - [Test] - public void PropertyFunctionNullReturn() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - pg.SetProperty("SomeStuff", "This IS SOME STUff"); - - Expander expander = new Expander(pg); - - string result = expander.ExpandAllIntoStringLeaveEscaped("$([System.Convert]::ChangeType(,$(SomeStuff.GetType())))", null); - - Assertion.AssertEquals("", result); - } - - /// - /// Expand property function that takes no arguments and returns a string - /// - [Test] - public void PropertyFunctionNoArguments() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - pg.SetProperty("SomeStuff", "This IS SOME STUff"); - - Expander expander = new Expander(pg); - - string result = expander.ExpandAllIntoStringLeaveEscaped("$(SomeStuff.ToUpper())", null); - - Assertion.AssertEquals("THIS IS SOME STUFF", result); - } - - /// - /// Expand property function that takes no arguments and returns a string (trimmed) - /// - [Test] - public void PropertyFunctionNoArgumentsTrim() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - pg.SetProperty("FileName", " foobar.baz "); - - Expander expander = new Expander(pg); - - string result = expander.ExpandAllIntoStringLeaveEscaped("$(FileName.Trim())", null); - - Assertion.AssertEquals("foobar.baz", result); - } - - /// - /// Expand property function that is a get property accessor - /// - [Test] - public void PropertyFunctionPropertyGet() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - pg.SetProperty("SomeStuff", "This IS SOME STUff"); - - Expander expander = new Expander(pg); - - string result = expander.ExpandAllIntoStringLeaveEscaped("$(SomeStuff.Length)", null); - - Assertion.AssertEquals("18", result); - } - - /// - /// Expand property function which is a manual get property accessor - /// - [Test] - public void PropertyFunctionPropertyManualGet() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - pg.SetProperty("SomeStuff", "This IS SOME STUff"); - - Expander expander = new Expander(pg); - - string result = expander.ExpandAllIntoStringLeaveEscaped("$(SomeStuff.get_Length())", null); - - Assertion.AssertEquals("18", result); - } - - /// - /// Expand property function which is a manual get property accessor and a concatenation of a constant - /// - [Test] - public void PropertyFunctionPropertyNoArgumentsConcat() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - pg.SetProperty("SomeStuff", "This IS SOME STUff"); - - Expander expander = new Expander(pg); - - string result = expander.ExpandAllIntoStringLeaveEscaped("$(SomeStuff.ToLower())_goop", null); - - Assertion.AssertEquals("this is some stuff_goop", result); - } - - /// - /// Expand property function with a constant argument - /// - [Test] - public void PropertyFunctionPropertyWithArgument() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - pg.SetProperty("SomeStuff", "This IS SOME STUff"); - - Expander expander = new Expander(pg); - - string result = expander.ExpandAllIntoStringLeaveEscaped("$(SomeStuff.SubString(13))", null); - - Assertion.AssertEquals("STUff", result); - } - - /// - /// Expand property function with a constant argument - /// - [Test] - public void PropertyFunctionPropertyPathRootSubtraction() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - pg.SetProperty("RootPath", @"c:\this\is\the\root"); - pg.SetProperty("MyPath", @"c:\this\is\the\root\my\project\is\here.proj"); - - Expander expander = new Expander(pg); - - string result = expander.ExpandAllIntoStringLeaveEscaped("$(MyPath.SubString($(RootPath.Length)))", null); - - Assertion.AssertEquals(@"\my\project\is\here.proj", result); - } - - /// - /// Expand property function with an argument that is a property - /// - [Test] - public void PropertyFunctionPropertyWithArgumentExpandedProperty() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - pg.SetProperty("Value", "3"); - pg.SetProperty("SomeStuff", "This IS SOME STUff"); - - Expander expander = new Expander(pg); - - string result = expander.ExpandAllIntoStringLeaveEscaped("$(SomeStuff.SubString(1$(Value)))", null); - - Assertion.AssertEquals("STUff", result); - } - - /// - /// Expand property function that has a boolean return value - /// - [Test] - public void PropertyFunctionPropertyWithArgumentBooleanReturn() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - pg.SetProperty("PathRoot", @"c:\goo"); - pg.SetProperty("PathRoot2", @"c:\goop\"); - - Expander expander = new Expander(pg); - - string result = expander.ExpandAllIntoStringLeaveEscaped(@"$(PathRoot2.Endswith(\))", null); - Assertion.AssertEquals("True", result); - result = expander.ExpandAllIntoStringLeaveEscaped(@"$(PathRoot.Endswith(\))", null); - Assertion.AssertEquals("False", result); - } - - /// - /// Expand property function with an argument that is expanded, and a chaing of other functions. - /// - [Test] - public void PropertyFunctionPropertyWithArgumentNestedAndChainedFunction() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - pg.SetProperty("Value", "3"); - pg.SetProperty("SomeStuff", "This IS SOME STUff"); - - Expander expander = new Expander(pg); - - string result = expander.ExpandAllIntoStringLeaveEscaped("$(SomeStuff.SubString(1$(Value)).ToLower().SubString($(Value)))", null); - - Assertion.AssertEquals("ff", result); - } - - - /// - /// Expand property function with chained functions on its results - /// - [Test] - public void PropertyFunctionPropertyWithArgumentChained() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - pg.SetProperty("Value", "3"); - pg.SetProperty("SomeStuff", "This IS SOME STUff"); - - Expander expander = new Expander(pg); - - string result = expander.ExpandAllIntoStringLeaveEscaped("$(SomeStuff.ToUpper().ToLower())", null); - Assertion.AssertEquals("this is some stuff", result); - } - - /// - /// Expand property function with an argument that is a function - /// - [Test] - public void PropertyFunctionPropertyWithArgumentNested() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - pg.SetProperty("Value", "12345"); - pg.SetProperty("SomeStuff", "1234567890"); - - Expander expander = new Expander(pg); - - string result = expander.ExpandAllIntoStringLeaveEscaped("$(SomeStuff.SubString($(Value.get_Length())))", null); - - Assertion.AssertEquals("67890", result); - } - - /// - /// Expand property function that returns an generic list - /// - [Test] - public void PropertyFunctionGenericListReturn() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - - Expander expander = new Expander(pg); - - string result = expander.ExpandAllIntoStringLeaveEscaped("$([MSBuild]::__GetListTest())", null); - - Assertion.AssertEquals("A;B;C;D", result); - } - - /// - /// Expand property function that returns an array - /// - [Test] - public void PropertyFunctionArrayReturn() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - pg.SetProperty("List", "A-B-C-D"); - - Expander expander = new Expander(pg); - - string result = expander.ExpandAllIntoStringLeaveEscaped("$(List.Split(-))", null); - - Assertion.AssertEquals("A;B;C;D", result); - } - - /// - /// Expand property function that returns an array - /// - [Test] - public void PropertyFunctionArrayReturnManualSplitter() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - pg.SetProperty("List", "A-B-C-D"); - pg.SetProperty("Splitter", "-"); - - Expander expander = new Expander(pg); - - string result = expander.ExpandAllIntoStringLeaveEscaped("$(List.Split($(Splitter.ToCharArray())))", null); - - Assertion.AssertEquals("A;B;C;D", result); - } - - private XmlAttribute dummyAttribute; - private XmlAttribute DummyAttribute - { - get - { - if (dummyAttribute == null) - { - dummyAttribute = (new XmlDocument()).CreateAttribute("foo"); - } - - return dummyAttribute; - } - } - - private bool EvaluateCondition(string conditionExpression, Expander expander) - { - Parser p = new Parser(); - ConditionEvaluationState state = new ConditionEvaluationState(DummyAttribute, expander, null, conditionExpression); - GenericExpressionNode node = p.Parse(conditionExpression, DummyAttribute, ParserOptions.AllowAll); - bool result = node.Evaluate(state); - return result; - } - - /// - /// Expand property function that returns an array - /// - [Test] - public void PropertyFunctionInCondition() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - pg.SetProperty("PathRoot", @"c:\goo"); - pg.SetProperty("PathRoot2", @"c:\goop\"); - - Expander expander = new Expander(pg); - - Assertion.Assert(EvaluateCondition(@"'$(PathRoot2.Endswith(`\`))' == 'true'", expander)); - Assertion.Assert(EvaluateCondition(@"'$(PathRoot.Endswith(\))' == 'false'", expander)); - } - - /// - /// Expand property function that is invalid - properties don't take arguments - /// - [Test] - [ExpectedException(typeof(Microsoft.Build.BuildEngine.InvalidProjectFileException))] - public void PropertyFunctionInvalid1() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - pg.SetProperty("Value", "3"); - pg.SetProperty("SomeStuff", "This IS SOME STUff"); - - Expander expander = new Expander(pg); - - string result = expander.ExpandAllIntoStringLeaveEscaped("[$(SomeStuff($(Value)))]", null); - } - - - /// - /// Expand property function - invlaid since properties don't have properties - /// - [Test] - [ExpectedException(typeof(Microsoft.Build.BuildEngine.InvalidProjectFileException))] - public void PropertyFunctionInvalid2() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - pg.SetProperty("Value", "3"); - pg.SetProperty("SomeStuff", "This IS SOME STUff"); - - Expander expander = new Expander(pg); - - string result = expander.ExpandAllIntoStringLeaveEscaped("[$(SomeStuff.Lgg)]", null); - } - - /// - /// Expand property function - invlaid since properties don't have properties and don't support '.' in them - /// - [Test] - [ExpectedException(typeof(Microsoft.Build.BuildEngine.InvalidProjectFileException))] - public void PropertyFunctionInvalid3() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - pg.SetProperty("Value", "3"); - pg.SetProperty("SomeStuff", "This IS SOME STUff"); - - Expander expander = new Expander(pg); - - string result = expander.ExpandAllIntoStringLeaveEscaped("$(SomeStuff.ToUpper().Foo)", null); - } - - /// - /// Expand property function - properties don't take arguments - /// - [Test] - [ExpectedException(typeof(Microsoft.Build.BuildEngine.InvalidProjectFileException))] - public void PropertyFunctionInvalid4() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - pg.SetProperty("Value", "3"); - pg.SetProperty("SomeStuff", "This IS SOME STUff"); - - Expander expander = new Expander(pg); - - string result = expander.ExpandAllIntoStringLeaveEscaped("[$(SomeStuff($(System.DateTime.Now)))]", null); - } - - - /// - /// Expand property function - invalid expression - /// - [Test] - [ExpectedException(typeof(Microsoft.Build.BuildEngine.InvalidProjectFileException))] - public void PropertyFunctionInvalid5() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - pg.SetProperty("SomeStuff", "This IS SOME STUff"); - - Expander expander = new Expander(pg); - - string result = expander.ExpandAllIntoStringLeaveEscaped("$(SomeStuff.ToLower()_goop)", null); - } - - /// - /// Expand property function - functions with invalid arguments - /// - [Test] - [ExpectedException(typeof(Microsoft.Build.BuildEngine.InvalidProjectFileException))] - public void PropertyFunctionInvalid6() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - pg.SetProperty("SomeStuff", "This IS SOME STUff"); - - Expander expander = new Expander(pg); - - string result = expander.ExpandAllIntoStringLeaveEscaped("[$(SomeStuff.Substring(HELLO!))]", null); - } - - /// - /// Expand property function - functions with invalid arguments - /// - [Test] - [ExpectedException(typeof(Microsoft.Build.BuildEngine.InvalidProjectFileException))] - public void PropertyFunctionInvalid7() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - pg.SetProperty("SomeStuff", "This IS SOME STUff"); - - Expander expander = new Expander(pg); - - string result = expander.ExpandAllIntoStringLeaveEscaped("[$(SomeStuff.Substring(-10))]", null); - } - - /// - /// Expand property function calls a static method with quoted arguments - /// - [Test] - [ExpectedException(typeof(Microsoft.Build.BuildEngine.InvalidProjectFileException))] - public void PropertyFunctionInvalid8() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - - Expander expander = new Expander(pg); - - string result = expander.ExpandAllIntoStringLeaveEscaped("$(([System.DateTime]::Now).ToString(\"MM.dd.yyyy\"))", null); - } - - /// - /// Expand property function - we don't handle metadata functions - /// - [Test] - public void PropertyFunctionInvalidNoMetadataFunctions() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - - Expander expander = new Expander(pg); - - string result = expander.ExpandAllIntoStringLeaveEscaped("[%(LowerLetterList.Identity.ToUpper())]", null); - - Assertion.AssertEquals("[%(LowerLetterList.Identity.ToUpper())]", result); - } - - /// - /// Expand property function - properties won't get confused with a type or namespace - /// - [Test] - public void PropertyFunctionNoCollisionsOnType() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - pg.SetProperty("System", "The System Namespace"); - - Expander expander = new Expander(pg); - - string result = expander.ExpandAllIntoStringLeaveEscaped("$(System)", null); - - Assertion.AssertEquals("The System Namespace", result); - } - - - - /// - /// Expand property function that creates an instance of a type - /// - [Test] - public void PropertyFunctionConstructor1() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - pg.SetProperty("ver1", @"1.2.3.4"); - - - Expander expander = new Expander(pg); - - string result = expander.ExpandAllIntoStringLeaveEscaped(@"$([System.Version]::new($(ver1)))", null); - - Version v = new Version(result); - - Assertion.AssertEquals(1, v.Major); - Assertion.AssertEquals(2, v.Minor); - Assertion.AssertEquals(3, v.Build); - Assertion.AssertEquals(4, v.Revision); - } - - /// - /// Expand property function that creates an instance of a type - /// - [Test] - public void PropertyFunctionConstructor2() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - pg.SetProperty("ver1", @"1.2.3.4"); - pg.SetProperty("ver2", @"2.2.3.4"); - - Expander expander = new Expander(pg); - string result = expander.ExpandAllIntoStringLeaveEscaped(@"$([System.Version]::new($(ver1)).CompareTo($([System.Version]::new($(ver2)))))", null); - - Assertion.AssertEquals(@"-1", result); - } - - /// - /// Expand property function calls a static method - /// - [Test] - public void PropertyFunctionStaticMethodMakeRelative() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - pg.SetProperty("ParentPath", @"c:\abc\def"); - pg.SetProperty("FilePath", @"c:\abc\def\foo.cpp"); - - Expander expander = new Expander(pg); - - string result = expander.ExpandAllIntoStringLeaveEscaped(@"$([MSBuild]::MakeRelative($(ParentPath), `$(FilePath)`))", null); - - Assertion.AssertEquals(@"foo.cpp", result); - } - - [Test] - public void PropertyFunctionGetRegistryValueFromView1() - { - try - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - pg.SetProperty("SomeProperty", "Value"); - - Expander expander = new Expander(pg); - RegistryKey key = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\MSBuild_test"); - - key.SetValue(String.Empty, "%TEMP%", RegistryValueKind.ExpandString); - string result = expander.ExpandAllIntoStringLeaveEscaped(@"$([MSBuild]::GetRegistryValueFromView('HKEY_CURRENT_USER\Software\Microsoft\MSBuild_test', null, null, RegistryView.Default, RegistryView.Default))", null); - - Assertion.AssertEquals(Environment.GetEnvironmentVariable("TEMP"), result); - } - finally - { - Registry.CurrentUser.DeleteSubKey(@"Software\Microsoft\MSBuild_test"); - } - } - - [Test] - public void PropertyFunctionGetRegistryValueFromView2() - { - try - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - pg.SetProperty("SomeProperty", "Value"); - - Expander expander = new Expander(pg); - RegistryKey key = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\MSBuild_test"); - - key.SetValue(String.Empty, "%TEMP%", RegistryValueKind.ExpandString); - string result = expander.ExpandAllIntoStringLeaveEscaped(@"$([MSBuild]::GetRegistryValueFromView('HKEY_CURRENT_USER\Software\Microsoft\MSBuild_test', null, null, Microsoft.Win32.RegistryView.Default))", null); - - Assertion.AssertEquals(Environment.GetEnvironmentVariable("TEMP"), result); - } - finally - { - Registry.CurrentUser.DeleteSubKey(@"Software\Microsoft\MSBuild_test"); - } - } - - [Test] - public void PropertyFunctionGetRegistryValueFromView_NonexistentKey() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - pg.SetProperty("SomeProperty", "Value"); - - Expander expander = new Expander(pg); - - string result = expander.ExpandAllIntoStringLeaveEscaped(@"a$([MSBuild]::GetRegistryValueFromView('HKEY_CURRENT_USER\Software\Microsoft\MSBuildKeyThatDoesNotExist', null, null, Microsoft.Win32.RegistryView.Default))b", null); - - Assertion.AssertEquals("ab", result); - } - - /// - /// Expand property function calls a static method - /// - [Test] - public void PropertyFunctionStaticMethod1() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - pg.SetProperty("Drive", @"c:\"); - pg.SetProperty("File", @"foobar\baz.txt"); - - Expander expander = new Expander(pg); - - string result = expander.ExpandAllIntoStringLeaveEscaped(@"$([System.IO.Path]::Combine($(Drive), `$(File)`))", null); - - Assertion.AssertEquals(@"c:\foobar\baz.txt", result); - } - - /// - /// Expand property function calls a static method - /// - [Test] - public void PropertyFunctionStaticMethodQuoted1() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - pg.SetProperty("File", @"foobar\baz.txt"); - - Expander expander = new Expander(pg); - - string result = expander.ExpandAllIntoStringLeaveEscaped(@"$([System.IO.Path]::Combine(`c:\`, `$(File)`))", null); - - Assertion.AssertEquals(@"c:\foobar\baz.txt", result); - } - - /// - /// Expand property function calls a static method with quoted arguments - /// - [Test] - public void PropertyFunctionStaticMethodQuoted2() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - - Expander expander = new Expander(pg); - - string result = expander.ExpandAllIntoStringLeaveEscaped("$([System.DateTime]::Parse('2005/12/25').ToString(\"yyyy/MM/dd HH:mm:ss\"))", null); - - Assertion.AssertEquals(@"2005/12/25 00:00:00", result); - } - - /// - /// Expand property function calls a static method with quoted arguments - /// - [Test] - public void PropertyFunctionStaticMethodQuoted3() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - - Expander expander = new Expander(pg); - - string result = expander.ExpandAllIntoStringLeaveEscaped("$([System.DateTime]::Parse('2005/12/25').ToString(\"MM.dd.yyyy\"))", null); - - Assertion.AssertEquals(@"12.25.2005", result); - } - - /// - /// Expand property function calls a static method with quoted arguments - /// - [Test] - public void PropertyFunctionStaticMethodQuoted4() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - - Expander expander = new Expander(pg); - - string result = expander.ExpandAllIntoStringLeaveEscaped("$([System.DateTime]::Now.ToString(\"MM.dd.yyyy\"))", null); - - Assertion.AssertEquals(DateTime.Now.ToString("MM.dd.yyyy"), result); - } - - /// - /// Expand property function calls a static method - /// - [Test] - public void PropertyFunctionStaticMethodNested() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - pg.SetProperty("File", @"foobar\baz.txt"); - - Expander expander = new Expander(pg); - - string result = expander.ExpandAllIntoStringLeaveEscaped(@"$([System.IO.Path]::Combine(`c:\`, $([System.IO.Path]::Combine(`foobar`,`baz.txt`))))", null); - - Assertion.AssertEquals(@"c:\foobar\baz.txt", result); - } - - /// - /// Expand property function calls a static method regex - /// - [Test] - public void PropertyFunctionStaticMethodRegex1() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - - Expander expander = new Expander(pg); - - // Support enum combines as Enum.Parse expects them - string result = expander.ExpandAllIntoStringLeaveEscaped(@"$([System.Text.RegularExpressions.Regex]::IsMatch(`-42`, `^-?\d+(\.\d{2})?$`, `RegexOptions.IgnoreCase,RegexOptions.Singleline`))", null); - - Assertion.AssertEquals(@"True", result); - - // We support the C# style enum combining syntax too - result = expander.ExpandAllIntoStringLeaveEscaped(@"$([System.Text.RegularExpressions.Regex]::IsMatch(`-42`, `^-?\d+(\.\d{2})?$`, System.Text.RegularExpressions.RegexOptions.IgnoreCase|RegexOptions.Singleline))", null); - - Assertion.AssertEquals(@"True", result); - - result = expander.ExpandAllIntoStringLeaveEscaped(@"$([System.Text.RegularExpressions.Regex]::IsMatch(`100 GBP`, `^-?\d+(\.\d{2})?$`))", null); - - Assertion.AssertEquals(@"False", result); - } - - /// - /// Expand property function calls a static method with an instance method chained - /// - [Test] - public void PropertyFunctionStaticMethodChained() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - - Expander expander = new Expander(pg); - - string result = expander.ExpandAllIntoStringLeaveEscaped(@"$([System.DateTime]::Parse(`2005/12/25`).ToString(`yyyy/MM/dd HH:mm:ss`))", null); - - Assertion.AssertEquals(@"2005/12/25 00:00:00", result); - } - - /// - /// Expand property function calls a static method an enum argument - /// - [Test] - public void PropertyFunctionStaticMethodEnumArgument() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - - Expander expander = new Expander(pg); - - string result = expander.ExpandAllIntoStringLeaveEscaped(@"$([System.Environment]::GetFolderPath(SpecialFolder.System))", null); - - Assertion.AssertEquals(System.Environment.GetFolderPath(Environment.SpecialFolder.System), result); - } - - /// - /// Expand intrinsic property function to locate the directory of a file above - /// - [Test] - public void PropertyFunctionStaticMethodDirectoryNameOfFileAbove() - { - string tempPath = Path.GetTempPath(); - string tempFile = Path.GetFileName(Path.GetTempFileName()); - - try - { - string directoryStart = Path.Combine(tempPath, "one\\two\\three\\four\\five"); - - BuildPropertyGroup pg = new BuildPropertyGroup(); - pg.SetProperty("StartingDirectory", directoryStart); - pg.SetProperty("FileToFind", tempFile); - - Expander expander = new Expander(pg); - - string result = expander.ExpandAllIntoStringLeaveEscaped(@"$([MSBuild]::GetDirectoryNameOfFileAbove($(StartingDirectory), $(FileToFind)))", null); - - Assertion.AssertEquals(Microsoft.Build.BuildEngine.Shared.FileUtilities.EnsureTrailingSlash(tempPath), Microsoft.Build.BuildEngine.Shared.FileUtilities.EnsureTrailingSlash(result)); - - result = expander.ExpandAllIntoStringLeaveEscaped(@"$([MSBuild]::GetDirectoryNameOfFileAbove($(StartingDirectory), Hobbits))", null); - - Assertion.AssertEquals(String.Empty, result); - } - finally - { - File.Delete(tempFile); - } - } - - /// Expand property function calls a static arithmetic method - /// - [Test] - public void PropertyFunctionStaticMethodArithmeticAddInt32() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - - Expander expander = new Expander(pg); - - string result = expander.ExpandAllIntoStringLeaveEscaped(@"$([MSBuild]::Add(40, 2))", null); - - Assertion.AssertEquals("42", result); - } - - /// - /// Expand property function calls a static arithmetic method - /// - [Test] - public void PropertyFunctionStaticMethodArithmeticAddDouble() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - - Expander expander = new Expander(pg); - - string result = expander.ExpandAllIntoStringLeaveEscaped(@"$([MSBuild]::Add(39.9, 2.1))", null); - - Assertion.AssertEquals("42", result); - } - - /// - /// Expand property function calls a static bitwise method to retrieve file attribute - /// - [Test] - public void PropertyFunctionStaticMethodFileAttributes() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - - Expander expander = new Expander(pg); - - string tempFile = Path.GetTempFileName(); - try - { - - File.SetAttributes(tempFile, FileAttributes.ReadOnly | FileAttributes.Archive); - - string result = expander.ExpandAllIntoStringLeaveEscaped(@"$([MSBuild]::BitwiseAnd(32,$([System.IO.File]::GetAttributes(" + tempFile + "))))", null); - - Assertion.AssertEquals("32", result); - } - finally - { - File.SetAttributes(tempFile, FileAttributes.Normal); - File.Delete(tempFile); - } - } - - /// - /// Expand intrinsic property function calls a static arithmetic method - /// - [Test] - public void PropertyFunctionStaticMethodIntrinsicMaths() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - - Expander expander = new Expander(pg); - - string result = expander.ExpandAllIntoStringLeaveEscaped(@"$([MSBuild]::Add(39.9, 2.1))", null); - - Assertion.AssertEquals("42", result); - - result = expander.ExpandAllIntoStringLeaveEscaped(@"$([MSBuild]::Add(40, 2))", null); - - Assertion.AssertEquals("42", result); - - result = expander.ExpandAllIntoStringLeaveEscaped(@"$([MSBuild]::Subtract(44, 2))", null); - - Assertion.AssertEquals("42", result); - - result = expander.ExpandAllIntoStringLeaveEscaped(@"$([MSBuild]::Subtract(42.9, 0.9))", null); - - Assertion.AssertEquals("42", result); - - result = expander.ExpandAllIntoStringLeaveEscaped(@"$([MSBuild]::Multiply(21, 2))", null); - - Assertion.AssertEquals("42", result); - - result = expander.ExpandAllIntoStringLeaveEscaped(@"$([MSBuild]::Multiply(84.0, 0.5))", null); - - Assertion.AssertEquals("42", result); - - result = expander.ExpandAllIntoStringLeaveEscaped(@"$([MSBuild]::Divide(84, 2))", null); - - Assertion.AssertEquals("42", result); - - result = expander.ExpandAllIntoStringLeaveEscaped(@"$([MSBuild]::Divide(84.4, 2.0))", null); - - Assertion.AssertEquals("42.2", result); - - result = expander.ExpandAllIntoStringLeaveEscaped(@"$([MSBuild]::Modulo(85, 2))", null); - - Assertion.AssertEquals("1", result); - - result = expander.ExpandAllIntoStringLeaveEscaped(@"$([MSBuild]::Modulo(2345.5, 43))", null); - - Assertion.AssertEquals("23.5", result); - - // test for overflow wrapping - result = expander.ExpandAllIntoStringLeaveEscaped(@"$([MSBuild]::Add(9223372036854775807, 20))", null); - - Assertion.AssertEquals("9.22337203685478E+18", result); - - result = expander.ExpandAllIntoStringLeaveEscaped(@"$([MSBuild]::BitwiseOr(40, 2))", null); - - Assertion.AssertEquals("42", result); - - result = expander.ExpandAllIntoStringLeaveEscaped(@"$([MSBuild]::BitwiseAnd(42, 2))", null); - - Assertion.AssertEquals("2", result); - - result = expander.ExpandAllIntoStringLeaveEscaped(@"$([MSBuild]::BitwiseXor(213, 255))", null); - - Assertion.AssertEquals("42", result); - - result = expander.ExpandAllIntoStringLeaveEscaped(@"$([MSBuild]::BitwiseNot(-43))", null); - - Assertion.AssertEquals("42", result); - - } - /// - /// Expand a property reference that has whitespace around the property name (should result in empty) - /// - [Test] - public void PropertySimpleSpaced() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - pg.SetProperty("SomeStuff", "This IS SOME STUff"); - - Expander expander = new Expander(pg); - - string result = expander.ExpandAllIntoStringLeaveEscaped(@"$( SomeStuff )", null); - - Assertion.AssertEquals(String.Empty, result); - } - - /// - /// Expand a property function that references item metadata - /// - [Test] - public void PropertyFunctionConsumingItemMetadata() - { - MockLogger logger = new MockLogger(); - Project project = ObjectModelHelpers.CreateInMemoryProject(@" - - - ", logger); - - - BuildPropertyGroup pg = new BuildPropertyGroup(); - pg.SetProperty("SomePath", @"c:\some\path"); - - BuildItemGroup ig = new BuildItemGroup(); - BuildItem item = new BuildItem("Compile", "fOo.Cs"); - item.SetMetadata("SomeMeta", "fOo.Cs"); - ig.AddItem(item); - - Hashtable itemsByType = new Hashtable(StringComparer.OrdinalIgnoreCase); - itemsByType["Compile"] = ig; - - Expander expander = new Expander(pg, itemsByType, ExpanderOptions.ExpandAll); - expander.SetMetadataInMetadataTable("Compile", "SomeMeta", "fOo.Cs"); - - string result = expander.ExpandAllIntoStringLeaveEscaped(@"$([System.IO.Path]::Combine($(SomePath),%(Compile.SomeMeta)))", null); - - Assertion.AssertEquals(@"c:\some\path\fOo.Cs", result); - } - - /// - /// A whole bunch error check tests - /// - [Test] - public void Medley() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - pg.SetProperty("File", @"foobar\baz.txt"); - - pg.SetProperty("a", "no"); - pg.SetProperty("b", "true"); - pg.SetProperty("c", "1"); - pg.SetProperty("d", "xxx"); - pg.SetProperty("e", "xxx"); - pg.SetProperty("and", "and"); - pg.SetProperty("a_semi_b", "a;b"); - pg.SetProperty("a_apos_b", "a'b"); - pg.SetProperty("foo_apos_foo", "foo'foo"); - pg.SetProperty("a_escapedsemi_b", "a%3bb"); - pg.SetProperty("a_escapedapos_b", "a%27b"); - pg.SetProperty("has_trailing_slash", @"foo\"); - pg.SetProperty("emptystring", @""); - pg.SetProperty("space", @" "); - pg.SetProperty("propertycontainingnullasastring", @"null"); - - Expander expander = new Expander(pg); - - string[,] validTests = { - {"$([MSBuild]::Add(2,$([System.Convert]::ToInt64('28', 16))))", "42"}, - {"$([MSBuild]::Add(2,$([System.Convert]::ToInt64('28', $([System.Convert]::ToInt32(16))))))", "42"}, - {"$(e.Length.ToString())", "3"}, - {"$(e.get_Length().ToString())", "3"}, - {"$(emptystring.Length)", "0" }, - {"$(space.Length)", "1" }, - {"$([System.TimeSpan]::Equals(null, null))", "True"}, // constant, unquoted null is a special value - {"$([MSBuild]::Add(40,null))", "40"}, - {"$([MSBuild]::Add( 40 , null ))", "40"}, - {"$([MSBuild]::Add(null,40))", "40"}, - {"$([MSBuild]::Escape(';'))", "%3b"}, - {"$([MSBuild]::UnEscape('%3b'))", ";"}, - {"$(e.Substring($(e.Length)))", ""}, - {"$(386)", ""}, - {"$(Environent:W3=w2)", ""}, - {"$([System.Int32]::MaxValue)", System.Int32.MaxValue.ToString()}, - }; - - string[] errorTests = { - "$([Microsoft.VisualBasic.FileIO.FileSystem]::CurrentDirectory)", // not allowed - "$(e.Length..ToString())", - "$(SomeStuff.get_Length(null))", - "$(SomeStuff.Substring((1)))", - "$(b.Substring(-10, $(c)))", - "$(b.Substring(-10, $(emptystring)))", - "$(b.Substring(-10, $(space)))", - "$([MSBuild]::Add.Sub(null,40))", - "$([MSBuild]::Add( ,40))", // empty parameter is empty string - "$([MSBuild]::Add('',40))", // empty quoted parameter is empty string - "$([MSBuild]::Add(40,,,))", - "$([MSBuild]::Add(40, ,,))", - "$([MSBuild]::Add(40,)", - "$([MSBuild]::Add(40,X)", - "$([MSBuild]::Add(40,", - "$([MSBuild]::Add(40", - "$([MSBuild]::Add(,))", // gives "Late bound operations cannot be performed on types or methods for which ContainsGenericParameters is true." - "$([System.TimeSpan]::Equals(,))", // empty parameter is interpreted as empty string - "$([System.TimeSpan]::Equals($(space),$(emptystring)))", // empty parameter is interpreted as empty string - "$([System.TimeSpan]::Equals($(emptystring),$(emptystring)))", // empty parameter is interpreted as empty string - "$([MSBuild]::Add($(PropertyContainingNullAsAString),40))", // a property containing the word null is a string "null" - "$([MSBuild]::Add('null',40))", // the word null is a string "null" - "$(SomeStuff.Substring(-10))", - "$(.Length)", - "$(.Substring(1))", - "$(.get_Length())", - "$(e.)", - "$(e..)", - "$(e..Length)", - "$(e$(d).Length)", - "$($(d).Length)", - "$(e`.Length)", - "$([System.IO.Path]Combine::Combine(`a`,`b`))", - "$([System.IO.Path]::Combine((`a`,`b`))", - "$([System.IO.Path]::Combine(`|`,`b`))", - "$([System.IO.Path]Combine(::Combine(`a`,`b`))", - "$([System.IO.Path]Combine(`::Combine(`a`,`b`)`, `b`)`)", - "$([System.IO.Path]::`Combine(`a`, `b`)`)", - "$([System.IO.Path]::(`Combine(`a`, `b`)`))", - "$([System.DateTime]foofoo::Now)", - "$([System.DateTime].Now)", - "$([].Now)", - "$([ ].Now)", - "$([ .Now)", - "$([])", - "$([ )", - "$([ ])", - "$([System.Diagnostics.Process]::Start(`NOTEPAD.EXE`))", - "$([[]]::Start(`NOTEPAD.EXE`))", - "$([(::Start(`NOTEPAD.EXE`))", - "$([Goop]::Start(`NOTEPAD.EXE`))", - "$([System.Threading.Thread]::CurrentThread)", - "$", - "$(", - "$((", - "@", - "@(", - "@()", - "%", - "%(", - "%()", - "exists", - "exists(", - "exists()", - "exists( )", - "exists(,)", - "@(x->'", - "@(x->''", - "@(x-", - "@(x->'x','", - "@(x->'x',''", - "@(x->'x','')", - "-1>x", - "\n", - "\t", - "+-1", - "$(SomeStuff.)", - "$(SomeStuff.!)", - "$(SomeStuff.`)", - "$(SomeStuff.GetType)", - "$(goop.baz`)", - "$(SomeStuff.Substring(HELLO!))", - "$(SomeStuff.ToLower()_goop)", - "$(SomeStuff($(System.DateTime.Now)))", - "$(System.Foo.Bar.Lgg)", - "$(SomeStuff.Lgg)", - "$(SomeStuff($(Value)))", - "$(e.$(e.Length))", - "$(e.Substring($(e.Substring(,)))", - "$(e.Substring($(e.Substring(a)))", - "$(e.Substring($([System.IO.Path]::Combine(`a`, `b`))))", - - }; - - string result; - for (int i = 0; i < validTests.GetLength(0); i++) - { - result = expander.ExpandAllIntoStringLeaveEscaped(validTests[i, 0], null); - - if (!String.Equals(result, validTests[i, 1])) - { - Console.WriteLine("FAILURE: " + validTests[i, 0] + " expanded to '" + result + "' instead of '" + validTests[i, 1] + "'"); - } - else - { - Console.WriteLine(validTests[i, 0] + " expanded to '" + result + "'"); - } - } - - for (int i = 0; i < errorTests.GetLength(0); i++) - { - // If an expression is invalid, - // - Expansion may throw InvalidProjectFileException, or - // - return the original unexpanded expression - bool success = true; - bool caughtException = false; - result = String.Empty; - try - { - result = expander.ExpandAllIntoStringLeaveEscaped(errorTests[i], null); - if (String.Compare(result, errorTests[i]) == 0) - { - Console.WriteLine(errorTests[i] + " did not expand."); - success = false; - } - } - catch (Microsoft.Build.BuildEngine.InvalidProjectFileException ex) - { - Console.WriteLine(errorTests[i] + " caused '" + ex.Message + "'"); - caughtException = true; - } - Assertion.Assert("FAILURE: Expected '" + errorTests[i] + "' to not parse or not be evaluated but it evaluated to '" + result + "'", - (success == false || caughtException == true)); - - } - } - - [Test] - public void RegistryPropertyString() - { - try - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - - Expander expander = new Expander(pg); - RegistryKey key = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\MSBuild_test"); - - key.SetValue("Value", "String", RegistryValueKind.String); - string result = expander.ExpandAllIntoStringLeaveEscaped(@"$(Registry:HKEY_CURRENT_USER\Software\Microsoft\MSBuild_test@Value)", null); - - Assertion.AssertEquals("String", result); - } - finally - { - Registry.CurrentUser.DeleteSubKey(@"Software\Microsoft\MSBuild_test"); - } - } - - [Test] - public void RegistryPropertyBinary() - { - try - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - - Expander expander = new Expander(pg); - RegistryKey key = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\MSBuild_test"); - - UTF8Encoding enc = new UTF8Encoding(); - byte[] utfText = enc.GetBytes("String".ToCharArray()); - - key.SetValue("Value", utfText, RegistryValueKind.Binary); - string result = expander.ExpandAllIntoStringLeaveEscaped(@"$(Registry:HKEY_CURRENT_USER\Software\Microsoft\MSBuild_test@Value)", null); - - Assertion.AssertEquals("83;116;114;105;110;103", result); - } - finally - { - Registry.CurrentUser.DeleteSubKey(@"Software\Microsoft\MSBuild_test"); - } - } - - [Test] - public void RegistryPropertyDWord() - { - try - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - - Expander expander = new Expander(pg); - RegistryKey key = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\MSBuild_test"); - - key.SetValue("Value", 123456, RegistryValueKind.DWord); - string result = expander.ExpandAllIntoStringLeaveEscaped(@"$(Registry:HKEY_CURRENT_USER\Software\Microsoft\MSBuild_test@Value)", null); - - Assertion.AssertEquals("123456", result); - } - finally - { - Registry.CurrentUser.DeleteSubKey(@"Software\Microsoft\MSBuild_test"); - } - } - - [Test] - public void RegistryPropertyExpandString() - { - try - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - - Expander expander = new Expander(pg); - RegistryKey key = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\MSBuild_test"); - - key.SetValue("Value", "%TEMP%", RegistryValueKind.ExpandString); - string result = expander.ExpandAllIntoStringLeaveEscaped(@"$(Registry:HKEY_CURRENT_USER\Software\Microsoft\MSBuild_test@Value)", null); - - Assertion.AssertEquals(Environment.GetEnvironmentVariable("TEMP"), result); - } - finally - { - Registry.CurrentUser.DeleteSubKey(@"Software\Microsoft\MSBuild_test"); - } - } - - [Test] - public void RegistryPropertyQWord() - { - try - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - - Expander expander = new Expander(pg); - RegistryKey key = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\MSBuild_test"); - - key.SetValue("Value", (long)123456789123456789, RegistryValueKind.QWord); - string result = expander.ExpandAllIntoStringLeaveEscaped(@"$(Registry:HKEY_CURRENT_USER\Software\Microsoft\MSBuild_test@Value)", null); - - Assertion.AssertEquals("123456789123456789", result); - } - finally - { - Registry.CurrentUser.DeleteSubKey(@"Software\Microsoft\MSBuild_test"); - } - } - - [Test] - public void RegistryPropertyMultiString() - { - try - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - - Expander expander = new Expander(pg); - RegistryKey key = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\MSBuild_test"); - - key.SetValue("Value", new string[] { "A", "B", "C", "D" }, RegistryValueKind.MultiString); - string result = expander.ExpandAllIntoStringLeaveEscaped(@"$(Registry:HKEY_CURRENT_USER\Software\Microsoft\MSBuild_test@Value)", null); - - Assertion.AssertEquals("A;B;C;D", result); - } - finally - { - Registry.CurrentUser.DeleteSubKey(@"Software\Microsoft\MSBuild_test"); - } - } - } - - /// - /// Tests relating to SplitSemiColonSeparatedList method - /// - [TestFixture] - public class SplitSemiColonSeparatedList_Tests - { - [Test] - public void NoOpSplit() - { - VerifySplitSemiColonSeparatedList("a", "a"); - } - - [Test] - public void BasicSplit() - { - VerifySplitSemiColonSeparatedList("a;b", "a", "b"); - } - - [Test] - public void Empty() - { - VerifySplitSemiColonSeparatedList("", null); - } - - [Test] - public void SemicolonOnly() - { - VerifySplitSemiColonSeparatedList(";", null); - } - - [Test] - public void TwoSemicolons() - { - VerifySplitSemiColonSeparatedList(";;", null); - } - - [Test] - public void TwoSemicolonsAndOneEntryAtStart() - { - VerifySplitSemiColonSeparatedList("a;;", "a"); - } - - [Test] - public void TwoSemicolonsAndOneEntryAtEnd() - { - VerifySplitSemiColonSeparatedList(";;a", "a"); - } - - [Test] - public void AtSignAtEnd() - { - VerifySplitSemiColonSeparatedList("@", "@"); - } - - [Test] - public void AtSignParenAtEnd() - { - VerifySplitSemiColonSeparatedList("foo@(", "foo@("); - } - - [Test] - public void EmptyEntriesRemoved() - { - VerifySplitSemiColonSeparatedList(";a;bbb;;c;;", "a", "bbb", "c"); - } - - [Test] - public void EntriesTrimmed() - { - VerifySplitSemiColonSeparatedList(" ; a ;b ; ;c\n; \r; ", "a", "b", "c"); - } - - [Test] - public void NoSplittingOnMacros() - { - VerifySplitSemiColonSeparatedList("@(foo->';')", "@(foo->';')"); - } - - [Test] - public void NoSplittingOnSeparators() - { - VerifySplitSemiColonSeparatedList("@(foo, ';')", "@(foo, ';')"); - } - - [Test] - public void NoSplittingOnSeparatorsAndMacros() - { - VerifySplitSemiColonSeparatedList("@(foo->'abc;def', 'ghi;jkl')", "@(foo->'abc;def', 'ghi;jkl')"); - } - - [Test] - public void CloseParensInMacro() - { - VerifySplitSemiColonSeparatedList("@(foo->');')", "@(foo->');')"); - } - - [Test] - public void CloseParensInSeparator() - { - VerifySplitSemiColonSeparatedList("a;@(foo,');');b", "a", "@(foo,');')", "b"); - } - - [Test] - public void CloseParensInMacroAndSeparator() - { - VerifySplitSemiColonSeparatedList("@(foo->';);', ';);')", "@(foo->';);', ';);')"); - } - - [Test] - public void EmptyQuotesInMacroAndSeparator() - { - VerifySplitSemiColonSeparatedList(" @(foo->'', '')", "@(foo->'', '')"); - } - - [Test] - public void MoreParensAndAtSigns() - { - VerifySplitSemiColonSeparatedList("@(foo->';());', ';@();')", "@(foo->';());', ';@();')"); - } - - [Test] - public void SplittingExceptForMacros() - { - VerifySplitSemiColonSeparatedList("@(foo->';');def;@ghi;", "@(foo->';')", "def", "@ghi"); - } - - // Invalid item expressions shouldn't cause an error in the splitting function. - // The caller will emit an error later when it tries to parse the results. - [Test] - public void InvalidItemExpressions() - { - VerifySplitSemiColonSeparatedList("@(x", "@(x"); - VerifySplitSemiColonSeparatedList("@(x->')", "@(x->')"); - VerifySplitSemiColonSeparatedList("@(x->)", "@(x->)"); - VerifySplitSemiColonSeparatedList("@(x->''", "@(x->''"); - VerifySplitSemiColonSeparatedList("@(x->)", "@(x->)"); - VerifySplitSemiColonSeparatedList("@(x->", "@(x->"); - VerifySplitSemiColonSeparatedList("@(x,')", "@(x,')"); - - // This one doesn't remove the ';' because it thinks it's in - // an item list. This isn't worth tweaking, because the invalid expression is - // going to lead to an error in the caller whether there's a ';' or not. - VerifySplitSemiColonSeparatedList("@(x''';", "@(x''';"); - } - - [Test] - public void RealisticExample() - { - VerifySplitSemiColonSeparatedList("@(_OutputPathItem->'%(FullPath)', ';');$(MSBuildAllProjects);\n @(Compile);\n @(ManifestResourceWithNoCulture);\n $(ApplicationIcon);\n $(AssemblyOriginatorKeyFile);\n @(ManifestNonResxWithNoCultureOnDisk);\n @(ReferencePath);\n @(CompiledLicenseFile);\n @(EmbeddedDocumentation); \n @(CustomAdditionalCompileInputs)", - "@(_OutputPathItem->'%(FullPath)', ';')", "$(MSBuildAllProjects)", "@(Compile)", "@(ManifestResourceWithNoCulture)", "$(ApplicationIcon)", "$(AssemblyOriginatorKeyFile)", "@(ManifestNonResxWithNoCultureOnDisk)", "@(ReferencePath)", "@(CompiledLicenseFile)", "@(EmbeddedDocumentation)", "@(CustomAdditionalCompileInputs)"); - } - - // For reference, this is the authoritative definition of an item expression: - // @"@\(\s* - // (?[\w\x20-]*[\w-]+) - // (?\s*->\s*'(?[^']*)')? - // (?\s*,\s*'(?[^']*)')? - // \s*\)"; - // We need to support any item expressions that satisfy this expression. - // - // Try spaces everywhere that that regex allows spaces: - [Test] - public void SpacingInItemListExpression() - { - VerifySplitSemiColonSeparatedList("@( foo \n -> \t ';abc;def;' , \t 'ghi;jkl' )", "@( foo \n -> \t ';abc;def;' , \t 'ghi;jkl' )"); - } - - /// - /// Helper method for SplitSemiColonSeparatedList tests - /// - /// - /// - private void VerifySplitSemiColonSeparatedList(string input, params string[] expected) - { - List actual = ExpressionShredder.SplitSemiColonSeparatedList(input); - Console.WriteLine(input); - - if (null == expected) - { - // passing "null" means you expect an empty array back - expected = new string[] { }; - } - - Assertion.AssertEquals("Expected " + expected.Length + " items but got " + actual.Count, - actual.Count, expected.Length); - - for (int i = 0; i < expected.Length; i++) - { - Assertion.AssertEquals(expected[i], actual[i]); - } - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/ExpressionShredder_Tests.cs b/src/Deprecated/Engine.UnitTests/ExpressionShredder_Tests.cs deleted file mode 100644 index 3d157e3478a..00000000000 --- a/src/Deprecated/Engine.UnitTests/ExpressionShredder_Tests.cs +++ /dev/null @@ -1,518 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Text; -using NUnit.Framework; -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine; -using Microsoft.Build.BuildEngine.Shared; -using System.Xml; -using System.Text.RegularExpressions; - -namespace Microsoft.Build.UnitTests -{ - /// - /// Compares the items and metadata that ExpressionShredder finds - /// with the results from the old regexes to make sure they're identical - /// in every case. - /// - [TestFixture] - public class ExpressionShredder_Tests - { - [Test] - public void Medley() - { - string[] tests = new string[] - { - "a;@(foo,');');b", - "x@(z);@(zz)y", - "exists('@(u)')", - "a;b", - "a;;", - "a", - "@A->'%(x)'", - "@@(", - "@@", - "@(z1234567890_-AZaz->'z1234567890_-AZaz','a1234567890_-AZaz')", - "@(z1234567890_-AZaz,'a1234567890_-AZaz')", - "@(z1234567890_-AZaz)", - "@(z1234567890_-AXZaxz -> '%(a1234567890_-AXZaxz).%(adfas)' )", - "@(z123456.7890_-AXZaxz -> '%(a1234567890_-AXZaxz).%(adfas)' )", - "@(z->'%(x)", - "@(z->%(x)", - "@(z,'%(x)", - "@(z,%(x)", - "@(z) and true", - "@(z%(x)", - "@(z -> '%(filename).z', '$')=='xxx.z$yyy.z'", - "@(z -> '%(filename)', '!')=='xxx!yyy'", - "@(y)==$(d)", - "@(y)<=1", - "@(y -> '%(filename)')=='xxx'", - "@(x\u00DF)", - "@(x1234567890_-AZaz->'x1234567890_-AZaz')", - "@(x1234567890_-AZaz)", - "@(x123 4567890_-AZaz->'x1234567890_-AZaz')", - "@(x->)", - "@(x->)", - "@(x->'x','')", - "@(x->'x',''", - "@(x->'x','", - "@(x->')", - "@(x->''", - "@(x->''", - "@(x->'", - "@(x->", - "@(x-", - "@(x,')", - "@(x)@(x)", - "@(x)0", - "@(nonexistent)", - "@(nonexistent) and true", - "@(foo->'x')", - "@(foo->'abc;def', 'ghi;jkl')", - "@(foo->';());', ';@();')", - "@(foo->';');def;@ghi;", - "@(foo->';')", - "@(foo-->'x')", // "foo-" is a legit item type - "@(foo, ';')", - "@(a1234:567890_-AZaz->'z1234567890_-AZaz')", - "@(a1234567890_-AZaz->'z1234567890_-AZaz')", - "@(a1234567890_-AXZaxz -> 'a1234567890_-AXZaxz' , 'z1234567890_-AXZaxz' )", - "@(a1234567890_-AXZaxz , 'z123%%4567890_-AXZaxz' )", - "@(a->'a')", - "@(a->'a' , 'a')", - "@(a)@(x)!=1", - "@(a)", - "@(a) @(x)!=1", - "@(a , 'a')", - "@(_X->'_X','X')", - "@(_X->'_X')", - "@(_X,'X')", - "@(_X)", - "@(_->'@#$%$%^&*&*)','@#$%$%^&*&*)')", - "@(_->'@#$%$%^&*&*)')", - "@(_,'@#$%$%^&*&*)')", - "@(_)", - "@(\u1234%(x)", - "@(\u00DF)", - "@(Z1234567890_-AZaz)", - "@(Z1234567890_-AZaz -> 'Z1234567890_-AZaz')", - "@(Com:pile)", - "@(Com.pile)", - "@(Com%pile)", - "@(Com pile)", - "@(A1234567890_-AZaz,'!@#$%^&*)(_+'))", - "@(A1234567890_-AZaz)", - "@(A1234567890_-AZaz ->'A1234567890_-AZaz')", - "@(A1234567890_-AZaz ->'A1234567890_-AZaz' , '!@#$%^&*)(_+'))", - "@(A->'foo%(x)bar',',')", - "@(A->'%(x))", - "@(A->'%(x)')@(B->'%(x);%(y)')@(C->'%(z)')", - "@(A->'%(x)');@(B->'%(x);%(y)');;@(C->'%(z)')", - "@(A->'%(x)')", - "@(A->%(x))", - "@(A,'%(x)')", - "@(A, '%(x)->%(y)')", - "@(A, '%(x)%(y)')", - "@(A > '%(x)','+')", - "@(:Z1234567890_-AZaz -> 'Z1234567890_-AZaz')", - "@(:Compile)", - "@(1x->'@#$%$%^&*&*)')", - "@(1Compile)", - "@(1->'a')", - "@(.Compile)", - "@(.A1234567890_-AZaz ->'A1234567890_-AZaz')", - "@(-x->'_X')", - "@(-Compile)", - "@()", - "@() and true", - "@(%Compile)", - "@(%(x)", - "@(", "@()", "@", - "@(", - "@( foo -> ';);' , ';);' )", - "@( foo -> ');' )", - "@( A -> '%(Directory)%(Filename)%(Extension)', ' ** ')", - "@( )", - "@( foo )", - "@( foo ", - "@( a1234567890_-AXZaxz )", - "@", - "@ (x)", - "@(x,'@(y)%(x)@(z->')", - "@(x,'@(y)')", // verify items inside separators aren't found - "@(x,'@(y, '%(z)')')", - "@(x,'@(y)%(z)')", - "@(x,'@(y)%(x')", - "@(x,'')", - "@(x->'','')", - "@(x->'%(z)','')", - ";a;bbb;;c;;", - ";;a", - ";;;@(A->'%(x)');@(B)@(C->'%(y)');%(x)@(D->'%(y)');;", - ";;", - ";", - "; ", - "1<=@(z)", - "1<=@(w)", - "'xxx!yyy'==@(z -> '%(filename)', '!')", - "'@(z)'=='xxx;yyy'", - "'$(e)1@(y)'=='xxx1xxx'", - "'$(c)@(y)'>1", - "%x)", - "%x", - "%(z1234567890_-AZaz.z1234567890_-AZaz)", - "%(z1234567890_-AZaz)", - "%(x1234567890_-AZaz.x1234567890_-AZaz)", - "%(x1234567890_-AZaz)", - "%(x._)", - "%(x)", - "%(x", - "%(x )", - "%(foo.bar.baz)", - "%(foo.bar baz)", - "%(foo bar.rhu barb)", - "%(abc._X)", - "%(a@(z)", - "%(a1234567890_-AXZaxz)", - "%(a12.a)", - "%(a.x)", - "%(a.x )", - "%(a.a@(z)", - "%(a.@(z)", - "%(a. x)", - "%(a)", - "%(a . x)", - "%(_X)", - "%(_)", - "%(Z1234567890_-AZaz.Z1234567890_-AZaz)", - "%(Z1234567890_-AZaz)", - "%(MyType.attr)", - "%(InvalidAttrWithA Space)", - "%(Foo.Bar.)", - "%(Compile.)", - "%(Com:pile.Com:pile)", - "%(Com:pile)", - "%(Com.pile.Com.pile)", - "%(Com%pile.Com%pile)", - "%(Com%pile)", - "%(Com pile.Com pile)", - "%(Com pile)", - "%(A1234567890_-AZaz.A1234567890_-AZaz)", - "%(A1234567890_-AZaz)", - "%(A.x)%(b.x)", - "%(A.x)", - "%(A.x) %( x )", - "%(A.)", - "%(A. )", - "%(A .x)", - "%(A .)", - "%(A . )", - "%(@(z)", - "%(:Compile.:Compile)", - "%(:Compile)", - "%(1Compile.1Compile)", - "%(1Compile)", - "%(.x)", - "%(.x )", - "%(.foo.bar)", - "%(.Compile)", - "%(.)", - "%(. x)", - "%(. x )", - "%(-Compile.-Compile)", - "%(-Compile)", - "%()", - "%(%Compile.%Compile)", - "%(%Compile)", - "%( x)", - "%( MyType . attr )", - "%( A.x)", - "%( A.x )", - "%( A.)", - "%( A .)", - "%( A . x )", - "%( .x)", - "%( . x)", - "%( . x )", - "%( )", - "%( fooBar )", - "%( Invalid AttrWithASpace )", - "%( A . )", - "%( x )", - "%( a1234567890_-AXZaxz.a1234567890_-AXZaxz )", - "% x", - "% (x)", - "$(c)@(y)>1", - "", - "", - "!@#$%^&*", - " @(foo->'', '')", - " -> ';abc;def;' , 'ghi;jkl' )", - " %(A . x)%%%%%%%%(b . x) ", - " ; a ;b ; ;c", - " $(AssemblyOriginatorKeyFile);\n\t @(Compile);", - "@(_OutputPathItem->'%(FullPath)', ';');$(MSBuildAllProjects);" - }; - - foreach (string test in tests) - { - VerifyExpression(test); - } - } - - private void VerifyExpression(string test) - { - List list = new List(); - list.Add(test); - ItemsAndMetadataPair pair = ExpressionShredder.GetReferencedItemNamesAndMetadata(list); - - Hashtable actualItems = pair.Items; - Dictionary actualMetadata = pair.Metadata; - - Hashtable expectedItems = GetConsumedItemReferences_OriginalImplementation(test); - Console.WriteLine("verifying item names..."); - VerifyAgainstCanonicalResults(test, actualItems, expectedItems); - - Hashtable expectedMetadata = GetConsumedMetadataReferences_OriginalImplementation(test); - Console.WriteLine("verifying metadata ..."); - VerifyAgainstCanonicalResults(test, actualMetadata, expectedMetadata); - - Console.WriteLine("===OK==="); - } - - private static void VerifyAgainstCanonicalResults(string test, IDictionary actual, IDictionary expected) - { - List messages = new List(); - - Console.WriteLine("Expecting " + expected.Count + " distinct values for <" + test + ">"); - - if (actual != null) - { - foreach (DictionaryEntry result in actual) - { - if (expected == null || !expected.Contains(result.Key)) - { - messages.Add("Found <" + result.Key + "> in <" + test + "> but it wasn't expected"); - } - } - } - - if (expected != null) - { - foreach (DictionaryEntry expect in expected) - { - if (actual == null || !actual.Contains(expect.Key)) - { - messages.Add("Did not find <" + expect.Key + "> in <" + test + ">"); - } - } - } - - if (messages.Count > 0) - { - if (actual != null) - { - Console.Write("FOUND: "); - foreach (string result in actual.Keys) - { - Console.Write("<" + result + "> "); - } - Console.WriteLine(); - } - } - - foreach (string message in messages) - { - Console.WriteLine(message); - } - - Assertion.Assert(messages.Count == 0); - } - - #region Original code to produce canonical results - - /// - /// Looks through the parameters of the batchable object, and finds all referenced item lists. - /// Returns a hashtable containing the item lists, where the key is the item name, and the - /// value is always String.Empty (not used). - /// - private static Hashtable GetConsumedItemReferences_OriginalImplementation(string expression) - { - Hashtable result = new Hashtable(StringComparer.OrdinalIgnoreCase); - - foreach (Match itemVector in itemVectorPattern.Matches(expression)) - { - result[itemVector.Groups["TYPE"].Value] = String.Empty; - } - - return result; - } - - /// - /// Looks through the parameters of the batchable object, and finds all references to item metadata - /// (that aren't part of an item transform). Returns a Hashtable containing a bunch of MetadataReference - /// structs. Each reference to item metadata may or may not be qualified with an item name (e.g., - /// %(Culture) vs. %(EmbeddedResource.Culture). - /// - /// SumedhK, RGoel - /// Hashtable containing the metadata references. - private static Hashtable GetConsumedMetadataReferences_OriginalImplementation(string expression) - { - // The keys in the hash table are the qualified metadata names (e.g. "EmbeddedResource.Culture" - // or just "Culture"). The values are MetadataReference structs, which simply split out the item - // name (possibly null) and the actual metadata name. - Hashtable consumedMetadataReferences = new Hashtable(StringComparer.OrdinalIgnoreCase); - - FindEmbeddedMetadataReferences_OriginalImplementation(expression, consumedMetadataReferences); - - return consumedMetadataReferences; - } - - /// - /// Looks through a single parameter of the batchable object, and finds all references to item metadata - /// (that aren't part of an item transform). Populates a Hashtable containing a bunch of MetadataReference - /// structs. Each reference to item metadata may or may not be qualified with an item name (e.g., - /// %(Culture) vs. %(EmbeddedResource.Culture). - /// - /// - /// - private static void FindEmbeddedMetadataReferences_OriginalImplementation - ( - string batchableObjectParameter, - Hashtable consumedMetadataReferences - ) - { - MatchCollection embeddedMetadataReferences = FindEmbeddedMetadataReferenceMatches_OriginalImplementation(batchableObjectParameter); - - if (embeddedMetadataReferences != null) - { - foreach (Match embeddedMetadataReference in embeddedMetadataReferences) - { - string metadataName = embeddedMetadataReference.Groups["NAME"].Value; - string qualifiedMetadataName = metadataName; - - // Check if the metadata is qualified with the item name. - string itemName = null; - if (embeddedMetadataReference.Groups["ITEM_SPECIFICATION"].Length > 0) - { - itemName = embeddedMetadataReference.Groups["TYPE"].Value; - qualifiedMetadataName = itemName + "." + metadataName; - } - - consumedMetadataReferences[qualifiedMetadataName] = new MetadataReference(itemName, metadataName); - } - } - } - - // the leading characters that indicate the start of an item vector - private const string itemVectorPrefix = "@("; - - // complete description of an item vector, including the optional transform expression and separator specification - private const string itemVectorSpecification = - @"@\(\s* - (?" + ProjectWriter.itemTypeOrMetadataNameSpecification + @") - (?\s*->\s*'(?[^']*)')? - (?\s*,\s*'(?[^']*)')? - \s*\)"; - - // description of an item vector, including the optional transform expression, but not the separator specification - private const string itemVectorWithoutSeparatorSpecification = - @"@\(\s* - (?" + ProjectWriter.itemTypeOrMetadataNameSpecification + @") - (?\s*->\s*'(?[^']*)')? - \s*\)"; - - // regular expression used to match item vectors, including those embedded in strings - private static readonly Regex itemVectorPattern = new Regex(itemVectorSpecification, RegexOptions.IgnorePatternWhitespace | RegexOptions.ExplicitCapture); - - // regular expression used to match a list of item vectors that have no separator specification -- the item vectors - // themselves may be optionally separated by semi-colons, or they might be all jammed together - private static readonly Regex listOfItemVectorsWithoutSeparatorsPattern = - new Regex(@"^\s*(;\s*)*(" + - itemVectorWithoutSeparatorSpecification + - @"\s*(;\s*)*)+$", - RegexOptions.IgnorePatternWhitespace | RegexOptions.ExplicitCapture); - - // the leading characters that indicate the start of an item metadata reference - private const string itemMetadataPrefix = "%("; - - // complete description of an item metadata reference, including the optional qualifying item type - private const string itemMetadataSpecification = - @"%\(\s* - (?(?" + ProjectWriter.itemTypeOrMetadataNameSpecification + @")\s*\.\s*)? - (?" + ProjectWriter.itemTypeOrMetadataNameSpecification + @") - \s*\)"; - - // regular expression used to match item metadata references embedded in strings - private static readonly Regex itemMetadataPattern = new Regex(itemMetadataSpecification, RegexOptions.IgnorePatternWhitespace | RegexOptions.ExplicitCapture); - - // description of an item vector with a transform, split into two halves along the transform expression - private const string itemVectorWithTransformLHS = @"@\(\s*" + ProjectWriter.itemTypeOrMetadataNameSpecification + @"\s*->\s*'[^']*"; - private const string itemVectorWithTransformRHS = @"[^']*'(\s*,\s*'[^']*')?\s*\)"; - - // PERF WARNING: this Regex is complex and tends to run slowly - // regular expression used to match item metadata references outside of item vector transforms - private static readonly Regex nonTransformItemMetadataPattern = - new Regex(@"((?<=" + itemVectorWithTransformLHS + @")" + itemMetadataSpecification + @"(?!" + itemVectorWithTransformRHS + @")) | - ((? - /// Looks through a single parameter of the batchable object, and finds all references to item metadata - /// (that aren't part of an item transform). Populates a MatchCollection object with any regex matches - /// found in the input. Each reference to item metadata may or may not be qualified with an item name (e.g., - /// %(Culture) vs. %(EmbeddedResource.Culture). - /// - /// - private static MatchCollection FindEmbeddedMetadataReferenceMatches_OriginalImplementation(string batchableObjectParameter) - { - MatchCollection embeddedMetadataReferences = null; - - // PERF NOTE: Regex matching is expensive, so if the string doesn't contain any item attribute references, just bail - // out -- pre-scanning the string is actually cheaper than running the Regex, even when there are no matches! - - if (batchableObjectParameter.IndexOf(itemMetadataPrefix, StringComparison.Ordinal) != -1) - { - // if there are no item vectors in the string - if (batchableObjectParameter.IndexOf(itemVectorPrefix, StringComparison.Ordinal) == -1) - { - // run a simpler Regex to find item metadata references - embeddedMetadataReferences = itemMetadataPattern.Matches(batchableObjectParameter); - } - // PERF NOTE: this is a highly targeted optimization for a common pattern observed during profiling - // if the string is a list of item vectors with no separator specifications - else if (listOfItemVectorsWithoutSeparatorsPattern.IsMatch(batchableObjectParameter)) - { - // then even if the string contains item metadata references, those references will only be inside transform - // expressions, and can be safely skipped - embeddedMetadataReferences = null; - } - else - { - // otherwise, run the more complex Regex to find item metadata references not contained in transforms - embeddedMetadataReferences = nonTransformItemMetadataPattern.Matches(batchableObjectParameter); - } - } - - return embeddedMetadataReferences; - } - - #endregion - } -} diff --git a/src/Deprecated/Engine.UnitTests/ExpressionTree_Tests.cs b/src/Deprecated/Engine.UnitTests/ExpressionTree_Tests.cs deleted file mode 100644 index 19c3ee674e3..00000000000 --- a/src/Deprecated/Engine.UnitTests/ExpressionTree_Tests.cs +++ /dev/null @@ -1,971 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Globalization; -using System.Reflection; -using System.Collections; -using System.IO; -using System.Xml; -using System.Collections.Specialized; -using NUnit.Framework; -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine; -using System.Collections.Generic; - - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class ExpressionTreeTest - { - private XmlAttribute dummyAttribute; - private XmlAttribute DummyAttribute - { - get - { - if (dummyAttribute == null) - { - dummyAttribute = (new XmlDocument()).CreateAttribute("foo"); - } - - return dummyAttribute; - } - } - - private void AssertParseEvaluate(Parser p, string expression, ConditionEvaluationState state, bool expected) - { - state.parsedCondition = expression; - GenericExpressionNode expressionTree = p.Parse(expression, DummyAttribute, ParserOptions.AllowAll); - Assertion.AssertEquals(expected, expressionTree.Evaluate(state)); - } - - /// - /// - /// DavidLe - [Test] - public void SimpleEvaluationTests() - { - Parser p = new Parser(); - Expander expander = new Expander(new BuildPropertyGroup()); - Hashtable conditionedProperties = null; - ConditionEvaluationState state = new ConditionEvaluationState(DummyAttribute, expander, conditionedProperties, string.Empty); - - AssertParseEvaluate(p, "true", state, true); - AssertParseEvaluate(p, "on", state, true); - AssertParseEvaluate(p, "yes", state, true); - AssertParseEvaluate(p, "false", state, false); - AssertParseEvaluate(p, "off", state, false); - AssertParseEvaluate(p, "no", state, false); - } - - [Test] - public void EvaluatedAVarietyOfExpressionsWithProjectPerThreadProjectDirectoryNull() - { - string original = null; - try - { - original = Project.PerThreadProjectDirectory; - Project.PerThreadProjectDirectory = null; - EvaluateAVarietyOfExpressions(); - } - finally - { - Project.PerThreadProjectDirectory = original; - } - } - - [Test] - public void EvaluatedAVarietyOfExpressionsWithProjectPerThreadProjectDirectoryEmpty() - { - string original = null; - try - { - original = Project.PerThreadProjectDirectory; - Project.PerThreadProjectDirectory = String.Empty; - EvaluateAVarietyOfExpressions(); - } - finally - { - Project.PerThreadProjectDirectory = original; - } - } - - [Test] - public void EvaluatedAVarietyOfExpressionsWithProjectPerThreadProjectDirectoryNotNull() - { - string original = null; - try - { - original = Project.PerThreadProjectDirectory; - Project.PerThreadProjectDirectory = Directory.GetCurrentDirectory(); - EvaluateAVarietyOfExpressions(); - } - finally - { - Project.PerThreadProjectDirectory = original; - } - } - - /// - /// A whole bunch of conditionals, that should be true, false, or error - /// (many coincidentally like existing QA tests) to give breadth coverage. - /// Please add more cases as they arise. - /// - /// danmose - private void EvaluateAVarietyOfExpressions() - { - string[] files = { "a", "a;b", "a'b", ";", "'" }; - - try - { - foreach (string file in files) - { - using (StreamWriter sw = File.CreateText(file)) { ; } - } - - Parser p = new Parser(); - GenericExpressionNode tree; - - BuildItemGroup itemGroupU = new BuildItemGroup(); - BuildItemGroup itemGroupV = new BuildItemGroup(); - BuildItemGroup itemGroupW = new BuildItemGroup(); - BuildItemGroup itemGroupX = new BuildItemGroup(); - BuildItemGroup itemGroupY = new BuildItemGroup(); - BuildItemGroup itemGroupZ = new BuildItemGroup(); - itemGroupU.AddItem(new BuildItem("u", "a'b;c")); - itemGroupV.AddItem(new BuildItem("w", "a")); - itemGroupW.AddItem(new BuildItem("w", "1")); - itemGroupX.AddItem(new BuildItem("x", "true")); - itemGroupY.AddItem(new BuildItem("y", "xxx")); - itemGroupZ.AddItem(new BuildItem("z", "xxx")); - itemGroupZ.AddItem(new BuildItem("z", "yyy")); - Hashtable itemBag = new Hashtable(StringComparer.OrdinalIgnoreCase); - itemBag["u"] = itemGroupU; - itemBag["v"] = itemGroupV; - itemBag["w"] = itemGroupW; - itemBag["x"] = itemGroupX; - itemBag["y"] = itemGroupY; - itemBag["z"] = itemGroupZ; - - BuildPropertyGroup propertyBag = new BuildPropertyGroup(); - propertyBag.SetProperty("a", "no"); - propertyBag.SetProperty("b", "true"); - propertyBag.SetProperty("c", "1"); - propertyBag.SetProperty("d", "xxx"); - propertyBag.SetProperty("e", "xxx"); - propertyBag.SetProperty("and", "and"); - propertyBag.SetProperty("a_semi_b", "a;b"); - propertyBag.SetProperty("a_apos_b", "a'b"); - propertyBag.SetProperty("foo_apos_foo", "foo'foo"); - propertyBag.SetProperty("a_escapedsemi_b", "a%3bb"); - propertyBag.SetProperty("a_escapedapos_b", "a%27b"); - propertyBag.SetProperty("has_trailing_slash", @"foo\"); - - Dictionary itemMetadata = new Dictionary(StringComparer.OrdinalIgnoreCase); - itemMetadata["Culture"] = "french"; - - Expander expander = new Expander(new ReadOnlyLookup(itemBag, propertyBag), itemMetadata); - - string[] trueTests = { - "true or (SHOULDNOTEVALTHIS)", // short circuit - "(true and false) or true", - "false or true or false", - "(true) and (true)", - "false or !false", - "($(a) or true)", - "('$(c)'==1 and (!false))", - "@(z -> '%(filename).z', '$')=='xxx.z$yyy.z'", - "false or (false or (false or (false or (false or (true)))))", - "!(true and false)", - "$(and)=='and'", - "0x1==1.0", - "0xa==10", - "0<0.1", - "+4>-4", - "'-$(c)'==-1", - "$(a)==faLse", - "$(a)==oFF", - "$(a)==no", - "$(a)!=true", - "$(b)== True", - "$(b)==on", - "$(b)==yes", - "$(b)!=1", - "$(c)==1", - "$(d)=='xxx'", - "$(d)==$(e)", - "$(d)=='$(e)'", - "@(y)==$(d)", - "'@(z)'=='xxx;yyy'", - "$(a)==$(a)", - "'1'=='1'", - "'1'==1", - "1\n==1", - "1\t==\t\r\n1", - "123=='0123.0'", - "123==123", - "123==0123", - "123==0123.0", - "123!=0123.01", - "00==0", - "0==0.0", - "1\n\t==1", - "+4==4", - "44==+44.0 and -44==-44.0", - "false==no", - "true==yes", - "true==!false", - "yes!=no", - "false!=1", - "$(c)>0", - "!$(a)", - "$(b)", - "($(d)==$(e))", - "!true==false", - "a_a==a_a", - "a_a=='a_a'", - "_a== _a", - "@(y -> '%(filename)')=='xxx'", - "@(z -> '%(filename)', '!')=='xxx!yyy'", - "'xxx!yyy'==@(z -> '%(filename)', '!')", - "'$(a)'==(false)", - "('$(a)'==(false))", - "1>0", - "2<=2", - "2<=3", - "1>=1", - "1>=-1", - "-1==-1", - "-1 < 0", - "(1==1)and('a'=='a')", - "(true) and ($(a)==off)", - "(true) and ($(d)==xxx)", - "(false) or($(d)==xxx)", - "!(false)and!(false)", - "'and'=='AND'", - "$(d)=='XxX'", - "true or true or false", - "false or true or !true or'1'", - "$(a) or $(b)", - "$(a) or true", - "!!true", - "'$(e)1@(y)'=='xxx1xxx'", - "0x11==17", - "0x01a==26", - "0xa==0x0A", - "@(x)", - "'%77'=='w'", - "'%zz'=='%zz'", - "true or 1", - "true==!false", - "(!(true))=='off'", - "@(w)>0", - "1<=@(w)", - "%(culture)=='FRENCH'", - "'%(culture) fries' == 'FRENCH FRIES' ", - @"'%(HintPath)' == ''", - @"%(HintPath) != 'c:\myassemblies\foo.dll'", - "exists('a')", - "exists(a)", - "exists('a%3bb')", /* semicolon */ - "exists('a%27b')", /* apostrophe */ - "exists($(a_escapedsemi_b))", - "exists('$(a_escapedsemi_b)')", - "exists($(a_escapedapos_b))", - "exists('$(a_escapedapos_b)')", - "exists($(a_apos_b))", - "exists('$(a_apos_b)')", - "exists(@(v))", - "exists('@(v)')", - "exists('%3b')", - "exists('%27')", - "exists('@(v);@(nonexistent)')", - @"HASTRAILINGSLASH('foo\')", - @"!HasTrailingSlash('foo')", - @"HasTrailingSlash('foo/')", - @"HasTrailingSlash($(has_trailing_slash))", - "'59264.59264' == '59264.59264'", - "1" + new String('0', 500) + "==" + "1" + new String('0', 500), /* too big for double, eval as string */ - "'1" + new String('0', 500) + "'=='" + "1" + new String('0', 500) + "'" /* too big for double, eval as string */ - }; - - string[] falseTests = { - "false and SHOULDNOTEVALTHIS", // short circuit - "$(a)!=no", - "$(b)==1.1", - "$(c)==$(a)", - "$(d)!=$(e)", - "!$(b)", - "false or false or false", - "false and !((true and false))", - "on and off", - "(true) and (false)", - "false or (false or (false or (false or (false or (false)))))", - "!$(b)and true", - "1==a", - "!($(d)==$(e))", - "$(a) and true", - "true==1", - "false==0", - "(!(true))=='x'", - "oops==false", - "oops==!false", - "%(culture) == 'english'", - "'%(culture) fries' == 'english fries' ", - @"'%(HintPath)' == 'c:\myassemblies\foo.dll'", - @"%(HintPath) == 'c:\myassemblies\foo.dll'", - "exists('')", - "exists(' ')", - "exists($(nonexistent))", // DDB #141195 - "exists('$(nonexistent)')", // DDB #141195 - "exists(@(nonexistent))", // DDB #141195 - "exists('@(nonexistent)')", // DDB #141195 - "exists('\t')", - "exists('@(u)')", - "exists('$(foo_apos_foo)')", - "!exists('a')", - "!!!exists(a)", - @"hastrailingslash('foo')", - @"hastrailingslash('')", - @"HasTrailingSlash($(nonexistent))", - "'59264.59264' == '59264.59265'", - "1" + new String('0', 500) + "==2", /* too big for double, eval as string */ - "'1" + new String('0', 500) + "'=='2'", /* too big for double, eval as string */ - "'1" + new String('0', 500) + "'=='01" + new String('0', 500) + "'" /* too big for double, eval as string */ - }; - - string[] errorTests = { - "$", - "$(", - "$()", - "@", - "@(", - "@()", - "%", - "%(", - "%()", - "exists", - "exists(", - "exists()", - "exists( )", - "exists(,)", - "@(x->'", - "@(x->''", - "@(x-", - "@(x->'x','", - "@(x->'x',''", - "@(x->'x','')", - "-1>x", - "%00", - "\n", - "\t", - "+-1==1", - "1==-+1", - "1==+0xa", - "!$(c)", - "'a'==('a'=='a')", - "'a'!=('a'=='a')", - "('a'=='a')!=a", - "('a'=='a')==a", - "!'x'", - "!'$(d)'", - "ab#==ab#", - "#!=#", - "$(d)$(e)=='xxxxxx'", - "1=1=1", - "'a'=='a'=='a'", - "1 > 'x'", - "x1<=1", - "1<=x", - "1>x", - "xx", - "x>=x", - "x<=x", - "x>1", - "x>=1", - "1>=x", - "@(y)<=1", - "1<=@(z)", - "1>$(d)", - "$(c)@(y)>1", - "'$(c)@(y)'>1", - "$(d)>=1", - "1>=$(b)", - "1> =0", - "or true", - "1 and", - "and", - "or", - "not", - "not true", - "()", - "(a)", - "!", - "or=or", - "1==", - "1= =1", - "=", - "'true", - "'false''", - "'a'=='a", - "('a'=='a'", - "('a'=='a'))", - "'a'=='a')", - "!and", - "@(a)@(x)!=1", - "@(a) @(x)!=1", - "$(a==off", - "=='x'", - "==", - "!0", - ">", - "true!=false==", - "true!=false==true", - "()", - "!1", - "1==(2", - "$(a)==x>1==2", - "'a'>'a'", - "0", - "$(a)>0", - "!$(e)", - "1<=1<=1", - "true $(and) true", - "--1==1", - "$(and)==and", - "!@#$%^&*", - "-($(c))==-1", - "a==b or $(d)", - "false or $()", - "$(d) or true", - "%(Culture) or true", - "@(nonexistent) and true", - "$(nonexistent) and true", - "@(nonexistent)", - "$(nonexistent)", - "@(z) and true", - "@() and true", - "@()", - "$()", - "1", - "1 or true", - "false or 1", - "1 and true", - "true and 1", - "!1", - "false or !1", - "false or 'aa'", - "true blah", - "existsX", - "!", - "nonexistentfunction('xyz')", - "exists('a;b')", /* non scalar */ - "exists(@(z))", - "exists('@(z)')", - "exists($(a_semi_b))", - "exists('$(a_semi_b)')", - "exists(@(v)x)", - "exists(@(v)$(nonexistent))", - "exists('@(v)$(a)')", - "HasTrailingSlash(a,'b')", - "HasTrailingSlash(,,)" - }; - - for (int i = 0; i < trueTests.GetLength(0); i++) - { - tree = p.Parse(trueTests[i], DummyAttribute, ParserOptions.AllowAll); - ConditionEvaluationState state = new ConditionEvaluationState(DummyAttribute, expander, null, trueTests[i]); - Assertion.Assert("expected true from '" + trueTests[i] + "'", tree.Evaluate(state)); - } - - for (int i = 0; i < falseTests.GetLength(0); i++) - { - tree = p.Parse(falseTests[i], DummyAttribute, ParserOptions.AllowAll); - ConditionEvaluationState state = new ConditionEvaluationState(DummyAttribute, expander, null, falseTests[i]); - Assertion.Assert("expected false from '" + falseTests[i] + "' and got true", !tree.Evaluate(state)); - } - - for (int i = 0; i < errorTests.GetLength(0); i++) - { - // It seems that if an expression is invalid, - // - Parse may throw, or - // - Evaluate may throw, or - // - Evaluate may return false causing its caller EvaluateCondition to throw - bool success = true; - bool caughtException = false; - bool value; - try - { - tree = p.Parse(errorTests[i], DummyAttribute, ParserOptions.AllowAll); - ConditionEvaluationState state = new ConditionEvaluationState(DummyAttribute, expander, null, errorTests[i]); - value = tree.Evaluate(state); - if (!success) Console.WriteLine(errorTests[i] + " caused Evaluate to return false"); - } - catch (InvalidProjectFileException ex) - { - Console.WriteLine(errorTests[i] + " caused '" + ex.Message + "'"); - caughtException = true; - } - Assertion.Assert("expected '" + errorTests[i] + "' to not parse or not be evaluated", - (success == false || caughtException == true)); - - } - } - finally - { - foreach (string file in files) - { - if (File.Exists(file)) File.Delete(file); - } - } - } - - - /// - /// - /// DavidLe - [Test] - public void EqualityTests() - { - Parser p = new Parser(); - Expander expander = new Expander(new BuildPropertyGroup()); - Hashtable conditionedProperties = null; - ConditionEvaluationState state = new ConditionEvaluationState(DummyAttribute, expander, conditionedProperties, string.Empty); - - AssertParseEvaluate(p, "true == on", state, true); - AssertParseEvaluate(p, "TrUe == On", state, true); - AssertParseEvaluate(p, "true != false", state, true); - AssertParseEvaluate(p, "true==!false", state, true); - AssertParseEvaluate(p, "4 != 5", state, true); - AssertParseEvaluate(p, "-4 < 4", state, true); - AssertParseEvaluate(p, "5 == +5", state, true); - AssertParseEvaluate(p, "4 == 4.0", state, true); - AssertParseEvaluate(p, "4 == 4.0", state, true); - AssertParseEvaluate(p, ".45 == '.45'", state, true); - AssertParseEvaluate(p, "4 == '4'", state, true); - AssertParseEvaluate(p, "'0' == '4'", state, false); - AssertParseEvaluate(p, "4 == 0x0004", state, true); - AssertParseEvaluate(p, "0.0 == 0", state, true); - AssertParseEvaluate(p, "simplestring == 'simplestring'", state, true); - } - - /// - /// - /// DavidLe - [Test] - public void RelationalTests() - { - Parser p = new Parser(); - Expander expander = new Expander(new BuildPropertyGroup()); - Hashtable conditionedProperties = null; - ConditionEvaluationState state = new ConditionEvaluationState(DummyAttribute, expander, conditionedProperties, string.Empty); - - AssertParseEvaluate(p, "1234 < 1235", state, true); - AssertParseEvaluate(p, "1234 <= 1235", state, true); - AssertParseEvaluate(p, "1235 < 1235", state, false); - AssertParseEvaluate(p, "1234 <= 1234", state, true); - AssertParseEvaluate(p, "1235 <= 1234", state, false); - AssertParseEvaluate(p, "1235 > 1234", state, true); - AssertParseEvaluate(p, "1235 >= 1235", state, true); - AssertParseEvaluate(p, "1235 >= 1234", state, true); - AssertParseEvaluate(p, "0.0==0", state, true);} - - /// - /// - /// DavidLe - [Test] - public void AndandOrTests() - { - Parser p = new Parser(); - Expander expander = new Expander(new BuildPropertyGroup()); - Hashtable conditionedProperties = null; - ConditionEvaluationState state = new ConditionEvaluationState(DummyAttribute, expander, conditionedProperties, string.Empty); - - AssertParseEvaluate(p, "true == on and 1234 < 1235", state, true);} - - /// - /// - /// DavidLe - [Test] - public void FunctionTests() - { - Parser p = new Parser(); - GenericExpressionNode tree; - Expander expander = new Expander(new BuildPropertyGroup()); - Hashtable conditionedProperties = null; - ConditionEvaluationState state = new ConditionEvaluationState(DummyAttribute, expander, conditionedProperties, string.Empty); - bool value; - - string fileThatMustAlwaysExist = Path.GetTempFileName(); - File.WriteAllText(fileThatMustAlwaysExist, "foo"); - string command = "Exists('" + fileThatMustAlwaysExist + "')"; - tree = p.Parse(command, DummyAttribute, ParserOptions.AllowAll); - value = tree.Evaluate(state); - Assertion.Assert(value); - - if (File.Exists(fileThatMustAlwaysExist)) - { - File.Delete(fileThatMustAlwaysExist); - } - - AssertParseEvaluate(p, "Exists('c:\\IShouldntExist.sys')", state, false); - } - - /// - /// - /// DavidLe - [Test] - public void PropertyTests() - { - Parser p = new Parser(); - Hashtable conditionedProperties = null; - - BuildPropertyGroup propertyBag = new BuildPropertyGroup(); - propertyBag.SetProperty("foo", "true"); - propertyBag.SetProperty("bar", "yes"); - propertyBag.SetProperty("one", "1"); - propertyBag.SetProperty("onepointzero", "1.0"); - propertyBag.SetProperty("two", "2"); - propertyBag.SetProperty("simple", "simplestring"); - propertyBag.SetProperty("complex", "This is a complex string"); - propertyBag.SetProperty("c1", "Another (complex) one."); - propertyBag.SetProperty("c2", "Another (complex) one."); - propertyBag.SetProperty("x86", "x86"); - propertyBag.SetProperty("no", "no"); - - Expander expander = new Expander(propertyBag); - ConditionEvaluationState state = new ConditionEvaluationState(DummyAttribute, expander, conditionedProperties, string.Empty); - - AssertParseEvaluate(p, "$(foo)", state, true); - AssertParseEvaluate(p, "!$(foo)", state, false); - // Test properties with strings - AssertParseEvaluate(p, "$(simple) == 'simplestring'", state, true); - AssertParseEvaluate(p, "'simplestring' == $(simple)", state, true); - AssertParseEvaluate(p, "'foobar' != $(simple)", state, true); - AssertParseEvaluate(p, "'simplestring' == '$(simple)'", state, true); - AssertParseEvaluate(p, "$(simple) == simplestring", state, true); - AssertParseEvaluate(p, "$(x86) == x86", state, true); - AssertParseEvaluate(p, "$(x86)==x86", state, true); - AssertParseEvaluate(p, "x86==$(x86)", state, true); - AssertParseEvaluate(p, "$(c1) == $(c2)", state, true); - AssertParseEvaluate(p, "'$(c1)' == $(c2)", state, true); - AssertParseEvaluate(p, "$(c1) != $(simple)", state, true); - AssertParseEvaluate(p, "$(c1) == $(c2)", state, true); - // Test properties with numbers - AssertParseEvaluate(p, "$(one) == $(onepointzero)", state, true); - AssertParseEvaluate(p, "$(one) <= $(two)", state, true); - AssertParseEvaluate(p, "$(two) > $(onepointzero)", state, true); - AssertParseEvaluate(p, "$(one) != $(two)", state, true); - AssertParseEvaluate(p, "'$(no)'==false", state, true);} - - /// - /// - /// DavidLe - [Test] - public void ItemListTests() - { - Parser p = new Parser(); - Hashtable conditionedProperties = null; - - BuildItemGroup myCompileItemGroup = new BuildItemGroup(); - myCompileItemGroup.AddItem(new BuildItem("Compile", "foo.cs")); - myCompileItemGroup.AddItem(new BuildItem("Compile", "bar.cs")); - myCompileItemGroup.AddItem(new BuildItem("Compile", "baz.cs")); - - BuildItemGroup myBooleanItemGroup = new BuildItemGroup(); - myBooleanItemGroup.AddItem(new BuildItem("Boolean", "true")); - - Hashtable itemsByType = new Hashtable(StringComparer.OrdinalIgnoreCase); - itemsByType["Compile"] = myCompileItemGroup; - itemsByType["Boolean"] = myBooleanItemGroup; - - Expander expander = new Expander(LookupHelpers.CreateLookup(itemsByType).ReadOnlyLookup); - ConditionEvaluationState state = new ConditionEvaluationState(DummyAttribute, expander, conditionedProperties, string.Empty); - - AssertParseEvaluate(p, "@(Compile) == 'foo.cs;bar.cs;baz.cs'", state, true); - AssertParseEvaluate(p, "@(Compile,' ') == 'foo.cs bar.cs baz.cs'", state, true); - AssertParseEvaluate(p, "@(Compile,'') == 'foo.csbar.csbaz.cs'", state, true); - AssertParseEvaluate(p, "@(Compile->'%(Filename)') == 'foo;bar;baz'", state, true); - AssertParseEvaluate(p, "@(Compile -> 'temp\\%(Filename).xml', ' ') == 'temp\\foo.xml temp\\bar.xml temp\\baz.xml'", state, true); - AssertParseEvaluate(p, "@(Compile->'', '') == ''", state, true); - AssertParseEvaluate(p, "@(Compile->'') == ';;'", state, true); - AssertParseEvaluate(p, "@(Compile->'%(Nonexistent)', '') == ''", state, true); - AssertParseEvaluate(p, "@(Compile->'%(Nonexistent)') == ';;'", state, true); - AssertParseEvaluate(p, "@(Boolean)", state, true); - AssertParseEvaluate(p, "@(Boolean) == true", state, true); - AssertParseEvaluate(p, "'@(Empty, ';')' == ''", state, true);} - - /// - /// - /// DavidLe - [Test] - public void StringExpansionTests() - { - Parser p = new Parser(); - BuildPropertyGroup propertyBag = new BuildPropertyGroup(); - Hashtable conditionedProperties = null; - - BuildItemGroup myNewItemGroup = new BuildItemGroup(); - myNewItemGroup.AddItem(new BuildItem("Compile", "foo.cs")); - myNewItemGroup.AddItem(new BuildItem("Compile", "bar.cs")); - myNewItemGroup.AddItem(new BuildItem("Compile", "baz.cs")); - Hashtable itemBag = new Hashtable(StringComparer.OrdinalIgnoreCase); - itemBag["COMPILE"] = myNewItemGroup; - - propertyBag = new BuildPropertyGroup(); - propertyBag.SetProperty("foo", "true"); - propertyBag.SetProperty("bar", "yes"); - propertyBag.SetProperty("one", "1"); - propertyBag.SetProperty("onepointzero", "1.0"); - propertyBag.SetProperty("two", "2"); - propertyBag.SetProperty("simple", "simplestring"); - propertyBag.SetProperty("complex", "This is a complex string"); - propertyBag.SetProperty("c1", "Another (complex) one."); - propertyBag.SetProperty("c2", "Another (complex) one."); - propertyBag.SetProperty("TestQuote", "Contains'Quote'"); - propertyBag.SetProperty("AnotherTestQuote", "Here's Johnny!"); - propertyBag.SetProperty("Atsign", "Test the @ replacement"); - - Expander expander = new Expander(propertyBag, itemBag); - ConditionEvaluationState state = new ConditionEvaluationState(DummyAttribute, expander, conditionedProperties, string.Empty); - - AssertParseEvaluate(p, "'simplestring: true foo.cs;bar.cs;baz.cs' == '$(simple): $(foo) @(compile)'", state, true); - AssertParseEvaluate(p, "'$(c1) $(c2)' == 'Another (complex) one. Another (complex) one.'", state, true); - AssertParseEvaluate(p, "'CONTAINS%27QUOTE%27' == '$(TestQuote)'", state, true); - AssertParseEvaluate(p, "'Here%27s Johnny!' == '$(AnotherTestQuote)'", state, true); - AssertParseEvaluate(p, "'Test the %40 replacement' == $(Atsign)", state, true);} - - /// - /// - /// DavidLe - [Test] - public void ComplexTests() - { - Parser p = new Parser(); - BuildPropertyGroup propertyBag = new BuildPropertyGroup(); - Hashtable conditionedProperties = null; - - BuildItemGroup myNewItemGroup = new BuildItemGroup(); - myNewItemGroup.AddItem(new BuildItem("Compile", "foo.cs")); - myNewItemGroup.AddItem(new BuildItem("Compile", "bar.cs")); - myNewItemGroup.AddItem(new BuildItem("Compile", "baz.cs")); - Hashtable itemBag = new Hashtable(StringComparer.OrdinalIgnoreCase); - itemBag["COMPILE"] = myNewItemGroup; - - propertyBag = new BuildPropertyGroup(); - propertyBag.SetProperty("foo", "true"); - propertyBag.SetProperty("bar", "yes"); - propertyBag.SetProperty("one", "1"); - propertyBag.SetProperty("onepointzero", "1.0"); - propertyBag.SetProperty("two", "2"); - propertyBag.SetProperty("simple", "simplestring"); - propertyBag.SetProperty("complex", "This is a complex string"); - propertyBag.SetProperty("c1", "Another (complex) one."); - propertyBag.SetProperty("c2", "Another (complex) one."); - - Expander expander = new Expander(propertyBag, itemBag); - ConditionEvaluationState state = new ConditionEvaluationState(DummyAttribute, expander, conditionedProperties, string.Empty); - - AssertParseEvaluate(p, "(($(foo) != 'two' and $(bar)) and 5 >= 1) or $(one) == 1", state, true); - AssertParseEvaluate(p, "(($(foo) != 'twoo' or !$(bar)) and 5 >= 1) or $(two) == 1", state, true); - AssertParseEvaluate(p, "!((($(foo) != 'twoo' or !$(bar)) and 5 >= 1) or $(two) == 1)", state, false);} - - /// - /// - /// DavidLe - [Test] - public void OldSyntaxTests() - { - Parser p = new Parser(); - BuildPropertyGroup propertyBag = new BuildPropertyGroup(); - Hashtable conditionedProperties = null; - - BuildItemGroup myNewItemGroup = new BuildItemGroup(); - myNewItemGroup.AddItem(new BuildItem("Compile", "foo.cs")); - myNewItemGroup.AddItem(new BuildItem("Compile", "bar.cs")); - myNewItemGroup.AddItem(new BuildItem("Compile", "baz.cs")); - Hashtable itemBag = new Hashtable(StringComparer.OrdinalIgnoreCase); - itemBag["COMPILE"] = myNewItemGroup; - - propertyBag = new BuildPropertyGroup(); - propertyBag.SetProperty("foo", "true"); - propertyBag.SetProperty("bar", "yes"); - propertyBag.SetProperty("one", "1"); - propertyBag.SetProperty("onepointzero", "1.0"); - propertyBag.SetProperty("two", "2"); - propertyBag.SetProperty("simple", "simplestring"); - propertyBag.SetProperty("complex", "This is a complex string"); - propertyBag.SetProperty("c1", "Another (complex) one."); - propertyBag.SetProperty("c2", "Another (complex) one."); - - Expander expander = new Expander(propertyBag, itemBag); - ConditionEvaluationState state = new ConditionEvaluationState(DummyAttribute, expander, conditionedProperties, string.Empty); - - AssertParseEvaluate(p, "(($(foo) != 'two' and $(bar)) and 5 >= 1) or $(one) == 1", state, true);} - - /// - /// - /// DavidLe - [Test] - public void ConditionedPropertyUpdateTests() - { - Parser p = new Parser(); - BuildPropertyGroup propertyBag = new BuildPropertyGroup(); - Hashtable conditionedProperties = new Hashtable(StringComparer.OrdinalIgnoreCase); - - BuildItemGroup myNewItemGroup = new BuildItemGroup(); - myNewItemGroup.AddItem(new BuildItem("Compile", "foo.cs")); - myNewItemGroup.AddItem(new BuildItem("Compile", "bar.cs")); - myNewItemGroup.AddItem(new BuildItem("Compile", "baz.cs")); - Hashtable itemBag = new Hashtable(StringComparer.OrdinalIgnoreCase); - itemBag["Compile"] = myNewItemGroup; - - Expander expander = new Expander(LookupHelpers.CreateLookup(itemBag).ReadOnlyLookup); - ConditionEvaluationState state = new ConditionEvaluationState(DummyAttribute, expander, conditionedProperties, string.Empty); - - StringCollection sc; - AssertParseEvaluate(p, "'0' == '1'", state, false); - Assertion.Assert(conditionedProperties.Count == 0); - - AssertParseEvaluate(p, "$(foo) == foo", state, false); - Assertion.Assert(conditionedProperties.Count == 1); - sc = (StringCollection)conditionedProperties["foo"]; - Assertion.Assert(sc.Count == 1); - - AssertParseEvaluate(p, "'$(foo)' != 'bar'", state, true); - Assertion.Assert(conditionedProperties.Count == 1); - sc = (StringCollection)conditionedProperties["foo"]; - Assertion.Assert(sc.Count == 2); - - AssertParseEvaluate(p, "'$(branch)|$(build)|$(platform)' == 'lab22dev|debug|x86'", state, false); - Assertion.Assert(conditionedProperties.Count == 4); - sc = (StringCollection)conditionedProperties["foo"]; - Assertion.Assert(sc.Count == 2); - sc = (StringCollection)conditionedProperties["branch"]; - Assertion.Assert(sc.Count == 1); - sc = (StringCollection)conditionedProperties["build"]; - Assertion.Assert(sc.Count == 1); - sc = (StringCollection)conditionedProperties["platform"]; - Assertion.Assert(sc.Count == 1); - - AssertParseEvaluate(p, "'$(branch)|$(build)|$(platform)' == 'lab21|debug|x86'", state, false); - Assertion.Assert(conditionedProperties.Count == 4); - sc = (StringCollection)conditionedProperties["foo"]; - Assertion.Assert(sc.Count == 2); - sc = (StringCollection)conditionedProperties["branch"]; - Assertion.Assert(sc.Count == 2); - sc = (StringCollection)conditionedProperties["build"]; - Assertion.Assert(sc.Count == 1); - sc = (StringCollection)conditionedProperties["platform"]; - Assertion.Assert(sc.Count == 1); - - AssertParseEvaluate(p, "'$(branch)|$(build)|$(platform)' == 'lab23|retail|ia64'", state, false); - Assertion.Assert(conditionedProperties.Count == 4); - sc = (StringCollection)conditionedProperties["foo"]; - Assertion.Assert(sc.Count == 2); - sc = (StringCollection)conditionedProperties["branch"]; - Assertion.Assert(sc.Count == 3); - sc = (StringCollection)conditionedProperties["build"]; - Assertion.Assert(sc.Count == 2); - sc = (StringCollection)conditionedProperties["platform"]; - Assertion.Assert(sc.Count == 2); - DumpHashtable(conditionedProperties); - } - - private static void DumpHashtable(Hashtable ht) - { - foreach (DictionaryEntry entry in ht) - { - Console.Write(" {0}:\t", entry.Key); - - StringCollection sc = (StringCollection)entry.Value; - StringEnumerator scEnumerator = sc.GetEnumerator(); - while (scEnumerator.MoveNext()) - Console.Write("{0}, ", scEnumerator.Current); - - Console.WriteLine(); - } - } - - /// - /// - /// DavidLe - [Test] - public void NotTests() - { - Console.WriteLine("NegationParseTest()"); - Parser p = new Parser(); - Hashtable conditionedProperties = null; - - BuildPropertyGroup propertyBag = new BuildPropertyGroup(); - propertyBag.SetProperty("foo", "4"); - propertyBag.SetProperty("bar", "32"); - - Expander expander = new Expander(propertyBag); - ConditionEvaluationState state = new ConditionEvaluationState(DummyAttribute, expander, conditionedProperties, string.Empty); - - AssertParseEvaluate(p, "!true", state, false); - AssertParseEvaluate(p, "!(true)", state, false); - AssertParseEvaluate(p, "!($(foo) <= 5)", state, false); - AssertParseEvaluate(p, "!($(foo) <= 5 and $(bar) >= 15)", state, false); - } - - private void AssertParseEvaluateThrow(Parser p, string expression, ConditionEvaluationState state) - { - bool fExceptionCaught; - - try - { - fExceptionCaught = false; - GenericExpressionNode tree = p.Parse(expression, DummyAttribute, ParserOptions.AllowAll); - state.parsedCondition = expression; - tree.Evaluate(state); - } - catch (InvalidProjectFileException e) - { - Console.WriteLine(e.BaseMessage); - fExceptionCaught = true; - } - - Assertion.Assert(fExceptionCaught); - } - - /// - /// - /// DavidLe - [Test] - public void NegativeTests() - { - Parser p = new Parser(); - Expander expander = new Expander(new BuildPropertyGroup()); - Hashtable conditionedProperties = null; - ConditionEvaluationState state = new ConditionEvaluationState(DummyAttribute, expander, conditionedProperties, string.Empty); - - AssertParseEvaluateThrow(p, "foobar", state); - AssertParseEvaluateThrow(p, "0", state); - AssertParseEvaluateThrow(p, "$(platform) == xx > 1==2", state); - AssertParseEvaluateThrow(p, "!0", state); - AssertParseEvaluateThrow(p, ">", state); - AssertParseEvaluateThrow(p, "true!=false==", state); - AssertParseEvaluateThrow(p, "()", state); - AssertParseEvaluateThrow(p, "!1", state); - AssertParseEvaluateThrow(p, "true!=false==true", state); - AssertParseEvaluateThrow(p, "'a'>'a'", state); - AssertParseEvaluateThrow(p, "=='x'", state); - AssertParseEvaluateThrow(p, "==", state); - AssertParseEvaluateThrow(p, "1==(2", state); - AssertParseEvaluateThrow(p, "'a'==('a'=='a')", state); - AssertParseEvaluateThrow(p, "true == on and ''", state); - AssertParseEvaluateThrow(p, "'' or 'true'", state); - } - } -} - - diff --git a/src/Deprecated/Engine.UnitTests/FileLogger_Tests.cs b/src/Deprecated/Engine.UnitTests/FileLogger_Tests.cs deleted file mode 100644 index c688bd3e4b8..00000000000 --- a/src/Deprecated/Engine.UnitTests/FileLogger_Tests.cs +++ /dev/null @@ -1,449 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.IO; -using System.Collections.Generic; -using System.Text; - -using NUnit.Framework; - -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class FileLogger_Tests - { - /// - /// Basic test of the file logger. Writes to a log file in the temp directory. - /// - /// RGoel - [Test] - public void Basic() - { - FileLogger fileLogger = new FileLogger(); - string logFile = Path.GetTempFileName(); - fileLogger.Parameters = "verbosity=Normal;logfile=" + logFile; - - Project project = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - ", fileLogger); - - project.Build(); - - project.ParentEngine.UnregisterAllLoggers(); - - string log = File.ReadAllText(logFile); - Assertion.Assert("Log should have contained message", log.Contains("Hello world from the FileLogger")); - - File.Delete(logFile); - } - - /// - /// Basic case of logging a message to a file - /// Verify it logs and encoding is ANSI - /// - [Test] - public void BasicNoExistingFile() - { - string log = null; - - try - { - log = GetTempFilename(); - SetUpFileLoggerAndLogMessage("logfile=" + log, new BuildMessageEventArgs("message here", null, null, MessageImportance.High)); - VerifyFileContent(log, "message here"); - - // Verify no BOM (ANSI encoding) - byte[] content = ReadRawBytes(log); - Assertion.AssertEquals((byte)109, content[0]); // 'm' - } - finally - { - if (null != log) File.Delete(log); - } - } - - /// - /// Invalid file should error nicely - /// - [Test] - [ExpectedException(typeof(LoggerException))] - public void InvalidFile() - { - string log = null; - - try - { - SetUpFileLoggerAndLogMessage("logfile=||invalid||", new BuildMessageEventArgs("message here", null, null, MessageImportance.High)); - } - finally - { - if (null != log) File.Delete(log); - } - } - - /// - /// Specific verbosity overrides global verbosity - /// - [Test] - public void SpecificVerbosity() - { - string log = null; - - try - { - log = GetTempFilename(); - FileLogger fl = new FileLogger(); - EventSource es = new EventSource(); - fl.Parameters = "verbosity=diagnostic;logfile=" + log; // diagnostic specific setting - fl.Verbosity = LoggerVerbosity.Quiet ; // quiet global setting - fl.Initialize(es); - fl.MessageHandler(null, new BuildMessageEventArgs("message here", null, null, MessageImportance.High)); - fl.Shutdown(); - - // expect message to appear because diagnostic not quiet verbosity was used - VerifyFileContent(log, "message here"); - } - finally - { - if (null != log) File.Delete(log); - } - } - - /// - /// Test the short hand verbosity settings for the file logger - /// - [Test] - public void ValidVerbosities() - { - string[] verbositySettings = new string[] {"Q", "quiet", "m", "minimal", "N", "normal", "d", "detailed", "diag", "DIAGNOSTIC"}; - LoggerVerbosity[] verbosityEnumerations = new LoggerVerbosity[] {LoggerVerbosity.Quiet, LoggerVerbosity.Quiet, - LoggerVerbosity.Minimal, LoggerVerbosity.Minimal, - LoggerVerbosity.Normal, LoggerVerbosity.Normal, - LoggerVerbosity.Detailed, LoggerVerbosity.Detailed, - LoggerVerbosity.Diagnostic, LoggerVerbosity.Diagnostic}; - for (int i = 0; i < verbositySettings.Length; i++) - { - FileLogger fl = new FileLogger(); - fl.Parameters = "verbosity=" + verbositySettings[i] + ";"; - EventSource es = new EventSource(); - fl.Initialize(es); - fl.Shutdown(); - Assertion.AssertEquals(fl.Verbosity, verbosityEnumerations[i]); - } - - // Do the same using the v shorthand - for (int i = 0; i < verbositySettings.Length; i++) - { - FileLogger fl = new FileLogger(); - fl.Parameters = "v=" + verbositySettings[i] + ";"; - EventSource es = new EventSource(); - fl.Initialize(es); - fl.Shutdown(); - Assertion.AssertEquals(fl.Verbosity, verbosityEnumerations[i]); - } - } - - /// - /// Invalid verbosity setting - /// - [Test] - [ExpectedException(typeof(LoggerException))] - public void InvalidVerbosity() - { - FileLogger fl = new FileLogger(); - fl.Parameters = "verbosity=CookiesAndCream"; - EventSource es = new EventSource(); - fl.Initialize(es); - } - - /// - /// Invalid encoding setting - /// - [Test] - [ExpectedException(typeof(LoggerException))] - public void InvalidEncoding() - { - string log = null; - - try - { - log = GetTempFilename(); - FileLogger fl = new FileLogger(); - EventSource es = new EventSource(); - fl.Parameters = "encoding=foo;logfile=" + log; - fl.Initialize(es); - } - finally - { - if (null != log) File.Delete(log); - } - } - - - /// - /// Valid encoding setting - /// - [Test] - public void ValidEncoding() - { - string log = null; - - try - { - log = GetTempFilename(); - SetUpFileLoggerAndLogMessage("encoding=utf-16;logfile=" + log, new BuildMessageEventArgs("message here", null, null, MessageImportance.High)); - byte[] content = ReadRawBytes(log); - - // FF FE is the BOM for UTF16 - Assertion.AssertEquals((byte)255, content[0]); - Assertion.AssertEquals((byte)254, content[1]); - } - finally - { - if (null != log) File.Delete(log); - } - } - - /// - /// Valid encoding setting - /// - [Test] - public void ValidEncoding2() - { - string log = null; - - try - { - log = GetTempFilename(); - SetUpFileLoggerAndLogMessage("encoding=utf-8;logfile=" + log, new BuildMessageEventArgs("message here", null, null, MessageImportance.High)); - byte[] content = ReadRawBytes(log); - - // EF BB BF is the BOM for UTF8 - Assertion.AssertEquals((byte)239, content[0]); - Assertion.AssertEquals((byte)187, content[1]); - Assertion.AssertEquals((byte)191, content[2]); - } - finally - { - if (null != log) File.Delete(log); - } - } - - /// - /// Read the raw byte content of a file - /// - /// - /// - private byte[] ReadRawBytes(string log) - { - byte[] content; - using (FileStream stream = new FileStream(log, FileMode.Open)) - { - content = new byte[stream.Length]; - - for (int i = 0; i < stream.Length; i++) - { - content[i] = (byte)stream.ReadByte(); - } - } - - return content; - } - - /// - /// Logging a message to a file that already exists should overwrite it - /// - [Test] - public void BasicExistingFileNoAppend() - { - string log = null; - - try - { - log = GetTempFilename(); - WriteContentToFile(log); - SetUpFileLoggerAndLogMessage("logfile=" + log, new BuildMessageEventArgs("message here", null, null, MessageImportance.High)); - VerifyFileContent(log, "message here"); - } - finally - { - if (null != log) File.Delete(log); - } - } - - /// - /// Logging to a file that already exists, with "append" set, should append - /// - [Test] - public void BasicExistingFileAppend() - { - string log = null; - - try - { - log = GetTempFilename(); - WriteContentToFile(log); - SetUpFileLoggerAndLogMessage("append;logfile=" + log, new BuildMessageEventArgs("message here", null, null, MessageImportance.High)); - VerifyFileContent(log, "existing content\nmessage here"); - } - finally - { - if (null != log) File.Delete(log); - } - } - - /// - /// Gets a filename for a nonexistent temporary file. - /// - /// - private string GetTempFilename() - { - string path = Path.GetTempFileName(); - File.Delete(path); - return path; - } - - /// - /// Writes a string to a file. - /// - /// - private void WriteContentToFile(string log) - { - using (StreamWriter sw = new StreamWriter(log)) - { - sw.WriteLine("existing content"); - } - } - - /// - /// Creates a FileLogger, sets its parameters and initializes it, - /// logs a message to it, and calls shutdown - /// - /// - /// - private void SetUpFileLoggerAndLogMessage(string parameters, BuildMessageEventArgs message) - { - FileLogger fl = new FileLogger(); - EventSource es = new EventSource(); - fl.Parameters = parameters; - fl.Initialize(es); - fl.MessageHandler(null, message); - fl.Shutdown(); - return; - } - - /// - /// Verifies that a file contains exactly the expected content. - /// - /// - /// - private void VerifyFileContent(string file, string expectedContent) - { - string actualContent; - using (StreamReader sr = new StreamReader(file)) - { - actualContent = sr.ReadToEnd(); - } - - string[] actualLines = actualContent.Split(new char[] { '\n' }, StringSplitOptions.RemoveEmptyEntries); - string[] expectedLines = expectedContent.Split(new char[] { '\n' }, StringSplitOptions.RemoveEmptyEntries); - - Assertion.AssertEquals(expectedLines.Length, actualLines.Length); - - for (int i = 0; i < expectedLines.Length; i++) - { - Assertion.AssertEquals(expectedLines[i].Trim(), actualLines[i].Trim()); - } - } - - #region DistributedLogger - /// - /// Check the ability of the distributed logger to correctly tell its internal file logger where to log the file - /// - [Test] - public void DistributedFileLoggerParameters() - { - DistributedFileLogger fileLogger = new DistributedFileLogger(); - try - { - fileLogger.NodeId = 0; - fileLogger.Initialize(new EventSource()); - Assert.IsTrue(string.Compare(fileLogger.InternalFilelogger.Parameters, "ForceNoAlign;ShowEventId;ShowCommandLine;logfile=msbuild0.log;", StringComparison.OrdinalIgnoreCase) == 0); - fileLogger.Shutdown(); - - fileLogger.NodeId = 3; - fileLogger.Parameters = "logfile="+Path.Combine(Environment.CurrentDirectory,"mylogfile.log"); - fileLogger.Initialize(new EventSource()); - Assert.IsTrue(string.Compare(fileLogger.InternalFilelogger.Parameters, "ForceNoAlign;ShowEventId;ShowCommandLine;logfile=" + Path.Combine(Environment.CurrentDirectory, "mylogfile3.log") + ";", StringComparison.OrdinalIgnoreCase) == 0); - fileLogger.Shutdown(); - - fileLogger.NodeId = 4; - fileLogger.Parameters = "logfile=" + Path.Combine(Environment.CurrentDirectory, "mylogfile.log"); - fileLogger.Initialize(new EventSource()); - Assert.IsTrue(string.Compare(fileLogger.InternalFilelogger.Parameters, "ForceNoAlign;ShowEventId;ShowCommandLine;logfile=" + Path.Combine(Environment.CurrentDirectory, "mylogfile4.log") + ";", StringComparison.OrdinalIgnoreCase) == 0); - fileLogger.Shutdown(); - - Directory.CreateDirectory(Path.Combine(Environment.CurrentDirectory, "tempura")); - fileLogger.NodeId = 1; - fileLogger.Parameters = "logfile=" + Path.Combine(Environment.CurrentDirectory, "tempura\\mylogfile.log"); - fileLogger.Initialize(new EventSource()); - Assert.IsTrue(string.Compare(fileLogger.InternalFilelogger.Parameters, "ForceNoAlign;ShowEventId;ShowCommandLine;logfile=" + Path.Combine(Environment.CurrentDirectory, "tempura\\mylogfile1.log") + ";", StringComparison.OrdinalIgnoreCase) == 0); - fileLogger.Shutdown(); - } - finally - { - if (Directory.Exists(Path.Combine(Environment.CurrentDirectory, "tempura"))) - { - File.Delete(Path.Combine(Environment.CurrentDirectory, "tempura\\mylogfile1.log")); - Directory.Delete(Path.Combine(Environment.CurrentDirectory, "tempura")); - } - File.Delete(Path.Combine(Environment.CurrentDirectory, "mylogfile0.log")); - File.Delete(Path.Combine(Environment.CurrentDirectory, "mylogfile3.log")); - File.Delete(Path.Combine(Environment.CurrentDirectory, "mylogfile4.log")); - } - } - - [Test] - [ExpectedException(typeof(LoggerException))] - public void DistributedLoggerBadPath() - { - DistributedFileLogger fileLogger = new DistributedFileLogger(); - fileLogger.NodeId = 0; - fileLogger.Initialize(new EventSource()); - - fileLogger.NodeId = 1; - fileLogger.Parameters = "logfile=" + Path.Combine(Environment.CurrentDirectory, "\\DONTEXIST\\mylogfile.log"); - fileLogger.Initialize(new EventSource()); - Assert.IsTrue(string.Compare(fileLogger.InternalFilelogger.Parameters, ";ShowCommandLine;logfile=" + Path.Combine(Environment.CurrentDirectory, "\\DONTEXIST\\mylogfile2.log"), StringComparison.OrdinalIgnoreCase) == 0); - } - - [Test] - [ExpectedException(typeof(LoggerException))] - public void DistributedLoggerNullEmpty() - { - DistributedFileLogger fileLogger = new DistributedFileLogger(); - fileLogger.NodeId = 0; - fileLogger.Initialize(new EventSource()); - - fileLogger.NodeId = 1; - fileLogger.Parameters = "logfile="; - fileLogger.Initialize(new EventSource()); - Assert.Fail(); - } - #endregion - - } -} diff --git a/src/Deprecated/Engine.UnitTests/GroupingCollection_Tests.cs b/src/Deprecated/Engine.UnitTests/GroupingCollection_Tests.cs deleted file mode 100644 index b5b967ff15b..00000000000 --- a/src/Deprecated/Engine.UnitTests/GroupingCollection_Tests.cs +++ /dev/null @@ -1,268 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Globalization; -using System.Reflection; -using NUnit.Framework; -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine; - - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class GroupingCollectionTest - { - private BuildPropertyGroup pg1; - private BuildPropertyGroup pg2; - private BuildPropertyGroup pg3; - - private Choose choose1; - private Choose choose2; - private Choose choose3; - - private BuildItemGroup ig1; - private BuildItemGroup ig2; - private BuildItemGroup ig3; - - private void SetupMembers() - { - pg1 = new BuildPropertyGroup(); - pg1.SetProperty("foo", "bar"); - pg1.SetProperty("abc", "true"); - pg1.SetProperty("Unit", "inches"); - - pg2 = new BuildPropertyGroup(); - pg2.SetProperty("foo", "bar"); - pg2.SetProperty("abc", "true"); - - pg3 = new BuildPropertyGroup(); - - // These Choose objects are only suitable for - // holding a place in the GroupingCollection. - choose1 = new Choose(); - choose2 = new Choose(); - choose3 = new Choose(); - - ig1 = new BuildItemGroup(); - ig1.AddNewItem("x", "x1"); - ig1.AddNewItem("x", "x2"); - ig1.AddNewItem("y", "y1"); - ig1.AddNewItem("y", "y2"); - ig1.AddNewItem("y", "y3"); - ig1.AddNewItem("y", "y4"); - - ig2 = new BuildItemGroup(); - ig2.AddNewItem("jacksonfive", "germaine"); - ig2.AddNewItem("jacksonfive", "tito"); - ig2.AddNewItem("jacksonfive", "michael"); - ig2.AddNewItem("jacksonfive", "latoya"); - ig2.AddNewItem("jacksonfive", "janet"); - - ig3 = new BuildItemGroup(); - } - - private void AssertNPropertyGroupsInCollection(GroupingCollection group, int n) - { - int count; - count = 0; - foreach (IItemPropertyGrouping pg in new GroupEnumeratorHelper(group, GroupEnumeratorHelper.ListType.PropertyGroupsAll)) - { - count++; - } - Assertion.AssertEquals(n, count); - // PropertyGroupCount uses a different mechanism to obtain the total count, so verify it as well - Assertion.AssertEquals(n, group.PropertyGroupCount); - } - - private void AssertNItemGroupsInCollection(GroupingCollection group, int n) - { - int count; - count = 0; - foreach (IItemPropertyGrouping pg in new GroupEnumeratorHelper(group, GroupEnumeratorHelper.ListType.ItemGroupsAll)) - { - count++; - } - Assertion.AssertEquals(n, count); - // ItemGroupCount uses a different mechanism to obtain the total count, so verify it as well - Assertion.AssertEquals(n, group.ItemGroupCount); - } - - private void AssertNPropertyGroupsAndChoosesInCollection(GroupingCollection group, int n) - { - int count; - count = 0; - foreach (IItemPropertyGrouping pg in new GroupEnumeratorHelper(group, GroupEnumeratorHelper.ListType.PropertyGroupsTopLevelAndChoose)) - { - count++; - } - Assertion.AssertEquals(n, count); - } - - private void AssertNItemGroupsAndChoosesInCollection(GroupingCollection group, int n) - { - int count; - count = 0; - foreach (IItemPropertyGrouping pg in new GroupEnumeratorHelper(group, GroupEnumeratorHelper.ListType.ItemGroupsTopLevelAndChoose)) - { - count++; - } - Assertion.AssertEquals(n, count); - } - - /// - /// - /// DavidLe - [Test] - public void EnumerationTest() - { - SetupMembers(); - GroupingCollection group = new GroupingCollection(null); - group.InsertAtEnd(this.pg1); - group.InsertAtEnd(this.ig1); - group.InsertAtEnd(this.pg2); - group.InsertAtEnd(this.ig2); - group.InsertAtEnd(this.ig3); - - AssertNPropertyGroupsInCollection(group, 2); - Assertion.Assert(group.PropertyGroupCount == 2); - AssertNItemGroupsInCollection(group, 3); - Assertion.Assert(group.ItemGroupCount == 3); - - group.InsertAtEnd(this.choose1); - group.InsertAtEnd(this.choose2); - - AssertNPropertyGroupsInCollection(group, 2); - Assertion.Assert(group.PropertyGroupCount == 2); - AssertNItemGroupsInCollection(group, 3); - Assertion.Assert(group.ItemGroupCount == 3); - - AssertNPropertyGroupsAndChoosesInCollection(group, 4); - AssertNItemGroupsAndChoosesInCollection(group, 5); - } - - /// - /// - /// DavidLe - [Test] - public void InsertionTest() - { - SetupMembers(); - GroupingCollection group = new GroupingCollection(null); - group.InsertAtEnd(this.pg1); - group.InsertAtEnd(this.ig1); - group.InsertAtBeginning(this.pg2); - group.InsertAtEnd(this.ig2); - group.InsertAfter(this.ig3, this.ig2); - group.InsertAfter(this.pg3, this.pg2); - - AssertNPropertyGroupsInCollection(group, 3); - Assertion.Assert(group.PropertyGroupCount == 3); - AssertNItemGroupsInCollection(group, 3); - Assertion.Assert(group.ItemGroupCount == 3); - - group.InsertAtEnd(this.choose1); - group.InsertAtEnd(this.choose2); - } - - /// - /// - /// DavidLe - [Test] - public void RemoveTest() - { - SetupMembers(); - GroupingCollection group = new GroupingCollection(null); - group.InsertAtEnd(this.pg1); - group.InsertAtEnd(this.ig1); - group.InsertAtBeginning(this.pg2); - group.InsertAtEnd(this.ig2); - group.InsertAfter(this.ig3, this.ig2); - group.InsertAfter(this.pg3, this.pg2); - - AssertNPropertyGroupsInCollection(group, 3); - AssertNItemGroupsInCollection(group, 3); - - group.RemovePropertyGroup(this.pg3); - AssertNPropertyGroupsInCollection(group, 2); - AssertNItemGroupsInCollection(group, 3); - - group.RemovePropertyGroup(this.pg2); - AssertNPropertyGroupsInCollection(group, 1); - AssertNItemGroupsInCollection(group, 3); - - group.RemoveItemGroup(this.ig2); - AssertNPropertyGroupsInCollection(group, 1); - AssertNItemGroupsInCollection(group, 2); - } - - /// - /// Make sure linked property group and item group counting works correctly. - /// Parent grouping collections depend on child grouping collections to update the count for nested groups. - /// - /// LukaszG - [Test] - public void LinkedCount() - { - SetupMembers(); - GroupingCollection masterGroup = new GroupingCollection(null); - GroupingCollection childGroup1 = new GroupingCollection(masterGroup); - GroupingCollection childGroup2 = new GroupingCollection(masterGroup); - GroupingCollection nestedGroup = new GroupingCollection(childGroup1); - - nestedGroup.InsertAtEnd(this.ig1); - nestedGroup.InsertAfter(this.ig2, this.ig1); - nestedGroup.InsertAtBeginning(this.pg1); - - childGroup1.InsertAtEnd(this.ig1); - childGroup1.InsertAtBeginning(this.pg1); - - childGroup2.InsertAtBeginning(this.pg1); - - masterGroup.InsertAtEnd(this.ig1); - masterGroup.InsertAfter(this.ig2, this.ig1); - masterGroup.InsertAtEnd(this.pg2); - - Assertion.AssertEquals(nestedGroup.ItemGroupCount, 2); - Assertion.AssertEquals(nestedGroup.PropertyGroupCount, 1); - - Assertion.AssertEquals(childGroup1.ItemGroupCount, 1 + 2); - Assertion.AssertEquals(childGroup1.PropertyGroupCount, 1 + 1); - - Assertion.AssertEquals(childGroup2.ItemGroupCount, 0); - Assertion.AssertEquals(childGroup2.PropertyGroupCount, 1); - - Assertion.AssertEquals(masterGroup.ItemGroupCount, 2 + 0 + 1 + 2); - Assertion.AssertEquals(masterGroup.PropertyGroupCount, 1 + 1 + 1 + 1); - - nestedGroup.Clear(); - nestedGroup.InsertAtEnd(this.ig2); - nestedGroup.InsertAfter(this.ig3, this.ig2); - - childGroup1.RemovePropertyGroup(this.pg1); - childGroup1.RemoveItemGroup(this.ig1); - childGroup1.InsertAtEnd(this.ig3); - - childGroup2.RemovePropertyGroup(this.pg1); - - masterGroup.RemoveItemGroup(this.ig2); - - Assertion.AssertEquals(nestedGroup.ItemGroupCount, 2); - Assertion.AssertEquals(nestedGroup.PropertyGroupCount, 0); - - Assertion.AssertEquals(childGroup1.ItemGroupCount, 1 + 2); - Assertion.AssertEquals(childGroup1.PropertyGroupCount, 0 + 0); - - Assertion.AssertEquals(childGroup2.ItemGroupCount, 0); - Assertion.AssertEquals(childGroup2.PropertyGroupCount, 0); - - Assertion.AssertEquals(masterGroup.ItemGroupCount, 1 + 0 + 1 + 2); - Assertion.AssertEquals(masterGroup.PropertyGroupCount, 1 + 0 + 0 + 0); - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/HashTableUtility_Tests.cs b/src/Deprecated/Engine.UnitTests/HashTableUtility_Tests.cs deleted file mode 100644 index 94da0bd2342..00000000000 --- a/src/Deprecated/Engine.UnitTests/HashTableUtility_Tests.cs +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Xml; -using System.Collections; -using System.Text.RegularExpressions; - -using NUnit.Framework; - -using Microsoft.Build.BuildEngine; -using System.Collections.Generic; - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class HashTableUtilityTests - { - /// - /// Missing unittest found by mutation testing. - /// REASON TEST WASN'T ORIGINALLY PRESENT: HashTableUtility was not a separate class and - /// there was no way to hit this case through BatchingEngine directly because it never - /// calls Compare() with unequal numbers of items. - /// - /// This test ensures that hashtable with unequal numbers of items are considered not - /// equivalent. - /// - [Test] - public void Regress_Mutation_HashtablesWithDifferentCountsAreNotEquivalent() - { - Dictionary h1 = new Dictionary(); - h1["a"] = "x"; // <---------- Must be the same in both hashtables. - Dictionary h2 = new Dictionary(); - h2["a"] = "x"; // <---------- Must be the same in both hashtables. - h2["b"] = "y"; - - Assertion.Assert(HashTableUtility.Compare(h1, h2) < 0); - Assertion.Assert(HashTableUtility.Compare(h2, h1) > 0); - } - - [Test] - public void HashtableComparisons() - { - Dictionary h1 = new Dictionary(); - Dictionary h2 = new Dictionary(); - Assertion.Assert(HashTableUtility.Compare(h1, h2) == 0); - - h1["a"] = "x"; - h2["a"] = "x"; - Assertion.Assert(HashTableUtility.Compare(h1, h2) == 0); - - h1["b"] = "y"; - h1["c"] = "z"; - h2["b"] = "y"; - h2["c"] = "z"; - Assertion.Assert(HashTableUtility.Compare(h1, h2) == 0); - - h1["b"] = "j"; - Assertion.Assert(HashTableUtility.Compare(h1, h2) < 0); - - h2["b"] = "j"; - h2["c"] = "k"; - Assertion.Assert(HashTableUtility.Compare(h1, h2) > 0); - - h1["a"] = null; - h1["c"] = "k"; - Assertion.Assert(HashTableUtility.Compare(h1, h2) < 0); - - h2["a"] = null; - Assertion.Assert(HashTableUtility.Compare(h1, h2) == 0); - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/ImportCollection_Tests.cs b/src/Deprecated/Engine.UnitTests/ImportCollection_Tests.cs deleted file mode 100644 index 040c59c4a85..00000000000 --- a/src/Deprecated/Engine.UnitTests/ImportCollection_Tests.cs +++ /dev/null @@ -1,234 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections.Generic; -using System.IO; -using System.Reflection; -using System.Text; -using System.Xml; - -using NUnit.Framework; -using Microsoft.Build.BuildEngine; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class ImportCollection_Tests - { - [Test] - public void TestICollectionMethods() - { - ObjectModelHelpers.DeleteTempProjectDirectory(); - - ObjectModelHelpers.CreateFileInTempProjectDirectory("import1.proj", @" - - - "); - - ObjectModelHelpers.CreateFileInTempProjectDirectory("import2.proj", @" - - - "); - - ObjectModelHelpers.CreateFileInTempProjectDirectory("main.proj", @" - - - - - - - - - - - - - "); - - Project project = ObjectModelHelpers.LoadProjectFileInTempProjectDirectory("main.proj", null); - - string import1Path = Path.Combine(ObjectModelHelpers.TempProjectDir, "import1.proj"); - string import2Path = Path.Combine(ObjectModelHelpers.TempProjectDir, "import2.proj"); - - ImportCollection imports = project.Imports; - - Assertion.AssertEquals(2, imports.Count); - - Import[] array = new Import[2]; - imports.CopyTo(array, 0); - Dictionary hash = new Dictionary(StringComparer.OrdinalIgnoreCase); - hash[array[0].EvaluatedProjectPath] = array[0]; - hash[array[1].EvaluatedProjectPath] = array[1]; - - Assertion.AssertEquals(imports[import1Path], hash[import1Path]); - Assertion.AssertEquals(imports[import2Path], hash[import2Path]); - - object[] arrayObjects = new object[2]; - imports.CopyTo(arrayObjects, 0); - hash.Clear(); - hash[((Import)arrayObjects[0]).EvaluatedProjectPath] = ((Import)arrayObjects[0]); - hash[((Import)arrayObjects[1]).EvaluatedProjectPath] = ((Import)arrayObjects[1]); - - Assertion.AssertEquals(imports[import1Path], hash[import1Path]); - Assertion.AssertEquals(imports[import2Path], hash[import2Path]); - - Assertion.AssertEquals("import1.proj", imports[import1Path].ProjectPath); - Assertion.AssertEquals("import2.proj", imports[import2Path].ProjectPath); - } - - [Test] - public void RemoveExistingImport() - { - ObjectModelHelpers.DeleteTempProjectDirectory(); - - ObjectModelHelpers.CreateFileInTempProjectDirectory("import1.proj", @" - - - "); - - ObjectModelHelpers.CreateFileInTempProjectDirectory("import2.proj", @" - - - "); - - ObjectModelHelpers.CreateFileInTempProjectDirectory("main.proj", @" - - - - - - - - - - - - - "); - - Project project = ObjectModelHelpers.LoadProjectFileInTempProjectDirectory("main.proj", null); - - ImportCollection imports = project.Imports; - Assertion.AssertEquals(2, imports.Count); - - imports.RemoveImport(imports[Path.Combine(ObjectModelHelpers.TempProjectDir, "import1.proj")]); - - // First validate that the ImportCollection only contains a single Import - Assertion.AssertEquals(1, imports.Count); - - // Now validate that the ImportCollection properly updated its parent Project (by inspecting the - // project's in-memory Xml) - int importCount = 0; - - foreach (XmlNode childNode in project.ProjectElement) - { - if (childNode.Name == XMakeElements.import) - { - importCount++; - } - } - - Assertion.AssertEquals(1, importCount); - } - - [Test] - [ExpectedException(typeof(InvalidOperationException))] - public void AttemptToRemoveImportedImportShouldThrowException() - { - ObjectModelHelpers.DeleteTempProjectDirectory(); - - ObjectModelHelpers.CreateFileInTempProjectDirectory("import1.proj", @" - - - "); - - ObjectModelHelpers.CreateFileInTempProjectDirectory("import2.proj", @" - - - - "); - - ObjectModelHelpers.CreateFileInTempProjectDirectory("import3.proj", @" - - - "); - - ObjectModelHelpers.CreateFileInTempProjectDirectory("main.proj", @" - - - - - - - - - - - - - "); - - Project project = ObjectModelHelpers.LoadProjectFileInTempProjectDirectory("main.proj", null); - - ImportCollection imports = project.Imports; - - // Should throw an InvalidOperationException - imports.RemoveImport(imports[Path.Combine(ObjectModelHelpers.TempProjectDir, "import3.proj")]); - } - - [Test] - [ExpectedException(typeof(InvalidOperationException))] - public void AttemptToRemoveImportFromAnotherProjectShouldThrowException() - { - ObjectModelHelpers.DeleteTempProjectDirectory(); - - ObjectModelHelpers.CreateFileInTempProjectDirectory("import1.proj", @" - - - "); - - ObjectModelHelpers.CreateFileInTempProjectDirectory("main1.proj", @" - - - - - - - - - - - - "); - - ObjectModelHelpers.CreateFileInTempProjectDirectory("main2.proj", @" - - - - - - - - - - - - "); - - Project project1 = ObjectModelHelpers.LoadProjectFileInTempProjectDirectory("main1.proj", null); - Project project2 = ObjectModelHelpers.LoadProjectFileInTempProjectDirectory("main2.proj", null); - - ImportCollection imports1 = project1.Imports; - ImportCollection imports2 = project2.Imports; - - // Should throw an InvalidOperationException - imports1.RemoveImport(imports2[Path.Combine(ObjectModelHelpers.TempProjectDir, "import1.proj")]); - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/IntrinsicTask_Tests.cs b/src/Deprecated/Engine.UnitTests/IntrinsicTask_Tests.cs deleted file mode 100644 index 8d79bf8724e..00000000000 --- a/src/Deprecated/Engine.UnitTests/IntrinsicTask_Tests.cs +++ /dev/null @@ -1,2772 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Reflection; -using System.Collections; -using System.Text.RegularExpressions; -using System.Xml; - -using NUnit.Framework; - -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine; -using Microsoft.Build.BuildEngine.Shared; -using System.Collections.Generic; -using System.IO; - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class IntrinsicTask_Tests - { - [Test] - public void PropertyGroup() - { - string content = @" - - - v1 - v2 - - "; - IntrinsicTask task = CreateIntrinsicTask(content); - BuildPropertyGroup properties = new BuildPropertyGroup(); - ExecuteTask(task, LookupHelpers.CreateLookup(properties)); - - Assertion.AssertEquals(2, properties.Count); - Assertion.AssertEquals("v1", properties["p1"].FinalValue); - Assertion.AssertEquals("v2", properties["p2"].FinalValue); - } - - [Test] - public void PropertyGroupWithComments() - { - string content = @" - - - v1 - - "; - IntrinsicTask task = CreateIntrinsicTask(content); - BuildPropertyGroup properties = new BuildPropertyGroup(); - ExecuteTask(task, LookupHelpers.CreateLookup(properties)); - - Assertion.AssertEquals(1, properties.Count); - Assertion.AssertEquals("v1", properties["p1"].FinalValue); - } - - [Test] - public void PropertyGroupEmpty() - { - string content = @" - - - "; - IntrinsicTask task = CreateIntrinsicTask(content); - BuildPropertyGroup properties = new BuildPropertyGroup(); - ExecuteTask(task, LookupHelpers.CreateLookup(properties)); - - Assertion.AssertEquals(0, properties.Count); - } - - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void PropertyGroupWithReservedProperty() - { - string content = @" - - - - - "; - IntrinsicTask task = CreateIntrinsicTask(content); - ExecuteTask(task); - } - - - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void PropertyGroupWithInvalidPropertyName() - { - string content = @" - - - - - "; - IntrinsicTask task = CreateIntrinsicTask(content); - ExecuteTask(task); - } - - [Test] - public void BlankProperty() - { - string content = @" - - - - - "; - IntrinsicTask task = CreateIntrinsicTask(content); - BuildPropertyGroup properties = new BuildPropertyGroup(); - ExecuteTask(task, LookupHelpers.CreateLookup(properties)); - - Assertion.AssertEquals(1, properties.Count); - Assertion.AssertEquals("", properties["p1"].FinalValue); - } - - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void PropertyGroupWithInvalidSyntax1() - { - string content = @" - - x - "; - IntrinsicTask task = CreateIntrinsicTask(content); - ExecuteTask(task, null); - } - - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void PropertyGroupWithInvalidSyntax2() - { - string content = @" - - -

- - "; - IntrinsicTask task = CreateIntrinsicTask(content); - ExecuteTask(task, null); - } - - [Test] - public void PropertyGroupWithConditionOnGroup() - { - string content = @" - - - v1 - v2 - - "; - IntrinsicTask task = CreateIntrinsicTask(content); - BuildPropertyGroup properties = new BuildPropertyGroup(); - ExecuteTask(task, LookupHelpers.CreateLookup(properties)); - - Assertion.AssertEquals(0, properties.Count); - - content = @" - - - v1 - v2 - - "; - task = CreateIntrinsicTask(content); - properties = new BuildPropertyGroup(); - ExecuteTask(task, LookupHelpers.CreateLookup(properties)); - - Assertion.AssertEquals(2, properties.Count); - Assertion.AssertEquals("v1", properties["p1"].FinalValue); - Assertion.AssertEquals("v2", properties["p2"].FinalValue); - } - - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void PropertyGroupWithConditionOnGroupUsingMetadataErrors() - { - // - // - // m1 - // - // - // m2 - // - // - // m3 - // - // - string content = @" - - - @(i0) - %(i0.m) - - "; - - IntrinsicTask task = CreateIntrinsicTask(content); - Lookup lookup = GenerateLookup(); - ExecuteTask(task, lookup); - } - - [Test] - public void ItemGroup() - { - string content = @" - - - - - - "; - IntrinsicTask task = CreateIntrinsicTask(content); - Lookup lookup = LookupHelpers.CreateEmptyLookup(); - ExecuteTask(task, lookup); - - BuildItemGroup i1Group = lookup.GetItems("i1"); - BuildItemGroup i2Group = lookup.GetItems("i2"); - Assertion.AssertEquals("a1", i1Group[0].FinalItemSpec); - Assertion.AssertEquals("b1", i2Group[0].FinalItemSpec); - } - - [Test] - public void ItemGroupWithComments() - { - string content = @" - - - - - - m1 - - - "; - IntrinsicTask task = CreateIntrinsicTask(content); - Lookup lookup = LookupHelpers.CreateEmptyLookup(); - ExecuteTask(task, lookup); - - BuildItemGroup i1Group = lookup.GetItems("i1"); - Assertion.AssertEquals("a1", i1Group[0].FinalItemSpec); - Assertion.AssertEquals("m1", i1Group[0].GetMetadata("m")); - } - - ///

- /// This is something that used to be done by CreateItem - /// - [Test] - public void ItemGroupTrims() - { - string content = @" - - - - - - "; - IntrinsicTask task = CreateIntrinsicTask(content); - BuildPropertyGroup properties = new BuildPropertyGroup(); - properties.SetProperty("p0", " v0 "); - Lookup lookup = LookupHelpers.CreateLookup(properties); - ExecuteTask(task, lookup); - - BuildItemGroup i1Group = lookup.GetItems("i1"); - Assertion.AssertEquals("v0", i1Group[0].FinalItemSpec); - } - - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void ItemGroupWithInvalidSyntax1() - { - string content = @" - - x - "; - IntrinsicTask task = CreateIntrinsicTask(content); - ExecuteTask(task, null); - } - - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void ItemGroupWithInvalidSyntax2() - { - string content = @" - - - x - - "; - IntrinsicTask task = CreateIntrinsicTask(content); - ExecuteTask(task, null); - } - - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void ItemGroupWithInvalidSyntax3() - { - string content = @" - - - - - "; - IntrinsicTask task = CreateIntrinsicTask(content); - ExecuteTask(task, null); - } - - [Test] - public void ItemGroupWithTransform() - { - string content = @" - - - - '%(filename).obj')""/> - - "; - IntrinsicTask task = CreateIntrinsicTask(content); - Lookup lookup = LookupHelpers.CreateEmptyLookup(); - ExecuteTask(task, lookup); - - BuildItemGroup i1Group = lookup.GetItems("i1"); - BuildItemGroup i2Group = lookup.GetItems("i2"); - Assertion.AssertEquals("a.cpp", i1Group[0].FinalItemSpec); - Assertion.AssertEquals("a.obj", i2Group[0].FinalItemSpec); - } - - [Test] - public void ItemGroupWithTransformInMetadataValue() - { - string content = @" - - - - - @(i1->'%(filename).obj') - - - "; - IntrinsicTask task = CreateIntrinsicTask(content); - Lookup lookup = LookupHelpers.CreateEmptyLookup(); - ExecuteTask(task, lookup); - - BuildItemGroup i2Group = lookup.GetItems("i2"); - Assertion.AssertEquals("a.cpp", i2Group[0].FinalItemSpec); - Assertion.AssertEquals("a.obj", i2Group[0].GetEvaluatedMetadata("m")); - } - - [Test] - public void ItemGroupWithExclude() - { - string content = @" - - - - - - "; - IntrinsicTask task = CreateIntrinsicTask(content); - Lookup lookup = LookupHelpers.CreateEmptyLookup(); - ExecuteTask(task, lookup); - - BuildItemGroup i1Group = lookup.GetItems("i1"); - BuildItemGroup i2Group = lookup.GetItems("i2"); - Assertion.AssertEquals("a1", i1Group[0].FinalItemSpec); - Assertion.AssertEquals("b2", i2Group[0].FinalItemSpec); - } - - [Test] - public void ItemGroupWithMetadataInExclude() - { - string content = @" - - - - a1 - - - - "; - IntrinsicTask task = CreateIntrinsicTask(content); - Lookup lookup = LookupHelpers.CreateEmptyLookup(); - ExecuteTask(task, lookup); - - BuildItemGroup i1Group = lookup.GetItems("i1"); - BuildItemGroup i2Group = lookup.GetItems("i2"); - Assertion.AssertEquals(1, i1Group.Count); - Assertion.AssertEquals(1, i2Group.Count); - Assertion.AssertEquals("a1", i1Group[0].FinalItemSpec); - Assertion.AssertEquals("b1", i2Group[0].FinalItemSpec); - } - - [Test] - public void ItemGroupWithConditionOnGroup() - { - string content = @" - - - - - - "; - IntrinsicTask task = CreateIntrinsicTask(content); - Lookup lookup = LookupHelpers.CreateEmptyLookup(); - ExecuteTask(task, lookup); - - Assertion.AssertEquals(0, lookup.GetItems("i1").Count); - Assertion.AssertEquals(0, lookup.GetItems("i2").Count); - - content = @" - - - - - - "; - task = CreateIntrinsicTask(content); - lookup = LookupHelpers.CreateEmptyLookup(); - ExecuteTask(task, lookup); - - BuildItemGroup i1Group = lookup.GetItems("i1"); - BuildItemGroup i2Group = lookup.GetItems("i2"); - Assertion.AssertEquals("a1", i1Group[0].FinalItemSpec); - Assertion.AssertEquals("b1", i2Group[0].FinalItemSpec); - } - - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void ItemGroupWithConditionOnGroupUsingMetadataErrors() - { - // - // - // m1 - // - // - // m2 - // - // - // m3 - // - // - string content = @" - - - - - - - - "; - IntrinsicTask task = CreateIntrinsicTask(content); - Lookup lookup = GenerateLookup(); - ExecuteTask(task, lookup); - } - - [Test] - public void PropertyGroupWithExternalPropertyReferences() - { - // - // v0 - // - string content = @" - - - $(p0) - - "; - IntrinsicTask task = CreateIntrinsicTask(content); - BuildPropertyGroup properties = GeneratePropertyGroup(); - ExecuteTask(task, LookupHelpers.CreateLookup(properties)); - - Assertion.AssertEquals(2, properties.Count); - Assertion.AssertEquals("v0", properties["p0"].FinalValue); - Assertion.AssertEquals("v0", properties["p1"].FinalValue); - } - - [Test] - public void ItemGroupWithPropertyReferences() - { - // - // v0 - // - string content = @" - - - - - - "; - IntrinsicTask task = CreateIntrinsicTask(content); - BuildPropertyGroup properties = GeneratePropertyGroup(); - Lookup lookup = LookupHelpers.CreateLookup(properties); - ExecuteTask(task, lookup); - - BuildItemGroup i1Group = lookup.GetItems("i1"); - BuildItemGroup i2Group = lookup.GetItems("i2"); - Assertion.AssertEquals("v0", i1Group[0].FinalItemSpec); - Assertion.AssertEquals("a2", i2Group[0].FinalItemSpec); - } - - [Test] - public void ItemGroupWithMetadataReferences() - { - string content = @" - - - - m1 - - - m2 - - - - "; - IntrinsicTask task = CreateIntrinsicTask(content); - Lookup lookup = LookupHelpers.CreateEmptyLookup(); - ExecuteTask(task, lookup); - - BuildItemGroup i1Group = lookup.GetItems("i1"); - BuildItemGroup i2Group = lookup.GetItems("i2"); - - Assertion.AssertEquals("a1", i1Group[0].FinalItemSpec); - Assertion.AssertEquals("a2", i1Group[1].FinalItemSpec); - Assertion.AssertEquals("m1", i2Group[0].FinalItemSpec); - Assertion.AssertEquals("m2", i2Group[1].FinalItemSpec); - - Assertion.AssertEquals("m1", i1Group[0].GetEvaluatedMetadata("m")); - Assertion.AssertEquals("m2", i1Group[1].GetEvaluatedMetadata("m")); - } - - [Test] - public void ItemGroupWithMetadataReferencesOnMetadataConditions() - { - string content = @" - - - - m1 - - - m2 - - - n1 - - - "; - IntrinsicTask task = CreateIntrinsicTask(content); - Lookup lookup = LookupHelpers.CreateEmptyLookup(); - ExecuteTask(task, lookup); - - BuildItemGroup i2Group = lookup.GetItems("i2"); - - Assertion.AssertEquals(2, i2Group.Count); - Assertion.AssertEquals("a1", i2Group[0].FinalItemSpec); - Assertion.AssertEquals("a2", i2Group[1].FinalItemSpec); - - Assertion.AssertEquals("n1", i2Group[0].GetEvaluatedMetadata("n")); - Assertion.AssertEquals("", i2Group[1].GetEvaluatedMetadata("n")); - } - - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void ItemGroupWithMetadataReferencesOnItemGroupAndItemConditionsErrors() - { - // - // - // m1 - // - // - // m2 - // - // - // m3 - // - // - string content = @" - - - - - "; - - IntrinsicTask task = CreateIntrinsicTask(content); - Lookup lookup = GenerateLookup(); - ExecuteTask(task, lookup); - } - - [Test] - public void ItemGroupWithExternalMetadataReferences() - { - // - // - // m1 - // - // - // m2 - // - // - // m3 - // - // - string content = @" - - - - %(i0.m) - - - - "; - - IntrinsicTask task = CreateIntrinsicTask(content); - Lookup lookup = GenerateLookup(); - ExecuteTask(task, lookup); - - BuildItemGroup i1Group = lookup.GetItems("i1"); - BuildItemGroup i2Group = lookup.GetItems("i2"); - - Assertion.AssertEquals("b1", i1Group[0].FinalItemSpec); - Assertion.AssertEquals("b1", i1Group[1].FinalItemSpec); - Assertion.AssertEquals("b1", i1Group[2].FinalItemSpec); - Assertion.AssertEquals("m1", i1Group[0].GetEvaluatedMetadata("m")); - Assertion.AssertEquals("m2", i1Group[1].GetEvaluatedMetadata("m")); - Assertion.AssertEquals("m3", i1Group[2].GetEvaluatedMetadata("m")); - - Assertion.AssertEquals("m1", i2Group[0].FinalItemSpec); - Assertion.AssertEquals("m2", i2Group[1].FinalItemSpec); - Assertion.AssertEquals("m3", i2Group[2].FinalItemSpec); - } - - [Test] - public void PropertyGroupWithCumulativePropertyReferences() - { - string content = @" - - - v1 - #$(p1)# - v2 - - "; - - IntrinsicTask task = CreateIntrinsicTask(content); - BuildPropertyGroup properties = new BuildPropertyGroup(); - ExecuteTask(task, LookupHelpers.CreateLookup(properties)); - - Assertion.AssertEquals(2, properties.Count); - Assertion.AssertEquals("v2", properties["p1"].FinalValue); - Assertion.AssertEquals("#v1#", properties["p2"].FinalValue); - } - - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void PropertyGroupWithMetadataReferencesOnGroupErrors() - { - // - // - // m1 - // n1 - // - // - // m2 - // n2 - // - // - // m3 - // n3 - // - // - string content = @" - - - %(i0.m) - - "; - - IntrinsicTask task = CreateIntrinsicTask(content); - Lookup lookup = GenerateLookup(); - ExecuteTask(task, lookup); - } - - [Test] - public void PropertyGroupWithMetadataReferencesOnProperty() - { - // - // - // m1 - // n1 - // - // - // m2 - // n2 - // - // - // m3 - // n3 - // - // - string content = @" - - - %(i0.n) - - "; - - IntrinsicTask task = CreateIntrinsicTask(content); - Lookup lookup = GenerateLookup(); - ExecuteTask(task, lookup); - - Assertion.AssertEquals("n2", lookup.GetProperty("p1").FinalValue); - } - - [Test] - public void PropertiesCanReferenceItemsInSameTarget() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - -

@(i1->'#%(identity)#', '*')

-
- -
-
- ", logger); - p.Build(new string[] { "t" }); - - logger.AssertLogContains("[#a1#*#a2#]"); - } - - [Test] - public void ItemsCanReferencePropertiesInSameTarget() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - v0 - - - - - - - - ", logger); - p.Build(new string[] { "t" }); - - logger.AssertLogContains("[v0]"); - } - - [Test] - public void PropertyGroupInTargetCanOverwriteGlobalProperties() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - v1 - - - - - - - - v2 - - - - - ", logger); - BuildPropertyGroup globalProperties = new BuildPropertyGroup(); - globalProperties.SetProperty("global", "v0"); - p.GlobalProperties = globalProperties; - Assertion.AssertEquals("v0", p.GetEvaluatedProperty("global")); - Assertion.Assert("Project shouldn't be dirty", !p.IsDirtyNeedToReevaluate); - p.Build(new string[] { "t2" }); - Assertion.Assert("Project shouldn't be dirty", !p.IsDirtyNeedToReevaluate); - - // PropertyGroup outside of target can't overwrite global property, - // but PropertyGroup inside of target can overwrite it - logger.AssertLogContains("start:[v0]", "end:[v2]", "final:[v2]"); - Assertion.AssertEquals("v2", p.GetEvaluatedProperty("global")); - - p.ResetBuildStatus(); - Assertion.Assert("Project shouldn't be dirty", !p.IsDirtyNeedToReevaluate); - - // Resetting the project goes back to the old value - Assertion.AssertEquals("v0", p.GetEvaluatedProperty("global")); - } - - - [Test] - public void PropertiesAreRevertedAfterBuild() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - -

p0

-
- - -

p1

-
-
-
- ", logger); - p.Build(new string[] { "t" }); - - string value = p.GetEvaluatedProperty("p"); - Assertion.AssertEquals("p1", value); - - p.ResetBuildStatus(); - - value = p.GetEvaluatedProperty("p"); - Assertion.AssertEquals("p0", value); - } - - [Test] - public void PropertiesVisibleToSubsequentTask() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - -

p1

-
- -
-
- ", logger); - p.Build(new string[] { "t" }); - - logger.AssertLogContains("[p1]"); - } - - [Test] - public void PropertiesVisibleToSubsequentTarget() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - -

p1

-
-
-
- ", logger); - p.Build(new string[] { "t2" }); - - logger.AssertLogContains("[p1]"); - } - - [Test] - public void ItemsVisibleToSubsequentTask() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - - - ", logger); - p.Build(new string[] { "t" }); - - logger.AssertLogContains("[i1]"); - } - - [Test] - public void ItemsVisibleToSubsequentTarget() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - - - - - ", logger); - p.Build(new string[] { "t2" }); - - logger.AssertLogContains("[i1]"); - } - - [Test] - public void ItemsNotVisibleToParallelTargetBatches() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - 1.out - 2.out - - - - - - - - - - ", logger); - p.Build(new string[] { "t" }); - - logger.AssertLogContains(new string[] { "start:[1.in]", "end:[1.in]", "start:[2.in]", "end:[2.in]" }); - } - - [Test] - public void PropertiesNotVisibleToParallelTargetBatches() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - 1.out - 2.out - - - - -

p1

-
- -
-
- ", logger); - p.Build(new string[] { "t" }); - - logger.AssertLogContains(new string[] { "start:[]", "end:[p1]", "start:[]", "end:[p1]" }); - } - - // One input is built, the other is inferred - [Test] - public void ItemsInPartialBuild() - { - string[] oldFiles = null, newFiles = null; - try - { - oldFiles = ObjectModelHelpers.GetTempFiles(2, new DateTime(2005, 1, 1)); - newFiles = ObjectModelHelpers.GetTempFiles(2, new DateTime(2006, 1, 1)); - - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - " + newFiles[0] + @" - " + oldFiles[1] + @" - - - - - - - - - - - - - ", logger); - p.Build(new string[] { "t2" }); - - // We should only see messages for the out of date inputs, but the itemgroup should do its work for both inputs - logger.AssertLogContains(new string[] { "start:[]", "end:[" + newFiles[1] + "]", "final:[" + oldFiles[0] + ";" + newFiles[1] + "]" }); - } - finally - { - ObjectModelHelpers.DeleteTempFiles(oldFiles); - ObjectModelHelpers.DeleteTempFiles(newFiles); - } - } - - // One input is built, the other input is inferred - [Test] - public void PropertiesInPartialBuild() - { - string[] oldFiles = null, newFiles = null; - try - { - oldFiles = ObjectModelHelpers.GetTempFiles(2, new DateTime(2005, 1, 1)); - newFiles = ObjectModelHelpers.GetTempFiles(2, new DateTime(2006, 1, 1)); - - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - " + newFiles[0] + @" - " + oldFiles[1] + @" - - - - - - - -

@(i)

-
- -
-
- ", logger); - p.Build(new string[] { "t2" }); - - // We should only see messages for the out of date inputs, but the propertygroup should do its work for both inputs - // Finally, execution wins over inferral, as the code chooses to do it that way - logger.AssertLogContains(new string[] { "start:[]", "end:[" + newFiles[1] + "]", "final:[" + newFiles[1] + "]" }); - } - finally - { - ObjectModelHelpers.DeleteTempFiles(oldFiles); - ObjectModelHelpers.DeleteTempFiles(newFiles); - } - } - - // One input is built, the other is inferred - [Test] - public void ItemsInPartialBuildVisibleToSubsequentlyInferringTasks() - { - string[] oldFiles = null, newFiles = null; - try - { - oldFiles = ObjectModelHelpers.GetTempFiles(2, new DateTime(2005, 1, 1)); - newFiles = ObjectModelHelpers.GetTempFiles(2, new DateTime(2006, 1, 1)); - string oldInput = oldFiles[0]; - string newInput = newFiles[1]; - string oldOutput = oldFiles[1]; - string newOutput = newFiles[0]; - - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - " + newOutput + @" - " + oldOutput + @" - - - - - - - - - - - - - - - - - ", logger); - p.Build(new string[] { "t2" }); - - // We should only see messages for the out of date inputs, but the itemgroup should do its work for both inputs; - // The final result should include the out of date inputs (twice) and the up to date inputs (twice). - // NOTE: outputs from regular tasks, like CreateItem, are gathered up and included in the project in the order (1) inferred (2) executed. - // Intrinsic tasks, because they affect the project directly, don't do this. So the final order we see is - // two inputs (old, new) from the ItemGroup; followed by the inferred CreateItem output, then the executed CreateItem output. - // I suggest this ordering isn't important: it's a new feature, so nobody will get broken. - logger.AssertLogContains(new string[] { "start:[" + newInput + "]", - "middle:[" + newInput + "][" + newInput + "]", - "end:[" + newInput + ";" + newInput + "]", - "final:[" + oldInput + ";" + newInput + ";" + oldInput + ";" + newInput + "]" }); - } - finally - { - ObjectModelHelpers.DeleteTempFiles(oldFiles); - ObjectModelHelpers.DeleteTempFiles(newFiles); - } - } - - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void IncludeNoOp() - { - string content = @" - - - - - "; - IntrinsicTask task = CreateIntrinsicTask(content); - ExecuteTask(task, null); - } - - [Test] - public void RemoveNoOp() - { - string content = @" - - - - - "; - IntrinsicTask task = CreateIntrinsicTask(content); - Lookup lookup = LookupHelpers.CreateEmptyLookup(); - ExecuteTask(task, lookup); - - Assertion.AssertEquals(0, lookup.GetItems("i1").Count); - } - - [Test] - public void RemoveItemInTarget() - { - string content = @" - - - - - - "; - IntrinsicTask task = CreateIntrinsicTask(content); - Lookup lookup = LookupHelpers.CreateEmptyLookup(); - ExecuteTask(task, lookup); - - Assertion.AssertEquals(0, lookup.GetItems("i1").Count); - } - - /// - /// Removes in one batch should never affect adds in a parallel batch, even if that - /// parallel batch ran first. - /// - [Test] - public void RemoveOfItemAddedInTargetByParallelTargetBatchDoesNothing() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - 1.out - 2.out - - - - - - - - - - - - - - - - - - - - - - - - ", logger); - p.Build(new string[] { "t", "t2" }); - - logger.AssertLogContains(new string[] { "final:[a;b;d]" }); - } - - [Test] - public void RemoveItemInTargetWithTransform() - { - string content = @" - - - - - '%(filename).obj')""/> - - "; - IntrinsicTask task = CreateIntrinsicTask(content); - Lookup lookup = LookupHelpers.CreateEmptyLookup(); - ExecuteTask(task, lookup); - - Assertion.AssertEquals(0, lookup.GetItems("i1").Count); - } - - [Test] - public void RemoveWithMultipleItemspecs() - { - string content = @" - - - - - - - "; - IntrinsicTask task = CreateIntrinsicTask(content); - Lookup lookup = LookupHelpers.CreateEmptyLookup(); - ExecuteTask(task, lookup); - - Assertion.AssertEquals(0, lookup.GetItems("i1").Count); - } - - [Test] - public void RemoveAllItemsInList() - { - string content = @" - - - - - - - "; - IntrinsicTask task = CreateIntrinsicTask(content); - Lookup lookup = LookupHelpers.CreateEmptyLookup(); - ExecuteTask(task, lookup); - - Assertion.AssertEquals(0, lookup.GetItems("i1").Count); - } - - [Test] - public void RemoveItemOutsideTarget() - { - // - // - // m1 - // n1 - // - // - // m2 - // n2 - // - // - // m3 - // n3 - // - // - string content = @" - - - - - "; - IntrinsicTask task = CreateIntrinsicTask(content); - Lookup lookup = GenerateLookup(); - - task.ExecuteTask(lookup); - - BuildItemGroup i0Group = lookup.GetItems("i0"); - - Assertion.AssertEquals(3, i0Group.Count); - Assertion.AssertEquals("a1", i0Group[0].FinalItemSpec); - Assertion.AssertEquals("a3", i0Group[1].FinalItemSpec); - Assertion.AssertEquals("a4", i0Group[2].FinalItemSpec); - } - - /// - /// Bare (batchable) metadata is prohibited on IG/PG conditions -- all other expressions - /// should be allowed - /// - [Test] - public void ConditionOnPropertyGroupUsingPropertiesAndItemListsAndTransforms() - { - // - // - // m1 - // - // - // m2 - // - // - // m3 - // - // - // - // v0 - // - string content = @" - - '%(identity).x','|')'=='a1.x|a2.x|a3.x|a4.x'""> - v1 - - "; - IntrinsicTask task = CreateIntrinsicTask(content); - - Lookup lookup = GenerateLookupWithItemsAndProperties(); - - task.ExecuteTask(lookup); - - string p1 = lookup.GetProperty("p1").FinalValue; - - Assertion.AssertEquals("v1", p1); - } - - /// - /// Bare (batchable) metadata is prohibited on IG/PG conditions -- all other expressions - /// should be allowed - /// - [Test] - public void ConditionOnItemGroupUsingPropertiesAndItemListsAndTransforms() - { - // - // - // m1 - // - // - // m2 - // - // - // m3 - // - // - // - // v0 - // - string content = @" - - '%(identity).x','|')'=='a1.x|a2.x|a3.x|a4.x'""> - - - "; - IntrinsicTask task = CreateIntrinsicTask(content); - - Lookup lookup = GenerateLookupWithItemsAndProperties(); - - task.ExecuteTask(lookup); - - BuildItemGroup i1Group = lookup.GetItems("i1"); - - Assertion.AssertEquals(1, i1Group.Count); - Assertion.AssertEquals("x", i1Group[0].FinalItemSpec); - } - - /// - /// This bug was caused by batching over the ItemGroup as well as over each child. - /// If the condition on a child did not exclude it, an unwitting child could be included multiple times, - /// once for each outer batch. The fix was to abandon the idea of outer batching and just - /// prohibit batchable expressions on the ItemGroup conditions. It's just too hard to write such expressions - /// in a comprehensible way. - /// - [Test] - public void RegressPCHBug68578() - { - // - // - // m1 - // - // - // m2 - // - // - // m3 - // - // - string content = @" - - - - - '%(m).obj')"" Condition=""'%(i0.m)' == 'm1'""/> - '%(m)')"" Condition=""'%(i0.m)' == 'm2'""/> - - "; - IntrinsicTask task = CreateIntrinsicTask(content); - - Lookup lookup = GenerateLookup(); - - task.ExecuteTask(lookup); - - BuildItemGroup linkGroup = lookup.GetItems("link"); - - Assertion.AssertEquals(4, linkGroup.Count); - Assertion.AssertEquals("A_PCH", linkGroup[0].FinalItemSpec); - Assertion.AssertEquals("m1.obj", linkGroup[1].FinalItemSpec); - Assertion.AssertEquals("m2", linkGroup[2].FinalItemSpec); - Assertion.AssertEquals("m2", linkGroup[3].FinalItemSpec); - } - - [Test] - public void RemovesOfPersistedItemsAreReversed() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - - - - - - ", logger); - p.Build(new string[] { "t" }); - - // The item was removed during the build - logger.AssertLogContains("[]"); - Assertion.AssertEquals(0, ((BuildItemGroup)p.EvaluatedItemsByName["i0"]).Count); - Assertion.AssertEquals(0, p.EvaluatedItems.Count); - - p.ResetBuildStatus(); - // We should still have the item left - Assertion.AssertEquals(1, ((BuildItemGroup)p.EvaluatedItemsByName["i0"]).Count); - Assertion.AssertEquals(1, p.EvaluatedItems.Count); - } - - [Test] - public void RemovesOfPersistedItemsAreReversed1() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - - - - - - - ", logger); - p.Build(new string[] { "t" }); - - logger.AssertLogContains("[]"); - Assertion.AssertEquals(0, ((BuildItemGroup)p.EvaluatedItemsByName["i0"]).Count); - Assertion.AssertEquals(0, p.EvaluatedItems.Count); - - p.ResetBuildStatus(); - Assertion.AssertEquals(1, ((BuildItemGroup)p.EvaluatedItemsByName["i0"]).Count); - Assertion.AssertEquals(1, p.EvaluatedItems.Count); - } - - [Test] - public void RemovesOfPersistedItemsAreReversed2() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - - - - - - - - - - - ", logger); - p.Build(new string[] { "t" }); - - logger.AssertLogContains("[a2;a1;a3][b1]"); - Assertion.AssertEquals(3, ((BuildItemGroup)p.EvaluatedItemsByName["i0"]).Count); - Assertion.AssertEquals(1, ((BuildItemGroup)p.EvaluatedItemsByName["i1"]).Count); - Assertion.AssertEquals(4, p.EvaluatedItems.Count); - - p.ResetBuildStatus(); - Assertion.AssertEquals(2, ((BuildItemGroup)p.EvaluatedItemsByName["i0"]).Count); - Assertion.AssertEquals(1, ((BuildItemGroup)p.EvaluatedItemsByName["i1"]).Count); - Assertion.AssertEquals(3, p.EvaluatedItems.Count); - } - - [Test] - public void RemovesOfPersistedItemsAreReversed3() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - m1 - - - - - - m2 - - - - - - - ", logger); - p.Build(new string[] { "t" }); - - logger.AssertLogContains("[]"); - Assertion.AssertEquals(0, ((BuildItemGroup)p.EvaluatedItemsByName["i0"]).Count); - Assertion.AssertEquals(0, p.EvaluatedItems.Count); - - p.ResetBuildStatus(); - Assertion.AssertEquals(1, ((BuildItemGroup)p.EvaluatedItemsByName["i0"]).Count); - Assertion.AssertEquals("m1", ((BuildItemGroup)p.EvaluatedItemsByName["i0"])[0].GetMetadata("m")); - Assertion.AssertEquals(1, p.EvaluatedItems.Count); - } - - /// - /// Persisted item is copied into another item list by an ItemGroup -- the copy - /// should be reversed - /// - [Test] - public void RemovesOfPersistedItemsAreReversed4() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - - - - - - - ", logger); - p.Build(new string[] { "t" }); - - logger.AssertLogContains("[a1;a1][a1;a1]"); - Assertion.AssertEquals(2, ((BuildItemGroup)p.EvaluatedItemsByName["i0"]).Count); - Assertion.AssertEquals(2, ((BuildItemGroup)p.EvaluatedItemsByName["i1"]).Count); - Assertion.AssertEquals(4, p.EvaluatedItems.Count); - - p.ResetBuildStatus(); - Assertion.AssertEquals(1, ((BuildItemGroup)p.EvaluatedItemsByName["i0"]).Count); - Assertion.AssertEquals("a1", ((BuildItemGroup)p.EvaluatedItemsByName["i0"])[0].EvaluatedItemSpec); - Assertion.AssertEquals(0, ((BuildItemGroup)p.EvaluatedItemsByName["i1"]).Count); - Assertion.AssertEquals(1, p.EvaluatedItems.Count); - } - - [Test] - public void RemovesOfItemsOnlyWithMetadataValue() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - m1 - - - - - - m2 - - - - - - - ", logger); - p.Build(new string[] { "t" }); - - logger.AssertLogContains("[m2]"); - Assertion.AssertEquals(1, ((BuildItemGroup)p.EvaluatedItemsByName["i0"]).Count); - } - - [Test] - public void RemoveBatchingOnRemoveValue() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - m1 - - - m2 - - - - - - - - - - ", logger); - p.Build(new string[] { "t" }); - - logger.AssertLogContains("[m3]"); - Assertion.AssertEquals(1, ((BuildItemGroup)p.EvaluatedItemsByName["i0"]).Count); - } - - [Test] - public void RemoveWithWildcards() - { - string[] files = null; - - try - { - files = ObjectModelHelpers.GetTempFiles(2, DateTime.Now); - - string content = @" - - - - - - "; - IntrinsicTask task = CreateIntrinsicTask(content); - BuildPropertyGroup properties = new BuildPropertyGroup(); - properties.SetProperty("TEMP", Environment.GetEnvironmentVariable("TEMP")); - Lookup lookup = LookupHelpers.CreateLookup(properties); - ExecuteTask(task, lookup); - - Assertion.AssertEquals(1, lookup.GetItems("i1").Count); - Assertion.AssertEquals("other", lookup.GetItems("i1")[0].FinalItemSpec); - } - finally - { - ObjectModelHelpers.DeleteTempFiles(files); - } - } - - [Test] - public void RemovesNotVisibleToParallelTargetBatches() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - 1.out - 2.out - - - - - - - - - - ", logger); - p.Build(new string[] { "t" }); - - logger.AssertLogContains(new string[] { "start:[1.in]", "end:[]", "start:[2.in]", "end:[]" }); - } - - [Test] - public void RemovesNotVisibleToParallelTargetBatches2() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - 1.out - 2.out - - - - - - - - - - - ", logger); - p.Build(new string[] { "t" }); - - logger.AssertLogContains(new string[] { "start:[j1]", "end:[]", "start:[j1]", "end:[]" }); - } - -#if false // Not implemented yet: this was working when we were cloning, but now needs some thought. - - /// - /// The historical task output publishing model prevents a called target seeing outputs - /// from tasks in the same target that have already run. We choose to not follow this model - /// for itemgroups in targets. - /// - [Test] - public void RemovesAreVisibleToCalledTarget() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - - - - - - - - - - - - ", logger); - p.Build(new string[] { "t" }); - - logger.AssertLogContains(new string[] { "a:[i1;i2]", "b:[i1]", "c:[i1]", "d:[i1]" }); - } -#endif - - /// - /// Whidbey behavior was that items/properties emitted by a target being called, were - /// not visible to subsequent tasks in the calling target. (That was because the project - /// items and properties had been cloned for the target batches.) We must match that behavior. - /// - [Test] - public void CalledTargetItemsAreNotVisibleToCallerTarget() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - -

a

-
- - - - - - - - - - - - - - - - -

$(p);$(q);c

-
-
-
- ", logger); - p.Build(new string[] { "t3" }); - - logger.AssertLogContains(new string[] { "in target:[a][a]", "after target:[a;b;c][a;b;c]" }); - } - - /// - /// Whidbey behavior was that items/properties emitted by a target calling another target, were - /// not visible to the calling target. (That was because the project items and properties had been cloned for the target batches.) - /// We must match that behavior. (For now) - /// - [Test] - public void CallerTargetItemsAreNotVisibleToCalledTarget() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - -

a

-
- - - - - - - - - - - - -

$(p);$(q);c

-
- -
- - - -
- ", logger); - p.Build(new string[] { "t3" }); - - logger.AssertLogContains(new string[] { "in target:[a][a]", "after target:[a;b;c][a;b;c]" }); - } - - [Test] - public void ModifyNoOp() - { - string content = @" - - - - - "; - IntrinsicTask task = CreateIntrinsicTask(content); - Lookup lookup = LookupHelpers.CreateEmptyLookup(); - ExecuteTask(task, lookup); - - Assertion.AssertEquals(0, lookup.GetItems("i1").Count); - } - - [Test] - public void ModifyItemInTarget() - { - string content = @" - - - - m1 - - - m2 - - - "; - IntrinsicTask task = CreateIntrinsicTask(content); - Lookup lookup = LookupHelpers.CreateEmptyLookup(); - ExecuteTask(task, lookup); - - BuildItem item = lookup.GetItems("i1")[0]; - Assertion.AssertEquals("m2", item.GetMetadata("m")); - } - - [Test] - public void ModifyItemInTargetLastMetadataWins() - { - string content = @" - - - - m1 - - - m2 - m3 - m4 - - - "; - IntrinsicTask task = CreateIntrinsicTask(content); - Lookup lookup = LookupHelpers.CreateEmptyLookup(); - ExecuteTask(task, lookup); - - BuildItem item = lookup.GetItems("i1")[0]; - Assertion.AssertEquals("m3", item.GetMetadata("m")); - } - - [Test] - public void ModifyItemEmittedByTask() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - - m2 - - - - - - ", logger); - p.Build(new string[] { "t" }); - - logger.AssertLogContains(new string[] { "[m2][n1]" }); - } - - [Test] - public void ModifyItemInTargetWithCondition() - { - string content = @" - - - - m1 - - - m2 - - - m3 - - - "; - IntrinsicTask task = CreateIntrinsicTask(content); - Lookup lookup = LookupHelpers.CreateEmptyLookup(); - ExecuteTask(task, lookup); - - BuildItem item1 = lookup.GetItems("i1")[0]; - BuildItem item2 = lookup.GetItems("i1")[1]; - Assertion.AssertEquals("a1", item1.FinalItemSpec); - Assertion.AssertEquals("a2", item2.FinalItemSpec); - Assertion.AssertEquals("m1", item1.GetMetadata("m")); - Assertion.AssertEquals("m3", item2.GetMetadata("m")); - } - - [Test] - public void ModifyItemInTargetWithConditionOnMetadata() - { - string content = @" - - - - m1 - - - m2 - - - m3 - - - "; - IntrinsicTask task = CreateIntrinsicTask(content); - Lookup lookup = LookupHelpers.CreateEmptyLookup(); - ExecuteTask(task, lookup); - - BuildItem item1 = lookup.GetItems("i1")[0]; - BuildItem item2 = lookup.GetItems("i1")[1]; - Assertion.AssertEquals("a1", item1.FinalItemSpec); - Assertion.AssertEquals("a2", item2.FinalItemSpec); - Assertion.AssertEquals("m1", item1.GetMetadata("m")); - Assertion.AssertEquals("m3", item2.GetMetadata("m")); - } - - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void ModifyItemWithUnqualifiedMetadataError() - { - string content = @" - - - - - 2 - - - "; - IntrinsicTask task = CreateIntrinsicTask(content); - ExecuteTask(task, null); - } - - [Test] - public void ModifyItemInTargetWithConditionWithoutItemTypeOnMetadataInCondition() - { - string content = @" - - - - m1 - - - m2 - - - m3 - - - "; - IntrinsicTask task = CreateIntrinsicTask(content); - Lookup lookup = LookupHelpers.CreateEmptyLookup(); - ExecuteTask(task, lookup); - - BuildItem item1 = lookup.GetItems("i1")[0]; - BuildItem item2 = lookup.GetItems("i1")[1]; - Assertion.AssertEquals("a1", item1.FinalItemSpec); - Assertion.AssertEquals("a2", item2.FinalItemSpec); - Assertion.AssertEquals("m1", item1.GetMetadata("m")); - Assertion.AssertEquals("m3", item2.GetMetadata("m")); - } - - - [Test] - public void ModifyItemInTargetWithConditionOnMetadataWithoutItemTypeOnMetadataInCondition() - { - string content = @" - - - - m1 - - - m2 - - - m3 - - - "; - IntrinsicTask task = CreateIntrinsicTask(content); - Lookup lookup = LookupHelpers.CreateEmptyLookup(); - ExecuteTask(task, lookup); - - BuildItem item1 = lookup.GetItems("i1")[0]; - BuildItem item2 = lookup.GetItems("i1")[1]; - Assertion.AssertEquals("a1", item1.FinalItemSpec); - Assertion.AssertEquals("a2", item2.FinalItemSpec); - Assertion.AssertEquals("m1", item1.GetMetadata("m")); - Assertion.AssertEquals("m3", item2.GetMetadata("m")); - } - - [Test] - public void ModifyItemOutsideTarget() - { - // - // - // m1 - // n1 - // - // - // m2 - // n2 - // - // - // m3 - // n3 - // - // - string content = @" - - - - m4 - - - "; - IntrinsicTask task = CreateIntrinsicTask(content); - - Lookup lookup = GenerateLookup(); - - task.ExecuteTask(lookup); - - BuildItemGroup i0Group = lookup.GetItems("i0"); - - Assertion.AssertEquals(4, i0Group.Count); - foreach (BuildItem item in i0Group) - { - item.EvaluateAllItemMetadata(new Expander(new BuildPropertyGroup()), ParserOptions.AllowAll, null, null); - Assertion.AssertEquals("m4", item.GetEvaluatedMetadata("m")); - } - } - - [Test] - public void RemoveComplexMidlExample() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - true - dlldata.c - dlldatadir - headerdir - tlbdir - proxydir - interfacedir - - - - - - mydlldata.c - - - myheader.h - - - - - - - $(MidlDllDataDir)\%(Filename)_dlldata.c - $(MidlDllDataFileName) - $(MidlHeaderDir)\%(Idl.Filename).h - $(MidlTlbDir)\%(Filename).tlb - $(MidlProxyDir)\%(Filename)_p.c - $(MidlInterfaceDir)\%(Filename)_i.c - - - - - - - ", logger); - p.Build(new string[] { "MIDL" }); - - logger.AssertLogContains(@"[a.idl|dlldatadir\a_dlldata.c|headerdir\a.h|tlbdir\a.tlb|proxydir\a_p.c|interfacedir\a_i.c]", - @"[b.idl|mydlldata.c|headerdir\b.h|tlbdir\b.tlb|proxydir\b_p.c|interfacedir\b_i.c]", - @"[c.idl|dlldatadir\c_dlldata.c|myheader.h|tlbdir\c.tlb|proxydir\c_p.c|interfacedir\c_i.c]"); - } - - [Test] - public void ModifiesOfPersistedItemsAreReversed1() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - m0 - - - - - - m1 - - - - - - - - ", logger); - p.Build(new string[] { "t", "t2" }); - - logger.AssertLogContains("[m1]"); - - BuildItem item = ((BuildItemGroup)p.EvaluatedItemsByName["i0"])[0]; - Assertion.AssertEquals("m1", item.GetEvaluatedMetadata("m")); - - p.ResetBuildStatus(); - Assertion.AssertEquals("m0", item.GetEvaluatedMetadata("m")); - } - - /// - /// Modify of an item copied during the build - /// - [Test] - public void ModifiesOfPersistedItemsAreReversed2() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - m0 - n0 - - - - - - m1 - - - n1 - - - - - - - - - ", logger); - p.Build(new string[] { "t", "t2" }); - - logger.AssertLogContains("[m0][n0]", "[m1][n1]"); - - Assertion.AssertEquals(1, ((BuildItemGroup)p.evaluatedItemsByName["i0"]).Count); - Assertion.AssertEquals(1, ((BuildItemGroup)p.evaluatedItemsByName["i1"]).Count); - Assertion.AssertEquals("m0", ((BuildItemGroup)p.EvaluatedItemsByName["i0"])[0].GetEvaluatedMetadata("m")); - Assertion.AssertEquals("n0", ((BuildItemGroup)p.EvaluatedItemsByName["i0"])[0].GetEvaluatedMetadata("n")); - Assertion.AssertEquals("m1", ((BuildItemGroup)p.EvaluatedItemsByName["i1"])[0].GetEvaluatedMetadata("m")); - Assertion.AssertEquals("n1", ((BuildItemGroup)p.EvaluatedItemsByName["i1"])[0].GetEvaluatedMetadata("n")); - - p.ResetBuildStatus(); - Assertion.AssertEquals(1, ((BuildItemGroup)p.evaluatedItemsByName["i0"]).Count); - Assertion.AssertEquals(0, ((BuildItemGroup)p.evaluatedItemsByName["i1"]).Count); - Assertion.AssertEquals("m0", ((BuildItemGroup)p.EvaluatedItemsByName["i0"])[0].GetEvaluatedMetadata("m")); - Assertion.AssertEquals("n0", ((BuildItemGroup)p.EvaluatedItemsByName["i0"])[0].GetEvaluatedMetadata("n")); - } - - [Test] - public void RemoveItemInImportedFile() - { - MockLogger logger = new MockLogger(); - string importedFile = null; - - try - { - importedFile = Path.GetTempFileName(); - File.WriteAllText(importedFile, @" - - - - - - "); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - - - - - ", logger); - p.Build(new string[] { "t" }); - - logger.AssertLogContains("[imported]", "[]"); - } - finally - { - ObjectModelHelpers.DeleteTempFiles(new string[] { importedFile }); - } - } - - [Test] - public void ModifyItemInImportedFile() - { - MockLogger logger = new MockLogger(); - string importedFile = null; - - try - { - importedFile = Path.GetTempFileName(); - File.WriteAllText(importedFile, @" - - - - - - "); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - m1 - - - - - - ", logger); - p.Build(new string[] { "t" }); - - logger.AssertLogContains("[m1]"); - } - finally - { - ObjectModelHelpers.DeleteTempFiles(new string[] { importedFile }); - } - } - - /// - /// Properties produced in one target batch are not visible to another - /// - [Test] - public void OutputPropertiesInTargetBatchesCreateItem() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - 1.out - 2.out - - - - - - - - - - - - - ", logger); - p.Build(new string[] { "t", "t2" }); - - logger.AssertLogContains(new string[] { "start:[]", "end:[--1.in]", "start:[]", "end:[--2.in]", "final:[--2.in]" }); - } - - /// - /// Properties produced in one task batch are not visible to another - /// - [Test] - public void OutputPropertiesInTaskBatchesCreateItem() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - - - - - - ", logger); - p.Build(new string[] { "t" }); - - logger.AssertLogContains(new string[] { "end:[--2.in]" }); - } - - [Test] - public void PropertiesInInferredBuildCreateProperty() - { - string[] files = null; - try - { - files = ObjectModelHelpers.GetTempFiles(2, new DateTime(2005, 1, 1)); - - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - " + files[1] + @" - - - - - - - - - - - - - ", logger); - p.Build(new string[] { "t2" }); - - // We should only see messages from the second target, as the first is only inferred - logger.AssertLogDoesntContain("start:"); - logger.AssertLogDoesntContain("end:"); - logger.AssertLogContains(new string[] { "final:[" + files[0] + "]" }); - } - finally - { - ObjectModelHelpers.DeleteTempFiles(files); - } - } - - [Test] - public void ModifyItemPreviouslyModified() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - - 1 - - - 2 - - - - - - ", logger); - p.Build(new string[] { "t" }); - - logger.AssertLogDoesntContain("[1]"); - logger.AssertLogContains("[2]"); - } - - [Test] - public void ModifyItemPreviouslyModified2() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - - 1 - - - - - 2 - - - - - - ", logger); - p.Build(new string[] { "t" }); - - logger.AssertLogDoesntContain("[1]"); - logger.AssertLogContains("[2]"); - } - - [Test] - public void RemoveItemPreviouslyModified() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - - 1 - - - - - - - ", logger); - p.Build(new string[] { "t" }); - - logger.AssertLogDoesntContain("[1]"); - logger.AssertLogDoesntContain("[2]"); - } - - [Test] - public void RemoveItemPreviouslyModified2() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - - 1 - - - - - - - - - ", logger); - p.Build(new string[] { "t" }); - - logger.AssertLogDoesntContain("[1]"); - logger.AssertLogDoesntContain("[2]"); - } - - [Test] - public void FilterItemPreviouslyModified() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - - 1 - - - 2 - - - - - - ", logger); - p.Build(new string[] { "t" }); - - logger.AssertLogDoesntContain("[1]"); - logger.AssertLogContains("[2]"); - } - - [Test] - public void FilterItemPreviouslyModified2() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - - 1 - - - 2 - - - - - - ", logger); - p.Build(new string[] { "t" }); - - logger.AssertLogDoesntContain("[1]"); - logger.AssertLogContains("[2]"); - } - - [Test] - public void FilterItemPreviouslyModified3() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - m1 - - - - - - m2 - - - - - m3 - - - - - m4 - - - - - - ", logger); - p.Build(new string[] { "t" }); - - logger.AssertLogContains("[a;b;c = m4]"); - } - - [Test] - public void FilterItemPreviouslyModified4() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - m1 - - - m2 - - - m3 - - - - - - ", logger); - p.Build(new string[] { "t" }); - - logger.AssertLogContains("[b = m1]"); - logger.AssertLogContains("[a;c = m3]"); - } - - [Test] - public void FilterItemPreviouslyModified5() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - m1 - - - m2 - - - m3 - - - - - - ", logger); - p.Build(new string[] { "t" }); - - logger.AssertLogContains("[a = m3]"); - logger.AssertLogContains("[b = m1]"); - logger.AssertLogContains("[c = m2]"); - } - - [Test] - public void FilterItemPreviouslyModified6() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - m1 - - - - - - m2 - - - - - - - - - - m3 - - - - - - ", logger); - p.Build(new string[] { "t" }); - - logger.AssertLogContains("[a;b;c=]"); - } - ////////////////////////////////////////////////////////////////////////////////////////////////////////// - ////////////////////////////////////////////////////////////////////////////////////////////////////////// - ////////////////////////////////////////////////////////////////////////////////////////////////////////// - - #region Helpers - - private static BuildPropertyGroup GeneratePropertyGroup() - { - BuildPropertyGroup properties = new BuildPropertyGroup(); - properties.SetProperty("p0", "v0"); - return properties; - } - - private static Lookup GenerateLookupWithItemsAndProperties() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - pg.SetProperty("p0", "v0"); - - Lookup lookup = GenerateLookup(pg); - return lookup; - } - - private static Lookup GenerateLookup() - { - return GenerateLookup(new BuildPropertyGroup()); - } - - private static Lookup GenerateLookup(BuildPropertyGroup properties) - { - BuildItemGroup items = new BuildItemGroup(); - BuildItem item1 = new BuildItem("i0", "a1"); - BuildItem item2 = new BuildItem("i0", "a2"); - BuildItem item3 = new BuildItem("i0", "a3"); - BuildItem item4 = new BuildItem("i0", "a4"); - item1.SetMetadata("m", "m1"); - item1.SetMetadata("n", "n1"); - item2.SetMetadata("m", "m2"); - item2.SetMetadata("n", "n2"); - item3.SetMetadata("m", "m2"); - item3.SetMetadata("n", "n2"); - item4.SetMetadata("m", "m3"); - item4.SetMetadata("n", "n3"); - items.AddItem(item1); - items.AddItem(item2); - items.AddItem(item3); - items.AddItem(item4); - Hashtable itemsByName = new Hashtable(StringComparer.OrdinalIgnoreCase); - itemsByName.Add("i0", items); - - Lookup lookup = LookupHelpers.CreateLookup(properties, itemsByName); - - return lookup; - } - - private static IntrinsicTask CreateIntrinsicTask(string content) - { - XmlDocument doc = new XmlDocument(); - doc.LoadXml(content); - - IntrinsicTask task = new IntrinsicTask((XmlElement)doc.FirstChild.FirstChild, - new EngineLoggingServicesInProc(new EventSource(), true, null), - null, - Directory.GetCurrentDirectory(), - new ItemDefinitionLibrary(new Project())); - return task; - } - - private void ExecuteTask(IntrinsicTask task) - { - ExecuteTask(task, null); - } - - private void ExecuteTask(IntrinsicTask task, Lookup lookup) - { - if (lookup == null) - { - lookup = LookupHelpers.CreateEmptyLookup(); - } - - task.ExecuteTask(lookup); - } - - #endregion - } -} diff --git a/src/Deprecated/Engine.UnitTests/InvalidProjectFileException_Tests.cs b/src/Deprecated/Engine.UnitTests/InvalidProjectFileException_Tests.cs deleted file mode 100644 index d11b243c0ef..00000000000 --- a/src/Deprecated/Engine.UnitTests/InvalidProjectFileException_Tests.cs +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Reflection; -using System.Collections; -using System.Runtime.Serialization; -using System.Runtime.Serialization.Formatters.Binary; -using System.IO; -using NUnit.Framework; -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine; -using System.Text.RegularExpressions; - - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class InvalidProjectFileExceptionTests - { - /// - /// Verify I implemented ISerializable correctly - /// - /// LukaszG - [Test] - public void SerializeDeserialize() - { - InvalidProjectFileException e = new InvalidProjectFileException( - "projectFile", - 1, 2, 3, 4, - "message", - "errorSubcategory", - "errorCode", - "helpKeyword"); - - using (MemoryStream memstr = new MemoryStream()) - { - BinaryFormatter frm = new BinaryFormatter(); - - frm.Serialize(memstr, e); - memstr.Position = 0; - - InvalidProjectFileException e2 = (InvalidProjectFileException)frm.Deserialize(memstr); - - Assertion.AssertEquals(e.ColumnNumber, e2.ColumnNumber); - Assertion.AssertEquals(e.EndColumnNumber, e2.EndColumnNumber); - Assertion.AssertEquals(e.EndLineNumber, e2.EndLineNumber); - Assertion.AssertEquals(e.ErrorCode, e2.ErrorCode); - Assertion.AssertEquals(e.ErrorSubcategory, e2.ErrorSubcategory); - Assertion.AssertEquals(e.HasBeenLogged, e2.HasBeenLogged); - Assertion.AssertEquals(e.HelpKeyword, e2.HelpKeyword); - Assertion.AssertEquals(e.LineNumber, e2.LineNumber); - Assertion.AssertEquals(e.Message, e2.Message); - Assertion.AssertEquals(e.ProjectFile, e2.ProjectFile); - } - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/ItemBucket_Tests.cs b/src/Deprecated/Engine.UnitTests/ItemBucket_Tests.cs deleted file mode 100644 index 0df120e2083..00000000000 --- a/src/Deprecated/Engine.UnitTests/ItemBucket_Tests.cs +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Text; -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine; -using Microsoft.Build.BuildEngine.Shared; -using System.Xml; - -using NUnit.Framework; - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class ItemBucket_Tests - { - /// - /// When a bucket is created, it's created for specific item names. After it's created - /// no items of those types should be visible in the bucket (unless they are subsequently added) - /// - [Test] - public void InitiallyNoItemsInBucketOfTypesInItemNames() - { - // This bucket is for items of type "i" - string[] itemNames = new string[] { "i" }; - - // There are items of type "i" and "j" available in the project, though - BuildItemGroup group1 = new BuildItemGroup(); - BuildItemGroup group2 = new BuildItemGroup(); - group1.AddNewItem("i", "i1"); - group2.AddNewItem("j", "j1"); - Hashtable items = new Hashtable(StringComparer.OrdinalIgnoreCase); - items.Add("i", group1); - items.Add("j", group2); - Lookup lookup = LookupHelpers.CreateLookup(items); - - ItemBucket bucket = new ItemBucket(itemNames, new Dictionary(), lookup, 0); - - // No items of type i - Assertion.AssertEquals(0, bucket.Lookup.GetItems("i1").Count); - // Items of type j, however, are visible - Assertion.AssertEquals(1, bucket.Lookup.GetItems("j").Count); - } - - } -} diff --git a/src/Deprecated/Engine.UnitTests/ItemDefinitionLibrary_Tests.cs b/src/Deprecated/Engine.UnitTests/ItemDefinitionLibrary_Tests.cs deleted file mode 100644 index b058f26bc06..00000000000 --- a/src/Deprecated/Engine.UnitTests/ItemDefinitionLibrary_Tests.cs +++ /dev/null @@ -1,239 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections.Generic; -using System.Text; -using NUnit.Framework; -using System.Xml; -using Microsoft.Build.BuildEngine; -using Microsoft.Build.BuildEngine.Shared; -using Metadatum = System.Collections.Generic.KeyValuePair; -using MetadataDictionary = System.Collections.Generic.Dictionary; -using ItemDefinitionsDictionary = System.Collections.Generic.Dictionary>; - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class ItemDefinitionLibrary_Tests - { - [Test] - [ExpectedException(typeof(InternalErrorException))] - public void GetMetadataBeforeEvaluate() - { - XmlElement group = XmlTestUtilities.CreateBasicElement("ItemDefinitionGroup"); - - ItemDefinitionLibrary library = new ItemDefinitionLibrary(new Project()); - library.Add(group); - library.GetDefaultMetadataValue("ccompile", "defines"); - } - - [Test] - public void Basic() - { - XmlElement group = XmlTestUtilities.CreateBasicElement("ItemDefinitionGroup"); - XmlElement item = XmlTestUtilities.AddChildElement(group, "CCompile"); - XmlElement meta = XmlTestUtilities.AddChildElementWithInnerText(item, "Defines", "DEBUG"); - - ItemDefinitionLibrary library = new ItemDefinitionLibrary(new Project()); - library.Add(group); - library.Evaluate(null); - - Assertion.AssertEquals("DEBUG", library.GetDefaultMetadataValue("ccompile", "defines")); - } - - [Test] - public void SameGroupTwoChildrenSameItemTypeDifferentMetadata() - { - XmlElement group = XmlTestUtilities.CreateBasicElement("ItemDefinitionGroup"); - XmlElement item1 = XmlTestUtilities.AddChildElement(group, "CCompile"); - XmlElement meta1 = XmlTestUtilities.AddChildElementWithInnerText(item1, "Defines", "DEBUG"); - XmlElement item2 = XmlTestUtilities.AddChildElement(group, "CCompile"); - XmlElement meta2 = XmlTestUtilities.AddChildElementWithInnerText(item1, "WarningLevel", "W4"); - - ItemDefinitionLibrary library = new ItemDefinitionLibrary(new Project()); - library.Add(group); - library.Evaluate(null); - - Assertion.AssertEquals("DEBUG", library.GetDefaultMetadataValue("ccompile", "defines")); - Assertion.AssertEquals("W4", library.GetDefaultMetadataValue("ccompile", "warninglevel")); - } - - [Test] - public void SameGroupTwoChildrenDifferentItemType() - { - XmlElement group = XmlTestUtilities.CreateBasicElement("ItemDefinitionGroup"); - XmlElement item1 = XmlTestUtilities.AddChildElement(group, "CCompile"); - XmlElement meta1 = XmlTestUtilities.AddChildElementWithInnerText(item1, "Defines", "DEBUG"); - XmlElement item2 = XmlTestUtilities.AddChildElement(group, "CppCompile"); - XmlElement meta2 = XmlTestUtilities.AddChildElementWithInnerText(item2, "WarningLevel", "W4"); - - ItemDefinitionLibrary library = new ItemDefinitionLibrary(new Project()); - library.Add(group); - library.Evaluate(null); - - Assertion.AssertEquals("DEBUG", library.GetDefaultMetadataValue("ccompile", "defines")); - Assertion.AssertEquals("W4", library.GetDefaultMetadataValue("CppCompile", "warninglevel")); - Assertion.AssertEquals(null, library.GetDefaultMetadataValue("CppCompile", "defines")); - } - - [Test] - public void TwoGroups() - { - XmlElement group1 = XmlTestUtilities.CreateBasicElement("ItemDefinitionGroup"); - XmlElement item1 = XmlTestUtilities.AddChildElement(group1, "CCompile"); - XmlElement meta1 = XmlTestUtilities.AddChildElementWithInnerText(item1, "Defines", "DEBUG"); - XmlElement group2 = XmlTestUtilities.CreateBasicElement("ItemDefinitionGroup"); - XmlElement item2 = XmlTestUtilities.AddChildElement(group2, "CppCompile"); - XmlElement meta2 = XmlTestUtilities.AddChildElementWithInnerText(item2, "WarningLevel", "W4"); - - ItemDefinitionLibrary library = new ItemDefinitionLibrary(new Project()); - library.Add(group1); - library.Add(group2); - library.Evaluate(null); - - Assertion.AssertEquals("DEBUG", library.GetDefaultMetadataValue("ccompile", "defines")); - Assertion.AssertEquals("W4", library.GetDefaultMetadataValue("CppCompile", "warninglevel")); - Assertion.AssertEquals(null, library.GetDefaultMetadataValue("CppCompile", "defines")); - } - - [Test] - public void PropertyInMetadataValue() - { - XmlElement group = XmlTestUtilities.CreateBasicElement("ItemDefinitionGroup"); - XmlElement item = XmlTestUtilities.AddChildElement(group, "CCompile"); - XmlElement meta = XmlTestUtilities.AddChildElementWithInnerText(item, "Defines", "$(p1)"); - - ItemDefinitionLibrary library = new ItemDefinitionLibrary(new Project()); - library.Add(group); - BuildPropertyGroup pg1 = new BuildPropertyGroup(); - pg1.SetProperty("p1", "v1"); - library.Evaluate(pg1); - - Assertion.AssertEquals("v1", library.GetDefaultMetadataValue("ccompile", "defines")); - - // Change the original property group -- should not affect the metadata value which was - // already evaluated - pg1.SetProperty("p1", "v1b"); - - Assertion.AssertEquals("v1", library.GetDefaultMetadataValue("ccompile", "defines")); - - // Reevaluate with another property value - BuildPropertyGroup pg2 = new BuildPropertyGroup(); - pg2.SetProperty("p1", "v2"); - library.Evaluate(pg2); - - Assertion.AssertEquals("v2", library.GetDefaultMetadataValue("ccompile", "defines")); - } - - /// - /// Verifies that, given metadata on an item definition, a corresponding item will pick up - /// that item definition metadata. - /// - [Test] - public void ItemsPickUpItemDefinitionMetadata() - { - MockLogger logger = ObjectModelHelpers.BuildProjectExpectSuccess(@" - - - - foo - - - - - - - - - - - - "); - - logger.AssertLogContains("[foo]"); - } - - /// - /// Verifies that, given metadata on an item definition, a corresponding item will pick up - /// that item definition metadata, even if the name of the item has since changed. - /// - [Test] - public void ItemsPickUpItemDefinitionMetadataWithTransforms() - { - MockLogger logger = ObjectModelHelpers.BuildProjectExpectSuccess(@" - - - - foo - - - - - - - - - - - - - - - - "); - - logger.AssertLogContains("[foo]"); - } - - /// - /// Verifies that, given metadata on an item definition, a corresponding item will pick up - /// that item definition metadata even if the definition is in a different project from the item. - /// - [Test] - public void ItemsPickUpItemDefinitionMetadataFromImportedProject() - { - try - { - ObjectModelHelpers.CreateFileInTempProjectDirectory("foo.proj", @" - - - - - - - - - - - - "); - - ObjectModelHelpers.CreateFileInTempProjectDirectory("foo2.proj", @" - - - - foo - - - - - - "); - - MockLogger logger = ObjectModelHelpers.BuildTempProjectFileExpectSuccess("foo.proj"); - - logger.AssertLogContains("[foo]"); - - } - finally - { - ObjectModelHelpers.DeleteTempProjectDirectory(); - } - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/ItemExpander_Tests.cs b/src/Deprecated/Engine.UnitTests/ItemExpander_Tests.cs deleted file mode 100644 index eb909464aef..00000000000 --- a/src/Deprecated/Engine.UnitTests/ItemExpander_Tests.cs +++ /dev/null @@ -1,561 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections; -using NUnit.Framework; -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine; -using Microsoft.Build.BuildEngine.Shared; -using System.Xml; -using System.Text.RegularExpressions; - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class ItemExpanderTest - { - /// - /// Generate a hashtable of items by type with a bunch of sample items, so that we can exercise - /// ItemExpander.ItemizeItemVector. - /// - /// - /// RGoel - private Hashtable GenerateTestItems() - { - Hashtable itemGroupsByType = new Hashtable(StringComparer.OrdinalIgnoreCase); - - // Set up our item group programmatically. - BuildItemGroup itemGroup = new BuildItemGroup(); - itemGroupsByType["Compile"] = itemGroup; - BuildItem a = itemGroup.AddNewItem("Compile", "a.cs"); - a.SetMetadata("WarningLevel", "4"); - BuildItem b = itemGroup.AddNewItem("Compile", "b.cs"); - b.SetMetadata("WarningLevel", "3"); - - BuildItemGroup itemGroup2 = new BuildItemGroup(); - itemGroupsByType["Resource"] = itemGroup2; - BuildItem c = itemGroup2.AddNewItem("Resource", "c.resx"); - - return itemGroupsByType; - } - - /// - /// Expand item vectors, basic case - /// - /// danmose - [Test] - public void ExpandEmbeddedItemVectorsBasic() - { - Hashtable itemGroupsByType = this.GenerateTestItems(); - - XmlNode foo = new XmlDocument().CreateElement("Foo"); - string evaluatedString = ItemExpander.ExpandEmbeddedItemVectors("@(Compile)", foo, LookupHelpers.CreateLookup(itemGroupsByType).ReadOnlyLookup); - Assertion.AssertEquals("a.cs;b.cs", evaluatedString); - } - - /// - /// Expand item vectors, macro expansion - /// - /// danmose - [Test] - public void ExpandEmbeddedItemVectorsMacroExpansion() - { - Hashtable itemGroupsByType = this.GenerateTestItems(); - - XmlNode foo = new XmlDocument().CreateElement("Foo"); - string evaluatedString = ItemExpander.ExpandEmbeddedItemVectors("@(Compile->'%(filename)')", foo, LookupHelpers.CreateLookup(itemGroupsByType).ReadOnlyLookup); - Assertion.AssertEquals("a;b", evaluatedString); - } - - /// - /// Expand item vectors, separator - /// - /// danmose - [Test] - public void ExpandEmbeddedItemVectorsSeparator() - { - Hashtable itemGroupsByType = this.GenerateTestItems(); - - XmlNode foo = new XmlDocument().CreateElement("Foo"); - string evaluatedString = ItemExpander.ExpandEmbeddedItemVectors("@(Compile, '#')", foo, LookupHelpers.CreateLookup(itemGroupsByType).ReadOnlyLookup); - Assertion.AssertEquals("a.cs#b.cs", evaluatedString); - } - /// - /// Expand item vectors, multiple vectors - /// - /// danmose - [Test] - public void ExpandEmbeddedItemVectorsMultiple() - { - Hashtable itemGroupsByType = this.GenerateTestItems(); - - XmlNode foo = new XmlDocument().CreateElement("Foo"); - string evaluatedString = ItemExpander.ExpandEmbeddedItemVectors("...@(Compile)...@(Resource)...", foo, LookupHelpers.CreateLookup(itemGroupsByType).ReadOnlyLookup); - Assertion.AssertEquals("...a.cs;b.cs...c.resx...", evaluatedString); - } - - /// - /// Expand item vectors, macro expansion and separator - /// - /// danmose - [Test] - public void ExpandEmbeddedItemVectorsSeparatorAndMacroExpansion() - { - Hashtable itemGroupsByType = this.GenerateTestItems(); - - XmlNode foo = new XmlDocument().CreateElement("Foo"); - string evaluatedString = ItemExpander.ExpandEmbeddedItemVectors("@(Compile->'%(filename)','#')", foo, LookupHelpers.CreateLookup(itemGroupsByType).ReadOnlyLookup); - Assertion.AssertEquals("a#b", evaluatedString); - } - - /// - /// Expand item vectors, no vectors - /// - /// danmose - [Test] - public void ExpandEmbeddedItemVectorsNoVectors() - { - Hashtable itemGroupsByType = this.GenerateTestItems(); - - XmlNode foo = new XmlDocument().CreateElement("Foo"); - string evaluatedString = ItemExpander.ExpandEmbeddedItemVectors("blah", foo, LookupHelpers.CreateLookup(itemGroupsByType).ReadOnlyLookup); - Assertion.AssertEquals("blah", evaluatedString); - } - - /// - /// Expand item vectors, empty - /// - /// danmose - [Test] - public void ExpandEmbeddedItemVectorsEmpty() - { - Hashtable itemGroupsByType = this.GenerateTestItems(); - - XmlNode foo = new XmlDocument().CreateElement("Foo"); - string evaluatedString = ItemExpander.ExpandEmbeddedItemVectors(String.Empty, foo, LookupHelpers.CreateLookup(itemGroupsByType).ReadOnlyLookup); - Assertion.AssertEquals(String.Empty, evaluatedString); - } - - /// - /// Itemize a normal item vector -- @(Compile) - /// - /// RGoel - [Test] - public void ItemizeItemVectorNormal() - { - Hashtable itemGroupsByType = this.GenerateTestItems(); - - BuildItemGroup compileItems = ItemExpander.ItemizeItemVector("@(Compile)", null, LookupHelpers.CreateLookup(itemGroupsByType).ReadOnlyLookup); - - Assertion.AssertEquals("Resulting item group should have 2 items", 2, compileItems.Count); - Assertion.AssertEquals("First item should be a.cs", "a.cs", compileItems[0].FinalItemSpecEscaped); - Assertion.AssertEquals("First item WarningLevel should be 4", "4", compileItems[0].GetMetadata("WarningLevel")); - Assertion.AssertEquals("First item should be b.cs", "b.cs", compileItems[1].FinalItemSpecEscaped); - Assertion.AssertEquals("First item WarningLevel should be 3", "3", compileItems[1].GetMetadata("WarningLevel")); - } - - /// - /// Attempt to itemize an expression that is an @(...) item list concatenated with another string. - /// - /// RGoel - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void ItemizeItemVectorWithConcatenation() - { - Hashtable itemGroupsByType = this.GenerateTestItems(); - - BuildItemGroup compileItems = ItemExpander.ItemizeItemVector("@(Compile)foo", null, LookupHelpers.CreateLookup(itemGroupsByType).ReadOnlyLookup); - } - - /// - /// Attempt to itemize an expression that is in fact not an item list at all. - /// - /// RGoel - [Test] - public void ItemizeItemVectorWithNoItemLists() - { - Hashtable itemGroupsByType = this.GenerateTestItems(); - - BuildItemGroup compileItems = ItemExpander.ItemizeItemVector("foobar", null, LookupHelpers.CreateLookup(itemGroupsByType).ReadOnlyLookup); - - // If the specified expression does not contain any item lists, then we expect ItemizeItemVector - // to give us back null, but not throw an exception. - Assertion.AssertNull(compileItems); - } - - /// - /// Verify that an item list reference *with a separator* produces a scalar when itemized - /// - /// LukaszG - [Test] - public void ItemizeItemVectorWithSeparator() - { - Hashtable itemGroupsByType = this.GenerateTestItems(); - - Match disposableMatch; - BuildItemGroup compileItems = ItemExpander.ItemizeItemVector("@(Compile, ' ')", null, LookupHelpers.CreateLookup(itemGroupsByType).ReadOnlyLookup, out disposableMatch); - - // @(Compile, ' ') is a scalar, so we should only have one item in the resulting item group - Assertion.AssertEquals(1, compileItems.Count); - Assertion.Assert(compileItems[0].Include == "a.cs b.cs"); - } - - /// - /// Verify that an item list reference *with a separator* produces a scalar when itemized. - /// This test makes sure that bucketed items take precedence over the full set of items in the project. - /// - /// LukaszG - [Test] - public void ItemizeItemVectorWithSeparatorBucketed() - { - Hashtable itemGroupsByType = this.GenerateTestItems(); - Lookup lookup = LookupHelpers.CreateLookup(itemGroupsByType); - - lookup.EnterScope(); - lookup.PopulateWithItem(new BuildItem("Compile", "c.cs")); - lookup.PopulateWithItem(new BuildItem("Compile", "d.cs")); - - Match disposableMatch; - BuildItemGroup compileItems = ItemExpander.ItemizeItemVector("@(Compile, ' ')", null, new ReadOnlyLookup(lookup), out disposableMatch); - - // @(Compile, ' ') is a scalar, so we should only have one item in the resulting item group - Assertion.AssertEquals(1, compileItems.Count); - Assertion.Assert(compileItems[0].Include == "c.cs d.cs"); - } - - /// - /// Regression test for bug 534115. Using an item separator when there are no items in the list. - /// - /// RGoel - [Test] - public void ItemizeItemVectorWithSeparatorWithZeroItems1() - { - Hashtable itemGroupsByType = this.GenerateTestItems(); - - Match disposableMatch; - BuildItemGroup zeroItems = ItemExpander.ItemizeItemVector("@(ItemThatDoesNotExist, ' ')", null, LookupHelpers.CreateLookup(itemGroupsByType).ReadOnlyLookup, out disposableMatch); - - Assertion.AssertEquals(0, zeroItems.Count); - } - - /// - /// Regression test for bug 534115. Using an item separator when there are no items in the list. - /// - /// RGoel - [Test] - public void ItemizeItemVectorWithSeparatorWithZeroItems2() - { - MockLogger logger = ObjectModelHelpers.BuildProjectExpectSuccess(@" - - - - - - - - - - - - - - - '', '!')`> - - - - - - - - "); - - logger.AssertLogContains("zz=[]"); - } - - // Valid names. The goal here is that an item name is recognized iff it is valid - // in a project. (That is, iff it matches "[A-Za-z_][A-Za-z_0-9\-]*") - private string[] validItemVectors = new string[] - { - "@( a1234567890_-AXZaxz )", - "@(z1234567890_-AZaz)", - "@(A1234567890_-AZaz)", - "@(Z1234567890_-AZaz)", - "@(x1234567890_-AZaz)", - "@(_X)", - "@(a)", - "@(_)" - }; - - // Invalid item names - private string[] invalidItemVectors = new string[] - { - "@(Com pile)", - "@(Com.pile)", - "@(Com%pile)", - "@(Com:pile)", - "@(.Compile)", - "@(%Compile)", - "@(:Compile)", - "@(-Compile)", - "@(1Compile)", - "@()", - "@( )" - }; - - private string[] validMetadataExpressions = new string[] - { - "%( a1234567890_-AXZaxz.a1234567890_-AXZaxz )", - "%(z1234567890_-AZaz.z1234567890_-AZaz)", - "%(A1234567890_-AZaz.A1234567890_-AZaz)", - "%(Z1234567890_-AZaz.Z1234567890_-AZaz)", - "%(x1234567890_-AZaz.x1234567890_-AZaz)", - "%(abc._X)", - "%(a12.a)", - "%(x._)", - "%(a1234567890_-AXZaxz)", - "%(z1234567890_-AZaz)", - "%(A1234567890_-AZaz)", - "%(Z1234567890_-AZaz)", - "%(x1234567890_-AZaz)", - "%(_X)", - "%(a)", - "%(_)" - }; - - private string[] invalidMetadataExpressions = new string[] - { - "%(Com pile.Com pile)", - "%(Com.pile.Com.pile)", - "%(Com%pile.Com%pile)", - "%(Com:pile.Com:pile)", - "%(.Compile)", - "%(Compile.)", - "%(%Compile.%Compile)", - "%(:Compile.:Compile)", - "%(-Compile.-Compile)", - "%(1Compile.1Compile)", - "%()", - "%(.)", - "%( )", - "%(Com pile)", - "%(Com%pile)", - "%(Com:pile)", - "%(.Compile)", - "%(%Compile)", - "%(:Compile)", - "%(-Compile)", - "%(1Compile)" - }; - - private string[] validItemVectorsWithTransforms = new string[] - { - "@(z1234567890_-AXZaxz -> '%(a1234567890_-AXZaxz).%(adfas)' )", - "@(a1234567890_-AZaz->'z1234567890_-AZaz')", - "@(A1234567890_-AZaz ->'A1234567890_-AZaz')", - "@(Z1234567890_-AZaz -> 'Z1234567890_-AZaz')", - "@(x1234567890_-AZaz->'x1234567890_-AZaz')", - "@(_X->'_X')", - "@(a->'a')", - "@(_->'@#$%$%^&*&*)')" - }; - - private string[] validItemVectorsWithSeparators = new string[] - { - "@(a1234567890_-AXZaxz , 'z123%%4567890_-AXZaxz' )", - "@(z1234567890_-AZaz,'a1234567890_-AZaz')", - "@(A1234567890_-AZaz,'!@#$%^&*)(_+'))", - "@(_X,'X')", - "@(a , 'a')", - "@(_,'@#$%$%^&*&*)')" - }; - - private string[] validItemVectorsWithTransformsAndSeparators = new string[] - { - "@(a1234567890_-AXZaxz -> 'a1234567890_-AXZaxz' , 'z1234567890_-AXZaxz' )", - "@(z1234567890_-AZaz->'z1234567890_-AZaz','a1234567890_-AZaz')", - "@(A1234567890_-AZaz ->'A1234567890_-AZaz' , '!@#$%^&*)(_+'))", - "@(_X->'_X','X')", - "@(a->'a' , 'a')", - "@(_->'@#$%$%^&*&*)','@#$%$%^&*&*)')" - }; - - private string[] invalidItemVectorsWithTransforms = new string[] - { - "@(z123456.7890_-AXZaxz -> '%(a1234567890_-AXZaxz).%(adfas)' )", - "@(a1234:567890_-AZaz->'z1234567890_-AZaz')", - "@(.A1234567890_-AZaz ->'A1234567890_-AZaz')", - "@(:Z1234567890_-AZaz -> 'Z1234567890_-AZaz')", - "@(x123 4567890_-AZaz->'x1234567890_-AZaz')", - "@(-x->'_X')", - "@(1->'a')", - "@(1x->'@#$%$%^&*&*)')" - }; - - /// - /// Ensure that valid item list expressions are matched. - /// This tests "itemVectorPattern". - /// - /// danmose - [Test] - public void ItemizeItemVectorsWithValidNames() - { - Hashtable itemGroupsByType = this.GenerateTestItems(); - - foreach (string candidate in validItemVectors) - { - Assertion.AssertNotNull(candidate, ItemExpander.ItemizeItemVector(candidate, null, LookupHelpers.CreateLookup(itemGroupsByType).ReadOnlyLookup)); - } - foreach (string candidate in validItemVectorsWithTransforms) - { - Assertion.AssertNotNull(candidate, ItemExpander.ItemizeItemVector(candidate, null, LookupHelpers.CreateLookup(itemGroupsByType).ReadOnlyLookup)); - } - } - - /// - /// Ensure that leading sand trailing pace is ignored for the item name - /// This tests "itemVectorPattern". - /// - /// danmose - [Test] - public void ItemizeItemVectorsWithLeadingAndTrailingSpaces() - { - Hashtable itemGroupsByType = this.GenerateTestItems(); - - // Spaces around are fine, but it's ignored for the item name - BuildItemGroup items = ItemExpander.ItemizeItemVector("@( Compile )", null, LookupHelpers.CreateLookup(itemGroupsByType).ReadOnlyLookup); - Assertion.AssertEquals("Resulting item group should have 2 items", 2, items.Count); - } - - /// - /// Ensure that invalid item list expressions are not matched. - /// This tests "itemVectorPattern". - /// - /// danmose - [Test] - public void ItemizeItemVectorsWithInvalidNames() - { - Hashtable itemGroupsByType = this.GenerateTestItems(); - - // First, verify that a valid but simply non-existent item list returns an empty BuildItemGroup, - // not just null. - BuildItemGroup control = ItemExpander.ItemizeItemVector("@(nonexistent)", null, LookupHelpers.CreateLookup(itemGroupsByType).ReadOnlyLookup); - Assertion.AssertEquals(0, control.Count); - - foreach (string candidate in invalidItemVectors) - { - Assertion.AssertNull(candidate, ItemExpander.ItemizeItemVector(candidate, null, LookupHelpers.CreateLookup(itemGroupsByType).ReadOnlyLookup)); - } - } - - /// - /// This tests "listOfItemVectorsWithoutSeparatorsPattern" - /// - /// danmose - [Test] - public void ListOfItemVectorsWithoutSeparatorsPattern() - { - // Positive cases - foreach (string candidate in validItemVectorsWithTransforms) - { - Assertion.Assert(candidate, ItemExpander.listOfItemVectorsWithoutSeparatorsPattern.IsMatch(candidate)); - } - // Negative cases - foreach (string candidate in invalidItemVectors) - { - Assertion.Assert(candidate, !ItemExpander.listOfItemVectorsWithoutSeparatorsPattern.IsMatch(candidate)); - } - } - - /// - /// This tests "itemVectorPattern" - /// - /// danmose - [Test] - public void ItemVectorPattern() - { - // Positive cases - foreach (string candidate in validItemVectorsWithTransforms) - { - Assertion.Assert(candidate, ItemExpander.itemVectorPattern.IsMatch(candidate)); - } - foreach (string candidate in validItemVectorsWithSeparators) - { - Assertion.Assert(candidate, ItemExpander.itemVectorPattern.IsMatch(candidate)); - } - foreach (string candidate in validItemVectorsWithTransformsAndSeparators) - { - Assertion.Assert(candidate, ItemExpander.itemVectorPattern.IsMatch(candidate)); - } - } - - /// - /// This tests "itemMetadataPattern" - /// - /// danmose - [Test] - public void ItemMetadataPattern() - { - // Positive cases - foreach (string candidate in validMetadataExpressions) - { - Assertion.Assert(candidate, ItemExpander.itemMetadataPattern.IsMatch(candidate)); - } - // Negative cases - foreach (string candidate in invalidMetadataExpressions) - { - Assertion.Assert(candidate, !ItemExpander.itemMetadataPattern.IsMatch(candidate)); - } - } - - // ProjectWriter has regular expressions that must match these same expressions. Test them here, - // too, so we can re-use the same sample expressions. - - /// - /// ItemVectorTransformPattern should match any item expressions containing transforms. - /// - /// danmose - [Test] - public void ProjectWriterItemVectorTransformPattern() - { - // Positive cases - foreach (string candidate in validItemVectorsWithTransforms) - { - Assertion.Assert(candidate, ProjectWriter.itemVectorTransformPattern.IsMatch(candidate)); - } - foreach (string candidate in validItemVectorsWithTransformsAndSeparators) - { - Assertion.Assert(candidate, ProjectWriter.itemVectorTransformPattern.IsMatch(candidate)); - } - } - - /// - /// itemVectorTransformRawPattern should match any item expressions containing transforms. - /// - /// danmose - [Test] - public void ProjectWriterItemVectorTransformRawPattern() - { - // Positive cases - foreach (string candidate in validItemVectorsWithTransforms) - { - Assertion.Assert(candidate, ProjectWriter.itemVectorTransformRawPattern.IsMatch(candidate)); - } - foreach (string candidate in validItemVectorsWithTransformsAndSeparators) - { - Assertion.Assert(candidate, ProjectWriter.itemVectorTransformRawPattern.IsMatch(candidate)); - } - // Negative cases - foreach (string candidate in invalidItemVectorsWithTransforms) - { - Assertion.Assert(candidate, !ProjectWriter.itemVectorTransformRawPattern.IsMatch(candidate)); - } - } - - } -} diff --git a/src/Deprecated/Engine.UnitTests/Item_Tests.cs b/src/Deprecated/Engine.UnitTests/Item_Tests.cs deleted file mode 100644 index 2e87f865741..00000000000 --- a/src/Deprecated/Engine.UnitTests/Item_Tests.cs +++ /dev/null @@ -1,645 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Text; -using System.IO; -using System.Xml; -using NUnit.Framework; -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine; - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class Item_Tests - { - /// - /// Both Include and Exclude should be unescaped before one is subtracted from the other - /// - [Test] - public void IncludeAndExcludeUnescaping() - { - string tempFolder = Path.Combine(Path.GetTempPath(), "IncludeAndExcludeUnescaping"); - string matchesFoo = Path.Combine(tempFolder, "*"); - string foo = Path.Combine(tempFolder, "foo"); - StreamWriter sw = null; - - try - { - Directory.CreateDirectory(tempFolder); - sw = File.CreateText(foo); - - string projectContents = String.Format(@" - - - - - - - - - - - - - - - - - ", foo, matchesFoo); - - Project project = ObjectModelHelpers.CreateInMemoryProject(projectContents); - - BuildItemGroup i1Items = project.GetEvaluatedItemsByName("i1"); - BuildItemGroup i2Items = project.GetEvaluatedItemsByName("i2"); - BuildItemGroup i3Items = project.GetEvaluatedItemsByName("i3"); - BuildItemGroup i4Items = project.GetEvaluatedItemsByName("i4"); - BuildItemGroup i5Items = project.GetEvaluatedItemsByName("i5"); - BuildItemGroup i6Items = project.GetEvaluatedItemsByName("i6"); - BuildItemGroup i7Items = project.GetEvaluatedItemsByName("i7"); - BuildItemGroup i8Items = project.GetEvaluatedItemsByName("i8"); - BuildItemGroup i9Items = project.GetEvaluatedItemsByName("i9"); - BuildItemGroup i10Items = project.GetEvaluatedItemsByName("i10"); - BuildItemGroup i11Items = project.GetEvaluatedItemsByName("i11"); - BuildItemGroup i12Items = project.GetEvaluatedItemsByName("i12"); - Assertion.Assert(") should exclude )", i1Items.Count == 0); - Assertion.Assert("%29 should exclude %29", i2Items.Count == 0); - Assertion.Assert(") should exclude %29", i3Items.Count == 0); - Assertion.Assert("%29 should exclude )", i4Items.Count == 0); - Assertion.Assert("%29 should exclude ) from );x", i5Items.Count == 1 && i5Items[0].FinalItemSpecEscaped == "x"); - Assertion.Assert("y should not exclude x", i6Items.Count == 1 && i6Items[0].FinalItemSpecEscaped == "x"); - Assertion.Assert("empty include, y exclude", i7Items.Count == 0); - Assertion.Assert("x include, empty exclude", i8Items.Count == 1 && i8Items[0].FinalItemSpecEscaped == "x"); - Assertion.Assert(") should exclude both from );%29", i9Items.Count == 0); - Assertion.Assert("%2a should exclude %2a", i10Items.Count == 0); - Assertion.Assert("* matching foo should exclude foo", i11Items.Count == 0); - Assertion.Assert("* should exclude *", i12Items.Count == 0); - } - finally - { - if (null != sw) sw.Close(); - File.Delete(foo); - Directory.Delete(tempFolder); - } - } - - [Test] - public void ItemMetadataShouldBeEvaluatedEarly() - { - string projectOriginalContents = @" - - - - - - @(CultureItem) - - - - - - "; - - Project project = ObjectModelHelpers.CreateInMemoryProject(projectOriginalContents); - - BuildItemGroup compileItems = project.GetEvaluatedItemsByName("Compile"); - string evaluatedCulture = compileItems[0].GetEvaluatedMetadata("Culture"); - - Assertion.AssertEquals("Culture should be 'spanish'", "spanish", evaluatedCulture); - } - - [Test] - public void HasMetadataAndGetItemMetadata() - { - string projectContents = @" - - - - - - klingon - - - - - - - - - vulcan - - - - - "; - - Project project = ObjectModelHelpers.CreateInMemoryProject(projectContents); - - BuildItemGroup iItems = project.GetEvaluatedItemsByName("i"); - // I believe it is safe to assume ordering as ItemGroup is backed up by an ArrayList - Assertion.Assert(iItems[0].FinalItemSpecEscaped == "i1"); - Assertion.Assert(!iItems[0].HasMetadata("Culture")); // Does not have it - Assertion.Assert(iItems[1].FinalItemSpecEscaped == "i2"); - Assertion.Assert(iItems[1].HasMetadata("Culture")); - Assertion.Assert(iItems[1].HasMetadata("CuLtUrE")); - Assertion.Assert(iItems[1].GetMetadata("CuLtUrE") == "klingon"); - Assertion.Assert(iItems[2].FinalItemSpecEscaped == "i3"); - Assertion.Assert(iItems[2].HasMetadata("Culture")); - Assertion.Assert(iItems[2].GetMetadata("Culture") == ""); - Assertion.Assert(iItems[3].FinalItemSpecEscaped == "i4"); - Assertion.Assert(iItems[3].HasMetadata("Culture")); - Assertion.Assert(iItems[3].GetMetadata("Culture") == ""); - Assertion.Assert(iItems[4].FinalItemSpecEscaped == "i1"); - Assertion.Assert(iItems[4].HasMetadata("Culture")); - Assertion.Assert(iItems[4].GetMetadata("Culture") == "vulcan"); - } - - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void HasMetadataPassNull() - { - string projectContents = @" - - - - - - "; - - Project project = ObjectModelHelpers.CreateInMemoryProject(projectContents); - - BuildItemGroup iItems = project.GetEvaluatedItemsByName("i"); - iItems[0].HasMetadata(null); - } - - [Test] - [ExpectedException(typeof(ArgumentException))] - public void HasMetadataPassEmpty() - { - string projectContents = @" - - - - - - "; - - Project project = ObjectModelHelpers.CreateInMemoryProject(projectContents); - - BuildItemGroup iItems = project.GetEvaluatedItemsByName("i"); - iItems[0].HasMetadata(""); - } - - [Test] - public void HasMetadataBuiltInMetadata() - { - string projectContents = @" - - - - - - "; - - Project project = ObjectModelHelpers.CreateInMemoryProject(projectContents); - - BuildItemGroup iItems = project.GetEvaluatedItemsByName("i"); - Assertion.Assert(iItems[0].HasMetadata("Filename")); - Assertion.Assert("i1" == iItems[0].GetMetadata("Filename")); - } - - [Test] - public void HasMetadataInvalidName() - { - string projectContents = @" - - - - - - "; - - Project project = ObjectModelHelpers.CreateInMemoryProject(projectContents); - - BuildItemGroup iItems = project.GetEvaluatedItemsByName("i"); - // Shouldn't check whether the attribute /could/ exist (it couldn't) - // just return that it doesn't. - Assertion.Assert(!iItems[0].HasMetadata("_!@#$%^&*()")); - } - - /// - /// Verify we can't create items with invalid names in projects - /// - /// LukaszG - [Test] - public void InvalidItemNameInProject() - { - bool fExceptionCaught = false; - try - { - Project p = ObjectModelHelpers.CreateInMemoryProject - ( - "" - + " " - + " " - + " " - + " " - + "" - ); - } - catch (InvalidProjectFileException) - { - fExceptionCaught = true; - } - Assertion.Assert(fExceptionCaught); - } - - /// - /// Verify we can't create items with invalid names directly - /// - /// LukaszG - [Test] - public void InvalidItemNameDirectPrivateCreate() - { - bool fExceptionCaught = false; - try - { - XmlDocument doc = new XmlDocument(); - doc.LoadXml(""); - XmlElement element = doc.DocumentElement; - BuildItem item = new BuildItem(doc.DocumentElement, false, new ItemDefinitionLibrary(new Project())); - } - catch (InvalidProjectFileException) - { - fExceptionCaught = true; - } - Assertion.Assert(fExceptionCaught); - } - - /// - /// Verify we can't create items with invalid names directly - /// - /// LukaszG - [Test] - public void InvalidItemNameDirectPublicCreate() - { - bool fExceptionCaught = false; - try - { - BuildItem item = new BuildItem("Choose", "blah"); - } - catch (InvalidOperationException) - { - fExceptionCaught = true; - } - Assertion.Assert(fExceptionCaught); - } - - /// - /// Verify we can't create items with invalid names directly - /// - /// LukaszG - [Test] - public void InvalidItemNameDirectPublicCreate2() - { - bool fExceptionCaught = false; - try - { - BuildItem item = new BuildItem("Choose", new TaskItem("blah")); - } - catch (InvalidOperationException) - { - fExceptionCaught = true; - } - Assertion.Assert(fExceptionCaught); - } - - /// - /// Verify we can't create items with invalid names directly - /// - /// LukaszG - [Test] - public void InvalidItemNameDirectPrivateCreate2() - { - bool fExceptionCaught = false; - try - { - XmlDocument doc = new XmlDocument(); - doc.LoadXml(""); - BuildItem item = new BuildItem(doc, "Choose", "value", new ItemDefinitionLibrary(new Project())); - } - catch (InvalidOperationException) - { - fExceptionCaught = true; - } - Assertion.Assert(fExceptionCaught); - } - - /// - /// Verify we can't create items with invalid names by renaming a valid item - /// - /// LukaszG - [Test] - public void InvalidItemNameRename() - { - bool fExceptionCaught = false; - BuildItem item = new BuildItem("my", "precioussss"); - try - { - item.Name = "Choose"; - } - catch (InvalidOperationException) - { - fExceptionCaught = true; - } - Assertion.Assert(fExceptionCaught); - } - - /// - /// Verify we can't create items with invalid metadata names in projects - /// - /// LukaszG - [Test] - public void InvalidItemMetadataNameInProject() - { - bool fExceptionCaught = false; - try - { - Project p = ObjectModelHelpers.CreateInMemoryProject - ( - "" - + " " - + " " - + " " - + " " - + "" - ); - } - catch (InvalidProjectFileException) - { - fExceptionCaught = true; - } - Assertion.Assert(fExceptionCaught); - } - - /// - /// Verify we can't create items with invalid names by renaming a valid item - /// - /// LukaszG - [Test] - public void InvalidItemMetadataNameRename() - { - bool fExceptionCaught = false; - BuildItem item = new BuildItem("my", "precioussss"); - try - { - item.SetMetadata("Choose", "blah"); - } - catch (InvalidOperationException) - { - fExceptionCaught = true; - } - Assertion.Assert(fExceptionCaught); - } - - - /// - /// Verify invalid item names are caught, where the names are valid Xml Element names. - /// - /// danmose - [Test] - public void InvalidCharInItemNameInProject() - { - bool exceptionCaught = false; - try - { - Project p = ObjectModelHelpers.CreateInMemoryProject - ( - "" - + " <\u03A3/>" // \u03A3 == sigma - + " " - + " " - + " " - + "" - ); - } - catch (InvalidProjectFileException) - { - exceptionCaught = true; - } - Assertion.Assert(exceptionCaught); - } - - /// - /// Verify invalid metadata names are caught, where the names are valid Xml Element names. - /// - /// danmose - [Test] - public void InvalidCharInMetadataNameInProject() - { - bool exceptionCaught = false; - try - { - Project p = ObjectModelHelpers.CreateInMemoryProject - ( - "" - + " " // \u03A3 == sigma - + " " - + " " - + " " - + "" - ); - } - catch (InvalidProjectFileException) - { - exceptionCaught = true; - } - Assertion.Assert(exceptionCaught); - } - - internal static string[] validItemPropertyMetadataNames = new string[] - { - "x", - "x1", - "_x", - "_1-", - "aa1" - }; - - internal static string[] invalidItemPropertyMetadataNames = new string[] - { - " ", - "$", - "@", - "(", - ")", - "%", - "*", - "?", - ".", - " ", - "1", - "\n", - ":", - "xxx$", - "xxx@", - "xxx(", - "xxx)", - "xxx%", - "xxx*", - "xxx?", - "xxx.", - "xxx:", - "\u03A3", // sigma is a valid XML element name, but invalid item/property name - "a\u03A3", - "aa\u03A3" - }; - - /// - /// Check the valid names are accepted - /// - [Test] - public void ValidName() - { - foreach (string candidate in validItemPropertyMetadataNames) - { - TryValidItemName(candidate); - } - } - - /// - /// Check the invalid names are rejected - /// - [Test] - public void InvalidNames() - { - foreach (string candidate in invalidItemPropertyMetadataNames) - { - TryInvalidItemName(candidate); - } - } - - /// - /// Helper for trying invalid item names - /// - /// - private void TryInvalidItemName(string name) - { - XmlDocument doc = new XmlDocument(); - bool caughtException = false; - - // Test the BuildItem ctor - try - { - BuildItem item = new BuildItem(doc, name, "someItemSpec", new ItemDefinitionLibrary(new Project())); - } - catch (ArgumentException ex) - { - Console.WriteLine(ex.Message); - caughtException = true; - } - Assertion.Assert(name, caughtException); - - // Test the Name setter codepath - caughtException = false; - try - { - BuildItem item = new BuildItem(doc, "someName", "someItemSpec", new ItemDefinitionLibrary(new Project())); - item.Name = name; - } - catch (ArgumentException ex) - { - Console.WriteLine(ex.Message); - caughtException = true; - } - Assertion.Assert(name, caughtException); - - // Test the metadata setter codepath - caughtException = false; - try - { - BuildItem item = new BuildItem(doc, "someName", "someItemSpec", new ItemDefinitionLibrary(new Project())); - item.SetMetadata(name, "someValue"); - } - catch (ArgumentException ex) - { - Console.WriteLine(ex.Message); - caughtException = true; - } - Assertion.Assert(name, caughtException); - } - - /// - /// Helper for trying valid item names - /// - /// - private void TryValidItemName(string name) - { - XmlDocument doc = new XmlDocument(); - - BuildItem item = new BuildItem(doc, name, "someItemSpec", new ItemDefinitionLibrary(new Project())); - Assertion.AssertEquals(name, item.Name); - Assertion.AssertEquals("someItemSpec", item.FinalItemSpec); - // Try setter - item.Name = name; - Assertion.AssertEquals(name, item.Name); - } - - [Test] - public void BuildItemToTaskItemAndBack() - { - BuildItem[] buildItems = new BuildItem[2]; - - buildItems[0] = new BuildItem("item1name", "item1$$value"); - buildItems[0].SetMetadata("Something", "Dir\\**"); - buildItems[0].SetMetadata("stupidescaping", "nokidding"); - - buildItems[1] = new BuildItem("item2", "value2"); - buildItems[1].SetMetadata("name", "value"); - buildItems[1].SetMetadata("OtherName", ";Value;"); - - ITaskItem[] pass1 = BuildItem.ConvertBuildItemArrayToTaskItems(buildItems); - - for (int i = 0; i < 2; i++) - { - Assert.AreEqual(pass1[i].ItemSpec, buildItems[i].FinalItemSpec); - foreach (string metadataName in pass1[i].MetadataNames) - { - Assert.AreEqual(pass1[i].GetMetadata(metadataName), buildItems[i].GetEvaluatedMetadata(metadataName)); - } - } - - // This will create nameless BuildItems, so it's a different code path - that's why we need this and - // the following test - BuildItem[] pass2 = BuildItem.ConvertTaskItemArrayToBuildItems(pass1); - - for (int i = 0; i < 2; i++) - { - Assert.AreEqual(pass1[i].ItemSpec, pass2[i].FinalItemSpec); - foreach (string metadataName in pass1[i].MetadataNames) - { - Assert.AreEqual(pass1[i].GetMetadata(metadataName), pass2[i].GetEvaluatedMetadata(metadataName)); - } - } - - ITaskItem[] pass3 = BuildItem.ConvertBuildItemArrayToTaskItems(pass2); - - for (int i = 0; i < 2; i++) - { - Assert.AreEqual(pass3[i].ItemSpec, pass2[i].FinalItemSpec); - foreach (string metadataName in pass3[i].MetadataNames) - { - Assert.AreEqual(pass3[i].GetMetadata(metadataName), pass2[i].GetEvaluatedMetadata(metadataName)); - } - } - - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/LocalNode_Tests.cs b/src/Deprecated/Engine.UnitTests/LocalNode_Tests.cs deleted file mode 100644 index 010afb84108..00000000000 --- a/src/Deprecated/Engine.UnitTests/LocalNode_Tests.cs +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections.Generic; -using System.Text; -using System.IO; - -using NUnit.Framework; - -using Microsoft.Build.BuildEngine; - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class LocalNode_Tests - { - /// - /// Verify when an exception is sent to the DumpExceptionToFile method, that the exception is exception is written to disk - /// - [Test] - public void TestReportUnhandledException() - { - Exception testException = new Exception("Test Exception"); - Exception testException2 = new Exception("Test Exception2"); - string dumpFile = null; - try - { - // Write the exception to the dump file - - LocalNode.DumpExceptionToFile(testException); - LocalNode.DumpExceptionToFile(testException2); - dumpFile = LocalNode.DumpFileName; - - // Read the file and the contents out and make sure they match what is expected - using (StreamReader reader = new StreamReader(dumpFile)) - { - for (int i = 0; i < 2; i++) - { - if (i == 0) - { - Assert.IsTrue(String.Compare(reader.ReadLine(), "UNHANDLED EXCEPTIONS FROM CHILD NODE:", StringComparison.OrdinalIgnoreCase) == 0); - Assert.IsTrue(String.Compare(reader.ReadLine(), "===================", StringComparison.OrdinalIgnoreCase) == 0); - //Skip over the time stamp. - reader.ReadLine(); - // Make sure the exception message is there - Assert.IsTrue(reader.ReadLine().Contains("Test Exception")); - Assert.IsTrue(String.Compare(reader.ReadLine(), "===================", StringComparison.OrdinalIgnoreCase) == 0); - } - else - { - //Skip over the time stamp. - reader.ReadLine(); - Assert.IsTrue(reader.ReadLine().Contains("Test Exception2")); - Assert.IsTrue(String.Compare(reader.ReadLine(), "===================", StringComparison.OrdinalIgnoreCase) == 0); - } - } - } - } - finally - { - if (File.Exists(dumpFile)) - { - File.Delete(dumpFile); - } - } - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/LogFormatter_Tests.cs b/src/Deprecated/Engine.UnitTests/LogFormatter_Tests.cs deleted file mode 100644 index 130a81a5e79..00000000000 --- a/src/Deprecated/Engine.UnitTests/LogFormatter_Tests.cs +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Reflection; -using System.Collections; -using NUnit.Framework; -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine; -using System.Text.RegularExpressions; - - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class LogFormatterTest - { - /* - * Method: TimeSpanMediumDuration - * Owner: jomof - * - * Tests the mainline: a medium length duration - */ - [Test] - public void TimeSpanMediumDuration() - { - TimeSpan t = new TimeSpan(1254544900); - string result = LogFormatter.FormatTimeSpan(t); - Assertion.AssertEquals("00:02:05.45", result); - } - - - /* - * Method: TimeSpanZeroDuration - * Owner: jomof - * - * Format a TimeSpan where the duration is zero. - */ - [Test] - public void TimeSpanZeroDuration() - { - TimeSpan t = new TimeSpan(0); - string result = LogFormatter.FormatTimeSpan(t); - Assertion.AssertEquals("00:00:00", result); - } - - [Test] - public void FormatDateTime() - { - - DateTime testTime = new DateTime(2007 /*Year*/, 08 /*Month*/, 20 /*Day*/, 10 /*Hour*/, 42 /*Minutes*/, 44 /*Seconds*/, 12 /*Milliseconds*/); - string result = LogFormatter.FormatLogTimeStamp(testTime); - Assertion.AssertEquals("10:42:44.012", result); - - testTime = new DateTime(2007, 08, 20, 05, 04, 03, 01); - result = LogFormatter.FormatLogTimeStamp(testTime); - Assertion.AssertEquals("05:04:03.001", result); - - testTime = new DateTime(2007, 08, 20, 0, 0, 0, 0); - result = LogFormatter.FormatLogTimeStamp(testTime); - Assertion.AssertEquals("00:00:00.000", result); - - } - - } - -} - - - - - diff --git a/src/Deprecated/Engine.UnitTests/LoggerDescription_Tests.cs b/src/Deprecated/Engine.UnitTests/LoggerDescription_Tests.cs deleted file mode 100644 index 6e19d450bc8..00000000000 --- a/src/Deprecated/Engine.UnitTests/LoggerDescription_Tests.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections.Generic; -using System.Text; -using NUnit.Framework; -using System.IO; - -using Microsoft.Build.BuildEngine; -using Microsoft.Build.Framework; - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class LoggerDescription_Tests - { - [Test] - public void LoggerDescriptionCustomSerialization() - { - - string className = "Class"; - string loggerAssemblyName = "Class"; - string loggerFileAssembly = null; - string loggerSwitchParameters = "Class"; - LoggerVerbosity verbosity = LoggerVerbosity.Detailed; - - LoggerDescription description = new LoggerDescription(className, loggerAssemblyName, loggerFileAssembly, loggerSwitchParameters, verbosity); - MemoryStream stream = new MemoryStream(); - BinaryWriter writer = new BinaryWriter(stream); - BinaryReader reader = new BinaryReader(stream); - try - { - stream.Position = 0; - description.WriteToStream(writer); - long streamWriteEndPosition = stream.Position; - stream.Position = 0; - LoggerDescription description2 = new LoggerDescription(); - description2.CreateFromStream(reader); - long streamReadEndPosition = stream.Position; - Assert.IsTrue(streamWriteEndPosition == streamReadEndPosition, "Stream end positions should be equal"); - - Assert.IsTrue(description.Verbosity == description2.Verbosity, "Expected Verbosity to Match"); - Assert.IsTrue(description.LoggerId == description2.LoggerId, "Expected Verbosity to Match"); - Assert.IsTrue(string.Compare(description.LoggerSwitchParameters, description2.LoggerSwitchParameters, StringComparison.OrdinalIgnoreCase) == 0, "Expected LoggerSwitchParameters to Match"); - Assert.IsTrue(string.Compare(description.Name, description2.Name, StringComparison.OrdinalIgnoreCase) == 0, "Expected Name to Match"); - } - finally - { - reader.Close(); - writer = null; - stream = null; - } - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/LoggerException_Tests.cs b/src/Deprecated/Engine.UnitTests/LoggerException_Tests.cs deleted file mode 100644 index d8c89af6e3f..00000000000 --- a/src/Deprecated/Engine.UnitTests/LoggerException_Tests.cs +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Reflection; -using System.Collections; -using System.Runtime.Serialization; -using System.Runtime.Serialization.Formatters.Binary; -using System.IO; -using NUnit.Framework; -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine; -using System.Text.RegularExpressions; - - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class InternalLoggerExceptionTests - { - /// - /// Verify I implemented ISerializable correctly - /// - /// LukaszG - [Test] - public void SerializeDeserialize() - { - InternalLoggerException e = new InternalLoggerException("message", - new Exception("innerException"), - new BuildStartedEventArgs("evMessage", "evHelpKeyword"), - "errorCode", - "helpKeyword", - false); - - using (MemoryStream memstr = new MemoryStream()) - { - BinaryFormatter frm = new BinaryFormatter(); - - frm.Serialize(memstr, e); - memstr.Position = 0; - - InternalLoggerException e2 = (InternalLoggerException) frm.Deserialize(memstr); - - Assertion.AssertEquals(e.BuildEventArgs.Message, e2.BuildEventArgs.Message); - Assertion.AssertEquals(e.BuildEventArgs.HelpKeyword, e2.BuildEventArgs.HelpKeyword); - Assertion.AssertEquals(e.ErrorCode, e2.ErrorCode); - Assertion.AssertEquals(e.HelpKeyword, e2.HelpKeyword); - Assertion.AssertEquals(e.Message, e2.Message); - Assertion.AssertEquals(e.InnerException.Message, e2.InnerException.Message); - } - } - } -} - - - - - diff --git a/src/Deprecated/Engine.UnitTests/Lookup_Tests.cs b/src/Deprecated/Engine.UnitTests/Lookup_Tests.cs deleted file mode 100644 index 29fffbb8319..00000000000 --- a/src/Deprecated/Engine.UnitTests/Lookup_Tests.cs +++ /dev/null @@ -1,1035 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Text; -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine; -using Microsoft.Build.BuildEngine.Shared; -using System.Xml; - -using NUnit.Framework; -using System.Threading; - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class Lookup_Tests - { - /// - /// Primary group contains an item for a type and secondary does; - /// primary item should be returned instead of the secondary item. - /// - [Test] - public void SecondaryItemShadowedByPrimaryItem() - { - BuildItemGroup group1 = new BuildItemGroup(); - group1.AddNewItem("i1", "a1"); - Hashtable table1 = new Hashtable(StringComparer.OrdinalIgnoreCase); - table1.Add("i1", group1); - Lookup lookup = LookupHelpers.CreateLookup(table1); - - lookup.EnterScope(); - BuildItemGroup group2 = new BuildItemGroup(); - group2.AddNewItem("i1", "a2"); - lookup.PopulateWithItems("i1", group2); - - // Should return the item from the primary, not the secondary table - Assertion.AssertEquals("a2", lookup.GetItems("i1")[0].FinalItemSpec); - } - - /// - /// Primary group does not contain an item for a type but secondary does; - /// secondary item should be returned. - /// - [Test] - public void SecondaryItemNotShadowedByPrimaryItem() - { - BuildItemGroup group1 = new BuildItemGroup(); - group1.AddNewItem("i1", "a1"); - Hashtable table1 = new Hashtable(StringComparer.OrdinalIgnoreCase); - table1.Add("i1", group1); - Lookup lookup = LookupHelpers.CreateLookup(table1); - - lookup.EnterScope(); - - // Should return item from the secondary table. - Assertion.AssertEquals("a1", lookup.GetItems("i1")[0].FinalItemSpec); - } - - /// - /// No items of that type: should return empty group rather than null - /// - [Test] - public void UnknownItemType() - { - Lookup lookup = LookupHelpers.CreateEmptyLookup(); - - lookup.EnterScope(); // Doesn't matter really - - Assertion.AssertEquals(0, lookup.GetItems("i1").Count); - } - - /// - /// Adds accumulate as we lookup in the tables - /// - [Test] - public void AddsAreCombinedWithPopulates() - { - // One item in the project - BuildItemGroup group1 = new BuildItemGroup(); - group1.AddNewItem("i1", "a1"); - Hashtable table1 = new Hashtable(StringComparer.OrdinalIgnoreCase); - table1.Add("i1", group1); - Lookup lookup = LookupHelpers.CreateLookup(table1); - - // We see the one item - Assertion.AssertEquals("a1", lookup.GetItems("i1")[0].FinalItemSpec); - - // One item in the project - Assertion.AssertEquals("a1", group1[0].FinalItemSpec); - Assertion.AssertEquals(1, group1.Count); - - // Start a target - lookup.EnterScope(); - - // We see the one item - Assertion.AssertEquals("a1", lookup.GetItems("i1")[0].FinalItemSpec); - - // One item in the project - Assertion.AssertEquals("a1", group1[0].FinalItemSpec); - Assertion.AssertEquals(1, group1.Count); - - // Start a task (eg) and add a new item - lookup.EnterScope(); - lookup.AddNewItem(new BuildItem("i1", "a2")); - - // Now we see two items - Assertion.AssertEquals("a1", lookup.GetItems("i1")[0].FinalItemSpec); - Assertion.AssertEquals("a2", lookup.GetItems("i1")[1].FinalItemSpec); - - // But there's still one item in the project - Assertion.AssertEquals("a1", group1[0].FinalItemSpec); - Assertion.AssertEquals(1, group1.Count); - - // Finish the task - lookup.LeaveScope(); - - // We still see two items - Assertion.AssertEquals("a1", lookup.GetItems("i1")[0].FinalItemSpec); - Assertion.AssertEquals("a2", lookup.GetItems("i1")[1].FinalItemSpec); - - // But there's still one item in the project - Assertion.AssertEquals("a1", group1[0].FinalItemSpec); - Assertion.AssertEquals(1, group1.Count); - - // Finish the target - lookup.LeaveScope(); - - // We still see two items - Assertion.AssertEquals("a1", lookup.GetItems("i1")[0].FinalItemSpec); - Assertion.AssertEquals("a2", lookup.GetItems("i1")[1].FinalItemSpec); - - // And now the items have gotten put into the global group - Assertion.AssertEquals("a1", group1[0].FinalItemSpec); - Assertion.AssertEquals("a2", group1[1].FinalItemSpec); - Assertion.AssertEquals(2, group1.Count); - } - - [Test] - public void Removes() - { - // One item in the project - BuildItemGroup group1 = new BuildItemGroup(); - BuildItem item1 = new BuildItem("i1", "a1"); - group1.AddItem(item1); - Hashtable table1 = new Hashtable(StringComparer.OrdinalIgnoreCase); - table1.Add("i1", group1); - Lookup lookup = LookupHelpers.CreateLookup(table1); - - // Start a target - lookup.EnterScope(); - - // Start a task (eg) and add a new item - lookup.EnterScope(); - BuildItem item2 = new BuildItem("i1", "a2"); - lookup.AddNewItem(item2); - - // Remove one item - lookup.RemoveItem(item1); - - // We see one item - Assertion.AssertEquals(1, lookup.GetItems("i1").Count); - Assertion.AssertEquals("a2", lookup.GetItems("i1")[0].FinalItemSpec); - - // Remove the other item - lookup.RemoveItem(item2); - - // We see no items - Assertion.AssertEquals(0, lookup.GetItems("i1").Count); - - // Finish the task - lookup.LeaveScope(); - - // We still see no items - Assertion.AssertEquals(0, lookup.GetItems("i1").Count); - - // But there's still one item in the project - Assertion.AssertEquals("a1", group1[0].FinalItemSpec); - Assertion.AssertEquals(1, group1.Count); - - // Finish the target - lookup.LeaveScope(); - - // We still see no items - Assertion.AssertEquals(0, lookup.GetItems("i1").Count); - - // And now there are no items in the project either - Assertion.AssertEquals(0, group1.Count); - } - -// These tests used to have an #if DEBUG around them, because the method they -// are testing only gets called in chk builds; they have been removed -// entirely due to BVT bug 527712: Main is attempting to run chk unit tests -// against ret bits. Please only uncomment these tests if you have verified -// that that scenario works. -#if NULL - /// - /// Lookup class should never be asked to add an item that was already removed; - /// this is not something that is possible through a project file: all adds create - /// brand new items. - /// - [Test] - [ExpectedException(typeof(InternalErrorException))] - public void RemoveBeforeAnAddShouldBeInvalid() - { - Hashtable table1 = new Hashtable(StringComparer.OrdinalIgnoreCase); - Lookup lookup = LookupHelpers.CreateLookup(table1); - - // Start a target - lookup.EnterScope(); - - // Start a task (eg) - lookup.EnterScope(); - BuildItem item1 = new BuildItem("i1", "a2"); - - // Remove an item then add it - lookup.RemoveItem(item1); - lookup.AddNewItem(item1); - } - - /// - /// Lookup class should never be asked to modify an item that was already removed; - /// this is not something that is possible through a project file - /// - [Test] - [ExpectedException(typeof(InternalErrorException))] - public void RemoveBeforeModifyShouldBeInvalid() - { - Hashtable table1 = new Hashtable(StringComparer.OrdinalIgnoreCase); - Lookup lookup = LookupHelpers.CreateLookup(table1); - - // Start a target - lookup.EnterScope(); - - // Start a task (eg) - lookup.EnterScope(); - BuildItem item1 = new BuildItem("i1", "a2"); - BuildItemGroup group = new BuildItemGroup(); - group.AddItem(item1); - - // Remove an item then modify it - lookup.RemoveItem(item1); - - Dictionary metadataChanges = new Dictionary(); - metadataChanges.Add("x", "y"); - lookup.ModifyItems("i1", group, metadataChanges); - } -#endif - - [Test] - public void RemoveItemPopulatedInLowerScope() - { - Hashtable table1 = new Hashtable(StringComparer.OrdinalIgnoreCase); - Lookup lookup = LookupHelpers.CreateLookup(table1); - BuildItem item1 = new BuildItem("i1", "a2"); - - // Start a target - lookup.EnterScope(); - - // There's one item in this batch - lookup.PopulateWithItem(item1); - - // We see it - Assertion.AssertEquals(1, lookup.GetItems("i1").Count); - - // Make a clone so we can keep an eye on that item - Lookup lookup2 = lookup.Clone(); - - // We can see the item in the clone - Assertion.AssertEquals(1, lookup2.GetItems("i1").Count); - - // Start a task (eg) - lookup.EnterScope(); - - // We see the item below - Assertion.AssertEquals(1, lookup.GetItems("i1").Count); - - // Remove that item - lookup.RemoveItem(item1); - - // We see no items - Assertion.AssertEquals(0, lookup.GetItems("i1").Count); - - // The clone is unaffected so far - Assertion.AssertEquals(1, lookup2.GetItems("i1").Count); - - // Finish the task - lookup.LeaveScope(); - - // We still see no items - Assertion.AssertEquals(0, lookup.GetItems("i1").Count); - - // But now the clone doesn't either - Assertion.AssertEquals(0, lookup2.GetItems("i1").Count); - - // Finish the target - lookup.LeaveScope(); - - // We still see no items - Assertion.AssertEquals(0, lookup.GetItems("i1").Count); - Assertion.AssertEquals(0, lookup2.GetItems("i1").Count); - } - - [Test] - public void RemoveItemAddedInLowerScope() - { - Hashtable table1 = new Hashtable(StringComparer.OrdinalIgnoreCase); - Lookup lookup = LookupHelpers.CreateLookup(table1); - - // Start a target - lookup.EnterScope(); - - // Add an item - BuildItem item1 = new BuildItem("i1", "a2"); - lookup.AddNewItem(item1); - - // Start a task (eg) - lookup.EnterScope(); - - // We see the item below - Assertion.AssertEquals(1, lookup.GetItems("i1").Count); - - // Remove that item - lookup.RemoveItem(item1); - - // We see no items - Assertion.AssertEquals(0, lookup.GetItems("i1").Count); - - // Finish the task - lookup.LeaveScope(); - - // We still see no items - Assertion.AssertEquals(0, lookup.GetItems("i1").Count); - - // Finish the target - lookup.LeaveScope(); - - // We still see no items - Assertion.AssertEquals(0, lookup.GetItems("i1").Count); - } - - [Test] - public void ModifyItem() - { - Hashtable table1 = new Hashtable(StringComparer.OrdinalIgnoreCase); - Lookup lookup = LookupHelpers.CreateLookup(table1); - - lookup.EnterScope(); - - // Add an item with m=m1 - BuildItem item1 = new BuildItem("i1", "a2"); - item1.SetMetadata("m", "m1"); - lookup.AddNewItem(item1); - - lookup.EnterScope(); - - // Change the item to be m=m2 - Dictionary newMetadata = new Dictionary(); - newMetadata.Add("m", "m2"); - BuildItemGroup group = new BuildItemGroup(); - group.AddItem(item1); - lookup.ModifyItems(item1.Name, group, newMetadata); - - // Now it has m=m2 - group = lookup.GetItems("i1"); - Assertion.AssertEquals(1, group.Count); - Assertion.AssertEquals("m2", group[0].GetMetadata("m")); - - // But the original item hasn't changed yet - Assertion.AssertEquals("m1", item1.GetMetadata("m")); - - lookup.LeaveScope(); - - // It still has m=m2 - group = lookup.GetItems("i1"); - Assertion.AssertEquals(1, group.Count); - Assertion.AssertEquals("m2", group[0].GetMetadata("m")); - - // The original item still hasn't changed - // even though it was added in this scope - Assertion.AssertEquals("m1", item1.GetMetadata("m")); - - lookup.LeaveScope(); - - // It still has m=m2 - group = lookup.GetItems("i1"); - Assertion.AssertEquals(1, group.Count); - Assertion.AssertEquals("m2", group[0].GetMetadata("m")); - - // But now the original item has changed - Assertion.AssertEquals("m2", item1.GetMetadata("m")); - } - - /// - /// Modifications should be merged - /// - [Test] - public void ModifyItemModifiedInPreviousScope() - { - Hashtable table1 = new Hashtable(StringComparer.OrdinalIgnoreCase); - Lookup lookup = LookupHelpers.CreateLookup(table1); - - // Add an item with m=m1 and n=n1 - BuildItem item1 = new BuildItem("i1", "a2"); - item1.SetMetadata("m", "m1"); - lookup.PopulateWithItem(item1); - - lookup.EnterScope(); - - // Make a modification to the item to be m=m2 - Dictionary newMetadata = new Dictionary(); - newMetadata.Add("m", "m2"); - newMetadata.Add("n", "n2"); - BuildItemGroup group = new BuildItemGroup(); - group.AddItem(item1); - lookup.ModifyItems(item1.Name, group, newMetadata); - - lookup.EnterScope(); - - // Make another modification to the item - newMetadata = new Dictionary(); - newMetadata.Add("m", "m3"); - newMetadata.Add("o", "o3"); - lookup.ModifyItems(item1.Name, group, newMetadata); - - // It's now m=m3, n=n2, o=o3 - group = lookup.GetItems("i1"); - Assertion.AssertEquals(1, group.Count); - Assertion.AssertEquals("m3", group[0].GetMetadata("m")); - Assertion.AssertEquals("n2", group[0].GetMetadata("n")); - Assertion.AssertEquals("o3", group[0].GetMetadata("o")); - } - - /// - /// Modifications should be merged - /// - [Test] - public void ModifyItemTwiceInSameScope1() - { - Hashtable table1 = new Hashtable(StringComparer.OrdinalIgnoreCase); - Lookup lookup = LookupHelpers.CreateLookup(table1); - - // Add an item with m=m1 and n=n1 - BuildItem item1 = new BuildItem("i1", "a2"); - item1.SetMetadata("m", "m1"); - lookup.PopulateWithItem(item1); - - lookup.EnterScope(); - - // Make a modification to the item to be m=m2 - Dictionary newMetadata = new Dictionary(); - newMetadata.Add("m", "m2"); - BuildItemGroup group = new BuildItemGroup(); - group.AddItem(item1); - lookup.ModifyItems(item1.Name, group, newMetadata); - - // Make an unrelated modification to the item - newMetadata = new Dictionary(); - newMetadata.Add("n", "n1"); - lookup.ModifyItems(item1.Name, group, newMetadata); - - // It's now m=m2 - group = lookup.GetItems("i1"); - Assertion.AssertEquals(1, group.Count); - Assertion.AssertEquals("m2", group[0].GetMetadata("m")); - } - - /// - /// Modifications should be merged - /// - [Test] - public void ModifyItemTwiceInSameScope2() - { - Hashtable table1 = new Hashtable(StringComparer.OrdinalIgnoreCase); - Lookup lookup = LookupHelpers.CreateLookup(table1); - - // Add an item with m=m1 and n=n1 and o=o1 - BuildItem item1 = new BuildItem("i1", "a2"); - item1.SetMetadata("m", "m1"); - item1.SetMetadata("n", "n1"); - item1.SetMetadata("o", "o1"); - lookup.PopulateWithItem(item1); - - lookup.EnterScope(); - - // It's still m=m1, n=n1, o=o1 - BuildItemGroup group = lookup.GetItems("i1"); - Assertion.AssertEquals(1, group.Count); - Assertion.AssertEquals("m1", group[0].GetMetadata("m")); - Assertion.AssertEquals("n1", group[0].GetMetadata("n")); - Assertion.AssertEquals("o1", group[0].GetMetadata("o")); - - // Make a modification to the item to be m=m2 and n=n2 - Dictionary newMetadata = new Dictionary(); - newMetadata.Add("m", "m2"); - newMetadata.Add("n", "n2"); - group = new BuildItemGroup(); - group.AddItem(item1); - lookup.ModifyItems("i1", group, newMetadata); - - // It's now m=m2, n=n2, o=o1 - BuildItemGroup foundGroup = lookup.GetItems("i1"); - Assertion.AssertEquals(1, foundGroup.Count); - Assertion.AssertEquals("m2", foundGroup[0].GetMetadata("m")); - Assertion.AssertEquals("n2", foundGroup[0].GetMetadata("n")); - Assertion.AssertEquals("o1", foundGroup[0].GetMetadata("o")); - - // Make a modification to the item to be n=n3 - newMetadata = new Dictionary(); - newMetadata.Add("n", "n3"); - lookup.ModifyItems("i1", group, newMetadata); - - // It's now m=m2, n=n3, o=o1 - foundGroup = lookup.GetItems("i1"); - Assertion.AssertEquals(1, foundGroup.Count); - Assertion.AssertEquals("m2", foundGroup[0].GetMetadata("m")); - Assertion.AssertEquals("n3", foundGroup[0].GetMetadata("n")); - Assertion.AssertEquals("o1", foundGroup[0].GetMetadata("o")); - - // But the original item hasn't changed yet - Assertion.AssertEquals("m1", item1.GetMetadata("m")); - Assertion.AssertEquals("n1", item1.GetMetadata("n")); - Assertion.AssertEquals("o1", item1.GetMetadata("o")); - - lookup.LeaveScope(); - - // It's still m=m2, n=n3, o=o1 - foundGroup = lookup.GetItems("i1"); - Assertion.AssertEquals(1, foundGroup.Count); - Assertion.AssertEquals("m2", foundGroup[0].GetMetadata("m")); - Assertion.AssertEquals("n3", foundGroup[0].GetMetadata("n")); - Assertion.AssertEquals("o1", foundGroup[0].GetMetadata("o")); - - // And the original item has changed - Assertion.AssertEquals("m2", item1.GetMetadata("m")); - Assertion.AssertEquals("n3", item1.GetMetadata("n")); - Assertion.AssertEquals("o1", item1.GetMetadata("o")); - } - - - [Test] - public void ModifyItemThatWasAddedInSameScope() - { - Hashtable table1 = new Hashtable(StringComparer.OrdinalIgnoreCase); - Lookup lookup = LookupHelpers.CreateLookup(table1); - - lookup.EnterScope(); - - // Add an item with m=m1 - BuildItem item1 = new BuildItem("i1", "a2"); - item1.SetMetadata("m", "m1"); - lookup.AddNewItem(item1); - - // Change the item to be m=m2 - Dictionary newMetadata = new Dictionary(); - newMetadata.Add("m", "m2"); - BuildItemGroup group = new BuildItemGroup(); - group.AddItem(item1); - lookup.ModifyItems(item1.Name, group, newMetadata); - - // Now it has m=m2 - group = lookup.GetItems("i1"); - Assertion.AssertEquals(1, group.Count); - Assertion.AssertEquals("m2", group[0].GetMetadata("m")); - - // But the original item hasn't changed yet - Assertion.AssertEquals("m1", item1.GetMetadata("m")); - - lookup.LeaveScope(); - - // It still has m=m2 - group = lookup.GetItems("i1"); - Assertion.AssertEquals(1, group.Count); - Assertion.AssertEquals("m2", group[0].GetMetadata("m")); - - // But now the original item has changed as well - Assertion.AssertEquals("m2", item1.GetMetadata("m")); - } - - /// - /// Modifying an item in the outside scope is prohibited- - /// purely because we don't need to do it in our code - /// - [Test] - [ExpectedException(typeof(InternalErrorException))] - public void ModifyItemInOutsideScope() - { - Lookup lookup = LookupHelpers.CreateLookup(new Hashtable()); - lookup.AddNewItem(new BuildItem("x", "y")); - } - - /// - /// After modification, should be able to GetItem and then modify it again - /// - [Test] - public void ModifyItemPreviouslyModifiedAndGottenThroughGetItem() - { - Hashtable table1 = new Hashtable(StringComparer.OrdinalIgnoreCase); - Lookup lookup = LookupHelpers.CreateLookup(table1); - - // Add an item with m=m1 and n=n1 - BuildItem item1 = new BuildItem("i1", "a2"); - item1.SetMetadata("m", "m1"); - lookup.PopulateWithItem(item1); - - lookup.EnterScope(); - - // Make a modification to the item to be m=m2 - Dictionary newMetadata = new Dictionary(); - newMetadata.Add("m", "m2"); - BuildItemGroup group = new BuildItemGroup(); - group.AddItem(item1); - lookup.ModifyItems(item1.Name, group, newMetadata); - - // Get the item (under the covers, it cloned it in order to apply the modification) - BuildItemGroup group2 = lookup.GetItems(item1.Name); - Assertion.AssertEquals(1, group2.Count); - BuildItem item1b = group2[0]; - - // Modify to m=m3 - Dictionary newMetadata2 = new Dictionary(); - newMetadata2.Add("m", "m3"); - BuildItemGroup group3 = new BuildItemGroup(); - group3.AddItem(item1b); - lookup.ModifyItems(item1b.Name, group3, newMetadata2); - - // Modifications are visible - BuildItemGroup group4 = lookup.GetItems(item1b.Name); - Assertion.AssertEquals(1, group4.Count); - Assertion.AssertEquals("m3", group4[0].GetMetadata("m")); - - // Leave scope - lookup.LeaveScope(); - - // Still visible - BuildItemGroup group5 = lookup.GetItems(item1b.Name); - Assertion.AssertEquals(1, group5.Count); - Assertion.AssertEquals("m3", group5[0].GetMetadata("m")); - } - - - /// - /// After modification, should be able to GetItem and then modify it again - /// - [Test] - public void ModifyItemInProjectPreviouslyModifiedAndGottenThroughGetItem() - { - // Create some project state with an item with m=m1 and n=n1 - Hashtable table1 = new Hashtable(StringComparer.OrdinalIgnoreCase); - BuildItem item1 = new BuildItem("i1", "a2"); - item1.SetMetadata("m", "m1"); - BuildItemGroup group0 = new BuildItemGroup(); - group0.AddExistingItem(item1); - table1["i1"] = group0; - - Lookup lookup = LookupHelpers.CreateLookup(table1); - - lookup.EnterScope(); - - // Make a modification to the item to be m=m2 - Dictionary newMetadata = new Dictionary(); - newMetadata.Add("m", "m2"); - BuildItemGroup group = new BuildItemGroup(); - group.AddItem(item1); - lookup.ModifyItems(item1.Name, group, newMetadata); - - // Get the item (under the covers, it cloned it in order to apply the modification) - BuildItemGroup group2 = lookup.GetItems(item1.Name); - Assertion.AssertEquals(1, group2.Count); - BuildItem item1b = group2[0]; - - // Modify to m=m3 - Dictionary newMetadata2 = new Dictionary(); - newMetadata2.Add("m", "m3"); - BuildItemGroup group3 = new BuildItemGroup(); - group3.AddItem(item1b); - lookup.ModifyItems(item1b.Name, group3, newMetadata2); - - // Modifications are visible - BuildItemGroup group4 = lookup.GetItems(item1b.Name); - Assertion.AssertEquals(1, group4.Count); - Assertion.AssertEquals("m3", group4[0].GetMetadata("m")); - - // Leave scope - lookup.LeaveScope(); - - // Still visible - BuildItemGroup group5 = lookup.GetItems(item1b.Name); - Assertion.AssertEquals(1, group5.Count); - Assertion.AssertEquals("m3", group5[0].GetMetadata("m")); - - // And the one in the project is changed - Assertion.AssertEquals("m3", item1.GetMetadata("m")); - } - - /// - /// After modification, should be able to GetItem and then remove it - /// - [Test] - public void RemoveItemPreviouslyModifiedAndGottenThroughGetItem() - { - Hashtable table1 = new Hashtable(StringComparer.OrdinalIgnoreCase); - Lookup lookup = LookupHelpers.CreateLookup(table1); - - // Add an item with m=m1 and n=n1 - BuildItem item1 = new BuildItem("i1", "a2"); - item1.SetMetadata("m", "m1"); - lookup.PopulateWithItem(item1); - - lookup.EnterScope(); - - // Make a modification to the item to be m=m2 - Dictionary newMetadata = new Dictionary(); - newMetadata.Add("m", "m2"); - BuildItemGroup group = new BuildItemGroup(); - group.AddItem(item1); - lookup.ModifyItems(item1.Name, group, newMetadata); - - // Get the item (under the covers, it cloned it in order to apply the modification) - BuildItemGroup group2 = lookup.GetItems(item1.Name); - Assertion.AssertEquals(1, group2.Count); - BuildItem item1b = group2[0]; - - // Remove the item - lookup.RemoveItem(item1b); - - // There's now no items at all - BuildItemGroup group3 = lookup.GetItems(item1.Name); - Assertion.AssertEquals(0, group3.Count); - } - - /// - /// After modification, should be able to GetItem and then remove it - /// - [Test] - public void RemoveItemFromProjectPreviouslyModifiedAndGottenThroughGetItem() - { - // Create some project state with an item with m=m1 and n=n1 - Hashtable table1 = new Hashtable(StringComparer.OrdinalIgnoreCase); - BuildItem item1 = new BuildItem("i1", "a2"); - item1.SetMetadata("m", "m1"); - BuildItemGroup group0 = new BuildItemGroup(); - group0.AddExistingItem(item1); - table1["i1"] = group0; - - Lookup lookup = LookupHelpers.CreateLookup(table1); - - lookup.EnterScope(); - - // Make a modification to the item to be m=m2 - Dictionary newMetadata = new Dictionary(); - newMetadata.Add("m", "m2"); - BuildItemGroup group = new BuildItemGroup(); - group.AddItem(item1); - lookup.ModifyItems(item1.Name, group, newMetadata); - - // Get the item (under the covers, it cloned it in order to apply the modification) - BuildItemGroup group2 = lookup.GetItems(item1.Name); - Assertion.AssertEquals(1, group2.Count); - BuildItem item1b = group2[0]; - - // Remove the item - lookup.RemoveItem(item1b); - - // There's now no items at all - BuildItemGroup group3 = lookup.GetItems(item1.Name); - Assertion.AssertEquals(0, group3.Count); - - // Leave scope - lookup.LeaveScope(); - - // And now none left in the project either - Assertion.AssertEquals(0, ((BuildItemGroup)table1["i1"]).Count); - } - - /// - /// If the property isn't modified, the initial property - /// should be returned - /// - [Test] - public void UnmodifiedProperty() - { - BuildPropertyGroup group = new BuildPropertyGroup(); - BuildProperty property = new BuildProperty("p1", "v1"); - group.SetProperty(property); - Lookup lookup = LookupHelpers.CreateLookup(group); - - Assertion.AssertEquals(property, lookup.GetProperty("p1")); - - lookup.EnterScope(); - - Assertion.AssertEquals(property, lookup.GetProperty("p1")); - } - - /// - /// If the property isn't found, should return null - /// - [Test] - public void NonexistentProperty() - { - BuildPropertyGroup group = new BuildPropertyGroup(); - Lookup lookup = LookupHelpers.CreateLookup(group); - - Assertion.AssertEquals(null, lookup.GetProperty("p1")); - - lookup.EnterScope(); - - Assertion.AssertEquals(null, lookup.GetProperty("p1")); - } - - /// - /// If the property is modified, the updated value should be returned, - /// both before and after leaving scope. - /// - [Test] - public void ModifiedProperty() - { - BuildPropertyGroup group = new BuildPropertyGroup(); - group.SetProperty(new BuildProperty("p1", "v1")); - Lookup lookup = LookupHelpers.CreateLookup(group); - // Enter scope so that property sets are allowed on it - lookup.EnterScope(); - - // Change the property value - lookup.SetProperty(new BuildProperty("p1", "v2", PropertyType.OutputProperty)); - - // Lookup is updated, but not original item group - Assertion.AssertEquals("v2", lookup.GetProperty("p1").FinalValue); - Assertion.AssertEquals("v1", group["p1"].FinalValue); - - lookup.EnterScope(); - - // Change the value again in the new scope - lookup.SetProperty(new BuildProperty("p1", "v3", PropertyType.OutputProperty)); - - // Lookup is updated, but not the original item group - Assertion.AssertEquals("v3", lookup.GetProperty("p1").FinalValue); - Assertion.AssertEquals("v1", group["p1"].FinalValue); - - lookup.EnterScope(); - - // Change the value again in the new scope - lookup.SetProperty(new BuildProperty("p1", "v4", PropertyType.OutputProperty)); - - Assertion.AssertEquals("v4", lookup.GetProperty("p1").FinalValue); - - lookup.LeaveScope(); - - Assertion.AssertEquals("v4", lookup.GetProperty("p1").FinalValue); - - // Leave to the outer scope - lookup.LeaveScope(); - lookup.LeaveScope(); - - // Now the lookup and original group are updated - Assertion.AssertEquals("v4", lookup.GetProperty("p1").FinalValue); - Assertion.AssertEquals("v4", group["p1"].FinalValue); - } - - [Test] - [ExpectedException(typeof(InternalErrorException))] - public void LeaveTooMuch() - { - Lookup lookup = LookupHelpers.CreateEmptyLookup(); - lookup.EnterScope(); - lookup.LeaveScope(); - lookup.LeaveScope(); - } - - [Test] - [ExpectedException(typeof(InternalErrorException))] - public void RemoveScopeOnDifferentThread() - { - Thread thread = new Thread(CreateLookupAndEnterScope); - thread.Start(); - thread.Join(); - - Assertion.AssertNotNull(lookupPassedBetweenThreads); - lookupPassedBetweenThreads.LeaveScope(); - } - - [Test] - [ExpectedException(typeof(InternalErrorException))] - public void PopulateWithItemOnDifferentThread() - { - Thread thread = new Thread(CreateLookupAndEnterScope); - thread.Start(); - thread.Join(); - - Assertion.AssertNotNull(lookupPassedBetweenThreads); - lookupPassedBetweenThreads.PopulateWithItem(new BuildItem("x", "y")); - } - - [Test] - [ExpectedException(typeof(InternalErrorException))] - public void PopulateWithItemsOnDifferentThread() - { - Thread thread = new Thread(CreateLookupAndEnterScope); - thread.Start(); - thread.Join(); - - Assertion.AssertNotNull(lookupPassedBetweenThreads); - lookupPassedBetweenThreads.PopulateWithItems("x", new BuildItemGroup()); - } - - [Test] - [ExpectedException(typeof(InternalErrorException))] - public void AddNewItemOnDifferentThread() - { - Thread thread = new Thread(CreateLookupAndEnterScope); - thread.Start(); - thread.Join(); - - Assertion.AssertNotNull(lookupPassedBetweenThreads); - lookupPassedBetweenThreads.AddNewItem(new BuildItem("x", "y")); - } - - [Test] - [ExpectedException(typeof(InternalErrorException))] - public void AddNewItemsOnDifferentThread() - { - Thread thread = new Thread(CreateLookupAndEnterScope); - thread.Start(); - thread.Join(); - - Assertion.AssertNotNull(lookupPassedBetweenThreads); - lookupPassedBetweenThreads.AddNewItems(new BuildItemGroup()); - } - - [Test] - [ExpectedException(typeof(InternalErrorException))] - public void RemoveItemOnDifferentThread() - { - Thread thread = new Thread(CreateLookupAndEnterScope); - thread.Start(); - thread.Join(); - - Assertion.AssertNotNull(lookupPassedBetweenThreads); - lookupPassedBetweenThreads.RemoveItem(new BuildItem("x", "y")); - } - - [Test] - [ExpectedException(typeof(InternalErrorException))] - public void RemoveItemsOnDifferentThread() - { - Thread thread = new Thread(CreateLookupAndEnterScope); - thread.Start(); - thread.Join(); - - Assertion.AssertNotNull(lookupPassedBetweenThreads); - List list = new List(); - list.Add(new BuildItem("x", "y")); - lookupPassedBetweenThreads.RemoveItems(list); - } - - [Test] - [ExpectedException(typeof(InternalErrorException))] - public void ModifyItemOnDifferentThread() - { - Thread thread = new Thread(CreateLookupAndEnterScope); - thread.Start(); - thread.Join(); - - Assertion.AssertNotNull(lookupPassedBetweenThreads); - lookupPassedBetweenThreads.ModifyItems("x", new BuildItemGroup(), new Dictionary()); - } - - [Test] - [ExpectedException(typeof(InternalErrorException))] - public void SetPropertyOnDifferentThread() - { - Thread thread = new Thread(CreateLookupAndEnterScope); - thread.Start(); - thread.Join(); - - Assertion.AssertNotNull(lookupPassedBetweenThreads); - lookupPassedBetweenThreads.SetProperty(new BuildProperty("x", "y", PropertyType.OutputProperty)); - } - - /// - /// Bad but simple way to get the lookup from another thread - /// - private static Lookup lookupPassedBetweenThreads; - - private void CreateLookupAndEnterScope() - { - lookupPassedBetweenThreads = LookupHelpers.CreateEmptyLookup(); - lookupPassedBetweenThreads.EnterScope(); - } - } - - internal class LookupHelpers - { - internal static Lookup CreateEmptyLookup() - { - ItemDefinitionLibrary itemDefinitionLibrary = CreateEmptyEvaluatedItemDefinitionLibrary(); - Lookup lookup = new Lookup(null, null, itemDefinitionLibrary); - return lookup; - } - - internal static Lookup CreateLookup(Hashtable items) - { - ItemDefinitionLibrary itemDefinitionLibrary = CreateEmptyEvaluatedItemDefinitionLibrary(); - Lookup lookup = new Lookup(items, null, itemDefinitionLibrary); - return lookup; - } - - internal static Lookup CreateLookup(BuildPropertyGroup properties) - { - ItemDefinitionLibrary itemDefinitionLibrary = CreateEmptyEvaluatedItemDefinitionLibrary(); - Lookup lookup = new Lookup(null, properties, itemDefinitionLibrary); - return lookup; - } - - internal static Lookup CreateLookup(BuildPropertyGroup properties, Hashtable items) - { - ItemDefinitionLibrary itemDefinitionLibrary = CreateEmptyEvaluatedItemDefinitionLibrary(); - Lookup lookup = new Lookup(items, properties, itemDefinitionLibrary); - return lookup; - } - - internal static ItemDefinitionLibrary CreateEmptyEvaluatedItemDefinitionLibrary() - { - ItemDefinitionLibrary itemDefinitionLibrary = new ItemDefinitionLibrary(new Project()); - itemDefinitionLibrary.Evaluate(new BuildPropertyGroup()); - return itemDefinitionLibrary; - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/Microsoft.Build.Engine.UnitTests.csproj b/src/Deprecated/Engine.UnitTests/Microsoft.Build.Engine.UnitTests.csproj deleted file mode 100644 index b43f608a108..00000000000 --- a/src/Deprecated/Engine.UnitTests/Microsoft.Build.Engine.UnitTests.csproj +++ /dev/null @@ -1,204 +0,0 @@ - - - - $([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), Build.props))\Build.props - - - - - - $(SuiteBinPath) - library - Microsoft.Build.Engine.Unittest - true - $(BuildArchitecturesAllowed);amd64;arm - - - - - $(NoWarn);0618 - {91781F04-64B3-4E65-882D-C8613484F850} - - - - - - - - - - - - - - - - XmakeAttributes_Tests.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {784BF121-CE8F-4314-AA55-E86AB61670FE} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Framework - Needs 'microsoft.build.framework.dll' - true - - - {653E79B4-118B-4E0A-9E34-8EB30E5E0881} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Utilities %28Utilities\Utilities%29 - Needs 'microsoft.build.utilities.v12.0.dll' - - - {3F1F7307-EE89-4110-B636-BDE1E45358C4} - XMakeBuildEngine - Needs 'microsoft.build.engine.dll' - true - - - - - - - - - - true - - - - - - - - Microsoft.Build.Core.xsd - Designer - - - Microsoft.Build.CommonTypes.xsd - Designer - - - Microsoft.Build.xsd - Designer - - - - - - - - diff --git a/src/Deprecated/Engine.UnitTests/MockNode.cs b/src/Deprecated/Engine.UnitTests/MockNode.cs deleted file mode 100644 index 4fcc7f66145..00000000000 --- a/src/Deprecated/Engine.UnitTests/MockNode.cs +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections; -using System.Collections.Generic; -using System.IO; -using System.Text; - -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine.Shared; -using Microsoft.Build.BuildEngine; - -namespace Microsoft.Build.UnitTests -{ - /// - /// Mock out the node class through the use of a derived class - /// - class MockTaskExecutionModule : TaskExecutionModule - { - // A dictionary containing the inputs to the postTaskOutputsMethod - // This is used by tests to see what the results of calling PostTaskOutputs were - Dictionary postTaskOutputsInputs; - - public Dictionary PostTaskOutputsInputs - { - get { return postTaskOutputsInputs; } - set { postTaskOutputsInputs = value; } - } - - public MockTaskExecutionModule(EngineCallback nodeProxy) - : base(nodeProxy, TaskExecutionModule.TaskExecutionModuleMode.SingleProcMode, false) - { - - } - - public MockTaskExecutionModule(EngineCallback nodeProxy, TaskExecutionModule.TaskExecutionModuleMode moduleMode) - : base(nodeProxy, moduleMode, false) - { - - } - - /// - /// This method is called from TaskExecutionState and allows tests to see the results from TaskExecutionState - /// - internal override void PostTaskOutputs - ( - int nodeProxyId, - bool taskExecutedSuccessfully, - Exception thrownException, - long executionTime - ) - { - postTaskOutputsInputs = new Dictionary(); - postTaskOutputsInputs.Add("nodeProxyId", nodeProxyId); - postTaskOutputsInputs.Add("taskExecutedSuccessfully", taskExecutedSuccessfully); - postTaskOutputsInputs.Add("thrownException", thrownException); - } - - /// - /// Override to BuildProject file to return true so we can test that - /// - override internal bool BuildProjectFile - ( - int nodeProxyId, - string[] projectFileNames, - string[] targetNames, - IDictionary[] globalProperties, - IDictionary[] targetOutputsPerProject, - EngineLoggingServices loggingServices, - string[] toolsVersions, - bool useResultsCache, - bool unloadProjectsOnCompletion, - BuildEventContext taskContext - ) - { - return true; - } - - /// - /// Return some data from the method for unit testing - /// - override internal void GetLineColumnOfXmlNode(int nodeProxyId, out int lineNumber, out int columnNumber) - { - lineNumber = 0; - columnNumber = 0; - } - - } -} diff --git a/src/Deprecated/Engine.UnitTests/MockProjectStartedLogger.cs b/src/Deprecated/Engine.UnitTests/MockProjectStartedLogger.cs deleted file mode 100644 index 8589999d8ce..00000000000 --- a/src/Deprecated/Engine.UnitTests/MockProjectStartedLogger.cs +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Text; -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine; - -namespace Microsoft.Build.UnitTests -{ - class MockProjectStartedLogger : ILogger - { - #region ILogger Members - - /// - /// Logger verbosity - /// - public LoggerVerbosity Verbosity - { - get - { - return LoggerVerbosity.Diagnostic; - } - set - { - } - } - - /// - /// Logger parameters - /// - public string Parameters - { - get - { - return null; - } - set - { - } - } - - /// - /// Subscribing to the events - /// - /// - public void Initialize(IEventSource eventSource) - { - eventSource.ProjectStarted += new ProjectStartedEventHandler(eventSource_ProjectStarted); - } - - /// - /// Handler for the ProjectStarted event. - /// - /// - /// - private void eventSource_ProjectStarted(object sender, ProjectStartedEventArgs e) - { - // Clone and store the properties so we can inspect the values later on - foreach (DictionaryEntry property in e.Properties) - { - projectStartedProperties[(string) property.Key] = (string) property.Value; - } - } - - public void Shutdown() - { - // do nothing - } - - #endregion - - // dictionary of properties sent to us with the ProjectStarted event - private Dictionary projectStartedProperties = new Dictionary(StringComparer.OrdinalIgnoreCase); - - public Dictionary ProjectStartedProperties - { - get - { - return projectStartedProperties; - } - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/MockTask.cs b/src/Deprecated/Engine.UnitTests/MockTask.cs deleted file mode 100644 index bded93b80f2..00000000000 --- a/src/Deprecated/Engine.UnitTests/MockTask.cs +++ /dev/null @@ -1,516 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.IO; -using System.Reflection; -using System.Collections; -using NUnit.Framework; -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine; - - -namespace Microsoft.Build.UnitTests -{ - internal class MockTaskBase - { - private bool myBoolParam = false; - private bool[] myBoolArrayParam = null; - private int myIntParam = 0; - private int[] myIntArrayParam = null; - private string myStringParam = null; - private string[] myStringArrayParam = null; - private ITaskItem myITaskItemParam = null; - private ITaskItem[] myITaskItemArrayParam = null; - - private bool myRequiredBoolParam = false; - private bool[] myRequiredBoolArrayParam = null; - private int myRequiredIntParam = 0; - private int[] myRequiredIntArrayParam = null; - private string myRequiredStringParam = null; - private string[] myRequiredStringArrayParam = null; - private ITaskItem myRequiredITaskItemParam = null; - private ITaskItem[] myRequiredITaskItemArrayParam = null; - - internal bool myBoolParamWasSet = false; - internal bool myBoolArrayParamWasSet = false; - internal bool myIntParamWasSet = false; - internal bool myIntArrayParamWasSet = false; - internal bool myStringParamWasSet = false; - internal bool myStringArrayParamWasSet = false; - internal bool myITaskItemParamWasSet = false; - internal bool myITaskItemArrayParamWasSet = false; - -// disable csharp compiler warning #0414: field assigned unused value -#pragma warning disable 0414 - internal bool myRequiredBoolParamWasSet = false; - internal bool myRequiredBoolArrayParamWasSet = false; - internal bool myRequiredIntParamWasSet = false; - internal bool myRequiredIntArrayParamWasSet = false; - internal bool myRequiredStringParamWasSet = false; - internal bool myRequiredStringArrayParamWasSet = false; - internal bool myRequiredITaskItemParamWasSet = false; - internal bool myRequiredITaskItemArrayParamWasSet = false; -#pragma warning restore 0414 - - /// - /// Single bool parameter. - /// - /// RGoel - public bool MyBoolParam - { - get { return this.myBoolParam; } - set { this.myBoolParam = value; this.myBoolParamWasSet = true; } - } - - /// - /// bool[] parameter. - /// - /// RGoel - public bool[] MyBoolArrayParam - { - get { return this.myBoolArrayParam; } - set { this.myBoolArrayParam = value; this.myBoolArrayParamWasSet = true; } - } - - /// - /// Single int parameter. - /// - /// RGoel - public int MyIntParam - { - get { return this.myIntParam; } - set { this.myIntParam = value; this.myIntParamWasSet = true; } - } - - /// - /// int[] parameter. - /// - /// RGoel - public int[] MyIntArrayParam - { - get { return this.myIntArrayParam; } - set { this.myIntArrayParam = value; this.myIntArrayParamWasSet = true; } - } - - /// - /// Single string parameter - /// - /// RGoel - public string MyStringParam - { - get { return this.myStringParam; } - set { this.myStringParam = value; this.myStringParamWasSet = true; } - } - - /// - /// A string array parameter. - /// - /// JomoF - public string[] MyStringArrayParam - { - get { return this.myStringArrayParam; } - set { this.myStringArrayParam = value; this.myStringArrayParamWasSet = true; } - } - - /// - /// Single ITaskItem parameter. - /// - /// RGoel - public ITaskItem MyITaskItemParam - { - get { return this.myITaskItemParam; } - set { this.myITaskItemParam = value; this.myITaskItemParamWasSet = true; } - } - - /// - /// ITaskItem[] parameter. - /// - /// RGoel - public ITaskItem[] MyITaskItemArrayParam - { - get { return this.myITaskItemArrayParam; } - set { this.myITaskItemArrayParam = value; this.myITaskItemArrayParamWasSet = true; } - } - - /// - /// Single bool parameter. - /// - /// RGoel - [Required] - public bool MyRequiredBoolParam - { - get { return this.myRequiredBoolParam; } - set { this.myRequiredBoolParam = value; this.myRequiredBoolParamWasSet = true; } - } - - /// - /// bool[] parameter. - /// - /// RGoel - [Required] - public bool[] MyRequiredBoolArrayParam - { - get { return this.myRequiredBoolArrayParam; } - set { this.myRequiredBoolArrayParam = value; this.myRequiredBoolArrayParamWasSet = true; } - } - - /// - /// Single int parameter. - /// - /// RGoel - [Required] - public int MyRequiredIntParam - { - get { return this.myRequiredIntParam; } - set { this.myRequiredIntParam = value; this.myRequiredIntParamWasSet = true; } - } - - /// - /// int[] parameter. - /// - /// RGoel - [Required] - public int[] MyRequiredIntArrayParam - { - get { return this.myRequiredIntArrayParam; } - set { this.myRequiredIntArrayParam = value; this.myRequiredIntArrayParamWasSet = true; } - } - - /// - /// Single string parameter - /// - /// RGoel - [Required] - public string MyRequiredStringParam - { - get { return this.myRequiredStringParam; } - set { this.myRequiredStringParam = value; this.myRequiredStringParamWasSet = true; } - } - - /// - /// A string array parameter. - /// - /// JomoF - [Required] - public string[] MyRequiredStringArrayParam - { - get { return this.myRequiredStringArrayParam; } - set { this.myRequiredStringArrayParam = value; this.myRequiredStringArrayParamWasSet = true; } - } - - /// - /// Single ITaskItem parameter. - /// - /// RGoel - [Required] - public ITaskItem MyRequiredITaskItemParam - { - get { return this.myRequiredITaskItemParam; } - set { this.myRequiredITaskItemParam = value; this.myRequiredITaskItemParamWasSet = true; } - } - - /// - /// ITaskItem[] parameter. - /// - /// RGoel - [Required] - public ITaskItem[] MyRequiredITaskItemArrayParam - { - get { return this.myRequiredITaskItemArrayParam; } - set { this.myRequiredITaskItemArrayParam = value; this.myRequiredITaskItemArrayParamWasSet = true; } - } - - /// - /// ArrayList output parameter. (This is not supported by MSBuild.) - /// - /// RGoel - [Output] - public ArrayList MyArrayListOutputParam - { - get { return null; } - } - - /// - /// Null ITaskItem[] output parameter. - /// - /// danmose - [Output] - public ITaskItem[] NullITaskItemArrayOutputParameter - { - get - { - ITaskItem[] myNullITaskItemArrayOutputParameter = null; - return myNullITaskItemArrayOutputParameter; - } - } - - /// - /// Empty string output parameter. - /// - /// danmose - [Output] - public string EmptyStringOutputParameter - { - get - { - return String.Empty; - } - } - - /// - /// Empty string output parameter. - /// - /// danmose - [Output] - public string[] EmptyStringInStringArrayOutputParameter - { - get - { - string[] myArray = new string[] { "" }; - return myArray; - } - } - - /// - /// ITaskItem output parameter. - /// - /// danmose - [Output] - public ITaskItem ITaskItemOutputParameter - { - get - { - ITaskItem myITaskItem = null; - return myITaskItem; - } - } - - /// - /// string output parameter. - /// - /// danmose - [Output] - public string StringOutputParameter - { - get - { - return "foo"; - } - } - - /// - /// string array output parameter. - /// - /// danmose - [Output] - public string[] StringArrayOutputParameter - { - get - { - return new string[] { "foo", "bar" }; - } - } - - /// - /// int output parameter. - /// - /// danmose - [Output] - public int IntOutputParameter - { - get - { - return 1; - } - } - - /// - /// int array output parameter. - /// - /// danmose - [Output] - public int[] IntArrayOutputParameter - { - get - { - return new int[] { 1, 2 }; - } - } - - /// - /// object array output parameter. - /// - /// danmose - [Output] - public object[] ObjectArrayOutputParameter - { - get - { - return new object[] { new Object() }; - } - } - - /// - /// itaskitem implementation output parameter - /// - [Output] - public MyTaskItem MyTaskItemOutputParameter - { - get - { - return new MyTaskItem(); - } - } - - /// - /// itaskitem implementation array output parameter - /// - [Output] - public MyTaskItem[] MyTaskItemArrayOutputParameter - { - get - { - return new MyTaskItem[] { new MyTaskItem() }; - } - } - - /// - /// taskitem output parameter - /// - [Output] - public TaskItem TaskItemOutputParameter - { - get - { - return new TaskItem("foo"); - } - } - - /// - /// taskitem array output parameter - /// - [Output] - public TaskItem[] TaskItemArrayOutputParameter - { - get - { - return new TaskItem[] { new TaskItem("foo") }; - } - } - } - - /// - /// A simple mock task for use with Unit Testing. - /// - /// JomoF - sealed internal class MockTask : MockTaskBase,ITask - { - private IBuildEngine e = null; - - /// - /// Task constructor. - /// - /// - /// JomoF - public MockTask(IBuildEngine e) - { - this.e = e; - } - /// - /// Access the engine. - /// - /// JomoF - public IBuildEngine BuildEngine - { - get {return this.e;} - set {this.e = value;} - } - - /// - /// Access the host object. - /// - /// RGoel - public ITaskHost HostObject - { - get {return null;} - set {} - } - - /// - /// Main Execute method of the task does nothing. - /// - /// true if successful - /// JomoF - public bool Execute() - { - return true; - } - } - - /// - /// Custom implementation of ITaskItem for unit testing - /// Just TaskItem would work fine, but why not test a custom type as well - /// - internal class MyTaskItem : ITaskItem - { - #region ITaskItem Members - - public string ItemSpec - { - get - { - return "foo"; - } - set - { - // do nothing - } - } - - public ICollection MetadataNames - { - get - { - return new ArrayList(); - } - } - - public int MetadataCount - { - get { return 1; } - } - - public string GetMetadata(string attributeName) - { - return "foo"; - } - - public void SetMetadata(string attributeName, string attributeValue) - { - // do nothing - } - - public void RemoveMetadata(string attributeName) - { - // do nothing - } - - public void CopyMetadataTo(ITaskItem destinationItem) - { - // do nothing - } - - public IDictionary CloneCustomMetadata() - { - return new Hashtable(); - } - - #endregion - } - -} diff --git a/src/Deprecated/Engine.UnitTests/NodeLoggingEventTests.cs b/src/Deprecated/Engine.UnitTests/NodeLoggingEventTests.cs deleted file mode 100644 index 06abc5cd23d..00000000000 --- a/src/Deprecated/Engine.UnitTests/NodeLoggingEventTests.cs +++ /dev/null @@ -1,240 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections.Generic; -using System.Text; -using NUnit.Framework; -using System.IO; - -using Microsoft.Build.BuildEngine; -using Microsoft.Build.Framework; -using System.Collections; - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class NodeLoggingEventTests - { - [Serializable] - internal class GenericBuildEventArg : BuildEventArgs - { - internal GenericBuildEventArg - ( - string message, - string helpKeyword, - string senderName - ) - : base(message, helpKeyword, senderName) - { - } - } - - [Serializable] - internal class GenericCustomBuildEventArg : CustomBuildEventArgs - { - public string customField; - - internal GenericCustomBuildEventArg - ( - string customValue - ) - { - this.customField = customValue; - } - } - - MemoryStream stream; - BinaryWriter writer; - BinaryReader reader; - - [SetUp] - public void SetUp() - { - stream = new MemoryStream(); - writer = new BinaryWriter(stream); - reader = new BinaryReader(stream); - } - - [TearDown] - public void TearDown() - { - writer.Close(); - reader = null; - stream = null; - writer = null; - } - - [Test] - public void TestLoggingEventCustomerSerialization() - { - Hashtable loggingTypeCacheWrites = new Hashtable(); - stream.Position = 0; - BuildEventContext context = new BuildEventContext(1,3,5,7); - GenericBuildEventArg genericBuildEvent = new GenericBuildEventArg("Message","Help","Sender"); - genericBuildEvent.BuildEventContext = context; - NodeLoggingEvent genericBuildEventLoggingEvent = new NodeLoggingEvent(genericBuildEvent); - genericBuildEventLoggingEvent.WriteToStream(writer, loggingTypeCacheWrites); - - GenericCustomBuildEventArg genericCustomEvent = new GenericCustomBuildEventArg("FooFighter"); - genericCustomEvent.BuildEventContext = context; - NodeLoggingEvent genericCustomEventLoggingEvent = new NodeLoggingEvent(genericCustomEvent); - genericCustomEventLoggingEvent.WriteToStream(writer, loggingTypeCacheWrites); - - BuildErrorEventArgs errorEvent = new BuildErrorEventArgs("Subcategory", "Code", "File", 1, 2, 3, 4, "Message", "HelpKeyword", "SenderName"); - errorEvent.BuildEventContext = context; - NodeLoggingEvent errorEventLoggingEvent = new NodeLoggingEvent(errorEvent); - errorEventLoggingEvent.WriteToStream(writer, loggingTypeCacheWrites); - - BuildMessageEventArgs messageEvent = new BuildMessageEventArgs("Message", "HelpKeyword", "SenderName",MessageImportance.High); - messageEvent.BuildEventContext = context; - NodeLoggingEvent messageEventLoggingEvent = new NodeLoggingEvent(messageEvent); - messageEventLoggingEvent.WriteToStream(writer, loggingTypeCacheWrites); - - BuildWarningEventArgs warningEvent = new BuildWarningEventArgs("Subcategory", "Code", "File", 1, 2, 3, 4, "Message", "HelpKeyword", "SenderName"); - warningEvent.BuildEventContext = context; - NodeLoggingEvent warningEventLoggingEvent = new NodeLoggingEvent(warningEvent); - warningEventLoggingEvent.WriteToStream(writer, loggingTypeCacheWrites); - - ProjectStartedEventArgs projectStartedEvent = new ProjectStartedEventArgs( 8,"Message", "HelpKeyword", "ProjectFile", "TargetNames", null, null, new BuildEventContext(7,8,9,10)); - projectStartedEvent.BuildEventContext = context; - NodeLoggingEvent projectStartedEventLoggingEvent = new NodeLoggingEvent(projectStartedEvent); - projectStartedEventLoggingEvent.WriteToStream(writer, loggingTypeCacheWrites); - - ProjectFinishedEventArgs projectFinishedEvent = new ProjectFinishedEventArgs("Message", "HelpKeyword","ProjectFile",true); - projectFinishedEvent.BuildEventContext = context; - NodeLoggingEvent projectFinishedEventLoggingEvent = new NodeLoggingEvent(projectFinishedEvent); - projectFinishedEventLoggingEvent.WriteToStream(writer, loggingTypeCacheWrites); - - TargetStartedEventArgs targetStartedEvent = new TargetStartedEventArgs("Message", "HelpKeyword", "TargetName", "ProjectFile", "TargetFile"); - targetStartedEvent.BuildEventContext = context; - NodeLoggingEvent targetStartedEventLoggingEvent = new NodeLoggingEvent(targetStartedEvent); - targetStartedEventLoggingEvent.WriteToStream(writer, loggingTypeCacheWrites); - - TargetFinishedEventArgs targetFinished = new TargetFinishedEventArgs("Message", "HelpKeyword","TargetName", "ProjectFile", "TargetFile", true); - targetFinished.BuildEventContext = context; - NodeLoggingEvent targetFinishedEventLoggingEvent = new NodeLoggingEvent(targetFinished); - targetFinishedEventLoggingEvent.WriteToStream(writer, loggingTypeCacheWrites); - - TaskStartedEventArgs taskStartedEvent = new TaskStartedEventArgs("Message", "HelpKeyword", "ProjectFile", "TaskFile", "TaskName"); - taskStartedEvent.BuildEventContext = context; - NodeLoggingEvent taskStartedEventLoggingEvent = new NodeLoggingEvent(taskStartedEvent); - taskStartedEventLoggingEvent.WriteToStream(writer, loggingTypeCacheWrites); - - TaskFinishedEventArgs taskFinishedEvent = new TaskFinishedEventArgs("Message", "HelpKeyword", "ProjectFile", "TaskFile", "TaskName", true); - taskFinishedEvent.BuildEventContext = context; - NodeLoggingEvent taskFinishedEventLoggingEvent = new NodeLoggingEvent(taskFinishedEvent); - taskFinishedEventLoggingEvent.WriteToStream(writer, loggingTypeCacheWrites); - - BuildFinishedEventArgs buildFinishedEvent = new BuildFinishedEventArgs("Message","Help",true); - buildFinishedEvent.BuildEventContext = context; - NodeLoggingEvent buildFinishedEventEventLoggingEvent = new NodeLoggingEvent(buildFinishedEvent); - buildFinishedEventEventLoggingEvent.WriteToStream(writer, loggingTypeCacheWrites); - - BuildStartedEventArgs buildStartedEvent = new BuildStartedEventArgs("Message","Help"); - buildStartedEvent.BuildEventContext = context; - NodeLoggingEvent buildStartedEventLoggingEvent = new NodeLoggingEvent(buildStartedEvent); - buildStartedEventLoggingEvent.WriteToStream(writer, loggingTypeCacheWrites); - - TaskCommandLineEventArgs commandlineEventArg = new TaskCommandLineEventArgs("CommandLine","TaskName", MessageImportance.High); - commandlineEventArg.BuildEventContext = context; - NodeLoggingEvent commandlineEventArgLoggingEvent = new NodeLoggingEvent(commandlineEventArg); - commandlineEventArgLoggingEvent.WriteToStream(writer, loggingTypeCacheWrites); - - Hashtable loggingTypeCacheReads = new Hashtable(); - long streamWriteEndPosition = stream.Position; - stream.Position = 0; - - NodeLoggingEvent nodeLoggingEvent = new NodeLoggingEvent(null); - nodeLoggingEvent.CreateFromStream(reader, loggingTypeCacheReads); - Assert.IsTrue(nodeLoggingEvent.BuildEvent.GetType() == typeof(GenericBuildEventArg)); - - nodeLoggingEvent = new NodeLoggingEvent(null); - nodeLoggingEvent.CreateFromStream(reader, loggingTypeCacheReads); - Assert.IsTrue(nodeLoggingEvent.BuildEvent.GetType() == typeof(GenericCustomBuildEventArg)); - - nodeLoggingEvent = new NodeLoggingEvent(null); - nodeLoggingEvent.CreateFromStream(reader, loggingTypeCacheReads); - Assert.IsTrue(nodeLoggingEvent.BuildEvent.GetType() == typeof(BuildErrorEventArgs)); - - nodeLoggingEvent = new NodeLoggingEvent(null); - nodeLoggingEvent.CreateFromStream(reader, loggingTypeCacheReads); - Assert.IsTrue(nodeLoggingEvent.BuildEvent.GetType() == typeof(BuildMessageEventArgs)); - - nodeLoggingEvent = new NodeLoggingEvent(null); - nodeLoggingEvent.CreateFromStream(reader, loggingTypeCacheReads); - Assert.IsTrue(nodeLoggingEvent.BuildEvent.GetType() == typeof(BuildWarningEventArgs)); - - nodeLoggingEvent = new NodeLoggingEvent(null); - nodeLoggingEvent.CreateFromStream(reader, loggingTypeCacheReads); - Assert.IsTrue(nodeLoggingEvent.BuildEvent.GetType() == typeof(ProjectStartedEventArgs)); - - nodeLoggingEvent = new NodeLoggingEvent(null); - nodeLoggingEvent.CreateFromStream(reader, loggingTypeCacheReads); - Assert.IsTrue(nodeLoggingEvent.BuildEvent.GetType() == typeof(ProjectFinishedEventArgs)); - - nodeLoggingEvent = new NodeLoggingEvent(null); - nodeLoggingEvent.CreateFromStream(reader, loggingTypeCacheReads); - Assert.IsTrue(nodeLoggingEvent.BuildEvent.GetType() == typeof(TargetStartedEventArgs)); - - - nodeLoggingEvent = new NodeLoggingEvent(null); - nodeLoggingEvent.CreateFromStream(reader, loggingTypeCacheReads); - Assert.IsTrue(nodeLoggingEvent.BuildEvent.GetType() == typeof(TargetFinishedEventArgs)); - - nodeLoggingEvent = new NodeLoggingEvent(null); - nodeLoggingEvent.CreateFromStream(reader, loggingTypeCacheReads); - Assert.IsTrue(nodeLoggingEvent.BuildEvent.GetType() == typeof(TaskStartedEventArgs)); - - nodeLoggingEvent = new NodeLoggingEvent(null); - nodeLoggingEvent.CreateFromStream(reader, loggingTypeCacheReads); - Assert.IsTrue(nodeLoggingEvent.BuildEvent.GetType() == typeof(TaskFinishedEventArgs)); - - nodeLoggingEvent = new NodeLoggingEvent(null); - nodeLoggingEvent.CreateFromStream(reader, loggingTypeCacheReads); - Assert.IsTrue(nodeLoggingEvent.BuildEvent.GetType() == typeof(BuildFinishedEventArgs)); - - nodeLoggingEvent = new NodeLoggingEvent(null); - nodeLoggingEvent.CreateFromStream(reader, loggingTypeCacheReads); - Assert.IsTrue(nodeLoggingEvent.BuildEvent.GetType() == typeof(BuildStartedEventArgs)); - - nodeLoggingEvent = new NodeLoggingEvent(null); - nodeLoggingEvent.CreateFromStream(reader, loggingTypeCacheReads); - Assert.IsTrue(nodeLoggingEvent.BuildEvent.GetType() ==typeof( TaskCommandLineEventArgs)); - - long streamReadEndPosition = stream.Position; - Assert.AreEqual(streamWriteEndPosition, streamReadEndPosition, "Expected Read and Write Positions to match"); - } - - /// - /// Test the case where a nodeLoggingEvent with loggerId is serialized - /// - [Test] - public void TestLoggingEventWithIdCustomerSerialization() - { - Hashtable loggingTypeCacheWrites = new Hashtable(); - GenericCustomBuildEventArg genericEvent = new GenericCustomBuildEventArg("FooFighter"); - NodeLoggingEventWithLoggerId nodeEvent = new NodeLoggingEventWithLoggerId(genericEvent, 4); - stream.Position = 0; - nodeEvent.WriteToStream(writer, loggingTypeCacheWrites); - long streamWriteEndPosition = stream.Position; - - stream.Position = 0; - Hashtable loggingTypeCacheReads = new Hashtable(); - - NodeLoggingEventWithLoggerId nodeEvent2 = new NodeLoggingEventWithLoggerId(null,-1); - nodeEvent2.CreateFromStream(reader, loggingTypeCacheReads); - long streamReadEndPosition = stream.Position; - Assert.IsTrue(streamWriteEndPosition == streamReadEndPosition, "Stream end positions should be equal"); - - // Only checking loggingId because the serialization of the events are checked in the above test - Assert.AreEqual(nodeEvent.LoggerId, nodeEvent2.LoggerId, "Expected LoggerId to match"); - Assert.IsTrue(string.Compare(((GenericCustomBuildEventArg)nodeEvent.BuildEvent).customField, ((GenericCustomBuildEventArg)nodeEvent2.BuildEvent).customField, StringComparison.OrdinalIgnoreCase) == 0); - } - - } -} diff --git a/src/Deprecated/Engine.UnitTests/NodeManager_Tests.cs b/src/Deprecated/Engine.UnitTests/NodeManager_Tests.cs deleted file mode 100644 index ba016d9b45b..00000000000 --- a/src/Deprecated/Engine.UnitTests/NodeManager_Tests.cs +++ /dev/null @@ -1,359 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Reflection; -using System.Collections; -using NUnit.Framework; -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine; -using System.Text.RegularExpressions; -using System.Xml; -using System.Collections.Generic; - -namespace Microsoft.Build.UnitTests -{ - - [TestFixture] - public class NodeManager_Tests - { - private Engine engine = new Engine(@"c:\"); - [Test] - public void TestConstructor() - { - NodeManager nodeManager = new NodeManager(1, false, engine); - Assert.IsTrue(nodeManager.TaskExecutionModule.GetExecutionModuleMode() == TaskExecutionModule.TaskExecutionModuleMode.SingleProcMode, "Expected Task Mode to be Single"); - nodeManager.UpdateSettings(true, true, true); - } - - [Test] - public void TestConstructor2() - { - NodeManager nodeManager = new NodeManager(1, true, engine); - Assert.IsTrue(nodeManager.TaskExecutionModule.GetExecutionModuleMode() == TaskExecutionModule.TaskExecutionModuleMode.MultiProcFullNodeMode, "Expected Task Mode to be SingleProc"); - } - - [Test] - public void TestConstructor3() - { - - NodeManager nodeManager = new NodeManager(4, true, engine); - Assert.IsTrue(nodeManager.TaskExecutionModule.GetExecutionModuleMode() == TaskExecutionModule.TaskExecutionModuleMode.MultiProcFullNodeMode, "Expected Task Mode to be MultiProc"); - } - - [Test] - public void TestConstructor4() - { - - NodeManager nodeManager = new NodeManager(4, false, engine); - Assert.IsTrue(nodeManager.TaskExecutionModule.GetExecutionModuleMode() == TaskExecutionModule.TaskExecutionModuleMode.MultiProcFullNodeMode, "Expected Task Mode to be MultiProc"); - } - - - - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void RegisterNullNodeProviders() - { - MockNodeProvider nullNodeProvider = null; - NodeManager nodeManager = new NodeManager(1, false, engine); - nodeManager.RegisterNodeProvider(nullNodeProvider); - } - - [Test] - public void RegisterNodeProviders() - { - - MockNodeProvider ProviderOneNode = new MockNodeProvider(); - ProviderOneNode.NodeDescriptions.Add(new MockNodeDescription("Provider One Node One")); - - MockNodeProvider ProviderThreeNodes = new MockNodeProvider(); - ProviderThreeNodes.NodeDescriptions.Add(new MockNodeDescription("Provider Two Node One")); - ProviderThreeNodes.NodeDescriptions.Add(new MockNodeDescription("Provider Two Node Two")); - ProviderThreeNodes.NodeDescriptions.Add(new MockNodeDescription("Provider Two Node Three")); - - MockNodeProvider ProviderNoNodes = new MockNodeProvider(); - - // Register a node provider with only one node - NodeManager nodeManager = new NodeManager(1, false, new Engine(@"c:\")); - nodeManager.RegisterNodeProvider(ProviderOneNode); - // One from node added by node provider, one for the default 0 local node (null as there is no description) - Assert.IsTrue(nodeManager.GetNodeDescriptions().Length == 2, "Expected there to be two node Descriptions"); - Assert.AreEqual(2, nodeManager.MaxNodeCount); - Assert.IsNull(nodeManager.GetNodeDescriptions()[0],"Expected first element to be null"); - Assert.IsTrue(string.Compare(((MockNodeDescription)nodeManager.GetNodeDescriptions()[1]).NodeDescription, "Provider One Node One", StringComparison.OrdinalIgnoreCase)==0, "Expected node description to be Provider One Node One"); - - // Register a node provider with more than one node - nodeManager = new NodeManager(1, false, new Engine(@"c:\")); - nodeManager.RegisterNodeProvider(ProviderThreeNodes); - // THree from node added by node provider, one for the default 0 local node (null as there is no description) - Assert.IsTrue(nodeManager.GetNodeDescriptions().Length == 4, "Expected there to be four node Descriptions"); - Assert.AreEqual(4, nodeManager.MaxNodeCount); - Assert.IsNull(nodeManager.GetNodeDescriptions()[0], "Expected first element to be null"); - Assert.IsTrue(string.Compare(((MockNodeDescription)nodeManager.GetNodeDescriptions()[1]).NodeDescription, "Provider Two Node One", StringComparison.OrdinalIgnoreCase) == 0, "Expected node description to be Provider Two Node One"); - Assert.IsTrue(string.Compare(((MockNodeDescription)nodeManager.GetNodeDescriptions()[2]).NodeDescription, "Provider Two Node Two", StringComparison.OrdinalIgnoreCase) == 0, "Expected node description to be Provider Two Node Two"); - Assert.IsTrue(string.Compare(((MockNodeDescription)nodeManager.GetNodeDescriptions()[3]).NodeDescription, "Provider Two Node Three", StringComparison.OrdinalIgnoreCase) == 0, "Expected node description to be Provider Two Node Three"); - - - // Register a node provider with more than one node - nodeManager = new NodeManager(1, false, new Engine(@"c:\")); - nodeManager.RegisterNodeProvider(ProviderOneNode); - nodeManager.RegisterNodeProvider(ProviderThreeNodes); - // THree from node added by node provider, one for the default 0 local node (null as there is no description) - Assert.IsTrue(nodeManager.GetNodeDescriptions().Length == 5, "Expected there to be four node Descriptions"); - Assert.AreEqual(5, nodeManager.MaxNodeCount); - Assert.IsNull(nodeManager.GetNodeDescriptions()[0], "Expected first element to be null"); - Assert.IsTrue(string.Compare(((MockNodeDescription)nodeManager.GetNodeDescriptions()[1]).NodeDescription, "Provider One Node One", StringComparison.OrdinalIgnoreCase) == 0, "Expected node description to be Provider One Node One"); - Assert.IsTrue(string.Compare(((MockNodeDescription)nodeManager.GetNodeDescriptions()[2]).NodeDescription, "Provider Two Node One", StringComparison.OrdinalIgnoreCase) == 0, "Expected node description to be Provider Two Node One"); - Assert.IsTrue(string.Compare(((MockNodeDescription)nodeManager.GetNodeDescriptions()[3]).NodeDescription, "Provider Two Node Two", StringComparison.OrdinalIgnoreCase) == 0, "Expected node description to be Provider Two Node Two"); - Assert.IsTrue(string.Compare(((MockNodeDescription)nodeManager.GetNodeDescriptions()[4]).NodeDescription, "Provider Two Node Three", StringComparison.OrdinalIgnoreCase) == 0, "Expected node description to be Provider Two Node Three"); - - - // Register a node provider with more than one node - nodeManager = new NodeManager(1, false, new Engine(@"c:\")); - nodeManager.RegisterNodeProvider(ProviderThreeNodes); - nodeManager.RegisterNodeProvider(ProviderOneNode); - nodeManager.UpdateSettings(true, false, true); // just need to test this once - // THree from node added by node provider, one for the default 0 local node (null as there is no description) - Assert.IsTrue(nodeManager.GetNodeDescriptions().Length == 5, "Expected there to be four node Descriptions"); - Assert.AreEqual(5, nodeManager.MaxNodeCount); - Assert.IsNull(nodeManager.GetNodeDescriptions()[0], "Expected first element to be null"); - Assert.IsTrue(string.Compare(((MockNodeDescription)nodeManager.GetNodeDescriptions()[1]).NodeDescription, "Provider Two Node One", StringComparison.OrdinalIgnoreCase) == 0, "Expected node description to be Provider Two Node One"); - Assert.IsTrue(string.Compare(((MockNodeDescription)nodeManager.GetNodeDescriptions()[2]).NodeDescription, "Provider Two Node Two", StringComparison.OrdinalIgnoreCase) == 0, "Expected node description to be Provider Two Node Two"); - Assert.IsTrue(string.Compare(((MockNodeDescription)nodeManager.GetNodeDescriptions()[3]).NodeDescription, "Provider Two Node Three", StringComparison.OrdinalIgnoreCase) == 0, "Expected node description to be Provider Two Node Three"); - Assert.IsTrue(string.Compare(((MockNodeDescription)nodeManager.GetNodeDescriptions()[4]).NodeDescription, "Provider One Node One", StringComparison.OrdinalIgnoreCase) == 0, "Expected node description to be Provider One Node One"); - } - - [Test] - public void TestEnableOutOfProcLogging() - { - // Register a node provider with more than one node - MockNodeProvider ProviderOneNode = new MockNodeProvider(); - ProviderOneNode.NodeDescriptions.Add(new MockNodeDescription("Provider One Node One")); - NodeManager nodeManager = new NodeManager(1, false, new Engine(@"c:\")); - nodeManager.RegisterNodeProvider(ProviderOneNode); - nodeManager.UpdateSettings(true,false, true); // just need to test this once - } - - [Test] - public void TestShutdownNodes() - { - MockNodeProvider ProviderThreeNodes = new MockNodeProvider(); - ProviderThreeNodes.NodeDescriptions.Add(new MockNodeDescription("Provider Two Node One")); - ProviderThreeNodes.NodeDescriptions.Add(new MockNodeDescription("Provider Two Node Two")); - ProviderThreeNodes.NodeDescriptions.Add(new MockNodeDescription("Provider Two Node Three")); - - NodeManager nodeManager = new NodeManager(1, false, new Engine(@"c:\")); - nodeManager.RegisterNodeProvider(ProviderThreeNodes); - nodeManager.ShutdownNodes(Node.NodeShutdownLevel.PoliteShutdown); - - Assert.IsTrue(ProviderThreeNodes.NodeDescriptions.TrueForAll(delegate(INodeDescription o) - { - return o == null; - } - ), "Expected all descriptions to be null"); - - } - - [Test] - public void TestPostBuildResultToNode() - { - MockNodeProvider ProviderThreeNodes = new MockNodeProvider(); - ProviderThreeNodes.NodeDescriptions.Add(new MockNodeDescription("Provider Two Node One")); - ProviderThreeNodes.NodeDescriptions.Add(new MockNodeDescription("Provider Two Node Two")); - ProviderThreeNodes.NodeDescriptions.Add(new MockNodeDescription("Provider Two Node Three")); - - MockNodeProvider ProviderOneNode = new MockNodeProvider(); - ProviderOneNode.NodeDescriptions.Add(new MockNodeDescription("Provider One Node One")); - - NodeManager nodeManager = new NodeManager(1, false, new Engine(@"c:\")); - nodeManager.RegisterNodeProvider(ProviderThreeNodes); - nodeManager.RegisterNodeProvider(ProviderOneNode); - - nodeManager.PostBuildResultToNode(1, new BuildResult(null, new Hashtable(StringComparer.OrdinalIgnoreCase), false, 2, 1, 6, false, string.Empty, string.Empty, 0, 0, 0)); - nodeManager.PostBuildResultToNode(2, new BuildResult(null, new Hashtable(StringComparer.OrdinalIgnoreCase), false, 3, 2, 7, false, string.Empty, string.Empty, 0, 0, 0)); - nodeManager.PostBuildResultToNode(3, new BuildResult(null, new Hashtable(StringComparer.OrdinalIgnoreCase), false, 4, 3, 8, false, string.Empty, string.Empty, 0, 0, 0)); - nodeManager.PostBuildResultToNode(4, new BuildResult(null, new Hashtable(StringComparer.OrdinalIgnoreCase), false, 5, 4, 9, false, string.Empty, string.Empty, 0, 0, 0)); - Assert.IsTrue(ProviderThreeNodes.buildResultsSubmittedToProvider.Count == 3, "Expected there to be three build results in the mock provider"); - Assert.IsTrue(ProviderThreeNodes.buildResultsSubmittedToProvider[0].HandleId == 2, "Expected first NodeProxyId to be 2"); - Assert.IsTrue(ProviderThreeNodes.buildResultsSubmittedToProvider[1].HandleId == 3, "Expected second NodeProxyId to be 3"); - Assert.IsTrue(ProviderThreeNodes.buildResultsSubmittedToProvider[2].HandleId == 4, "Expected third NodeProxyId to be 4"); - Assert.IsTrue(ProviderOneNode.buildResultsSubmittedToProvider.Count == 1, "Expected there to be one build results in the mock provider"); - Assert.IsTrue(ProviderOneNode.buildResultsSubmittedToProvider[0].HandleId == 5, "Expected first NodeProxyId to be 5"); - } - - [Test] - public void TestPostBuildRequestToNode() - { - MockNodeProvider ProviderThreeNodes = new MockNodeProvider(); - ProviderThreeNodes.NodeDescriptions.Add(new MockNodeDescription("Provider Two Node One")); - ProviderThreeNodes.NodeDescriptions.Add(new MockNodeDescription("Provider Two Node Two")); - ProviderThreeNodes.NodeDescriptions.Add(new MockNodeDescription("Provider Two Node Three")); - - MockNodeProvider ProviderOneNode = new MockNodeProvider(); - ProviderOneNode.NodeDescriptions.Add(new MockNodeDescription("Provider One Node One")); - - NodeManager nodeManager = new NodeManager(1, false, new Engine(@"c:\")); - nodeManager.RegisterNodeProvider(ProviderThreeNodes); - nodeManager.RegisterNodeProvider(ProviderOneNode); - - nodeManager.PostBuildRequestToNode(1, new BuildRequest(1, "ProjectFile", null, new BuildPropertyGroup(), null, 1, false, false)); - nodeManager.PostBuildRequestToNode(2, new BuildRequest(2, "ProjectFile", null, new BuildPropertyGroup(), null, 2, false, false)); - nodeManager.PostBuildRequestToNode(3, new BuildRequest(3, "ProjectFile", null, new BuildPropertyGroup(), null, 3, false, false)); - nodeManager.PostBuildRequestToNode(4, new BuildRequest(4, "ProjectFile", null, new BuildPropertyGroup(), null, 4, false, false)); - - Assert.IsTrue(ProviderThreeNodes.buildRequestsSubmittedToProvider.Count == 3, "Expected there to be three build results in the mock provider"); - Assert.IsTrue(ProviderThreeNodes.buildRequestsSubmittedToProvider[0].HandleId == 1, "Expected first NodeProxyId to be 1"); - Assert.IsTrue(ProviderThreeNodes.buildRequestsSubmittedToProvider[1].HandleId == 2, "Expected second NodeProxyId to be 2"); - Assert.IsTrue(ProviderThreeNodes.buildRequestsSubmittedToProvider[2].HandleId == 3, "Expected third NodeProxyId to be 3"); - Assert.IsTrue(ProviderOneNode.buildRequestsSubmittedToProvider.Count == 1, "Expected there to be one build results in the mock provider"); - Assert.IsTrue(ProviderOneNode.buildRequestsSubmittedToProvider[0].HandleId == 4, "Expected first NodeProxyId to be 4"); - } - - - [Test] - public void TestGetNodeDescriptions() - { - MockNodeProvider ProviderThreeNodes = new MockNodeProvider(); - ProviderThreeNodes.NodeDescriptions.Add(new MockNodeDescription("Provider Two Node One")); - ProviderThreeNodes.NodeDescriptions.Add(new MockNodeDescription("Provider Two Node Two")); - ProviderThreeNodes.NodeDescriptions.Add(new MockNodeDescription("Provider Two Node Three")); - - MockNodeProvider ProviderOneNode = new MockNodeProvider(); - ProviderOneNode.NodeDescriptions.Add(new MockNodeDescription("Provider One Node One")); - - NodeManager nodeManager = new NodeManager(1, false, new Engine(@"c:\")); - nodeManager.RegisterNodeProvider(ProviderThreeNodes); - nodeManager.RegisterNodeProvider(ProviderOneNode); - // Cant assert the contents yet as there is no definition inside of a INodeDescription interface - Assert.IsTrue(nodeManager.GetNodeDescriptions().Length == 5, "Expected there to be five descriptions"); - } - } - - /// - /// Dont know what node description is, so I just set it to something for now - /// - internal class MockNodeDescription:INodeDescription - { - string nodeDescription; - - public string NodeDescription - { - get { return nodeDescription; } - } - internal MockNodeDescription(string description) - { - nodeDescription = description; - } - } - - internal class MockNodeProvider:INodeProvider - { - string initConfiguration; - IEngineCallback initEngineCallback; - List nodeDescriptions; - BuildPropertyGroup parentGlobalProperties; - ToolsetDefinitionLocations toolsetSearchLocations; - string startDirectory; - - internal List NodeDescriptions - { - get { return nodeDescriptions; } - set { nodeDescriptions = value; } - } - internal List buildRequestsSubmittedToProvider; - internal List buildResultsSubmittedToProvider; - #region INodeProvider Members - - internal MockNodeProvider() - { - nodeDescriptions = new List(); - buildRequestsSubmittedToProvider = new List(); - buildResultsSubmittedToProvider = new List(); - } - void INodeProvider.Initialize(string configuration, IEngineCallback engineCallback, BuildPropertyGroup parentGlobalProperties, - ToolsetDefinitionLocations toolsetSearchLocations, string startDirectory) - { - this.initConfiguration = configuration; - this.initEngineCallback = engineCallback; - this.parentGlobalProperties = parentGlobalProperties; - this.toolsetSearchLocations = toolsetSearchLocations; - this.startDirectory = startDirectory; - } - - INodeDescription[] INodeProvider.QueryNodeDescriptions() - { - return nodeDescriptions.ToArray(); - } - - void INodeProvider.RegisterNodeLogger(LoggerDescription description ) - { - if ( description == null ) - { - throw new ArgumentException("Logger description should be non-null"); - } - } - - void INodeProvider.PostBuildRequestToNode(int nodeIndex, BuildRequest buildRequest) - { - if (nodeIndex > nodeDescriptions.Count) - { - throw new ArgumentException("Node index is out of range"); - } - buildRequestsSubmittedToProvider.Add(buildRequest); - } - - void INodeProvider.PostBuildResultToNode(int nodeIndex, BuildResult buildResultToPost) - { - if (nodeIndex > nodeDescriptions.Count) - { - throw new ArgumentException("Node index is out of range"); - } - buildResultsSubmittedToProvider.Add(buildResultToPost); - } - - void INodeProvider.ShutdownNodes(Node.NodeShutdownLevel nodeShutdownLevel) - { - for (int i = 0; i < NodeDescriptions.Count; i++) - { - NodeDescriptions[i] = null; - } - } - - - #endregion - - #region INodeProvider Members - - - public void UpdateSettings(bool enableOutOfProcLogging, bool enableOnlyLogCriticalEvents, bool useBreadthFirstTraversalSetting) - { - - } - - #endregion - - #region INodeProvider Members - - - public void AssignNodeIdentifiers(int[] nodeIdentifiers) - { - - } - - public void RequestNodeStatus(int nodeIndex, int requestId) - { - } - - public void PostIntrospectorCommand(int nodeIndex, TargetInProgessState child, TargetInProgessState parent) - { - } - - #endregion - } - -} diff --git a/src/Deprecated/Engine.UnitTests/NodeRequestMapping_Tests.cs b/src/Deprecated/Engine.UnitTests/NodeRequestMapping_Tests.cs deleted file mode 100644 index 75006eafe8d..00000000000 --- a/src/Deprecated/Engine.UnitTests/NodeRequestMapping_Tests.cs +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections.Generic; -using System.Text; -using System.Xml; -using System.IO; -using System.Collections; - -using NUnit.Framework; - -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class NodeRequestMapping_Tests - { - // Project to which the results will be cached to - CacheScope cacheScope; - // Build result which will be added to the cache - BuildResult resultWithOutputs; - // Build result marked as should not cache - BuildResult uncacheableResult; - // Build result that was failed - BuildResult failedResult; - - [SetUp] - public void Initialize() - { - // Create some items and place them in a dictionary - // Add some include information so that when we check the final - // item spec we can verify that the item was recreated properly - BuildItem buildItem1 = new BuildItem("BuildItem1", "Item1"); - buildItem1.Include = "TestInclude1"; - BuildItem[] buildItems = new BuildItem[1]; - buildItems[0] = buildItem1; - Dictionary dictionary = new Dictionary(); - dictionary.Add("TaskItems", buildItems); - - Hashtable resultByTargetSuccess = new Hashtable(StringComparer.OrdinalIgnoreCase); - resultByTargetSuccess.Add("TaskItems", Target.BuildState.CompletedSuccessfully); - Hashtable resultByTargetFailure = new Hashtable(StringComparer.OrdinalIgnoreCase); - resultByTargetFailure.Add("TaskItems", Target.BuildState.CompletedUnsuccessfully); - Hashtable resultByTargetSkipped = new Hashtable(StringComparer.OrdinalIgnoreCase); - resultByTargetSkipped.Add("TaskItems", Target.BuildState.Skipped); - - resultWithOutputs = new BuildResult(dictionary, resultByTargetSuccess, true, 1, 1, 3, true, string.Empty, string.Empty, 0, 0, 0); - failedResult = new BuildResult(dictionary, resultByTargetFailure, false, 1, 1, 3, true, string.Empty, string.Empty, 0, 0, 0); - uncacheableResult = new BuildResult(dictionary, resultByTargetSkipped, true, 1, 1, 3, true, string.Empty, string.Empty, 0, 0, 0); - - cacheScope = new CacheScope("temp.proj", new BuildPropertyGroup(), "3.5"); - } - - /// - /// Test AddResultToCache using a "normal" constructor call - /// - [Test] - public void AddResultToCache() - { - Assert.IsNull(cacheScope.GetCacheEntry("TaskItems"), "Cache should not have an entry"); - NodeRequestMapping requestMapping = new NodeRequestMapping(1, 1, cacheScope); - Assert.AreEqual(1,requestMapping.HandleId,"Expected NodeProxyId to be 1"); - Assert.AreEqual(1,requestMapping.RequestId,"Expected RequestId to be 1"); - requestMapping.AddResultToCache(resultWithOutputs); - Assert.IsTrue(resultWithOutputs.EvaluationResult == ((BuildResultCacheEntry)cacheScope.GetCacheEntry("TaskItems")).BuildResult, - "Expected EvaluationResult to be the same after it was retrieved from the cache"); - Assert.IsTrue(((BuildItem[])resultWithOutputs.OutputsByTarget["TaskItems"])[0].Include == ((BuildResultCacheEntry)cacheScope.GetCacheEntry("TaskItems")).BuildItems[0].Include, - "Expected EvaluationResult to be the same after it was retrieved from the cache"); - // Remove the entry from the cache - cacheScope.ClearCacheEntry("TaskItems"); - } - - /// - /// If no the result is marked as uncacheable it should not be cached - /// - [Test] - public void AddResultToCacheUncacheableResult() - { - Assert.IsNull(cacheScope.GetCacheEntry("TaskItems"), "Cache should not have an entry"); - NodeRequestMapping requestMapping = new NodeRequestMapping(1, 1, cacheScope); - Assert.AreEqual(1, requestMapping.HandleId, "Expected NodeProxyId to be 1"); - Assert.AreEqual(1, requestMapping.RequestId, "Expected RequestId to be 1"); - requestMapping.AddResultToCache(uncacheableResult); - Assert.IsNull(cacheScope.GetCacheEntry("TaskItems"), - "Expected null to be retrieved from the cache as the targetNamesList should not have been added"); - } - - /// - /// If no the result is failed it should not be cached - /// - [Test] - public void AddResultToCacheFailedResult() - { - Assert.IsNull(cacheScope.GetCacheEntry("TaskItems"), "Cache should not have an entry"); - NodeRequestMapping requestMapping = new NodeRequestMapping(1, 1, cacheScope); - Assert.AreEqual(1, requestMapping.HandleId, "Expected NodeProxyId to be 1"); - Assert.AreEqual(1, requestMapping.RequestId, "Expected RequestId to be 1"); - requestMapping.AddResultToCache(failedResult); - Assert.IsTrue(failedResult.EvaluationResult == ((BuildResultCacheEntry)cacheScope.GetCacheEntry("TaskItems")).BuildResult, - "Expected EvaluationResult to be the same after it was retrieved from the cache"); - Assert.IsNull(((BuildResultCacheEntry)cacheScope.GetCacheEntry("TaskItems")).BuildItems, - "Task items should not be cached for failed build results"); - // Remove the entry from the cache - cacheScope.ClearCacheEntry("TaskItems"); - } - - /// - /// Internal error exception should be thrown if null cache scope is passed in. This test is - /// here to describe the behavior but it is not run because it causes a pop up. - /// - /* [Test] - [ExpectedException(typeof(InternalErrorException))] - public void AddResultToPassInNullCacheScope() - { - NodeRequestMapping requestMapping = new NodeRequestMapping(1, 1, null ); - } */ - - /// - /// Make sure that the correct InternalErrorException exception is thrown if a null build result is - /// attempted to be cached. This test is - /// here to describe the behavior but it is not run because it causes a pop up. - /// - /*[Test] - [ExpectedException(typeof(InternalErrorException))] - public void AddResultToCacheNullBuildResult() - { - NodeRequestMapping requestMapping = new NodeRequestMapping(1, 1, cacheScope); - Assert.AreEqual(1, requestMapping.NodeProxyId, "Expected NodeProxyId to be 1"); - Assert.AreEqual(1, requestMapping.RequestId, "Expected RequestId to be 1"); - requestMapping.AddResultToCache(null); - }*/ - - } -} diff --git a/src/Deprecated/Engine.UnitTests/NodeStatus_Tests.cs b/src/Deprecated/Engine.UnitTests/NodeStatus_Tests.cs deleted file mode 100644 index a45b6843ef5..00000000000 --- a/src/Deprecated/Engine.UnitTests/NodeStatus_Tests.cs +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections.Generic; -using System.Text; -using System.IO; - -using NUnit.Framework; - -using Microsoft.Build.BuildEngine; - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class NodeStatus_Tests - { - [Test] - public void NodeStatusCustomSerialization() - { - // Stream, writer and reader where the events will be serialized and deserialized from - MemoryStream stream = new MemoryStream(); - BinaryWriter writer = new BinaryWriter(stream); - BinaryReader reader = new BinaryReader(stream); - try - { - NodeStatus nodeStatus1 = new NodeStatus(1, true, 4, 1928374, 384923834, true); - - Exception except = new Exception("I am bad"); - NodeStatus nodeStatus2 = new NodeStatus(except); - - stream.Position = 0; - // Serialize - nodeStatus1.WriteToStream(writer); - // Get position of stream after write so it can be compared to the position after read - long streamWriteEndPosition = stream.Position; - - // Deserialize and Verify - stream.Position = 0; - NodeStatus newNodeStatus = NodeStatus.CreateFromStream(reader); - long streamReadEndPosition = stream.Position; - Assert.IsTrue(streamWriteEndPosition == streamReadEndPosition, "Stream End Positions Should Match"); - Assert.IsTrue(newNodeStatus.IsActive == newNodeStatus.IsActive); - Assert.IsTrue(newNodeStatus.IsLaunchInProgress == nodeStatus1.IsLaunchInProgress); - Assert.IsTrue(newNodeStatus.TimeSinceLastLoopActivity == nodeStatus1.TimeSinceLastLoopActivity); - Assert.IsTrue(newNodeStatus.TimeSinceLastTaskActivity == nodeStatus1.TimeSinceLastTaskActivity); - Assert.IsTrue(newNodeStatus.QueueDepth == nodeStatus1.QueueDepth); - Assert.IsTrue(newNodeStatus.RequestId == nodeStatus1.RequestId); - Assert.IsTrue(newNodeStatus.UnhandledException == null); - - stream.Position = 0; - // Serialize - nodeStatus2.WriteToStream(writer); - // Get position of stream after write so it can be compared to the position after read - streamWriteEndPosition = stream.Position; - - // Deserialize and Verify - stream.Position = 0; - newNodeStatus = NodeStatus.CreateFromStream(reader); - streamReadEndPosition = stream.Position; - Assert.IsTrue(streamWriteEndPosition == streamReadEndPosition, "Stream End Positions Should Match"); - Assert.IsTrue(newNodeStatus.IsActive == nodeStatus2.IsActive); - Assert.IsTrue(newNodeStatus.IsLaunchInProgress == nodeStatus2.IsLaunchInProgress); - Assert.IsTrue(newNodeStatus.TimeSinceLastLoopActivity == nodeStatus2.TimeSinceLastLoopActivity); - Assert.IsTrue(newNodeStatus.TimeSinceLastTaskActivity == nodeStatus2.TimeSinceLastTaskActivity); - Assert.IsTrue(newNodeStatus.QueueDepth == nodeStatus2.QueueDepth); - Assert.IsTrue(newNodeStatus.RequestId == nodeStatus2.RequestId); - Assert.IsTrue(newNodeStatus.UnhandledException.Message == nodeStatus2.UnhandledException.Message); - } - finally - { - // Close will close the writer/reader and the underlying stream - writer.Close(); - reader.Close(); - reader = null; - stream = null; - writer = null; - } - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/OnError_Tests.cs b/src/Deprecated/Engine.UnitTests/OnError_Tests.cs deleted file mode 100644 index 8bbe6704f56..00000000000 --- a/src/Deprecated/Engine.UnitTests/OnError_Tests.cs +++ /dev/null @@ -1,851 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.IO; -using NUnit.Framework; -using Microsoft.Build.BuildEngine; -using System.Threading; -using System.Collections; - -namespace Microsoft.Build.UnitTests -{ - /* - * Class: OnErrorHandling - * Owner: jomof - * - * Tests that exercise the tag. - */ - [TestFixture] - sealed public class OnErrorHandling - { - /* - * Method: Basic - * Owner: jomof - * - * Construct a simple OnError tag. - */ - [Test] - public void Basic() - { - MockLogger l = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - - - - ", - l - ); - - p.Build(new string [] {"Build"}, null); - - Assertion.Assert("Expected one error because 'Build' failed.", l.ErrorCount==1); - Assertion.Assert("The CleanUp target should have been called.", (l.FullLog.IndexOf("CleanUp-was-called") != -1)); - } - - /// - /// Target items and properties should be published to the project level even when a task that - /// outputs them fails. (Of course the task must have populated its property before it errors.) - /// Then these items and properties should be visible to the onerror targets. - /// - [Test] - public void FailingTaskStillPublishesOutputs() - { - MockLogger l = new MockLogger(); - - string resx = Path.Combine(Path.GetTempPath(), "FailingTaskStillPublishesOutputs.resx"); - - try - { - File.WriteAllText(resx, @" - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - aa - - - bb - - "); - - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - - - - - - - - - - ", - l - ); - - p.Build(new string[] { "Build" }, null); - - string resource = Path.ChangeExtension(resx, ".resources"); - - Assertion.Assert("Expected one error because 'Build' failed.", l.ErrorCount >= 1); - l.AssertLogContains("[" + resource + "]", "[" + resource + "]"); - - // And outputs are visible at the project level - Assertion.AssertEquals(resource, p.GetEvaluatedItemsByName("FilesWrittenItem")[0].FinalItemSpec); - Assertion.AssertEquals(resource, p.GetEvaluatedProperty("FilesWrittenProperty")); - - p.ResetBuildStatus(); - - // But are gone after resetting of course - Assertion.AssertEquals(0, p.GetEvaluatedItemsByName("FilesWrittenItem").Count); - Assertion.AssertEquals(null, p.GetEvaluatedProperty("FilesWrittenProperty")); - - } - finally - { - File.Delete(resx); - } - } - - /// - /// Target items and properties should be published to the project level when an OnError - /// target runs, and those items and properties should be visible to the OnError targets. - /// - [Test] - public void OnErrorSeesPropertiesAndItemsFromFirstTarget() - { - MockLogger l = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - - - - - - - - - - v2 - - - - - - - - - - - ", - l - ); - - p.Build(new string[] { "Build" }, null); - - Assertion.Assert("Expected one error because 'Build' failed.", l.ErrorCount == 1); - l.AssertLogContains("[a1;a2][v1][v2]"); - } - - /* - * Method: TwoExecuteTargets - * Owner: jomof - * - * Make sure two execute targets can be called. - */ - [Test] - public void TwoExecuteTargets() - { - MockLogger l = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - - - - - - - ", - l - ); - - p.Build(new string [] {"Build"}, null); - - Assertion.Assert("Expected one error because 'Build' failed.", l.ErrorCount==1); - Assertion.Assert("The CleanUp target should have been called.", (l.FullLog.IndexOf("CleanUp-was-called") != -1)); - Assertion.Assert("The CleanUp2 target should have been called.", (l.FullLog.IndexOf("CleanUp2-was-called") != -1)); - } - - /* - * Method: TwoOnErrorClauses - * Owner: jomof - * - * Make sure two OnError clauses can be used. - */ - [Test] - public void TwoOnErrorClauses() - { - MockLogger l = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - - - - - - - - ", - l - ); - - p.Build(new string [] {"Build"}, null); - - Assertion.Assert("Expected one error because 'Build' failed.", l.ErrorCount==1); - Assertion.Assert("The CleanUp target should have been called.", (l.FullLog.IndexOf("CleanUp-was-called") != -1)); - Assertion.Assert("The CleanUp2 target should have been called.", (l.FullLog.IndexOf("CleanUp2-was-called") != -1)); - } - - /* - * Method: DependentTarget - * Owner: jomof - * - * Make sure that a target that is a dependent of a target called because of an - * OnError clause is called - */ - [Test] - public void DependentTarget() - { - MockLogger l = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - - - - - - - ", - l - ); - - p.Build(new string [] {"Build"}, null); - - Assertion.Assert("Expected one error because 'Build' failed.", l.ErrorCount==1); - Assertion.Assert("The CleanUp target should have been called.", (l.FullLog.IndexOf("CleanUp-was-called") != -1)); - Assertion.Assert("The CleanUp2 target should have been called.", (l.FullLog.IndexOf("CleanUp2-was-called") != -1)); - } - - /* - * Method: ErrorInChildIsHandledInParent - * Owner: jomof - * - * If a target is dependent on a child target and that child target errors, - * then the parent's OnError clauses should fire. - */ - [Test] - public void ErrorInChildIsHandledInParent() - { - MockLogger l = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - - - - - - ", - l - ); - - p.Build(new string [] {"Build"}, null); - - Assertion.Assert("Expected one error because 'BuildStep1' failed.", l.ErrorCount==1); - Assertion.Assert("The CleanUp target should have been called.", (l.FullLog.IndexOf("CleanUp-was-called") != -1)); - Assertion.Assert("The BuildStep1 target should have been called.", (l.FullLog.IndexOf("Error-in-build-step-1") != -1)); - } - - - /* - * Method: NonExistentExecuteTarget - * Owner: jomof - * - * Construct a simple OnError tag. - */ - [Test] - public void NonExistentExecuteTarget() - { - MockLogger l = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - ", - l - ); - - p.Build(new string [] {"Build"}, null); - - Assertion.Assert("Expected at least one error because 'Build' failed and one error because 'CleanUp' didn't exist.", l.ErrorCount==2); - Assertion.Assert("The CleanUp target should not have been called.", (l.FullLog.IndexOf("CleanUp-was-called") == -1)); - - } - - /* - * Method: TrueCondition - * Owner: jomof - * - * Test the case when the result of the condition is 'true' - */ - [Test] - public void TrueCondition() - { - MockLogger l = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - - - - ", - l - ); - - p.Build(new string [] {"Build"}, null); - - Assertion.Assert("Expected one error because 'Build' failed.", l.ErrorCount == 1); - Assertion.Assert("The CleanUp target should have been called.", (l.FullLog.IndexOf("CleanUp-was-called") != -1)); - } - - /* - * Method: FalseCondition - * Owner: jomof - * - * Test the case when the result of the condition is 'false' - */ - [Test] - public void FalseCondition() - { - MockLogger l = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - - - - ", - l - ); - - - p.Build(new string [] {"Build"}, null); - - Assertion.Assert("Expected one error because 'Build' failed.", l.ErrorCount == 1); - Assertion.Assert("The CleanUp target should not have been called.", (l.FullLog.IndexOf("CleanUp-was-called") == -1)); - } - - /* - * Method: PropertiesInExecuteTargets - * Owner: jomof - * - * Make sure that properties in ExecuteTargets are properly expanded. - */ - [Test] - public void PropertiesInExecuteTargets() - { - MockLogger l = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - Clean - Up - - - - - - - - - ", - l - ); - - p.Build(new string [] {"Build"}, null); - - Assertion.Assert("Expected one error because 'Build' failed.", l.ErrorCount == 1); - Assertion.Assert("The CleanUp target should have been called.", (l.FullLog.IndexOf("CleanUp-was-called") != -1)); - } - - /* - * Method: ErrorTargetsContinueAfterErrorsInErrorHandler - * Owner: jomof - * - * If an error occurs in an error handling target, then continue processing - * remaining error targets - */ - [Test] - public void ErrorTargetsContinueAfterErrorsInErrorHandler() - { - MockLogger l = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - - - - - - - - - - - - - - - - ", - l - ); - - p.Build(new string [] {"Build"}, null); - - Assertion.Assert("Four build errors expect: One from CoreBuild and on each from the error handlers.", l.ErrorCount == 4); - Assertion.Assert("The CleanUp1 target should have been called.", (l.FullLog.IndexOf("CleanUp1-was-called") != -1)); - Assertion.Assert("The CleanUp2 target should have been called.", (l.FullLog.IndexOf("CleanUp2-was-called") != -1)); - Assertion.Assert("The CleanUp3 target should have been called.", (l.FullLog.IndexOf("CleanUp3-was-called") != -1)); - } - - /* - * Method: ExecuteTargetIsMissing - * Owner: jomof - * - * If an OnError specifies an ExecuteTarget that is missing, that's an error - */ - [Test] - public void ExecuteTargetIsMissing() - { - MockLogger l = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - ", - l - ); - - p.Build(new string [] {"Build"}, null); - - Assertion.Assert("Expected one error because 'Build' failed and one because 'CleanUp' doesn't exist.", l.ErrorCount == 2); - } - - /* - * Method: CommentsAroundOnError - * Owner: jomof - * - * Since there is special-case code to ignore comments around OnError blocks, - * let's test this case. - */ - [Test] - public void CommentsAroundOnError() - { - MockLogger l = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - - - - - - ", - l - ); - - p.Build(new string [] {"Build"}, null); - - Assertion.Assert("Expected one error because 'Build' failed.", l.ErrorCount == 1); - Assertion.Assert("The CleanUp target should have been called.", (l.FullLog.IndexOf("CleanUp-was-called") != -1)); - } - - /* - * Method: CircularDependency - * Owner: jomof - * - * Detect circular dependencies and break out. - */ - [Test] - public void CircularDependency() - { - MockLogger l = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - ", - l - ); - - - p.Build(new string [] {"Build"}, null); - - Assertion.Assert("Expected one error because 'Build' failed and one error because of the circular dependency.", l.ErrorCount == 2); - } - - /* - * Method: OutOfOrderOnError - * Owner: jomof - * - * OnError clauses must come at the end of a Target, it can't be sprinkled in-between tasks. Catch this case. - */ - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void OutOfOrderOnError() - { - MockLogger l = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - - - - ", - l - ); - - /* No build required */ - } - - -#region Postbuild - /* - * Method: PostBuildBasic - * Owner: jomof - * - * Handle the basic post-build case where the user has asked for 'On_Success' and - * none of the build steps fail. - */ - [Test] - public void PostBuildBasic() - { - MockLogger l = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject - ( - PostBuildBuilder("On_Success", FailAt.Nowhere), - l - ); - - p.Build(new string [] {"Build"}, null); - - Assertion.Assert("Expected no error because 'Build' succeeded.", l.ErrorCount == 0); - Assertion.Assert("The ResGen target should have been called.", (l.FullLog.IndexOf("ResGen-was-called") != -1)); - Assertion.Assert("The Compile target should have been called.", (l.FullLog.IndexOf("Compile-was-called") != -1)); - Assertion.Assert("The GenerateSatellites target should have been called.", (l.FullLog.IndexOf("GenerateSatellites-was-called") != -1)); - Assertion.Assert("The PostBuild target should have been called.", (l.FullLog.IndexOf("PostBuild-was-called") != -1)); - } - - /* - * Method: PostBuildOnSuccessWhereCompileFailed - * Owner: jomof - * - * User asked for 'On_Success' but the compile step failed. We don't expect post-build - * to be called. - */ - [Test] - public void PostBuildOnSuccessWhereCompileFailed() - { - MockLogger l = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject - ( - PostBuildBuilder("On_Success", FailAt.Compile), - l - ); - - p.Build(new string [] {"Build"}, null); - - Assertion.Assert("Expected one error because 'Build' failed.", l.ErrorCount == 1); - Assertion.Assert("The ResGen target should have been called.", (l.FullLog.IndexOf("ResGen-was-called") != -1)); - Assertion.Assert("The Compile target should have been called.", (l.FullLog.IndexOf("Compile-was-called") != -1)); - Assertion.Assert("The Compile target should have failed.", (l.FullLog.IndexOf("Compile-step-failed") != -1)); - Assertion.Assert("The GenerateSatellites target should not have been called.", (l.FullLog.IndexOf("GenerateSatellites-was-called") == -1)); - Assertion.Assert("The PostBuild target should not have been called.", (l.FullLog.IndexOf("PostBuild-was-called") == -1)); - } - - /* - * Method: PostBuildOnSuccessWhereGenerateSatellitesFailed - * Owner: jomof - * - * User asked for 'On_Success' but the PostBuildOnSuccessWhereGenerateSatellitesFailed step - * failed. We don't expect post-build to be called. - */ - [Test] - public void PostBuildOnSuccessWhereGenerateSatellitesFailed() - { - MockLogger l = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject - ( - PostBuildBuilder("On_Success", FailAt.GenerateSatellites), - l - ); - - p.Build(new string [] {"Build"}, null); - - Assertion.Assert("Expected one error because 'Build' failed.", l.ErrorCount == 1); - Assertion.Assert("The ResGen target should have been called.", (l.FullLog.IndexOf("ResGen-was-called") != -1)); - Assertion.Assert("The Compile target should have been called.", (l.FullLog.IndexOf("Compile-was-called") != -1)); - Assertion.Assert("The GenerateSatellites target should have been called.", (l.FullLog.IndexOf("GenerateSatellites-was-called") != -1)); - Assertion.Assert("The GenerateSatellites target should have failed.", (l.FullLog.IndexOf("GenerateSatellites-step-failed") != -1)); - Assertion.Assert("The PostBuild target should not have been called.", (l.FullLog.IndexOf("PostBuild-was-called") == -1)); - } - - /* - * Method: PostBuildAlwaysWhereCompileFailed - * Owner: jomof - * - * User asked for 'Always' but the compile step failed. We expect the post-build - * to be called. - */ - [Test] - public void PostBuildAlwaysWhereCompileFailed() - { - MockLogger l = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject - ( - PostBuildBuilder("Always", FailAt.Compile), - l - ); - - p.Build(new string [] {"Build"}, null); - - Assertion.Assert("Expected one error because 'Build' failed.", l.ErrorCount == 1); - Assertion.Assert("The ResGen target should have been called.", (l.FullLog.IndexOf("ResGen-was-called") != -1)); - Assertion.Assert("The Compile target should have been called.", (l.FullLog.IndexOf("Compile-was-called") != -1)); - Assertion.Assert("The Compile target should have failed.", (l.FullLog.IndexOf("Compile-step-failed") != -1)); - Assertion.Assert("The GenerateSatellites target should not have been called.", (l.FullLog.IndexOf("GenerateSatellites-was-called") == -1)); - Assertion.Assert("The PostBuild target should have been called.", (l.FullLog.IndexOf("PostBuild-was-called") != -1)); - } - - /* - * Method: PostBuildFinalOutputChangedWhereCompileFailed - * Owner: jomof - * - * User asked for 'Final_Output_Changed' but the Compile step failed. - * We expect post-build to be called. - */ - [Test] - public void PostBuildFinalOutputChangedWhereCompileFailed() - { - MockLogger l = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject - ( - PostBuildBuilder("Final_Output_Changed", FailAt.Compile), - l - ); - - p.Build(new string [] {"Build"}, null); - - Assertion.Assert("Expected one error because 'Build' failed.", l.ErrorCount == 1); - Assertion.Assert("The ResGen target should have been called.", (l.FullLog.IndexOf("ResGen-was-called") != -1)); - Assertion.Assert("The Compile target should have been called.", (l.FullLog.IndexOf("Compile-was-called") != -1)); - Assertion.Assert("The Compile target should have failed.", (l.FullLog.IndexOf("Compile-step-failed") != -1)); - Assertion.Assert("The GenerateSatellites target should not have been called.", (l.FullLog.IndexOf("GenerateSatellites-was-called") == -1)); - Assertion.Assert("The PostBuild target should not have been called.", (l.FullLog.IndexOf("PostBuild-was-called") == -1)); - } - - /* - * Method: PostBuildFinalOutputChangedWhereGenerateSatellitesFailed - * Owner: jomof - * - * User asked for 'Final_Output_Changed' but the GenerateSatellites step failed. - * We expect post-build to be called because Compile succeeded (and wrote to the output). - */ - [Test] - public void PostBuildFinalOutputChangedWhereGenerateSatellitesFailed() - { - MockLogger l = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject - ( - PostBuildBuilder("Final_Output_Changed", FailAt.GenerateSatellites), - l - ); - - p.Build(new string [] {"Build"}, null); - - Assertion.Assert("Expected one error because 'Build' failed.", l.ErrorCount == 1); - Assertion.Assert("The ResGen target should have been called.", (l.FullLog.IndexOf("ResGen-was-called") != -1)); - Assertion.Assert("The Compile target should have been called.", (l.FullLog.IndexOf("Compile-was-called") != -1)); - Assertion.Assert("The GenerateSatellites target should have been called.", (l.FullLog.IndexOf("GenerateSatellites-was-called") != -1)); - Assertion.Assert("The GenerateSatellites target should have failed.", (l.FullLog.IndexOf("GenerateSatellites-step-failed") != -1)); - Assertion.Assert("The PostBuild target should have been called.", (l.FullLog.IndexOf("PostBuild-was-called") != -1)); - } - - - /* - * The different places that PostBuildBuilder might be instructed to fail at - */ - private enum FailAt - { - Compile, - GenerateSatellites, - Nowhere - } - - /* - * Method: PostBuildBuilder - * Owner: jomof - * - * Build a project file that mimics the fairly complex way we plan to use OnError - * to handle all the different combinations of project failures and post-build - * conditions. - * - */ - private static string PostBuildBuilder - ( - string controlFlag, // On_Success, Always, Final_Output_Changed - FailAt failAt - ) - { - string compileStep = ""; - if (FailAt.Compile == failAt) - { - compileStep = ""; - } - - string generateSatellites = ""; - if (FailAt.GenerateSatellites == failAt) - { - generateSatellites = ""; - } - - return String.Format(@" - - - {0} - - - - - - - - {1} - - - - - - - {2} - - - - - - - - - - - - - - - - - - - - - - - ", controlFlag, compileStep, generateSatellites); - } -#endregion - } -} diff --git a/src/Deprecated/Engine.UnitTests/Parser_Tests.cs b/src/Deprecated/Engine.UnitTests/Parser_Tests.cs deleted file mode 100644 index 3c355afad23..00000000000 --- a/src/Deprecated/Engine.UnitTests/Parser_Tests.cs +++ /dev/null @@ -1,540 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Globalization; -using System.Reflection; -using NUnit.Framework; -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine; - - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class ParserTest - { - /// - /// - /// DavidLe - [Test] - public void SimpleParseTest() - { - Console.WriteLine("SimpleParseTest()"); - Parser p = new Parser(); - GenericExpressionNode tree; - - tree = p.Parse("$(foo)", null, ParserOptions.AllowAll); - - - tree = p.Parse("$(foo)=='hello'", null, ParserOptions.AllowAll); - - - tree = p.Parse("$(foo)==''", null, ParserOptions.AllowAll); - - - tree = p.Parse("$(debug) and $(buildlab) and $(full)", null, ParserOptions.AllowAll); - - - tree = p.Parse("$(debug) or $(buildlab) or $(full)", null, ParserOptions.AllowAll); - - - tree = p.Parse("$(debug) and $(buildlab) or $(full)", null, ParserOptions.AllowAll); - - - tree = p.Parse("$(full) or $(debug) and $(buildlab)", null, ParserOptions.AllowAll); - - - tree = p.Parse("%(culture)", null, ParserOptions.AllowAll); - - - tree = p.Parse("%(culture)=='french'", null, ParserOptions.AllowAll); - - - tree = p.Parse("'foo_%(culture)'=='foo_french'", null, ParserOptions.AllowAll); - - - tree = p.Parse("true", null, ParserOptions.AllowAll); - - - tree = p.Parse("false", null, ParserOptions.AllowAll); - - - tree = p.Parse("0", null, ParserOptions.AllowAll); - - - tree = p.Parse("0.0 == 0", null, ParserOptions.AllowAll); - - } - - /// - /// - /// DavidLe - [Test] - public void ComplexParseTest() - { - Console.WriteLine("ComplexParseTest()"); - Parser p = new Parser(); - GenericExpressionNode tree; - - tree = p.Parse("$(foo)", null, ParserOptions.AllowAll); - - - tree = p.Parse("($(foo) or $(bar)) and $(baz)", null, ParserOptions.AllowAll); - - - tree = p.Parse("$(foo) <= 5 and $(bar) >= 15", null, ParserOptions.AllowAll); - - - tree = p.Parse("(($(foo) <= 5 and $(bar) >= 15) and $(baz) == simplestring) and 'a more complex string' != $(quux)", null, ParserOptions.AllowAll); - - - tree = p.Parse("(($(foo) or $(bar) == false) and !($(baz) == simplestring))", null, ParserOptions.AllowAll); - - - tree = p.Parse("(($(foo) or Exists('c:\\foobar.txt')) and !(($(baz) == simplestring)))", null, ParserOptions.AllowAll); - - - tree = p.Parse("'CONTAINS%27QUOTE%27' == '$(TestQuote)'", null, ParserOptions.AllowAll); - - } - - /// - /// - /// DavidLe - [Test] - public void NotParseTest() - { - Console.WriteLine("NegationParseTest()"); - Parser p = new Parser(); - GenericExpressionNode tree; - tree = p.Parse("!true", null, ParserOptions.AllowAll); - - tree = p.Parse("!(true)", null, ParserOptions.AllowAll); - - tree = p.Parse("!($(foo) <= 5)", null, ParserOptions.AllowAll); - - tree = p.Parse("!(%(foo) <= 5)", null, ParserOptions.AllowAll); - - tree = p.Parse("!($(foo) <= 5 and $(bar) >= 15)", null, ParserOptions.AllowAll); - - } - /// - /// - /// DavidLe - [Test] - public void FunctionCallParseTest() - { - Console.WriteLine("FunctionCallParseTest()"); - Parser p = new Parser(); - GenericExpressionNode tree; - tree = p.Parse("SimpleFunctionCall()", null, ParserOptions.AllowAll); - - tree = p.Parse("SimpleFunctionCall( 1234 )", null, ParserOptions.AllowAll); - tree = p.Parse("SimpleFunctionCall( true )", null, ParserOptions.AllowAll); - tree = p.Parse("SimpleFunctionCall( $(property) )", null, ParserOptions.AllowAll); - - tree = p.Parse("SimpleFunctionCall( $(property), 1234, abcd, 'abcd efgh' )", null, ParserOptions.AllowAll); - - } - - /// DavidLe - [Test] - public void ItemListParseTest() - { - Console.WriteLine("FunctionCallParseTest()"); - Parser p = new Parser(); - GenericExpressionNode tree; - bool fExceptionCaught; - - fExceptionCaught = false; - try - { - tree = p.Parse("@(foo) == 'a.cs;b.cs'", null, ParserOptions.AllowProperties); - } - catch (InvalidProjectFileException e) - { - Console.WriteLine(e.BaseMessage); - fExceptionCaught = true; - } - Assertion.Assert(fExceptionCaught); - - fExceptionCaught = false; - try - { - tree = p.Parse("'a.cs;b.cs' == @(foo)", null, ParserOptions.AllowProperties); - } - catch (InvalidProjectFileException e) - { - Console.WriteLine(e.BaseMessage); - fExceptionCaught = true; - } - Assertion.Assert(fExceptionCaught); - - fExceptionCaught = false; - try - { - tree = p.Parse("'@(foo)' == 'a.cs;b.cs'", null, ParserOptions.AllowProperties); - } - catch (InvalidProjectFileException e) - { - Console.WriteLine(e.BaseMessage); - fExceptionCaught = true; - } - Assertion.Assert(fExceptionCaught); - - fExceptionCaught = false; - try - { - tree = p.Parse("'otherstuff@(foo)' == 'a.cs;b.cs'", null, ParserOptions.AllowProperties); - } - catch (InvalidProjectFileException e) - { - Console.WriteLine(e.BaseMessage); - fExceptionCaught = true; - } - Assertion.Assert(fExceptionCaught); - - fExceptionCaught = false; - try - { - tree = p.Parse("'@(foo)otherstuff' == 'a.cs;b.cs'", null, ParserOptions.AllowProperties); - } - catch (InvalidProjectFileException e) - { - Console.WriteLine(e.BaseMessage); - fExceptionCaught = true; - } - Assertion.Assert(fExceptionCaught); - - fExceptionCaught = false; - try - { - tree = p.Parse("somefunction(@(foo), 'otherstuff')", null, ParserOptions.AllowProperties); - } - catch (InvalidProjectFileException e) - { - Console.WriteLine(e.BaseMessage); - fExceptionCaught = true; - } - Assertion.Assert(fExceptionCaught); - } - - /// RGoel - [Test] - public void MetadataParseTest() - { - Console.WriteLine("FunctionCallParseTest()"); - Parser p = new Parser(); - GenericExpressionNode tree; - bool fExceptionCaught; - - fExceptionCaught = false; - try - { - tree = p.Parse("%(foo) == 'a.cs;b.cs'", null, ParserOptions.AllowProperties | ParserOptions.AllowItemLists); - } - catch (InvalidProjectFileException e) - { - Console.WriteLine(e.BaseMessage); - fExceptionCaught = true; - } - Assertion.Assert(fExceptionCaught); - - fExceptionCaught = false; - try - { - tree = p.Parse("'a.cs;b.cs' == %(foo)", null, ParserOptions.AllowProperties | ParserOptions.AllowItemLists); - } - catch (InvalidProjectFileException e) - { - Console.WriteLine(e.BaseMessage); - fExceptionCaught = true; - } - Assertion.Assert(fExceptionCaught); - - fExceptionCaught = false; - try - { - tree = p.Parse("'%(foo)' == 'a.cs;b.cs'", null, ParserOptions.AllowProperties | ParserOptions.AllowItemLists); - } - catch (InvalidProjectFileException e) - { - Console.WriteLine(e.BaseMessage); - fExceptionCaught = true; - } - Assertion.Assert(fExceptionCaught); - - fExceptionCaught = false; - try - { - tree = p.Parse("'otherstuff%(foo)' == 'a.cs;b.cs'", null, ParserOptions.AllowProperties | ParserOptions.AllowItemLists); - } - catch (InvalidProjectFileException e) - { - Console.WriteLine(e.BaseMessage); - fExceptionCaught = true; - } - Assertion.Assert(fExceptionCaught); - - fExceptionCaught = false; - try - { - tree = p.Parse("'%(foo)otherstuff' == 'a.cs;b.cs'", null, ParserOptions.AllowProperties | ParserOptions.AllowItemLists); - } - catch (InvalidProjectFileException e) - { - Console.WriteLine(e.BaseMessage); - fExceptionCaught = true; - } - Assertion.Assert(fExceptionCaught); - - fExceptionCaught = false; - try - { - tree = p.Parse("somefunction(%(foo), 'otherstuff')", null, ParserOptions.AllowProperties | ParserOptions.AllowItemLists); - } - catch (InvalidProjectFileException e) - { - Console.WriteLine(e.BaseMessage); - fExceptionCaught = true; - } - Assertion.Assert(fExceptionCaught); - } - - /// - /// - /// DavidLe - [Test] - public void NegativeTests() - { - Console.WriteLine("NegativeTests()"); - Parser p = new Parser(); - GenericExpressionNode tree; - bool fExceptionCaught; - - try - { - fExceptionCaught = false; - // Note no close quote ----------------------------------------------------V - tree = p.Parse("'a more complex' == 'asdf", null, ParserOptions.AllowAll); - } - catch (InvalidProjectFileException e) - { - Console.WriteLine(e.BaseMessage); - fExceptionCaught = true; - } - Assertion.Assert(fExceptionCaught); - - try - { - fExceptionCaught = false; - // Note no close quote ----------------------------------------------------V - tree = p.Parse("(($(foo) <= 5 and $(bar) >= 15) and $(baz) == 'simple string) and 'a more complex string' != $(quux)", null, ParserOptions.AllowAll); - } - catch (InvalidProjectFileException e) - { - Console.WriteLine(e.BaseMessage); - fExceptionCaught = true; - } - Assertion.Assert(fExceptionCaught); - try - { - fExceptionCaught = false; - // Correct tokens, but bad parse -----------V - tree = p.Parse("($(foo) == 'simple string') $(bar)", null, ParserOptions.AllowAll); - } - catch (InvalidProjectFileException e) - { - Console.WriteLine(e.BaseMessage); - fExceptionCaught = true; - } - Assertion.Assert(fExceptionCaught); - - try - { - fExceptionCaught = false; - // Correct tokens, but bad parse -----------V - tree = p.Parse("=='x'", null, ParserOptions.AllowAll); - } - catch (InvalidProjectFileException e) - { - Console.WriteLine(e.BaseMessage); - fExceptionCaught = true; - } - Assertion.Assert(fExceptionCaught); - - try - { - fExceptionCaught = false; - // Correct tokens, but bad parse -----------V - tree = p.Parse("==", null, ParserOptions.AllowAll); - } - catch (InvalidProjectFileException e) - { - Console.WriteLine(e.BaseMessage); - fExceptionCaught = true; - } - Assertion.Assert(fExceptionCaught); - - try - { - fExceptionCaught = false; - // Correct tokens, but bad parse -----------V - tree = p.Parse(">", null, ParserOptions.AllowAll); - } - catch (InvalidProjectFileException e) - { - Console.WriteLine(e.BaseMessage); - fExceptionCaught = true; - } - Assertion.Assert(fExceptionCaught); - try - { - fExceptionCaught = false; - // Correct tokens, but bad parse -----------V - tree = p.Parse("true!=false==", null, ParserOptions.AllowAll); - } - catch (InvalidProjectFileException e) - { - Console.WriteLine(e.BaseMessage); - fExceptionCaught = true; - } - Assertion.Assert(fExceptionCaught); - - try - { - fExceptionCaught = false; - // Correct tokens, but bad parse -----------V - tree = p.Parse("true!=false==true", null, ParserOptions.AllowAll); - } - catch (InvalidProjectFileException e) - { - Console.WriteLine(e.BaseMessage); - fExceptionCaught = true; - } - Assertion.Assert(fExceptionCaught); - try - { - fExceptionCaught = false; - // Correct tokens, but bad parse -----------V - tree = p.Parse("1==(2", null, ParserOptions.AllowAll); - } - catch (InvalidProjectFileException e) - { - Console.WriteLine(e.BaseMessage); - fExceptionCaught = true; - } - Assertion.Assert(fExceptionCaught); - } - - /// - /// This test verifies that we trigger warnings for expressions that - /// could be incorrectly evaluated - /// - /// VladF - [Test] - public void VerifyWarningForOrder() - { - // Create a project file that has an expression - MockLogger ml = ObjectModelHelpers.BuildProjectExpectSuccess(String.Format(@" - - - - - - ", new Uri(Assembly.GetExecutingAssembly().EscapedCodeBase).LocalPath)); - - // Make sure the log contains the correct strings. - Assertion.Assert("Need to warn for this expression - (a) == 1 and $(b) == 2 or $(c) == 3.", - ml.FullLog.Contains("MSB4130:")); - - ml = ObjectModelHelpers.BuildProjectExpectSuccess(String.Format(@" - - - - - - ", new Uri(Assembly.GetExecutingAssembly().EscapedCodeBase).LocalPath)); - - // Make sure the log contains the correct strings. - Assertion.Assert("Need to warn for this expression - (a) == 1 or $(b) == 2 and $(c) == 3.", - ml.FullLog.Contains("MSB4130:")); - - ml = ObjectModelHelpers.BuildProjectExpectSuccess(String.Format(@" - - - - - - ", new Uri(Assembly.GetExecutingAssembly().EscapedCodeBase).LocalPath)); - - // Make sure the log contains the correct strings. - Assertion.Assert("Need to warn for this expression - ($(a) == 1 or $(b) == 2 and $(c) == 3) or $(d) == 4.", - ml.FullLog.Contains("MSB4130:")); - } - - /// - /// This test verifies that we don't trigger warnings for expressions that - /// couldn't be incorrectly evaluated - /// - /// VladF - [Test] - public void VerifyNoWarningForOrder() - { - // Create a project file that has an expression - MockLogger ml = ObjectModelHelpers.BuildProjectExpectSuccess(String.Format(@" - - - - - - ", new Uri(Assembly.GetExecutingAssembly().EscapedCodeBase).LocalPath)); - - // Make sure the log contains the correct strings. - Assertion.Assert("No need to warn for this expression - (a) == 1 and $(b) == 2 and $(c) == 3.", - !ml.FullLog.Contains("MSB4130:")); - - ml = ObjectModelHelpers.BuildProjectExpectSuccess(String.Format(@" - - - - - - ", new Uri(Assembly.GetExecutingAssembly().EscapedCodeBase).LocalPath)); - - // Make sure the log contains the correct strings. - Assertion.Assert("No need to warn for this expression - (a) == 1 or $(b) == 2 or $(c) == 3.", - !ml.FullLog.Contains("MSB4130:")); - - ml = ObjectModelHelpers.BuildProjectExpectSuccess(String.Format(@" - - - - - - ", new Uri(Assembly.GetExecutingAssembly().EscapedCodeBase).LocalPath)); - - // Make sure the log contains the correct strings. - Assertion.Assert("No need to warn for this expression - ($(a) == 1 and $(b) == 2) or $(c) == 3.", - !ml.FullLog.Contains("MSB4130:")); - - ml = ObjectModelHelpers.BuildProjectExpectSuccess(String.Format(@" - - - - - - ", new Uri(Assembly.GetExecutingAssembly().EscapedCodeBase).LocalPath)); - - // Make sure the log contains the correct strings. - Assertion.Assert("No need to warn for this expression - ($(a) == 1 or $(b) == 2) and $(c) == 3.", - !ml.FullLog.Contains("MSB4130:")); - } - - } -} diff --git a/src/Deprecated/Engine.UnitTests/ProjectIdLogger.cs b/src/Deprecated/Engine.UnitTests/ProjectIdLogger.cs deleted file mode 100644 index ac4bd424323..00000000000 --- a/src/Deprecated/Engine.UnitTests/ProjectIdLogger.cs +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections.Generic; -using System.Text; - -using Microsoft.Build.Framework; -using Microsoft.Build.Utilities; - -namespace Microsoft.Build.UnitTests -{ - internal class ProjectIdLogger : Logger - { - private List projectStartedEvents = new List(); - private StringBuilder fullLog = new StringBuilder(); - - internal List ProjectStartedEvents - { - get { return projectStartedEvents; } - } - - public override void Initialize(IEventSource eventSource) - { - eventSource.ProjectStarted += new ProjectStartedEventHandler(ProjectStartedHandler); - eventSource.AnyEventRaised += new AnyEventHandler(AnyEventHandler); - eventSource.BuildFinished += new BuildFinishedEventHandler(BuildFinishedHandler); - } - - void BuildFinishedHandler(object sender, BuildFinishedEventArgs e) - { - // Console.Write in the context of a unit test is very expensive. A hundred - // calls to Console.Write can easily take two seconds on a fast machine. Therefore, only - // do the Console.Write once at the end of the build. - Console.Write(fullLog); - } - - void AnyEventHandler(object sender, BuildEventArgs e) - { - fullLog.Append(e.Message); - fullLog.Append("\r\n"); - } - - private void ProjectStartedHandler(object sender, ProjectStartedEventArgs e) - { - projectStartedEvents.Add(e); - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/ProjectManager_Tests.cs b/src/Deprecated/Engine.UnitTests/ProjectManager_Tests.cs deleted file mode 100644 index fd25282c8a6..00000000000 --- a/src/Deprecated/Engine.UnitTests/ProjectManager_Tests.cs +++ /dev/null @@ -1,299 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -#region Using directives - -using System; -using System.Collections.Generic; -using System.Text; - -using NUnit.Framework; -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine; -using System.Collections; - -#endregion - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class ProjectManager_Tests - { - /// - /// Add a project to the ProjectManager, and try to get it back out using the - /// correct set of search criteria. - /// - /// RGoel - [Test] - public void SimpleAddAndRetrieveProject() - { - // Initialize engine. - Engine engine = new Engine(@"c:\"); - - // Instantiate new project manager. - ProjectManager projectManager = new ProjectManager(); - - // Set up variables that represent the information we would be getting from - // the "MSBuild" task. - string fullPath = @"c:\rajeev\temp\myapp.proj"; - BuildPropertyGroup globalProperties = new BuildPropertyGroup(); - globalProperties.SetProperty("Configuration", "Debug"); - - // Create a new project that matches the information that we're pretending - // to receive from the MSBuild task. - Project project1 = new Project(engine); - project1.FullFileName = fullPath; - project1.GlobalProperties = globalProperties; - - // Add the new project to the ProjectManager. - projectManager.AddProject(project1); - - // Try and retrieve the project from the ProjectManager based on the fullpath + globalprops, - // and make sure we get back the same project we added. - Assertion.AssertEquals(project1, projectManager.GetProject(fullPath, globalProperties, null)); - } - - /// - /// Verify project manager does not insert duplicates into project table. - /// - [Test] - public void TestForDuplicatesInProjectTable() - { - ProjectManager projectManager = new ProjectManager(); - - string fullPath = @"c:\foo\bar.proj"; - BuildPropertyGroup globalProperties = new BuildPropertyGroup(); - globalProperties.SetProperty("p1", "v1"); - - Project p = new Project(new Engine()); - p.FullFileName = fullPath; - p.GlobalProperties = globalProperties; - p.ToolsVersion = "4.0"; - - // Add the new project to the ProjectManager, twice - Hashtable table = new Hashtable(StringComparer.OrdinalIgnoreCase); - ProjectManager.AddProject(table, p); - ProjectManager.AddProject(table, p); - - Assertion.AssertEquals(1, ((ArrayList)table[fullPath]).Count); // Didn't add a duplicate - - // Add a second, slightly different project, and ensure it DOES get added - Project p2 = new Project(new Engine()); - p2.FullFileName = fullPath; - p2.GlobalProperties = globalProperties; - p2.ToolsVersion = "2.0"; - - ProjectManager.AddProject(table, p2); - - Project p3 = new Project(new Engine()); - p3.FullFileName = fullPath; - p3.GlobalProperties = new BuildPropertyGroup(); - p3.ToolsVersion = "2.0"; - - ProjectManager.AddProject(table, p3); - - Assertion.AssertEquals(3, ((ArrayList)table[fullPath]).Count); - } - - /// - /// Verify project manager does not insert duplicates into project entry table. - /// - [Test] - public void TestForDuplicatesInProjectEntryTable() - { - ProjectManager projectManager = new ProjectManager(); - - string fullPath = @"c:\foo\bar.proj"; - BuildPropertyGroup globalProperties = new BuildPropertyGroup(); - globalProperties.SetProperty("p1", "v1"); - string toolsVersion = "3.5"; - - // Add the new project entry to the ProjectManager, twice - Hashtable table = new Hashtable(StringComparer.OrdinalIgnoreCase); - ProjectManager.AddProjectEntry(table, fullPath, globalProperties, toolsVersion, 0); - - ProjectManager.AddProjectEntry(table, fullPath, globalProperties, toolsVersion, 0); - - Assertion.AssertEquals(1, ((ArrayList)table[fullPath]).Count); // Didn't add a duplicate - - // Add a second, slightly different project entry, and ensure it DOES get added - ProjectManager.AddProjectEntry(table, fullPath, globalProperties, "2.0", 0); - ProjectManager.AddProjectEntry(table, fullPath, new BuildPropertyGroup(), "2.0", 0); - - Assertion.AssertEquals(3, ((ArrayList)table[fullPath]).Count); - } - - /// - /// Add a project to the ProjectManager, and try to get it back out using the - /// wrong set of search criteria (different set of global properties). - /// - /// RGoel - [Test] - public void SimpleAddAndRetrieveProjectWithDifferentGlobals() - { - // Initialize engine. - Engine engine = new Engine(@"c:\"); - - // Instantiate new project manager. - ProjectManager projectManager = new ProjectManager(); - - // Set up variables that represent the information we would be getting from - // the "MSBuild" task. - string fullPath = @"c:\rajeev\temp\myapp.proj"; - BuildPropertyGroup globalProperties = new BuildPropertyGroup(); - globalProperties.SetProperty("Configuration", "Release"); - - // Create a new project that matches the information that we're pretending - // to receive from the MSBuild task. - Project project1 = new Project(engine); - project1.FullFileName = fullPath; - project1.GlobalProperties = globalProperties; - - // Add the new project to the ProjectManager. - projectManager.AddProject(project1); - - // Now search for a project with the same full path but a different set of global - // properties. We expect to get back null, because no such project exists. - globalProperties.SetProperty("Configuration", "Debug"); - Assertion.AssertNull(projectManager.GetProject(fullPath, globalProperties, null)); - } - - /// - /// Add a project to the ProjectManager, and try to get it back out using the - /// wrong set of search criteria (different full path). - /// - /// RGoel - [Test] - public void SimpleAddAndRetrieveProjectWithDifferentFullPath() - { - // Initialize engine. - Engine engine = new Engine(@"c:\"); - - // Instantiate new project manager. - ProjectManager projectManager = new ProjectManager(); - - // Set up variables that represent the information we would be getting from - // the "MSBuild" task. - BuildPropertyGroup globalProperties = new BuildPropertyGroup(); - globalProperties.SetProperty("Configuration", "Release"); - - // Create a new project that matches the information that we're pretending - // to receive from the MSBuild task. - Project project1 = new Project(engine); - project1.FullFileName = @"c:\rajeev\temp\myapp.proj"; - project1.GlobalProperties = globalProperties; - - // Add the new project to the ProjectManager. - projectManager.AddProject(project1); - - // Now search for a project with a different full path but same set of global - // properties. We expect to get back null, because no such project exists. - Assertion.AssertNull(projectManager.GetProject(@"c:\blah\wrong.proj", globalProperties, null)); - } - - /// - /// Reset the build status for every project stored in the ProjectManager. - /// - /// RGoel - [Test] - public void ResetBuildStatusForAllProjects() - { - // Initialize engine. Need two separate engines because we don't allow two - // projects with the same full path to be loaded in the same Engine. - Engine engine1 = new Engine(@"c:\"); - Engine engine2 = new Engine(@"c:\"); - - // Instantiate new project manager. - ProjectManager projectManager = new ProjectManager(); - - // Set up a global property group. - BuildPropertyGroup globalProperties = new BuildPropertyGroup(); - globalProperties.SetProperty("Configuration", "Release"); - - // Create a few new projects. - Project project1 = new Project(engine1); - project1.FullFileName = @"c:\rajeev\temp\myapp.proj"; - project1.GlobalProperties = globalProperties; - - Project project2 = new Project(engine1); - project2.FullFileName = @"c:\blah\foo.proj"; - project2.GlobalProperties = globalProperties; - - Project project3 = new Project(engine2); - project3.FullFileName = @"c:\blah\foo.proj"; - globalProperties.SetProperty("Configuration", "Debug"); - project3.GlobalProperties = globalProperties; - - // Add the new projects to the ProjectManager. - projectManager.AddProject(project1); - projectManager.AddProject(project2); - projectManager.AddProject(project3); - - // Put all the projects in a non-reset state. - project1.IsReset = false; - project2.IsReset = false; - project3.IsReset = false; - - // Call ResetAllProjects. - projectManager.ResetBuildStatusForAllProjects(); - - // Make sure they all got reset. - Assertion.Assert(project1.IsReset); - Assertion.Assert(project2.IsReset); - Assertion.Assert(project3.IsReset); - } - - /// - /// Removes all projects of a given full path. - /// - /// RGoel - [Test] - public void RemoveProjectsByFullPath() - { - // Initialize engine. Need two separate engines because we don't allow two - // projects with the same full path to be loaded in the same Engine. - Engine engine1 = new Engine(@"c:\"); - Engine engine2 = new Engine(@"c:\"); - - // Instantiate new project manager. - ProjectManager projectManager = new ProjectManager(); - - // Set up a global property group. - BuildPropertyGroup globalProperties = new BuildPropertyGroup(); - globalProperties.SetProperty("Configuration", "Release"); - - // Create a few new projects. - Project project1 = new Project(engine1); - project1.FullFileName = @"c:\rajeev\temp\myapp.proj"; - project1.GlobalProperties = globalProperties; - - Project project2 = new Project(engine1); - project2.FullFileName = @"c:\blah\foo.proj"; - project2.GlobalProperties = globalProperties; - - Project project3 = new Project(engine2); - project3.FullFileName = @"c:\blah\foo.proj"; - globalProperties.SetProperty("Configuration", "Debug"); - project3.GlobalProperties = globalProperties; - - // Add the new projects to the ProjectManager. - projectManager.AddProject(project1); - projectManager.AddProject(project2); - projectManager.AddProject(project3); - - // Remove all projects with the full path "c:\blah\foo.proj" (case insenstively). - projectManager.RemoveProjects(@"c:\BLAH\FOO.Proj"); - - // Make sure project 1 is still there. - Assertion.AssertEquals(project1, projectManager.GetProject(project1.FullFileName, project1.GlobalProperties, null)); - - // Make sure projects 2 and 3 are gone. - Assertion.AssertNull(projectManager.GetProject(project2.FullFileName, project2.GlobalProperties, null)); - Assertion.AssertNull(projectManager.GetProject(project3.FullFileName, project3.GlobalProperties, null)); - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/Project_Tests.cs b/src/Deprecated/Engine.UnitTests/Project_Tests.cs deleted file mode 100644 index 0321d970bd5..00000000000 --- a/src/Deprecated/Engine.UnitTests/Project_Tests.cs +++ /dev/null @@ -1,6136 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.IO; -using System.Resources; -using System.Reflection; -using System.Collections; -using System.Xml; -using System.Text; -using System.Globalization; - -using NUnit.Framework; - -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine; -using Microsoft.Build.BuildEngine.Shared; -using Microsoft.Win32; -using System.Configuration; -using System.Diagnostics; - -namespace Microsoft.Build.UnitTests.Project_Tests -{ - [TestFixture] - public class AddItem - { - /// - /// This loads an existing project, and uses the MSBuild object model to - /// add a new item (Type="Compile" Include="c.cs") to the project. Then - /// it compares the final project XML to make sure the item was added in - /// the correct place. - /// - /// - /// - /// - /// - /// - /// RGoel - internal static BuildItem AddNewItemHelper - ( - string originalProjectContents, - string newExpectedProjectContents, - string newItemType, - string newItemInclude - ) - { - Project project = ObjectModelHelpers.CreateInMemoryProject(originalProjectContents); - - // The project shouldn't be marked dirty yet. - Assertion.Assert("Project shouldn't be dirty", !project.IsDirtyNeedToReevaluate); - - // Add a new item (Type="Compile", Include="c.cs") to the project using - // the object model. - BuildItem newItem = project.AddNewItem(newItemType, newItemInclude); - - // The project should be marked dirty now. - Assertion.Assert("Project should be dirty", project.IsDirtyNeedToReevaluate); - - ObjectModelHelpers.CompareProjectContents(project, newExpectedProjectContents); - - return newItem; - } - - /// - /// This loads an existing project that contains items within s. - /// It then uses the MSBuild object model to - /// add a new item to the project. Then it compares the final project - /// XML to make sure the item was added in the correct place. - /// - /// RGoel - [Test] - public void AddNewItemToExistingItemGroup() - { - // ************************************ - // BEFORE - // ************************************ - string projectOriginalContents = @" - - - - - - - - - - - - - - - "; - - - // ************************************ - // AFTER - // ************************************ - string projectNewExpectedContents = @" - - - - - - - - - - - - - - - - "; - - AddNewItemHelper(projectOriginalContents, projectNewExpectedContents, - "Compile", "a.cs"); - } - - /// - /// This tests that the project is correctly marked as dirty when we - /// add a new item to the project. - /// - /// RGoel - [Test] - public void AddNewItemToNewItemGroup() - { - // ************************************ - // BEFORE - // ************************************ - string projectOriginalContents = @" - - - - 4 - - - - - hint - - - - - - - - "; - - - // ************************************ - // AFTER - // ************************************ - string projectNewExpectedContents = @" - - - - 4 - - - - - hint - - - - - - - - - - - - "; - - AddNewItemHelper(projectOriginalContents, projectNewExpectedContents, - "Resource", "strings.resx"); - } - - /// - /// This loads an existing project that did not contain any items previously. - /// It then uses the MSBuild object model to - /// add a new item to the project. Then it compares the final project - /// XML to make sure the item was added in the correct place. - /// - /// RGoel - [Test] - public void AddNewItemWithNoPreviousItemGroup() - { - // ************************************ - // BEFORE - // ************************************ - string projectOriginalContents = @" - - - - bar - - - - - - "; - - - // ************************************ - // AFTER - // ************************************ - string projectNewExpectedContents = @" - - - - bar - - - - - - - - - - "; - - AddNewItemHelper(projectOriginalContents, projectNewExpectedContents, - "Compile", "c.cs"); - } - - /// - /// This adds a new item into the project, and then immediately queries - /// the item for an evaluated attribute, which of course doesn't exist yet. - /// We're testing to make sure we don't throw an exception in this case. - /// - /// RGoel - [Test] - public void AddNewItemAndQueryForNonExistentMetadata() - { - // ************************************ - // BEFORE - // ************************************ - string projectOriginalContents = @" - - - "; - - - // ************************************ - // AFTER - // ************************************ - string projectNewExpectedContents = @" - - - - - - - - "; - - BuildItem newItem = AddNewItemHelper(projectOriginalContents, - projectNewExpectedContents, "Compile", "foo.cs"); - - string hintPath = newItem.GetEvaluatedMetadata("HintPath"); - - Assertion.AssertEquals(String.Empty, hintPath); - } - - /// - /// Add a new item of the same name and include path of an item that already - /// exists in the project. Current behavior is that we add the duplicated item, - /// although there's no great reason for this. If we wanted, we could have - /// made it so that adding a dup results in a no-op to the project file. - /// - /// RGoel - [Test] - public void AddNewDuplicate() - { - // ************************************ - // BEFORE - // ************************************ - string projectOriginalContents = @" - - - - - - "; - - - // ************************************ - // AFTER - // ************************************ - string projectNewExpectedContents = @" - - - - - - - "; - - BuildItem newItem = AddNewItemHelper(projectOriginalContents, - projectNewExpectedContents, "MyWildCard", "foo.weirdo"); - } - - /// - /// If user tries to add a new item that has the same item name as an existing - /// wildcarded item, but the wildcard won't pick up the new file, then we - /// of course have to add the new item. - /// - /// RGoel - [Test] - public void AddNewItemThatDoesntMatchWildcard() - { - // ************************************ - // BEFORE - // ************************************ - string projectOriginalContents = @" - - - - - - "; - - - // ************************************ - // AFTER - // ************************************ - string projectNewExpectedContents = @" - - - - - - - "; - - BuildItem newItem = AddNewItemHelper(projectOriginalContents, - projectNewExpectedContents, "MyWildCard", "foo.txt"); - } - - /// - /// In order to match a new item with a wildcard already in the project, - /// they of course have to have the same name. If the item names differ, - /// then we just add the new item. - /// - /// RGoel - [Test] - public void AddNewItemThatMatchesWildcardWithDifferentItemName() - { - // ************************************ - // BEFORE - // ************************************ - string projectOriginalContents = @" - - - - - - "; - - - // ************************************ - // AFTER - // ************************************ - string projectNewExpectedContents = @" - - - - - - - - - "; - - BuildItem newItem = AddNewItemHelper(projectOriginalContents, - projectNewExpectedContents, "MyNewItemName", "foo.weirdo"); - } - - /// - /// When the wildcarded item already in the project file has a Condition - /// on it, we don't try to match with it when a user tries to add a new - /// item to the project. - /// - /// RGoel - [Test] - public void AddNewItemThatMatchesWildcardWithCondition() - { - // ************************************ - // BEFORE - // ************************************ - string projectOriginalContents = @" - - - - - - "; - - - // ************************************ - // AFTER - // ************************************ - string projectNewExpectedContents = @" - - - - - - - "; - - BuildItem newItem = AddNewItemHelper(projectOriginalContents, - projectNewExpectedContents, "MyWildCard", "foo.weirdo"); - } - - /// - /// When the wildcarded item already in the project file has a Exclude - /// on it, we don't try to match with it when a user tries to add a new - /// item to the project. - /// - /// RGoel - [Test] - public void AddNewItemThatMatchesWildcardWithExclude() - { - // ************************************ - // BEFORE - // ************************************ - string projectOriginalContents = @" - - - - - - "; - - - // ************************************ - // AFTER - // ************************************ - string projectNewExpectedContents = @" - - - - - - - "; - - BuildItem newItem = AddNewItemHelper(projectOriginalContents, - projectNewExpectedContents, "MyWildCard", "foo.weirdo"); - } - - /// - /// There's a wildcard in the project already, and the user tries to add an item - /// that matches that wildcard. In this case, we don't touch the project at all. - /// - /// RGoel - [Test] - public void AddNewItemThatMatchesWildcard() - { - // ************************************ - // BEFORE - // ************************************ - string projectOriginalContents = @" - - - - - - "; - - - // ************************************ - // AFTER - // ************************************ - string projectNewExpectedContents = @" - - - - - - "; - - BuildItem newItem = AddNewItemHelper(projectOriginalContents, - projectNewExpectedContents, "MyWildCard", "foo.weirdo"); - - Assertion.AssertEquals("Newly added item should have correct ItemName", "MyWildCard", newItem.Name); - Assertion.AssertEquals("Newly added item should have correct Include", "*.weirdo", newItem.Include); - Assertion.AssertEquals("Newly added item should have correct FinalItemSpec", "foo.weirdo", newItem.FinalItemSpecEscaped); - } - - /// - /// There's a complicated recursive wildcard in the project already, and the user tries to add an item - /// that matches that wildcard. In this case, we don't touch the project at all. - /// - /// RGoel - [Test] - public void AddNewItemThatMatchesComplicatedWildcard() - { - // ************************************ - // BEFORE - // ************************************ - string projectOriginalContents = @" - - - - - - "; - - - // ************************************ - // AFTER - // ************************************ - string projectNewExpectedContents = @" - - - - - - "; - - BuildItem newItem = AddNewItemHelper(projectOriginalContents, - projectNewExpectedContents, "MyWildCard", @"c:\subdir1\xmake\engine\subdir2\items\foo.weirdo"); - - Assertion.AssertEquals("Newly added item should have correct ItemName", "MyWildCard", newItem.Name); - Assertion.AssertEquals("Newly added item should have correct Include", @"c:\subdir1\**\subdir2\**\*.we?rdo", newItem.Include); - Assertion.AssertEquals("Newly added item should have correct FinalItemSpec", @"c:\subdir1\xmake\engine\subdir2\items\foo.weirdo", newItem.FinalItemSpecEscaped); - } - - /// - /// There's a complicated recursive wildcard in the project already, and the user tries to add an item - /// that matches that wildcard. In this case, we don't touch the project at all. - /// - /// RGoel - [Test] - public void AddNewItemThatDoesntMatchComplicatedWildcard() - { - // ************************************ - // BEFORE - // ************************************ - string projectOriginalContents = @" - - - - - - "; - - - // ************************************ - // AFTER - // ************************************ - string projectNewExpectedContents = @" - - - - - - - "; - - BuildItem newItem = AddNewItemHelper(projectOriginalContents, - projectNewExpectedContents, "MyWildCard", @"c:\subdir1\xmake\engine\items\foo.weirdo"); - - Assertion.AssertEquals("Newly added item should have correct ItemName", "MyWildCard", newItem.Name); - Assertion.AssertEquals("Newly added item should have correct Include", @"c:\subdir1\xmake\engine\items\foo.weirdo", newItem.Include); - Assertion.AssertEquals("Newly added item should have correct FinalItemSpec", @"c:\subdir1\xmake\engine\items\foo.weirdo", newItem.FinalItemSpecEscaped); - } - - /// - /// There's a wildcard in the project already, and the user tries to add an item - /// that matches that wildcard. In this case, we don't touch the project at all. - /// Then take the item that you got back from Project.AddNewItem and try and modify - /// its metadata. - /// - /// RGoel - [Test] - public void AddNewItemThatMatchesWildcardAndThenModifyIt() - { - // ************************************ - // BEFORE - // ************************************ - string projectOriginalContents = @" - - - - fr - - - - "; - - - // ************************************ - // AFTER - // ************************************ - string projectNewExpectedContents = @" - - - - fr - - - - "; - - BuildItem newItem = AddNewItemHelper(projectOriginalContents, - projectNewExpectedContents, "MyWildCard", "foo.weirdo"); - - Assertion.AssertEquals("Newly added item should have correct ItemName", "MyWildCard", newItem.Name); - Assertion.AssertEquals("Newly added item should have correct Include", "a.cs; *.weirdo; c.cs", newItem.Include); - Assertion.AssertEquals("Newly added item should have correct FinalItemSpec", "foo.weirdo", newItem.FinalItemSpecEscaped); - - newItem.SetMetadata("Culture", "en"); - - // ************************************ - // AFTER MODIFICATION - // ************************************ - string projectFinalExpectedContents = @" - - - - fr - - - fr - - - en - - - - "; - - ObjectModelHelpers.CompareProjectContents(newItem.ParentPersistedItem.ParentPersistedItemGroup.ParentProject, - projectFinalExpectedContents); - } - - /// - /// There's a wildcard in the project already, and the user tries to add an item - /// that matches that wildcard. In this case, we don't touch the project at all, - /// even though the existing item had metadata on it. - /// - /// RGoel - [Test] - public void AddNewItemThatMatchesWildcardWithMetadata() - { - // ************************************ - // BEFORE - // ************************************ - string projectOriginalContents = @" - - - - fr - - - - - $(MyCulture) - - - - - "; - - - // ************************************ - // AFTER - // ************************************ - string projectNewExpectedContents = @" - - - - fr - - - - - $(MyCulture) - - - - - "; - - BuildItem newItem = AddNewItemHelper(projectOriginalContents, - projectNewExpectedContents, "MyWildCard", "foo.weirdo"); - - Assertion.AssertEquals("Newly added item should have correct ItemName", "MyWildCard", newItem.Name); - Assertion.AssertEquals("Newly added item should have correct Include", "*.weirdo", newItem.Include); - Assertion.AssertEquals("Newly added item should have correct FinalItemSpec", "foo.weirdo", newItem.FinalItemSpecEscaped); - Assertion.AssertEquals("Newly added item should have correct metadata Culture", "$(MyCulture)", newItem.GetMetadata("Culture")); - Assertion.AssertEquals("Newly added item should have correct evaluated metadata Culture", "fr", newItem.GetEvaluatedMetadata("Culture")); - } - - /// - /// There's a wildcard in the project already, but it's part of a semicolon-separated - /// list of items. Now the user tries to add an item that matches that wildcard. - /// In this case, we don't touch the project at all. - /// - /// RGoel - [Test] - public void AddNewItemThatMatchesWildcardInSemicolonList() - { - // ************************************ - // BEFORE - // ************************************ - string projectOriginalContents = @" - - - - - - "; - - - // ************************************ - // AFTER - // ************************************ - string projectNewExpectedContents = @" - - - - - - "; - - BuildItem newItem = AddNewItemHelper(projectOriginalContents, - projectNewExpectedContents, "MyWildCard", "foo.weirdo"); - - Assertion.AssertEquals("Newly added item should have correct ItemName", "MyWildCard", newItem.Name); - Assertion.AssertEquals("Newly added item should have correct Include", "a.cs; *.weirdo; c.cs", newItem.Include); - Assertion.AssertEquals("Newly added item should have correct FinalItemSpec", "foo.weirdo", newItem.FinalItemSpecEscaped); - } - - /// - /// There's a wildcard in the project already, but it's part of a semicolon-separated - /// list of items, and it uses a property reference. Now the user tries to add a new - /// item that matches that wildcard. In this case, we don't touch the project at all. - /// We're so smart. - /// - /// RGoel - [Test] - public void AddNewItemThatMatchesWildcardWithPropertyReference() - { - // ************************************ - // BEFORE - // ************************************ - string projectOriginalContents = @" - - - - weirdo - - - - - - - - "; - - - // ************************************ - // AFTER - // ************************************ - string projectNewExpectedContents = @" - - - - weirdo - - - - - - - - "; - - BuildItem newItem = AddNewItemHelper(projectOriginalContents, - projectNewExpectedContents, "MyWildCard", "foo.weirdo"); - - Assertion.AssertEquals("Newly added item should have correct ItemName", "MyWildCard", newItem.Name); - Assertion.AssertEquals("Newly added item should have correct Include", "a.cs; *.$(MySpecialFileExtension); c.cs", newItem.Include); - Assertion.AssertEquals("Newly added item should have correct FinalItemSpec", "foo.weirdo", newItem.FinalItemSpecEscaped); - } - - /// - /// This tests that the project is correctly marked as dirty when we - /// add a new ItemGroup to the project. - /// - /// RGoel - [Test] - public void AddNewItemGroup() - { - // ************************************ - // BEFORE - // ************************************ - string projectOriginalContents = @" - - - - 4 - - - - - hint - - - - - - - - "; - - - // ************************************ - // AFTER - // ************************************ - string projectNewExpectedContents = @" - - - - 4 - - - - - hint - - - - - - - - - - "; - - Project project = ObjectModelHelpers.CreateInMemoryProject(projectOriginalContents); - - Assertion.Assert("Project shouldn't be dirty", !project.IsDirtyNeedToReevaluate); - - project.AddNewItemGroup(); - - Assertion.Assert("Project should be dirty", project.IsDirtyNeedToReevaluate); - - ObjectModelHelpers.CompareProjectContents(project, projectNewExpectedContents); - } - } - - [TestFixture] - public class RemoveItem - { - /// - /// This loads an existing project, and uses the MSBuild object model to - /// remove an item of a particular item spec (e.g., "b.cs"). It then - /// compares the final project XML to make sure the item was added in - /// the correct place. - /// - /// - /// - /// - /// RGoel - private void RemoveItemHelper - ( - string originalProjectContents, - string newExpectedProjectContents, - string itemSpecToRemove - ) - { - Project project = ObjectModelHelpers.CreateInMemoryProject(originalProjectContents); - - // The project shouldn't be marked dirty yet. - Assertion.Assert("Project shouldn't be dirty", !project.IsDirtyNeedToReevaluate); - - // Get the set of evaluated items. - BuildItemGroup evaluatedItems = project.EvaluatedItemsIgnoringCondition; - - // The VS IDE does a few re-evaluations with different sets of global properties - // (i.e., Configuration=Debug, Configuration=Release, etc.). This is to simulate - // that. If there's a bug in the Project object, then re-evaluation can - // potentially mess up the number of items hanging around. - project.MarkProjectAsDirty (); - BuildItemGroup evaluatedItems2 = project.EvaluatedItemsIgnoringCondition; - - // The project should be marked dirty now. - Assertion.Assert("Project should be dirty", project.IsDirtyNeedToReevaluate); - - // Search all the evaluated items for the one with the item spec we want - // to remove. - foreach (BuildItem evaluatedItem in evaluatedItems) - { - if (evaluatedItem.FinalItemSpecEscaped == itemSpecToRemove) - { - project.RemoveItem (evaluatedItem); - } - } - - // The project should still be marked dirty now. - Assertion.Assert("Project should be dirty", project.IsDirtyNeedToReevaluate); - - ObjectModelHelpers.CompareProjectContents(project, newExpectedProjectContents); - } - - /// - /// This loads an existing project that contained a few items, and tries - /// to remove one of them through the MSBuild object model. - /// - /// RGoel - [Test] - public void RemoveItemBySpec() - { - // ************************************ - // BEFORE - // ************************************ - string projectOriginalContents = @" - - - - - - - - - - - - - - - - "; - - - // ************************************ - // AFTER - // ************************************ - string projectNewExpectedContents = @" - - - - - - - - - - - - - - - "; - - this.RemoveItemHelper (projectOriginalContents, projectNewExpectedContents, "b.cs"); - } - - /// - /// This loads an existing project that contained an item tag that - /// declares several items with a single tag. Then it tries - /// to remove one of those items through the MSBuild object model. - /// - /// RGoel - [Test] - public void RemoveItemBySpecFromMultiItemSpec() - { - // ************************************ - // BEFORE - // ************************************ - string projectOriginalContents = @" - - - - a - - - - - - - - - - - - - - - "; - - - // ************************************ - // AFTER - // ************************************ - string projectNewExpectedContents = @" - - - - a - - - - - - - - - - - - - - - - "; - - this.RemoveItemHelper (projectOriginalContents, projectNewExpectedContents, "b.cs"); - } - - /// - /// This loads an existing project that contained an item tag that - /// declares several items with a single tag. Then it tries - /// to remove one of those items through the MSBuild object model. - /// The trick here is to test that we correctly preserve the metadata - /// on the items when we do this. - /// - /// RGoel - [Test] - public void RemoveItemBySpecFromMultiItemSpecWithMetadata() - { - // ************************************ - // BEFORE - // ************************************ - string projectOriginalContents = @" - - - - - $(mypath) - - - - - - - "; - - - // ************************************ - // AFTER - // ************************************ - string projectNewExpectedContents = @" - - - - - $(mypath) - - - $(mypath) - - - - - - - "; - - this.RemoveItemHelper (projectOriginalContents, projectNewExpectedContents, "b.cs"); - } - - /// - /// Another simple test of removing a single item. - /// - /// RGoel - [Test] - public void RemoveItemBySpecWhenMultiItemSpecExists() - { - // ************************************ - // BEFORE - // ************************************ - string projectOriginalContents = @" - - - - - $(mypath) - - - - - - - - "; - - - // ************************************ - // AFTER - // ************************************ - string projectNewExpectedContents = @" - - - - - $(mypath) - - - - - - - "; - - this.RemoveItemHelper (projectOriginalContents, projectNewExpectedContents, "d.cs"); - } - - /// - /// This tests that the project is correctly marked as dirty when we - /// remove an item. - /// - /// RGoel - [Test] - public void RemoveSpecificItem() - { - // ************************************ - // BEFORE - // ************************************ - string projectOriginalContents = @" - - - - 4 - - - - - hint - - - - - - - - - "; - - - // ************************************ - // AFTER - // ************************************ - string projectNewExpectedContents = @" - - - - 4 - - - - - - - - - - - "; - - Project project = ObjectModelHelpers.CreateInMemoryProject(projectOriginalContents); - - Assertion.Assert("Project shouldn't be dirty", !project.IsDirtyNeedToReevaluate); - - BuildItemGroup evaluatedItems = project.EvaluatedItemsIgnoringCondition; - BuildItem itemToRemove = null; - foreach (BuildItem item in evaluatedItems) - { - if (item.Include == "a.cs") - { - itemToRemove = item; - } - } - Assertion.Assert(itemToRemove != null); - project.RemoveItem(itemToRemove); - - Assertion.Assert("Project should be dirty", project.IsDirtyNeedToReevaluate); - - ObjectModelHelpers.CompareProjectContents(project, projectNewExpectedContents); - } - - /// - /// This tests that the project is correctly marked as dirty when we - /// remove a whole class of items from the project. - /// - /// RGoel - [Test] - public void RemoveItemsByName() - { - // ************************************ - // BEFORE - // ************************************ - string projectOriginalContents = @" - - - - 4 - - - - - hint - - - - - - - - - "; - - - // ************************************ - // AFTER - // ************************************ - string projectNewExpectedContents = @" - - - - 4 - - - - - - - - - - "; - - Project project = ObjectModelHelpers.CreateInMemoryProject(projectOriginalContents); - - Assertion.Assert("Project shouldn't be dirty", !project.IsDirtyNeedToReevaluate); - - project.RemoveItemsByName("Compile"); - - Assertion.Assert("Project should be dirty", project.IsDirtyNeedToReevaluate); - - ObjectModelHelpers.CompareProjectContents(project, projectNewExpectedContents); - } - - /// - /// This tests that the project is correctly marked as dirty when we - /// remove an ItemGroup from the project. - /// - /// RGoel - [Test] - public void RemoveItemGroup() - { - // ************************************ - // BEFORE - // ************************************ - string projectOriginalContents = @" - - - - 4 - - - - - hint - - - - - - - - "; - - - // ************************************ - // AFTER - // ************************************ - string projectNewExpectedContents = @" - - - - 4 - - - - - - "; - - Project project = ObjectModelHelpers.CreateInMemoryProject(projectOriginalContents); - - Assertion.Assert("Project shouldn't be dirty", !project.IsDirtyNeedToReevaluate); - - project.RemoveItemGroup(project.ItemGroups.LastLocalItemGroup); - - Assertion.Assert("Project should be dirty", project.IsDirtyNeedToReevaluate); - - ObjectModelHelpers.CompareProjectContents(project, projectNewExpectedContents); - } - - /// - /// Test the RemoveAllItemGroups method. - /// - /// RGoel - [Test] - public void RemoveAllItemGroups() - { - // ************************************ - // BEFORE - // ************************************ - string original = @" - - - - - - - - - - - - "; - - - // ************************************ - // AFTER - // ************************************ - string expected = @" - - - "; - - Project project = ObjectModelHelpers.CreateInMemoryProject(original); - Assertion.AssertEquals(2, project.ItemGroups.Count); - - project.RemoveAllItemGroups(); - - Assertion.AssertEquals(0, project.ItemGroups.Count); - ObjectModelHelpers.CompareProjectContents(project, expected); - } - - /// - /// Test the Unload method - /// - [Test] - public void TestUnload() - { - string original = @" - - - - - - "; - - Project project = ObjectModelHelpers.CreateInMemoryProject(original); - bool exceptionThrown = false; - - // Unload to cover the method - project.ParentEngine.UnloadProject(project); - try - { - Engine engine = project.ParentEngine; - } - catch (InvalidOperationException e) - { - exceptionThrown = true; - Assertion.AssertEquals(AssemblyResources.GetString("ProjectInvalidUnloaded"), e.Message); - } - - Assertion.AssertEquals(true, exceptionThrown); - } - - /// - /// Test the RemoveAllItemGroups method. - /// - /// RGoel - [Test] - public void RemoveAllItemGroupsWithChoose() - { - // ************************************ - // BEFORE - // ************************************ - string original = @" - - - - - - - - - - - - - - - - - - - - - "; - - - // ************************************ - // AFTER - // ************************************ - string expected = @" - - - - - - - - - - - "; - - Project project = ObjectModelHelpers.CreateInMemoryProject(original); - Assertion.AssertEquals(3, project.ItemGroups.Count); - - project.RemoveAllItemGroups(); - - Assertion.AssertEquals(0, project.ItemGroups.Count); - ObjectModelHelpers.CompareProjectContents(project, expected); - } - - /// - /// Test the RemoveAllItemGroupsByCondition method. - /// - /// RGoel - [Test] - public void RemoveAllItemGroupsByCondition() - { - // ************************************ - // BEFORE - // ************************************ - string original = @" - - - - - - - - - - - - "; - - - // ************************************ - // AFTER - // ************************************ - string expected = @" - - - - - - - - "; - - Project project = ObjectModelHelpers.CreateInMemoryProject(original); - Assertion.AssertEquals(2, project.ItemGroups.Count); - - project.RemoveItemGroupsWithMatchingCondition("'$(x)'=='y'"); - - Assertion.AssertEquals(1, project.ItemGroups.Count); - ObjectModelHelpers.CompareProjectContents(project, expected); - } - - - /// - /// Test the RemoveAllItemGroupsByCondition method. - /// - /// RGoel - [Test] - public void RemoveAllItemGroupsByConditionWithChoose() - { - // ************************************ - // BEFORE - // ************************************ - string original = @" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "; - - - // ************************************ - // AFTER - // ************************************ - string expected = @" - - - - - - - - - - - - - - - - - - - - - "; - - Project project = ObjectModelHelpers.CreateInMemoryProject(original); - Assertion.AssertEquals(6, project.ItemGroups.Count); - - project.RemoveItemGroupsWithMatchingCondition("'$(x)'=='y'"); - - Assertion.AssertEquals(3, project.ItemGroups.Count); - ObjectModelHelpers.CompareProjectContents(project, expected); - } - - /// - /// Test the RemoveAllItemGroupsByCondition method. - /// - /// RGoel - [Test] - public void RemoveItemsByNameWithChoose() - { - // ************************************ - // BEFORE - // ************************************ - string original = @" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "; - - - // ************************************ - // AFTER - // ************************************ - string expected = @" - - - - - - - - - - - - - - - - - - - - - "; - - Project project = ObjectModelHelpers.CreateInMemoryProject(original); - Assertion.AssertEquals(6, project.ItemGroups.Count); - - project.RemoveItemsByName("IncludePath"); - - Assertion.AssertEquals(3, project.ItemGroups.Count); - ObjectModelHelpers.CompareProjectContents(project, expected); - } - } - - [TestFixture] - public class ModifyItem - { - /// - /// This loads an existing project, and uses the MSBuild object model to - /// modify the "Include" attribute of an item of a particular item spec (e.g., - /// "b.cs"). It then compares the final project XML to make sure the item was - /// modified correctly. - /// - /// - /// - /// - /// - /// RGoel - internal static void ModifyItemIncludeHelper - ( - string originalProjectContents, - string newExpectedProjectContents, - string oldItemSpec, - string newIncludePath - ) - { - Project project = ObjectModelHelpers.CreateInMemoryProject(originalProjectContents); - - // The project shouldn't be marked dirty yet. - Assertion.Assert("Project shouldn't be dirty", !project.IsDirtyNeedToReevaluate); - - // Get the set of evaluated items. - BuildItemGroup evaluatedItems = project.EvaluatedItemsIgnoringCondition; - - // The VS IDE does a few re-evaluations with different sets of global properties - // (i.e., Configuration=Debug, Configuration=Release, etc.). This is to simulate - // that. If there's a bug in the Project object, then re-evaluation can - // potentially mess up the number of items hanging around. - project.MarkProjectAsDirty (); - BuildItemGroup evaluatedItems2 = project.EvaluatedItemsIgnoringCondition; - - // The project should be marked dirty now. - Assertion.Assert("Project should be dirty", project.IsDirtyNeedToReevaluate); - - // Search all the evaluated items for the one with the item spec we want - // to remove. - foreach (BuildItem evaluatedItem in evaluatedItems) - { - if (evaluatedItem.FinalItemSpecEscaped == oldItemSpec) - { - evaluatedItem.Include = newIncludePath; - } - } - - // The project should still be marked dirty now. - Assertion.Assert("Project should be dirty", project.IsDirtyNeedToReevaluate); - - ObjectModelHelpers.CompareProjectContents(project, newExpectedProjectContents); - } - - /// - /// Tests the ability to change an item's "Include" path through the object - /// model. - /// - /// RGoel - [Test] - public void ModifyItemIncludeWithEmbeddedProperty() - { - // ************************************ - // BEFORE - // ************************************ - string projectOriginalContents = @" - - - - b - - - - - $(mypath1) - - - $(mypath2) - - - $(mypath3) - - - - - - - "; - - - // ************************************ - // AFTER - // ************************************ - string projectNewExpectedContents = @" - - - - b - - - - - $(mypath1) - - - $(mypath2) - - - $(mypath3) - - - - - - - "; - - ModifyItemIncludeHelper (projectOriginalContents, projectNewExpectedContents, - "b.cs", "d.cs"); - } - - /// - /// Tests the ability to change an item's "Include" path that was originally - /// declared using a multi-item item tag. - /// - /// RGoel - [Test] - public void ModifyItemIncludeWithinMultiItemSpec() - { - // ************************************ - // BEFORE - // ************************************ - string projectOriginalContents = @" - - - - - $(mypath1) - - - $(mypath3) - - - - - - - "; - - - // ************************************ - // AFTER - // ************************************ - string projectNewExpectedContents = @" - - - - - $(mypath1) - - - $(mypath1) - - - $(mypath1) - - - $(mypath3) - - - - - - - "; - - ModifyItemIncludeHelper (projectOriginalContents, projectNewExpectedContents, - "b.cs", "foo.cs"); - } - - /// - /// Deletes all *.weirdo files from the temp path, and dumps 3 files there -- - /// a.weirdo, b.weirdo, c.weirdo. This is so that we can exercise our wildcard - /// matching a little bit without having to plumb mock objects all the way through - /// the engine. - /// - /// RGoel - internal static void CreateThreeWeirdoFilesHelper() - { - CleanupWeirdoFilesHelper(); - - string tempPath = Path.GetTempPath(); - - // Create 3 files in the temp path -- a.weirdo, b.weirdo, and c.weirdo. - File.WriteAllText(Path.Combine(tempPath, "a.weirdo"), String.Empty); - File.WriteAllText(Path.Combine(tempPath, "b.weirdo"), String.Empty); - File.WriteAllText(Path.Combine(tempPath, "c.weirdo"), String.Empty); - } - - /// - /// Delete all *.weirdo files from the temp directory. - /// - /// RGoel - internal static void CleanupWeirdoFilesHelper() - { - // Delete all *.weirdo files from the temp path. - string[] filesEndingWithWeirdo = Directory.GetFiles(Path.GetTempPath(), "*.weirdo"); - foreach (string fileEndingWithWeirdo in filesEndingWithWeirdo) - { - File.Delete(fileEndingWithWeirdo); - } - } - - /// - /// Tests the ability to change an item's "Include" path that was originally - /// part of a wildcard. The new item spec does not match the original wildcard, - /// so the wildcard has to be exploded. - /// - /// RGoel - [Test] - public void ModifyItemIncludeWithinNonMatchingWildcard() - { - // Populate the project directory with three physical files on disk -- a.weirdo, b.weirdo, c.weirdo. - CreateThreeWeirdoFilesHelper(); - - // ************************************ - // BEFORE - // ************************************ - string projectOriginalContents = @" - - - - - - - - "; - - - // ************************************ - // AFTER - // ************************************ - string projectNewExpectedContents = @" - - - - - - - - - - "; - - // Change b.weirdo to banana.cs. - ModifyItemIncludeHelper(projectOriginalContents, projectNewExpectedContents, - "b.weirdo", "banana.cs"); - - CleanupWeirdoFilesHelper(); - } - - /// - /// Tests the ability to change an item's "Include" path that was originally - /// part of a wildcard. The new item spec matches the original wildcard, - /// so the project file doesn't have to be touched at all. - /// - /// RGoel - [Test] - public void ModifyItemIncludeWithinMatchingWildcard() - { - // Populate the project directory with three physical files on disk -- a.weirdo, b.weirdo, c.weirdo. - CreateThreeWeirdoFilesHelper(); - - // ************************************ - // BEFORE - // ************************************ - string projectOriginalContents = @" - - - - - - - - "; - - - // ************************************ - // AFTER - // ************************************ - string projectNewExpectedContents = @" - - - - - - - - "; - - // Change b.weirdo to banana.weirdo. - ModifyItemIncludeHelper(projectOriginalContents, projectNewExpectedContents, - "b.weirdo", "banana.weirdo"); - - CleanupWeirdoFilesHelper(); - } - - /// - /// Tests the ability to change an item's "Include" path that was originally - /// part of a wildcard. In this test, we grab a reference to the *raw* item - /// instead of the evaluated item. When changing the Include of the raw item, - /// we never try to be smart with respect to wildcards. We just literally replace - /// the "Include" attribute with the new string given to us by the user. - /// - /// RGoel - [Test] - public void ModifyRawItemIncludeWithinMatchingWildcard() - { - // Populate the project directory with three physical files on disk -- a.weirdo, b.weirdo, c.weirdo. - CreateThreeWeirdoFilesHelper(); - - // ************************************ - // BEFORE - // ************************************ - string projectOriginalContents = @" - - - - - - - - "; - - - // ************************************ - // AFTER - // ************************************ - string projectNewExpectedContents = @" - - - - - - - - "; - - Project project = ObjectModelHelpers.CreateInMemoryProject(projectOriginalContents); - - // Get a reference to the one and only raw item in the original project file. - BuildItem rawItemForStarDotWeirdo = null; - foreach (BuildItemGroup rawItemGroup in project.ItemGroups) - { - foreach (BuildItem rawItem in rawItemGroup) - { - rawItemForStarDotWeirdo = rawItem; - } - } - - Assertion.AssertNotNull("Original raw item not found?", rawItemForStarDotWeirdo); - Assertion.AssertEquals("Original raw item should have Include *.weirdo", "*.weirdo", rawItemForStarDotWeirdo.Include); - - // Change the Include attribute to "banana.weirdo". - rawItemForStarDotWeirdo.Include = "banana.weirdo"; - - // The project should still be marked dirty now. - Assertion.Assert("Project should be dirty", project.IsDirtyNeedToReevaluate); - - ObjectModelHelpers.CompareProjectContents(project, projectNewExpectedContents); - - CleanupWeirdoFilesHelper(); - } - - /// - /// This helper method checks the project to determine whether a particular item of a particular - /// name exists in the project, such that the build process (the tasks) would see it. - /// - /// - /// - /// - /// - /// RGoel - private bool ItemExistsInBuildProcessHelper - ( - Project project, - string itemType, - string itemSpec - ) - { - BuildItemGroup evaluatedItemsOfParticularType = project.GetEvaluatedItemsByName(itemType); - - Assertion.AssertNotNull(evaluatedItemsOfParticularType); - - // Search all the evaluated items for the one with the item spec we want - // to remove. - foreach (BuildItem evaluatedItem in evaluatedItemsOfParticularType) - { - if (evaluatedItem.FinalItemSpecEscaped == itemSpec) - { - return true; - } - } - - return false; - } - - /// - /// This loads an existing project, and uses the MSBuild object model to - /// modify the Name of an item of a particular item spec (e.g., - /// "b.cs"). It then compares the final project XML to make sure the item was - /// modified correctly. - /// - /// - /// - /// - /// - /// RGoel - private void ModifyItemNameHelper - ( - string originalProjectContents, - string newExpectedProjectContents, - string itemSpecToModify, - string newItemType - ) - { - Project project = ObjectModelHelpers.CreateInMemoryProject(originalProjectContents); - - // The project shouldn't be marked dirty yet. - Assertion.Assert("Project shouldn't be dirty", !project.IsDirtyNeedToReevaluate); - - // Get the set of evaluated items. - BuildItemGroup evaluatedItems = project.EvaluatedItemsIgnoringCondition; - - // The VS IDE does a few re-evaluations with different sets of global properties - // (i.e., Configuration=Debug, Configuration=Release, etc.). This is to simulate - // that. If there's a bug in the Project object, then re-evaluation can - // potentially mess up the number of items hanging around. - project.MarkProjectAsDirty(); - BuildItemGroup evaluatedItems2 = project.EvaluatedItemsIgnoringCondition; - - // The project should be marked dirty now. - Assertion.Assert("Project should be dirty", project.IsDirtyNeedToReevaluate); - - // If we were to do a build right now, we certainly hope the tasks would not - // see the new item type. - Assertion.Assert("New item already exists?", !ItemExistsInBuildProcessHelper(project, newItemType, itemSpecToModify)); - - // The above assertion caused a re-evaluation, so we're no longer dirty. - Assertion.Assert("Project should not be dirty", !project.IsDirtyNeedToReevaluate); - - // Search all the evaluated items for the one with the item spec we want - // to remove. - foreach (BuildItem evaluatedItem in evaluatedItems) - { - if (evaluatedItem.FinalItemSpecEscaped == itemSpecToModify) - { - evaluatedItem.Name = newItemType; - } - } - - // The project should be dirty again, because we modified an item. - Assertion.Assert("Project should be dirty", project.IsDirtyNeedToReevaluate); - - // If we were to do a build right now, we hope the tasks would see the new item type. - Assertion.Assert("New item type did not get set properly.", ItemExistsInBuildProcessHelper(project, newItemType, itemSpecToModify)); - - ObjectModelHelpers.CompareProjectContents(project, newExpectedProjectContents); - } - - /// - /// Tests the ability to change an item's Name through the object model. - /// - /// RGoel - [Test] - public void ModifyItemNameWithEmbeddedProperty() - { - // ************************************ - // BEFORE - // ************************************ - string projectOriginalContents = @" - - - - b - - - - - $(mypath1) - - - $(mypath2) - - - $(mypath3) - - - - - - - "; - - - // ************************************ - // AFTER - // ************************************ - string projectNewExpectedContents = @" - - - - b - - - - - $(mypath1) - - - $(mypath2) - - - $(mypath3) - - - - - - - "; - - this.ModifyItemNameHelper(projectOriginalContents, projectNewExpectedContents, - "b.cs", "Resource"); - } - - /// - /// Tests the ability to change an item's "Type" that was originally - /// declared using a multi-item item tag. - /// - /// RGoel - [Test] - public void ModifyItemNameWithinMultiItemSpec() - { - // ************************************ - // BEFORE - // ************************************ - string projectOriginalContents = @" - - - - - $(mypath1) - - - $(mypath3) - - - - - - - "; - - - // ************************************ - // AFTER - // ************************************ - string projectNewExpectedContents = @" - - - - - $(mypath1) - - - $(mypath1) - - - $(mypath1) - - - $(mypath3) - - - - - - - "; - - this.ModifyItemNameHelper(projectOriginalContents, projectNewExpectedContents, - "b.cs", "Resource"); - } - - /// - /// This tests that the project is correctly marked as dirty when we - /// modify an item metadata. - /// - /// RGoel - [Test] - public void ModifyItemMetadata() - { - // ************************************ - // BEFORE - // ************************************ - string projectOriginalContents = @" - - - - 4 - - - - - hint - - - - - - - - "; - - - // ************************************ - // AFTER - // ************************************ - string projectNewExpectedContents = @" - - - - 4 - - - - - flint - - - hint - - - - - - - - "; - - Project project = ObjectModelHelpers.CreateInMemoryProject(projectOriginalContents); - - Assertion.Assert("Project shouldn't be dirty", !project.IsDirtyNeedToReevaluate); - - BuildItemGroup evaluatedItems = project.EvaluatedItemsIgnoringCondition; - foreach (BuildItem item in evaluatedItems) - { - if (item.FinalItemSpecEscaped == "a.cs") - { - item.SetMetadata("HintPath", "flint"); - } - } - - Assertion.Assert("Project should be dirty", project.IsDirtyNeedToReevaluate); - - ObjectModelHelpers.CompareProjectContents(project, projectNewExpectedContents); - } - } - - [TestFixture] - public class AddProperty - { - /// - /// Tests that the object model correctly adds a new property to the correct - /// existing PropertyGroup. - /// - /// RGoel - [Test] - public void SetPropertyOnNewPropertyInExistingPropertyGroup() - { - // ************************************ - // BEFORE - // ************************************ - string projectOriginalContents = @" - - - - c:\blah - - - - 1 - - - - true - - - - - - "; - - - // ************************************ - // AFTER - // ************************************ - string projectNewExpectedContents = @" - - - - c:\blah - - - - 1 - woohoo - - - - true - - - - - - "; - - Project project = ObjectModelHelpers.CreateInMemoryProject(projectOriginalContents); - - // The project shouldn't be marked dirty yet. - Assertion.Assert("Project shouldn't be dirty", !project.IsDirtyNeedToReevaluate); - - // Set the given new property in the project file using - // the object model. - project.SetProperty("MyNewProperty", "woohoo", ""); - - // The project should be marked dirty now. - Assertion.Assert("Project should be dirty", project.IsDirtyNeedToReevaluate); - - ObjectModelHelpers.CompareProjectContents(project, projectNewExpectedContents); - } - - /// - /// This tests that the project is correctly marked as dirty when we - /// add a new property to the project. - /// - /// RGoel - [Test] - public void AddNewPropertyThroughPropertyGroup() - { - // ************************************ - // BEFORE - // ************************************ - string projectOriginalContents = @" - - - - 4 - - - - - hint - - - - - - - - "; - - - // ************************************ - // AFTER - // ************************************ - string projectNewExpectedContents = @" - - - - 4 - true - - - - - hint - - - - - - - - "; - - Project project = ObjectModelHelpers.CreateInMemoryProject(projectOriginalContents); - - Assertion.Assert("Project shouldn't be dirty", !project.IsDirtyNeedToReevaluate); - - project.PropertyGroups.LastLocalPropertyGroup.AddNewProperty("Optimize", "true"); - - Assertion.Assert("Project should be dirty", project.IsDirtyNeedToReevaluate); - - ObjectModelHelpers.CompareProjectContents(project, projectNewExpectedContents); - } - - /// - /// This tests that the project is correctly marked as dirty when we - /// add a new PropertyGroup to the project. - /// - /// RGoel - [Test] - public void AddNewPropertyGroup() - { - // ************************************ - // BEFORE - // ************************************ - string projectOriginalContents = @" - - - - 4 - - - - - hint - - - - - - - - "; - - - // ************************************ - // AFTER - // ************************************ - string projectNewExpectedContents = @" - - - - 4 - - - - - - - hint - - - - - - - - "; - - Project project = ObjectModelHelpers.CreateInMemoryProject(projectOriginalContents); - - Assertion.Assert("Project shouldn't be dirty", !project.IsDirtyNeedToReevaluate); - - project.AddNewPropertyGroup(false); - - Assertion.Assert("Project should be dirty", project.IsDirtyNeedToReevaluate); - - ObjectModelHelpers.CompareProjectContents(project, projectNewExpectedContents); - } - - [Test] - public void AddPropertyToImportedProjectFile() - { - // Create temp files on disk for the main project file and the imported project file. - string importedProjFilename = ObjectModelHelpers.CreateTempFileOnDisk(@" - - - - - "); - - string mainProjFilename = ObjectModelHelpers.CreateTempFileOnDisk(@" - - - - - $(ReferencePath)$(NewImportedProperty) - - - - - - $(ReferencePath)$(NewImportedProperty) - - - - - ", importedProjFilename); - - try - { - // Load the two projects using the MSBuild object model. - Project mainProj = new Project(new Engine(@"c:\")); - Project importedProj = new Project(mainProj.ParentEngine); - - mainProj.Load(mainProjFilename); - importedProj.Load(importedProjFilename); - - // This adds a new property - mainProj.SetImportedProperty("ReferencePath", @"c:\foobar", "'true' == 'true'", importedProj); - - // Initially, the main project gets the correct value of the property from - // the imported project. So ConsumingRefPath == "$(ReferencePath)" == "c:\foobar". - Assertion.AssertEquals(@"c:\foobar", mainProj.EvaluatedProperties["ConsumingRefPath"].FinalValueEscaped); - Assertion.AssertEquals(string.Empty, mainProj.EvaluatedProperties["NonConsumingRefPath"].FinalValueEscaped); - - mainProj.SetImportedProperty("ReferencePath", @"c:\boobah", "'true' == 'true'", importedProj); - - // Now if we query for the property, we should get back the new value. - Assertion.AssertEquals(@"c:\boobah", mainProj.EvaluatedProperties["ConsumingRefPath"].FinalValueEscaped); - Assertion.AssertEquals(@"c:\boobah", importedProj.EvaluatedProperties["ReferencePath"].FinalValueEscaped); - Assertion.AssertEquals(string.Empty, mainProj.EvaluatedProperties["NonConsumingRefPath"].FinalValueEscaped); - - // Now we add a new imported property to the main file, into an existing imported - // property group. - mainProj.SetImportedProperty("NewImportedProperty", @"newpropertyvalue", "'true' == 'true'", importedProj); - - // Now if we query for the property, we should get back the new value. - Assertion.AssertEquals(@"newpropertyvalue", mainProj.EvaluatedProperties["NewImportedProperty"].FinalValueEscaped); - Assertion.AssertEquals(@"newpropertyvalue", importedProj.EvaluatedProperties["NewImportedProperty"].FinalValueEscaped); - Assertion.AssertEquals(@"c:\boobahnewpropertyvalue", mainProj.EvaluatedProperties["ConsumingRefPath"].FinalValueEscaped); - Assertion.AssertEquals(string.Empty, mainProj.EvaluatedProperties["NonConsumingRefPath"].FinalValueEscaped); - } - finally - { - File.Delete(mainProjFilename); - File.Delete(importedProjFilename); - } - } - } - - [TestFixture] - public class RemoveProperty - { - /// - /// This tests that the project is correctly marked as dirty when we - /// remove a property. - /// - /// RGoel - [Test] - public void RemovePropertyByName() - { - // ************************************ - // BEFORE - // ************************************ - string projectOriginalContents = @" - - - - false - 4 - - - - - hint - - - - - - - - "; - - - // ************************************ - // AFTER - // ************************************ - string projectNewExpectedContents = @" - - - - false - - - - - hint - - - - - - - - "; - - Project project = ObjectModelHelpers.CreateInMemoryProject(projectOriginalContents); - - Assertion.Assert("Project shouldn't be dirty", !project.IsDirtyNeedToReevaluate); - - project.PropertyGroups.LastLocalPropertyGroup.RemoveProperty("WarningLevel"); - - Assertion.Assert("Project should be dirty", project.IsDirtyNeedToReevaluate); - - ObjectModelHelpers.CompareProjectContents(project, projectNewExpectedContents); - } - - /// - /// This tests that the project is correctly marked as dirty when we - /// remove a BuildPropertyGroup from the project. - /// - /// RGoel - [Test] - public void RemovePropertyGroup() - { - // ************************************ - // BEFORE - // ************************************ - string projectOriginalContents = @" - - - - 4 - - - - - hint - - - - - - - - "; - - - // ************************************ - // AFTER - // ************************************ - string projectNewExpectedContents = @" - - - - - hint - - - - - - - - "; - - Project project = ObjectModelHelpers.CreateInMemoryProject(projectOriginalContents); - - Assertion.AssertEquals(1, project.PropertyGroups.Count); - Assertion.Assert("Project shouldn't be dirty", !project.IsDirtyNeedToReevaluate); - - project.RemovePropertyGroup(project.PropertyGroups.LastLocalPropertyGroup); - - Assertion.AssertEquals(0, project.PropertyGroups.Count); - Assertion.Assert("Project should be dirty", project.IsDirtyNeedToReevaluate); - - ObjectModelHelpers.CompareProjectContents(project, projectNewExpectedContents); - } - - /// - /// Test the RemoveAllPropertyGroups method. - /// - /// RGoel - [Test] - public void RemoveAllPropertyGroups() - { - // ************************************ - // BEFORE - // ************************************ - string original = @" - - - - c:\foobar - - - - c:\foobar - - - - "; - - - // ************************************ - // AFTER - // ************************************ - string expected = @" - - - "; - - Project project = ObjectModelHelpers.CreateInMemoryProject(original); - Assertion.AssertEquals(2, project.PropertyGroups.Count); - - project.RemoveAllPropertyGroups(); - - Assertion.AssertEquals(0, project.PropertyGroups.Count); - ObjectModelHelpers.CompareProjectContents(project, expected); - } - - /// - /// Test the RemoveAllPropertyGroups method. - /// - /// RGoel - [Test] - public void RemoveAllPropertyGroupsWithChoose() - { - // ************************************ - // BEFORE - // ************************************ - string original = @" - - - - c:\foobar - - - - - - c:\foobar - - - - - c:\foobar - - - - - - "; - - - // ************************************ - // AFTER - // ************************************ - string expected = @" - - - - - - - - - - - "; - - Project project = ObjectModelHelpers.CreateInMemoryProject(original); - Assertion.AssertEquals(3, project.PropertyGroups.Count); - - project.RemoveAllPropertyGroups(); - - Assertion.AssertEquals(0, project.PropertyGroups.Count); - ObjectModelHelpers.CompareProjectContents(project, expected); - } - - /// - /// Test the RemoveAllPropertyGroupsByCondition method. - /// - /// RGoel - [Test] - public void RemoveAllPropertyGroupsByCondition() - { - // ************************************ - // BEFORE - // ************************************ - string original = @" - - - - c:\foobar - - - - c:\foobar - - - - "; - - - // ************************************ - // AFTER - // ************************************ - string expected = @" - - - - c:\foobar - - - - "; - - Project project = ObjectModelHelpers.CreateInMemoryProject(original); - Assertion.AssertEquals(2, project.PropertyGroups.Count); - - project.RemovePropertyGroupsWithMatchingCondition("'$(x)'=='y'"); - - Assertion.AssertEquals(1, project.PropertyGroups.Count); - ObjectModelHelpers.CompareProjectContents(project, expected); - } - - /// - /// Test the RemoveAllPropertyGroupsByCondition method. - /// - /// RGoel - [Test] - public void RemoveAllPropertyGroupsByConditionWithChoose() - { - // ************************************ - // BEFORE - // ************************************ - string original = @" - - - - c:\foobar - - - - c:\foobar - - - - - - c:\foobar - - - - c:\foobar - - - - - c:\foobar - - - - c:\foobar - - - - - - "; - - - // ************************************ - // AFTER - // ************************************ - string expected = @" - - - - c:\foobar - - - - - - c:\foobar - - - - - c:\foobar - - - - - - "; - - Project project = ObjectModelHelpers.CreateInMemoryProject(original); - Assertion.AssertEquals(6, project.PropertyGroups.Count); - - project.RemovePropertyGroupsWithMatchingCondition("'$(x)'=='y'"); - - Assertion.AssertEquals(3, project.PropertyGroups.Count); - ObjectModelHelpers.CompareProjectContents(project, expected); - } - - [Test] - public void RemoveImportedPropertyGroupMatchingCondition() - { - // Create temp files on disk for the main project file and the imported project file. - string importedProjFilename = ObjectModelHelpers.CreateTempFileOnDisk(@" - - - - - "); - - string mainProjFilename = ObjectModelHelpers.CreateTempFileOnDisk(@" - - - - - - ", importedProjFilename); - - try - { - // Load the two projects using the MSBuild object model. - Project mainProj = new Project(new Engine(@"c:\")); - Project importedProj = new Project(mainProj.ParentEngine); - - mainProj.Load(mainProjFilename); - importedProj.Load(importedProjFilename); - - string configCondition1 = "'$(Configuration)' == 'Config1'"; - string configCondition2 = "'$(Configuration)' == 'Config2'"; - string configTestCondition = "'$(Configuration)' == 'Test'"; - - // Add same property to imported user file - mainProj.SetImportedProperty("Prop", "FromUserFile", - configCondition1, importedProj, PropertyPosition.UseExistingOrCreateAfterLastImport); - - mainProj.SetImportedProperty("Prop", "FromUserFile", - configCondition2, importedProj, PropertyPosition.UseExistingOrCreateAfterLastImport); - - mainProj.SetImportedProperty("Prop", "FromUserFile", - configTestCondition, importedProj, PropertyPosition.UseExistingOrCreateAfterLastImport); - - mainProj.RemovePropertyGroupsWithMatchingCondition(configTestCondition, true /* include imported */); - importedProj.RemovePropertyGroupsWithMatchingCondition(configTestCondition, true /* include imported */); - - string[] configs = mainProj.GetConditionedPropertyValues("Configuration"); - - Assertion.AssertEquals(2, configs.Length); - Assertion.Assert(configs[0] == "Config1" || configs[1] == "Config1"); - Assertion.Assert(configs[0] == "Config2" || configs[1] == "Config2"); - } - finally - { - File.Delete(mainProjFilename); - File.Delete(importedProjFilename); - } - } - - [Test] - public void RemovePersistedImportedPropertyGroupMatchingCondition() - { - // Create temp files on disk for the main project file and the imported project file. - string importedProjFilename = ObjectModelHelpers.CreateTempFileOnDisk(@" - - - - - FromUserFile1 - - - FromUserFile2 - - - FromUserFileTest - - - - - "); - - string mainProjFilename = ObjectModelHelpers.CreateTempFileOnDisk(@" - - - - - - ", importedProjFilename); - - try - { - // Load the two projects using the MSBuild object model. - Project mainProj = new Project(new Engine(@"c:\")); - Project importedProj = new Project(mainProj.ParentEngine); - - mainProj.Load(mainProjFilename); - importedProj.Load(importedProjFilename); - - mainProj.RemovePropertyGroupsWithMatchingCondition("'$(Configuration)' == 'Test'", true /* include imported */); - importedProj.RemovePropertyGroupsWithMatchingCondition("'$(Configuration)' == 'Test'", true /* include imported */); - - string[] configs = mainProj.GetConditionedPropertyValues("Configuration"); - - Assertion.AssertEquals(2, configs.Length); - Assertion.Assert(configs[0] == "Config1" || configs[1] == "Config1"); - Assertion.Assert(configs[0] == "Config2" || configs[1] == "Config2"); - } - finally - { - File.Delete(mainProjFilename); - File.Delete(importedProjFilename); - } - } - } - - [TestFixture] - public class ModifyProperty - { - /// - /// This tests that the project is correctly marked as dirty when we - /// set a property value for a property that already existed on the project. - /// - /// RGoel - [Test] - public void SetPropertyOnExistingProperty() - { - // ************************************ - // BEFORE - // ************************************ - string projectOriginalContents = @" - - - - 4 - - - - - hint - - - - - - - - "; - - - // ************************************ - // AFTER - // ************************************ - string projectNewExpectedContents = @" - - - - 3 - - - - - hint - - - - - - - - "; - - Project project = ObjectModelHelpers.CreateInMemoryProject(projectOriginalContents); - - Assertion.Assert("Project shouldn't be dirty", !project.IsDirtyNeedToReevaluate); - - project.SetProperty("WarningLevel", "3", null); - - Assertion.Assert("Project should be dirty", project.IsDirtyNeedToReevaluate); - - ObjectModelHelpers.CompareProjectContents(project, projectNewExpectedContents); - } - - /// - /// This tests that the project is correctly marked as dirty when we - /// directly change the value of a property. - /// - /// RGoel - [Test] - public void ModifyPropertyValue() - { - // ************************************ - // BEFORE - // ************************************ - string projectOriginalContents = @" - - - - false - 4 - - - - - hint - - - - - - - - "; - - - // ************************************ - // AFTER - // ************************************ - string projectNewExpectedContents = @" - - - - false - 3 - - - - - hint - - - - - - - - "; - - Project project = ObjectModelHelpers.CreateInMemoryProject(projectOriginalContents); - - // Force an evaluation of the project. If there were a bug in the project code, this might - // cause the back pointers from properties to the parent BuildPropertyGroup to get messed up. - BuildPropertyGroup evaluatedProperties = project.EvaluatedProperties; - - Assertion.Assert("Project shouldn't be dirty", !project.IsDirtyNeedToReevaluate); - - BuildPropertyGroup propertyGroup = project.PropertyGroups.LastLocalPropertyGroup; - foreach (BuildProperty property in propertyGroup) - { - if (property.Name == "WarningLevel") - { - property.Value = "3"; - } - } - - Assertion.Assert("Project should be dirty", project.IsDirtyNeedToReevaluate); - - ObjectModelHelpers.CompareProjectContents(project, projectNewExpectedContents); - } - - /// - /// Tests to see if the main project's evaluated properties will pick up changes made - /// to the imported project file. This is necessary for IDE scenarios, particularly for - /// things like the "ReferencePath" property which is stored in the .USER file and is - /// used during the build process for the main project. - /// - /// RGoel - [Test] - public void ModifyPropertyInImportedProjectFile() - { - // Create temp files on disk for the main project file and the imported project file. - string importedProjFilename = ObjectModelHelpers.CreateTempFileOnDisk(@" - - - - - c:\foobar - - - - - "); - - string mainProjFilename = ObjectModelHelpers.CreateTempFileOnDisk(@" - - - - - - - $(ReferencePath) - - - - - ", importedProjFilename); - - try - { - // Load the two projects using the MSBuild object model. - Project mainProj = new Project(new Engine(@"c:\")); - Project importedProj = new Project(mainProj.ParentEngine); - - mainProj.Load(mainProjFilename); - importedProj.Load(importedProjFilename); - - // Initially, the main project gets the correct value of the property from - // the imported project. So ConsumingRefPath == "$(ReferencePath)" == "c:\foobar". - Assertion.AssertEquals(@"c:\foobar", mainProj.EvaluatedProperties["ConsumingRefPath"].FinalValueEscaped); - - Assertion.Assert("Main project should not be dirty for Save before setting imported property", !mainProj.IsDirty); - Assertion.Assert("Main project should not be dirty for Evaluation before setting imported property", !mainProj.IsDirtyNeedToReevaluate); - Assertion.Assert("Imported project should not be dirty for Save before setting imported property", !importedProj.IsDirty); - Assertion.Assert("Imported project should not be dirty for Evaluation before setting imported property", !importedProj.IsDirtyNeedToReevaluate); - - mainProj.SetImportedProperty("ReferencePath", @"c:\boobah", null, importedProj); - - Assertion.Assert("Main project should not be dirty for Save after setting first imported property", !mainProj.IsDirty); - Assertion.Assert("Main project should be dirty for Evaluation after setting first imported property", mainProj.IsDirtyNeedToReevaluate); - Assertion.Assert("Imported project should be dirty for Save after setting first imported property", importedProj.IsDirty); - Assertion.Assert("Imported project should be dirty for Evaluation after setting first imported property", importedProj.IsDirtyNeedToReevaluate); - - // Now if we query for the property, we should get back the new value. - Assertion.AssertEquals(@"c:\boobah", mainProj.EvaluatedProperties["ConsumingRefPath"].FinalValueEscaped); - Assertion.AssertEquals(@"c:\boobah", importedProj.EvaluatedProperties["ReferencePath"].FinalValueEscaped); - - // Now we add a new imported property to the main file, into an existing imported - // property group. - mainProj.SetImportedProperty("NewImportedProperty", @"newpropertyvalue", null, importedProj); - - // Now if we query for the property, we should get back the new value. - Assertion.AssertEquals(@"newpropertyvalue", mainProj.EvaluatedProperties["NewImportedProperty"].FinalValueEscaped); - Assertion.AssertEquals(@"newpropertyvalue", importedProj.EvaluatedProperties["NewImportedProperty"].FinalValueEscaped); - - // Now we add a new imported property to the main file, into a new imported - // property group (by setting a unique condition). - mainProj.SetImportedProperty("NewImportedPropertyWithCondition", @"anotherpropertyvalue", "'$(foo)' == '$(bar)'", importedProj); - - // Now if we query for the property, we should get back the new value. - Assertion.AssertEquals(@"anotherpropertyvalue", mainProj.EvaluatedProperties["NewImportedPropertyWithCondition"].FinalValueEscaped); - Assertion.AssertEquals(@"anotherpropertyvalue", importedProj.EvaluatedProperties["NewImportedPropertyWithCondition"].FinalValueEscaped); - - Assertion.Assert("Main project should not be dirty for Save after setting last imported property", !mainProj.IsDirty); - Assertion.Assert("Imported project should be dirty for Save after setting last imported property", importedProj.IsDirty); - } - finally - { - File.Delete(mainProjFilename); - File.Delete(importedProjFilename); - } - } - - [Test] - public void ModifyImportedPropertyGroupCondition() - { - // Create temp files on disk for the main project file and the imported project file. - string importedProjFilename = ObjectModelHelpers.CreateTempFileOnDisk(@" - - - - - "); - - string mainProjFilename = ObjectModelHelpers.CreateTempFileOnDisk(@" - - - - - - ", importedProjFilename); - - try - { - // Load the two projects using the MSBuild object model. - Project mainProj = new Project(new Engine(@"c:\")); - Project importedProj = new Project(mainProj.ParentEngine); - - mainProj.Load(mainProjFilename); - importedProj.Load(importedProjFilename); - - string configCondition1 = "'$(Configuration)' == 'Config1'"; - string configCondition2 = "'$(Configuration)' == 'Config2'"; - - // Add same property to imported user file - mainProj.SetImportedProperty("Prop", "FromUserFile", - configCondition1, importedProj, PropertyPosition.UseExistingOrCreateAfterLastImport); - - mainProj.SetImportedProperty("Prop", "FromUserFile", - configCondition2, importedProj, PropertyPosition.UseExistingOrCreateAfterLastImport); - - foreach (BuildPropertyGroup bpg in mainProj.PropertyGroups) - { - if (bpg.Condition == configCondition2) - { - bpg.SetImportedPropertyGroupCondition("'$(Configuration)' == 'NewConfig'"); - } - } - - string[] configs = mainProj.GetConditionedPropertyValues("Configuration"); - - Assertion.AssertEquals(2, configs.Length); - Assertion.Assert(configs[0] == "Config1" || configs[1] == "Config1"); - Assertion.Assert(configs[0] == "NewConfig" || configs[1] == "NewConfig"); - } - finally - { - File.Delete(mainProjFilename); - File.Delete(importedProjFilename); - } - } - - [Test] - public void ModifyPersistedImportedPropertyGroupCondition() - { - // Create temp files on disk for the main project file and the imported project file. - string importedProjFilename = ObjectModelHelpers.CreateTempFileOnDisk(@" - - - - - FromUserFile1 - - - FromUserFile2 - - - - - "); - - string mainProjFilename = ObjectModelHelpers.CreateTempFileOnDisk(@" - - - - - - ", importedProjFilename); - - try - { - // Load the two projects using the MSBuild object model. - Project mainProj = new Project(new Engine(@"c:\")); - Project importedProj = new Project(mainProj.ParentEngine); - - mainProj.Load(mainProjFilename); - importedProj.Load(importedProjFilename); - - foreach (BuildPropertyGroup bpg in mainProj.PropertyGroups) - { - if (bpg.Condition == "'$(Configuration)' == 'Config2'") - { - bpg.SetImportedPropertyGroupCondition("'$(Configuration)' == 'NewConfig'"); - } - } - - string[] configs = mainProj.GetConditionedPropertyValues("Configuration"); - - Assertion.AssertEquals(2, configs.Length); - Assertion.Assert(configs[0] == "Config1" || configs[1] == "Config1"); - Assertion.Assert(configs[0] == "NewConfig" || configs[1] == "NewConfig"); - } - finally - { - File.Delete(mainProjFilename); - File.Delete(importedProjFilename); - } - } - - /// - /// Verify that the programfiles32 property points to the correct location - /// - [Test] - public void VerifyMsbuildProgramFiles32ReservedProperty() - { - MockLogger ml = ObjectModelHelpers.BuildProjectExpectSuccess(@" - - - $(MsBuildProgramFiles32) - - - - - - "); - - // Make sure the log contains the correct strings. - ml .AssertLogContains(String.Format("[{0}]", FrameworkLocationHelper.programFiles32)); - } - - /// - /// Tests to see if the main project's evaluated properties will pick up changes made - /// to the imported project file. This is necessary for IDE scenarios, particularly for - /// things like the "ReferencePath" property which is stored in the .USER file and is - /// used during the build process for the main project. - /// - /// RGoel - [Test] - public void ModifyPropertyInImportedProjectFileAfterRename() - { - ObjectModelHelpers.DeleteTempProjectDirectory(); - - // Create temp files on disk for the main project file and the imported project file. - string importedProjFilename = ObjectModelHelpers.CreateFileInTempProjectDirectory("imported.proj", @" - - - - - c:\foobar - - - - - "); - - string mainProjFilename = ObjectModelHelpers.CreateFileInTempProjectDirectory("main.proj", string.Format(@" - - - - - - - $(ReferencePath) - - - - - ", importedProjFilename)); - - // Load the two projects using the MSBuild object model. - Project mainProj = new Project(new Engine(@"c:\")); - Project importedProj = new Project(mainProj.ParentEngine); - - mainProj.Load(mainProjFilename); - importedProj.Load(importedProjFilename); - - // Initially, the main project gets the correct value of the property from - // the imported project. So ConsumingRefPath == "$(ReferencePath)" == "c:\foobar". - Assertion.AssertEquals(@"c:\foobar", mainProj.EvaluatedProperties["ConsumingRefPath"].FinalValueEscaped); - - mainProj.SetImportedProperty("ReferencePath", @"c:\boobah", null, importedProj); - - // Now if we query for the property, we should get back the new value. - Assertion.AssertEquals(@"c:\boobah", mainProj.EvaluatedProperties["ConsumingRefPath"].FinalValueEscaped); - Assertion.AssertEquals(@"c:\boobah", importedProj.EvaluatedProperties["ReferencePath"].FinalValueEscaped); - - importedProj.Save(Path.Combine(ObjectModelHelpers.TempProjectDir, "newimported.proj")); - - // Now we add a new imported property to the main file, into an existing imported - // property group. - mainProj.SetImportedProperty("ReferencePath", @"c:\hoohah", null, importedProj); - - // Now if we query for the property, we should get back the new value. - Assertion.AssertEquals(@"c:\hoohah", importedProj.EvaluatedProperties["ReferencePath"].FinalValueEscaped); - Assertion.AssertEquals(@"c:\hoohah", mainProj.EvaluatedProperties["ReferencePath"].FinalValueEscaped); - } - } - - /// - /// A very simple task that logs a constant message. - /// - /// RGoel - public class WashCar : Microsoft.Build.Utilities.Task - { - public override bool Execute() - { - this.Log.LogMessage("Done washing car."); - return true; - } - } - - /// - /// A very simple Message task. We are intentionally giving it the same name as one of our shipping tasks. - /// - /// RGoel - public class Message : Microsoft.Build.Utilities.Task - { - private string text; - public string Text - { - set {text = value;} - } - - public override bool Execute() - { - this.Log.LogMessage("Custom Message task: " + text); - return true; - } - } - - [TestFixture] - public class UsingTask - { - /// - /// Register a custom task using the fully qualified name, and invoke it using the fully qualified name. - /// - /// RGoel - [Test] - public void CustomTaskRegisteredFullInvokedFull() - { - // Create a project file that calls our custom WashCar task (implemented just a few lines above). - MockLogger ml = ObjectModelHelpers.BuildProjectExpectSuccess(String.Format(@" - - - - - - - - - - - - ", new Uri(Assembly.GetExecutingAssembly().EscapedCodeBase).LocalPath)); - - // Make sure the log contains the correct strings. - Assertion.Assert("Custom WashCar task should have been called.", ml.FullLog.Contains("Done washing car.")); - } - - /// - /// Register a custom task using the fully qualified name, and invoke it using the simple name. - /// - /// RGoel - [Test] - public void CustomTaskRegisteredFullInvokedSimple() - { - // Create a project file that calls our custom WashCar task (implemented just a few lines above). - MockLogger ml = ObjectModelHelpers.BuildProjectExpectSuccess(String.Format(@" - - - - - - - - - - - - ", new Uri(Assembly.GetExecutingAssembly().EscapedCodeBase).LocalPath)); - - // Make sure the log contains the correct strings. - Assertion.Assert("Custom WashCar task should have been called.", ml.FullLog.Contains("Done washing car.")); - } - - /// - /// Register a custom task using the simple name, and invoke it using the fully qualified name. - /// - /// RGoel - [Test] - public void CustomTaskRegisteredSimpleInvokedFull() - { - // Create a project file that calls our custom WashCar task (implemented just a few lines above). - MockLogger ml = ObjectModelHelpers.BuildProjectExpectSuccess(String.Format(@" - - - - - - - - - - - - ", new Uri(Assembly.GetExecutingAssembly().EscapedCodeBase).LocalPath)); - - // Make sure the log contains the correct strings. - Assertion.Assert("Custom WashCar task should have been called.", ml.FullLog.Contains("Done washing car.")); - } - - /// - /// Register a custom task using the simple name, and invoke it using the simple name. - /// - /// RGoel - [Test] - public void CustomTaskRegisteredSimpleInvokedSimple() - { - // Create a project file that calls our custom WashCar task (implemented just a few lines above). - MockLogger ml = ObjectModelHelpers.BuildProjectExpectSuccess(String.Format(@" - - - - - - - - - - - - ", new Uri(Assembly.GetExecutingAssembly().EscapedCodeBase).LocalPath)); - - // Make sure the log contains the correct strings. - Assertion.Assert("Custom WashCar task should have been called.", ml.FullLog.Contains("Done washing car.")); - } - - /// - /// Register a custom task that has the same class name as one of our shipping tasks, but in a different - /// namespace. Register it using the fully qualified namespace. Then invoke the task with: - /// 1.) fully qualified namespace of the custom task. This should invoke the custom task. - /// 2.) fully qualified namespace of the shipping task. This should invoke the shipping task. - /// 3.) unqualified task name. This should invoke the shipping task. - /// - /// RGoel - [Test] - public void CustomMessageTaskRegisteredFullyQualifed() - { - // Create a project file that calls our custom Message task and the shipping Message task. - // (The custom Message task is implemented just a few lines above.) - MockLogger ml = ObjectModelHelpers.BuildProjectExpectSuccess(String.Format(ObjectModelHelpers.CleanupFileContents(@" - - - - - - - - - - - - - - - - - - - - - - - - "), new Uri(Assembly.GetExecutingAssembly().EscapedCodeBase).LocalPath)); - - // Make sure the log contains the correct strings. - Assertion.Assert("Custom Message task should have been called the first time.", ml.FullLog.Contains("Custom Message task: Being")); - - Assertion.Assert("Some Message task should have been called the second time.", ml.FullLog.Contains("John")); - Assertion.Assert("Shipping Message task should have been called the second time.", !ml.FullLog.Contains("Custom Message task: John")); - - Assertion.Assert("Some Message task should have been called the third time.", ml.FullLog.Contains("Malkovich")); - Assertion.Assert("Shipping Message task should have been called the third time.", !ml.FullLog.Contains("Custom Message task: Malkovich")); - } - - /// - /// Register a custom task that has the same class name as one of our shipping tasks, but in a different - /// namespace. Register it using only the simple name. Then invoke the task with: - /// 1.) fully qualified namespace of the custom task. This should invoke the custom task. - /// 2.) fully qualified namespace of the shipping task. This should invoke the shipping task. - /// 3.) unqualified task name. This should invoke the custom task. - /// - /// RGoel - [Test] - public void CustomMessageTaskRegisteredSimple() - { - // Create a project file that calls our custom Message task and the shipping Message task. - // (The custom Message task is implemented just a few lines above.) - MockLogger ml = ObjectModelHelpers.BuildProjectExpectSuccess(String.Format(@" - - - - - - - - - - - - - - - - - - - - - ", new Uri(Assembly.GetExecutingAssembly().EscapedCodeBase).LocalPath)); - - // Make sure the log contains the correct strings. - Assertion.Assert("Custom Message task should have been called the first time.", ml.FullLog.Contains("Custom Message task: Being")); - - Assertion.Assert("Some Message task should have been called the second time.", ml.FullLog.Contains("John")); - Assertion.Assert("Shipping Message task should have been called the second time.", !ml.FullLog.Contains("Custom Message task: John")); - - Assertion.Assert("Custom Message task should have been called the third time.", ml.FullLog.Contains("Custom Message task: Malkovich")); - } - } - - [TestFixture] - public class Properties - { - [TearDown] - public void TearDown() - { - if (Registry.CurrentUser.OpenSubKey("msbuildUnitTests") != null) - { - Registry.CurrentUser.DeleteSubKeyTree("msbuildUnitTests"); - } - } - - private const string testRegistryPath = @"msbuildUnitTests"; - - /// - /// Basic test. - /// - [Test] - public void RegistryProperties() - { - RegistryKey testRegistryKey = null; - - testRegistryKey = Registry.CurrentUser.CreateSubKey(testRegistryPath); - testRegistryKey.SetValue("Foo", "FooValue"); - - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - -

$(Registry:HKEY_CURRENT_USER\" + testRegistryPath + @"@Foo)

- QValue -
-
- "); - - Assertion.AssertEquals("FooValue", p.EvaluatedProperties["P"].FinalValue); - Assertion.AssertEquals("QValue", p.EvaluatedProperties["Q"].FinalValue); - } - - /// - /// Basic test. - /// - [Test] - public void RegistryPropertiesWithEscapedCharactersInValue() - { - RegistryKey testRegistryKey = null; - testRegistryKey = Registry.CurrentUser.CreateSubKey(testRegistryPath); - testRegistryKey.SetValue("Foo", "FooValue"); - testRegistryKey.SetValue("Bar", "%24(Foo)"); - testRegistryKey.SetValue("Property3", "%24(NUMBER_OF_PROCESSORS)"); - testRegistryKey.SetValue("@Property4", "Value4"); - - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - -

$(Registry:HKEY_CURRENT_USER\" + testRegistryPath + @"@Foo)

- QValue - $(Registry:HKEY_CURRENT_USER\" + testRegistryPath + @"@Property3) - $(Registry:HKEY_CURRENT_USER\" + testRegistryPath + @"@%40Property4) -
-
- "); - - Assertion.AssertEquals("FooValue", p.EvaluatedProperties["P"].FinalValue); - Assertion.AssertEquals("QValue", p.EvaluatedProperties["Q"].FinalValue); - Assertion.AssertEquals("$(NUMBER_OF_PROCESSORS)", p.EvaluatedProperties["R"].FinalValue); - Assertion.AssertEquals("Value4", p.EvaluatedProperties["S"].FinalValue); - } - } - - [TestFixture] - public class QueryProjectState - { - /// - /// This tests the Project.EvaluatedItemsIgnoringCondition property. This - /// property should return the list of evaluated items in the project, - /// pretending that all "Condition"s evaluated to true. - /// - /// RGoel - [Test] - public void GetEvaluatedItemsIgnoringCondition() - { - string projectOriginalContents = @" - - - - .cs - - - - - hint - - - - - - - - "; - - Project project = ObjectModelHelpers.CreateInMemoryProject(projectOriginalContents); - - // Get the set of evaluated items. - BuildItem[] evaluatedItemsIgnoringCondition1 = project.EvaluatedItemsIgnoringCondition.ToArray(); - BuildItem[] evaluatedItems1 = project.EvaluatedItems.ToArray(); - - // The VS IDE does a few re-evaluations with different sets of global properties - // (i.e., Configuration=Debug, Configuration=Release, etc.). This is to simulate - // that. The point is that re-evaluating a project should NOT change the items - // that are returned from Project.EvaluatedItemsIgnoringCondition. Those items - // need to be semi-permanent so that the IDE can hang on to them across multiple - // builds. - project.MarkProjectAsDirty (); - BuildItem[] evaluatedItemsIgnoringCondition2 = project.EvaluatedItemsIgnoringCondition.ToArray(); - BuildItem[] evaluatedItems2 = project.EvaluatedItems.ToArray(); - - // Confirm the "IgnoreCondition" lists: - { - EngineHelpers.AssertItemsMatch(@" - a.cs : HintPath=hint - b.cs : HintPath=hint - c.cs : HintPath= - ", evaluatedItemsIgnoringCondition1); - - EngineHelpers.AssertItemsMatch(@" - a.cs : HintPath=hint - b.cs : HintPath=hint - c.cs : HintPath= - ", evaluatedItemsIgnoringCondition2); - - // Confirm that both lists contain the exact same 3 items. - Assertion.AssertEquals(evaluatedItemsIgnoringCondition1[0], evaluatedItemsIgnoringCondition2[0]); - Assertion.AssertEquals(evaluatedItemsIgnoringCondition1[1], evaluatedItemsIgnoringCondition2[1]); - Assertion.AssertEquals(evaluatedItemsIgnoringCondition1[2], evaluatedItemsIgnoringCondition2[2]); - } - - // Confirm the other "normal" lists: - { - EngineHelpers.AssertItemsMatch("c.cs", evaluatedItems1); - EngineHelpers.AssertItemsMatch("c.cs", evaluatedItems2); - - // Confirm that both lists do *not* contain the exact same item. - Assertion.Assert(evaluatedItems1[0] != evaluatedItems2[0]); - } - } - - /// - /// Ensures that if we define a new item list based on another previously defined - /// item list that the new item list inherits the metadata from the previous item list. - /// - /// RGoel - [Test] - public void GetItemMetadataInheritedFromOtherItems() - { - string projectOriginalContents = @" - - - - - Klingon - Time - - - Smurf - - - '%(Identity)3')`> - Newsweek - - - - - "; - - Project project = ObjectModelHelpers.CreateInMemoryProject(projectOriginalContents); - - // ========================================== - // VALIDATE @(COMPILE2) IS DEFINED CORRECTLY. - // ========================================== - BuildItemGroup compile2 = project.GetEvaluatedItemsByName("Compile2"); - - EngineHelpers.AssertItemsMatch(@" - a : Culture=Klingon ; Magazine=Time - b : Culture=Klingon ; Magazine=Time - c : Culture=Smurf ; Magazine= - ", compile2); - - // ========================================== - // VALIDATE @(COMPILE3) IS DEFINED CORRECTLY. - // ========================================== - BuildItemGroup compile3 = project.GetEvaluatedItemsByName("Compile3"); - - EngineHelpers.AssertItemsMatch(@" - a3 : Culture=Klingon ; Magazine=Newsweek - b3 : Culture=Klingon ; Magazine=Newsweek - c3 : Culture=Smurf ; Magazine=Newsweek - ", compile3); - } - } - - [TestFixture] - public class Imports - { - /// - /// Tests that the engine does care about an invalid import if the condition - /// is false - #484931 - /// - /// danmose - [Test] - public void InvalidImportFalseCondition() - { - // Very important to put the Project attribute before the Condition attribute, - // to repro the crash in #484931 - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - "); - - // Should build successfully - Assertion.Assert(p.Build(new string[] { "t" }, null)); - - // No exception - } - - /// - /// Tests that the engine handles invalid Import project path nicely - #347276 - /// - /// danmose - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void InvalidImportProject() - { - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - "); - - p.Build(new string[] { "t" }, null); // Should throw - } - - /// - /// Tests that the engine handles invalid Import project path nicely - #347276 - /// - /// danmose - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void InvalidImportProject2() - { - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - "); - - p.Build(new string[] { "t" }, null); // Should throw - } - - /// - /// Tests that the engine handles invalid Import project path nicely - #347276 - /// - /// danmose - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void InvalidImportProject3() - { - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - "); - - p.Build(new string[] { "t" }, null); // Should throw - } - - /// - /// Test replacing the project import path with something else - /// - [Test] - public void ReplaceImport() - { - XmlDocument xmldoc = new XmlDocument(); - xmldoc.LoadXml(ObjectModelHelpers.CleanupFileContents(@" - - - - ")); - - Engine engine = new Engine(@"c:\"); - Project project = engine.CreateNewProject(); - project.LoadFromXmlDocument(xmldoc, null, ProjectLoadSettings.IgnoreMissingImports); - - IEnumerator enumerator = project.Imports.GetEnumerator(); - enumerator.MoveNext(); - Import import = (Import)enumerator.Current; - - import.ProjectPath = "Microsoft.Rare.targets"; - Assert.AreEqual(null, import.Condition); - import.Condition = "'true' == 'true'"; - Assert.AreEqual("'true' == 'true'", import.Condition); - - StringWriter writer = new StringWriter(); - project.Save(writer); - - // Load the modified project into a new project object - xmldoc = new XmlDocument(); - xmldoc.LoadXml(writer.ToString()); - - Project projectWithChangedImport = engine.CreateNewProject(); - project.LoadFromXmlDocument(xmldoc, null, ProjectLoadSettings.IgnoreMissingImports); - Assert.AreEqual(1, project.Imports.Count); - - enumerator = project.Imports.GetEnumerator(); - enumerator.MoveNext(); - import = (Import)enumerator.Current; - - Assert.AreEqual("Microsoft.Rare.targets", import.ProjectPath); - Assert.AreEqual("'true' == 'true'", import.Condition); - } - } - - [TestFixture] - public class Evaluation - { - /// - /// Relative paths in 'exists' on conditions should be evalauted relative to the - /// project directory. - /// - [Test] - public void ImportConditionsEvaluatedUsingProjectsDirectory() - { - string importFile = ObjectModelHelpers.CreateTempFileOnDisk(@" - - - - - - "); - - // Import the file (and express the import condition) using a *relative* path - string importFileRelative = Path.GetFileName(importFile); - - string projectFile = ObjectModelHelpers.CreateTempFileOnDisk(@" - - - - ", importFileRelative); - - string currentDirectory = Environment.CurrentDirectory; - try - { - MockLogger logger = new MockLogger(); - Project project = LoadAndBuildInDifferentCurrentDirectory(projectFile, logger); - - logger.AssertLogContains("[in import]"); - logger.ClearLog(); - - DirtyAndBuildInDifferentCurrentDirectory(project); - logger.AssertLogContains("[in import]"); - } - finally - { - File.Delete(projectFile); - File.Delete(importFile); - Environment.CurrentDirectory = currentDirectory; - } - } - - /// - /// Relative paths in 'exists' on conditions should be evalauted relative to the - /// project directory. - /// - [Test] - public void PropertyConditionsEvaluatedUsingProjectsDirectory() - { - string tempFile = Path.GetTempFileName(); - string relativeTempFile = Path.GetFileName(tempFile); - - string projectFile = ObjectModelHelpers.CreateTempFileOnDisk(@" - - -

v1

-
- - - -
- ", relativeTempFile); - - try - { - MockLogger logger = new MockLogger(); - Project project = LoadAndBuildInDifferentCurrentDirectory(projectFile, logger); - - logger.AssertLogContains("[v1]"); - logger.ClearLog(); - - DirtyAndBuildInDifferentCurrentDirectory(project); - logger.AssertLogContains("[v1]"); - } - finally - { - File.Delete(projectFile); - File.Delete(tempFile); - } - } - - /// - /// Relative paths in 'exists' on conditions should be evalauted relative to the - /// project directory. - /// - [Test] - public void ItemAndTargetConditionsEvaluatedUsingProjectsDirectory() - { - string tempFile = Path.GetTempFileName(); - string relativeTempFile = Path.GetFileName(tempFile); - - string projectFile = ObjectModelHelpers.CreateTempFileOnDisk(@" - - - - - - - - - ", relativeTempFile); - - try - { - MockLogger logger = new MockLogger(); - Project project = LoadAndBuildInDifferentCurrentDirectory(projectFile, logger); - - logger.AssertLogContains("[i1]"); - logger.ClearLog(); - - DirtyAndBuildInDifferentCurrentDirectory(project); - logger.AssertLogContains("[i1]"); - } - finally - { - File.Delete(projectFile); - File.Delete(tempFile); - } - } - - /// - /// Changes the current directory, loads the project, changes the current directory again, and builds it. - /// - private static Project LoadAndBuildInDifferentCurrentDirectory(string projectFile, MockLogger logger) - { - string currentDirectory = Environment.CurrentDirectory; - Project project; - - try - { - project = new Project(new Engine()); - project.ParentEngine.RegisterLogger(logger); - - // Make sure that the current directory isn't the project directory somehow - Environment.CurrentDirectory = Environment.SystemDirectory; - project.Load(projectFile); - - // Make sure that the current directory isn't the project directory somehow - Environment.CurrentDirectory = Environment.SystemDirectory; - project.Build(); - } - finally - { - Environment.CurrentDirectory = currentDirectory; - } - - return project; - } - - /// - /// Dirties the project, changes the current directory, and builds it. - /// - private void DirtyAndBuildInDifferentCurrentDirectory(Project project) - { - string currentDirectory = Environment.CurrentDirectory; - - try - { - project.MarkProjectAsDirty(); - - // Make sure that the current directory isn't the project directory somehow - Environment.CurrentDirectory = Environment.SystemDirectory; - project.Build(); - } - finally - { - Environment.CurrentDirectory = currentDirectory; - } - } - } - - [TestFixture] - public class EscapingAndRecursiveDir - { - /// - /// Regress DDB# 114268. %28 in an item's include in the XML should - /// match '(' in a file path. This was not happening in the code path - /// that produces %(RecursiveDir). - /// - [Test] - public void RecursiveDirPathWithParentheses() - { - string directory = null, subdirectory = null, file1 = null; - - try - { - directory = Path.Combine(Path.GetTempPath(), "a(b)c"); - subdirectory = Path.Combine(directory, "d"); - file1 = Path.Combine(subdirectory, "e"); - Directory.CreateDirectory(subdirectory); - - // Create a file "%temp%\a(b)c\d\e" - File.WriteAllText(file1, String.Empty); - - - string xml = @" - - - - - - c:\foo\%(i.recursivedir)%(i.filename)%(i.extension)]`/> - - - "; - - Console.WriteLine(xml); - - Project p = new Project(); - p.FullFileName = Path.Combine(subdirectory, "x.proj"); - p.LoadXml(xml.Replace('`', '"')); - - MockLogger logger = new MockLogger(); - p.ParentEngine.RegisterLogger(logger); - - p.Build(); - - logger.AssertLogContains("[" + directory + @"\d\e-->c:\foo\d\e]"); - } - finally - { - File.Delete(file1); - Directory.Delete(subdirectory); - Directory.Delete(directory); - } - } - } - - [TestFixture] - public class ErrorCases - { - /// - /// Tests that the engine correctly reports a failure when somebody tries to - /// reference an item list inside the Condition for an Import. - /// - /// RGoel - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void ItemGroupInAnImportCondition() - { - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - - - - - - "); - - p.Build(new string[] { "t" }, null); - } - - /// - /// Tests to make sure we correctly fail on a target name that contains an embedded property. - /// - /// RGoel - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void InvalidTargetName() - { - string projectOriginalContents = @" - - - - "; - - Project project = ObjectModelHelpers.CreateInMemoryProject(projectOriginalContents); - } - - /// - /// Tests to make sure we correctly fail on a meta-data name containing a period. - /// - /// danmose - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void InvalidMetadataName() - { - string projectOriginalContents = @" - - - - foo - - - - - "; - - Project project = ObjectModelHelpers.CreateInMemoryProject(projectOriginalContents); - } - - /// - /// Regression test for bug VSWhidbey 243657 - /// - /// RGoel - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void IllegalCharactersInItemName() - { - string original = @" - - - - - - - - "; - - Project project = ObjectModelHelpers.CreateInMemoryProject(original); - } - - /// - /// Regression test for bug VSWhidbey 412627 - /// - /// danmose - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void IllegalCharactersInUsingTaskAssemblyFile() - { - string original = @" - - - - "; - - Project project = ObjectModelHelpers.CreateInMemoryProject(original); - } - - /// - /// Unknown attribute on UsingTask should throw - /// - /// danmose - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void UnknownAttributeInUsingTask() - { - string original = @" - - - - "; - - // Should throw - Project project = ObjectModelHelpers.CreateInMemoryProject(original); - } - - /// - /// RequiredRuntime attribute on UsingTask should be ignored - /// (we'll make it actually do something in V3.5+1 - /// - /// danmose - [Test] - public void RequiredRuntimeAttributeInUsingTask() - { - string original = @" - - - - "; - - // Should not throw - Project project = ObjectModelHelpers.CreateInMemoryProject(original); - } - - /// - /// Tests that putting invalid characters in the path results in a - /// InvalidProjectFileException. - /// - /// RGoel - [ExpectedException(typeof(InvalidProjectFileException))] - [Test] - public void InvalidCharactersInImportedPath() - { - string original = @" - - - - "; - - Project project = ObjectModelHelpers.CreateInMemoryProject(original); - } - - /// - /// Regress Whidbey 531457. Make sure that we restore the current directory after a child project - /// throws an exception - /// - /// LukaszG - [Test] - public void CurrentDirectoryRestoredAfterException() - { - ObjectModelHelpers.DeleteTempProjectDirectory(); - - // --------------------- - // dirs.proj - // --------------------- - ObjectModelHelpers.CreateFileInTempProjectDirectory("dirs.proj", @" - - - - - - - - - - "); - - // --------------------- - // a.proj - // An invalid project file that will cause an InvalidProjectException - // --------------------- - ObjectModelHelpers.CreateFileInTempProjectDirectory(@"a\a.proj", @" - - - - - - - "); - - // --------------------- - // b.proj - // A control project file that should build correctly after a.proj throws - // --------------------- - ObjectModelHelpers.CreateFileInTempProjectDirectory(@"b\b.proj", @" - - - - - - "); - - // Create a logger. - MockLogger logger = new MockLogger(); - Project project = ObjectModelHelpers.LoadProjectFileInTempProjectDirectory("dirs.proj", logger); - - bool success = project.Build(null, null); - Assertion.Assert("Build should have failed. See Standard Out tab for details", !success); - - logger.AssertLogDoesntContain("Greetings from an invalid project!"); - logger.AssertLogContains("Greetings from a valid project!"); - } - } - - [TestFixture] - public class GlobalProperties - { - /// - /// This tests that the project is correctly marked as dirty when we - /// modify a global property. - /// - /// RGoel - [Test] - public void SetNewGlobalProperty() - { - string projectOriginalContents = @" - - - - 4 - - - - - hint - - - - - - - - "; - - Project project = ObjectModelHelpers.CreateInMemoryProject(projectOriginalContents); - - Assertion.Assert("Project shouldn't be dirty", !project.IsDirtyNeedToReevaluate); - - project.GlobalProperties.SetProperty("Configuration", "Debug"); - - Assertion.Assert("Project should be dirty", project.IsDirtyNeedToReevaluate); - } - - /// - /// This tests that the project is NOT marked as dirty when we set a - /// global property to the exact same value it had before. - /// - /// RGoel - [Test] - public void SetGlobalPropertyToSameValue() - { - Project project = ObjectModelHelpers.CreateInMemoryProject(@""); - - Assertion.Assert("Project shouldn't be dirty to begin with.", !project.IsDirtyNeedToReevaluate); - - project.GlobalProperties.SetProperty("Configuration", "Debug"); - - Assertion.Assert("Project should be dirty after setting a global property for the first time.", project.IsDirtyNeedToReevaluate); - - // This forces a re-evaluation. - BuildPropertyGroup evaluatedProps = project.EvaluatedProperties; - - Assertion.Assert("Project should not be dirty after re-evaluation.", !project.IsDirtyNeedToReevaluate); - - // Set the global property to the exact same value it had before. - project.GlobalProperties.SetProperty("Configuration", "Debug"); - - Assertion.Assert("Project should not be dirty after setting global property to same value.", !project.IsDirtyNeedToReevaluate); - } - - /// - /// Test that the default value for $(MSBuildExtensionsPath) points to "c:\program files\msbuild" on a 32 bit machine - /// or points to c:\program files(x86)\msbuild on 64 bit machine. - /// - /// RGoel - [Test] - public void MSBuildExtensionsPathDefault() - { - string specialPropertyName = ReservedPropertyNames.extensionsPath; // "MSBuildExtensionsPath" - - // Save the old copy of the MSBuildExtensionsPath, so we can restore it when the unit test is done. - string backupMSBuildExtensionsPath = Environment.GetEnvironmentVariable(specialPropertyName); - - // Set an environment variable called MSBuildExtensionsPath to some value, for the purpose - // of seeing whether our value wins. - Environment.SetEnvironmentVariable(specialPropertyName, null); - - // Need to create a new engine object in order to pick up the new environment variables. - Engine myEngine = new Engine(); - myEngine.BinPath = @"c:\"; - - // Create a new project, and see what MSBuild gives us for the value of MSBuildExtensionsPath. - // we should get the default value which is "c:\program files\msbuild". - Project myProject = new Project(myEngine); - - string expectedValue = null; - if (Environment.Is64BitOperatingSystem) - { - expectedValue = Environment.GetEnvironmentVariable("ProgramFiles(x86)"); - } - else - { - expectedValue = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles); - } - - Assertion.AssertEquals(expectedValue + @"\MSBuild", - (string)myProject.EvaluatedProperties[specialPropertyName]); - - // Restore the original value of the MSBuildExtensionsPath environment variable. - Environment.SetEnvironmentVariable(specialPropertyName, backupMSBuildExtensionsPath); - } - - /// - /// When MSBUILDLEGACYEXTENSIONSPATH is set test tha $(MSBuildExtensionsPath) points to "c:\program files\msbuild". This should be valid for both 32 and 64 bit. - /// - [Test] - public void MSBuildExtensionsPathDefault_Legacy() - { - string specialPropertyName = "MSBuildExtensionsPath"; - - // Save the old copy of the MSBuildExtensionsPath, so we can restore it when the unit test is done. - string backupMSBuildExtensionsPath = Environment.GetEnvironmentVariable(specialPropertyName); - string backupMagicSwitch = Environment.GetEnvironmentVariable("MSBUILDLEGACYEXTENSIONSPATH"); - string targetVar = Environment.GetEnvironmentVariable("Target"); - string numberVar = Environment.GetEnvironmentVariable("0env"); - string msbuildVar = Environment.GetEnvironmentVariable("msbuildtoolsversion"); - - try - { - // Set an environment variable called MSBuildExtensionsPath to some value, for the purpose - // of seeing whether our value wins. - Environment.SetEnvironmentVariable(specialPropertyName, null); - Environment.SetEnvironmentVariable("MSBUILDLEGACYEXTENSIONSPATH", "1"); - - // Need to create a new engine object in order to pick up the new environment variables. - Engine myEngine = new Engine(); - myEngine.BinPath = @"c:\"; - - // Create a new project, and see what MSBuild gives us for the value of MSBuildExtensionsPath. - // we should get the default value which is "c:\program files\msbuild". - Project myProject = new Project(myEngine); - Assertion.AssertEquals(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) + @"\MSBuild", - (string)myProject.EvaluatedProperties[specialPropertyName]); - } - finally - { - // Restore the original value of the MSBuildExtensionsPath environment variable. - Environment.SetEnvironmentVariable(specialPropertyName, backupMSBuildExtensionsPath); - Environment.SetEnvironmentVariable("MSBUILDLEGACYEXTENSIONSPATH", backupMagicSwitch); - Environment.SetEnvironmentVariable("Target", targetVar); - Environment.SetEnvironmentVariable("0env", numberVar); - Environment.SetEnvironmentVariable("msbuildtoolsversion", msbuildVar); - } - } - - /// - /// Test that if I set an environment variable called "MSBuildExtensionPath", that my env var - /// should win over whatever MSBuild thinks the default is. - /// - /// RGoel - [Test] - public void MSBuildExtensionsPathWithEnvironmentOverride() - { - string specialPropertyName = ReservedPropertyNames.extensionsPath; // "MSBuildExtensionsPath" - - // Save the old copy of the MSBuildExtensionsPath, so we can restore it when the unit test is done. - string backupMSBuildExtensionsPath = Environment.GetEnvironmentVariable(specialPropertyName); - - // Set an environment variable called MSBuildExtensionsPath to some value, for the purpose - // of seeing whether our value wins. - Environment.SetEnvironmentVariable(specialPropertyName, @"c:\devdiv\vscore\msbuild"); - - // Need to create a new engine object in order to pick up the new environment variables. - Engine myEngine = new Engine(); - myEngine.BinPath = @"c:\"; - - // Create a new project, and see what MSBuild gives us for the value of MSBuildExtensionsPath. - Project myProject = new Project(myEngine); - Assertion.AssertEquals(@"c:\devdiv\vscore\msbuild", - (string)myProject.EvaluatedProperties[specialPropertyName]); - - // Restore the original value of the MSBuildExtensionsPath environment variable. - Environment.SetEnvironmentVariable(specialPropertyName, backupMSBuildExtensionsPath); - } - - /// - /// Test that if I set a global property called "MSBuildExtensionPath", that my global property - /// should win over whatever MSBuild thinks the default is. - /// - /// RGoel - [Test] - public void MSBuildExtensionsPathWithGlobalOverride() - { - string specialPropertyName = ReservedPropertyNames.extensionsPath; // "MSBuildExtensionsPath" - - // Create a new project, and see what MSBuild gives us for the value of MSBuildExtensionsPath. - Engine engine = new Engine(@"c:\"); - Project myProject = new Project(engine); - - // Set a global property called MSBuildExtensionsPath to some value, for the purpose - // of seeing whether our value wins. - myProject.GlobalProperties.SetProperty(specialPropertyName, @"c:\devdiv\vscore\msbuild"); - - Assertion.AssertEquals(@"c:\devdiv\vscore\msbuild", - (string)myProject.EvaluatedProperties[specialPropertyName]); - } - - /// - /// The default value for $(MSBuildExtensionsPath32) should point to "c:\program files (x86)\msbuild" on a 64 bit machine. - /// We can't test that directly since tests generally don't run on 64 bit boxes. However we can set the "ProgramFiles(x86)" - /// environment variable and make sure that that's the value used. - /// - [Test] - public void MSBuildExtensionsPath32Default() - { - string programFiles32EnvVar = "ProgramFiles(x86)"; - string originalProgramFiles32Value = Environment.GetEnvironmentVariable(programFiles32EnvVar); - string extensionsPath32EnvValue = Environment.GetEnvironmentVariable("MSBuildExtensionsPath32"); - - try - { - Environment.SetEnvironmentVariable("MSBuildExtensionsPath32", null); - - if (String.IsNullOrEmpty(originalProgramFiles32Value)) - { - // 32 bit box - originalProgramFiles32Value = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles); - } - - // First try it with whatever value it currently has (it will probably be blank since it's a 32 bit box) - Project p = new Project(new Engine()); - string msbuildExtensionsPath32Value = (string)p.EvaluatedProperties[ReservedPropertyNames.extensionsPath32]; - Assertion.AssertEquals(originalProgramFiles32Value + @"\MSBuild", msbuildExtensionsPath32Value); - - // Now try setting it temporarily to some value -- as if we were on a 64 bit machine -- and getting MSBuildExtensionsPath32 again. - try - { - Environment.SetEnvironmentVariable(programFiles32EnvVar, @"c:\Program Files (x86)"); - Project p2 = new Project(new Engine()); - msbuildExtensionsPath32Value = (string)p2.EvaluatedProperties[ReservedPropertyNames.extensionsPath32]; - Assertion.AssertEquals(@"c:\Program Files (x86)\MSBuild", msbuildExtensionsPath32Value); - } - finally - { - // And restore the old value - Environment.SetEnvironmentVariable(programFiles32EnvVar, originalProgramFiles32Value); - } - } - finally - { - Environment.SetEnvironmentVariable("MSBuildExtensionsPath32", extensionsPath32EnvValue); - } - } - - [Test] - public void MSBuildExtensionsPath32WithEnvironmentOverride() - { - string originalMSBuildExtensionsPath32Value = Environment.GetEnvironmentVariable(ReservedPropertyNames.extensionsPath32); - - try - { - // Set an env var called MSBuildExtensionsPath32 to some value, for the purpose - // of seeing whether our value wins. - Environment.SetEnvironmentVariable(ReservedPropertyNames.extensionsPath32, @"c:\devdiv\vscore\msbuild"); - Project p = new Project(new Engine()); - string msbuildExtensionsPath32Value = (string)p.EvaluatedProperties[ReservedPropertyNames.extensionsPath32]; - Assertion.AssertEquals(@"c:\devdiv\vscore\msbuild", msbuildExtensionsPath32Value); - } - finally - { - // And restore the old value - Environment.SetEnvironmentVariable(ReservedPropertyNames.extensionsPath32, originalMSBuildExtensionsPath32Value); - } - } - - [Test] - public void MSBuildExtensionsPath32WithGlobalOverride() - { - Project p = new Project(new Engine()); - - // Set a global property called MSBuildExtensionsPath32 to some value, for the purpose - // of seeing whether our value wins. - p.GlobalProperties.SetProperty(ReservedPropertyNames.extensionsPath32, @"c:\devdiv\vscore\msbuild"); - string msbuildExtensionsPath32Value = (string)p.EvaluatedProperties[ReservedPropertyNames.extensionsPath32]; - Assertion.AssertEquals(@"c:\devdiv\vscore\msbuild", msbuildExtensionsPath32Value); - } - - - /// - /// Test standard reserved properties - /// - [Test] - public void ReservedProjectProperties() - { - string file = ObjectModelHelpers.CreateTempFileOnDisk( - @" - "); - Project project = new Project(new Engine()); - project.Load(file); - - Assertion.AssertEquals(Path.GetDirectoryName(file), (string)project.EvaluatedProperties["MSBuildProjectDirectory"]); - Assertion.AssertEquals(Path.GetFileName(file), (string)project.EvaluatedProperties["MSBuildProjectFile"]); - Assertion.AssertEquals(Path.GetExtension(file), (string)project.EvaluatedProperties["MSBuildProjectExtension"]); - Assertion.AssertEquals(file, (string)project.EvaluatedProperties["MSBuildProjectFullPath"]); - Assertion.AssertEquals(Path.GetFileNameWithoutExtension(file), (string)project.EvaluatedProperties["MSBuildProjectName"]); - Assertion.AssertEquals("Build", (string)project.EvaluatedProperties["MSBuildProjectDefaultTargets"]); - - int rootLength = Path.GetPathRoot(file).Length; - int fileLength = Path.GetFileName(file).Length; - string projectDirectoryNoRoot = file.Substring(rootLength, file.Length - fileLength - rootLength - 1 /* no slash */); - - Console.WriteLine("project is: " + file); - Console.WriteLine("expect MSBuildProjectDirectoryNoRoot:" + projectDirectoryNoRoot); - Console.WriteLine("actual MSBuildProjectDirectoryNoRoot:" + (string)project.EvaluatedProperties["MSBuildProjectDirectoryNoRoot"]); - Assertion.AssertEquals(projectDirectoryNoRoot, (string)project.EvaluatedProperties["MSBuildProjectDirectoryNoRoot"]); - } - - /// - /// Test standard reserved properties - /// - [Test] - public void ReservedProjectPropertiesAtRoot() - { - string file = Path.Combine(@"c:\", "MSBuildUnitTests_ReservedProjectPropertiesAtRoot.proj"); - try - { - File.WriteAllText(file, @""); - Project project = new Project(new Engine()); - project.Load(file); - - Assertion.AssertEquals(Path.GetDirectoryName(file), (string)project.EvaluatedProperties["MSBuildProjectDirectory"]); - Assertion.AssertEquals(Path.GetFileName(file), (string)project.EvaluatedProperties["MSBuildProjectFile"]); - Assertion.AssertEquals(Path.GetExtension(file), (string)project.EvaluatedProperties["MSBuildProjectExtension"]); - Assertion.AssertEquals(file, (string)project.EvaluatedProperties["MSBuildProjectFullPath"]); - Assertion.AssertEquals(Path.GetFileNameWithoutExtension(file), (string)project.EvaluatedProperties["MSBuildProjectName"]); - - // Should be empty as there's no directory - Console.WriteLine("project is: " + file); - Console.WriteLine("expect MSBuildProjectDirectoryNoRoot: (empty)"); - Console.WriteLine("actual MSBuildProjectDirectoryNoRoot:" + (string)project.EvaluatedProperties["MSBuildProjectDirectoryNoRoot"]); - Assertion.AssertEquals(String.Empty, (string)project.EvaluatedProperties["MSBuildProjectDirectoryNoRoot"]); - } - finally - { - if (file != null) File.Delete(file); - } - } - - /// - /// Test standard reserved properties on UNC - /// - [Test] - public void ReservedProjectPropertiesOnUNC() - { - string file = ObjectModelHelpers.CreateTempFileOnDisk( - @" - "); - Project project = new Project(new Engine()); - - // Hacky way to get UNC path to file - string uncFile = @"\\" + Environment.MachineName + @"\" + file[0] + "$" + file.Substring(2); - - project.Load(uncFile); - - Assertion.AssertEquals(Path.GetDirectoryName(uncFile), (string)project.EvaluatedProperties["MSBuildProjectDirectory"]); - Assertion.AssertEquals(Path.GetFileName(uncFile), (string)project.EvaluatedProperties["MSBuildProjectFile"]); - Assertion.AssertEquals(Path.GetExtension(uncFile), (string)project.EvaluatedProperties["MSBuildProjectExtension"]); - Assertion.AssertEquals(uncFile, (string)project.EvaluatedProperties["MSBuildProjectFullPath"]); - Assertion.AssertEquals(Path.GetFileNameWithoutExtension(uncFile), (string)project.EvaluatedProperties["MSBuildProjectName"]); - - int fileLength = Path.GetFileName(uncFile).Length; - int rootLength = Path.GetPathRoot(uncFile).Length; - string projectDirectoryNoRoot = uncFile.Substring(rootLength, uncFile.Length - rootLength - fileLength); - projectDirectoryNoRoot = EngineHelpers.EnsureNoLeadingSlash(projectDirectoryNoRoot); - projectDirectoryNoRoot = EngineHelpers.EnsureNoTrailingSlash(projectDirectoryNoRoot); - - Console.WriteLine("project is: " + uncFile); - Console.WriteLine("expect MSBuildProjectDirectoryNoRoot:" + projectDirectoryNoRoot); - Console.WriteLine("actual MSBuildProjectDirectoryNoRoot:" + (string)project.EvaluatedProperties["MSBuildProjectDirectoryNoRoot"]); - Assertion.AssertEquals(projectDirectoryNoRoot, (string)project.EvaluatedProperties["MSBuildProjectDirectoryNoRoot"]); - } - - /// - /// MSBuildStartupDirectory should point to the directory in which the process hosting the Engine - /// was first started. - /// - [Test] - public void MSBuildStartupDirectory() - { - // This test crashes if Engine is not GAC'd, as it typically isn't during development - if (Environment.GetEnvironmentVariable("DO_NOT_RUN_TESTS_REQUIRING_ENGINE_GACD") == "1") - { - return; - } - - string projectFile = null; - string resultFile = null; - string startDirectory = null; - - string oldCurrentDirectory = Environment.CurrentDirectory; - - try - { - projectFile = Path.GetTempFileName(); - resultFile = Path.GetTempFileName(); - Random rand = new Random(); - startDirectory = Path.Combine(Path.GetTempPath(), Convert.ToString(rand.NextDouble())); - Directory.CreateDirectory(startDirectory); - - Environment.CurrentDirectory = startDirectory; - Engine e = new Engine(); - - Project p = ObjectModelHelpers.CreateInMemoryProject(e, @" - - - - - ", null); - - bool result = p.Build(); - - Assertion.Assert("ERROR: Check Engine is in the GAC?", File.Exists(resultFile)); - - FileInfo fileInfo = new FileInfo(resultFile); - Assertion.Assert("ERROR: Check Engine is in the GAC?", fileInfo.Length > 0); - - string resultContent = File.ReadAllLines(resultFile)[0]; - Console.WriteLine("[$(MSBuildStartupDirectory)] was: " + resultContent); - Assertion.AssertEquals("[" + startDirectory + "]", resultContent); - } - catch (Exception e) - { - string stack = e.StackTrace.Replace('\n', ' ').Replace('\t', ' '); - Assertion.Fail(stack); - throw; - } - finally - { - // Sometimes this fails with "being used by another process" - heaven knows why; - // use a Sleep and a catch to make it more robust. - System.Threading.Thread.Sleep(3); - - try - { - Environment.CurrentDirectory = oldCurrentDirectory; - File.Delete(projectFile); - File.Delete(resultFile); - Directory.Delete(startDirectory); - } - catch (Exception ex) - { - Console.WriteLine(ex.ToString()); - } - } - } - } - - [TestFixture] - public class LoadAndSave - { - /// - /// Just load an MSBuild project by passing in a TextReader, and get back the contents to - /// make sure the project was read in correctly. - /// - /// RGoel - [Test] - public void LoadFromTextReader() - { - StringReader stringReader = new StringReader(ObjectModelHelpers.CleanupFileContents(@" - - - true - - - ")); - - Engine engine = new Engine(@"c:\"); - Project project = engine.CreateNewProject(); - project.Load(stringReader); - - ObjectModelHelpers.CompareProjectContents(project, @" - - - true - - - "); - } - - /// - /// Just load an MSBuild project with invalid XML by passing in a TextReader, and make sure - /// it throws an InvalidProjectFileException. - /// - /// RGoel - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void LoadFromTextReaderInvalidXml() - { - StringReader stringReader = new StringReader(ObjectModelHelpers.CleanupFileContents(@" - - - ")); - - Engine engine = new Engine(@"c:\"); - Project project = engine.CreateNewProject(); - project.Load(stringReader); - } - - /// - /// Just load an MSBuild project with invalid XML by passing in a TextReader, and make sure - /// it throws an InvalidProjectFileException. - /// - /// RGoel - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void LoadFromTextReaderInvalidProject() - { - StringReader stringReader = new StringReader(ObjectModelHelpers.CleanupFileContents(@" - - - ")); - - Engine engine = new Engine(@"c:\"); - Project project = engine.CreateNewProject(); - project.Load(stringReader); - } - - /// - /// Exercises the internal-only feature of being able to load a project from a XML document. - /// - /// RGoel - [Test] - public void LoadFromXmlDocument() - { - XmlDocument xmldoc = new XmlDocument(); - xmldoc.LoadXml(ObjectModelHelpers.CleanupFileContents(@" - - - true - - - ")); - - Engine engine = new Engine(@"c:\"); - Project project = engine.CreateNewProject(); - project.LoadFromXmlDocument(xmldoc, null, ProjectLoadSettings.None); - - ObjectModelHelpers.CompareProjectContents(project, @" - - - true - - - "); - } - - /// - /// Exercises the internal-only feature of being able to load a project from a XML document, - /// when the project file is invalid. - /// - /// RGoel - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void LoadFromXmlDocumentInvalidProject() - { - XmlDocument xmldoc = new XmlDocument(); - xmldoc.LoadXml(ObjectModelHelpers.CleanupFileContents(@" - - - ")); - - Engine engine = new Engine(@"c:\"); - Project project = engine.CreateNewProject(); - project.LoadFromXmlDocument(xmldoc, null, ProjectLoadSettings.None); - } - - /// - /// Exercises the internal-only feature of being able to load a project from a XML document, - /// when the project file is invalid. - /// - /// RGoel - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void LoadFromStringInvalidXml() - { - string projectContents = ObjectModelHelpers.CleanupFileContents(@" - - - "); - - Engine engine = new Engine(@"c:\"); - Project project = engine.CreateNewProject(); - project.LoadXml(projectContents); - } - - /// - /// Tests the 'load project ignoring imports' flag - /// - [Test] - public void LoadFromXmlDocumentIgnoringImports() - { - XmlDocument xmldoc = new XmlDocument(); - xmldoc.LoadXml(ObjectModelHelpers.CleanupFileContents(@" - - - - ")); - - Engine engine = new Engine(@"c:\"); - Project project = engine.CreateNewProject(); - project.LoadFromXmlDocument(xmldoc, null, ProjectLoadSettings.IgnoreMissingImports); - - Assert.AreEqual(1, project.Imports.Count); - } - - /// - /// Make sure missing imports throw for the standard load - /// - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void LoadFromXmlDocumentMissingImport() - { - XmlDocument xmldoc = new XmlDocument(); - xmldoc.LoadXml(ObjectModelHelpers.CleanupFileContents(@" - - - - ")); - - Engine engine = new Engine(@"c:\"); - Project project = engine.CreateNewProject(); - project.LoadFromXmlDocument(xmldoc, null, ProjectLoadSettings.None); - } - - [Test] - public void RemoveMissingImportAndLoadNormally() - { - XmlDocument xmldoc = new XmlDocument(); - xmldoc.LoadXml(ObjectModelHelpers.CleanupFileContents(@" - - - - ")); - - // Load the project ignoring missing imports - Engine engine = new Engine(@"c:\"); - Project project = engine.CreateNewProject(); - project.LoadFromXmlDocument(xmldoc, null, ProjectLoadSettings.IgnoreMissingImports); - Assert.AreEqual(1, project.Imports.Count); - - IEnumerator enumerator = project.Imports.GetEnumerator(); - enumerator.MoveNext(); - Import import = (Import) enumerator.Current; - - // Remove the import - project.Imports.RemoveImport(import); - Assert.AreEqual(0, project.Imports.Count); - - // Save the modified project - StringWriter writer = new StringWriter(); - project.Save(writer); - - // Load the modified project into a new project object - xmldoc = new XmlDocument(); - xmldoc.LoadXml(writer.ToString()); - - Project projectWithNoImport = engine.CreateNewProject(); - project.LoadFromXmlDocument(xmldoc, null, ProjectLoadSettings.None); - Assert.AreEqual(0, project.Imports.Count); - } - } - - [TestFixture] - public class Build - { - /// - /// Targets that fail should not produce target outputs (the list that comes back from project.build()) - /// (Note that they may change the items and properties that are visible in the project after a build is done, though.) - /// All this is Whidbey behavior. - /// - [Test] - public void FailingTargetsDoNotHaveOutputs() - { - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - - - - - - - - u - - - - - - "); - - Hashtable outputs = new Hashtable(); - bool result = p.Build(new string[] { "Build" }, outputs); - - Assertion.AssertEquals(false, result); - Assertion.AssertEquals(0, outputs.Count); - } - - /// - /// Checks to make sure that passing in the DoNotResetPreviouslyBuiltTargets flag - /// works as expected. - /// - /// JomoF - [Test] - public void CheckDoNotResetPreviouslyBuiltTargets() - { - // Create a temporary file. - string tempFile = Path.GetTempFileName(); - - // This project sets $(FileExists) to true if the file exists - Project p = ObjectModelHelpers.CreateInMemoryProject(String.Format(@" - - - - - - - - - - ", tempFile)); - - // Build first time with 'DoNotResetPreviouslyBuiltTargets' passed in. - p.Build(new string[]{"Build"}, null, BuildSettings.DoNotResetPreviouslyBuiltTargets); - - // At this point, the property $(FileExists) should be 'true' - Assertion.AssertEquals("true", p.GetEvaluatedProperty("FileExists")); - - // Delete the file - File.Delete(tempFile); - - // Build again. The result should still be 'true' because the target won't be reevaluated. - p.Build(new string[]{"Build"}, null, BuildSettings.DoNotResetPreviouslyBuiltTargets); - Assertion.AssertEquals("true", p.GetEvaluatedProperty("FileExists")); - - // Build a third time, but now don't pass the DoNotResetPreviouslyBuiltTargets flag. The target should - // be reevaluated and the result should be empty. - p.Build(new string[]{"Build"}, null, BuildSettings.None); - Assertion.AssertEquals(null, p.GetEvaluatedProperty("FileExists")); - } - - /// - /// Makes sure that after somebody requests a build of some targets in a project, the project - /// should always be in the "not reset" state. - /// - /// RGoel - [Test] - public void AllTargetsGetRebuiltAfterModificationToProject() - { - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - "); - - // Set some random property in the project to force it to be dirty. - p.SetProperty("Foo", "Bar", null); - - Assertion.Assert("Project should be dirty.", p.IsDirty); - - // Build the target. - p.Build("Build"); - - Assertion.Assert("Project should not be in the 'reset' state after a build", !p.IsReset); - } - } - - [TestFixture] - public class InitialTargets - { - /// - /// Simple case. Just make sure that the target specified in InitialTargets gets run. - /// - [Test] - public void RunInitialTargetsInMainProject() - { - MockLogger myLogger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - - - - - ", myLogger); - - // Build the target. - p.Build(null, null); - - Assertion.Assert("Build target should have been run.", myLogger.FullLog.Contains("BuildTargetExecuted")); - Assertion.Assert("CheckForErrors target should have been run.", myLogger.FullLog.Contains("CheckForErrorsTargetExecuted")); - } - - /// - /// Simple case. Just make sure that the target specified in InitialTargets gets run. - /// - [Test] - public void RunInitialTargetsInMainProjectWithMissingTargets() - { - MockLogger myLogger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(new Engine(), - @" - - - - - - - - - - ", myLogger, null, ProjectLoadSettings.IgnoreMissingImports); - - // Build the target. - p.Build(null, null); - - Assertion.Assert("Build target should have been run.", myLogger.FullLog.Contains("BuildTargetExecuted")); - Assertion.Assert("CheckForErrors target should have been run.", myLogger.FullLog.Contains("CheckForErrorsTargetExecuted")); - } - - /// - /// We have an "InitialTargets" attribute in the main project as well as two imported projects. Make sure we - /// run those initial targets in the correct expected order. - /// - /// RGoel - [Test] - public void RunInitialTargetsInMainAndImportedProjects() - { - Environment.SetEnvironmentVariable("MyNewChecks", "NewChecks"); - - string importedProject1 = ObjectModelHelpers.CreateTempFileOnDisk(@" - - - - - - - - - - - - - - "); - - string importedProject2 = ObjectModelHelpers.CreateTempFileOnDisk(@" - - - - - - - - - - - - - - "); - - try - { - Project p = ObjectModelHelpers.CreateInMemoryProject(String.Format(@" - - - - - - - - - - - - - - - - - - - - - - - - - - ", importedProject1, importedProject2)); - - Assertion.AssertEquals("Check all InitialTargets", "CheckForBadUser; CheckForBadProperties; CheckForBadConfigurations", - p.InitialTargets); - - // Build the default target. - p.Build(null, null); - - DumpBuildItemGroup(p.GetEvaluatedItemsByName("TargetOrder")); - - // The following method will ensure that the targets were executed in the correct order. - EngineHelpers.AssertItemsMatch(@" - CheckForBadUser_Executed - CheckForBadPlatforms_Executed - CheckForBadItems_Overridden_Executed - CheckForBadProperties_Executed - CheckForBadConfigurations_Executed - Build_Executed - ", - p.GetEvaluatedItemsByName("TargetOrder")); - - // Change the InitialTargets on the main project to be "NewChecks", but do it via an environment variable. - p.InitialTargets = "$(MyNewChecks)"; - - Assertion.AssertEquals("Check all InitialTargets", "NewChecks; CheckForBadProperties; CheckForBadConfigurations", - p.InitialTargets); - - // Build the default target. - p.Build(null, null); - - DumpBuildItemGroup(p.GetEvaluatedItemsByName("TargetOrder")); - - // The following method will ensure that the targets were executed in the correct order. - EngineHelpers.AssertItemsMatch(@" - NewChecks_Executed - CheckForBadPlatforms_Executed - CheckForBadItems_Overridden_Executed - CheckForBadProperties_Executed - CheckForBadConfigurations_Executed - Build_Executed - ", - p.GetEvaluatedItemsByName("TargetOrder")); - } - finally - { - File.Delete(importedProject1); - File.Delete(importedProject2); - } - } - - private static void DumpBuildItemGroup(BuildItemGroup itemGroup) - { - Console.WriteLine(itemGroup.Count); - foreach (BuildItem item in itemGroup) - { - Console.WriteLine(item.Name + " : " + item.FinalItemSpec); - } - } - - /// - /// Makes sure that after somebody requests a build of some targets in a project, the project - /// should always be in the "not reset" state. - /// - /// RGoel - [Test] - public void ModifyInitialTargetsInMainProject() - { - MockLogger myLogger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - - - - - ", myLogger); - - Assertion.AssertEquals("InitialTargets should be empty to start with.", String.Empty, p.InitialTargets); - p.InitialTargets = "CheckForErrors"; - Assertion.AssertEquals("InitialTargets should be set.", "CheckForErrors", p.InitialTargets); - - ObjectModelHelpers.CompareProjectContents(p, @" - - - - - - - - - - - "); - - // Build the default target. - p.Build(null, null); - - Assertion.Assert("Build target should have been run.", myLogger.FullLog.Contains("BuildTargetExecuted")); - Assertion.Assert("CheckForErrors target should have been run.", myLogger.FullLog.Contains("CheckForErrorsTargetExecuted")); - } - - } - - [TestFixture] - public class Miscellaneous - { - /// - /// Regression test for bug VSWhidbey 403429 - /// - /// danmose - [Test] - public void DocTypeInProject() - { - string original = @" - - - - - - "; - - Project project = ObjectModelHelpers.CreateInMemoryProject(original); - // Does not throw - } - - /// - /// Test the various encoding and writing methods. - /// - /// RGoel - [Test] - public void LoadAndSaveWithDifferentEncodings() - { - string file = Path.GetTempFileName(); - - string original = @" - - - - - - - - - - - - "; - - Project project = ObjectModelHelpers.CreateInMemoryProject(original); - - Engine engine = new Engine(); - engine.BinPath = @"c:\"; - - // Save and load using each encoding scheme. The ultimate result should be identity. - File.Delete(file); - project.Save(file, Encoding.Default); - project = new Project(engine); - project.Load(file); - string header = string.Format(@"", Encoding.Default.WebName); - ObjectModelHelpers.CompareProjectContents(project, header + original); - - File.Delete(file); - project.Save(file, Encoding.UTF8); - project.ParentEngine.UnloadProject(project); - project = new Project(engine); - project.Load(file); - ObjectModelHelpers.CompareProjectContents(project, @"" + original); - - File.Delete(file); - project.Save(file, Encoding.Unicode); - project.ParentEngine.UnloadProject(project); - project = new Project(engine); - project.Load(file); - ObjectModelHelpers.CompareProjectContents(project, @"" + original); - - // Save with current encoding. - File.Delete(file); - project.Save(file); - project.ParentEngine.UnloadProject(project); - project = new Project(engine); - project.Load(file); - ObjectModelHelpers.CompareProjectContents(project, @"" + original); - File.Delete(file); - - // Save to writer. - File.Delete(file); - using (StreamWriter writer = new StreamWriter(file)) - { - project.Save(writer); - } - project.ParentEngine.UnloadProject(project); - project = new Project(engine); - project.Load(file); - ObjectModelHelpers.CompareProjectContents(project, @"" + original); - File.Delete(file); - - // Verify the final encoding state is Utf-8. - Assertion.AssertEquals(Encoding.UTF8, project.Encoding); - } - - /// - /// Set and Get ProjectExtensions - /// - /// danmose - [Test] - public void SetGetProjectExtensions() - { - string original = @" - - - - "; - - Project project = ObjectModelHelpers.CreateInMemoryProject(original); - project.SetProjectExtensions("myID", ""); - project.SetProjectExtensions("myOtherID", ""); - Assertion.AssertEquals("", project.GetProjectExtensions("myID")); - Assertion.AssertEquals("", project.GetProjectExtensions("myNonexistent")); - } - - /// - /// There is a certain error that the MSBuild engine fires when you try to do a build on - /// a project that has had its targets disabled because of security. However, the project - /// system doesn't want to show this error to the user because it's not actionable for - /// the user. So it looks for code MSB4112 to throw away this error. Here we're just - /// to catch the case where somebody accidentally changes the error code for this error, - /// without realizing that somebody else has a dependency on it. - /// - /// RGoel - [Test] - public void VerifySecurityErrorHasCodeMSB4112() - { - ResourceManager resourceManager = new ResourceManager("Microsoft.Build.Engine.Resources.Strings", typeof(Project).Assembly); - string securityMessage = resourceManager.GetString("SecurityProjectBuildDisabled", CultureInfo.CurrentUICulture); - - Assertion.Assert( - "Security message about disabled targets need to have code MSB4112, because code in the VS Core project system depends on this. See DesignTimeBuildFeedback.cpp.", - securityMessage.Contains("MSB4112") - ); - } - - /// - /// Verify that warning & error tags at target level work correctly - /// - /// LukaszG - [Test] - public void WarningErrorTagsTargetLevel() - { - MockLogger logger = new MockLogger(); - Project project = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - ", logger); - - project.Build(null, null); - - Assertion.AssertEquals(1, logger.Warnings.Count); - BuildWarningEventArgs warning = logger.Warnings[0]; - - Assertion.AssertEquals("This is a scary warning message.", warning.Message); - Assertion.AssertEquals("MSB9999", warning.Code); - Assertion.AssertEquals("MSBuild.keyword", warning.HelpKeyword); - - Assertion.AssertEquals(1, logger.Errors.Count); - BuildErrorEventArgs error = logger.Errors[0]; - - Assertion.AssertEquals("A horrible error has occurred. Be very afraid.", error.Message); - Assertion.AssertEquals("MSB1111", error.Code); - Assertion.AssertEquals("MSBuild.otherkeyword", error.HelpKeyword); - } - - [Test] - public void TestLoadProjectDifferentGP() - { - MockLogger logger = new MockLogger(); - string path = ObjectModelHelpers.CreateTempFileOnDisk(@" - - - - - - - "); - - Engine engine = new Engine(); - - Project project = engine.CreateNewProject(); - - project.Load(path); - - project.GlobalProperties.SetProperty("a", "b"); - engine.BuildProjectFile(path); - } - - [Test] - public void ICollectionMethodsOnItemPropertyGroupCollection() - { - Engine engine = new Engine(@"C:\"); - Project project = new Project(engine); - BuildPropertyGroup pg1 = project.AddNewPropertyGroup(true); - BuildPropertyGroup pg2 = project.AddNewPropertyGroup(true); - BuildItemGroup ig1 = project.AddNewItemGroup(); - BuildItemGroup ig2 = project.AddNewItemGroup(); - - BuildPropertyGroup[] pgarray = new BuildPropertyGroup[2]; - BuildItemGroup[] igarray = new BuildItemGroup[2]; - - project.PropertyGroups.CopyTo(pgarray, 0); - project.ItemGroups.CopyTo(igarray, 0); - - Assertion.Assert(pgarray[0] == pg1 || pgarray[1] == pg1); - Assertion.Assert(pgarray[0] == pg2 || pgarray[1] == pg2); - - Assertion.Assert(igarray[0] == ig1 || igarray[1] == ig1); - Assertion.Assert(igarray[0] == ig2 || igarray[1] == ig2); - } - - [Test] - public void RegressVsWhidbey579075() - { - MockProjectStartedLogger logger = new MockProjectStartedLogger(); - Project project = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - ", logger); - - // Set a property and force project evaluation - project.SetProperty("Configuration", "Release"); - BuildPropertyGroup evaluatedProperties = project.EvaluatedProperties; - - // Set a different value of the property and build without forced reevaluation, - // check if the new value is passed to the logger - project.SetProperty("Configuration", "Debug"); - project.Build(); - Assertion.AssertEquals("Debug", logger.ProjectStartedProperties["Configuration"]); - } - } - - [TestFixture] - public class ToolsVersion - { - [Test] - public void VersionBasedMSBuildBinPathDefault() - { - Engine e = new Engine("www.msbuild.org"); - Project project = ObjectModelHelpers.CreateInMemoryProject(e, @" - - - ", null); - - Assertion.AssertEquals("Nonexistent ToolsVersion should evaluate to the default version", - Constants.defaultToolsVersion, project.ToolsVersion); - - Assertion.AssertEquals("Nonexistent ToolsVersion should mean ToolsVersionAttribute is the default version", - Constants.defaultToolsVersion, project.DefaultToolsVersion); - - Assertion.AssertEquals("BinPath is the MSBuildBinPath for the default version", - "www.msbuild.org", project.EvaluatedProperties[ReservedPropertyNames.binPath].FinalValue); - - Assertion.AssertEquals("BinPath is the MSBuildToolsPath for the default version", - "www.msbuild.org", project.EvaluatedProperties[ReservedPropertyNames.toolsPath].FinalValue); - } - - [Test] - public void VersionBasedMSBuildBinPathExplicit() - { - Engine e = new Engine("www.msbuild.org"); - e.AddToolset(new Toolset("myValidToolsVersion", "myValidToolsVersion's path")); - - Project project = ObjectModelHelpers.CreateInMemoryProject(e, @" - - - ", null); - - Assertion.AssertEquals("ToolsVersion should have been picked up from the project attribute", - "myValidToolsVersion", project.ToolsVersion); - - Assertion.AssertEquals("ToolsVersionAttribute should have been picked up from the project attribute", - "myValidToolsVersion", project.DefaultToolsVersion); - - Assertion.AssertEquals("BinPath is the MSBuildBinPath for the default version", - "myValidToolsVersion's path", project.EvaluatedProperties[ReservedPropertyNames.binPath].FinalValue); - - Assertion.AssertEquals("BinPath is the MSBuildToolsPath for the default version", - "myValidToolsVersion's path", project.EvaluatedProperties[ReservedPropertyNames.toolsPath].FinalValue); - } - - [Test] - public void ChangingToolsVersion() - { - Engine e = new Engine("www.msbuild.org"); - e.AddToolset(new Toolset("myValidToolsVersion", "myValidToolsVersion's path")); - - Project project = ObjectModelHelpers.CreateInMemoryProject(e, @" - - - ", null); - - Assertion.AssertEquals("Nonexistent ToolsVersion should evaluate to the default version", - Constants.defaultToolsVersion, project.ToolsVersion); - - Assertion.AssertEquals("BinPath is the MSBuildBinPath for the default version", - "www.msbuild.org", project.EvaluatedProperties[ReservedPropertyNames.binPath].FinalValue); - - Assertion.AssertEquals("BinPath is the MSBuildToolsPath for the default version", - "www.msbuild.org", project.EvaluatedProperties[ReservedPropertyNames.toolsPath].FinalValue); - - project.DefaultToolsVersion = "myValidToolsVersion"; - - Assertion.AssertEquals("ToolsVersion should have been changed by the project attribute (because it wasn't overridden)", - "myValidToolsVersion", project.ToolsVersion); - - Assertion.AssertEquals("ToolsVersionAttribute should have been picked up from the project attribute", - "myValidToolsVersion", project.DefaultToolsVersion); - - Assertion.AssertEquals("OverridingToolsVersion should be false", - false, project.OverridingToolsVersion); - - Assertion.AssertEquals("BinPath is the MSBuildBinPath for the default version", - "myValidToolsVersion's path", project.EvaluatedProperties[ReservedPropertyNames.binPath].FinalValue); - - Assertion.AssertEquals("BinPath is the MSBuildToolsPath for the default version", - "myValidToolsVersion's path", project.EvaluatedProperties[ReservedPropertyNames.toolsPath].FinalValue); - } - - /// - /// It's okay to change DefaultToolsVersion to some apparently bogus value -- the project can be persisted - /// that way, and maybe later it'll correspond to some known toolset. If the effective ToolsVersion was being - /// gotten from the attribute, that'll be affected too; and thus might be bogus. - /// - [Test] - public void ChangingToolsVersionAttributeToUnrecognizedValue() - { - Engine e = new Engine("www.msbuild.org"); - e.AddToolset(new Toolset("myValidToolsVersion", "myValidToolsVersion's path")); - - Project project = ObjectModelHelpers.CreateInMemoryProject(e, @" - - - ", null); - - Assertion.AssertEquals("We should have toolsVersion equal to myValidToolsVersion", - "myValidToolsVersion", project.DefaultToolsVersion); - - // Build should succeed at this point - Assertion.Assert(project.Build()); - - project.DefaultToolsVersion = "UnknownToolsVersion"; - - // When an unknown toolsversion is used, MSBuild treats it as TV4.0. - Assertion.AssertEquals("Because a bogus ToolsVersion was set, the ToolsVersion gets treated as v4.0", "4.0", project.ToolsVersion); - - Assertion.AssertEquals("ToolsVersionAttribute has the new value", "4.0", project.DefaultToolsVersion); - - // It's a valid ToolsVersion, so the build should succeed - Assertion.Assert(project.Build()); - } - - /// - /// If project has not loaded from XML, it should have the default tools version - /// - [Test] - public void EmptyProjectCreatedViaOMHasDefaultToolsVersion() - { - Engine e = new Engine("www.msbuild.org"); - Project p = new Project(e); - // Don't load any project here - Assertion.AssertEquals(Constants.defaultToolsVersion, p.ToolsVersion); - } - - [Test] - public void ToolsVersionAttributeConstructor() - { - Engine e = new Engine("www.msbuild.org"); - e.AddToolset(new Toolset("myValidToolsVersion", "myValidToolsVersion's path")); - e.AddToolset(new Toolset("myOtherToolsVersion", "myOtherToolsVersion's path")); - - Project project = ObjectModelHelpers.CreateInMemoryProject(e, @" - - - ", null, "myValidToolsVersion"); - - Assertion.AssertEquals("We should have Override equal to true", - true, project.OverridingToolsVersion); - Assertion.AssertEquals("We should have ToolsVersion equal to myValidToolsVersion", - "myValidToolsVersion", project.ToolsVersion); - Assertion.AssertEquals("We should have ToolsVersionAttribute equal to myOtherToolsVersion", - "myOtherToolsVersion", project.DefaultToolsVersion); - } - - // Regular case of setting DefaultToolsVersion - [Test] - public void SettingToolsVersionAttribute() - { - Engine e = new Engine("www.msbuild.org"); - e.AddToolset(new Toolset("myValidToolsVersion", "myValidToolsVersion's path")); - - Project project = ObjectModelHelpers.CreateInMemoryProject(e, @" - - - ", null); - - project.DefaultToolsVersion = "myValidToolsVersion"; - - Assertion.AssertEquals("We should have Override equal to false", - false, project.OverridingToolsVersion); - Assertion.AssertEquals("We should have ToolsVersion equal to myValidToolsVersion", - "myValidToolsVersion", project.ToolsVersion); - Assertion.AssertEquals("We should have ToolsVersionAttribute equal to myValidToolsVersion", - "myValidToolsVersion", project.DefaultToolsVersion); - } - - // Setting DefaultToolsVersion should not modify ToolsVersion if it was an override value - [Test] - public void SettingToolsVersionAttributeAfterToolsVersionSetInProjectConstructor() - { - Engine e = new Engine("www.msbuild.org"); - e.AddToolset(new Toolset("myValidToolsVersion", "myValidToolsVersion's path")); - e.AddToolset(new Toolset("myOtherToolsVersion", "myOtherToolsVersion's path")); - - Project project = ObjectModelHelpers.CreateInMemoryProject(e, @" - - - ", null, "myValidToolsVersion"); - - project.DefaultToolsVersion = "myOtherToolsVersion"; - - Assertion.AssertEquals("We should have Override equal to true", - true, project.OverridingToolsVersion); - Assertion.AssertEquals("We should have ToolsVersion equal to myOtherToolsVersion", - "myValidToolsVersion", project.ToolsVersion); - Assertion.AssertEquals("We should have ToolsVersionAttribute equal to myOtherToolsVersion", - "myOtherToolsVersion", project.DefaultToolsVersion); - } - - [Test] - public void MSBuildToolsVersionProperty() - { - Engine e = new Engine("www.msbuild.org"); - e.AddToolset(new Toolset("myValidToolsVersion", "myValidToolsVersion's path")); - - MockLogger logger = new MockLogger(); - - Project project = ObjectModelHelpers.CreateInMemoryProject(e, ObjectModelHelpers.CleanupFileContents(@" - - - - - - "), logger); - - project.Build(); - - logger.AssertLogContains("##2.0##"); - } - - [Test] - public void MSBuildToolsVersionProperty2() - { - Engine e = new Engine("www.msbuild.org"); - e.AddToolset(new Toolset("myValidToolsVersion", "myValidToolsVersion's path")); - - MockLogger logger = new MockLogger(); - - Project project = ObjectModelHelpers.CreateInMemoryProject(e, ObjectModelHelpers.CleanupFileContents(@" - - - - - - "), logger); - project.DefaultToolsVersion = "myValidToolsVersion"; - - project.Build(); - - logger.AssertLogContains("##myValidToolsVersion##"); - } - - [Test] - public void SetEffectiveToolsVersionAttribute() - { - Engine e = new Engine("www.msbuild.org"); - e.AddToolset(new Toolset("myValidToolsVersion", "myValidToolsVersion's path")); - e.AddToolset(new Toolset("myOtherToolsVersion", "myOtherToolsVersion's path")); - - MockLogger logger = new MockLogger(); - - Project project = ObjectModelHelpers.CreateInMemoryProject(e, ObjectModelHelpers.CleanupFileContents(@" - - - - $(MSBuildToolsVersion) - - - - - "), logger, "myValidToolsVersion"); - - project.ToolsVersion = "myOtherToolsVersion"; - - project.Build(); - - Assertion.Assert("We should be using a ToolsVersion override", project.OverridingToolsVersion); - Assertion.AssertEquals("We should have ToolsVersion equal to myOtherToolsVersion", - "myOtherToolsVersion", project.ToolsVersion); - Assertion.AssertEquals("We should have ToolsVersionAttribute equal to myValidToolsVersion", - "myValidToolsVersion", project.DefaultToolsVersion); - logger.AssertLogContains("### myOtherToolsVersion ###"); - } - - - [Test] - public void PropertiesFromToolsetAppliedToProjectWhenToolsVersionSet() - { - Engine e = new Engine("www.msbuild.org"); - BuildPropertyGroup properties1 = new BuildPropertyGroup(); - properties1.SetProperty("foo1", "bar1"); - properties1.SetProperty("foo2", "bar2"); - BuildPropertyGroup properties2 = new BuildPropertyGroup(); - properties2.SetProperty("foo3", "bar3"); - properties2.SetProperty("foo1", "bar4"); - e.AddToolset(new Toolset("myValidToolsVersion", "myValidToolsVersion's path", properties1)); - e.AddToolset(new Toolset("myOtherToolsVersion", "myOtherToolsVersion's path", properties2)); - - MockLogger logger = new MockLogger(); - - Project project = ObjectModelHelpers.CreateInMemoryProject(e, @" - ", logger); - - Assertion.AssertEquals("bar1", project.EvaluatedProperties["foo1"].Value); - Assertion.AssertEquals("bar2", project.EvaluatedProperties["foo2"].Value); - Assertion.AssertEquals(null, project.EvaluatedProperties["foo3"]); - - // Now update tools version: should grab properties from the new toolset - project.ToolsVersion = "myOtherToolsVersion"; - - Assertion.AssertEquals("bar4", project.EvaluatedProperties["foo1"].Value); // Updated - Assertion.AssertEquals(null, project.EvaluatedProperties["foo2"]); // Reset - Assertion.AssertEquals("bar3", project.EvaluatedProperties["foo3"].Value); // New - } - - [Test] - public void PropertiesFromToolsetAppliedToProjectWhenToolsVersionOverridden() - { - Engine e = new Engine("www.msbuild.org"); - BuildPropertyGroup properties1 = new BuildPropertyGroup(); - properties1.SetProperty("foo1", "bar1"); - properties1.SetProperty("foo2", "bar2"); - BuildPropertyGroup properties2 = new BuildPropertyGroup(); - properties2.SetProperty("foo3", "bar3"); - properties2.SetProperty("foo1", "bar4"); - e.AddToolset(new Toolset("myValidToolsVersion", "myValidToolsVersion's path", properties1)); - e.AddToolset(new Toolset("myOtherToolsVersion", "myOtherToolsVersion's path", properties2)); - - MockLogger logger = new MockLogger(); - - Project project = ObjectModelHelpers.CreateInMemoryProject(e, @" - ", logger, "myOtherToolsVersion"); - - Assertion.AssertEquals("bar4", project.EvaluatedProperties["foo1"].Value); // Updated - Assertion.AssertEquals(null, project.EvaluatedProperties["foo2"]); // Reset - Assertion.AssertEquals("bar3", project.EvaluatedProperties["foo3"].Value); // New - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/PropertyGroup_Tests.cs b/src/Deprecated/Engine.UnitTests/PropertyGroup_Tests.cs deleted file mode 100644 index e843e109e04..00000000000 --- a/src/Deprecated/Engine.UnitTests/PropertyGroup_Tests.cs +++ /dev/null @@ -1,615 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - - using System; - using System.Collections; - - using NUnit.Framework; - using System.IO; - - using Microsoft.Build.BuildEngine; - using System.Threading; - using System.Reflection; - - namespace Microsoft.Build.UnitTests - { - [TestFixture] - public class PropertyGroupTests - { - /// - /// - /// SumedhK - [Test] - public void ImportOutputProperties() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - pg.SetProperty("foo", "fooval"); - pg.SetProperty(new BuildProperty("bar", "barval", PropertyType.EnvironmentProperty)); - pg.SetProperty(new BuildProperty("baz", "bazval", PropertyType.GlobalProperty)); - pg.SetProperty(new BuildProperty("caz", "cazval", PropertyType.ImportedProperty)); - pg.SetProperty(new BuildProperty("barb", "barbval", PropertyType.OutputProperty)); - - BuildPropertyGroup pgo = new BuildPropertyGroup(); - pgo.SetProperty(new BuildProperty("foo", "fooout", PropertyType.OutputProperty)); - pgo.SetProperty(new BuildProperty("bar", "barout", PropertyType.OutputProperty)); - pgo.SetProperty(new BuildProperty("baz", "bazout", PropertyType.OutputProperty)); - pgo.SetProperty(new BuildProperty("caz", "cazout", PropertyType.OutputProperty)); - pgo.SetProperty(new BuildProperty("barb", "barbout", PropertyType.OutputProperty)); - pgo.SetProperty(new BuildProperty("gaz", "gazout", PropertyType.OutputProperty)); - - pg.ImportProperties(pgo); - - Assertion.AssertEquals(6, pg.Count); - Assertion.AssertEquals("fooout", pg["foo"].FinalValueEscaped); - Assertion.AssertEquals("barout", pg["bar"].FinalValueEscaped); - Assertion.AssertEquals("bazout", pg["baz"].FinalValueEscaped); - Assertion.AssertEquals("cazout", pg["caz"].FinalValueEscaped); - Assertion.AssertEquals("barbout", pg["barb"].FinalValueEscaped); - Assertion.AssertEquals("gazout", pg["gaz"].FinalValueEscaped); - - pg.SetProperty(new BuildProperty("foo", "fooout2", PropertyType.OutputProperty)); - pg.SetProperty(new BuildProperty("gaz", "gazout2", PropertyType.OutputProperty)); - - Assertion.AssertEquals("fooout2", pg["foo"].FinalValueEscaped); - Assertion.AssertEquals("gazout2", pg["gaz"].FinalValueEscaped); - - pg.RemoveProperty("baz"); - pg.RevertAllOutputProperties(); - - Assertion.AssertEquals(3, pg.Count); - Assertion.AssertEquals("fooval", pg["foo"].FinalValueEscaped); - Assertion.AssertEquals("barval", pg["bar"].FinalValueEscaped); - Assertion.AssertNull(pg["baz"]); - Assertion.AssertEquals("cazval", pg["caz"].FinalValueEscaped); - Assertion.AssertNull(pg["barb"]); - } - - /// - /// - /// SumedhK - [Test] - public void ClonePropertyGroup() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - pg.SetProperty("foo", "fooval"); - pg.SetProperty(new BuildProperty("bar", "barval", PropertyType.EnvironmentProperty)); - pg.SetProperty(new BuildProperty("baz", "bazval", PropertyType.GlobalProperty)); - pg.SetProperty(new BuildProperty("caz", "cazval", PropertyType.ImportedProperty)); - pg.SetProperty(new BuildProperty("barb", "barbval", PropertyType.OutputProperty)); - - pg.SetProperty(new BuildProperty("foo", "fooout", PropertyType.OutputProperty)); - pg.SetProperty(new BuildProperty("barb", "barbout", PropertyType.OutputProperty)); - pg.SetProperty(new BuildProperty("gaz", "gazout", PropertyType.OutputProperty)); - pg.SetProperty(new BuildProperty("foo", "fooout2", PropertyType.OutputProperty)); - - BuildPropertyGroup pgsc = pg.Clone(false /* shallow clone */); - BuildPropertyGroup pgdc = pg.Clone(true /* deep clone */); - - Assertion.AssertEquals(6, pg.Count); - Assertion.AssertEquals("fooout2", pg["foo"].FinalValueEscaped); - Assertion.AssertEquals("barval", pg["bar"].FinalValueEscaped); - Assertion.AssertEquals("bazval", pg["baz"].FinalValueEscaped); - Assertion.AssertEquals("cazval", pg["caz"].FinalValueEscaped); - Assertion.AssertEquals("barbout", pg["barb"].FinalValueEscaped); - Assertion.AssertEquals("gazout", pg["gaz"].FinalValueEscaped); - - Assertion.AssertEquals(6, pgsc.Count); - Assertion.AssertEquals("fooout2", pgsc["foo"].FinalValueEscaped); - Assertion.AssertEquals("barval", pgsc["bar"].FinalValueEscaped); - Assertion.AssertEquals("bazval", pgsc["baz"].FinalValueEscaped); - Assertion.AssertEquals("cazval", pgsc["caz"].FinalValueEscaped); - Assertion.AssertEquals("barbout", pgsc["barb"].FinalValueEscaped); - Assertion.AssertEquals("gazout", pgsc["gaz"].FinalValueEscaped); - - Assertion.AssertEquals(6, pgdc.Count); - Assertion.AssertEquals("fooout2", pgdc["foo"].FinalValueEscaped); - Assertion.AssertEquals("barval", pgdc["bar"].FinalValueEscaped); - Assertion.AssertEquals("bazval", pgdc["baz"].FinalValueEscaped); - Assertion.AssertEquals("cazval", pgdc["caz"].FinalValueEscaped); - Assertion.AssertEquals("barbout", pgdc["barb"].FinalValueEscaped); - Assertion.AssertEquals("gazout", pgdc["gaz"].FinalValueEscaped); - - pg.RevertAllOutputProperties(); - - Assertion.AssertEquals(4, pg.Count); - Assertion.AssertEquals("fooval", pg["foo"].FinalValueEscaped); - Assertion.AssertEquals("barval", pg["bar"].FinalValueEscaped); - Assertion.AssertEquals("bazval", pg["baz"].FinalValueEscaped); - Assertion.AssertEquals("cazval", pg["caz"].FinalValueEscaped); - Assertion.AssertNull(pg["barb"]); - Assertion.AssertNull(pg["gaz"]); - - Assertion.AssertEquals(6, pgsc.Count); - Assertion.AssertEquals("fooout2", pgsc["foo"].FinalValueEscaped); - Assertion.AssertEquals("barval", pgsc["bar"].FinalValueEscaped); - Assertion.AssertEquals("bazval", pgsc["baz"].FinalValueEscaped); - Assertion.AssertEquals("cazval", pgsc["caz"].FinalValueEscaped); - Assertion.AssertEquals("barbout", pgsc["barb"].FinalValueEscaped); - Assertion.AssertEquals("gazout", pgsc["gaz"].FinalValueEscaped); - - Assertion.AssertEquals(6, pgdc.Count); - Assertion.AssertEquals("fooout2", pgdc["foo"].FinalValueEscaped); - Assertion.AssertEquals("barval", pgdc["bar"].FinalValueEscaped); - Assertion.AssertEquals("bazval", pgdc["baz"].FinalValueEscaped); - Assertion.AssertEquals("cazval", pgdc["caz"].FinalValueEscaped); - Assertion.AssertEquals("barbout", pgdc["barb"].FinalValueEscaped); - Assertion.AssertEquals("gazout", pgdc["gaz"].FinalValueEscaped); - - pgsc.RevertAllOutputProperties(); - - Assertion.AssertEquals(4, pg.Count); - Assertion.AssertEquals("fooval", pg["foo"].FinalValueEscaped); - Assertion.AssertEquals("barval", pg["bar"].FinalValueEscaped); - Assertion.AssertEquals("bazval", pg["baz"].FinalValueEscaped); - Assertion.AssertEquals("cazval", pg["caz"].FinalValueEscaped); - Assertion.AssertNull(pg["barb"]); - Assertion.AssertNull(pg["gaz"]); - - Assertion.AssertEquals(4, pgsc.Count); - Assertion.AssertEquals("fooval", pgsc["foo"].FinalValueEscaped); - Assertion.AssertEquals("barval", pgsc["bar"].FinalValueEscaped); - Assertion.AssertEquals("bazval", pgsc["baz"].FinalValueEscaped); - Assertion.AssertEquals("cazval", pgsc["caz"].FinalValueEscaped); - Assertion.AssertNull(pgsc["barb"]); - Assertion.AssertNull(pgsc["gaz"]); - - Assertion.AssertEquals(6, pgdc.Count); - Assertion.AssertEquals("fooout2", pgdc["foo"].FinalValueEscaped); - Assertion.AssertEquals("barval", pgdc["bar"].FinalValueEscaped); - Assertion.AssertEquals("bazval", pgdc["baz"].FinalValueEscaped); - Assertion.AssertEquals("cazval", pgdc["caz"].FinalValueEscaped); - Assertion.AssertEquals("barbout", pgdc["barb"].FinalValueEscaped); - Assertion.AssertEquals("gazout", pgdc["gaz"].FinalValueEscaped); - - pgdc.RevertAllOutputProperties(); - - Assertion.AssertEquals(4, pg.Count); - Assertion.AssertEquals("fooval", pg["foo"].FinalValueEscaped); - Assertion.AssertEquals("barval", pg["bar"].FinalValueEscaped); - Assertion.AssertEquals("bazval", pg["baz"].FinalValueEscaped); - Assertion.AssertEquals("cazval", pg["caz"].FinalValueEscaped); - Assertion.AssertNull(pg["barb"]); - Assertion.AssertNull(pg["gaz"]); - - Assertion.AssertEquals(4, pgsc.Count); - Assertion.AssertEquals("fooval", pgsc["foo"].FinalValueEscaped); - Assertion.AssertEquals("barval", pgsc["bar"].FinalValueEscaped); - Assertion.AssertEquals("bazval", pgsc["baz"].FinalValueEscaped); - Assertion.AssertEquals("cazval", pgsc["caz"].FinalValueEscaped); - Assertion.AssertNull(pgsc["barb"]); - Assertion.AssertNull(pgsc["gaz"]); - - Assertion.AssertEquals(4, pgdc.Count); - Assertion.AssertEquals("fooval", pgdc["foo"].FinalValueEscaped); - Assertion.AssertEquals("barval", pgdc["bar"].FinalValueEscaped); - Assertion.AssertEquals("bazval", pgdc["baz"].FinalValueEscaped); - Assertion.AssertEquals("cazval", pgdc["caz"].FinalValueEscaped); - Assertion.AssertNull(pgdc["barb"]); - Assertion.AssertNull(pgdc["gaz"]); - } - - /// - /// Tests the IsEquivalent method on BuildPropertyGroup, when the two PGs have a - /// different number of properties. - /// - /// RGoel - [Test] - public void PropertyGroupIsEquivalent_DifferentCount() - { - BuildPropertyGroup pg1 = new BuildPropertyGroup(); - BuildPropertyGroup pg2 = new BuildPropertyGroup(); - - pg1.SetProperty("Elmo", "Red"); - pg1.SetProperty("BigBird", "Yellow"); - pg1.SetProperty("OscartheGrouch", "Green"); - - pg2.SetProperty("Elmo", "Red"); - pg2.SetProperty("BigBird", "Yellow"); - - // The two property bags are not equivalent. - Assertion.Assert(!pg1.IsEquivalent(pg2)); - } - - /// - /// Tests the IsEquivalent method on BuildPropertyGroup, when the two PGs have differing - /// cases on the property names. - /// - /// RGoel - [Test] - public void PropertyGroupIsEquivalent_DifferentCaseOnName() - { - BuildPropertyGroup pg1 = new BuildPropertyGroup(); - BuildPropertyGroup pg2 = new BuildPropertyGroup(); - - pg1.SetProperty("oscarthegrouch", "Green"); - pg1.SetProperty("bigbird", "Yellow"); - pg1.SetProperty("elmo", "Red"); - - pg2.SetProperty("Elmo", "Red"); - pg2.SetProperty("BigBird", "Yellow"); - pg2.SetProperty("OscartheGrouch", "Green"); - - // The two property bags are not equivalent. - Assertion.Assert(pg1.IsEquivalent(pg2)); - } - - /// - /// Tests the IsEquivalent method on BuildPropertyGroup, when the two PGs have differing - /// cases on the property values. - /// - /// RGoel - [Test] - public void PropertyGroupIsEquivalent_DifferentCaseOnValue() - { - BuildPropertyGroup pg1 = new BuildPropertyGroup(); - BuildPropertyGroup pg2 = new BuildPropertyGroup(); - - pg1.SetProperty("Elmo", "Red"); - pg1.SetProperty("BigBird", "Yellow"); - pg1.SetProperty("OscartheGrouch", "green"); - - pg2.SetProperty("Elmo", "Red"); - pg2.SetProperty("BigBird", "Yellow"); - pg2.SetProperty("OscartheGrouch", "Green"); - - // The two property bags are not equivalent. - Assertion.Assert(!pg1.IsEquivalent(pg2)); - } - - /// - /// Tests the IsEquivalent method on BuildPropertyGroup, when one of the PGs has a blank - /// property value. - /// - /// RGoel - [Test] - public void PropertyGroupIsEquivalent_BlankPropertyValue() - { - BuildPropertyGroup pg1 = new BuildPropertyGroup(); - BuildPropertyGroup pg2 = new BuildPropertyGroup(); - - pg1.SetProperty("Elmo", "Red"); - pg1.SetProperty("BigBird", "Yellow"); - pg1.SetProperty("OscartheGrouch", "Green"); - - pg2.SetProperty("Elmo", "Red"); - pg2.SetProperty("BigBird", ""); - pg2.SetProperty("OscartheGrouch", "Green"); - - // The two property bags are not equivalent. - Assertion.Assert(!pg1.IsEquivalent(pg2)); - } - - /// - /// Test that the ImportInitialProperties method imports the properties from the given - /// BuildPropertyGroup instances in the correct order. - /// - [Test] - public void ImportInitialPropertiesHasCorrectPrecedence() - { - BuildPropertyGroup environmentProperties = new BuildPropertyGroup(); - environmentProperties.SetProperty("Property1", "Value1"); - environmentProperties.SetProperty("Property2", "Value2"); - environmentProperties.SetProperty("Property3", "Value3"); - environmentProperties.SetProperty("Property4", "Value4"); - BuildPropertyGroup reservedProperties = new BuildPropertyGroup(); - reservedProperties.SetProperty("Property2", "Value5"); - reservedProperties.SetProperty("Property3", "Value6"); - reservedProperties.SetProperty("Property4", "Value7"); - BuildPropertyGroup toolsVersionDependentProperties = new BuildPropertyGroup(); - toolsVersionDependentProperties.SetProperty("Property3", "Value8"); - toolsVersionDependentProperties.SetProperty("Property4", "Value9"); - BuildPropertyGroup globalProperties = new BuildPropertyGroup(); - globalProperties.SetProperty("Property4", "Value10"); - - BuildPropertyGroup evaluatedProperties = new BuildPropertyGroup(); - evaluatedProperties.ImportInitialProperties(environmentProperties, reservedProperties, toolsVersionDependentProperties, globalProperties); - - Assertion.AssertEquals("Value10", evaluatedProperties["Property4"].Value); - Assertion.AssertEquals("Value8", evaluatedProperties["Property3"].Value); - Assertion.AssertEquals("Value5", evaluatedProperties["Property2"].Value); - Assertion.AssertEquals("Value1", evaluatedProperties["Property1"].Value); - } - - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void ItemGroupInAPropertyGroupCondition() - { - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - - - @(x) - - - - - - - - - "); - - p.Build(new string[] { "t" }, null); - } - - [Test] - public void RemoveProperty() - { - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - 123 - 456 - - - - 789 - - - - - "); - - BuildPropertyGroup[] propertyGroups = new BuildPropertyGroup[2]; - p.PropertyGroups.CopyTo(propertyGroups, 0); - - BuildPropertyGroup first = propertyGroups[0].Count == 2 ? propertyGroups[0] : propertyGroups[1]; - BuildPropertyGroup second = propertyGroups[1].Count == 1 ? propertyGroups[1] : propertyGroups[0]; - - BuildProperty property = null; - foreach (BuildProperty tempProperty in first) - { - if (tempProperty.Name.Equals("a", StringComparison.OrdinalIgnoreCase)) - { - property = tempProperty; - break; - } - } - - first.RemoveProperty(property); - - Assertion.AssertEquals("First property group should now only have 1 property.", 1, first.Count); - Assertion.AssertEquals("Second property group should still have 1 property.", 1, second.Count); - - Assertion.Assert("Project xml should not have a definition for property 'a'.", !p.Xml.Contains(@"")); - } - - [Test] - [ExpectedException(typeof(InvalidOperationException))] - public void RemovePropertyFromPropertyGroupThatIsntItsParent() - { - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - 123 - 456 -
- - - 789 - - -
- - "); - - BuildPropertyGroup[] propertyGroups = new BuildPropertyGroup[2]; - p.PropertyGroups.CopyTo(propertyGroups, 0); - - BuildPropertyGroup first = propertyGroups[0].Count == 2 ? propertyGroups[0] : propertyGroups[1]; - BuildPropertyGroup second = propertyGroups[1].Count == 1 ? propertyGroups[1] : propertyGroups[0]; - - BuildProperty property = null; - foreach (BuildProperty tempProperty in first) - { - if (tempProperty.Name.Equals("a", StringComparison.OrdinalIgnoreCase)) - { - property = tempProperty; - break; - } - } - - //this should throw because the property comes from another property group - second.RemoveProperty(property); - } - - [Test] - public void SetGlobalPropertyAfterLoadBeforeBuild() - { - MockLogger logger = new MockLogger(); - - Project project = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - ", logger); - - BuildPropertyGroup globals = project.GlobalProperties; - - // Set a property before building -- this should work - BuildProperty p = new BuildProperty("p", "v1"); - globals.SetProperty(p); - - project.Build(); - - logger.AssertLogContains("[v1]"); - } - - [Test] - [ExpectedException(typeof(InvalidOperationException))] - public void SetGlobalPropertyToDifferentValueDuringBuild() - { - SetPropertyDuringBuild("v1", "v2"); - } - - [Test] - public void SetGlobalPropertyDuringBuildToValueItAlreadyHas() - { - MockLogger logger = SetPropertyDuringBuild("v1", "v1"); - logger.AssertLogContains("[v1]"); - } - - private MockLogger SetPropertyDuringBuild(string initialValue, string newValue) - { - Thread t = null; - MockLogger logger = new MockLogger(); - - try - { - Project project = ObjectModelHelpers.CreateInMemoryProject(String.Format(@" - - - - - - - - - - ", new Uri(Assembly.GetExecutingAssembly().EscapedCodeBase).LocalPath), logger); - - BuildPropertyGroup globals = project.GlobalProperties; - Console.WriteLine("Setting property to " + initialValue); - globals.SetProperty("p", initialValue); - - // Set a property during build -- this should fail - t = new Thread(BuildSuppliedProject); - t.Start(project); - - // Wait for the build to get going - while (!WaitForSignal.ReadyForSignal) - { - Thread.Sleep(50); - } - - // Now set a property - Console.WriteLine("Setting property to " + newValue); - globals.SetProperty("p", newValue); - } - finally - { - if (t != null) - { - // Clean up the thread, if necessary - while (!WaitForSignal.ReadyForSignal) - { - Thread.Sleep(50); - } - WaitForSignal.Signal(); - t.Join(); - } - } - - return logger; - } - - private void BuildSuppliedProject(Object o) - { - Project project = (Project) o; - project.Build(); - } - - [Test] - public void PropertyGroupCustomSerialization() - { - BuildPropertyGroup pg = new BuildPropertyGroup(); - pg.SetProperty(new BuildProperty("bar", "barval", PropertyType.EnvironmentProperty)); - pg.SetProperty(new BuildProperty("baz", "bazval", PropertyType.GlobalProperty)); - pg.SetProperty(new BuildProperty("caz", "cazval", PropertyType.ImportedProperty)); - pg.SetProperty(new BuildProperty("barb", "barbout", PropertyType.OutputProperty)); - pg.SetProperty(new BuildProperty("gaz", "gazout", PropertyType.OutputProperty)); - pg.SetProperty(new BuildProperty("foo", "fooout2", PropertyType.OutputProperty)); - - MemoryStream stream = new MemoryStream(); - BinaryWriter writer = new BinaryWriter(stream); - BinaryReader reader = new BinaryReader(stream); - try - { - stream.Position = 0; - pg.WriteToStream(writer); - long streamWriteEndPosition = stream.Position; - - stream.Position = 0; - BuildPropertyGroup pg2 = new BuildPropertyGroup(); - pg2.CreateFromStream(reader); - long streamReadEndPosition = stream.Position; - Assert.IsTrue(streamWriteEndPosition == streamReadEndPosition, "Stream end positions should be equal"); - Assert.AreEqual(6, pg.Count); - Assert.AreEqual("fooout2", pg2["foo"].FinalValueEscaped); - Assert.AreEqual("barval", pg2["bar"].FinalValueEscaped); - Assert.AreEqual("bazval", pg2["baz"].FinalValueEscaped); - Assert.AreEqual("cazval", pg2["caz"].FinalValueEscaped); - Assert.AreEqual("barbout", pg2["barb"].FinalValueEscaped); - Assert.AreEqual("gazout", pg2["gaz"].FinalValueEscaped); - } - finally - { - reader.Close(); - writer = null; - stream = null; - } - } - } - - /// - /// Task sets "Ready" when it's started, and sleeps until "Signal" is set. - /// Useful if you want a test to do something while a build is in progress. - /// - public class WaitForSignal : Microsoft.Build.Utilities.Task - { - private static bool signal; - private static bool readyForSignal; - private static Object locker = new Object(); - - public static void Signal() - { - lock (locker) - { - // Lock, so that we don't race the caller's check for ready - if (readyForSignal) - { - signal = true; - readyForSignal = false; - } - } - } - - public static bool ReadyForSignal - { - get { return readyForSignal; } - } - - public override bool Execute() - { - signal = false; - readyForSignal = true; - - Console.WriteLine("waiting for signal"); - while (!signal) - { - Thread.Sleep(50); - } - Console.WriteLine(" ... signaled"); - - readyForSignal = false; - signal = false; - - return true; - } - } - } diff --git a/src/Deprecated/Engine.UnitTests/Property_Tests.cs b/src/Deprecated/Engine.UnitTests/Property_Tests.cs deleted file mode 100644 index 45631ee035f..00000000000 --- a/src/Deprecated/Engine.UnitTests/Property_Tests.cs +++ /dev/null @@ -1,459 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using NUnit.Framework; -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine; -using System.Xml; -using System.IO; - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class PropertyTest - { - [Test] - public void Constructors() - { - BuildProperty p1 = new BuildProperty("name", "value", PropertyType.NormalProperty); - Assertion.AssertEquals("", p1.Name, "name"); - Assertion.AssertEquals("", p1.Value, "value"); - - BuildProperty p2 = new BuildProperty("name", "value"); - Assertion.AssertEquals("", p2.Name, "name"); - Assertion.AssertEquals("", p2.Value, "value"); - - BuildProperty p3 = new BuildProperty(new XmlDocument(), "name", "value", PropertyType.NormalProperty); - Assertion.AssertEquals("", p3.Name, "name"); - Assertion.AssertEquals("", p3.Value, "value"); - - BuildProperty p4 = new BuildProperty(null, "name", "value", PropertyType.NormalProperty); - Assertion.AssertEquals("", p4.Name, "name"); - Assertion.AssertEquals("", p4.Value, "value"); - - XmlDocument xmldoc = new XmlDocument(); - XmlElement xmlel = xmldoc.CreateElement("name"); - xmlel.InnerXml = "value"; - - BuildProperty p5 = new BuildProperty(xmlel, PropertyType.NormalProperty); - Assertion.AssertEquals("", p5.Name, "name"); - Assertion.AssertEquals("", p5.Value, "value"); - } - - [Test] - public void SetValueForPropertyInXMLDoc() - { - XmlDocument xmldoc = new XmlDocument(); - XmlElement xmlel = xmldoc.CreateElement("name"); - xmlel.InnerXml = "value"; - - BuildProperty p1 = new BuildProperty(xmlel, PropertyType.NormalProperty); - Assertion.AssertEquals("", p1.Value, "value"); - - p1.Value = "modified value"; - Assertion.AssertEquals("", p1.Value, "modified value"); - Assertion.AssertEquals("", xmlel.InnerXml, "modified value"); - Assertion.AssertEquals("", xmlel.InnerText, "modified value"); - - p1.Value = "modified "; - Assertion.AssertEquals("", p1.Value, "modified "); - Assertion.AssertEquals("", xmlel.InnerXml, "modified "); - Assertion.AssertEquals("", xmlel.InnerText, "modified "); - - p1.Value = "modified & value"; - Assertion.AssertEquals("", p1.Value, "modified & value"); - Assertion.AssertEquals("", xmlel.InnerXml, "modified & value"); - Assertion.AssertEquals("", xmlel.InnerText, "modified & value"); - - p1.Value = "modified <value/>"; - Assertion.AssertEquals("", p1.Value, "modified <value/>"); - Assertion.AssertEquals("", xmlel.InnerXml, "modified &lt;value/&gt;"); - Assertion.AssertEquals("", xmlel.InnerText, "modified <value/>"); - } - - [Test] - public void SetValueForPropertyWithoutXMLDoc() - { - BuildProperty p1 = new BuildProperty("name", "value"); - Assertion.AssertEquals("", p1.Value, "value"); - - p1.Value = "modified value"; - Assertion.AssertEquals("", p1.Value, "modified value"); - } - - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void ItemGroupInAPropertyCondition() - { - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - - - - @(x) - - - - - - - - - "); - - p.Build(new string[] { "t" }, null); - } - - /// - /// Verify we can't create properties with reserved names in projects - /// - /// LukaszG - [Test] - public void ReservedPropertyNameInProject() - { - bool fExceptionCaught = false; - try - { - Project p = ObjectModelHelpers.CreateInMemoryProject - ( - "" - + " " - + " " - + " " - + " " - + "" - ); - } - catch (InvalidProjectFileException) - { - fExceptionCaught = true; - } - Assertion.Assert(fExceptionCaught); - } - - /// - /// Verify we can't create properties with invalid names in projects - /// - /// LukaszG - [Test] - public void InvalidPropertyNameInProject() - { - bool fExceptionCaught = false; - try - { - Project p = ObjectModelHelpers.CreateInMemoryProject - ( - "" - + " " - + " " - + " " - + " " - + "" - ); - } - catch (InvalidProjectFileException) - { - fExceptionCaught = true; - } - Assertion.Assert(fExceptionCaught); - } - - /// - /// Verify invalid property names are caught, where the names are valid Xml Element names. - /// - /// danmose - [Test] - public void InvalidCharInPropertyNameInProject() - { - bool exceptionCaught = false; - try - { - Project p = ObjectModelHelpers.CreateInMemoryProject - ( - "" - + " <\u03A3/>" - + " " - + " " - + " " - + "" - ); - } - catch (InvalidProjectFileException) - { - exceptionCaught = true; - } - Assertion.Assert(exceptionCaught); - } - - /// - /// Verify we can't create properties with invalid names directly - /// - /// LukaszG - [Test] - public void InvalidPropertyNameDirectPrivateCreate() - { - bool fExceptionCaught = false; - try - { - XmlDocument doc = new XmlDocument(); - doc.LoadXml(""); - XmlElement element = doc.DocumentElement; - BuildProperty property = new BuildProperty(doc.DocumentElement, PropertyType.ReservedProperty); - } - catch (InvalidProjectFileException) - { - fExceptionCaught = true; - } - Assertion.Assert(fExceptionCaught); - } - - /// - /// Verify we can't create properties with invalid names directly - /// - /// LukaszG - [Test] - public void InvalidPropertyNameDirectPublicCreate() - { - bool fExceptionCaught = false; - try - { - BuildProperty property = new BuildProperty("Choose", "to be or not to be"); - } - catch (InvalidOperationException) - { - fExceptionCaught = true; - } - Assertion.Assert(fExceptionCaught); - } - - /// - /// Verify we can't create properties with invalid names directly - /// - /// LukaszG - [Test] - public void InvalidPropertyNameDirectPublicCreate2() - { - bool fExceptionCaught = false; - try - { - BuildProperty property = new BuildProperty("Choose", "to be or not to be", PropertyType.ReservedProperty); - } - catch (InvalidOperationException) - { - fExceptionCaught = true; - } - Assertion.Assert(fExceptionCaught); - } - - /// - /// Verify we can't create properties with invalid names directly - /// - /// LukaszG - [Test] - public void InvalidPropertyNameDirectPublicCreate3() - { - bool fExceptionCaught = false; - try - { - XmlDocument doc = new XmlDocument(); - doc.LoadXml(""); - BuildProperty property = new BuildProperty(doc, "Choose", "value", PropertyType.ReservedProperty); - } - catch (InvalidOperationException) - { - fExceptionCaught = true; - } - Assertion.Assert(fExceptionCaught); - } - - /// - /// Verify some valid property names are accepted - /// - [Test] - public void ValidName() - { - foreach (string candidate in Item_Tests.validItemPropertyMetadataNames) - { - TryValidPropertyName(candidate); - } - } - - /// - /// Verify invalid property names are rejected - /// - [Test] - public void InvalidNames() - { - foreach (string candidate in Item_Tests.invalidItemPropertyMetadataNames) - { - TryInvalidPropertyName(candidate); - } - - // For the other BuildProperty ctor, it has to be an xml-valid name since it takes an element - // Just try one case - XmlDocument doc = new XmlDocument(); - XmlElement element = doc.CreateElement("foo.bar"); - element.InnerText = "foo"; - bool caughtException = false; - try - { - BuildProperty item = new BuildProperty(element, PropertyType.NormalProperty); - } - catch (InvalidProjectFileException ex) - { - Console.WriteLine(ex.Message); - caughtException = true; - } - Assertion.Assert("foo.bar", caughtException); - } - - /// - /// Helper for trying invalid property names - /// - /// - private void TryInvalidPropertyName(string name) - { - XmlDocument doc = new XmlDocument(); - bool caughtException = false; - - // Test the first BuildProperty ctor - try - { - BuildProperty item = new BuildProperty(doc, name, "someValue", PropertyType.NormalProperty); - } - catch (ArgumentException ex) - { - Console.WriteLine(ex.Message); - caughtException = true; - } - Assertion.Assert(name, caughtException); - } - - /// - /// Helper for trying valid property names - /// - /// - private void TryValidPropertyName(string name) - { - XmlDocument doc = new XmlDocument(); - - BuildProperty property = new BuildProperty(doc, name, "someValue", PropertyType.NormalProperty); - Assertion.AssertEquals(name, property.Name); - Assertion.AssertEquals("someValue", property.Value); - } - - [Test] - public void TestCustomSerialization() - { - BuildProperty p1 = new BuildProperty("name", "value", PropertyType.GlobalProperty); - BuildProperty p2 = new BuildProperty("name2", "value2", PropertyType.OutputProperty); - BuildProperty p3 = new BuildProperty("name3", "value3", PropertyType.EnvironmentProperty); - - MemoryStream stream = new MemoryStream(); - BinaryWriter writer = new BinaryWriter(stream); - BinaryReader reader = new BinaryReader(stream); - try - { - stream.Position = 0; - p1.WriteToStream(writer); - p2.WriteToStream(writer); - p3.WriteToStream(writer); - long streamWriteEndPosition = stream.Position; - - stream.Position = 0; - BuildProperty p4 = BuildProperty.CreateFromStream(reader); - BuildProperty p5 = BuildProperty.CreateFromStream(reader); - BuildProperty p6 = BuildProperty.CreateFromStream(reader); - long streamReadEndPosition = stream.Position; - Assert.IsTrue(streamWriteEndPosition == streamReadEndPosition, "Stream end positions should be equal"); - CompareBuildProperty(p1, p4); - CompareBuildProperty(p2, p5); - CompareBuildProperty(p3, p6); - } - finally - { - reader.Close(); - writer = null; - stream = null; - } - } - - /// - /// Often a property has a value and an expanded value that are string identical. In such cases, - /// we should not transmit both across the wire, and at the other end the property should end up - /// with reference identical values for each, saving memory too. - /// - [Test] - public void TestCustomSerializationCompressesPropertyValueAndExpandedValue() - { - // Create a non-literal string, so the CLR won't intern it (in real builds, - // the strings are not literals, and the CLR won't intern them) - string v1 = "non_expandable_property" + new Random().Next(); - int i = new Random().Next(); - string v2 = "expandable_$(property)" + i; - string v2Expanded = "expandable_" + i; - - // Verify it is not interned - Assertion.Assert(null == String.IsInterned(v1)); - Assertion.Assert(null == String.IsInterned(v2)); - - // Property with finalValue == Value - BuildProperty p = new BuildProperty("name", v1); - Assertion.Assert(Object.ReferenceEquals(p.FinalValueEscaped, p.Value)); - - // Property with finalValue != Value - BuildProperty q = new BuildProperty("name", v2); - q.Evaluate(new Expander(new BuildPropertyGroup())); - Assertion.Assert(!Object.ReferenceEquals(q.FinalValueEscaped, q.Value)); - Assertion.AssertEquals(v2, q.Value); - Assertion.AssertEquals(v2Expanded, q.FinalValueEscaped); - - // "Transmit across the wire" - MemoryStream stream = new MemoryStream(); - BinaryWriter writer = new BinaryWriter(stream); - BinaryReader reader = new BinaryReader(stream); - try - { - stream.Position = 0; - p.WriteToStream(writer); - q.WriteToStream(writer); - - // The property that had identical value and finalvalueescaped should - // be deserialized into a property that has identical references for its - // value and finalvalueescaped. - stream.Position = 0; - BuildProperty p2 = BuildProperty.CreateFromStream(reader); - Assertion.Assert(Object.ReferenceEquals(p2.FinalValueEscaped, p2.Value)); - Assertion.AssertEquals(v1, p2.Value); - - // The property that had different value and finalvalueescaped should be deserialized - // normally - BuildProperty q2 = BuildProperty.CreateFromStream(reader); - Assertion.Assert(!Object.ReferenceEquals(q2.FinalValueEscaped, q2.Value)); - Assertion.AssertEquals(v2, q2.Value); - Assertion.AssertEquals(v2Expanded, q2.FinalValueEscaped); - } - finally - { - reader.Close(); - } - } - - private static void CompareBuildProperty(BuildProperty a, BuildProperty b) - { - Assert.IsTrue(string.Compare(a.Value, b.Value, StringComparison.OrdinalIgnoreCase) == 0, "PropertyValue should be equal"); - Assert.IsTrue(string.Compare(a.Name, b.Name, StringComparison.OrdinalIgnoreCase) == 0, "Name should be equal"); - Assert.IsTrue(string.Compare(a.FinalValueEscaped, b.FinalValueEscaped, StringComparison.OrdinalIgnoreCase) == 0, "FinalValueEscaped should be equal"); - Assert.AreEqual(a.Type, b.Type, "Type should be equal"); - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/Scanner_Tests.cs b/src/Deprecated/Engine.UnitTests/Scanner_Tests.cs deleted file mode 100644 index 10edea8a5db..00000000000 --- a/src/Deprecated/Engine.UnitTests/Scanner_Tests.cs +++ /dev/null @@ -1,575 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Globalization; -using System.Reflection; -using NUnit.Framework; -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine; - - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class ScannerTest - { - /// - /// Tests that we give a useful error position (not 0 for example) - /// - /// danmose - [Test] - public void ErrorPosition() - { - string[,] tests = { - { "1==1.1.", "7", "AllowAll"}, // Position of second '.' - { "1==0xFG", "7", "AllowAll"}, // Position of G - { "1==-0xF", "6", "AllowAll"}, // Position of x - { "1234=5678", "6", "AllowAll"}, // Position of '5' - { " ", "2", "AllowAll"}, // Position of End of Input - { " (", "3", "AllowAll"}, // Position of End of Input - { " false or ", "12", "AllowAll"}, // Position of End of Input - { " \"foo", "2", "AllowAll"}, // Position of open quote - { " @(foo", "2", "AllowAll"}, // Position of @ - { " @(", "2", "AllowAll"}, // Position of @ - { " $", "2", "AllowAll"}, // Position of $ - { " $(foo", "2", "AllowAll"}, // Position of $ - { " $(", "2", "AllowAll"}, // Position of $ - { " $", "2", "AllowAll"}, // Position of $ - { " @(foo)", "2", "AllowProperties"}, // Position of @ - { " '@(foo)'", "3", "AllowProperties"}, // Position of @ - /* test escaped chars: message shows them escaped so count should include them */ - { "'%24%28x' == '%24(x''", "21", "AllowAll"} // Position of extra quote - }; - - // Some errors are caught by the Parser, not merely by the Lexer/Scanner. So we have to do a full Parse, - // rather than just calling AdvanceToScannerError(). (The error location is still supplied by the Scanner.) - for (int i = 0; i < tests.GetLength(0); i++) - { - Parser parser = null; - try - { - parser = new Parser(); - ParserOptions options = (ParserOptions)Enum.Parse(typeof(ParserOptions), tests[i, 2], true /* case-insensitive */); - GenericExpressionNode parsedExpression = parser.Parse(tests[i, 0], null, options); - } - catch (InvalidProjectFileException ex) - { - Console.WriteLine(ex.Message); - Assertion.Assert("Expression '" + tests[i, 0] + "' should have an error at " + tests[i, 1] + " but it was at " + parser.errorPosition, - Convert.ToInt32(tests[i, 1]) == parser.errorPosition); - } - } - } - - /// - /// Advance to the point of the lexer error. If the error is only caught by the parser, this isn't useful. - /// - /// - private void AdvanceToScannerError(Scanner lexer) - { - while (true) - { - if (!lexer.Advance()) break; - if (lexer.IsNext(Token.TokenType.EndOfInput)) break; - } - } - - /// - /// Tests the special error for "=". - /// - /// danmose - [Test] - public void SingleEquals() - { - Scanner lexer; - - lexer = new Scanner("a=b", ParserOptions.AllowProperties); - AdvanceToScannerError(lexer); - Assertion.Assert(lexer.GetErrorResource() == "IllFormedEqualsInCondition"); - Assertion.Assert(lexer.UnexpectedlyFound == "b"); - } - - /// - /// Tests the special errors for "$(" and "$x" and similar cases - /// - /// danmose - [Test] - public void IllFormedProperty() - { - Scanner lexer; - - lexer = new Scanner("$(", ParserOptions.AllowProperties); - AdvanceToScannerError(lexer); - Assertion.Assert(lexer.GetErrorResource() == "IllFormedPropertyCloseParenthesisInCondition"); - - lexer = new Scanner("$x", ParserOptions.AllowProperties); - AdvanceToScannerError(lexer); - Assertion.Assert(lexer.GetErrorResource() == "IllFormedPropertyOpenParenthesisInCondition"); - } - - /// - /// Tests the special errors for "@(" and "@x" and similar cases. - /// - /// danmose - [Test] - public void IllFormedItemList() - { - Scanner lexer; - - lexer = new Scanner("@(", ParserOptions.AllowAll); - AdvanceToScannerError(lexer); - Assertion.Assert(lexer.GetErrorResource() == "IllFormedItemListCloseParenthesisInCondition"); - Assertion.Assert(lexer.UnexpectedlyFound == null); - - lexer = new Scanner("@x", ParserOptions.AllowAll); - AdvanceToScannerError(lexer); - Assertion.Assert(lexer.GetErrorResource() == "IllFormedItemListOpenParenthesisInCondition"); - Assertion.Assert(lexer.UnexpectedlyFound == null); - - lexer = new Scanner("@(x", ParserOptions.AllowAll); - AdvanceToScannerError(lexer); - Assertion.Assert(lexer.GetErrorResource() == "IllFormedItemListCloseParenthesisInCondition"); - Assertion.Assert(lexer.UnexpectedlyFound == null); - - lexer = new Scanner("@(x->'%(y)", ParserOptions.AllowAll); - AdvanceToScannerError(lexer); - Assertion.Assert(lexer.GetErrorResource() == "IllFormedItemListQuoteInCondition"); - Assertion.Assert(lexer.UnexpectedlyFound == null); - - lexer = new Scanner("@(x->'%(y)', 'x", ParserOptions.AllowAll); - AdvanceToScannerError(lexer); - Assertion.Assert(lexer.GetErrorResource() == "IllFormedItemListQuoteInCondition"); - Assertion.Assert(lexer.UnexpectedlyFound == null); - - lexer = new Scanner("@(x->'%(y)', 'x'", ParserOptions.AllowAll); - AdvanceToScannerError(lexer); - Assertion.Assert(lexer.GetErrorResource() == "IllFormedItemListCloseParenthesisInCondition"); - Assertion.Assert(lexer.UnexpectedlyFound == null); - } - - /// - /// Tests the special error for unterminated quotes. - /// Note, scanner only understands single quotes. - /// - /// danmose - [Test] - public void IllFormedQuotedString() - { - Scanner lexer; - - lexer = new Scanner("false or 'abc", ParserOptions.AllowAll); - AdvanceToScannerError(lexer); - Assertion.Assert(lexer.GetErrorResource() == "IllFormedQuotedStringInCondition"); - Assertion.Assert(lexer.UnexpectedlyFound == null); - - lexer = new Scanner("\'", ParserOptions.AllowAll); - AdvanceToScannerError(lexer); - Assertion.Assert(lexer.GetErrorResource() == "IllFormedQuotedStringInCondition"); - Assertion.Assert(lexer.UnexpectedlyFound == null); - } - - /// - /// - /// DavidLe - [Test] - public void NumericSingleTokenTests() - { - Scanner lexer; - - lexer = new Scanner("1234", ParserOptions.AllowAll); - Assertion.Assert(lexer.Advance()); - Assertion.AssertEquals(lexer.IsNext(Token.TokenType.Numeric), true); - Assertion.AssertEquals(String.Compare("1234", lexer.IsNextString()), 0); - - lexer = new Scanner("-1234", ParserOptions.AllowAll); - Assertion.Assert(lexer.Advance()); - Assertion.AssertEquals(lexer.IsNext(Token.TokenType.Numeric), true); - Assertion.AssertEquals(String.Compare("-1234", lexer.IsNextString()), 0); - - lexer = new Scanner("+1234", ParserOptions.AllowAll); - Assertion.Assert(lexer.Advance()); - Assertion.AssertEquals(lexer.IsNext(Token.TokenType.Numeric), true); - Assertion.AssertEquals(String.Compare("+1234", lexer.IsNextString()), 0); - - lexer = new Scanner("1234.1234", ParserOptions.AllowAll); - Assertion.Assert(lexer.Advance()); - Assertion.AssertEquals(lexer.IsNext(Token.TokenType.Numeric), true); - Assertion.AssertEquals(String.Compare("1234.1234", lexer.IsNextString()), 0); - - lexer = new Scanner(".1234", ParserOptions.AllowAll); - Assertion.Assert(lexer.Advance()); - Assertion.AssertEquals(lexer.IsNext(Token.TokenType.Numeric), true); - Assertion.AssertEquals(String.Compare(".1234", lexer.IsNextString()), 0); - - lexer = new Scanner("1234.", ParserOptions.AllowAll); - Assertion.Assert(lexer.Advance()); - Assertion.AssertEquals(lexer.IsNext(Token.TokenType.Numeric), true); - Assertion.AssertEquals(String.Compare("1234.", lexer.IsNextString()), 0); - lexer = new Scanner("0x1234", ParserOptions.AllowAll); - Assertion.Assert(lexer.Advance()); - Assertion.AssertEquals(lexer.IsNext(Token.TokenType.Numeric), true); - Assertion.AssertEquals(String.Compare("0x1234", lexer.IsNextString()), 0); - lexer = new Scanner("0X1234abcd", ParserOptions.AllowAll); - Assertion.Assert(lexer.Advance()); - Assertion.AssertEquals(lexer.IsNext(Token.TokenType.Numeric), true); - Assertion.AssertEquals(String.Compare("0X1234abcd", lexer.IsNextString()), 0); - lexer = new Scanner("0x1234ABCD", ParserOptions.AllowAll); - Assertion.Assert(lexer.Advance()); - Assertion.AssertEquals(lexer.IsNext(Token.TokenType.Numeric), true); - Assertion.AssertEquals(String.Compare("0x1234ABCD", lexer.IsNextString()), 0); - } - - /// - /// - /// DavidLe - [Test] - public void PropsStringsAndBooleanSingleTokenTests() - { - Scanner lexer = new Scanner("$(foo)", ParserOptions.AllowAll); - Assertion.Assert(lexer.Advance()); - Assertion.AssertEquals(lexer.IsNext(Token.TokenType.Property), true); - lexer = new Scanner("@(foo)", ParserOptions.AllowAll); - Assertion.Assert(lexer.Advance()); - Assertion.AssertEquals(lexer.IsNext(Token.TokenType.ItemList), true); - lexer = new Scanner("abcde", ParserOptions.AllowAll); - Assertion.Assert(lexer.Advance()); - Assertion.AssertEquals(lexer.IsNext(Token.TokenType.String), true); - Assertion.AssertEquals(String.Compare("abcde", lexer.IsNextString()), 0); - - lexer = new Scanner("'abc-efg'", ParserOptions.AllowAll); - Assertion.Assert(lexer.Advance()); - Assertion.AssertEquals(lexer.IsNext(Token.TokenType.String), true); - Assertion.AssertEquals(String.Compare("abc-efg", lexer.IsNextString()), 0); - - lexer = new Scanner("and", ParserOptions.AllowAll); - Assertion.Assert(lexer.Advance()); - Assertion.AssertEquals(lexer.IsNext(Token.TokenType.And), true); - Assertion.AssertEquals(String.Compare("and", lexer.IsNextString()), 0); - lexer = new Scanner("or", ParserOptions.AllowAll); - Assertion.Assert(lexer.Advance()); - Assertion.AssertEquals(lexer.IsNext(Token.TokenType.Or), true); - Assertion.AssertEquals(String.Compare("or", lexer.IsNextString()), 0); - lexer = new Scanner("AnD", ParserOptions.AllowAll); - Assertion.Assert(lexer.Advance()); - Assertion.AssertEquals(lexer.IsNext(Token.TokenType.And), true); - Assertion.AssertEquals(String.Compare("AnD", lexer.IsNextString()), 0); - lexer = new Scanner("Or", ParserOptions.AllowAll); - Assertion.Assert(lexer.Advance()); - Assertion.AssertEquals(lexer.IsNext(Token.TokenType.Or), true); - Assertion.AssertEquals(String.Compare("Or", lexer.IsNextString()), 0); - } - - /// - /// - /// DavidLe - [Test] - public void SimpleSingleTokenTests () - { - Scanner lexer = new Scanner("(", ParserOptions.AllowAll); - Assertion.Assert(lexer.Advance()); - Assertion.AssertEquals(lexer.IsNext(Token.TokenType.LeftParenthesis), true); - lexer = new Scanner(")", ParserOptions.AllowAll); - Assertion.Assert(lexer.Advance()); - Assertion.AssertEquals(lexer.IsNext(Token.TokenType.RightParenthesis), true); - lexer = new Scanner(",", ParserOptions.AllowAll); - Assertion.Assert(lexer.Advance()); - Assertion.AssertEquals(lexer.IsNext(Token.TokenType.Comma), true); - lexer = new Scanner("==", ParserOptions.AllowAll); - Assertion.Assert(lexer.Advance()); - Assertion.AssertEquals(lexer.IsNext(Token.TokenType.EqualTo), true); - lexer = new Scanner("!=", ParserOptions.AllowAll); - Assertion.Assert(lexer.Advance()); - Assertion.AssertEquals(lexer.IsNext(Token.TokenType.NotEqualTo), true); - lexer = new Scanner("<", ParserOptions.AllowAll); - Assertion.Assert(lexer.Advance()); - Assertion.AssertEquals(lexer.IsNext(Token.TokenType.LessThan), true); - lexer = new Scanner(">", ParserOptions.AllowAll); - Assertion.Assert(lexer.Advance()); - Assertion.AssertEquals(lexer.IsNext(Token.TokenType.GreaterThan), true); - lexer = new Scanner("<=", ParserOptions.AllowAll); - Assertion.Assert(lexer.Advance()); - Assertion.AssertEquals(lexer.IsNext(Token.TokenType.LessThanOrEqualTo), true); - lexer = new Scanner(">=", ParserOptions.AllowAll); - Assertion.Assert(lexer.Advance()); - Assertion.AssertEquals(lexer.IsNext(Token.TokenType.GreaterThanOrEqualTo), true); - lexer = new Scanner("!", ParserOptions.AllowAll); - Assertion.Assert(lexer.Advance()); - Assertion.AssertEquals(lexer.IsNext(Token.TokenType.Not), true); - } - - - /// - /// - /// DavidLe - [Test] - public void StringEdgeTests() - { - Scanner lexer; - - lexer = new Scanner("@(Foo, ' ')", ParserOptions.AllowAll); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.ItemList)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.EndOfInput)); - - lexer = new Scanner("'@(Foo, ' ')'", ParserOptions.AllowAll); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.String)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.EndOfInput)); - - lexer = new Scanner("'%40(( '", ParserOptions.AllowAll); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.String)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.EndOfInput)); - - lexer = new Scanner("'@(Complex_ItemType-123, ';')' == ''", ParserOptions.AllowAll); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.String)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.EqualTo)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.String)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.EndOfInput)); - - } - - /// - /// - /// DavidLe - [Test] - public void FunctionTests() - { - Scanner lexer; - - lexer = new Scanner("Foobar()", ParserOptions.AllowAll); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.Function)); - Assertion.AssertEquals(String.Compare("Foobar", lexer.IsNextString()), 0); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.LeftParenthesis)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.RightParenthesis)); - - lexer = new Scanner("Foobar( 1 )", ParserOptions.AllowAll); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.Function)); - Assertion.AssertEquals(String.Compare("Foobar", lexer.IsNextString()), 0); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.LeftParenthesis)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.Numeric)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.RightParenthesis)); - - lexer = new Scanner("Foobar( $(Property) )", ParserOptions.AllowAll); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.Function)); - Assertion.AssertEquals(String.Compare("Foobar", lexer.IsNextString()), 0); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.LeftParenthesis)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.Property)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.RightParenthesis)); - - lexer = new Scanner("Foobar( @(ItemList) )", ParserOptions.AllowAll); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.Function)); - Assertion.AssertEquals(String.Compare("Foobar", lexer.IsNextString()), 0); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.LeftParenthesis)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.ItemList)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.RightParenthesis)); - - lexer = new Scanner("Foobar( simplestring )", ParserOptions.AllowAll); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.Function)); - Assertion.AssertEquals(String.Compare("Foobar", lexer.IsNextString()), 0); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.LeftParenthesis)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.String)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.RightParenthesis)); - - lexer = new Scanner("Foobar( 'Not a Simple String' )", ParserOptions.AllowAll); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.Function)); - Assertion.AssertEquals(String.Compare("Foobar", lexer.IsNextString()), 0); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.LeftParenthesis)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.String)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.RightParenthesis)); - - lexer = new Scanner("Foobar( 'Not a Simple String', 1234 )", ParserOptions.AllowAll); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.Function)); - Assertion.AssertEquals(String.Compare("Foobar", lexer.IsNextString()), 0); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.LeftParenthesis)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.String)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.Comma)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.Numeric)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.RightParenthesis)); - - lexer = new Scanner("Foobar( $(Property), 'Not a Simple String', 1234 )", ParserOptions.AllowAll); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.Function)); - Assertion.AssertEquals(String.Compare("Foobar", lexer.IsNextString()), 0); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.LeftParenthesis)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.Property)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.Comma)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.String)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.Comma)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.Numeric)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.RightParenthesis)); - - lexer = new Scanner("Foobar( @(ItemList), $(Property), simplestring, 'Not a Simple String', 1234 )", ParserOptions.AllowAll); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.Function)); - Assertion.AssertEquals(String.Compare("Foobar", lexer.IsNextString()), 0); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.LeftParenthesis)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.ItemList)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.Comma)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.Property)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.Comma)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.String)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.Comma)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.String)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.Comma)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.Numeric)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.RightParenthesis)); - } - - /// - /// - /// DavidLe - [Test] - public void ComplexTests1 () - { - Scanner lexer; - - lexer = new Scanner("'String with a $(Property) inside'", ParserOptions.AllowAll); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.String)); - Assertion.AssertEquals(String.Compare("String with a $(Property) inside", lexer.IsNextString()), 0); - - lexer = new Scanner("'String with an embedded \\' in it'", ParserOptions.AllowAll); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.String)); -// Assertion.AssertEquals(String.Compare("String with an embedded ' in it", lexer.IsNextString()), 0); - - lexer = new Scanner("'String with a $(Property) inside'", ParserOptions.AllowAll); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.String)); - Assertion.AssertEquals(String.Compare("String with a $(Property) inside", lexer.IsNextString()), 0); - - lexer = new Scanner("@(list, ' ')", ParserOptions.AllowAll); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.ItemList)); - Assertion.AssertEquals(String.Compare("@(list, ' ')", lexer.IsNextString()), 0); - - lexer = new Scanner("@(files->'%(Filename)')", ParserOptions.AllowAll); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.ItemList)); - Assertion.AssertEquals(String.Compare("@(files->'%(Filename)')", lexer.IsNextString()), 0); - } - - /// - /// - /// DavidLe - [Test] - public void ComplexTests2() - { - Scanner lexer = new Scanner("1234", ParserOptions.AllowAll); - Assertion.Assert(lexer.Advance()); - - lexer = new Scanner("'abc-efg'==$(foo)", ParserOptions.AllowAll); - Assertion.Assert(lexer.Advance()); - Assertion.AssertEquals(lexer.IsNext(Token.TokenType.String), true); - lexer.Advance(); - Assertion.AssertEquals(lexer.IsNext(Token.TokenType.EqualTo), true); - lexer.Advance(); - Assertion.AssertEquals(lexer.IsNext(Token.TokenType.Property), true); - lexer.Advance(); - Assertion.AssertEquals(lexer.IsNext(Token.TokenType.EndOfInput), true); - - lexer = new Scanner("$(debug)!=true", ParserOptions.AllowAll); - Assertion.Assert(lexer.Advance()); - Assertion.AssertEquals(lexer.IsNext(Token.TokenType.Property), true); - lexer.Advance(); - Assertion.AssertEquals(lexer.IsNext(Token.TokenType.NotEqualTo), true); - lexer.Advance(); - Assertion.AssertEquals(lexer.IsNext(Token.TokenType.String), true); - lexer.Advance(); - Assertion.AssertEquals(lexer.IsNext(Token.TokenType.EndOfInput), true); - - lexer = new Scanner("$(VERSION)<5", ParserOptions.AllowAll); - Assertion.Assert(lexer.Advance()); - Assertion.AssertEquals(lexer.IsNext(Token.TokenType.Property), true); - lexer.Advance(); - Assertion.AssertEquals(lexer.IsNext(Token.TokenType.LessThan), true); - lexer.Advance(); - Assertion.AssertEquals(lexer.IsNext(Token.TokenType.Numeric), true); - lexer.Advance(); - Assertion.AssertEquals(lexer.IsNext(Token.TokenType.EndOfInput), true); - } - - /// - /// Tests all tokens with no whitespace and whitespace. - /// - /// DavidLe - [Test] - public void WhitespaceTests() - { - Scanner lexer; - Console.WriteLine("here"); - lexer = new Scanner("$(DEBUG) and $(FOO)", ParserOptions.AllowAll); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.Property)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.And)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.Property)); - - lexer = new Scanner("1234$(DEBUG)0xabcd@(foo)asdf<>'foobar'<=false>=true==1234!=", ParserOptions.AllowAll); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.Numeric)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.Property)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.Numeric)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.ItemList)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.String)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.LessThan)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.GreaterThan)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.String)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.LessThanOrEqualTo)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.String)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.GreaterThanOrEqualTo)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.String)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.EqualTo)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.Numeric)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.NotEqualTo)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.EndOfInput)); - - lexer = new Scanner(" 1234 $(DEBUG) 0xabcd \n@(foo) \nasdf \n< \n> \n'foobar' \n<= \nfalse \n>= \ntrue \n== \n 1234 \n!= ", ParserOptions.AllowAll); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.Numeric)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.Property)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.Numeric)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.ItemList)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.String)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.LessThan)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.GreaterThan)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.String)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.LessThanOrEqualTo)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.String)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.GreaterThanOrEqualTo)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.String)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.EqualTo)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.Numeric)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.NotEqualTo)); - Assertion.Assert(lexer.Advance() && lexer.IsNext(Token.TokenType.EndOfInput)); - } - - /// - /// Tests the parsing of item lists. - /// - /// DavidLe - [Test] - public void ItemListTests() - { - Scanner lexer; - - lexer = new Scanner("@(foo)", ParserOptions.AllowProperties); - Assertion.Assert(!lexer.Advance()); - Assertion.Assert(String.Compare(lexer.GetErrorResource(), "ItemListNotAllowedInThisConditional") == 0); - - lexer = new Scanner("1234 '@(foo)'", ParserOptions.AllowProperties); - Assertion.Assert(lexer.Advance()); - Assertion.Assert(!lexer.Advance()); - Assertion.Assert(String.Compare(lexer.GetErrorResource(), "ItemListNotAllowedInThisConditional") == 0); - - lexer = new Scanner("'1234 @(foo)'", ParserOptions.AllowProperties); - Assertion.Assert(!lexer.Advance()); - Assertion.Assert(String.Compare(lexer.GetErrorResource(), "ItemListNotAllowedInThisConditional") == 0); - } - - /// - /// Tests that shouldn't work. - /// - /// DavidLe - [Test] - public void NegativeTests() - { - Scanner lexer; - - lexer = new Scanner("'$(DEBUG) == true", ParserOptions.AllowAll); - Assertion.Assert(!lexer.Advance()); - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/SharedMemory_Test.cs b/src/Deprecated/Engine.UnitTests/SharedMemory_Test.cs deleted file mode 100644 index 903a4672d44..00000000000 --- a/src/Deprecated/Engine.UnitTests/SharedMemory_Test.cs +++ /dev/null @@ -1,483 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections.Generic; -using System.Text; -using NUnit.Framework; -using Microsoft.Build.BuildEngine; -using Microsoft.Build.Framework; -using System.Collections; - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class SharedMemory_Test - { - [Test] - public void TestItemsInandOutOfSharedMemory() - { - string name = Guid.NewGuid().ToString(); - // Create the shared memory buffer - SharedMemory readSharedMemory = - new SharedMemory - ( - name, - SharedMemoryType.ReadOnly, - true - ); - - - SharedMemory writeSharedMemory = - new SharedMemory - ( - name, - SharedMemoryType.WriteOnly, - true - ); - - DualQueue queue = new DualQueue(); - DualQueue hiPriQueue = new DualQueue(); - LocalCallDescriptorForPostLoggingMessagesToHost LargeLogEvent = CreatePostMessageCallDescriptor(1); - LocalCallDescriptorForUpdateNodeSettings updateNodeSettings = new LocalCallDescriptorForUpdateNodeSettings(true, true, true); - LocalCallDescriptorForPostBuildResult buildResult = new LocalCallDescriptorForPostBuildResult(CreateBuildResult()); - LocalCallDescriptorForPostBuildRequests buildRequests = new LocalCallDescriptorForPostBuildRequests(CreateBuildRequest()); - LocalCallDescriptorForRequestStatus requestStatus = new LocalCallDescriptorForRequestStatus(4); - LocalCallDescriptorForPostStatus nodeStatusNoExcept = new LocalCallDescriptorForPostStatus(new NodeStatus(1, true, 2, 3, 4, true)); - LocalCallDescriptorForPostStatus nodeStatusExcept = new LocalCallDescriptorForPostStatus(new NodeStatus(new Exception("I am bad"))); - LocalCallDescriptorForShutdownNode shutdownNode = new LocalCallDescriptorForShutdownNode(Node.NodeShutdownLevel.BuildCompleteSuccess, true); - LocalCallDescriptorForShutdownComplete shutdownComplete = new LocalCallDescriptorForShutdownComplete(Node.NodeShutdownLevel.BuildCompleteFailure, 0); - LocalCallDescriptorForInitializationComplete initializeComplete = new LocalCallDescriptorForInitializationComplete(99); - - BuildPropertyGroup propertyGroup = new BuildPropertyGroup(); - BuildProperty propertyToAdd = new BuildProperty("PropertyName", "Value"); - propertyGroup.SetProperty(propertyToAdd); - CacheEntry[] entries = CreateCacheEntries(); - LocalCallDescriptorForGettingCacheEntriesFromHost getCacheEntries = new LocalCallDescriptorForGettingCacheEntriesFromHost(new string[] { "Hi", "Hello" }, "Name", propertyGroup, "3.5", CacheContentType.Properties); - LocalCallDescriptorForPostingCacheEntriesToHost postCacheEntries = new LocalCallDescriptorForPostingCacheEntriesToHost(entries, "ScopeName", propertyGroup, "3.5", CacheContentType.BuildResults); - LocalReplyCallDescriptor replyDescriptor1 = new LocalReplyCallDescriptor(1, entries); - LocalReplyCallDescriptor replyDescriptor2 = new LocalReplyCallDescriptor(6, "Foo"); - - IDictionary environmentVariables = Environment.GetEnvironmentVariables(); - Hashtable environmentVariablesHashtable = new Hashtable(environmentVariables); - - string className = "Class"; - string loggerAssemblyName = "Class"; - string loggerFileAssembly = null; - string loggerSwitchParameters = "Class"; - LoggerVerbosity verbosity = LoggerVerbosity.Detailed; - LoggerDescription description = new LoggerDescription(className, loggerAssemblyName, loggerFileAssembly, loggerSwitchParameters, verbosity); - LocalCallDescriptorForInitializeNode initializeNode = new LocalCallDescriptorForInitializeNode(environmentVariablesHashtable, new LoggerDescription[] { description }, 4, propertyGroup, ToolsetDefinitionLocations.ConfigurationFile, 5, String.Empty); - - queue.Enqueue(LargeLogEvent); - queue.Enqueue(updateNodeSettings); - queue.Enqueue(buildResult); - queue.Enqueue(buildRequests); - queue.Enqueue(requestStatus); - queue.Enqueue(nodeStatusNoExcept); - queue.Enqueue(nodeStatusExcept); - queue.Enqueue(shutdownNode); - queue.Enqueue(shutdownComplete); - queue.Enqueue(initializeComplete); - queue.Enqueue(getCacheEntries); - queue.Enqueue(postCacheEntries); - queue.Enqueue(replyDescriptor1); - queue.Enqueue(replyDescriptor2); - queue.Enqueue(initializeNode); - writeSharedMemory.Write(queue, hiPriQueue, false); - - IList localCallDescriptorList = readSharedMemory.Read(); - Assert.IsTrue(localCallDescriptorList.Count == 15); - - LocalCallDescriptorForPostLoggingMessagesToHost messageCallDescriptor = localCallDescriptorList[0] as LocalCallDescriptorForPostLoggingMessagesToHost; - VerifyPostMessagesToHost(messageCallDescriptor, 1); - - LocalCallDescriptorForUpdateNodeSettings updateSettingsCallDescriptor = localCallDescriptorList[1] as LocalCallDescriptorForUpdateNodeSettings; - VerifyUpdateSettings(updateSettingsCallDescriptor); - - LocalCallDescriptorForPostBuildResult buildResultCallDescriptor = localCallDescriptorList[2] as LocalCallDescriptorForPostBuildResult; - CompareBuildResult(buildResultCallDescriptor); - - LocalCallDescriptorForPostBuildRequests buildRequestsCallDescriptor = localCallDescriptorList[3] as LocalCallDescriptorForPostBuildRequests; - ComparebuildRequests(buildRequestsCallDescriptor); - - LocalCallDescriptorForRequestStatus requestStatusCallDescriptor = localCallDescriptorList[4] as LocalCallDescriptorForRequestStatus; - Assert.IsTrue(requestStatusCallDescriptor.RequestId == 4); - - LocalCallDescriptorForPostStatus nodeStatus1CallDescriptor = localCallDescriptorList[5] as LocalCallDescriptorForPostStatus; - VerifyNodeStatus1(nodeStatus1CallDescriptor); - - LocalCallDescriptorForPostStatus nodeStatus2CallDescriptor = localCallDescriptorList[6] as LocalCallDescriptorForPostStatus; - VerifyNodeStatus2(nodeStatus2CallDescriptor); - - LocalCallDescriptorForShutdownNode shutdownNodeCallDescriptor = localCallDescriptorList[7] as LocalCallDescriptorForShutdownNode; - Assert.IsTrue(shutdownNodeCallDescriptor.ShutdownLevel == Node.NodeShutdownLevel.BuildCompleteSuccess); - Assert.IsTrue(shutdownNodeCallDescriptor.ExitProcess); - - LocalCallDescriptorForShutdownComplete shutdownNodeCompleteCallDescriptor = localCallDescriptorList[8] as LocalCallDescriptorForShutdownComplete; - Assert.IsTrue(shutdownNodeCompleteCallDescriptor.ShutdownLevel == Node.NodeShutdownLevel.BuildCompleteFailure); - - LocalCallDescriptorForInitializationComplete initializeCompleteCallDescriptor = localCallDescriptorList[9] as LocalCallDescriptorForInitializationComplete; - Assert.IsTrue(initializeCompleteCallDescriptor.ProcessId == 99); - - LocalCallDescriptorForGettingCacheEntriesFromHost getCacheEntriesCallDescriptor = localCallDescriptorList[10] as LocalCallDescriptorForGettingCacheEntriesFromHost; - VerifyGetCacheEntryFromHost(getCacheEntriesCallDescriptor); - - LocalCallDescriptorForPostingCacheEntriesToHost postCacheEntriesCallDescriptor = localCallDescriptorList[11] as LocalCallDescriptorForPostingCacheEntriesToHost; - Assert.IsTrue(string.Compare(postCacheEntriesCallDescriptor.ScopeName, "ScopeName", StringComparison.OrdinalIgnoreCase) == 0); - Assert.IsTrue(string.Compare(postCacheEntriesCallDescriptor.ScopeProperties["PropertyName"].Value, "Value", StringComparison.OrdinalIgnoreCase) == 0); - Assert.IsTrue(string.Compare(postCacheEntriesCallDescriptor.ScopeToolsVersion, "3.5", StringComparison.OrdinalIgnoreCase) == 0); - Assert.IsTrue(postCacheEntriesCallDescriptor.ContentType == CacheContentType.BuildResults); - VerifyGetCacheEntries(postCacheEntriesCallDescriptor.Entries); - - LocalReplyCallDescriptor reply1CallDescriptor = localCallDescriptorList[12] as LocalReplyCallDescriptor; - Assert.IsTrue(reply1CallDescriptor.RequestingCallNumber == 1); - VerifyGetCacheEntries((CacheEntry[])reply1CallDescriptor.ReplyData); - - LocalReplyCallDescriptor reply2CallDescriptor = localCallDescriptorList[13] as LocalReplyCallDescriptor; - Assert.IsTrue(reply2CallDescriptor.RequestingCallNumber == 6); - Assert.IsTrue(string.Compare("Foo", (string)reply2CallDescriptor.ReplyData, StringComparison.OrdinalIgnoreCase) == 0); - - LocalCallDescriptorForInitializeNode initializeCallDescriptor = localCallDescriptorList[14] as LocalCallDescriptorForInitializeNode; - Assert.IsTrue(initializeCallDescriptor.ParentProcessId == 5); - Assert.IsTrue(initializeCallDescriptor.NodeId == 4); - Assert.IsTrue(initializeCallDescriptor.ToolsetSearchLocations == ToolsetDefinitionLocations.ConfigurationFile); - Assert.IsTrue(string.Compare(initializeCallDescriptor.ParentGlobalProperties["PropertyName"].Value, "Value", StringComparison.OrdinalIgnoreCase) == 0); - Assert.IsTrue(string.Compare(initializeCallDescriptor.NodeLoggers[0].Name, "Class", StringComparison.OrdinalIgnoreCase) == 0); - - IDictionary variables = Environment.GetEnvironmentVariables(); - - Assert.IsTrue(variables.Count == initializeCallDescriptor.EnvironmentVariables.Count); - foreach (string key in variables.Keys) - { - Assert.IsTrue(string.Compare((string)initializeCallDescriptor.EnvironmentVariables[key], (string)variables[key], StringComparison.OrdinalIgnoreCase) == 0); - } - - writeSharedMemory.Reset(); - readSharedMemory.Reset(); - readSharedMemory = null; - writeSharedMemory = null; - } - - [Test] - public void TestLargeSharedMemorySend() - { - string name = Guid.NewGuid().ToString(); - // Create the shared memory buffer - SharedMemory readSharedMemory = - new SharedMemory - ( - name, - SharedMemoryType.ReadOnly, - true - ); - - - SharedMemory writeSharedMemory = - new SharedMemory - ( - name, - SharedMemoryType.WriteOnly, - true - ); - - DualQueue queue = new DualQueue(); - DualQueue hiPriQueue = new DualQueue(); - - int numberOfEvents = 2500; - LocalCallDescriptorForPostLoggingMessagesToHost LargeLogEvent = CreatePostMessageCallDescriptor(numberOfEvents); - queue.Enqueue(LargeLogEvent); - writeSharedMemory.Write(queue, hiPriQueue, false); - IList localCallDescriptorList = readSharedMemory.Read(); - while (localCallDescriptorList == null || localCallDescriptorList.Count == 0) - { - writeSharedMemory.Write(queue, hiPriQueue, false); - localCallDescriptorList = readSharedMemory.Read(); - } - VerifyPostMessagesToHost((LocalCallDescriptorForPostLoggingMessagesToHost)localCallDescriptorList[0], numberOfEvents); - writeSharedMemory.Reset(); - readSharedMemory.Reset(); - readSharedMemory = null; - writeSharedMemory = null; - } - - [Test] - public void TestHiPrioritySend() - { - string name = Guid.NewGuid().ToString(); - // Create the shared memory buffer - SharedMemory readSharedMemory = - new SharedMemory - ( - name, - SharedMemoryType.ReadOnly, - true - ); - - - SharedMemory writeSharedMemory = - new SharedMemory - ( - name, - SharedMemoryType.WriteOnly, - true - ); - - DualQueue queue = new DualQueue(); - DualQueue hiPriQueue = new DualQueue(); - - - int numberOfEvents = 20; - LocalCallDescriptorForPostLoggingMessagesToHost LargeLogEvent = CreatePostMessageCallDescriptor(numberOfEvents); - queue.Enqueue(LargeLogEvent); - LocalCallDescriptorForPostStatus nodeStatusExcept = new LocalCallDescriptorForPostStatus(new NodeStatus(new Exception("I am bad"))); - hiPriQueue.Enqueue(nodeStatusExcept); - - writeSharedMemory.Write(queue, hiPriQueue, true); - IList localCallDescriptorList = readSharedMemory.Read(); - - Assert.IsTrue(localCallDescriptorList.Count == 2); - - VerifyNodeStatus2((LocalCallDescriptorForPostStatus)localCallDescriptorList[0]); - VerifyPostMessagesToHost((LocalCallDescriptorForPostLoggingMessagesToHost)localCallDescriptorList[1], numberOfEvents); - writeSharedMemory.Reset(); - readSharedMemory.Reset(); - readSharedMemory = null; - writeSharedMemory = null; - } - - - [Test] - public void TestExistingBufferDetection() - { - string name = Guid.NewGuid().ToString(); - // Create the shared memory buffer - SharedMemory sharedMemory = - new SharedMemory - ( - name, - SharedMemoryType.ReadOnly, - false // disallow duplicates - ); - - Assert.IsTrue(sharedMemory.IsUsable, "Shared memory should be usable"); - - SharedMemory sharedMemoryDuplicate = - new SharedMemory - ( - name, - SharedMemoryType.ReadOnly, - false // disallow duplicates - ); - - Assert.IsFalse(sharedMemoryDuplicate.IsUsable, "Shared memory should not be usable"); - sharedMemoryDuplicate.Dispose(); - - sharedMemoryDuplicate = - new SharedMemory - ( - name, - SharedMemoryType.ReadOnly, - true // allow duplicates - ); - - Assert.IsTrue(sharedMemoryDuplicate.IsUsable, "Shared memory should be usable"); - sharedMemoryDuplicate.Dispose(); - - sharedMemory.Dispose(); - } - - private void VerifyGetCacheEntries(CacheEntry[] entries) - { - Assert.IsTrue(entries[0] is BuildItemCacheEntry); - Assert.IsTrue(string.Compare(entries[0].Name, "Badger" , StringComparison.OrdinalIgnoreCase) == 0); - BuildItem[] buildItemArray = ((BuildItemCacheEntry)entries[0]).BuildItems; - Assert.IsTrue(buildItemArray.Length == 2); - Assert.IsTrue(string.Compare(buildItemArray[0].Include, "TestInclude1", StringComparison.OrdinalIgnoreCase) == 0); - Assert.IsTrue(string.Compare(buildItemArray[1].Include, "TestInclude2", StringComparison.OrdinalIgnoreCase) == 0); - Assert.IsTrue(string.Compare(buildItemArray[1].Name, "BuildItem2", StringComparison.OrdinalIgnoreCase) == 0); - - Assert.IsTrue(entries[1] is BuildResultCacheEntry); - Assert.IsTrue(string.Compare(entries[1].Name, "Koi", StringComparison.OrdinalIgnoreCase) == 0); - Assert.IsTrue(((BuildResultCacheEntry)entries[1]).BuildResult); - buildItemArray = ((BuildResultCacheEntry)entries[1]).BuildItems; - Assert.IsTrue(buildItemArray.Length == 2); - Assert.IsTrue(string.Compare(buildItemArray[0].Include, "TestInclude1", StringComparison.OrdinalIgnoreCase) == 0); - Assert.IsTrue(string.Compare(buildItemArray[1].Include, "TestInclude2", StringComparison.OrdinalIgnoreCase) == 0); - Assert.IsTrue(string.Compare(buildItemArray[1].Name, "BuildItem2", StringComparison.OrdinalIgnoreCase) == 0); - - Assert.IsTrue(entries[2] is PropertyCacheEntry); - Assert.IsTrue(string.Compare(((PropertyCacheEntry)entries[2]).Name, "Seagull", StringComparison.OrdinalIgnoreCase) == 0); - Assert.IsTrue(string.Compare(((PropertyCacheEntry)entries[2]).Value, "bread", StringComparison.OrdinalIgnoreCase) == 0); - } - - private static CacheEntry[] CreateCacheEntries() - { - CacheEntry[] entries = new CacheEntry[3]; - - BuildItem buildItem1 = new BuildItem("BuildItem1", "Item1"); - BuildItem buildItem2 = new BuildItem("BuildItem2", "Item2"); - buildItem1.Include = "TestInclude1"; - buildItem2.Include = "TestInclude2"; - BuildItem[] buildItems = new BuildItem[2]; - buildItems[0] = buildItem1; - buildItems[1] = buildItem2; - - entries[0] = new BuildItemCacheEntry("Badger", buildItems); - entries[1] = new BuildResultCacheEntry("Koi", buildItems, true); - entries[2] = new PropertyCacheEntry("Seagull", "bread"); - return entries; - } - - private static void VerifyGetCacheEntryFromHost(LocalCallDescriptorForGettingCacheEntriesFromHost getCacheEntriesCallDescriptor) - { - Assert.IsTrue(string.Compare(getCacheEntriesCallDescriptor.Names[0], "Hi", StringComparison.OrdinalIgnoreCase) == 0); - Assert.IsTrue(string.Compare(getCacheEntriesCallDescriptor.Names[1], "Hello", StringComparison.OrdinalIgnoreCase) == 0); - Assert.IsTrue(string.Compare(getCacheEntriesCallDescriptor.ScopeName, "Name", StringComparison.OrdinalIgnoreCase) == 0); - Assert.IsTrue(string.Compare(getCacheEntriesCallDescriptor.ScopeProperties["PropertyName"].Value, "Value", StringComparison.OrdinalIgnoreCase) == 0); - Assert.IsTrue(string.Compare(getCacheEntriesCallDescriptor.ScopeToolsVersion, "3.5", StringComparison.OrdinalIgnoreCase) == 0); - Assert.IsTrue(getCacheEntriesCallDescriptor.ContentType == CacheContentType.Properties); - } - - private static void VerifyNodeStatus2(LocalCallDescriptorForPostStatus nodeStatus2CallDescriptor) - { - Assert.IsTrue(nodeStatus2CallDescriptor.StatusOfNode.IsActive); - Assert.IsFalse(nodeStatus2CallDescriptor.StatusOfNode.IsLaunchInProgress); - Assert.IsTrue(nodeStatus2CallDescriptor.StatusOfNode.QueueDepth == 0); - Assert.IsTrue(nodeStatus2CallDescriptor.StatusOfNode.RequestId == -1); - Assert.IsTrue(string.Compare(nodeStatus2CallDescriptor.StatusOfNode.UnhandledException.Message, "I am bad", StringComparison.OrdinalIgnoreCase) == 0); - } - - private static void VerifyNodeStatus1(LocalCallDescriptorForPostStatus nodeStatus1CallDescriptor) - { - Assert.IsTrue(nodeStatus1CallDescriptor.StatusOfNode.IsActive); - Assert.IsTrue(nodeStatus1CallDescriptor.StatusOfNode.IsLaunchInProgress); - Assert.IsTrue(nodeStatus1CallDescriptor.StatusOfNode.LastLoopActivity == 4); - Assert.IsTrue(nodeStatus1CallDescriptor.StatusOfNode.LastTaskActivity == 3); - Assert.IsTrue(nodeStatus1CallDescriptor.StatusOfNode.QueueDepth == 2); - Assert.IsTrue(nodeStatus1CallDescriptor.StatusOfNode.RequestId == 1); - Assert.IsTrue(nodeStatus1CallDescriptor.StatusOfNode.UnhandledException == null); - } - - private static void ComparebuildRequests(LocalCallDescriptorForPostBuildRequests buildRequestsCallDescriptor) - { - BuildRequest[] requests = buildRequestsCallDescriptor.BuildRequests; - Assert.IsTrue(requests.Length == 2); - BuildEventContext testContext = new BuildEventContext(1, 2, 3, 4); ; - foreach (BuildRequest request1 in requests) - { - Assert.IsTrue(request1.HandleId == 4, "Expected HandleId to Match"); - Assert.IsTrue(request1.RequestId == 1, "Expected Request to Match"); - Assert.IsTrue(string.Compare(request1.ProjectFileName, "ProjectFileName", StringComparison.OrdinalIgnoreCase) == 0, "Expected ProjectFileName to Match"); - Assert.IsTrue(string.Compare(request1.TargetNames[0], "Build", StringComparison.OrdinalIgnoreCase) == 0, "Expected TargetNames to Match"); - Assert.IsTrue(string.Compare(request1.ToolsetVersion, "Tool35", StringComparison.OrdinalIgnoreCase) == 0, "Expected ToolsetVersion to Match"); - Assert.IsTrue(request1.TargetNames.Length == 1, "Expected there to be one TargetName"); - Assert.IsTrue(request1.UnloadProjectsOnCompletion, "Expected UnloadProjectsOnCompletion to be true"); - Assert.IsTrue(request1.UseResultsCache, "Expected UseResultsCache to be true"); - Assert.IsTrue(string.Compare(request1.GlobalProperties["PropertyName"].Value, "Value", StringComparison.OrdinalIgnoreCase) == 0); - Assert.AreEqual(request1.ParentBuildEventContext, testContext, "Expected BuildEventContext to Match"); - } - } - - private static BuildRequest[] CreateBuildRequest() - { - string projectFileName = "ProjectFileName"; - string[] targetNames = new string[] { "Build" }; - BuildPropertyGroup globalProperties = null; - string toolsVersion = "Tool35"; - int requestId = 1; - int handleId = 4; - - globalProperties = new BuildPropertyGroup(); - BuildProperty propertyToAdd = new BuildProperty("PropertyName", "Value"); - globalProperties.SetProperty(propertyToAdd); - BuildRequest[] requests = new BuildRequest[2]; - requests[0] = new BuildRequest(handleId, projectFileName, targetNames, globalProperties, toolsVersion, requestId, true, true); - requests[0].ParentBuildEventContext = new BuildEventContext(1, 2, 3, 4); - requests[1] = new BuildRequest(handleId, projectFileName, targetNames, globalProperties, toolsVersion, requestId, true, true); - requests[1].ParentBuildEventContext = new BuildEventContext(1, 2, 3, 4); - return requests; - } - - private static void CompareBuildResult(LocalCallDescriptorForPostBuildResult buildResultCallDescriptor) - { - BuildResult result = buildResultCallDescriptor.ResultOfBuild; - Assert.IsTrue(result.ResultByTarget.Count == 1); - Assert.IsTrue(((Target.BuildState)result.ResultByTarget["ONE"]) == Target.BuildState.CompletedSuccessfully); - Assert.AreEqual(result.HandleId, 0, "Expected HandleId to Match"); - Assert.AreEqual(result.RequestId, 1, "Expected RequestId to Match"); - Assert.AreEqual(result.UseResultCache, true, "Expected UseResultCache to Match"); - Assert.IsTrue(string.Compare(result.InitialTargets, "Fighter", StringComparison.OrdinalIgnoreCase) == 0, "Expected InitialTargets to Match"); - Assert.IsTrue(string.Compare(result.DefaultTargets, "Foo", StringComparison.OrdinalIgnoreCase) == 0, "Expected DefaultTargets to Match"); - BuildItem[] buildItemArray = ((BuildItem[])result.OutputsByTarget["TaskItems"]); - Assert.IsTrue(buildItemArray.Length == 3); - Assert.IsTrue(string.Compare(buildItemArray[0].Include, "TestInclude1", StringComparison.OrdinalIgnoreCase) == 0); - Assertion.AssertEquals("m1", buildItemArray[0].GetMetadata("m")); - Assertion.AssertEquals("n1", buildItemArray[0].GetMetadata("n")); - Assert.IsTrue(string.Compare(buildItemArray[1].Include, "TestInclude2", StringComparison.OrdinalIgnoreCase) == 0); - Assert.IsTrue(string.Compare(buildItemArray[1].Name, "BuildItem2", StringComparison.OrdinalIgnoreCase) == 0); - Assertion.AssertEquals("m1", buildItemArray[2].GetMetadata("m")); - Assertion.AssertEquals("n1", buildItemArray[2].GetMetadata("n")); - Assertion.AssertEquals("o2", buildItemArray[2].GetMetadata("o")); - Assert.AreEqual(result.TotalTime, 1, "Expected TotalTime to Match"); - Assert.AreEqual(result.EngineTime, 2, "Expected EngineTime to Match"); - Assert.AreEqual(result.TaskTime, 3, "Expected TaskTime to Match"); - } - private static BuildResult CreateBuildResult() - { - BuildItem buildItem1 = new BuildItem(null, "Item1"); - BuildItem buildItem2 = new BuildItem("BuildItem2", "Item2"); - BuildItem buildItem3 = BuildItem_Tests.GetXmlBackedItemWithDefinitionLibrary(); // default metadata m=m1 and o=o1 - buildItem1.Include = "TestInclude1"; - buildItem2.Include = "TestInclude2"; - buildItem1.SetMetadata("m", "m1"); - buildItem1.SetMetadata("n", "n1"); - buildItem3.SetMetadata("n", "n1"); - buildItem3.SetMetadata("o", "o2"); - BuildItem[] taskItems = new BuildItem[3]; - taskItems[0] = buildItem1; - taskItems[1] = buildItem2; - taskItems[2] = buildItem3; - - Dictionary dictionary = new Dictionary(); - dictionary.Add("TaskItems", taskItems); - - BuildResult resultWithOutputs = new BuildResult(dictionary, new Hashtable(StringComparer.OrdinalIgnoreCase), true, 0, 1, 2, true, "Foo", "Fighter", 1, 2, 3); - resultWithOutputs.ResultByTarget.Add("ONE", Target.BuildState.CompletedSuccessfully); - resultWithOutputs.HandleId = 0; - resultWithOutputs.RequestId = 1; - return resultWithOutputs; - } - private static void VerifyUpdateSettings(LocalCallDescriptorForUpdateNodeSettings updateSettingsCallDescriptor) - { - Assert.IsNotNull(updateSettingsCallDescriptor); - Assert.IsTrue(updateSettingsCallDescriptor.LogOnlyCriticalEvents); - Assert.IsTrue(updateSettingsCallDescriptor.UseBreadthFirstTraversal); - Assert.IsTrue(updateSettingsCallDescriptor.CentralizedLogging); - } - private static void VerifyPostMessagesToHost(LocalCallDescriptorForPostLoggingMessagesToHost messageCallDescriptor, int count) - { - Assert.IsTrue(messageCallDescriptor.BuildEvents.Length == count); - for (int i = 0; i < count; i++) - { - Assert.IsTrue(string.Compare("aaaaaaaaaaaaaaa", messageCallDescriptor.BuildEvents[i].BuildEvent.Message, StringComparison.OrdinalIgnoreCase) == 0); - } - } - private static LocalCallDescriptorForPostLoggingMessagesToHost CreatePostMessageCallDescriptor(int numberEvents) - { - NodeLoggingEvent[] eventArray = new NodeLoggingEvent[numberEvents]; - for (int i = 0; i< numberEvents; i++) - { - BuildMessageEventArgs message = new BuildMessageEventArgs("aaaaaaaaaaaaaaa", "aaa", "a", MessageImportance.High); - message.BuildEventContext = new BuildEventContext(1, 2, 3, 4); - eventArray[i] = new NodeLoggingEvent(message); - } - LocalCallDescriptorForPostLoggingMessagesToHost LargeLogEvent = new LocalCallDescriptorForPostLoggingMessagesToHost(eventArray); - return LargeLogEvent; - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/SolutionWrapperProject_Tests.cs b/src/Deprecated/Engine.UnitTests/SolutionWrapperProject_Tests.cs deleted file mode 100644 index 8dcd83f8d6e..00000000000 --- a/src/Deprecated/Engine.UnitTests/SolutionWrapperProject_Tests.cs +++ /dev/null @@ -1,859 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Reflection; -using System.Text; -using System.IO; -using System.Xml; - -using NUnit.Framework; -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class SolutionWrapperProject_Tests - { - /// - /// Verify the SolutionParser.AddNewErrorWarningMessageElement method - /// - /// LukaszG - [Test] - public void AddNewErrorWarningMessageElement() - { - MockLogger logger = new MockLogger(); - Project project = ObjectModelHelpers.CreateInMemoryProject( - "" + - "" + - "" + - "", - logger); - - Target target = project.Targets["Build"]; - - SolutionWrapperProject.AddErrorWarningMessageElement(target, XMakeElements.message, true, "SolutionVenusProjectNoClean"); - SolutionWrapperProject.AddErrorWarningMessageElement(target, XMakeElements.warning, true, "SolutionParseUnknownProjectType", "proj1.csproj"); - SolutionWrapperProject.AddErrorWarningMessageElement(target, XMakeElements.error, true, "SolutionVCProjectNoPublish"); - - project.Build(null, null); - - string code = null; - string keyword = null; - string text = ResourceUtilities.FormatResourceString(out code, out keyword, "SolutionParseUnknownProjectType", "proj1.csproj"); - - // check the error event - Assertion.AssertEquals(1, logger.Warnings.Count); - BuildWarningEventArgs warning = logger.Warnings[0]; - - Assertion.AssertEquals(text, warning.Message); - Assertion.AssertEquals(code, warning.Code); - Assertion.AssertEquals(keyword, warning.HelpKeyword); - - code = null; - keyword = null; - text = ResourceUtilities.FormatResourceString(out code, out keyword, "SolutionVCProjectNoPublish"); - - // check the warning event - Assertion.AssertEquals(1, logger.Errors.Count); - BuildErrorEventArgs error = logger.Errors[0]; - - Assertion.AssertEquals(text, error.Message); - Assertion.AssertEquals(code, error.Code); - Assertion.AssertEquals(keyword, error.HelpKeyword); - - code = null; - keyword = null; - text = ResourceUtilities.FormatResourceString(out code, out keyword, "SolutionVenusProjectNoClean"); - - // check the message event - Assertion.Assert("Log should contain the regular message", logger.FullLog.Contains(text)); - } - - /// - /// Test to make sure we properly set the ToolsVersion attribute on the in-memory project based - /// on the Solution File Format Version. - /// - [Test] - public void EmitToolsVersionAttributeToInMemoryProject9() - { - if (FrameworkLocationHelper.PathToDotNetFrameworkV35 != null) - { - string solutionFileContents = - @" - Microsoft Visual Studio Solution File, Format Version 9.00 - Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Release|Any CPU = Release|Any CPU - Release|Win32 = Release|Win32 - Other|Any CPU = Other|Any CPU - Other|Win32 = Other|Win32 - EndGlobalSection - EndGlobal - "; - - SolutionParser solution = SolutionParser_Tests.ParseSolutionHelper(solutionFileContents); - - Project msbuildProject = new Project(); - - SolutionWrapperProject.Generate(solution, msbuildProject, "3.5", new BuildEventContext(0, 0, 0, 0)); - - Assertion.AssertEquals("3.5", msbuildProject.DefaultToolsVersion); - } - else - { - Assert.Ignore(".NET Framework 3.5 is required for this test, but is not installed."); - } - } - - /// - /// Test to make sure we properly set the ToolsVersion attribute on the in-memory project based - /// on the Solution File Format Version. - /// - [Test] - public void EmitToolsVersionAttributeToInMemoryProject10() - { - string solutionFileContents = - @" - Microsoft Visual Studio Solution File, Format Version 10.00 - Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Release|Any CPU = Release|Any CPU - Release|Win32 = Release|Win32 - Other|Any CPU = Other|Any CPU - Other|Win32 = Other|Win32 - EndGlobalSection - EndGlobal - "; - - SolutionParser solution = SolutionParser_Tests.ParseSolutionHelper(solutionFileContents); - - Project msbuildProject = new Project(); - - SolutionWrapperProject.Generate(solution, msbuildProject, "4.0", new BuildEventContext(0, 0, 0, 0)); - - Assertion.AssertEquals("4.0", msbuildProject.DefaultToolsVersion); - } - - /// - /// Test the SolutionWrapperProject.AddPropertyGroupForSolutionConfiguration method - /// - /// LukaszG - [Test] - public void TestAddPropertyGroupForSolutionConfiguration() - { - string solutionFileContents = - @" - Microsoft Visual Studio Solution File, Format Version 9.00 - # Visual Studio 2005 - Project('{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}') = 'ClassLibrary1', 'ClassLibrary1\ClassLibrary1.csproj', '{6185CC21-BE89-448A-B3C0-D1C27112E595}' - EndProject - Project('{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}') = 'MainApp', 'MainApp\MainApp.vcxproj', '{A6F99D27-47B9-4EA4-BFC9-25157CBDC281}' - EndProject - Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Mixed Platforms = Debug|Mixed Platforms - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6185CC21-BE89-448A-B3C0-D1C27112E595}.Debug|Mixed Platforms.ActiveCfg = CSConfig1|Any CPU - {6185CC21-BE89-448A-B3C0-D1C27112E595}.Debug|Mixed Platforms.Build.0 = CSConfig1|Any CPU - {6185CC21-BE89-448A-B3C0-D1C27112E595}.Release|Any CPU.ActiveCfg = CSConfig2|Any CPU - {A6F99D27-47B9-4EA4-BFC9-25157CBDC281}.Debug|Mixed Platforms.ActiveCfg = VCConfig1|Win32 - {A6F99D27-47B9-4EA4-BFC9-25157CBDC281}.Debug|Mixed Platforms.Build.0 = VCConfig1|Win32 - EndGlobalSection - EndGlobal - "; - - SolutionParser solution = SolutionParser_Tests.ParseSolutionHelper(solutionFileContents); - - Engine engine = new Engine(); - Project msbuildProject = new Project(engine); - - foreach (ConfigurationInSolution solutionConfiguration in solution.SolutionConfigurations) - { - SolutionWrapperProject.AddPropertyGroupForSolutionConfiguration(msbuildProject, solution, solutionConfiguration); - } - - // Both projects configurations should be present for solution configuration "Debug|Mixed Platforms" - msbuildProject.GlobalProperties.SetProperty("Configuration", "Debug"); - msbuildProject.GlobalProperties.SetProperty("Platform", "Mixed Platforms"); - - string solutionConfigurationContents = msbuildProject.GetEvaluatedProperty("CurrentSolutionConfigurationContents"); - - Assertion.Assert(solutionConfigurationContents.Contains("{6185CC21-BE89-448A-B3C0-D1C27112E595}")); - Assertion.Assert(solutionConfigurationContents.Contains("CSConfig1|AnyCPU")); - - Assertion.Assert(solutionConfigurationContents.Contains("{A6F99D27-47B9-4EA4-BFC9-25157CBDC281}")); - Assertion.Assert(solutionConfigurationContents.Contains("VCConfig1|Win32")); - - // Only the C# project should be present for solution configuration "Release|Any CPU", since the VC project - // is missing - msbuildProject.GlobalProperties.SetProperty("Configuration", "Release"); - msbuildProject.GlobalProperties.SetProperty("Platform", "Any CPU"); - - solutionConfigurationContents = msbuildProject.GetEvaluatedProperty("CurrentSolutionConfigurationContents"); - - Assertion.Assert(solutionConfigurationContents.Contains("{6185CC21-BE89-448A-B3C0-D1C27112E595}")); - Assertion.Assert(solutionConfigurationContents.Contains("CSConfig2|AnyCPU")); - - Assertion.Assert(!solutionConfigurationContents.Contains("{A6F99D27-47B9-4EA4-BFC9-25157CBDC281}")); - } - - /// - /// Test that the in memory project created from a solution file exposes an MSBuild property which, - /// if set when building a solution, will be specified as the ToolsVersion on the MSBuild task when - /// building the projects contained within the solution. - /// - [Test] - public void ToolsVersionOverrideShouldBeSpecifiedOnMSBuildTaskInvocations() - { - string solutionFileContents = - @" - Microsoft Visual Studio Solution File, Format Version 9.00 - # Visual Studio 2005 - Project('{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}') = 'ClassLibrary1', 'ClassLibrary1\ClassLibrary1.csproj', '{6185CC21-BE89-448A-B3C0-D1C27112E595}' - EndProject - Project('{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}') = 'MainApp', 'MainApp\MainApp.vcxproj', '{A6F99D27-47B9-4EA4-BFC9-25157CBDC281}' - EndProject - Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Mixed Platforms = Debug|Mixed Platforms - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6185CC21-BE89-448A-B3C0-D1C27112E595}.Debug|Mixed Platforms.ActiveCfg = CSConfig1|Any CPU - {6185CC21-BE89-448A-B3C0-D1C27112E595}.Debug|Mixed Platforms.Build.0 = CSConfig1|Any CPU - {6185CC21-BE89-448A-B3C0-D1C27112E595}.Release|Any CPU.ActiveCfg = CSConfig2|Any CPU - {A6F99D27-47B9-4EA4-BFC9-25157CBDC281}.Debug|Mixed Platforms.ActiveCfg = VCConfig1|Win32 - {A6F99D27-47B9-4EA4-BFC9-25157CBDC281}.Debug|Mixed Platforms.Build.0 = VCConfig1|Win32 - EndGlobalSection - EndGlobal - "; - - // We're not passing in a /tv:xx switch, so the solution project will have tools version 3.5 - Project project = new Project(); - SolutionParser solution = SolutionParser_Tests.ParseSolutionHelper(solutionFileContents); - BuildEventContext buildEventContext = new BuildEventContext(0, 0, 0, 0); - SolutionWrapperProject.Generate(solution, project, "3.5", buildEventContext); - - foreach (Target target in project.Targets) - { - foreach (XmlNode childNode in target.TargetElement) - { - if (0 == String.Compare(childNode.Name, "MSBuild", StringComparison.OrdinalIgnoreCase)) - { - // we found an MSBuild task invocation, now let's verify that it has the correct - // ToolsVersion parameter set - XmlAttribute toolsVersionAttribute = childNode.Attributes["ToolsVersion"]; - - Assertion.Assert(0 == String.Compare( - toolsVersionAttribute.Value, - "$(ProjectToolsVersion)", - StringComparison.OrdinalIgnoreCase) - ); - } - } - } - - } - - /// - /// Test the SolutionWrapperProject.Generate method with an invalid toolset -- will default to v4.0. - /// - /// jerelf - [Test] - public void ToolsVersionOverrideThrowsOnInvalidToolsVersion() - { - string solutionFileContents = - @" - Microsoft Visual Studio Solution File, Format Version 9.00 - # Visual Studio 2005 - Project('{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}') = 'ClassLibrary1', 'ClassLibrary1\ClassLibrary1.csproj', '{6185CC21-BE89-448A-B3C0-D1C27112E595}' - EndProject - Project('{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}') = 'MainApp', 'MainApp\MainApp.vcxproj', '{A6F99D27-47B9-4EA4-BFC9-25157CBDC281}' - EndProject - Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Mixed Platforms = Debug|Mixed Platforms - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6185CC21-BE89-448A-B3C0-D1C27112E595}.Debug|Mixed Platforms.ActiveCfg = CSConfig1|Any CPU - {6185CC21-BE89-448A-B3C0-D1C27112E595}.Debug|Mixed Platforms.Build.0 = CSConfig1|Any CPU - {6185CC21-BE89-448A-B3C0-D1C27112E595}.Release|Any CPU.ActiveCfg = CSConfig2|Any CPU - {A6F99D27-47B9-4EA4-BFC9-25157CBDC281}.Debug|Mixed Platforms.ActiveCfg = VCConfig1|Win32 - {A6F99D27-47B9-4EA4-BFC9-25157CBDC281}.Debug|Mixed Platforms.Build.0 = VCConfig1|Win32 - EndGlobalSection - EndGlobal - "; - - string oldUseNoCacheValue = Environment.GetEnvironmentVariable("MSBuildUseNoSolutionCache"); - - try - { - // We want to avoid using the solution cache -- it could lead to circumstances where detritus left - // on the disk leads us down paths we didn't mean to go. - Environment.SetEnvironmentVariable("MSBuildUseNoSolutionCache", "1"); - - // We're not passing in a /tv:xx switch, so the solution project will have tools version 3.5 - Project project = new Project(); - SolutionParser solution = SolutionParser_Tests.ParseSolutionHelper(solutionFileContents); - BuildEventContext buildEventContext = new BuildEventContext(0, 0, 0, 0); - - SolutionWrapperProject.Generate(solution, project, "invalid", buildEventContext); - - Assertion.AssertEquals("4.0", project.DefaultToolsVersion); - } - finally - { - Environment.SetEnvironmentVariable("MSBuildUseNoSolutionCache", oldUseNoCacheValue); - } - } - - /// - /// Test the SolutionWrapperProject.AddPropertyGroupForSolutionConfiguration method - /// - /// LukaszG - [Test] - public void TestDisambiguateProjectTargetName() - { - string solutionFileContents = - @" - Microsoft Visual Studio Solution File, Format Version 9.00 - # Visual Studio 2005 - Project('{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}') = 'Build', 'Build\Build.csproj', '{21397922-C38F-4A0E-B950-77B3FBD51881}' - EndProject - Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {21397922-C38F-4A0E-B950-77B3FBD51881}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {21397922-C38F-4A0E-B950-77B3FBD51881}.Debug|Any CPU.Build.0 = Debug|Any CPU - {21397922-C38F-4A0E-B950-77B3FBD51881}.Release|Any CPU.ActiveCfg = Release|Any CPU - {21397922-C38F-4A0E-B950-77B3FBD51881}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - EndGlobal - "; - - SolutionParser solution = SolutionParser_Tests.ParseSolutionHelper(solutionFileContents); - - Project msbuildProject = new Project(); - - SolutionWrapperProject.Generate(solution, msbuildProject, null, null); - - Assertion.AssertNotNull(msbuildProject.Targets["Build"]); - Assertion.AssertNotNull(msbuildProject.Targets["Solution:Build"]); - Assertion.AssertNotNull(msbuildProject.Targets["Solution:Build:Clean"]); - Assertion.AssertNotNull(msbuildProject.Targets["Solution:Build:Rebuild"]); - Assertion.AssertNotNull(msbuildProject.Targets["Solution:Build:Publish"]); - Assertion.AssertEquals(null, msbuildProject.Targets["Build"].TargetElement.ChildNodes[0].Attributes["Targets"]); - Assertion.AssertEquals("Clean", msbuildProject.Targets["Clean"].TargetElement.ChildNodes[0].Attributes["Targets"].Value); - Assertion.AssertEquals("Rebuild", msbuildProject.Targets["Rebuild"].TargetElement.ChildNodes[0].Attributes["Targets"].Value); - Assertion.AssertEquals("Publish", msbuildProject.Targets["Publish"].TargetElement.ChildNodes[0].Attributes["Targets"].Value); - Assertion.AssertEquals("@(BuildLevel0)", msbuildProject.Targets["Build"].TargetElement.ChildNodes[0].Attributes["Projects"].Value); - Assertion.AssertEquals("@(BuildLevel0)", msbuildProject.Targets["Clean"].TargetElement.ChildNodes[0].Attributes["Projects"].Value); - Assertion.AssertEquals("@(BuildLevel0)", msbuildProject.Targets["Rebuild"].TargetElement.ChildNodes[0].Attributes["Projects"].Value); - Assertion.AssertEquals("@(BuildLevel0)", msbuildProject.Targets["Publish"].TargetElement.ChildNodes[0].Attributes["Projects"].Value); - - // Here we check that the set of standard entry point targets in the solution project - // matches those defined in ProjectInSolution.projectNamesToDisambiguate = { "Build", "Rebuild", "Clean", "Publish" }; - int countOfStandardTargets = 0; - foreach (Target t in msbuildProject.Targets) - { - if (!t.Name.Contains(":")) - { - countOfStandardTargets += 1; - } - } - - // NOTE: ValidateSolutionConfiguration and ValidateToolsVersions are always added, so we need to add two extras - Assertion.AssertEquals(ProjectInSolution.projectNamesToDisambiguate.Length + 2, countOfStandardTargets); - } - - /// - /// Tests the algorithm for choosing default configuration/platform values for solutions - /// - /// LukaszG - [Test] - public void TestConfigurationPlatformDefaults1() - { - string solutionFileContents = - @" - Microsoft Visual Studio Solution File, Format Version 9.00 - Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|Mixed Platforms = Debug|Mixed Platforms - Debug|Win32 = Debug|Win32 - Release|Any CPU = Release|Any CPU - Release|Mixed Platforms = Release|Mixed Platforms - Release|Win32 = Release|Win32 - EndGlobalSection - EndGlobal - "; - - SolutionParser solution = SolutionParser_Tests.ParseSolutionHelper(solutionFileContents); - - Project msbuildProject = new Project(); - SolutionWrapperProject.Generate(solution, msbuildProject, null, null); - - // Default for Configuration is "Debug", if present - Assertion.AssertEquals("Debug", msbuildProject.GetEvaluatedProperty("Configuration")); - - // Default for Platform is "Mixed Platforms", if present - Assertion.AssertEquals("Mixed Platforms", msbuildProject.GetEvaluatedProperty("Platform")); - } - - /// - /// Tests the algorithm for choosing default configuration/platform values for solutions - /// - /// LukaszG - [Test] - public void TestConfigurationPlatformDefaults2() - { - string solutionFileContents = - @" - Microsoft Visual Studio Solution File, Format Version 9.00 - Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Release|Any CPU = Release|Any CPU - Release|Win32 = Release|Win32 - Other|Any CPU = Other|Any CPU - Other|Win32 = Other|Win32 - EndGlobalSection - EndGlobal - "; - - SolutionParser solution = SolutionParser_Tests.ParseSolutionHelper(solutionFileContents); - - Project msbuildProject = new Project(); - - SolutionWrapperProject.Generate(solution, msbuildProject, null, null); - - // If "Debug" is not present, just pick the first configuration name - Assertion.AssertEquals("Release", msbuildProject.GetEvaluatedProperty("Configuration")); - - // if "Mixed Platforms" is not present, just pick the first platform name - Assertion.AssertEquals("Any CPU", msbuildProject.GetEvaluatedProperty("Platform")); - } - - /// - /// Tests the algorithm for choosing default Venus configuration values for solutions - /// - /// LukaszG - [Test] - public void TestVenusConfigurationDefaults() - { - Project msbuildProject = CreateVenusSolutionProject(); - - // ASP.NET configuration should match the selected solution configuration - msbuildProject.GlobalProperties.SetProperty("Configuration", "Debug"); - Assertion.AssertEquals("Debug", msbuildProject.GetEvaluatedProperty("AspNetConfiguration")); - - msbuildProject.GlobalProperties.SetProperty("Configuration", "Release"); - Assertion.AssertEquals("Release", msbuildProject.GetEvaluatedProperty("AspNetConfiguration")); - - msbuildProject.GlobalProperties.SetProperty("Configuration", "Other"); - Assertion.AssertEquals("Other", msbuildProject.GetEvaluatedProperty("AspNetConfiguration")); - - // Check that the two standard Asp.net configurations are represented on the targets - Assertion.Assert(msbuildProject.Targets["C:\\solutions\\WebSite2\\"].Condition.Contains("'$(Configuration)' == 'Release'")); - Assertion.Assert(msbuildProject.Targets["C:\\solutions\\WebSite2\\"].Condition.Contains("'$(Configuration)' == 'Debug'")); - } - - [Test] - public void DefaultTargetFrameworkVersion() - { - Project msbuildProject = CreateVenusSolutionProject(); - - // v3.5 by default - Assertion.AssertEquals("v4.0", msbuildProject.EvaluatedProperties["TargetFrameworkVersion"].Value); - // may be user defined - msbuildProject.SetProperty("TargetFrameworkVersion", "userdefined"); - Assertion.AssertEquals("userdefined", msbuildProject.EvaluatedProperties["TargetFrameworkVersion"].Value); - // v2.0 if MSBuildToolsVersion is 2.0 - msbuildProject.SetProperty("TargetFrameworkVersion", String.Empty); - msbuildProject.ToolsVersion = "2.0"; - Assertion.AssertEquals("v2.0", msbuildProject.EvaluatedProperties["TargetFrameworkVersion"].Value); - } - - /// - /// Tests the algorithm for choosing target framework paths for ResolveAssemblyReferences for Venus - /// - [Test] - public void TestTargetFrameworkPaths0() - { - BuildPropertyGroup globalProperties = new BuildPropertyGroup(); - globalProperties.SetProperty("TargetFrameworkVersion", "v2.0"); - - Project msbuildProject = CreateVenusSolutionProject(globalProperties, "4.0"); - - // ToolsVersion is 2.0, TargetFrameworkVersion is v2.0 --> one item pointing to v2.0 - msbuildProject.ToolsVersion = "4.0"; - - bool success = msbuildProject.Build("GetFrameworkPathAndRedistList"); - Assertion.AssertEquals(true, success); - - AssertProjectContainsItem(msbuildProject, "_CombinedTargetFrameworkDirectoriesItem", FrameworkLocationHelper.PathToDotNetFrameworkV20); - AssertProjectItemNameCount(msbuildProject, "_CombinedTargetFrameworkDirectoriesItem", 1); - } - - /// - /// Tests the algorithm for choosing target framework paths for ResolveAssemblyReferences for Venus - /// - [Test] - public void TestTargetFrameworkPaths1() - { - Project msbuildProject = CreateVenusSolutionProject(); - - // ToolsVersion is 3.5, TargetFrameworkVersion is v2.0 --> one item pointing to v2.0 - msbuildProject.SetProperty("TargetFrameworkVersion", "v2.0"); - bool success = msbuildProject.Build("GetFrameworkPathAndRedistList"); - Assertion.AssertEquals(true, success); - - AssertProjectContainsItem(msbuildProject, "_CombinedTargetFrameworkDirectoriesItem", FrameworkLocationHelper.PathToDotNetFrameworkV20); - AssertProjectItemNameCount(msbuildProject, "_CombinedTargetFrameworkDirectoriesItem", 1); - } - - /// - /// Tests the algorithm for choosing target framework paths for ResolveAssemblyReferences for Venus - /// - [Test] - public void TestTargetFrameworkPaths2() - { - Project msbuildProject = CreateVenusSolutionProject(); - - // ToolsVersion is 3.5, TargetFrameworkVersion is v3.5 --> items for v2.0 and v3.5 - msbuildProject.SetProperty("TargetFrameworkVersion", "v3.5"); - bool success = msbuildProject.Build("GetFrameworkPathAndRedistList"); - Assertion.AssertEquals(true, success); - - AssertProjectContainsItem(msbuildProject, "_CombinedTargetFrameworkDirectoriesItem", FrameworkLocationHelper.PathToDotNetFrameworkV20); - if (FrameworkLocationHelper.PathToDotNetFrameworkV35 != null && FrameworkLocationHelper.PathToDotNetFrameworkV30 != null) - { - AssertProjectContainsItem(msbuildProject, "_CombinedTargetFrameworkDirectoriesItem", FrameworkLocationHelper.PathToDotNetFrameworkV35); - AssertProjectContainsItem(msbuildProject, "_CombinedTargetFrameworkDirectoriesItem", FrameworkLocationHelper.PathToDotNetFrameworkV30); - AssertProjectItemNameCount(msbuildProject, "_CombinedTargetFrameworkDirectoriesItem", 3); - } - else if (FrameworkLocationHelper.PathToDotNetFrameworkV30 != null) - { - AssertProjectContainsItem(msbuildProject, "_CombinedTargetFrameworkDirectoriesItem", FrameworkLocationHelper.PathToDotNetFrameworkV30); - AssertProjectItemNameCount(msbuildProject, "_CombinedTargetFrameworkDirectoriesItem", 2); - } - else if (FrameworkLocationHelper.PathToDotNetFrameworkV35 != null) - { - AssertProjectContainsItem(msbuildProject, "_CombinedTargetFrameworkDirectoriesItem", FrameworkLocationHelper.PathToDotNetFrameworkV35); - AssertProjectItemNameCount(msbuildProject, "_CombinedTargetFrameworkDirectoriesItem", 2); - } - else - { - AssertProjectItemNameCount(msbuildProject, "_CombinedTargetFrameworkDirectoriesItem", 1); - } - } - - private static Project CreateVenusSolutionProject() - { - return CreateVenusSolutionProject(null); - } - - private static Project CreateVenusSolutionProject(BuildPropertyGroup globalProperties) - { - return CreateVenusSolutionProject(globalProperties, "4.0"); - } - - private static Project CreateVenusSolutionProject(BuildPropertyGroup globalProperties, string toolsVersion) - { - string solutionFileContents = - @" - Microsoft Visual Studio Solution File, Format Version 9.00 - # Visual Studio 2005 - Project('{E24C65DC-7377-472B-9ABA-BC803B73C61A}') = 'C:\solutions\WebSite2\', '..\..\solutions\WebSite2\', '{F90528C4-6989-4D33-AFE8-F53173597CC2}' - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.VirtualPath = '/WebSite2' - Debug.AspNetCompiler.PhysicalPath = '..\..\solutions\WebSite2\' - Debug.AspNetCompiler.TargetPath = 'PrecompiledWeb\WebSite2\' - Debug.AspNetCompiler.Updateable = 'true' - Debug.AspNetCompiler.ForceOverwrite = 'true' - Debug.AspNetCompiler.FixedNames = 'true' - Debug.AspNetCompiler.Debug = 'True' - Release.AspNetCompiler.VirtualPath = '/WebSite2' - Release.AspNetCompiler.PhysicalPath = '..\..\solutions\WebSite2\' - Release.AspNetCompiler.TargetPath = 'PrecompiledWeb\WebSite2\' - Release.AspNetCompiler.Updateable = 'true' - Release.AspNetCompiler.ForceOverwrite = 'true' - Release.AspNetCompiler.FixedNames = 'true' - Release.AspNetCompiler.Debug = 'False' - VWDPort = '2776' - DefaultWebSiteLanguage = 'Visual C#' - EndProjectSection - EndProject - Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {F90528C4-6989-4D33-AFE8-F53173597CC2}.Debug|Any CPU.ActiveCfg = Debug|.NET - {F90528C4-6989-4D33-AFE8-F53173597CC2}.Debug|Any CPU.Build.0 = Debug|.NET - EndGlobalSection - EndGlobal - "; - - SolutionParser solution = SolutionParser_Tests.ParseSolutionHelper(solutionFileContents); - - Engine engine = new Engine(globalProperties); - Project msbuildProject = new Project(engine); - - SolutionWrapperProject.Generate(solution, msbuildProject, toolsVersion, null); - return msbuildProject; - } - - private void AssertProjectContainsItem(Project msbuildProject, string itemName, string itemSpec) - { - BuildItemGroup itemGroup = (BuildItemGroup)msbuildProject.EvaluatedItemsByName[itemName]; - Assertion.AssertNotNull(itemGroup); - - foreach(BuildItem item in itemGroup) - { - if (item.Name == itemName && item.EvaluatedItemSpec == itemSpec) - { - return; - } - } - - Assertion.Assert(false); - } - - private void AssertProjectItemNameCount(Project msbuildProject, string itemName, int count) - { - BuildItemGroup itemGroup = (BuildItemGroup)msbuildProject.EvaluatedItemsByName[itemName]; - Assertion.AssertNotNull(itemGroup); - Assertion.AssertEquals(count, itemGroup.Count); - } - - /// - /// Test the PredictActiveSolutionConfigurationName method - /// - /// LukaszG - [Test] - public void TestPredictSolutionConfigurationName() - { - string solutionFileContents = - @" - Microsoft Visual Studio Solution File, Format Version 9.00 - Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Release|Mixed Platforms = Release|Mixed Platforms - Release|Win32 = Release|Win32 - Debug|Mixed Platforms = Debug|Mixed Platforms - Debug|Win32 = Debug|Win32 - EndGlobalSection - EndGlobal - "; - - SolutionParser solution = SolutionParser_Tests.ParseSolutionHelper(solutionFileContents); - Engine engine = new Engine(); - - Assertion.AssertEquals("Debug|Mixed Platforms", SolutionWrapperProject.PredictActiveSolutionConfigurationName(solution, engine)); - - engine.GlobalProperties.SetProperty("Configuration", "Release"); - Assertion.AssertEquals("Release|Mixed Platforms", SolutionWrapperProject.PredictActiveSolutionConfigurationName(solution, engine)); - - engine.GlobalProperties.SetProperty("Platform", "Win32"); - Assertion.AssertEquals("Release|Win32", SolutionWrapperProject.PredictActiveSolutionConfigurationName(solution, engine)); - - engine.GlobalProperties.SetProperty("Configuration", "Nonexistent"); - Assertion.AssertEquals(null, SolutionWrapperProject.PredictActiveSolutionConfigurationName(solution, engine)); - } - - /// - /// We had a bug where turning on the environment variable MSBuildEmitSolution=1 caused - /// a VerifyThrow to get fired in the engine, because the temp project that is saved - /// to disk gets loaded into the engine when it shouldn't have. - /// - /// RGoel - [Test] - public void SolutionParserShouldNotIncreaseNumberOfProjectsLoadedByHost() - { - string oldValueForMSBuildEmitSolution = Environment.GetEnvironmentVariable("MSBuildEmitSolution"); - Environment.SetEnvironmentVariable("MSBuildEmitSolution", "1"); - - string solutionFileContents = - @" - Microsoft Visual Studio Solution File, Format Version 9.00 - # Visual Studio 2005 - Project('{F184B08F-C81C-45F6-A57F-5ABD9991F28F}') = 'ConsoleApplication1', 'ConsoleApplication1\ConsoleApplication1.vbproj', '{AB3413A6-D689-486D-B7F0-A095371B3F13}' - EndProject - Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|AnyCPU = Debug|AnyCPU - Release|AnyCPU = Release|AnyCPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {AB3413A6-D689-486D-B7F0-A095371B3F13}.Debug|AnyCPU.ActiveCfg = Debug|AnyCPU - {AB3413A6-D689-486D-B7F0-A095371B3F13}.Debug|AnyCPU.Build.0 = Debug|AnyCPU - {AB3413A6-D689-486D-B7F0-A095371B3F13}.Release|AnyCPU.ActiveCfg = Release|AnyCPU - {AB3413A6-D689-486D-B7F0-A095371B3F13}.Release|AnyCPU.Build.0 = Release|AnyCPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - EndGlobal - "; - - SolutionParser solution = SolutionParser_Tests.ParseSolutionHelper(solutionFileContents); - Engine engine = new Engine(); - Project project = new Project(engine, null); - - // This project considers itself loaded-by-host. Setting a file name on it, causes it to - // ensure the engine believes it is loaded-by-host... - project.FullFileName = "my project"; - - Assertion.AssertEquals(1, engine.ProjectsLoadedByHost.Count); - - // Create a bogus cache file in the same place -- just to exercise the solution wrapper code that creates a new project - string solutionCacheFile = solution.SolutionFile + ".cache"; - using (StreamWriter writer = new StreamWriter(solutionCacheFile)) - { - writer.WriteLine("xxx"); - } - SolutionWrapperProject.Generate(solution, project, null, null); - - Assertion.AssertEquals(1, engine.ProjectsLoadedByHost.Count); - - // Clean up. Delete temp files and reset environment variables. - Assertion.Assert("Solution parser should have written in-memory project to disk", - File.Exists(solution.SolutionFile + ".proj")); - File.Delete(solution.SolutionFile + ".proj"); - File.Delete(solutionCacheFile); - - Environment.SetEnvironmentVariable("MSBuildEmitSolution", oldValueForMSBuildEmitSolution); - } - - /// - /// Make sure that we output a warning and don't build anything when we're given an invalid - /// solution configuration and SkipInvalidConfigurations is set to true. - /// - /// LukaszG - [Test] - public void TestSkipInvalidConfigurationsCase() - { - string tmpFileName = Path.GetTempFileName(); - File.Delete(tmpFileName); - string projectFilePath = tmpFileName + ".sln"; - - string solutionContents = - @" - Microsoft Visual Studio Solution File, Format Version 9.00 - # Visual Studio 2005 - Project('{E24C65DC-7377-472B-9ABA-BC803B73C61A}') = 'C:\solutions\WebSite2\', '..\..\solutions\WebSite2\', '{F90528C4-6989-4D33-AFE8-F53173597CC2}' - ProjectSection(WebsiteProperties) = preProject - Debug.AspNetCompiler.VirtualPath = '/WebSite2' - Debug.AspNetCompiler.PhysicalPath = '..\..\solutions\WebSite2\' - Debug.AspNetCompiler.TargetPath = 'PrecompiledWeb\WebSite2\' - Debug.AspNetCompiler.Updateable = 'true' - Debug.AspNetCompiler.ForceOverwrite = 'true' - Debug.AspNetCompiler.FixedNames = 'true' - Debug.AspNetCompiler.Debug = 'True' - Release.AspNetCompiler.VirtualPath = '/WebSite2' - Release.AspNetCompiler.PhysicalPath = '..\..\solutions\WebSite2\' - Release.AspNetCompiler.TargetPath = 'PrecompiledWeb\WebSite2\' - Release.AspNetCompiler.Updateable = 'true' - Release.AspNetCompiler.ForceOverwrite = 'true' - Release.AspNetCompiler.FixedNames = 'true' - Release.AspNetCompiler.Debug = 'False' - VWDPort = '2776' - DefaultWebSiteLanguage = 'Visual C#' - EndProjectSection - EndProject - Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {F90528C4-6989-4D33-AFE8-F53173597CC2}.Debug|Any CPU.ActiveCfg = Debug|.NET - {F90528C4-6989-4D33-AFE8-F53173597CC2}.Debug|Any CPU.Build.0 = Debug|.NET - EndGlobalSection - EndGlobal"; - - File.WriteAllText(projectFilePath, solutionContents.Replace('\'', '"')); - - try - { - MockLogger logger = new MockLogger(); - Engine engine = new Engine(); - engine.RegisterLogger(logger); - - Project solutionWrapperProject = new Project(engine); - solutionWrapperProject.Load(projectFilePath); - - solutionWrapperProject.SetProperty("Configuration", "Nonexistent"); - solutionWrapperProject.SetProperty("SkipInvalidConfigurations", "true"); - solutionWrapperProject.ToolsVersion = "4.0"; - - // Build should complete successfully even with an invalid solution config if SkipInvalidConfigurations is true - Assertion.AssertEquals(true, solutionWrapperProject.Build(null, null)); - - // We should get the invalid solution configuration warning - Assertion.AssertEquals(1, logger.Warnings.Count); - BuildWarningEventArgs warning = logger.Warnings[0]; - - // Don't look at warning.Code here -- it may be null if PseudoLoc has messed - // with our resource strings. The code will still be in the log -- it just wouldn't get - // pulled out into the code field. - logger.AssertLogContains("MSB4126"); - - // No errors expected - Assertion.AssertEquals(0, logger.Errors.Count); - } - finally - { - File.Delete(projectFilePath); - } - } - - /// - /// Convert passed in solution file to an MSBuild project. This method is used by Sln2Proj - /// - /// vladf - public bool ConvertSLN2Proj(string nameSolutionFile) - { - // Set the environment variable to cause the SolutionWrapperProject to emit the project to disk - string oldValueForMSBuildEmitSolution = Environment.GetEnvironmentVariable("MSBuildEmitSolution"); - Environment.SetEnvironmentVariable("MSBuildEmitSolution", "1"); - - if (nameSolutionFile == null || !File.Exists(nameSolutionFile)) - { - return false; - } - - // Parse the solution - SolutionParser solution = new SolutionParser(); - solution.SolutionFile = nameSolutionFile; - solution.ParseSolutionFile(); - - // Generate the in-memory MSBuild project and output it to disk - Project project = new Project(); - SolutionWrapperProject.Generate(solution, project, "4.0", null); - - - //Reset the environment variable - Environment.SetEnvironmentVariable("MSBuildEmitSolution", oldValueForMSBuildEmitSolution); - - return true; - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/TargetCollection_Tests.cs b/src/Deprecated/Engine.UnitTests/TargetCollection_Tests.cs deleted file mode 100644 index 86236768ef1..00000000000 --- a/src/Deprecated/Engine.UnitTests/TargetCollection_Tests.cs +++ /dev/null @@ -1,888 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Reflection; -using System.Collections; -using System.IO; -using NUnit.Framework; -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine; -using System.Text.RegularExpressions; -using System.Xml; - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class AddTargetToCollection_Tests - { - private Engine engine; - private Project myProject; - private MockLogger myLogger; - - /// - /// Creates the engine and parent object. Also registers the mock logger. - /// - [SetUp()] - public void Initialize() - { - engine = new Engine(); - myProject = new Project(engine); - myLogger = new MockLogger(); - myProject.ParentEngine.RegisterLogger(myLogger); - } - - /// - /// Unloads projects and un-registers logger. - /// - [TearDown()] - public void Cleanup() - { - engine.UnloadProject(myProject); - engine.UnregisterAllLoggers(); - engine = null; - myProject = null; - myLogger = null; - } - - /// - /// Un-registers the existing logger and registers a new copy. - /// We will use this when we do multiple builds so that we can safely - /// assert on log messages for that particular build. - /// - private void ResetLogger() - { - engine.UnregisterAllLoggers(); - myLogger = new MockLogger(); - myProject.ParentEngine.RegisterLogger(myLogger); - } - - /// - /// Verifies that build failed with MSB4116 error - /// - /// - private void AssertBuildFailedWithConditionWithMetadataError(bool buildResults) - { - Assertion.Assert(buildResults != true); - Assertion.Assert(myLogger.FullLog.Contains("MSB4116")); - } - - /// - /// Builds the specified target and return the outputs - /// - /// - /// - private ITaskItem[] BuildAndGatherOutputs(string targetToBuild) - { - Hashtable outputs = new Hashtable(); - myProject.Build(new string[] { "BuildMe" }, outputs); - ITaskItem[] outputItems = (ITaskItem[])outputs["BuildMe"]; - return outputItems; - } - - /// - /// Returns the first target from the project - /// - /// - private Target GetTargetFromProject(string targetName) - { - Target target = null; - foreach (Target t in myProject.Targets) - { - if (t.Name == targetName) - { - target = t; - break; - } - } - return target; - } - - /// - /// Deletes the temp files created - /// - /// - private void DeleteTempFiles(string[] files) - { - for (int i = 0; i < files.Length; i++) - { - File.Delete(files[i]); - } - } - - /// - /// Creates temp files with specified timestamp - /// - /// - /// - /// - private static string[] GetTempFiles(int number, DateTime lastWriteTime) - { - string[] files = new string[number]; - - for (int i = 0; i < number; i++) - { - files[i] = Path.GetTempFileName(); - File.SetLastWriteTime(files[i], lastWriteTime); - } - return files; - } - - /// - /// Set inputs and outputs and verify they are respected - /// - [Test] - public void SetInputsOutputsIncremental() - { - string oldFile = null, newFile = null; - try - { - oldFile = GetTempFiles(1, new DateTime(2005, 1, 1))[0]; - newFile = GetTempFiles(1, new DateTime(2006, 1, 1))[0]; - - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - ", logger); - p.Build(new string[] { "t" }); - - logger.AssertLogContains(new string[] { "building target !!" }); - logger.ClearLog(); - - Target t = p.Targets["t"]; - - // reverse inputs and outputs - t.Inputs = (string)oldFile; - t.Outputs = (string)newFile; - - p.ResetBuildStatus(); - p.Build(new string[] { "t" }); - - logger.AssertLogDoesntContain("building target !!"); - - - } - finally - { - DeleteTempFiles(new string[] { oldFile }); - DeleteTempFiles(new string[] { newFile }); - } - } - - /// - /// Get the inputs and outputs when it has not been set - /// - [Test] - public void GetUnsetTargetInputsAndOutputs() - { - string targetOutputsString = String.Empty; - string targetInputsString = String.Empty; - - Target myTarget = myProject.Targets.AddNewTarget("BuildMe"); - - Assertion.AssertEquals(myTarget.Inputs, targetInputsString); - Assertion.AssertEquals(myTarget.Outputs, targetOutputsString); - } - - /// - /// Set the inputs and outputs as string.Empty. Getting it should return string.empty - /// - [Test] - public void SetEmptyTargetInputsAndOutputs() - { - string targetOutputsString = String.Empty; - string targetInputsString = String.Empty; - - Target myTarget = myProject.Targets.AddNewTarget("BuildMe"); - myTarget.Inputs = targetInputsString; - myTarget.Outputs = targetOutputsString; - - Assertion.AssertEquals(myTarget.Inputs, targetInputsString); - Assertion.AssertEquals(myTarget.Outputs, targetOutputsString); - } - - /// - /// Set the inputs and outputs as null. Getting it should return string.empty - /// - [Test] - public void SetNullTargetInputsAndOutputs() - { - string targetOutputsString = String.Empty; - string targetInputsString = String.Empty; - - Target myTarget = myProject.Targets.AddNewTarget("BuildMe"); - myTarget.Inputs = null; - myTarget.Outputs = null; - - Assertion.AssertEquals(myTarget.Inputs, targetInputsString); - Assertion.AssertEquals(myTarget.Outputs, targetOutputsString); - } - - /// - /// Gets the inputs and outputs after setting it - /// - [Test] - public void GetValidTargetInputsAndOutputs() - { - string targetOutputsString = "target_output"; - string targetInputsString = "target_input"; - - Target myTarget = myProject.Targets.AddNewTarget("BuildMe"); - myTarget.Inputs = targetInputsString; - myTarget.Outputs = targetOutputsString; - - Assertion.AssertEquals(myTarget.Inputs, targetInputsString); - Assertion.AssertEquals(myTarget.Outputs, targetOutputsString); - } - - /// - /// Set the inputs and outputs of a target on an existing project - /// - [Test] - public void SetTargetInputsAndOutputsOnAnAlreadyBuiltTarget() - { - string targetInputsString = "%(SomeItem.metadata)"; - string targetOutputsString = @"@(SomeItem->'%(metadata)')"; - - string projectContents = @" - - - - 1 - - - 2 - - - - - - - "; - - myProject.LoadXml(projectContents); - myProject.Build("BuildMe"); - - Assertion.Assert(myLogger.FullLog.Contains("a;bfoo")); - - ResetLogger(); - - Target myTarget = GetTargetFromProject("BuildMe"); - - myTarget.Inputs = targetInputsString; - myTarget.Outputs = targetOutputsString; - - ITaskItem[] outputItems = BuildAndGatherOutputs("BuildMe"); - - - Assertion.Assert(myLogger.FullLog.Contains("afoo")); - Assertion.Assert(myLogger.FullLog.Contains("bfoo")); - Assertion.AssertEquals(outputItems[0].ToString(), "1"); - Assertion.AssertEquals(outputItems[1].ToString(), "2"); - } - - /// - /// Change the inputs and outputs of a target of an existing project - /// - [Test] - public void ChangingAnExistingTargetInputsAndOutputs() - { - string targetInputsString = "%(SomeItem2.metadata)"; - string targetOutputsString = @"@(SomeItem2->'%(metadata)')"; - - string projectContents = @" - - - - 1 - - - 2 - - - 1-1 - - - 2-1 - - - '%(metadata)')""> - - - - "; - - myProject.LoadXml(projectContents); - ITaskItem[] outputItems = BuildAndGatherOutputs("BuildMe"); - - Assertion.Assert(myLogger.FullLog.Contains("afoo")); - Assertion.Assert(myLogger.FullLog.Contains("bfoo")); - Assertion.AssertEquals(outputItems[0].ToString(), "1"); - Assertion.AssertEquals(outputItems[1].ToString(), "2"); - - ResetLogger(); - - Target myTarget = GetTargetFromProject("BuildMe"); - - myTarget.Inputs = targetInputsString; - myTarget.Outputs = targetOutputsString; - - BuildTask myTask = myTarget.AddNewTask("Exec"); - myTask.SetParameterValue("Command", "echo @(SomeItem2)foo"); - - ITaskItem[] outputItems1 = BuildAndGatherOutputs("BuildMe"); - - - Assertion.Assert(myLogger.FullLog.Contains("a2foo")); - Assertion.Assert(myLogger.FullLog.Contains("b2foo")); - Assertion.AssertEquals(outputItems1[0].ToString(), "1-1"); - Assertion.AssertEquals(outputItems1[1].ToString(), "2-1"); - } - - /// - /// Change the inputs of a target of an existing project - /// - [Test] - public void ChangingAnExistingTargetInputs() - { - string targetInputsString = "%(SomeItem2.metadata)"; - - string projectContents = @" - - - - 1 - - - 2 - - - 1-1 - - - 2-1 - - - '%(metadata)')""> - - - - "; - - myProject.LoadXml(projectContents); - ITaskItem[] outputItems = BuildAndGatherOutputs("BuildMe"); - - Assertion.Assert(myLogger.FullLog.Contains("afoo")); - Assertion.Assert(myLogger.FullLog.Contains("bfoo")); - Assertion.AssertEquals(outputItems[0].ToString(), "1"); - Assertion.AssertEquals(outputItems[1].ToString(), "2"); - - ResetLogger(); - - Target myTarget = GetTargetFromProject("BuildMe"); - - myTarget.Inputs = targetInputsString; - - BuildTask myTask = myTarget.AddNewTask("Exec"); - myTask.SetParameterValue("Command", "echo @(SomeItem2)foo"); - - ITaskItem[] outputItems1 = BuildAndGatherOutputs("BuildMe"); - - - Assertion.Assert(myLogger.FullLog.Contains("a;bfoo")); - Assertion.Assert(myLogger.FullLog.Contains("a2foo")); - Assertion.Assert(myLogger.FullLog.Contains("b2foo")); - Assertion.AssertEquals(outputItems1[0].ToString(), "1"); - Assertion.AssertEquals(outputItems1[1].ToString(), "2"); - } - - /// - /// Change the outputs of a target of an existing project - /// - [Test] - public void ChangingAnExistingTargetOutputs() - { - string targetOutputsString = @"@(SomeItem2->'%(metadata)')"; - - string projectContents = @" - - - - 1 - - - 2 - - - 1-1 - - - 2-1 - - - '%(metadata)')""> - - - - "; - - myProject.LoadXml(projectContents); - ITaskItem[] outputItems = BuildAndGatherOutputs("BuildMe"); - - Assertion.Assert(myLogger.FullLog.Contains("afoo")); - Assertion.Assert(myLogger.FullLog.Contains("bfoo")); - Assertion.AssertEquals(outputItems[0].ToString(), "1"); - Assertion.AssertEquals(outputItems[1].ToString(), "2"); - - ResetLogger(); - - Target myTarget = GetTargetFromProject("BuildMe"); - - myTarget.Outputs = targetOutputsString; - - ITaskItem[] outputItems1 = BuildAndGatherOutputs("BuildMe"); - - Assertion.Assert(myLogger.FullLog.Contains("afoo")); - Assertion.Assert(myLogger.FullLog.Contains("bfoo")); - Assertion.AssertEquals(outputItems1[0].ToString(), "1-1"); - Assertion.AssertEquals(outputItems1[1].ToString(), "2-1"); - } - - /// - /// Get inputs and outputs of a target from an existing project - /// - [Test] - public void GetInputsAndOutputsFromAnExistingTarget() - { - string targetOutputsString = "target_output"; - string targetInputsString = "target_input"; - - string projectContents = @" - - - - "; - - myProject.LoadXml(projectContents); - - Target myTarget = GetTargetFromProject("BuildMe"); - - Assertion.AssertEquals("BuildMe", myTarget.Name); - Assertion.AssertEquals(myTarget.Inputs, targetInputsString); - Assertion.AssertEquals(myTarget.Outputs, targetOutputsString); - } - - /// - /// Add new target with inputs and outputs to an existing project - /// - [Test] - public void AddNewTargetWithInputsAndOutputsOnAnExistingProject() - { - string targetOutputsString = "target_output"; - string targetInputsString = "target_input"; - string projectContents = @" - - - - "; - - myProject.LoadXml(projectContents); - - myProject.DefaultTargets = "BuildMe2"; - Target myTarget = myProject.Targets.AddNewTarget("BuildMe2"); - myTarget.Inputs = targetInputsString; - myTarget.Outputs = targetOutputsString; - - myProject.Build("BuildMe2"); - - Assertion.AssertEquals(myTarget.Inputs, targetInputsString); - Assertion.AssertEquals(myTarget.Outputs, targetOutputsString); - Assertion.Assert(myLogger.FullLog.Contains("BuildMe2")); - } - - /// - /// Add additional attributes to target after setting the inputs and outputs - /// - [Test] - public void AddAttributeAfterInputsAndOutputs() - { - string targetOutputsString = "target_output"; - string targetInputsString = "target_input"; - - myProject.DefaultTargets = "BuildMe"; - Target myTarget = myProject.Targets.AddNewTarget("BuildMe"); - myTarget.Inputs = targetInputsString; - myTarget.Outputs = targetOutputsString; - myTarget.Condition = @"'1' == '1'"; - - myProject.Build("BuildMe"); - - Assertion.AssertEquals(myTarget.Inputs, targetInputsString); - Assertion.AssertEquals(myTarget.Outputs, targetOutputsString); - Assertion.Assert(myLogger.FullLog.Contains("BuildMe")); - } - - /// - /// Create a target and add an inputs attribute to the target - /// - [Test] - public void AddNewTargetWithInputsString() - { - string targetInputsString = "%(SomeItem.metadata)"; - string targetOutputsString = "target_output"; - - BuildItem item1 = myProject.AddNewItem("SomeItem", "a"); - BuildItem item2 = myProject.AddNewItem("SomeItem", "b"); - item1.SetMetadata("metadata", "1"); - item2.SetMetadata("metadata", "2"); - - myProject.DefaultTargets = "BuildMe"; - - Target myTarget = myProject.Targets.AddNewTarget("BuildMe"); - myTarget.Inputs = targetInputsString; - myTarget.Outputs = targetOutputsString; - - BuildTask myTask = myTarget.AddNewTask("Exec"); - myTask.SetParameterValue("Command", "echo @(SomeItem)foo"); - - myProject.Build("BuildMe"); - - Assertion.Assert(myLogger.FullLog.Contains("BuildMe")); - Assertion.Assert(myLogger.FullLog.Contains("Exec")); - Assertion.Assert(myLogger.FullLog.Contains("afoo")); - Assertion.Assert(myLogger.FullLog.Contains("bfoo")); - } - - /// - /// Create a target and add an outputs attribute to the target - /// - [Test] - public void AddNewTargetWithOutputsString() - { - string targetOutputsString = @"@(SomeItem->'%(metadata)')"; - string targetInputsString = null; - - BuildItem item1 = myProject.AddNewItem("SomeItem", "a"); - BuildItem item2 = myProject.AddNewItem("SomeItem", "b"); - item1.SetMetadata("metadata", "1"); - item2.SetMetadata("metadata", "2"); - - myProject.DefaultTargets = "BuildMe"; - - // Add a new target specifying the inputs and outputs attribute - Target myTarget = myProject.Targets.AddNewTarget("BuildMe"); - myTarget.Inputs = targetInputsString; - myTarget.Outputs = targetOutputsString; - - BuildTask myTask = myTarget.AddNewTask("Exec"); - myTask.SetParameterValue("Command", "echo @(SomeItem)foo"); - - ITaskItem[] outputItems = BuildAndGatherOutputs("BuildMe"); - - // Confirm the logger received what it was supposed to. - Assertion.Assert(myLogger.FullLog.Contains("BuildMe")); - Assertion.Assert(myLogger.FullLog.Contains("Exec")); - Assertion.Assert(myLogger.FullLog.Contains("a;bfoo")); - Assertion.AssertEquals(outputItems[0].ToString(), "1"); - Assertion.AssertEquals(outputItems[1].ToString(), "2"); - } - - /// - /// Condition is a transform - /// - [Test] - public void TargetCondtionIsATransform() - { - string projectContents = @" - - - - 1 - - - '%(metadata)')'=='1'""> - - - - "; - - myProject.LoadXml(projectContents); - myProject.Build("BuildMe"); - - Assertion.Assert(myLogger.FullLog.Contains("[a]")); - } - - /// - /// Condition has a metadata expression - /// - [Test] - public void TargetCondtionHasAMetadata() - { - string projectContents = @" - - - - 1 - - - - - - - "; - - myProject.LoadXml(projectContents); - - AssertBuildFailedWithConditionWithMetadataError(myProject.Build("BuildMe")); - } - - /// - /// Condition has a metadata expression - /// - [Test] - public void TargetCondtionHasAMetadataButInvalidItemType() - { - string projectContents = @" - - - - 1 - - - 2 - - - - - - - - "; - - myProject.LoadXml(projectContents); - - AssertBuildFailedWithConditionWithMetadataError(myProject.Build("BuildMe")); - } - - /// - /// Condition has a metadata expression - /// - [Test] - public void TargetCondtionHasAMetadataButInvalidItemType2() - { - string projectContents = @" - - - - 1 - - - 2 - - - - - - - "; - - myProject.LoadXml(projectContents); - - AssertBuildFailedWithConditionWithMetadataError(myProject.Build("BuildMe")); - } - - /// - /// Condition has a metadata expression - /// - [Test] - public void TargetCondtionDependsOn2ValuesWhereOneIsAMetadata() - { - string projectContents = @" - - - - 1 - - - 2 - - - - - - - "; - - myProject.LoadXml(projectContents); - - AssertBuildFailedWithConditionWithMetadataError(myProject.Build("BuildMe")); - } - - /// - /// Condition has a metadata expression - /// - [Test] - public void TargetCondtionHasRandomCharactersFollowedByMetadata() - { - string projectContents = @" - - - - 1 - - - 2 - - - - - - - "; - - myProject.LoadXml(projectContents); - - AssertBuildFailedWithConditionWithMetadataError(myProject.Build("BuildMe")); - } - - /// - /// Condition has a metadata expression - /// - [Test] - public void TargetCondtionHasRandomCharactersFollowedByMetadata2() - { - string projectContents = @" - - - - 1 - - - 2 - - - - - - - "; - - myProject.LoadXml(projectContents); - - AssertBuildFailedWithConditionWithMetadataError(myProject.Build("BuildMe")); - } - - /// - /// Add a new target to a project - /// - [Test] - public void AddNewTarget() - { - // The following code should create a project that effectively looks like this: - // - // - // - // - // - // - // - myProject.DefaultTargets = "BuildMe"; - myProject.SetProperty("MyProp", "goober", null); - Target myTarget = myProject.Targets.AddNewTarget("BuildMe"); - BuildTask myTask = myTarget.AddNewTask("Exec"); - myTask.SetParameterValue("Command", "echo $(MyProp)foo"); - - // Build the project. - myProject.Build("BuildMe"); - - // Confirm the logger received what it was supposed to. - Assertion.Assert(myLogger.FullLog.Contains("BuildMe")); - Assertion.Assert(myLogger.FullLog.Contains("Exec")); - Assertion.Assert(myLogger.FullLog.Contains("gooberfoo")); - } - } - - [TestFixture] - public class RemoveTargetFromCollection_Tests - { - [Test] - public void RemoveTarget() - { - string projectOriginalContents = @" - - - - "; - - Project myProject = ObjectModelHelpers.CreateInMemoryProject(projectOriginalContents); - - // Loop through all the targets in the project. - int i = 0; - Target myTarget = null; - foreach (Target target in myProject.Targets) - { - myTarget = target; - i++; - } - - Assertion.AssertEquals("Expected exactly one target.", 1, i); - Assertion.AssertEquals("BuildMe", myTarget.Name); - - // Remove the target. - myProject.Targets.RemoveTarget(myTarget); - - // Build the project. This should throw an exception, because the target doesn't exist. - bool success = myProject.Build("BuildMe"); - - Assertion.Assert("Project should have failed to build.", !success); - } - - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void RemoveTargetNull() - { - string projectOriginalContents = @" - - - - "; - - Project myProject = ObjectModelHelpers.CreateInMemoryProject(projectOriginalContents); - - myProject.Targets.RemoveTarget(null); - } - - // Dirty project. - } - - [TestFixture] - public class Target_Tests - { - [Test] - public void TransformInTargetConditionLegal() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - '%(filename)')=='a;b'`> - - - - ", logger); - p.Build(new string[] { "t" }); - - logger.AssertLogContains(new string[] { "#a.ext;b.ext#" }); - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/TargetDependencyAnalyzer_Tests.cs b/src/Deprecated/Engine.UnitTests/TargetDependencyAnalyzer_Tests.cs deleted file mode 100644 index d73c3addeed..00000000000 --- a/src/Deprecated/Engine.UnitTests/TargetDependencyAnalyzer_Tests.cs +++ /dev/null @@ -1,619 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.IO; -using System.Resources; -using System.Reflection; -using System.Collections; -using System.Collections.Generic; -using System.Xml; -using System.Text; -using System.Globalization; - -using NUnit.Framework; - -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine; -using Microsoft.Build.BuildEngine.Shared; -using System.Threading; - -namespace Microsoft.Build.UnitTests.TargetDependencyAnalyzer_Tests -{ - [TestFixture] - public class TargetDependencyAnalyzer_Tests - { - /// - /// Regression test for bug VSWhidbey 523719. - /// - /// RGoel - [Test] - public void EmptyItemSpecInTargetInputs() - { - MockLogger ml = ObjectModelHelpers.BuildProjectExpectSuccess(@" - - - - - - '%(NonExistentMetadata)')` - Outputs=`foo.exe`> - - - - - "); - - // It should have actually skipped the "Build" target since there were no inputs. - ml.AssertLogDoesntContain("Running Build target"); - } - - /// - /// Verify missing output metadata gives an error, bug100245 - /// - [Test] - public void EmptyItemSpecInTargetOutputs() - { - MockLogger ml = ObjectModelHelpers.BuildProjectExpectFailure(@" - - - '%(OutputFile)');@(TASKXML->'%(PasFile)');`> - - - - - bcc32task.cs - bcc32task.pas - - - cpp32task.cs - - - "); - - // It should have actually skipped the "Build" target since some output metadata was missing - ml.AssertLogDoesntContain("Running Build target"); - ml.AssertLogContains("MSB4168"); - - // Clear the mock logger object out so it is not reused - ml = null; - - ml = ObjectModelHelpers.BuildProjectExpectFailure(@" - - - '%(OutputFile)');@(TASKXML->'%(PasFile)');`> - - - - - bcc32task.cs - bcc32task.pas - - - cpp32task.cs - - - - - - "); - - // It should have actually skipped the "Build" target since some output metadata was missing - ml.AssertLogDoesntContain("Running Build target"); - ml.AssertLogContains("MSB4168"); - } - - - /// - /// Tests this case: - /// - /// - /// - /// If Items = [a.cs;b.cs], and only b.cs is out of date w/r/t its - /// correlated output b.dll, then we should only build "b" incrementally. - /// - [Test] - public void MetaInputAndInputItemThatCorrelatesWithOutputItem() - { - string inputs = "@(Items);c.cs"; - string outputs = "@(Items->'%(Filename).dll')"; - FileWriteInfo[] filesToAnalyze = new FileWriteInfo[] - { - new FileWriteInfo("a.cs", yesterday), - new FileWriteInfo("a.dll", today), - new FileWriteInfo("b.cs", today), - new FileWriteInfo("b.dll", yesterday), - new FileWriteInfo("c.cs", twoDaysAgo) - }; - - BuildItemGroup items = new BuildItemGroup(); - items.AddNewItem("Items", "a.cs"); - items.AddNewItem("Items", "b.cs"); - - Hashtable itemsByName = new Hashtable(StringComparer.OrdinalIgnoreCase); - itemsByName.Add("Items", items); - - DependencyAnalysisResult result = PerformDependencyAnalysisTestHelper(filesToAnalyze, itemsByName, inputs, outputs); - - Assertion.AssertEquals("Should only build partially.", DependencyAnalysisResult.IncrementalBuild, result); - } - - /// - /// Tests this case: - /// - /// - /// - /// If Items = [a.cs;b.cs;c.cs], and only b.cs is out of date w/r/t its - /// correlated outputs (dll or xml), then we should only build "b" incrementally. - /// - [Test] - public void InputItemThatCorrelatesWithMultipleTransformOutputItems() - { - string inputs = "@(Items)"; - string outputs = "@(Items->'%(Filename).dll');@(Items->'%(Filename).xml')"; - - FileWriteInfo[] filesToAnalyze = new FileWriteInfo[] - { - new FileWriteInfo("a.cs", yesterday), - new FileWriteInfo("a.dll", today), - new FileWriteInfo("a.xml", today), - new FileWriteInfo("b.cs", yesterday), - new FileWriteInfo("b.dll", twoDaysAgo), - new FileWriteInfo("b.xml", today), - new FileWriteInfo("c.cs", yesterday), - new FileWriteInfo("c.dll", today), - new FileWriteInfo("c.xml", today) - }; - - BuildItemGroup items = new BuildItemGroup(); - items.AddNewItem("Items", "a.cs"); - items.AddNewItem("Items", "b.cs"); - items.AddNewItem("Items", "c.cs"); - - Hashtable itemsByName = new Hashtable(StringComparer.OrdinalIgnoreCase); - itemsByName.Add("Items", items); - - DependencyAnalysisResult result = PerformDependencyAnalysisTestHelper(filesToAnalyze, itemsByName, inputs, outputs); - - Assertion.AssertEquals("Should only build partially.", DependencyAnalysisResult.IncrementalBuild, result); - } - - private readonly DateTime today = DateTime.Today; - private readonly DateTime yesterday = DateTime.Today.AddTicks(-TimeSpan.TicksPerDay); - private readonly DateTime twoDaysAgo = DateTime.Today.AddTicks(-2*TimeSpan.TicksPerDay); - - private class FileWriteInfo - { - public string Path; - public DateTime LastWriteTime; - - private FileWriteInfo() { } - - public FileWriteInfo(string path, DateTime lastWriteTime) - { - this.Path = path; - this.LastWriteTime = lastWriteTime; - } - } - - /// - /// Helper method for tests of PerformDependencyAnalysis. - /// The setup required here suggests that the TargetDependencyAnalyzer - /// class should be refactored. - /// - private DependencyAnalysisResult PerformDependencyAnalysisTestHelper - ( - FileWriteInfo[] filesToAnalyze, - Hashtable itemsByName, - string inputs, - string outputs - ) - { - Hashtable h1 = new Hashtable(StringComparer.OrdinalIgnoreCase); - Hashtable h2 = new Hashtable(StringComparer.OrdinalIgnoreCase); - return PerformDependencyAnalysisTestHelper(filesToAnalyze, itemsByName, inputs, outputs, out h1, out h2); - } - - private DependencyAnalysisResult PerformDependencyAnalysisTestHelper - ( - FileWriteInfo [] filesToAnalyze, - Hashtable itemsByName, - string inputs, - string outputs, - out Hashtable changedTargetInputs, - out Hashtable upToDateTargetInputs - ) - { - List filesToDelete = new List(); - - try - { - // first set the disk up - for (int i = 0; i < filesToAnalyze.Length; ++i) - { - string path = ObjectModelHelpers.CreateFileInTempProjectDirectory(filesToAnalyze[i].Path, ""); - File.SetLastWriteTime(path, filesToAnalyze[i].LastWriteTime); - filesToDelete.Add(path); - } - - // now create the project - string unformattedProjectXml = - @" - - - - - "; - Project p = ObjectModelHelpers.CreateInMemoryProject(String.Format(unformattedProjectXml, inputs, outputs)); - - // now do the dependency analysis - ItemBucket itemBucket = new ItemBucket(null, null, LookupHelpers.CreateLookup(itemsByName), 0); - TargetDependencyAnalyzer analyzer = new TargetDependencyAnalyzer(ObjectModelHelpers.TempProjectDir, p.Targets["Build"], p.ParentEngine.LoggingServices, (BuildEventContext)null); - - return analyzer.PerformDependencyAnalysis(itemBucket, out changedTargetInputs, out upToDateTargetInputs); - } - finally - { - // finally clean up - foreach (string path in filesToDelete) - { - if (File.Exists(path)) File.Delete(path); - } - } - } - - /// - /// Test comparison of inputs/outputs: up to date - /// - /// danmose - [Test] - public void TestIsAnyOutOfDate1() - { - IsAnyOutOfDateTestHelper - ( - new DateTime(2000, 1, 1), /* input1 */ - new DateTime(2000, 1, 1), /* input2 */ - new DateTime(2001, 1, 1), /* output1 */ - new DateTime(2001, 1, 1), /* output2 */ - false /* none out of date */ - ); - } - - /// - /// Test comparison of inputs/outputs: first input out of date wrt second output - /// - /// danmose - [Test] - public void TestIsAnyOutOfDate2() - { - IsAnyOutOfDateTestHelper - ( - new DateTime(2002, 1, 1), /* input1 */ - new DateTime(2000, 1, 1), /* input2 */ - new DateTime(2003, 1, 1), /* output1 */ - new DateTime(2001, 1, 1), /* output2 */ - true /* some out of date */ - ); - } - - /// - /// Test comparison of inputs/outputs: second input out of date wrt first output - /// - /// danmose - [Test] - public void TestIsAnyOutOfDate3() - { - IsAnyOutOfDateTestHelper - ( - new DateTime(2000, 1, 1), /* input1 */ - new DateTime(2002, 1, 1), /* input2 */ - new DateTime(2001, 1, 1), /* output1 */ - new DateTime(2003, 1, 1), /* output2 */ - true /* some out of date */ - ); - } - - /// - /// Test comparison of inputs/outputs: inputs and outputs have same dates - /// - /// danmose - [Test] - public void TestIsAnyOutOfDate4() - { - IsAnyOutOfDateTestHelper - ( - new DateTime(2000, 1, 1), /* input1 */ - new DateTime(2000, 1, 1), /* input2 */ - new DateTime(2000, 1, 1), /* output1 */ - new DateTime(2000, 1, 1), /* output2 */ - false /* none out of date */ - ); - } - - /// - /// Test comparison of inputs/outputs: first input missing - /// - /// danmose - [Test] - public void TestIsAnyOutOfDate5() - { - IsAnyOutOfDateTestHelper - ( - null, /* input1 */ - new DateTime(2000, 1, 1), /* input2 */ - new DateTime(2002, 1, 1), /* output1 */ - new DateTime(2002, 1, 1), /* output2 */ - true /* some out of date */ - ); - } - - - /// - /// Test comparison of inputs/outputs: second input missing - /// - /// danmose - [Test] - public void TestIsAnyOutOfDate6() - { - IsAnyOutOfDateTestHelper - ( - new DateTime(2000, 1, 1), /* input1 */ - null, /* input2 */ - new DateTime(2002, 1, 1), /* output1 */ - new DateTime(2002, 1, 1), /* output2 */ - true /* some out of date */ - ); - } - - /// - /// Test comparison of inputs/outputs: second output missing - /// - /// danmose - [Test] - public void TestIsAnyOutOfDate7() - { - IsAnyOutOfDateTestHelper - ( - new DateTime(2000, 1, 1), /* input1 */ - new DateTime(2000, 1, 1), /* input2 */ - new DateTime(2002, 1, 1), /* output1 */ - null, /* output2 */ - true /* some out of date */ - ); - } - - /// - /// Test comparison of inputs/outputs: first output missing - /// - /// danmose - [Test] - public void TestIsAnyOutOfDate8() - { - IsAnyOutOfDateTestHelper - ( - new DateTime(2000, 1, 1), /* input1 */ - new DateTime(2000, 1, 1), /* input2 */ - null, /* output1 */ - new DateTime(2002, 1, 1), /* output2 */ - true /* some out of date */ - ); - } - - /// - /// Test comparison of inputs/outputs: first input and first output missing - /// - /// danmose - [Test] - public void TestIsAnyOutOfDate9() - { - IsAnyOutOfDateTestHelper - ( - null, /* input1 */ - new DateTime(2000, 1, 1), /* input2 */ - null, /* output1 */ - new DateTime(2002, 1, 1), /* output2 */ - true /* some out of date */ - ); - } - - /// - /// Test comparison of inputs/outputs: one input, two outputs, input out of date - /// - /// danmose - [Test] - public void TestIsAnyOutOfDate10() - { - IsAnyOutOfDateTestHelper - ( - new DateTime(2002, 1, 1), /* input1 */ - null, /* input2 */ - new DateTime(2000, 1, 1), /* output1 */ - new DateTime(2002, 1, 1), /* output2 */ - true, /* some out of date */ - true, /* include input1 */ - false, /* do not include input2 */ - true, /* include output1 */ - true /* include output2 */ - ); - } - - /// - /// Test comparison of inputs/outputs: one input, two outputs, input up to date - /// - /// danmose - [Test] - public void TestIsAnyOutOfDate11() - { - IsAnyOutOfDateTestHelper - ( - new DateTime(2000, 1, 1), /* input1 */ - null, /* input2 */ - new DateTime(2002, 1, 1), /* output1 */ - new DateTime(2002, 1, 1), /* output2 */ - false, /* none out of date */ - true, /* include input1 */ - false, /* do not include input2 */ - true, /* include output1 */ - true /* include output2 */ - ); - } - - /// - /// Test comparison of inputs/outputs: two inputs, one output, inputs up to date - /// - /// danmose - [Test] - public void TestIsAnyOutOfDate12() - { - IsAnyOutOfDateTestHelper - ( - new DateTime(2000, 1, 1), /* input1 */ - new DateTime(2000, 1, 1), /* input2 */ - new DateTime(2002, 1, 1), /* output1 */ - null, /* output2 */ - false, /* none out of date */ - true, /* include input1 */ - true, /* include input2 */ - true, /* include output1 */ - false /* do not include output2 */ - ); - } - - /// - /// Test comparison of inputs/outputs: two inputs, one output, second input out of date - /// - /// danmose - [Test] - public void TestIsAnyOutOfDate13() - { - IsAnyOutOfDateTestHelper - ( - new DateTime(2000, 1, 1), /* input1 */ - new DateTime(2003, 1, 1), /* input2 */ - new DateTime(2002, 1, 1), /* output1 */ - null, /* output2 */ - true, /* some out of date */ - true, /* include input1 */ - true, /* include input2 */ - true, /* include output1 */ - false /* do not include output2 */ - ); - } - - /// - /// Helper method for tests of IsAnyOutOfDate. - /// The setup required here suggests that the TargetDependencyAnalyzer - /// class should be refactored. - /// - /// - /// - /// - /// - /// - private void IsAnyOutOfDateTestHelper - ( - DateTime? input1Time, - DateTime? input2Time, - DateTime? output1Time, - DateTime? output2Time, - bool isUpToDate - ) - { - IsAnyOutOfDateTestHelper(input1Time, input2Time, output1Time, output2Time, isUpToDate, true, true, true, true); - } - - /// - /// Helper method for tests of IsAnyOutOfDate. - /// The setup required here suggests that the TargetDependencyAnalyzer - /// class should be refactored. - /// - /// - /// - /// - /// - /// - private void IsAnyOutOfDateTestHelper - ( - DateTime? input1Time, - DateTime? input2Time, - DateTime? output1Time, - DateTime? output2Time, - bool expectedAnyOutOfDate, - bool includeInput1, - bool includeInput2, - bool includeOutput1, - bool includeOutput2 - ) - { - ArrayList inputs = new ArrayList(); - ArrayList outputs = new ArrayList(); - - string input1 = "NONEXISTENT_FILE"; - string input2 = "NONEXISTENT_FILE"; - string output1 = "NONEXISTENT_FILE"; - string output2 = "NONEXISTENT_FILE"; - - try - { - if (input1Time != null) - { - input1 = Path.GetTempFileName(); - File.WriteAllText(input1, String.Empty); - File.SetLastWriteTime(input1, (DateTime)input1Time); - } - - if (input2Time != null) - { - input2 = Path.GetTempFileName(); - File.WriteAllText(input2, String.Empty); - File.SetLastWriteTime(input2, (DateTime)input2Time); - } - - if (output1Time != null) - { - output1 = Path.GetTempFileName(); - File.WriteAllText(output1, String.Empty); - File.SetLastWriteTime(output1, (DateTime)output1Time); - } - - if (output2Time != null) - { - output2 = Path.GetTempFileName(); - File.WriteAllText(output2, String.Empty); - File.SetLastWriteTime(output2, (DateTime)output2Time); - } - - if (includeInput1) inputs.Add(input1); - if (includeInput2) inputs.Add(input2); - if (includeOutput1) outputs.Add(output1); - if (includeOutput2) outputs.Add(output2); - - DependencyAnalysisLogDetail detail; - Assertion.AssertEquals(expectedAnyOutOfDate, TargetDependencyAnalyzer.IsAnyOutOfDate(out detail, Directory.GetCurrentDirectory(), inputs, outputs)); - } - finally - { - if (File.Exists(input1)) File.Delete(input1); - if (File.Exists(input2)) File.Delete(input2); - if (File.Exists(output1)) File.Delete(output1); - if (File.Exists(output2)) File.Delete(output2); - } - } - } -} - diff --git a/src/Deprecated/Engine.UnitTests/TargetInProgressState_Tests.cs b/src/Deprecated/Engine.UnitTests/TargetInProgressState_Tests.cs deleted file mode 100644 index 8d0c697a940..00000000000 --- a/src/Deprecated/Engine.UnitTests/TargetInProgressState_Tests.cs +++ /dev/null @@ -1,264 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections.Generic; -using System.Text; -using System.IO; -using System.Xml; - -using NUnit.Framework; -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine; -using Microsoft.Build.BuildEngine.Shared; -using System.Collections; - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class TargetInProgressState_Tests - { - - [Test] - public void TargetInProgressStateCustomSerialization() - { - Engine engine = new Engine(@"c:\"); - Project project = ObjectModelHelpers.CreateInMemoryProject(@" - - - bin\Debug\ - MyAssembly - Exe - Debug - - - - - - - - - - "); - EngineCallback engineCallback = new EngineCallback(engine); - Target build = project.Targets["Build"]; - List waitingBuildStates = null; - - int handleId = 1; - string projectFileName = "ProjectFileName"; - string[] targetNames = new string[] { "t" }; - Dictionary dictionary = null; - int requestId = 1; - BuildRequest request = new BuildRequest(handleId, projectFileName, targetNames, (IDictionary)dictionary, null, requestId, false, false); - ArrayList targetNamesToBuild = new ArrayList(); - targetNamesToBuild.Add("t"); - ProjectBuildState initiatingRequest = new ProjectBuildState(request, targetNamesToBuild, new BuildEventContext(1, 2, 2, 2)); - initiatingRequest.AddBlockingTarget("Build"); - BuildRequest [] outstandingBuildRequests = null; - string projectName = "SuperTestProject"; - - - - TargetInProgessState targetInProgress1 = new TargetInProgessState( - engineCallback, - build, - waitingBuildStates, - initiatingRequest, - outstandingBuildRequests, - projectName - ); - - targetInProgress1.ParentTargetsForBuildRequests = null; - Assertion.AssertNull(targetInProgress1.ParentTargetsForBuildRequests); - Assertion.Assert(!targetInProgress1.RequestedByHost); - - build = project.Targets["t"]; - request = new BuildRequest(handleId, projectFileName, targetNames, (IDictionary)dictionary, null, requestId, false, false); - request.IsExternalRequest = true; - targetNamesToBuild.Add("t"); - initiatingRequest = new ProjectBuildState(request, targetNamesToBuild, new BuildEventContext(1, 2, 2, 2)); - outstandingBuildRequests = new BuildRequest[]{ - new BuildRequest(1, projectFileName, targetNames, (IDictionary)dictionary, null, requestId, false, false), - new BuildRequest(2, projectFileName, targetNames, (IDictionary)dictionary, null, requestId, false, false), - new BuildRequest(3, projectFileName, targetNames, (IDictionary)dictionary, null, requestId, false, false), - new BuildRequest(4, projectFileName, targetNames, (IDictionary)dictionary, null, requestId, false, false) - }; - - TargetInProgessState.TargetIdWrapper originalWrapper = new TargetInProgessState.TargetIdWrapper(); - originalWrapper.id = 1; - originalWrapper.name = "Wrapper"; - originalWrapper.nodeId = 4; - originalWrapper.projectId = 6; - waitingBuildStates = new List(); - waitingBuildStates.Add(initiatingRequest); - - TargetInProgessState targetInProgress3 = new TargetInProgessState( - engineCallback, - build, - waitingBuildStates, - initiatingRequest, - outstandingBuildRequests, - projectName - ); - targetInProgress3.ParentTargetsForBuildRequests = new TargetInProgessState.TargetIdWrapper[] { originalWrapper }; - - // Stream, writer and reader where the events will be serialized and deserialized from - MemoryStream stream = new MemoryStream(); - BinaryWriter writer = new BinaryWriter(stream); - BinaryReader reader = new BinaryReader(stream); - try - { - stream.Position = 0; - // Serialize - targetInProgress3.WriteToStream(writer); - // Get position of stream after write so it can be compared to the position after read - long streamWriteEndPosition = stream.Position; - - // Deserialize and Verify - stream.Position = 0; - TargetInProgessState newInProgressState = new TargetInProgessState(); - newInProgressState.CreateFromStream(reader); - long streamReadEndPosition = stream.Position; - Assert.IsTrue(string.Compare(newInProgressState.ProjectName, projectName, StringComparison.OrdinalIgnoreCase) == 0); - Assert.IsTrue(string.Compare(newInProgressState.TargetId.name, "t", StringComparison.OrdinalIgnoreCase) == 0); - Assert.IsNotNull(newInProgressState.ParentTargets); - Assert.IsTrue(newInProgressState.OutstandingBuildRequests.Length == 4); - Assert.IsNotNull(newInProgressState.ParentBuildRequests); - Assert.IsNotNull(newInProgressState.ParentTargetsForBuildRequests.Length == 1); - - stream.Position = 0; - // Serialize - targetInProgress1.WriteToStream(writer); - // Get position of stream after write so it can be compared to the position after read - streamWriteEndPosition = stream.Position; - - // Deserialize and Verify - stream.Position = 0; - newInProgressState = new TargetInProgessState(); - newInProgressState.CreateFromStream(reader); - streamReadEndPosition = stream.Position; - Assert.IsTrue(string.Compare(newInProgressState.ProjectName, projectName,StringComparison.OrdinalIgnoreCase)==0); - Assert.IsTrue(string.Compare(newInProgressState.TargetId.name,"Build",StringComparison.OrdinalIgnoreCase)==0); - Assert.IsNotNull(newInProgressState.ParentTargets); - Assert.IsNull(newInProgressState.OutstandingBuildRequests); - Assert.IsNotNull(newInProgressState.ParentBuildRequests); - - TargetInProgessState targetInProgress2 = new TargetInProgessState(); - stream.Position = 0; - // Serialize - targetInProgress2.WriteToStream(writer); - // Get position of stream after write so it can be compared to the position after read - streamWriteEndPosition = stream.Position; - - // Deserialize and Verify - stream.Position = 0; - newInProgressState = new TargetInProgessState(); - newInProgressState.CreateFromStream(reader); - streamReadEndPosition = stream.Position; - Assert.IsNull(newInProgressState.ProjectName); - Assert.IsNull(newInProgressState.TargetId); - Assert.IsNull(newInProgressState.ParentTargets); - Assert.IsNull(newInProgressState.OutstandingBuildRequests); - Assert.IsNull(newInProgressState.ParentBuildRequests); - } - finally - { - // Close will close the writer/reader and the underlying stream - writer.Close(); - reader.Close(); - reader = null; - stream = null; - writer = null; - } - } - - - [Test] - public void TargetIdWrapperCustomSerialization() - { - // Stream, writer and reader where the events will be serialized and deserialized from - MemoryStream stream = new MemoryStream(); - BinaryWriter writer = new BinaryWriter(stream); - BinaryReader reader = new BinaryReader(stream); - try - { - TargetInProgessState.TargetIdWrapper originalWrapper = new TargetInProgessState.TargetIdWrapper(); - originalWrapper.id = 1; - originalWrapper.name = "Wrapper"; - originalWrapper.nodeId = 4; - originalWrapper.projectId = 6; - - stream.Position = 0; - // Serialize - originalWrapper.WriteToStream(writer); - // Get position of stream after write so it can be compared to the position after read - long streamWriteEndPosition = stream.Position; - - // Deserialize and Verify - stream.Position = 0; - TargetInProgessState.TargetIdWrapper newWrapper = new TargetInProgessState.TargetIdWrapper(); - newWrapper.CreateFromStream(reader); - long streamReadEndPosition = stream.Position; - Assert.IsTrue(streamWriteEndPosition == streamReadEndPosition, "Stream End Positions Should Match"); - Assert.IsTrue(originalWrapper.Equals(newWrapper)); - Assert.IsTrue(1 == newWrapper.id); - - originalWrapper = new TargetInProgessState.TargetIdWrapper(); - originalWrapper.id = 4; - originalWrapper.name = string.Empty; - originalWrapper.nodeId = 6; - originalWrapper.projectId = 8; - - stream.Position = 0; - // Serialize - originalWrapper.WriteToStream(writer); - // Get position of stream after write so it can be compared to the position after read - streamWriteEndPosition = stream.Position; - - // Deserialize and Verify - stream.Position = 0; - newWrapper = new TargetInProgessState.TargetIdWrapper(); - newWrapper.CreateFromStream(reader); - streamReadEndPosition = stream.Position; - Assert.IsTrue(streamWriteEndPosition == streamReadEndPosition, "Stream End Positions Should Match"); - Assert.IsTrue(originalWrapper.Equals(newWrapper)); - Assert.IsTrue(4 == newWrapper.id); - - originalWrapper = new TargetInProgessState.TargetIdWrapper(); - originalWrapper.id = 10; - originalWrapper.name = null; - originalWrapper.nodeId = 6; - originalWrapper.projectId = 8; - - stream.Position = 0; - // Serialize - originalWrapper.WriteToStream(writer); - // Get position of stream after write so it can be compared to the position after read - streamWriteEndPosition = stream.Position; - - // Deserialize and Verify - stream.Position = 0; - newWrapper = new TargetInProgessState.TargetIdWrapper(); - newWrapper.CreateFromStream(reader); - streamReadEndPosition = stream.Position; - Assert.IsTrue(streamWriteEndPosition == streamReadEndPosition, "Stream End Positions Should Match"); - Assert.IsTrue(originalWrapper.Equals(newWrapper)); - Assert.IsTrue(10 == newWrapper.id); - } - finally - { - // Close will close the writer/reader and the underlying stream - writer.Close(); - reader.Close(); - reader = null; - stream = null; - writer = null; - } - - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/TaskEngine_Tests.cs b/src/Deprecated/Engine.UnitTests/TaskEngine_Tests.cs deleted file mode 100644 index 1408438e97c..00000000000 --- a/src/Deprecated/Engine.UnitTests/TaskEngine_Tests.cs +++ /dev/null @@ -1,2436 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Reflection; -using System.Collections; -using System.Text.RegularExpressions; -using System.Xml; - -using NUnit.Framework; - -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine; -using Microsoft.Build.BuildEngine.Shared; -using System.Collections.Generic; - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class TaskEngineTest - { - /********************************************************************************* - * - * BOOL - * - *********************************************************************************/ - /// - /// Initialize a "bool" parameter where no XML attribute was specified on the task. - /// - /// RGoel - [Test] - public void InitTask_Bool_NoAttribute() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; - EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.RemoveAttribute("MyBoolParam"); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - - // We expect success. - Assertion.Assert("success", success); - - // We expect the setter not to have gotten called, which means its value remains the default. - Assertion.AssertEquals("not set", mockTask.myBoolParamWasSet, false); - Assertion.AssertEquals("default value", mockTask.MyBoolParam, false); - } - - /// - /// Initialize a "bool" parameter where a completely empty XML attribute was specified on the task. - /// - /// RGoel - [Test] - public void InitTask_Bool_EmptyAttribute() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.SetAttribute("MyBoolParam", ""); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - - // We expect success. - Assertion.Assert("success", success); - - // We expect the setter not to have gotten called, which means its value remains the default. - Assertion.AssertEquals("not set", mockTask.myBoolParamWasSet, false); - Assertion.AssertEquals("default value", mockTask.MyBoolParam, false); - } - - /// - /// Initialize a "bool" parameter where an XML attribute was specified, but evaluated to empty. - /// - /// RGoel - [Test] - public void InitTask_Bool_PropertyEvaluatesToEmpty() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.SetAttribute("MyBoolParam", "$(NonExistentProperty)"); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - - // We expect success. - Assertion.Assert("success", success); - - // We expect the setter not to have gotten called, which means its value remains the default. - Assertion.AssertEquals("not set", mockTask.myBoolParamWasSet, false); - Assertion.AssertEquals("default value", mockTask.MyBoolParam, false); - } - - /// - /// Initialize a "bool" parameter where an XML attribute was specified, but evaluated to empty. - /// - /// RGoel - [Test] - public void InitTask_Bool_ItemEvaluatesToEmpty() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.SetAttribute("MyBoolParam", "@(NonExistentItem)"); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - - // We expect success. - Assertion.Assert("success", success); - - // We expect the setter not to have gotten called, which means its value remains the default. - Assertion.AssertEquals("not set", mockTask.myBoolParamWasSet, false); - Assertion.AssertEquals("default value", mockTask.MyBoolParam, false); - } - - /********************************************************************************* - * - * BOOL[] - * - *********************************************************************************/ - /// - /// Initialize a "bool[]" parameter where no XML attribute was specified on the task. - /// - /// RGoel - [Test] - public void InitTask_BoolArray_NoAttribute() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.RemoveAttribute("MyBoolArrayParam"); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - - // We expect success. - Assertion.Assert("success", success); - - // We expect the setter not to have gotten called, which means its value remains the default. - Assertion.AssertEquals("not set", mockTask.myBoolArrayParamWasSet, false); - Assertion.AssertEquals("default value", mockTask.MyBoolArrayParam, null); - } - - /// - /// Initialize a "bool[]" parameter where a completely empty XML attribute was specified on the task. - /// - /// RGoel - [Test] - public void InitTask_BoolArray_EmptyAttribute() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.SetAttribute("MyBoolArrayParam", ""); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - - // We expect success. - Assertion.Assert("success", success); - - // We expect the setter not to have gotten called, which means its value remains the default. - Assertion.AssertEquals("not set", mockTask.myBoolArrayParamWasSet, false); - Assertion.AssertEquals("default value", mockTask.MyBoolArrayParam, null); - } - - /// - /// Initialize a "bool[]" parameter where an XML attribute was specified, but evaluated to empty. - /// - /// RGoel - [Test] - public void InitTask_BoolArray_PropertyEvaluatesToEmpty() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.SetAttribute("MyBoolArrayParam", "$(NonExistentProperty)"); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - - // We expect success. - Assertion.Assert("success", success); - - // We expect the setter not to have gotten called, which means its value remains the default. - Assertion.AssertEquals("not set", mockTask.myBoolArrayParamWasSet, false); - Assertion.AssertEquals("default value", mockTask.MyBoolArrayParam, null); - } - - /// - /// Initialize a "bool[]" parameter where an XML attribute was specified, but evaluated to empty. - /// - /// RGoel - [Test] - public void InitTask_BoolArray_ItemEvaluatesToEmpty() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.SetAttribute("MyBoolArrayParam", "@(NonExistentItem)"); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - - // We expect success. - Assertion.Assert("success", success); - - // We expect the setter not to have gotten called, which means its value remains the default. - Assertion.AssertEquals("not set", mockTask.myBoolArrayParamWasSet, false); - Assertion.AssertEquals("default value", mockTask.MyBoolArrayParam, null); - } - - /********************************************************************************* - * - * INT - * - *********************************************************************************/ - /// - /// Initialize a "int" parameter where no XML attribute was specified on the task. - /// - /// RGoel - [Test] - public void InitTask_Int_NoAttribute() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.RemoveAttribute("MyIntParam"); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - - // We expect success. - Assertion.Assert("success", success); - - // We expect the setter not to have gotten called, which means its value remains the default. - Assertion.AssertEquals("not set", mockTask.myIntParamWasSet, false); - Assertion.AssertEquals("default value", mockTask.MyIntParam, 0); - } - - /// - /// Initialize a "int" parameter where a completely empty XML attribute was specified on the task. - /// - /// RGoel - [Test] - public void InitTask_Int_EmptyAttribute() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.SetAttribute("MyIntParam", ""); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - - // We expect success. - Assertion.Assert("success", success); - - // We expect the setter not to have gotten called, which means its value remains the default. - Assertion.AssertEquals("not set", mockTask.myIntParamWasSet, false); - Assertion.AssertEquals("default value", mockTask.MyIntParam, 0); - } - - /// - /// Initialize a "int" parameter where an XML attribute was specified, but evaluated to empty. - /// - /// RGoel - [Test] - public void InitTask_Int_PropertyEvaluatesToEmpty() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.SetAttribute("MyIntParam", "$(NonExistentProperty)"); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - - // We expect success. - Assertion.Assert("success", success); - - // We expect the setter not to have gotten called, which means its value remains the default. - Assertion.AssertEquals("not set", mockTask.myIntParamWasSet, false); - Assertion.AssertEquals("default value", mockTask.MyIntParam, 0); - } - - /// - /// Initialize a "int" parameter where an XML attribute was specified, but evaluated to empty. - /// - /// RGoel - [Test] - public void InitTask_Int_ItemEvaluatesToEmpty() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.SetAttribute("MyIntParam", "@(NonExistentItem)"); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - - // We expect success. - Assertion.Assert("success", success); - - // We expect the setter not to have gotten called, which means its value remains the default. - Assertion.AssertEquals("not set", mockTask.myIntParamWasSet, false); - Assertion.AssertEquals("default value", mockTask.MyIntParam, 0); - } - - /********************************************************************************* - * - * INT[] - * - *********************************************************************************/ - /// - /// Initialize a "int[]" parameter where no XML attribute was specified on the task. - /// - /// RGoel - [Test] - public void InitTask_IntArray_NoAttribute() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.RemoveAttribute("MyIntArrayParam"); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - - // We expect success. - Assertion.Assert("success", success); - - // We expect the setter not to have gotten called, which means its value remains the default. - Assertion.AssertEquals("not set", mockTask.myIntArrayParamWasSet, false); - Assertion.AssertEquals("default value", mockTask.MyIntArrayParam, null); - } - - /// - /// Initialize a "int[]" parameter where a completely empty XML attribute was specified on the task. - /// - /// RGoel - [Test] - public void InitTask_IntArray_EmptyAttribute() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.SetAttribute("MyIntArrayParam", ""); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - - // We expect success. - Assertion.Assert("success", success); - - // We expect the setter not to have gotten called, which means its value remains the default. - Assertion.AssertEquals("not set", mockTask.myIntArrayParamWasSet, false); - Assertion.AssertEquals("default value", mockTask.MyIntArrayParam, null); - } - - /// - /// Initialize a "int[]" parameter where an XML attribute was specified, but evaluated to empty. - /// - /// RGoel - [Test] - public void InitTask_IntArray_PropertyEvaluatesToEmpty() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.SetAttribute("MyIntArrayParam", "$(NonExistentProperty)"); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - - // We expect success. - Assertion.Assert("success", success); - - // We expect the setter not to have gotten called, which means its value remains the default. - Assertion.AssertEquals("not set", mockTask.myIntArrayParamWasSet, false); - Assertion.AssertEquals("default value", mockTask.MyIntArrayParam, null); - } - - /// - /// Initialize a "int[]" parameter where an XML attribute was specified, but evaluated to empty. - /// - /// RGoel - [Test] - public void InitTask_IntArray_ItemEvaluatesToEmpty() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.SetAttribute("MyIntArrayParam", "@(NonExistentItem)"); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - - // We expect success. - Assertion.Assert("success", success); - - // We expect the setter not to have gotten called, which means its value remains the default. - Assertion.AssertEquals("not set", mockTask.myIntArrayParamWasSet, false); - Assertion.AssertEquals("default value", mockTask.MyIntArrayParam, null); - } - - /********************************************************************************* - * - * STRING - * - *********************************************************************************/ - /// - /// Initialize a "string" parameter where no XML attribute was specified on the task. - /// - /// RGoel - [Test] - public void InitTask_String_NoAttribute() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.RemoveAttribute("MyStringParam"); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - - // We expect success. - Assertion.Assert("success", success); - - // We expect the setter not to have gotten called, which means its value remains the default. - Assertion.AssertEquals("not set", mockTask.myStringParamWasSet, false); - Assertion.AssertEquals("default value", mockTask.MyStringParam, null); - } - - /// - /// Initialize a "string" parameter where a completely empty XML attribute was specified on the task. - /// - /// RGoel - [Test] - public void InitTask_String_EmptyAttribute() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.SetAttribute("MyStringParam", ""); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - - // We expect success. - Assertion.Assert("success", success); - - // We expect the setter not to have gotten called, which means its value remains the default. - Assertion.AssertEquals("not set", mockTask.myStringParamWasSet, false); - Assertion.AssertEquals("default value", mockTask.MyStringParam, null); - } - - /// - /// Initialize a "string" parameter where an XML attribute was specified, but evaluated to empty. - /// - /// RGoel - [Test] - public void InitTask_String_PropertyEvaluatesToEmpty() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.SetAttribute("MyStringParam", "$(NonExistentProperty)"); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - - // We expect success. - Assertion.Assert("success", success); - - // We expect the setter not to have gotten called, which means its value remains the default. - Assertion.AssertEquals("not set", mockTask.myStringParamWasSet, false); - Assertion.AssertEquals("default value", mockTask.MyStringParam, null); - } - - /// - /// Initialize a "string" parameter where an XML attribute was specified, but evaluated to empty. - /// - /// RGoel - [Test] - public void InitTask_String_ItemEvaluatesToEmpty() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.SetAttribute("MyStringParam", "@(NonExistentItem)"); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - - // We expect success. - Assertion.Assert("success", success); - - // We expect the setter not to have gotten called, which means its value remains the default. - Assertion.AssertEquals("not set", mockTask.myStringParamWasSet, false); - Assertion.AssertEquals("default value", mockTask.MyStringParam, null); - } - - /********************************************************************************* - * - * STRING[] - * - *********************************************************************************/ - /// - /// Initialize a "string[]" parameter where no XML attribute was specified on the task. - /// - /// RGoel - [Test] - public void InitTask_StringArray_NoAttribute() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.RemoveAttribute("MyStringArrayParam"); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - - // We expect success. - Assertion.Assert("success", success); - - // We expect the setter not to have gotten called, which means its value remains the default. - Assertion.AssertEquals("not set", mockTask.myStringArrayParamWasSet, false); - Assertion.AssertEquals("default value", mockTask.MyStringArrayParam, null); - } - - /// - /// Initialize a "string[]" parameter where a completely empty XML attribute was specified on the task. - /// - /// RGoel - [Test] - public void InitTask_StringArray_EmptyAttribute() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.SetAttribute("MyStringArrayParam", ""); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - - // We expect success. - Assertion.Assert("success", success); - - // We expect the setter not to have gotten called, which means its value remains the default. - Assertion.AssertEquals("not set", mockTask.myStringArrayParamWasSet, false); - Assertion.AssertEquals("default value", mockTask.MyStringArrayParam, null); - } - - /// - /// Initialize a "string[]" parameter where an XML attribute was specified, but evaluated to empty. - /// - /// RGoel - [Test] - public void InitTask_StringArray_PropertyEvaluatesToEmpty() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.SetAttribute("MyStringArrayParam", "$(NonExistentProperty)"); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - - // We expect success. - Assertion.Assert("success", success); - - // We expect the setter not to have gotten called, which means its value remains the default. - Assertion.AssertEquals("not set", mockTask.myStringArrayParamWasSet, false); - Assertion.AssertEquals("default value", mockTask.MyStringArrayParam, null); - } - - /// - /// Initialize a "string[]" parameter where an XML attribute was specified, but evaluated to empty. - /// - /// RGoel - [Test] - public void InitTask_StringArray_ItemEvaluatesToEmpty() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.SetAttribute("MyStringArrayParam", "@(NonExistentItem)"); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - - // We expect success. - Assertion.Assert("success", success); - - // We expect the setter not to have gotten called, which means its value remains the default. - Assertion.AssertEquals("not set", mockTask.myStringArrayParamWasSet, false); - Assertion.AssertEquals("default value", mockTask.MyStringArrayParam, null); - } - - /// - /// Initializing a string[] task parameter with a single item. - /// - /// JomoF - [Test] - public void InitTask_StringArray_SingleItem() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.SetAttribute("MyStringArrayParam", "VisualBasic.dll"); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - - // We expect success. - Assertion.Assert("success", success); - - Assertion.AssertEquals("set", mockTask.myStringArrayParamWasSet, true); - Assertion.AssertEquals("set length", mockTask.MyStringArrayParam.Length, 1); - Assertion.AssertEquals("set value", mockTask.MyStringArrayParam[0], "VisualBasic.dll"); - } - - /********************************************************************************* - * - * ITASKITEM - * - *********************************************************************************/ - /// - /// Initialize a "ITaskItem" parameter where no XML attribute was specified on the task. - /// - /// RGoel - [Test] - public void InitTask_ITaskItem_NoAttribute() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.RemoveAttribute("MyITaskItemParam"); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - - // We expect success. - Assertion.Assert("success", success); - - // We expect the setter not to have gotten called, which means its value remains the default. - Assertion.AssertEquals("not set", mockTask.myITaskItemParamWasSet, false); - Assertion.AssertEquals("default value", mockTask.MyITaskItemParam, null); - } - - /// - /// Initialize a "string" parameter where a completely empty XML attribute was specified on the task. - /// - /// RGoel - [Test] - public void InitTask_ITaskItem_EmptyAttribute() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.SetAttribute("MyITaskItemParam", ""); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - - // We expect success. - Assertion.Assert("success", success); - - // We expect the setter not to have gotten called, which means its value remains the default. - Assertion.AssertEquals("not set", mockTask.myITaskItemParamWasSet, false); - Assertion.AssertEquals("default value", mockTask.MyITaskItemParam, null); - } - - /// - /// Initialize a "string" parameter where an XML attribute was specified, but evaluated to empty. - /// - /// RGoel - [Test] - public void InitTask_ITaskItem_PropertyEvaluatesToEmpty() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.SetAttribute("MyITaskItemParam", "$(NonExistentProperty)"); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - - // We expect success. - Assertion.Assert("success", success); - - // We expect the setter not to have gotten called, which means its value remains the default. - Assertion.AssertEquals("not set", mockTask.myITaskItemParamWasSet, false); - Assertion.AssertEquals("default value", mockTask.MyITaskItemParam, null); - } - - /// - /// Initialize a "itaskitem" parameter where an XML attribute was specified, but evaluated to empty. - /// - /// RGoel - [Test] - public void InitTask_ITaskItem_ItemEvaluatesToEmpty() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.SetAttribute("MyITaskItemParam", "@(NonExistentItem)"); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - - // We expect success. - Assertion.Assert("success", success); - - // We expect the setter not to have gotten called, which means its value remains the default. - Assertion.AssertEquals("not set", mockTask.myITaskItemParamWasSet, false); - Assertion.AssertEquals("default value", mockTask.MyITaskItemParam, null); - } - - /// - /// Initialize a "itaskitem" parameter where a transform was specified, but evaluated to empty. - /// This should result in no setting at all. - /// - /// danmose - [Test] - public void InitTask_ITaskItem_ExpansionEvaluatesToEmpty() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; - EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.SetAttribute("MyITaskItemParam", "@(ItemListContainingOneItem -> '%(NonexistentMeta)')"); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - - // We expect success. - Assertion.Assert("success", success); - - // We expect the setter not to have gotten called, which means its value remains the default. - Assertion.AssertEquals("not set", mockTask.myITaskItemParamWasSet, true); - Assertion.AssertEquals("default value", mockTask.MyITaskItemParam.ItemSpec, String.Empty); - } - - /// - /// Initialize a "itaskitem" parameter where a transform was specified, but evaluated to empty. - /// - /// danmose - [Test] - public void InitTask_ITaskItemArray_ExpansionEvaluatesToEmpty() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; - EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.SetAttribute("MyITaskItemArrayParam", "@(ItemListContainingTwoItems -> '%(NonexistentMeta)')"); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - - // We expect success. - Assertion.Assert("success", success); - - // We expect the setter to have gotten called. - Assertion.AssertEquals("not set", mockTask.myITaskItemArrayParamWasSet, true); - Assertion.AssertEquals("default value", mockTask.MyITaskItemArrayParam[0].ItemSpec, String.Empty); - } - - /// - /// Initializing a ITaskItem scalar parameter with an item that has some metadata - /// should preserve the metadata. - /// - /// RGoel - [Test] - public void InitTask_ITaskItem_PreservesMetadata() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.SetAttribute("MyITaskItemParam", "@(ItemListContainingOneItem)"); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - - // We expect success. - Assertion.Assert("success", success); - - Assertion.AssertEquals("Expected task parameter to be set", mockTask.myITaskItemParamWasSet, true); - Assertion.AssertNotNull("Expected task parameter to be non-null", mockTask.MyITaskItemParam); - Assertion.AssertEquals("Expected item spec to be a.cs", "a.cs", mockTask.MyITaskItemParam.ItemSpec); - Assertion.AssertEquals("Expected culture to be fr-fr", "fr-fr", mockTask.MyITaskItemParam.GetMetadata("Culture")); - } - - /// - /// Initializing a ITaskItem scalar parameter with an item that has some metadata - /// should preserve the metadata. - /// - /// RGoel - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void InitTask_ITaskItem_CannotAcceptTwoItems() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.SetAttribute("MyITaskItemParam", "@(ItemListContainingTwoItems)"); - - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - // This should throw. - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - } - - /********************************************************************************* - * - * ITASKITEM[] - * - *********************************************************************************/ - /// - /// Initialize a "string[]" parameter where no XML attribute was specified on the task. - /// - /// RGoel - [Test] - public void InitTask_ITaskItemArray_NoAttribute() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.RemoveAttribute("MyITaskItemArrayParam"); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - - // We expect success. - Assertion.Assert("success", success); - - // We expect the setter not to have gotten called, which means its value remains the default. - Assertion.AssertEquals("not set", mockTask.myITaskItemArrayParamWasSet, false); - Assertion.AssertEquals("default value", mockTask.MyITaskItemArrayParam, null); - } - - /// - /// Initialize a "string[]" parameter where a completely empty XML attribute was specified on the task. - /// - /// RGoel - [Test] - public void InitTask_ITaskItemArray_EmptyAttribute() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.SetAttribute("MyITaskItemArrayParam", ""); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - - // We expect success. - Assertion.Assert("success", success); - - // We expect the setter not to have gotten called, which means its value remains the default. - Assertion.AssertEquals("not set", mockTask.myITaskItemArrayParamWasSet, false); - Assertion.AssertEquals("default value", mockTask.MyITaskItemArrayParam, null); - } - - /// - /// Initialize a "string[]" parameter where an XML attribute was specified, but evaluated to empty. - /// - /// RGoel - [Test] - public void InitTask_ITaskItemArray_PropertyEvaluatesToEmpty() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.SetAttribute("MyITaskItemArrayParam", "$(NonExistentProperty)"); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - - // We expect success. - Assertion.Assert("success", success); - - // We expect the setter not to have gotten called, which means its value remains the default. - Assertion.AssertEquals("not set", mockTask.myITaskItemArrayParamWasSet, false); - Assertion.AssertEquals("default value", mockTask.MyITaskItemArrayParam, null); - } - - /// - /// Initialize a "string[]" parameter where an XML attribute was specified, but evaluated to empty. - /// - /// RGoel - [Test] - public void InitTask_ITaskItemArray_ItemEvaluatesToEmpty() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.SetAttribute("MyITaskItemArrayParam", "@(NonExistentItem)"); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - - // We expect success. - Assertion.Assert("success", success); - - // We expect the setter not to have gotten called, which means its value remains the default. - Assertion.AssertEquals("not set", mockTask.myITaskItemArrayParamWasSet, false); - Assertion.AssertEquals("default value", mockTask.MyITaskItemArrayParam, null); - } - - /********************************************************************************* - * - * [REQUIRED] BOOL - * - *********************************************************************************/ - /// - /// Initialize a REQUIRED "bool" parameter where no XML attribute was specified on the task. - /// - /// RGoel - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void InitTask_Required_Bool_NoAttribute() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.RemoveAttribute("MyRequiredBoolParam"); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - // This should throw. - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - } - - /// - /// Initialize a REQUIRED "bool" parameter where a completely empty XML attribute was specified on the task. - /// - /// RGoel - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void InitTask_Required_Bool_EmptyAttribute() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.SetAttribute("MyRequiredBoolParam", ""); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - // This should throw. - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - } - - /// - /// Initialize a REQUIRED "bool" parameter where an XML attribute was specified, but evaluated to empty. - /// - /// RGoel - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void InitTask_Required_Bool_PropertyEvaluatesToEmpty() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.SetAttribute("MyRequiredBoolParam", "$(NonExistentProperty)"); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - // This should throw. - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - } - - /// - /// Initialize a REQUIRED "bool" parameter where an XML attribute was specified, but evaluated to empty. - /// - /// RGoel - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void InitTask_Required_Bool_ItemEvaluatesToEmpty() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.SetAttribute("MyRequiredBoolParam", "@(NonExistentItem)"); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - // This should throw. - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - } - - /********************************************************************************* - * - * [REQUIRED] BOOL[] - * - *********************************************************************************/ - /// - /// Initialize a REQUIRED "bool[]" parameter where no XML attribute was specified on the task. - /// - /// RGoel - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void InitTask_Required_BoolArray_NoAttribute() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.RemoveAttribute("MyRequiredBoolArrayParam"); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - // This should throw. - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - } - - /// - /// Initialize a REQUIRED "bool[]" parameter where a completely empty XML attribute was specified on the task. - /// - /// RGoel - [Test] - public void InitTask_Required_BoolArray_EmptyAttribute() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.SetAttribute("MyRequiredBoolArrayParam", ""); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - - // We expect success. - Assertion.Assert("success", success); - - Assertion.AssertEquals("was set", mockTask.myRequiredBoolArrayParamWasSet, true); - Assertion.AssertEquals("new value", mockTask.MyRequiredBoolArrayParam.Length, 0); - } - - /// - /// Initialize a REQUIRED "bool[]" parameter where an XML attribute was specified, but evaluated to empty. - /// - /// RGoel - [Test] - public void InitTask_Required_BoolArray_PropertyEvaluatesToEmpty() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.SetAttribute("MyRequiredBoolArrayParam", "$(NonExistentProperty)"); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - - // We expect success. - Assertion.Assert("success", success); - - Assertion.AssertEquals("was set", mockTask.myRequiredBoolArrayParamWasSet, true); - Assertion.AssertEquals("new value", mockTask.MyRequiredBoolArrayParam.Length, 0); - } - - /// - /// Initialize a REQUIRED "bool[]" parameter where an XML attribute was specified, but evaluated to empty. - /// - /// RGoel - [Test] - public void InitTask_Required_BoolArray_ItemEvaluatesToEmpty() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.SetAttribute("MyRequiredBoolArrayParam", "@(NonExistentItem)"); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - - // We expect success. - Assertion.Assert("success", success); - - Assertion.AssertEquals("was set", mockTask.myRequiredBoolArrayParamWasSet, true); - Assertion.AssertEquals("new value", mockTask.MyRequiredBoolArrayParam.Length, 0); - } - - /********************************************************************************* - * - * [REQUIRED] INT - * - *********************************************************************************/ - /// - /// Initialize a REQUIRED "int" parameter where no XML attribute was specified on the task. - /// - /// RGoel - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void InitTask_Required_Int_NoAttribute() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.RemoveAttribute("MyRequiredIntParam"); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - // This should throw. - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - } - - /// - /// Initialize a REQUIRED "int" parameter where a completely empty XML attribute was specified on the task. - /// - /// RGoel - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void InitTask_Required_Int_EmptyAttribute() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.SetAttribute("MyRequiredIntParam", ""); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - // This should throw. - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - } - - /// - /// Initialize a REQUIRED "int" parameter where an XML attribute was specified, but evaluated to empty. - /// - /// RGoel - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void InitTask_Required_Int_PropertyEvaluatesToEmpty() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.SetAttribute("MyRequiredIntParam", "$(NonExistentProperty)"); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - // This should throw. - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - } - - /// - /// Initialize a REQUIRED "int" parameter where an XML attribute was specified, but evaluated to empty. - /// - /// RGoel - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void InitTask_Required_Int_ItemEvaluatesToEmpty() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.SetAttribute("MyRequiredIntParam", "@(NonExistentItem)"); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - // This should throw. - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - } - - /********************************************************************************* - * - * [REQUIRED] INT[] - * - *********************************************************************************/ - /// - /// Initialize a REQUIRED "int[]" parameter where no XML attribute was specified on the task. - /// - /// RGoel - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void InitTask_Required_IntArray_NoAttribute() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.RemoveAttribute("MyRequiredIntArrayParam"); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - // This should throw. - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - } - - /// - /// Initialize a REQUIRED "int[]" parameter where a completely empty XML attribute was specified on the task. - /// - /// RGoel - [Test] - public void InitTask_Required_IntArray_EmptyAttribute() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.SetAttribute("MyRequiredIntArrayParam", ""); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - - // We expect success. - Assertion.Assert("success", success); - - Assertion.AssertEquals("was set", mockTask.myRequiredIntArrayParamWasSet, true); - Assertion.AssertEquals("new value", mockTask.MyRequiredIntArrayParam.Length, 0); - } - - /// - /// Initialize a REQUIRED "int[]" parameter where an XML attribute was specified, but evaluated to empty. - /// - /// RGoel - [Test] - public void InitTask_Required_IntArray_PropertyEvaluatesToEmpty() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.SetAttribute("MyRequiredIntArrayParam", "$(NonExistentProperty)"); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - - // We expect success. - Assertion.Assert("success", success); - - Assertion.AssertEquals("was set", mockTask.myRequiredIntArrayParamWasSet, true); - Assertion.AssertEquals("new value", mockTask.MyRequiredIntArrayParam.Length, 0); - } - - /// - /// Initialize a REQUIRED "int[]" parameter where an XML attribute was specified, but evaluated to empty. - /// - /// RGoel - [Test] - public void InitTask_Required_IntArray_ItemEvaluatesToEmpty() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.SetAttribute("MyRequiredIntArrayParam", "@(NonExistentItem)"); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - - // We expect success. - Assertion.Assert("success", success); - - Assertion.AssertEquals("was set", mockTask.myRequiredIntArrayParamWasSet, true); - Assertion.AssertEquals("new value", mockTask.MyRequiredIntArrayParam.Length, 0); - } - - /********************************************************************************* - * - * [REQUIRED] STRING - * - *********************************************************************************/ - /// - /// Initialize a REQUIRED "string" parameter where no XML attribute was specified on the task. - /// - /// RGoel - [ExpectedException(typeof(InvalidProjectFileException))] - [Test] - public void InitTask_Required_String_NoAttribute() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.RemoveAttribute("MyRequiredStringParam"); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - // This should throw. - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - } - - /// - /// Initialize a REQUIRED "string" parameter where a completely empty XML attribute was specified on the task. - /// - /// RGoel - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void InitTask_Required_String_EmptyAttribute() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.SetAttribute("MyRequiredStringParam", ""); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - // This should throw. - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - } - - /// - /// Initialize a REQUIRED "string" parameter where an XML attribute was specified, but evaluated to empty. - /// - /// RGoel - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void InitTask_Required_String_PropertyEvaluatesToEmpty() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.SetAttribute("MyRequiredStringParam", "$(NonExistentProperty)"); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - // This should throw. - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - } - - /// - /// Initialize a REQUIRED "string" parameter where an XML attribute was specified, but evaluated to empty. - /// - /// RGoel - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void InitTask_Required_String_ItemEvaluatesToEmpty() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.SetAttribute("MyRequiredStringParam", "@(NonExistentItem)"); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - // This should throw. - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - } - - /********************************************************************************* - * - * [REQUIRED] STRING[] - * - *********************************************************************************/ - /// - /// Initialize a REQUIRED "string[]" parameter where no XML attribute was specified on the task. - /// - /// RGoel - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void InitTask_Required_StringArray_NoAttribute() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.RemoveAttribute("MyRequiredStringArrayParam"); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - // This should throw. - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - } - - /// - /// Initialize a REQUIRED "string[]" parameter where a completely empty XML attribute was specified on the task. - /// - /// RGoel - [Test] - public void InitTask_Required_StringArray_EmptyAttribute() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.SetAttribute("MyRequiredStringArrayParam", ""); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - - // We expect success. - Assertion.Assert("success", success); - - Assertion.AssertEquals("was set", mockTask.myRequiredStringArrayParamWasSet, true); - Assertion.AssertEquals("new value", mockTask.MyRequiredStringArrayParam.Length, 0); - } - - /// - /// Initialize a REQUIRED "string[]" parameter where an XML attribute was specified, but evaluated to empty. - /// - /// RGoel - [Test] - public void InitTask_Required_StringArray_PropertyEvaluatesToEmpty() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.SetAttribute("MyRequiredStringArrayParam", "$(NonExistentProperty)"); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - - // We expect success. - Assertion.Assert("success", success); - - Assertion.AssertEquals("was set", mockTask.myRequiredStringArrayParamWasSet, true); - Assertion.AssertEquals("new value", mockTask.MyRequiredStringArrayParam.Length, 0); - } - - /// - /// Initialize a REQUIRED "string[]" parameter where an XML attribute was specified, but evaluated to empty. - /// - /// RGoel - [Test] - public void InitTask_Required_StringArray_ItemEvaluatesToEmpty() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.SetAttribute("MyRequiredStringArrayParam", "@(NonExistentItem)"); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - - // We expect success. - Assertion.Assert("success", success); - - Assertion.AssertEquals("was set", mockTask.myRequiredStringArrayParamWasSet, true); - Assertion.AssertEquals("new value", mockTask.MyRequiredStringArrayParam.Length, 0); - } - - /********************************************************************************* - * - * [REQUIRED] ITASKITEM - * - *********************************************************************************/ - /// - /// Initialize a REQUIRED "ITaskItem" parameter where no XML attribute was specified on the task. - /// - /// RGoel - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void InitTask_Required_ITaskItem_NoAttribute() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.RemoveAttribute("MyRequiredITaskItemParam"); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - // This should throw. - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - } - - /// - /// Initialize a REQUIRED "string" parameter where a completely empty XML attribute was specified on the task. - /// - /// RGoel - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void InitTask_Required_ITaskItem_EmptyAttribute() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.SetAttribute("MyRequiredITaskItemParam", ""); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - // This should throw. - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - } - - /// - /// Initialize a REQUIRED "string" parameter where an XML attribute was specified, but evaluated to empty. - /// - /// RGoel - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void InitTask_Required_ITaskItem_PropertyEvaluatesToEmpty() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.SetAttribute("MyRequiredITaskItemParam", "$(NonExistentProperty)"); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - // This should throw. - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - } - - /// - /// Initialize a REQUIRED "string" parameter where an XML attribute was specified, but evaluated to empty. - /// - /// RGoel - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void InitTask_Required_ITaskItem_ItemEvaluatesToEmpty() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.SetAttribute("MyRequiredITaskItemParam", "@(NonExistentItem)"); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - // This should throw. - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - } - - /********************************************************************************* - * - * [REQUIRED] ITASKITEM[] - * - *********************************************************************************/ - /// - /// Initialize a REQUIRED "string[]" parameter where no XML attribute was specified on the task. - /// - /// RGoel - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void InitTask_Required_ITaskItemArray_NoAttribute() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.RemoveAttribute("MyRequiredITaskItemArrayParam"); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - // This should throw. - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - } - - /// - /// Initialize a REQUIRED "string[]" parameter where a completely empty XML attribute was specified on the task. - /// - /// RGoel - [Test] - public void InitTask_Required_ITaskItemArray_EmptyAttribute() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.SetAttribute("MyRequiredITaskItemArrayParam", ""); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - - // We expect success. - Assertion.Assert("success", success); - - Assertion.AssertEquals("was set", mockTask.myRequiredITaskItemArrayParamWasSet, true); - Assertion.AssertEquals("new value", mockTask.MyRequiredITaskItemArrayParam.Length, 0); - } - - /// - /// Initialize a REQUIRED "string[]" parameter where an XML attribute was specified, but evaluated to empty. - /// - /// RGoel - [Test] - public void InitTask_Required_ITaskItemArray_PropertyEvaluatesToEmpty() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.SetAttribute("MyRequiredITaskItemArrayParam", "$(NonExistentProperty)"); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - - // We expect success. - Assertion.Assert("success", success); - - Assertion.AssertEquals("was set", mockTask.myRequiredITaskItemArrayParamWasSet, true); - Assertion.AssertEquals("new value", mockTask.MyRequiredITaskItemArrayParam.Length, 0); - } - - /// - /// Initialize a REQUIRED "string[]" parameter where an XML attribute was specified, but evaluated to empty. - /// - /// RGoel - [Test] - public void InitTask_Required_ITaskItemArray_ItemEvaluatesToEmpty() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - taskNode.SetAttribute("MyRequiredITaskItemArrayParam", "@(NonExistentItem)"); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - bool success = taskEngine.InitializeTask(mockTask, itemBucket, engineProxy); - - // We expect success. - Assertion.Assert("success", success); - - Assertion.AssertEquals("was set", mockTask.myRequiredITaskItemArrayParamWasSet, true); - Assertion.AssertEquals("new value", mockTask.MyRequiredITaskItemArrayParam.Length, 0); - } - - /********************************************************************************* - * - * OUTPUT PARAMS - * - *********************************************************************************/ - /// - /// Attempts to gather outputs from a task parameter of type "ArrayList". This should fail. Bug #416910 - /// - /// RGoel - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void TaskOutputsArrayListParameter() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - - // Create a task output specification to satisfy GatherGeneratedTaskOutputs. - XmlElement outputElement = taskNode.OwnerDocument.CreateElement("Output"); - outputElement.SetAttribute("TaskParameter", "MyArrayListOutputParam"); - outputElement.SetAttribute("ItemName", "MyItemList"); - taskNode.AppendChild(outputElement); - TaskOutput myTaskOutputSpecification = new TaskOutput(outputElement); - - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - // This should fail because MSBuild doesn't support output params of type ArrayList. - taskEngine.GatherGeneratedTaskOutputs(LookupHelpers.CreateLookup(new Hashtable()), myTaskOutputSpecification, "MyArrayListOutputParam", "MyItemList", null, mockTask); - } - - /// - /// Attempts to gather outputs from a null task parameter of type "ITaskItem[]". This should succeed. Bug #430452 - /// - /// danmose - [Test] - public void TaskOutputsNullITaskItemArrayParameter() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - - // Create a task output specification to satisfy GatherGeneratedTaskOutputs. - XmlElement outputElement = taskNode.OwnerDocument.CreateElement("Output"); - outputElement.SetAttribute("TaskParameter", "NullITaskItemArrayOutputParameter"); - outputElement.SetAttribute("ItemName", "MyItemList"); - taskNode.AppendChild(outputElement); - TaskOutput myTaskOutputSpecification = new TaskOutput(outputElement); - - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - taskEngine.GatherGeneratedTaskOutputs(LookupHelpers.CreateLookup(new Hashtable()), myTaskOutputSpecification, "NullITaskItemArrayOutputParameter", "MyItemList", null, mockTask); - // Did not throw InvalidProjectFileException - } - - /// - /// Attempts to gather outputs into an item list from an string task parameter that - /// returns an empty string. This should be a no-op. Bug #444501. - /// - /// danmose - [Test] - public void TaskOutputsEmptyStringParameterIntoItemList() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - - // Create a task output specification to satisfy GatherGeneratedTaskOutputs. - XmlElement outputElement = taskNode.OwnerDocument.CreateElement("Output"); - outputElement.SetAttribute("TaskParameter", "EmptyStringOutputParameter"); - outputElement.SetAttribute("ItemName", "MyItemList"); - taskNode.AppendChild(outputElement); - TaskOutput myTaskOutputSpecification = new TaskOutput(outputElement); - - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - taskEngine.GatherGeneratedTaskOutputs(LookupHelpers.CreateLookup(new Hashtable()), myTaskOutputSpecification, "NullITaskItemArrayOutputParameter", "MyItemList", null, mockTask); - // Did not throw InvalidProjectFileException - } - - /// - /// Attempts to gather outputs into an item list from an string task parameter that - /// returns an empty string. This should be a no-op. Bug #444501. - /// - /// danmose - [Test] - public void TaskOutputsEmptyStringInStringArrayParameterIntoItemList() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - - // Create a task output specification to satisfy GatherGeneratedTaskOutputs. - XmlElement outputElement = taskNode.OwnerDocument.CreateElement("Output"); - outputElement.SetAttribute("TaskParameter", "EmptyStringInStringArrayOutputParameter"); - outputElement.SetAttribute("ItemName", "MyItemList"); - taskNode.AppendChild(outputElement); - TaskOutput myTaskOutputSpecification = new TaskOutput(outputElement); - - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - taskEngine.GatherGeneratedTaskOutputs(LookupHelpers.CreateLookup(new Hashtable()), myTaskOutputSpecification, "EmptyStringInStringArrayOutputParameter", "MyItemList", null, mockTask); - // Did not throw InvalidProjectFileException - } - - /// - /// Attempts to gather outputs from a task parameter of type "string". This should succeed. - /// - /// danmose - [Test] - public void TaskOutputsStringParameter() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - - // Create a task output specification to satisfy GatherGeneratedTaskOutputs. - XmlElement outputElement = taskNode.OwnerDocument.CreateElement("Output"); - outputElement.SetAttribute("TaskParameter", "StringOutputParameter"); - outputElement.SetAttribute("ItemName", "MyItemList"); - taskNode.AppendChild(outputElement); - TaskOutput myTaskOutputSpecification = new TaskOutput(outputElement); - - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - taskEngine.GatherGeneratedTaskOutputs(GetEnteredScopeLookup(), myTaskOutputSpecification, "StringOutputParameter", "MyItemList", null, mockTask); - // Did not throw InvalidProjectFileException - } - - /// - /// Attempts to gather outputs from a task parameter of type "string[]". This should succeed. - /// - /// danmose - [Test] - public void TaskOutputsStringArrayParameter() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - - // Create a task output specification to satisfy GatherGeneratedTaskOutputs. - XmlElement outputElement = taskNode.OwnerDocument.CreateElement("Output"); - outputElement.SetAttribute("TaskParameter", "StringArrayOutputParameter"); - outputElement.SetAttribute("ItemName", "MyItemList"); - taskNode.AppendChild(outputElement); - TaskOutput myTaskOutputSpecification = new TaskOutput(outputElement); - - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - taskEngine.GatherGeneratedTaskOutputs(GetEnteredScopeLookup(), myTaskOutputSpecification, "StringArrayOutputParameter", "MyItemList", null, mockTask); - // Did not throw InvalidProjectFileException - } - - /// - /// Attempts to gather outputs from a task parameter of type "int". This should succeed. - /// - /// danmose - [Test] - public void TaskOutputsIntParameter() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - - // Create a task output specification to satisfy GatherGeneratedTaskOutputs. - XmlElement outputElement = taskNode.OwnerDocument.CreateElement("Output"); - outputElement.SetAttribute("TaskParameter", "IntOutputParameter"); - outputElement.SetAttribute("ItemName", "MyItemList"); - taskNode.AppendChild(outputElement); - TaskOutput myTaskOutputSpecification = new TaskOutput(outputElement); - - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - taskEngine.GatherGeneratedTaskOutputs(GetEnteredScopeLookup(), myTaskOutputSpecification, "IntOutputParameter", "MyItemList", null, mockTask); - // Did not throw InvalidProjectFileException - } - - /// - /// Attempts to gather outputs from a task parameter of type "int[]". This should succeed. - /// - /// danmose - [Test] - public void TaskOutputsIntArrayParameter() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - - // Create a task output specification to satisfy GatherGeneratedTaskOutputs. - XmlElement outputElement = taskNode.OwnerDocument.CreateElement("Output"); - outputElement.SetAttribute("TaskParameter", "IntArrayOutputParameter"); - outputElement.SetAttribute("ItemName", "MyItemList"); - taskNode.AppendChild(outputElement); - TaskOutput myTaskOutputSpecification = new TaskOutput(outputElement); - - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - taskEngine.GatherGeneratedTaskOutputs(GetEnteredScopeLookup(), myTaskOutputSpecification, "IntArrayOutputParameter", "MyItemList", null, mockTask); - // Did not throw InvalidProjectFileException - } - - - /// - /// Attempts to gather outputs from a task parameter of type "object[]". This should fail. - /// - /// danmose - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void TaskOutputsObjectArrayParameter() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - - // Create a task output specification to satisfy GatherGeneratedTaskOutputs. - XmlElement outputElement = taskNode.OwnerDocument.CreateElement("Output"); - outputElement.SetAttribute("TaskParameter", "ObjectArrayOutputParameter"); - outputElement.SetAttribute("ItemName", "MyItemList"); - taskNode.AppendChild(outputElement); - TaskOutput myTaskOutputSpecification = new TaskOutput(outputElement); - - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - taskEngine.GatherGeneratedTaskOutputs(LookupHelpers.CreateLookup(new Hashtable()), myTaskOutputSpecification, "ObjectArrayOutputParameter", "MyItemList", null, mockTask); - } - - /// - /// Attempts to gather outputs from a task parameter of type "ITaskItem". This should succeed. - /// - /// danmose - [Test] - public void TaskOutputsITaskItemParameter() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - - // Create a task output specification to satisfy GatherGeneratedTaskOutputs. - XmlElement outputElement = taskNode.OwnerDocument.CreateElement("Output"); - outputElement.SetAttribute("TaskParameter", "ITaskItemOutputParameter"); - outputElement.SetAttribute("ItemName", "MyItemList"); - taskNode.AppendChild(outputElement); - TaskOutput myTaskOutputSpecification = new TaskOutput(outputElement); - - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - taskEngine.GatherGeneratedTaskOutputs(LookupHelpers.CreateLookup(new Hashtable()), myTaskOutputSpecification, "ITaskItemOutputParameter", "MyItemList", null, mockTask); - // Did not throw InvalidProjectFileException - } - - /// - /// Attempts to gather outputs from a task parameter of type "TaskItem". This should succeed. - /// - /// danmose - [Test] - public void TaskOutputsTaskItemParameter() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - - // Create a task output specification to satisfy GatherGeneratedTaskOutputs. - XmlElement outputElement = taskNode.OwnerDocument.CreateElement("Output"); - outputElement.SetAttribute("TaskParameter", "TaskItemOutputParameter"); - outputElement.SetAttribute("ItemName", "MyItemList"); - taskNode.AppendChild(outputElement); - TaskOutput myTaskOutputSpecification = new TaskOutput(outputElement); - - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - taskEngine.GatherGeneratedTaskOutputs(GetEnteredScopeLookup(), myTaskOutputSpecification, "TaskItemOutputParameter", "MyItemList", null, mockTask); - // Did not throw InvalidProjectFileException - } - - /// - /// Attempts to gather outputs from a task parameter of type "TaskItem[]". This should succeed. - /// - /// danmose - [Test] - public void TaskOutputsTaskItemArrayParameter() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - - // Create a task output specification to satisfy GatherGeneratedTaskOutputs. - XmlElement outputElement = taskNode.OwnerDocument.CreateElement("Output"); - outputElement.SetAttribute("TaskParameter", "TaskItemArrayOutputParameter"); - outputElement.SetAttribute("ItemName", "MyItemList"); - taskNode.AppendChild(outputElement); - TaskOutput myTaskOutputSpecification = new TaskOutput(outputElement); - - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - taskEngine.GatherGeneratedTaskOutputs(GetEnteredScopeLookup(), myTaskOutputSpecification, "TaskItemArrayOutputParameter", "MyItemList", null, mockTask); - // Did not throw InvalidProjectFileException - } - - /// - /// Attempts to gather outputs from a task parameter of type that is a custom implementation of "ITaskItem". This should succeed. - /// - /// danmose - [Test] - public void TaskOutputsMyTaskItemParameter() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - - // Create a task output specification to satisfy GatherGeneratedTaskOutputs. - XmlElement outputElement = taskNode.OwnerDocument.CreateElement("Output"); - outputElement.SetAttribute("TaskParameter", "MyTaskItemOutputParameter"); - outputElement.SetAttribute("ItemName", "MyItemList"); - taskNode.AppendChild(outputElement); - TaskOutput myTaskOutputSpecification = new TaskOutput(outputElement); - - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - taskEngine.GatherGeneratedTaskOutputs(GetEnteredScopeLookup(), myTaskOutputSpecification, "MyTaskItemOutputParameter", "MyItemList", null, mockTask); - // Did not throw InvalidProjectFileException - } - - /// - /// Attempts to gather outputs from a task parameter of type that is an array of a custom implementation of "ITaskItem". This should succeed. - /// - /// danmose - [Test] - public void TaskOutputsMyTaskItemArrayParameter() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - taskNode = CreateXmlTaskNode(); - - // Create a task output specification to satisfy GatherGeneratedTaskOutputs. - XmlElement outputElement = taskNode.OwnerDocument.CreateElement("Output"); - outputElement.SetAttribute("TaskParameter", "MyTaskItemArrayOutputParameter"); - outputElement.SetAttribute("ItemName", "MyItemList"); - taskNode.AppendChild(outputElement); - TaskOutput myTaskOutputSpecification = new TaskOutput(outputElement); - - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy); - - taskEngine.GatherGeneratedTaskOutputs(GetEnteredScopeLookup(), myTaskOutputSpecification, "MyTaskItemArrayOutputParameter", "MyItemList", null, mockTask); - // Did not throw InvalidProjectFileException - } - - [Test] - public void TasksAreDiscoveredWhenTaskConditionTrue() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - string condition = "'1'=='1'"; - taskNode = CreateXmlTaskNode(condition); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy, condition); - // Make sure class needs to be found - taskEngine.TaskClass = null; - - Hashtable[] fakeArray = new Hashtable[1]; - fakeArray[0] = new Hashtable(); - - // ExecuteTask should fail as it isn't found - Assertion.Assert(!taskEngine.ExecuteTask( - TaskExecutionMode.ExecuteTaskAndGatherOutputs, - LookupHelpers.CreateLookup(new Hashtable()))); - } - - [Test] - public void TasksNotDiscoveredWhenTaskConditionFalse() - { - XmlElement taskNode; - TaskEngine taskEngine; - MockTask mockTask; - ItemBucket itemBucket; EngineProxy engineProxy; - string condition = "'1'=='2'"; - taskNode = CreateXmlTaskNode(condition); - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy, condition); - // Make sure class needs to be found - taskEngine.TaskClass = null; - - Hashtable[] fakeArray = new Hashtable[1]; - fakeArray[0] = new Hashtable(); - - // ExecuteTask should succeed as although the task couldn't be found, - // it never needed to look for it - Assertion.Assert(taskEngine.ExecuteTask( - TaskExecutionMode.ExecuteTaskAndGatherOutputs, - LookupHelpers.CreateLookup(new Hashtable()))); - - } - - /// - /// Test task instantiation failure with a bogus using task tag - /// - /// LukaszG - [Test] - public void TaskClassResolutionFailureWithUsingTask() - { - MockLogger logger = new MockLogger(); - string projectFileContents = @" - - - - - - - - "; - - Project project = ObjectModelHelpers.CreateInMemoryProject(projectFileContents, logger); - project.Build(null, null); - - logger.AssertLogContains("MSB4062"); - logger.AssertLogContains("Building..."); - } - - /// - /// Test task instantiation failure without a using task tag - /// - /// LukaszG - [Test] - public void TaskClassResolutionFailureWithoutUsingTask() - { - MockLogger logger = new MockLogger(); - string projectFileContents = @" - - - - - - "; - - Project project = ObjectModelHelpers.CreateInMemoryProject(projectFileContents, logger); - project.Build(null, null); - - logger.AssertLogContains("MSB4036"); - logger.AssertLogContains("Building..."); - } - - /// - /// Test correct error is logged if the project file specifies an output - /// that the task does not provide. Regress VSWhidbey 584487. - /// - /// JeffCal - [Test] - public void TaskOutputSpecifiedButNotSupported() - { - MockLogger logger = new MockLogger(); - string projectFileContents = @" - - - - - - - - "; - - Project project = ObjectModelHelpers.CreateInMemoryProject(projectFileContents, logger); - project.Build(null, null); - - logger.AssertLogContains("MSB4131"); - logger.AssertLogDoesntContain("Got Here!"); - Assertion.Assert("MSBuild should have logged an error because the task does not provide the given output parameter!", logger.ErrorCount > 0); - } - - /// - /// Verify when task outputs are overridden the override messages are correctly displayed - /// - [Test] - public void OverridePropertiesInCreateProperty() - { - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - foo - - - bar - - - barz - - - - '/assemblyresource:%(Identity),%(LogicalName)', ' ')"" - Condition=""'%(LogicalName)' != '' ""> - - - - - - ", logger); - p.Build(new string[] { "t" }); - logger.AssertLogContains(new string[] { "final:[/assemblyresource:c.resx,barz]"}); - logger.AssertLogContains(new string[] { ResourceUtilities.FormatResourceString("TaskStarted", "CreateProperty") }); - logger.AssertLogContains(new string[] { ResourceUtilities.FormatResourceString("PropertyOutputOverridden", "LinkSwitches", "/assemblyresource:a.resx,foo", "/assemblyresource:b.resx,bar") }); - logger.AssertLogContains(new string[] { ResourceUtilities.FormatResourceString("PropertyOutputOverridden", "LinkSwitches", "/assemblyresource:b.resx,bar", "/assemblyresource:c.resx,barz") }); - } - - /// - /// Verify that when a task outputs are inferred the override messages are displayed - /// - [Test] - public void OverridePropertiesInInferredCreateProperty() - { - string[] files = null; - try - { - files = ObjectModelHelpers.GetTempFiles(2, new DateTime(2005, 1, 1)); - - MockLogger logger = new MockLogger(); - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - " + files[1] + @" - - - - foo - - - bar - - - barz - - - - - - - - '/assemblyresource:%(Identity),%(LogicalName)', ' ')"" - Condition=""'%(LogicalName)' != '' ""> - - - - - - ", logger); - p.Build(new string[] { "t2" }); - - // We should only see messages from the second target, as the first is only inferred - logger.AssertLogDoesntContain("start:"); - logger.AssertLogDoesntContain("end:"); - - logger.AssertLogContains(new string[] { "final:[/assemblyresource:c.resx,barz]" }); - logger.AssertLogDoesntContain( ResourceUtilities.FormatResourceString("TaskStarted", "CreateProperty")); - logger.AssertLogContains(new string[] { ResourceUtilities.FormatResourceString("PropertyOutputOverridden", "LinkSwitches", "/assemblyresource:a.resx,foo", "/assemblyresource:b.resx,bar") }); - logger.AssertLogContains(new string[] { ResourceUtilities.FormatResourceString("PropertyOutputOverridden", "LinkSwitches", "/assemblyresource:b.resx,bar", "/assemblyresource:c.resx,barz") }); - } - finally - { - ObjectModelHelpers.DeleteTempFiles(files); - } - } - - /********************************************************************************* - * - * Helpers - * - *********************************************************************************/ - private void InstantiateMockTaskHelper - ( - XmlElement taskNode, - out TaskEngine taskEngine, - out MockTask mockTask, - out ItemBucket itemBucket, - out EngineProxy engineProxy - ) - { - InstantiateMockTaskHelper(taskNode, out taskEngine, out mockTask, out itemBucket, out engineProxy, null); - } - - /// - /// Creates an instance of a MockTask, and returns the objects necessary to exercise - /// taskEngine.InitializeTask - /// - /// - /// - /// - /// - /// RGoel - private void InstantiateMockTaskHelper - ( - XmlElement taskNode, - out TaskEngine taskEngine, - out MockTask mockTask, - out ItemBucket itemBucket, - out EngineProxy engineProxy, - string condition - ) - { - LoadedType taskClass = new LoadedType(typeof(MockTask), new AssemblyLoadInfo(typeof(MockTask).Assembly.FullName, null)); - Engine engine = new Engine(@"c:\"); - Project project = new Project(engine); - EngineCallback engineCallback = new EngineCallback(engine); - TaskExecutionModule taskExecutionModule = new TaskExecutionModule(engineCallback, - TaskExecutionModule.TaskExecutionModuleMode.SingleProcMode, false); - ProjectBuildState buildContext = new ProjectBuildState(null, null, new BuildEventContext(0, 1, 1, 1)); - int nodeProxyID = engineCallback.CreateTaskContext(project, null, buildContext, taskNode, EngineCallback.inProcNode, new BuildEventContext(BuildEventContext.InvalidNodeId, BuildEventContext.InvalidTargetId, BuildEventContext.InvalidProjectContextId, BuildEventContext.InvalidTaskId)); - taskEngine = new TaskEngine - ( - taskNode, - null, /* host object */ - "In Memory", - project.FullFileName, - engine.LoggingServices, - nodeProxyID, - taskExecutionModule, - new BuildEventContext(0, 1, 1, 1) - ); - taskEngine.TaskClass = taskClass; - engineProxy = new EngineProxy(taskExecutionModule, nodeProxyID, project.FullFileName, project.FullFileName, engine.LoggingServices, null); - mockTask = new MockTask(new EngineProxy(taskExecutionModule, nodeProxyID, project.FullFileName, project.FullFileName, engine.LoggingServices, null)); - - // The code below creates an item table that is equivalent to the following MSBuild syntax: - // - // - // - // fr-fr - // - // - // - // c:\foo - // - // - // c:\bar - // - // - // - Hashtable itemsByName = new Hashtable(StringComparer.OrdinalIgnoreCase); - - BuildItemGroup itemListContainingOneItem = new BuildItemGroup(); - BuildItem a = itemListContainingOneItem.AddNewItem("ItemListContainingOneItem", "a.cs"); - a.SetMetadata("Culture", "fr-fr"); - itemsByName["ItemListContainingOneItem"] = itemListContainingOneItem; - - BuildItemGroup itemListContainingTwoItems = new BuildItemGroup(); - BuildItem b = itemListContainingTwoItems.AddNewItem("ItemListContainingTwoItems", "b.cs"); - b.SetMetadata("HintPath", "c:\\foo"); - BuildItem c = itemListContainingTwoItems.AddNewItem("ItemListContainingTwoItems", "c.cs"); - c.SetMetadata("HintPath", "c:\\bar"); - itemsByName["ItemListContainingTwoItems"] = itemListContainingTwoItems; - - itemBucket = new ItemBucket(new string[0], new Dictionary(), LookupHelpers.CreateLookup(itemsByName), 0); - } - - private static XmlElement CreateXmlTaskNode() - { - return CreateXmlTaskNode(null); - } - - private static XmlElement CreateXmlTaskNode(string condition) - { - XmlElement taskNode; - taskNode = new XmlDocument().CreateElement("MockTask"); - taskNode.SetAttribute("MyRequiredBoolParam", "true"); - taskNode.SetAttribute("MyRequiredBoolArrayParam", "true"); - taskNode.SetAttribute("MyRequiredIntParam", "1"); - taskNode.SetAttribute("MyRequiredIntArrayParam", "1"); - taskNode.SetAttribute("MyRequiredStringParam", "a"); - taskNode.SetAttribute("MyRequiredStringArrayParam", "a"); - taskNode.SetAttribute("MyRequiredITaskItemParam", "a"); - taskNode.SetAttribute("MyRequiredITaskItemArrayParam", "a"); - if (null != condition) - { - taskNode.SetAttribute("Condition", condition); - } - return taskNode; - } - - /// - /// Return a lookup that has entered scope, so that adds/removes are allowed on it. - /// - /// - private Lookup GetEnteredScopeLookup() - { - Lookup lookup = LookupHelpers.CreateEmptyLookup(); - lookup.EnterScope(); - return lookup; - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/TaskExecutionContext_Tests.cs b/src/Deprecated/Engine.UnitTests/TaskExecutionContext_Tests.cs deleted file mode 100644 index 98b52a7bd56..00000000000 --- a/src/Deprecated/Engine.UnitTests/TaskExecutionContext_Tests.cs +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Text; -using System.Xml; -using System.IO; - -using NUnit.Framework; - -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class TaskExecutionContextTest - { - /// - /// Make sure that the constructor correctly sets the properties that are passed in - /// - [Test] - public void TaskExecutionContextCreation() - { - - // Create some items to instantiate a task execution context and check to make sure those values are set properly - Engine engine = new Engine(); - engine.BinPath="TestBinPath"; - - ArrayList targetsToBuild = new ArrayList(); - targetsToBuild.Add("targetName"); - ProjectBuildState projectContext = new ProjectBuildState(null, targetsToBuild, new BuildEventContext(0, 1, 1, 1)); - - TaskExecutionContext context = new TaskExecutionContext(null, null, null, projectContext, 4, EngineCallback.inProcNode, new BuildEventContext(BuildEventContext.InvalidNodeId, BuildEventContext.InvalidTargetId, BuildEventContext.InvalidProjectContextId, BuildEventContext.InvalidTaskId)); - - Assert.IsTrue(context.BuildContext.TargetNamesToBuild.Contains("targetName"),"Expected target list to contain targetName"); - Assert.IsNull(context.ParentTarget,"ParentTarget should be null"); - Assert.IsNull(context.ThrownException,"ThrownException should be null"); - Assert.AreEqual(4,context.HandleId,"Node ProxyId should be 4"); - } - - - /// - /// Check for each property we can set, that we get the same value out - /// - [Test] - public void ExecutionProperties() - { - Engine engine = new Engine(); - engine.BinPath="TestBinPath"; - - ArrayList targetsToBuild = new ArrayList(); - targetsToBuild.Add("targetName"); - ProjectBuildState projectContext = new ProjectBuildState(new BuildRequest(-1, null, null, (BuildPropertyGroup)null, null, -1, false, false), targetsToBuild, new BuildEventContext(0, 1, 1, 1)); - - TaskExecutionContext context = new TaskExecutionContext(null, null, null, projectContext, 4, EngineCallback.inProcNode, new BuildEventContext(BuildEventContext.InvalidNodeId, BuildEventContext.InvalidTargetId, BuildEventContext.InvalidProjectContextId, BuildEventContext.InvalidTaskId)); - - Assert.IsTrue(context.BuildContext.TargetNamesToBuild.Contains("targetName"), "Expected target list to contain targetName"); - - Assert.AreEqual(EngineCallback.inProcNode,context.NodeIndex); - - Assert.IsNull(context.ParentTarget,"Expected ParentTarget to be null"); - - context.SetTaskOutputs(false, null, 0); - - Assert.IsFalse(context.TaskExecutedSuccessfully ); - Assert.IsNull(context.ThrownException, "Expected ThrownException to be null"); - - context.SetTaskOutputs(true, new Exception(), 0); - - Assert.IsTrue(context.TaskExecutedSuccessfully); - Assert.IsNotNull(context.ThrownException,"Expected ThrownException to not be null"); - - - } - - } -} diff --git a/src/Deprecated/Engine.UnitTests/TaskExecutionState_Test.cs b/src/Deprecated/Engine.UnitTests/TaskExecutionState_Test.cs deleted file mode 100644 index 6773c945fcd..00000000000 --- a/src/Deprecated/Engine.UnitTests/TaskExecutionState_Test.cs +++ /dev/null @@ -1,234 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections.Generic; -using System.Text; -using System.Xml; -using System.IO; -using System.Collections; - -using NUnit.Framework; - -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine; -using Microsoft.Build.BuildEngine.Shared; -using System.Threading; - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class TaskExecutionState_Test - { - - [SetUp] - public void SetUp() - { - // Whole bunch of setup code. - XmlElement taskNode = new XmlDocument().CreateElement("MockTask"); - LoadedType taskClass = new LoadedType(typeof(MockTask), new AssemblyLoadInfo(typeof(MockTask).Assembly.FullName, null)); - Engine engine = new Engine(@"c:\"); - loggingHelper = new EngineLoggingServicesHelper(); - engine.LoggingServices = loggingHelper; - Project project = new Project(engine); - taskExecutionModule = new MockTaskExecutionModule(new EngineCallback(engine)); - // Set up some "fake data" which will be passed to the Task Execution State object - Hashtable[] fakeArray = new Hashtable[1]; - fakeArray[0] = new Hashtable(); - projectLevelProprtiesForInference = new BuildPropertyGroup(); - projectLevelPropertiesForExecution = new BuildPropertyGroup(); - inferenceBucketItemsByName = fakeArray; - inferenceBucketMetaData = fakeArray; - projectLevelItemsForInference = new Hashtable(); - executionBucketItemsByName = fakeArray; - executionBucketMetaData = fakeArray; - projectLevelItemsForExecution = new Hashtable(); - hostObject = null; - projectFileOfTaskNode = "In Memory"; - parentProjectFullFileName = project.FullFileName; - nodeProxyId = engine.EngineCallback.CreateTaskContext(project, null, null, taskNode, EngineCallback.inProcNode, new BuildEventContext(BuildEventContext.InvalidNodeId, BuildEventContext.InvalidTargetId, BuildEventContext.InvalidProjectContextId, BuildEventContext.InvalidTaskId)); - executionDirectory = Directory.GetCurrentDirectory(); - projectId = project.Id; - } - - /// - /// Test the case where the execution directory does not equal the current directory. In that - /// case the current directory should be switched to the execution directory - /// - [Test] - public void ExecuteTaskCurrentDirNotEqualExecutionDir() - { - string theCurrentDirectory = Directory.GetCurrentDirectory(); - try - { - string executionDirectory = "C:\\"; - TaskExecutionMode howToExecuteTask = TaskExecutionMode.InferOutputsOnly; - XmlDocument doc = new XmlDocument(); - XmlElement taskNode = doc.CreateElement("Foo"); - TaskExecutionStateHelper executionState = new TaskExecutionStateHelper( - howToExecuteTask, - LookupHelpers.CreateLookup(projectLevelProprtiesForInference, projectLevelItemsForInference), - LookupHelpers.CreateLookup(projectLevelPropertiesForExecution, projectLevelItemsForExecution), - taskNode, - hostObject, - projectFileOfTaskNode, - parentProjectFullFileName, - executionDirectory, - nodeProxyId); - executionState.ParentModule = taskExecutionModule; - executionState.LoggingService = loggingHelper; - executionState.TargetInferenceSuccessful = true; - executionState.ExecuteTask(); - Assert.IsTrue(string.Compare(Directory.GetCurrentDirectory(), "C:\\", StringComparison.OrdinalIgnoreCase) == 0, "Expected current directory to be c:\\ which should show up as an empty directory string"); - } - finally - { - - Directory.SetCurrentDirectory(theCurrentDirectory); - } - - } - - [Test] - public void TaskExecutionStateTestProperties() - { - TaskExecutionMode howToExecuteTask = TaskExecutionMode.ExecuteTaskAndGatherOutputs; - XmlDocument doc = new XmlDocument(); - XmlElement taskNode = doc.CreateElement("Foo"); - TaskExecutionStateHelper executionState = new TaskExecutionStateHelper( - howToExecuteTask, - LookupHelpers.CreateLookup(projectLevelProprtiesForInference, projectLevelItemsForInference), - LookupHelpers.CreateLookup(projectLevelPropertiesForExecution, projectLevelItemsForExecution), - taskNode, - hostObject, - projectFileOfTaskNode, - parentProjectFullFileName, - executionDirectory, - nodeProxyId); - - executionState.HandleId = 1; - Assert.AreEqual(1, executionState.HandleId, "Expected NodeProxyId to be equal to 1"); - - executionState.LoggingService = loggingHelper; - Assert.AreEqual(loggingHelper, executionState.LoggingService, "Expected LoggingService to be equal to the loggingService set in the LoggingService property setter"); - } - - #region Data - - // Some class variables which are used in the unit tests - BuildPropertyGroup projectLevelProprtiesForInference; - BuildPropertyGroup projectLevelPropertiesForExecution; - Hashtable[] inferenceBucketItemsByName; - Hashtable[] inferenceBucketMetaData; - Hashtable projectLevelItemsForInference; - Hashtable[] executionBucketItemsByName; - Hashtable[] executionBucketMetaData; - Hashtable projectLevelItemsForExecution; - ITaskHost hostObject; - MockTaskExecutionModule taskExecutionModule; - EngineLoggingServicesHelper loggingHelper; - string projectFileOfTaskNode; - string parentProjectFullFileName; - int nodeProxyId; - int projectId; - string executionDirectory; - #endregion - } - #region TaskExecutionStateHelper - /// - /// Since we cannot override task engine inside of taskExecutionState we need to override some methods - /// inside of teakexecutionstate which will allow us to replace the taskEngineCalls - /// within taskExecutionState with some mock methods - /// - internal class TaskExecutionStateHelper : TaskExecutionState - { - bool targetInferenceSuccessful; - - // Sometimes we want to know what thread we are executing on - int threadId; - - // Managed threadId where the execution method was run - public int ThreadId - { - get { return threadId; } - } - - public delegate void ExecuteTaskDelegate(object parameter); - private object executionTaskDelegateParameter; - - public object ExecutionTaskDelegateParameter - { - get { return executionTaskDelegateParameter; } - set { executionTaskDelegateParameter = value; } - } - - private ExecuteTaskDelegate executeDelegate; - - public ExecuteTaskDelegate ExecuteDelegate - { - get { return executeDelegate; } - set { executeDelegate = value; } - } - - public bool TargetInferenceSuccessful - { - get { return targetInferenceSuccessful; } - set { targetInferenceSuccessful = value; } - } - - - internal TaskExecutionStateHelper - ( - TaskExecutionMode howToExecuteTask, - Lookup lookupForInference, - Lookup lookupForExecution, - XmlElement taskXmlNode, - ITaskHost hostObject, - string projectFileOfTaskNode, - string parentProjectFullFileName, - string executionDirectory, - int nodeProxyId - ) - : base(howToExecuteTask, - lookupForInference, - lookupForExecution, - taskXmlNode, - hostObject, - projectFileOfTaskNode, - parentProjectFullFileName, - executionDirectory, - nodeProxyId, - null - ) - { - // Dont need to do anything - } - - internal override void ExecuteTask() - { - threadId = Thread.CurrentThread.ManagedThreadId; - if (executeDelegate == null) - { - base.ExecuteTask(); - } - else - { - executeDelegate(executionTaskDelegateParameter); - } - } - - /// - /// Mock out and override the method inside of TaskExecutionState which makes the calls to the task engine. - /// - internal override bool TaskEngineExecuteTask(TaskEngine taskEngine, TaskExecutionMode howToExecuteTask, Lookup lookup) - { - return targetInferenceSuccessful; - } - } - #endregion - -} diff --git a/src/Deprecated/Engine.UnitTests/TaskItem_Tests.cs b/src/Deprecated/Engine.UnitTests/TaskItem_Tests.cs deleted file mode 100644 index 9121f2694fe..00000000000 --- a/src/Deprecated/Engine.UnitTests/TaskItem_Tests.cs +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Reflection; -using System.Collections; -using NUnit.Framework; -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine; -using System.Text.RegularExpressions; -using System.Xml; - - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class TaskItemTests - { - /* - * Method: SimpleCopyMetadataTo - * Owner: jomof - * - * Try the most basic CopyMetadataTo(...) - * - */ - [Test] - public void SimpleCopyMetadataTo() - { - TaskItem from = new TaskItem("myfile.txt"); - from.SetMetadata("Culture", "fr"); - - TaskItem to = new TaskItem("myfile.bin"); - from.CopyMetadataTo(to); - - Assertion.AssertEquals("fr", to.GetMetadata("Culture")); - } - - /* - * Method: CopyMetadataToDoesNotCopyExtension - * Owner: jomof - * - * Make sure that CopyMetadataTo(...) does not copy extension. - * - */ - [Test] - public void CopyMetadataToDoesNotCopyExtension() - { - TaskItem from = new TaskItem("myfile.txt"); - TaskItem to = new TaskItem("myfile.bin"); - - from.CopyMetadataTo(to); - - Assertion.AssertEquals(".bin", to.GetMetadata("Extension")); - } - - [Test] - public void CopyMetadataToWithDefaults() - { - BuildItem fromBuildItem = BuildItem_Tests.GetXmlBackedItemWithDefinitionLibrary(); // i1; has m=m1 (default) and n=n1 (regular) - TaskItem from = new TaskItem(fromBuildItem); - - TaskItem to = new TaskItem("i2"); - from.CopyMetadataTo(to); - - Assertion.AssertEquals("n1", to.GetMetadata("n")); - Assertion.AssertEquals("m1", to.GetMetadata("m")); - } - - /// - /// Verify items cannot be created with null itemspec - /// - /// danmose - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void CreateItemWithNullItemSpec() - { - string nullItem = null; - BuildItem item = new BuildItem("x", nullItem); - } - - /// - /// Verify items can be created with empty itemspec - /// (To be consistent with the shipped TaskItem class...) - /// - /// danmose - [Test] - public void CreateItemWithEmptyItemSpec() - { - BuildItem item = new BuildItem("x", ""); - Assertion.AssertEquals(String.Empty, item.EvaluatedItemSpec); - } - - /// - /// Verify metadata cannot be created with null name - /// - /// danmose - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void CreateNullNamedMetadata() - { - TaskItem item = new TaskItem("foo"); - item.SetMetadata(null, "x"); - } - - /// - /// Verify metadata cannot be created with empty name - /// - /// danmose - [Test] - [ExpectedException(typeof(ArgumentException))] - public void CreateEmptyNamedMetadata() - { - TaskItem item = new TaskItem("foo"); - item.SetMetadata("", "x"); - } - - } -} diff --git a/src/Deprecated/Engine.UnitTests/TaskRegistry_Tests.cs b/src/Deprecated/Engine.UnitTests/TaskRegistry_Tests.cs deleted file mode 100644 index e5fb70692da..00000000000 --- a/src/Deprecated/Engine.UnitTests/TaskRegistry_Tests.cs +++ /dev/null @@ -1,374 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Xml; - -using Microsoft.Build.BuildEngine; -using Microsoft.Build.BuildEngine.Shared; - -using NUnit.Framework; - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class TaskRegistry_Tests - { - [Test] - public void RegisterTaskSimple() - { - UsingTaskInfo[] taskInfos = { new UsingTaskInfo("CustomTask", "CustomTask, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", null) }; - - TaskRegistry registryStub = TaskRegistryHelperMethods.CreateTaskRegistryAndRegisterTasks(taskInfos); - - int registeredTaskCount = TaskRegistryHelperMethods.GetDeepCountOfRegisteredTasks(registryStub.AllTaskDeclarations); - Assert.AreEqual(1, registeredTaskCount, "Expected only one registered task in TaskRegistry.AllTaskDeclarations!"); - - ArrayList taskAssemblyLoadInfoList = (ArrayList)registryStub.AllTaskDeclarations[taskInfos[0].TaskName]; - Assert.IsNotNull(taskAssemblyLoadInfoList, "Task AssemblyLoadInfo not found in TaskRegistry.AllTaskDeclarations!"); - Assert.AreEqual(1, taskAssemblyLoadInfoList.Count, "Expected only one AssemblyLoadInfo registered!"); - - AssemblyLoadInfo taskAssemblyLoadInfo = (AssemblyLoadInfo)taskAssemblyLoadInfoList[0]; - Assert.AreEqual(taskAssemblyLoadInfo, taskInfos[0].AssemblyInfo, "Task AssemblyLoadInfo was not properly registered by TaskRegistry.RegisterTask!"); - } - - [Test] - public void RegisterMultipleTasksWithDifferentNames() - { - UsingTaskInfo[] taskInfos = { new UsingTaskInfo("CustomTask", "CustomTask, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", null), - new UsingTaskInfo("YetAnotherCustomTask", null, "bin\\Assemblies\\YetAnotherCustomTask.dll"), - new UsingTaskInfo("AnotherCustomTask", "AnotherCustomTask, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null", null) }; - - TaskRegistry registryStub = TaskRegistryHelperMethods.CreateTaskRegistryAndRegisterTasks(taskInfos); - - int registeredTaskCount = TaskRegistryHelperMethods.GetDeepCountOfRegisteredTasks(registryStub.AllTaskDeclarations); - Assert.AreEqual(3, registeredTaskCount, "Expected three registered tasks in TaskRegistry.AllTaskDeclarations!"); - - foreach (UsingTaskInfo taskInfo in taskInfos) - { - ArrayList taskAssemblyLoadInfoList = (ArrayList)registryStub.AllTaskDeclarations[taskInfo.TaskName]; - Assert.IsNotNull(taskAssemblyLoadInfoList, "Task AssemblyLoadInfo not found in TaskRegistry.AllTaskDeclarations!"); - Assert.AreEqual(1, taskAssemblyLoadInfoList.Count, "Expected only one AssemblyLoadInfo registered under this TaskName!"); - - AssemblyLoadInfo taskAssemblyLoadInfo = (AssemblyLoadInfo)taskAssemblyLoadInfoList[0]; - Assert.AreEqual(taskAssemblyLoadInfo, taskInfo.AssemblyInfo, "Task AssemblyLoadInfo was not properly registered by TaskRegistry.RegisterTask!"); - } - } - - [Test] - public void RegisterMultipleTasksSomeWithSameName() - { - UsingTaskInfo[] taskInfos = { new UsingTaskInfo("CustomTask", "CustomTask, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", null), - new UsingTaskInfo("YetAnotherCustomTask", "YetAnotherCustomTask, Version=9.0.0.0, Culture=neutral, PublicKeyToken=null", null), - new UsingTaskInfo("CustomTask", "CustomTask, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null", null) }; - - TaskRegistry registryStub = TaskRegistryHelperMethods.CreateTaskRegistryAndRegisterTasks(taskInfos); - - //First assert that there are two unique buckets - Assert.AreEqual(2, registryStub.AllTaskDeclarations.Count, "Expected only two buckets since two of three tasks have the same name!"); - - //Now let's look at the bucket with only one task - ArrayList singletonBucket = (ArrayList)registryStub.AllTaskDeclarations[taskInfos[1].TaskName]; - Assert.IsNotNull(singletonBucket, "Task AssemblyLoadInfo not found in TaskRegistry.AllTaskDeclarations!"); - Assert.AreEqual(1, singletonBucket.Count, "Expected only one AssemblyLoadInfo registered under this TaskName!"); - AssemblyLoadInfo singletonAssemblyLoadInfo = (AssemblyLoadInfo)singletonBucket[0]; - Assert.AreEqual(singletonAssemblyLoadInfo, taskInfos[1].AssemblyInfo, "Task AssemblyLoadInfo was not properly registered by TaskRegistry.RegisterTask!"); - - //Finally let's look at the bucket with two tasks - ArrayList duplicateBucket = (ArrayList)registryStub.AllTaskDeclarations[taskInfos[0].TaskName]; - Assert.IsNotNull(duplicateBucket, "Task AssemblyLoadInfo not found in TaskRegistry.AllTaskDeclarations!"); - Assert.AreEqual(2, duplicateBucket.Count, "Expected two AssemblyLoadInfos registered under this TaskName!"); - bool bothTaskVersionsFound = duplicateBucket.Contains(taskInfos[0].AssemblyInfo) && duplicateBucket.Contains(taskInfos[2].AssemblyInfo); - Assert.IsTrue(bothTaskVersionsFound, "Expected both versions of the task to be registered in this bucket!"); - } - - [Test] - public void RegisterMultipleTasksWithDifferentNamesFromSameAssembly() - { - UsingTaskInfo[] taskInfos = { new UsingTaskInfo("CustomTask", "CustomTasks, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", null), - new UsingTaskInfo("YetAnotherCustomTask", null, "bin\\Assemblies\\YetAnotherCustomTask.dll"), - new UsingTaskInfo("AnotherCustomTask", "CustomTasks, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", null) }; - - TaskRegistry registryStub = TaskRegistryHelperMethods.CreateTaskRegistryAndRegisterTasks(taskInfos); - - int registeredTaskCount = TaskRegistryHelperMethods.GetDeepCountOfRegisteredTasks(registryStub.AllTaskDeclarations); - Assert.AreEqual(3, registeredTaskCount, "Expected three registered tasks in TaskRegistry.AllTaskDeclarations!"); - - foreach (UsingTaskInfo taskInfo in taskInfos) - { - ArrayList taskAssemblyLoadInfoList = (ArrayList)registryStub.AllTaskDeclarations[taskInfo.TaskName]; - Assert.IsNotNull(taskAssemblyLoadInfoList, "Task AssemblyLoadInfo not found in TaskRegistry.AllTaskDeclarations!"); - Assert.AreEqual(1, taskAssemblyLoadInfoList.Count, "Expected only one AssemblyLoadInfo registered under this TaskName!"); - - AssemblyLoadInfo taskAssemblyLoadInfo = (AssemblyLoadInfo)taskAssemblyLoadInfoList[0]; - Assert.AreEqual(taskAssemblyLoadInfo, taskInfo.AssemblyInfo, "Task AssemblyLoadInfo was not properly registered by TaskRegistry.RegisterTask!"); - } - } - - [Test] - public void RegisterMultipleTasksWithSameNameAndSameAssembly() - { - UsingTaskInfo[] taskInfos = { new UsingTaskInfo("CustomTask", null, "Some\\Relative\\Path\\CustomTasks.dll"), - new UsingTaskInfo("YetAnotherCustomTask", "YetAnotherCustomTask, Version=9.0.0.0, Culture=neutral, PublicKeyToken=null", null), - new UsingTaskInfo("CustomTask", null, "Some\\Relative\\Path\\CustomTasks.dll") }; - - TaskRegistry registryStub = TaskRegistryHelperMethods.CreateTaskRegistryAndRegisterTasks(taskInfos); - - //two unique buckets - Assert.AreEqual(2, registryStub.AllTaskDeclarations.Count, "Expected only two buckets since two of three tasks have the same name!"); - //three total tasks - Assert.AreEqual(3, TaskRegistryHelperMethods.GetDeepCountOfRegisteredTasks(registryStub.AllTaskDeclarations), "Expected three total tasks registered in TaskRegistry!"); - } - - [Test] - public void AllUsingTaskAttributesAreExpanded() - { - UsingTaskInfo[] taskInfos = { new UsingTaskInfo("$(Property1)@(ThirdItem)$(Property2)", null, "Some\\$(Property3)\\Path\\CustomTasks.dll"), - new UsingTaskInfo("YetAnotherCustomTask", "$(Property4)@(ThirdItem), Version=9.0.0.0, Culture=neutral, PublicKeyToken=null", null), - new UsingTaskInfo("Custom$(Property5)Task", null, "Some\\Relative\\Path\\CustomTasks.dll", "'@(ThirdItem)$(Property1)' == 'ThirdValue1Value1'") }; - - TaskRegistry registryStub = TaskRegistryHelperMethods.CreateTaskRegistryAndRegisterTasks(taskInfos); - - int registeredTaskCount = TaskRegistryHelperMethods.GetDeepCountOfRegisteredTasks(registryStub.AllTaskDeclarations); - Assert.AreEqual(3, registeredTaskCount, "Expected three registered tasks in TaskRegistry.AllTaskDeclarations!"); - - foreach (UsingTaskInfo taskInfo in taskInfos) - { - UsingTaskInfo expandedTaskInfo = taskInfo.CopyAndExpand(TaskRegistryHelperMethods.RegistryExpander); - ArrayList taskAssemblyLoadInfoList = (ArrayList)registryStub.AllTaskDeclarations[expandedTaskInfo.TaskName]; - Assert.IsNotNull(taskAssemblyLoadInfoList, "Task AssemblyLoadInfo not found in TaskRegistry.AllTaskDeclarations!"); - Assert.AreEqual(1, taskAssemblyLoadInfoList.Count, "Expected only one AssemblyLoadInfo registered under this TaskName!"); - - AssemblyLoadInfo taskAssemblyLoadInfo = (AssemblyLoadInfo)taskAssemblyLoadInfoList[0]; - Assert.AreEqual(taskAssemblyLoadInfo, expandedTaskInfo.AssemblyInfo, "Task AssemblyLoadInfo was not properly registered by TaskRegistry.RegisterTask!"); - } - } - - [Test] - public void TaskRegisteredOnlyIfConditionIsTrue() - { - UsingTaskInfo[] taskInfos = { new UsingTaskInfo("$(Property1)@(ThirdItem)$(Property2)", null, "Some\\$(Property3)\\Path\\CustomTasks.dll", "'true' != 'false'"), - new UsingTaskInfo("YetAnotherCustomTask", "$(Property4)@(ThirdItem), Version=9.0.0.0, Culture=neutral, PublicKeyToken=null", null, "false"), - new UsingTaskInfo("Custom$(Property5)Task", null, "Some\\Relative\\Path\\CustomTasks.dll", "'@(ThirdItem)$(Property1)' == 'ThirdValue1Value1'"), - new UsingTaskInfo("MyTask", null, "TasksAssembly.dll", "'@(ThirdItem)$(Property1)' == 'ThirdValue1'") }; - - TaskRegistry registryStub = TaskRegistryHelperMethods.CreateTaskRegistryAndRegisterTasks(taskInfos); - - int registeredTaskCount = TaskRegistryHelperMethods.GetDeepCountOfRegisteredTasks(registryStub.AllTaskDeclarations); - Assert.AreEqual(2, registeredTaskCount, "Expected two registered tasks in TaskRegistry.AllTaskDeclarations!"); - - for (int i = 0; i <= 2; i += 2) - { - UsingTaskInfo expandedTaskInfo = taskInfos[i].CopyAndExpand(TaskRegistryHelperMethods.RegistryExpander); - ArrayList taskAssemblyLoadInfoList = (ArrayList)registryStub.AllTaskDeclarations[expandedTaskInfo.TaskName]; - Assert.IsNotNull(taskAssemblyLoadInfoList, "Task AssemblyLoadInfo not found in TaskRegistry.AllTaskDeclarations!"); - Assert.AreEqual(1, taskAssemblyLoadInfoList.Count, "Expected only one AssemblyLoadInfo registered under this TaskName!"); - - AssemblyLoadInfo taskAssemblyLoadInfo = (AssemblyLoadInfo)taskAssemblyLoadInfoList[0]; - Assert.AreEqual(taskAssemblyLoadInfo, expandedTaskInfo.AssemblyInfo, "Task AssemblyLoadInfo was not properly registered by TaskRegistry.RegisterTask!"); - } - } - - [Test] - public void TasksNoLongerRegisteredAfterClearCalled() - { - UsingTaskInfo[] taskInfos = { new UsingTaskInfo("CustomTask", "CustomTask, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", null), - new UsingTaskInfo("YetAnotherCustomTask", "YetAnotherCustomTask, Version=9.0.0.0, Culture=neutral, PublicKeyToken=null", null), - new UsingTaskInfo("MyCustomTask", "CustomTask, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null", null) }; - - TaskRegistry registryStub = TaskRegistryHelperMethods.CreateTaskRegistryAndRegisterTasks(taskInfos); - - int registeredTaskCount = TaskRegistryHelperMethods.GetDeepCountOfRegisteredTasks(registryStub.AllTaskDeclarations); - Assert.AreEqual(3, registeredTaskCount, "Expected three registered tasks in TaskRegistry.AllTaskDeclarations!"); - - registryStub.Clear(); - - registeredTaskCount = TaskRegistryHelperMethods.GetDeepCountOfRegisteredTasks(registryStub.AllTaskDeclarations); - Assert.AreEqual(0, registeredTaskCount, "Expected no registered tasks in TaskRegistry.AllTaskDeclarations!"); - } - } - - internal class UsingTaskInfo - { - public string TaskName; - public AssemblyLoadInfo AssemblyInfo; - public string Condition; - - private UsingTask usingTask; - public UsingTask UsingTask - { - get - { - if (null == usingTask) - { - usingTask = ConstructUsingTask(); - } - return usingTask; - } - } - - private XmlElement usingTaskElement; - public XmlNode UsingTaskElement - { - get - { - if (null == usingTask) - { - usingTask = ConstructUsingTask(); - } - return usingTaskElement; - } - } - - public UsingTaskInfo(string taskName, string assemblyName, string assemblyFile) - { - TaskName = taskName; - AssemblyInfo = new AssemblyLoadInfo(assemblyName, assemblyFile); - } - - public UsingTaskInfo(string taskName, string assemblyName, string assemblyFile, string condition) - : this(taskName, assemblyName, assemblyFile) - { - Condition = condition; - } - - public UsingTaskInfo CopyAndExpand(Expander expander) - { - string newTaskName = expander.ExpandAllIntoString(UsingTask.TaskName, UsingTask.TaskNameAttribute); - string newCondition = null; - string newAssemblyName = null; - string newAssemblyFile = null; - - if (UsingTask.Condition != null) - { - newCondition = expander.ExpandAllIntoString(UsingTask.Condition, UsingTask.ConditionAttribute); - } - if (UsingTask.AssemblyName != null) - { - newAssemblyName = expander.ExpandAllIntoString(UsingTask.AssemblyName, UsingTask.AssemblyNameAttribute); - } - if (UsingTask.AssemblyFile != null) - { - newAssemblyFile = expander.ExpandAllIntoString(UsingTask.AssemblyFile, UsingTask.AssemblyFileAttribute); - } - - return new UsingTaskInfo(newTaskName, newAssemblyName, newAssemblyFile, newCondition); - } - - private UsingTask ConstructUsingTask() - { - usingTaskElement = new XmlDocument().CreateElement("UsingTask"); - usingTaskElement.SetAttribute("TaskName", TaskName); - - if (AssemblyInfo.AssemblyName != null) - { - usingTaskElement.SetAttribute("AssemblyName", AssemblyInfo.AssemblyName); - } - else - { - usingTaskElement.SetAttribute("AssemblyFile", AssemblyInfo.AssemblyFile); - } - - if (Condition != null) - { - usingTaskElement.SetAttribute("Condition", Condition); - } - - return new UsingTask(usingTaskElement, false); - } - } - - internal class TaskRegistryHelperMethods - { - private static Expander registryExpander; - - internal static Expander RegistryExpander - { - get - { - if (registryExpander == null) - { - registryExpander = GetExpander(); - } - return registryExpander; - } - } - - private static EngineLoggingServices engineLoggingServices; - - internal static EngineLoggingServices LoggingServices - { - get - { - if (null == engineLoggingServices) - { - engineLoggingServices = new EngineLoggingServicesHelper(); - } - return engineLoggingServices; - } - } - - internal static int GetDeepCountOfRegisteredTasks(Hashtable table) - { - if (table == null) - { - return 0; - } - - int count = 0; - foreach (ArrayList bucket in table.Values) - { - count += bucket.Count; - } - return count; - } - - internal static TaskRegistry CreateTaskRegistryAndRegisterTasks(UsingTaskInfo[] taskInfos) - { - TaskRegistry registry = new TaskRegistry(); - - foreach (UsingTaskInfo taskInfo in taskInfos) - { - registry.RegisterTask(taskInfo.UsingTask, RegistryExpander, LoggingServices, null); - } - - return registry; - } - - internal static Expander GetExpander() - { - BuildPropertyGroup propertyGroup = new BuildPropertyGroup(); - propertyGroup.SetProperty("Property1", "Value1"); - propertyGroup.SetProperty("Property2", "Value2"); - propertyGroup.SetProperty("Property3", "Value3"); - propertyGroup.SetProperty("Property4", "Value4"); - propertyGroup.SetProperty("Property5", "Value5"); - - BuildItemGroup itemGroup1 = new BuildItemGroup(); - itemGroup1.AddNewItem("FirstItem", "FirstValue1"); - itemGroup1.AddNewItem("FirstItem", "FirstValue2"); - itemGroup1.AddNewItem("FirstItem", "FirstValue3"); - - BuildItemGroup itemGroup2 = new BuildItemGroup(); - itemGroup2.AddNewItem("SecondItem", "SecondValue1"); - itemGroup2.AddNewItem("SecondItem", "SecondValue2"); - itemGroup2.AddNewItem("SecondItem", "SecondValue3"); - - BuildItemGroup itemGroup3 = new BuildItemGroup(); - itemGroup3.AddNewItem("ThirdItem", "ThirdValue1"); - - Hashtable itemsByName = new Hashtable(StringComparer.OrdinalIgnoreCase); - itemsByName["FirstItem"] = itemGroup1; - itemsByName["SecondItem"] = itemGroup2; - itemsByName["ThirdItem"] = itemGroup3; - - return new Expander(new ReadOnlyLookup(itemsByName, propertyGroup)); - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/TaskWorkerThread_Tests.cs b/src/Deprecated/Engine.UnitTests/TaskWorkerThread_Tests.cs deleted file mode 100644 index 40e460cb8a1..00000000000 --- a/src/Deprecated/Engine.UnitTests/TaskWorkerThread_Tests.cs +++ /dev/null @@ -1,215 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Xml; -using System.Collections; -using System.Text.RegularExpressions; -using System.Collections.Generic; -using System.Threading; - -using NUnit.Framework; - -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine; -using Microsoft.Build.BuildEngine.Shared; -using System.IO; - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class TaskWorkerThread_Tests - { - private Engine engine; - - private List InitializeTaskState() - { - BuildPropertyGroup projectLevelProprtiesForInference; - BuildPropertyGroup projectLevelPropertiesForExecution; - Hashtable[] inferenceBucketItemsByName; - Hashtable[] inferenceBucketMetaData; - Hashtable projectLevelItemsForInference; - Hashtable[] executionBucketItemsByName; - Hashtable[] executionBucketMetaData; - Hashtable projectLevelItemsForExecution; - ITaskHost hostObject; - EngineLoggingServicesHelper loggingHelper; - string projectFileOfTaskNode; - string parentProjectFullFileName; - int nodeProxyId; - int projectId; - string executionDirectory; - - XmlElement taskNode = new XmlDocument().CreateElement("MockTask"); - LoadedType taskClass = new LoadedType(typeof(MockTask), new AssemblyLoadInfo(typeof(MockTask).Assembly.FullName, null)); - loggingHelper = new EngineLoggingServicesHelper(); - engine.LoggingServices = loggingHelper; - Project project = new Project(engine); - - nodeProxyId = engine.EngineCallback.CreateTaskContext(project, null, null, taskNode, EngineCallback.inProcNode, new BuildEventContext(BuildEventContext.InvalidNodeId, BuildEventContext.InvalidTargetId, BuildEventContext.InvalidProjectContextId, BuildEventContext.InvalidTaskId)); - // Set up some "fake data" which will be passed to the Task Execution State object - Hashtable[] fakeArray = new Hashtable[1]; - fakeArray[0] = new Hashtable(); - projectLevelProprtiesForInference = new BuildPropertyGroup(); - projectLevelPropertiesForExecution = new BuildPropertyGroup(); - inferenceBucketItemsByName = fakeArray; - inferenceBucketMetaData = fakeArray; - projectLevelItemsForInference = new Hashtable(); - executionBucketItemsByName = fakeArray; - executionBucketMetaData = fakeArray; - projectLevelItemsForExecution = new Hashtable(); - hostObject = null; - projectFileOfTaskNode = "In Memory"; - parentProjectFullFileName = project.FullFileName; - - executionDirectory = Directory.GetCurrentDirectory(); - projectId = project.Id; - - - MockTaskExecutionModule taskExecutionModule = taskExecutionModule = new MockTaskExecutionModule(new EngineCallback(engine)); - TaskExecutionMode howToExecuteTask = TaskExecutionMode.InferOutputsOnly; - - List executionStates = new List(); - - TaskExecutionStateHelper executionStateNormal1 = new TaskExecutionStateHelper( - howToExecuteTask, - LookupHelpers.CreateLookup(projectLevelProprtiesForInference, projectLevelItemsForInference), - LookupHelpers.CreateLookup(projectLevelPropertiesForExecution, projectLevelItemsForExecution), - taskNode, - hostObject, - projectFileOfTaskNode, - parentProjectFullFileName, - executionDirectory, - nodeProxyId); - executionStateNormal1.LoggingService = loggingHelper; - executionStateNormal1.TargetInferenceSuccessful = true; - executionStateNormal1.ParentModule = taskExecutionModule; - - executionStates.Add(executionStateNormal1); - - - TaskExecutionStateHelper executionStateCallBack = new TaskExecutionStateHelper( - howToExecuteTask, - LookupHelpers.CreateLookup(projectLevelProprtiesForInference, projectLevelItemsForInference), - LookupHelpers.CreateLookup(projectLevelPropertiesForExecution, projectLevelItemsForExecution), - taskNode, - hostObject, - projectFileOfTaskNode, - parentProjectFullFileName, - executionDirectory, - nodeProxyId); - executionStateCallBack.LoggingService = loggingHelper; - executionStateCallBack.TargetInferenceSuccessful = true; - - executionStates.Add(executionStateCallBack); - - - TaskExecutionStateHelper executionStateNormal2 = new TaskExecutionStateHelper( - howToExecuteTask, - LookupHelpers.CreateLookup(projectLevelProprtiesForInference, projectLevelItemsForInference), - LookupHelpers.CreateLookup(projectLevelPropertiesForExecution, projectLevelItemsForExecution), - taskNode, - hostObject, - projectFileOfTaskNode, - parentProjectFullFileName, - executionDirectory, - nodeProxyId); - executionStateNormal2.LoggingService = loggingHelper; - executionStateNormal2.TargetInferenceSuccessful = true; - executionStateNormal2.ParentModule = taskExecutionModule; - executionStates.Add(executionStateNormal2); - - TaskExecutionStateHelper executionStateNormal3 = new TaskExecutionStateHelper( - howToExecuteTask, - LookupHelpers.CreateLookup(projectLevelProprtiesForInference, projectLevelItemsForInference), - LookupHelpers.CreateLookup(projectLevelPropertiesForExecution, projectLevelItemsForExecution), - taskNode, - hostObject, - projectFileOfTaskNode, - parentProjectFullFileName, - executionDirectory, - nodeProxyId); - executionStateNormal3.LoggingService = loggingHelper; - executionStateNormal3.TargetInferenceSuccessful = true; - executionStateNormal3.ParentModule = taskExecutionModule; - executionStates.Add(executionStateNormal3); - - return executionStates; - } - - - /// - /// Right now we are just testing the fact that the TaskWorker thread will take in a couple of tasks, some doing blocking - /// callbacks and make sure that each of the tasks completed correctly. Since the tasks are the ones which will - /// in the end set the exit event, if the test does not complete then the test has failed. - /// - [Test] - public void TaskWorkerThreadTest() - { - // This event will be triggered right before a "engine" call back is made. - // Once this event is fired we insert another item into the queue - ManualResetEvent rightBeforeCallbackBlock = new ManualResetEvent(false); - - engine = new Engine(@"c:\"); - TaskExecutionModule TEM = new TaskExecutionModule(new EngineCallback(engine), TaskExecutionModule.TaskExecutionModuleMode.MultiProcFullNodeMode, false); - - // Create a worker thread and make it the active node thread - TaskWorkerThread workerThread = TEM.GetWorkerThread(); - - // Get some tasks which we can then provide execution methods to - List tasks = InitializeTaskState(); - - tasks[1].ExecutionTaskDelegateParameter = rightBeforeCallbackBlock; - tasks[1].ExecuteDelegate = delegate(object parameter) - { - ((ManualResetEvent)parameter).Set(); - - workerThread.WaitForResults(tasks[1].HandleId, new BuildResult[] { new BuildResult(null, new Hashtable(StringComparer.OrdinalIgnoreCase), true, tasks[1].HandleId, 0, 2, false, string.Empty, string.Empty, 0, 0, 0) }, new BuildRequest[1]); - }; - - // Task 0 will cause a baseActiveThread to start up and run - workerThread.PostWorkItem(tasks[0]); - - // Since this will do a callback and will generate a waitingActiveThread - workerThread.PostWorkItem(tasks[1]); - - workerThread.ActivateThread(); - - // Wait for the call back to happen - rightBeforeCallbackBlock.WaitOne(); - - // Lets insert a execution task which and post a work item which will cause a localDoneEvent to be set - tasks[2].ExecutionTaskDelegateParameter = null; - tasks[2].ExecuteDelegate = null; - // TaskWorkerThread.PostBuildResult(new BuildResult(null, true, tasks[2].NodeProxyId, 0)); - workerThread.PostWorkItem(tasks[2]); - - //Post a build Result while one of the threads is waiting active, this should cause us to reuse the first thread - workerThread.PostBuildResult(new BuildResult(null, new Hashtable(StringComparer.OrdinalIgnoreCase), true, tasks[2].HandleId, 0, 2, false, string.Empty, string.Empty, 0, 0, 0)); - - tasks[3].ExecutionTaskDelegateParameter = null; - tasks[3].ExecuteDelegate = null; - - workerThread.PostWorkItem(tasks[3]); - TEM.Shutdown(); - - // Count up the number of threads used during the execution of the tasks - List threadsUsedForExecution = new List(); - foreach (TaskExecutionStateHelper state in tasks) - { - // If the list does not contain the threadId add it to the list - if (!threadsUsedForExecution.Contains(state.ThreadId)) - { - threadsUsedForExecution.Add(state.ThreadId); - } - } - // Make sure we use less threads then the number of sumbitted tasks which would indicate that threads are reused - Assert.IsTrue(threadsUsedForExecution.Count < tasks.Count, "Expected for the number of unique threads to be less than the number of tasks as threads should have been reused"); - } - - } -} diff --git a/src/Deprecated/Engine.UnitTests/ToolsVersion_Tests.cs b/src/Deprecated/Engine.UnitTests/ToolsVersion_Tests.cs deleted file mode 100644 index 3c6dad2f290..00000000000 --- a/src/Deprecated/Engine.UnitTests/ToolsVersion_Tests.cs +++ /dev/null @@ -1,186 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections; -using System.Collections.Generic; -using System.IO; -using System.Text.RegularExpressions; -using System.Xml; - -using NUnit.Framework; -using Microsoft.Build.BuildEngine; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class ToolsetState_Tests - { - [Test] - public void DefaultTasksAreFoundInToolsPath() - { - //Note Engine's BinPath is distinct from the ToolsVersion's ToolsPath - Engine e = new Engine(); - ToolsetState t = new ToolsetState(e, new Toolset("toolsversionname", "c:\\directory1\\directory2"), new GetFiles(this.getFiles), new LoadXmlFromPath(this.loadXmlFromPath)); - - TaskRegistry taskRegistry = (TaskRegistry) t.GetTaskRegistry(null); - - string[] expectedRegisteredTasks = { "a1", "a2", "a3", "a4", "b1", "e1", "g1", "g2", "g3" }; - string[] unexpectedRegisteredTasks = { "c1", "d1", "f1", "11", "12", "13", "21" }; - - foreach (string expectedRegisteredTask in expectedRegisteredTasks) - { - Hashtable registeredTasks; - Assert.IsTrue(taskRegistry.FindRegisteredTasks(expectedRegisteredTask, true, out registeredTasks), - String.Format("Expected task '{0}' registered!", expectedRegisteredTask)); - } - foreach (string unexpectedRegisteredTask in unexpectedRegisteredTasks) - { - Hashtable registeredTasks; - Assert.IsFalse(taskRegistry.FindRegisteredTasks(unexpectedRegisteredTask, true, out registeredTasks), - String.Format("Unexpected task '{0}' registered!", unexpectedRegisteredTask)); - } - } - - [Test] - public void WarningLoggedIfNoDefaultTasksFound() - { - //Note Engine's BinPath is distinct from the ToolsVersion's ToolsPath - Engine e = new Engine(); - MockLogger mockLogger = new MockLogger(); - e.RegisterLogger(mockLogger); - - ToolsetState t = new ToolsetState(e, new Toolset("toolsversionname", "c:\\directory1\\directory2\\doesntexist"), new GetFiles(this.getFiles), new LoadXmlFromPath(this.loadXmlFromPath)); - - TaskRegistry taskRegistry = (TaskRegistry) t.GetTaskRegistry(null); - - string[] unexpectedRegisteredTasks = { "a1", "a2", "a3", "a4", "b1", "c1", "d1", "e1", "f1", "g1", "g2", "g3", "11", "12", "13", "21" }; - - Assert.AreEqual(1, mockLogger.WarningCount, "Expected 1 warning logged!"); - foreach (string unexpectedRegisteredTask in unexpectedRegisteredTasks) - { - Hashtable registeredTasks; - Assert.IsFalse(taskRegistry.FindRegisteredTasks(unexpectedRegisteredTask, true, out registeredTasks), - String.Format("Unexpected task '{0}' registered!", unexpectedRegisteredTask)); - } - } - - [Test] - public void InvalidToolPath() - { - //Note Engine's BinPath is distinct from the ToolsVersion's ToolsPath - Engine e = new Engine(); - MockLogger mockLogger = new MockLogger(); - e.RegisterLogger(mockLogger); - ToolsetState t = new ToolsetState(e, new Toolset("toolsversionname", "invalid||path"), new GetFiles(this.getFiles), new LoadXmlFromPath(this.loadXmlFromPath)); - - TaskRegistry taskRegistry = (TaskRegistry) t.GetTaskRegistry(null); - - Console.WriteLine(mockLogger.FullLog); - Assert.AreEqual(1, mockLogger.WarningCount, "Expected a warning for invalid character in toolpath"); - } - - public ToolsetState_Tests() - { - defaultTasksFileMap = new Dictionary(StringComparer.OrdinalIgnoreCase); - foreach (DefaultTasksFile defaultTasksFileCandidate in defaultTasksFileCandidates) - { - defaultTasksFileMap.Add(defaultTasksFileCandidate.Path, defaultTasksFileCandidate.XmlContents); - } - } - - private string[] getFiles(string path, string pattern) - { - // Cause an exception if the path is invalid - Path.GetFileName(path); - - string pathWithoutTrailingSlash = path.EndsWith("\\") ? path.Substring(0, path.Length - 1) : path; - //NOTE: the Replace calls below are a very minimal attempt to convert a basic, cmd.exe-style wildcard - //into something Regex.IsMatch will know how to use. - string finalPattern = "^" + pattern.Replace(".", "\\.").Replace("*", "[\\w\\W]*") + "$"; - - List matches = new List(defaultTasksFileMap.Keys); - matches.RemoveAll( - delegate(string candidate) - { - bool sameFolder = (0 == String.Compare(Path.GetDirectoryName(candidate), - pathWithoutTrailingSlash, - StringComparison.OrdinalIgnoreCase)); - return !sameFolder || !Regex.IsMatch(Path.GetFileName(candidate), finalPattern); - }); - return matches.ToArray(); - } - - private XmlDocument loadXmlFromPath(string path) - { - string xmlContents = defaultTasksFileMap[path]; - XmlDocument xmlDocument = new XmlDocument(); - xmlDocument.LoadXml(xmlContents); - return xmlDocument; - } - - private readonly Dictionary defaultTasksFileMap; - - private DefaultTasksFile[] defaultTasksFileCandidates = - { new DefaultTasksFile( - "c:\\directory1\\directory2\\a.tasks", - @" - - - - - "), - new DefaultTasksFile("c:\\directory1\\directory2\\b.tasks", - @" - - "), - new DefaultTasksFile("c:\\directory1\\directory2\\c.tasksfile", - @" - - "), - new DefaultTasksFile("c:\\directory1\\directory2\\directory3\\d.tasks", - @" - - "), - new DefaultTasksFile("c:\\directory1\\directory2\\e.tasks", - @" - - "), - new DefaultTasksFile("d:\\directory1\\directory2\\f.tasks", - @" - - "), - new DefaultTasksFile("c:\\directory1\\directory2\\g.custom.tasks", - @" - - - - "), - new DefaultTasksFile("c:\\somepath\\1.tasks", - @" - - - - "), - new DefaultTasksFile("c:\\somepath\\2.tasks", - @" - - ") }; - - public struct DefaultTasksFile - { - public string Path; - public string XmlContents; - public DefaultTasksFile(string path, string xmlContents) - { - this.Path = path; - this.XmlContents = xmlContents; - } - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/ToolsetConfigurationReaderTestHelper.cs b/src/Deprecated/Engine.UnitTests/ToolsetConfigurationReaderTestHelper.cs deleted file mode 100644 index a1169ea0989..00000000000 --- a/src/Deprecated/Engine.UnitTests/ToolsetConfigurationReaderTestHelper.cs +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.IO; -using System.Text; -using System.Collections.Generic; -using System.Configuration; -using Microsoft.Win32; -using NUnit.Framework; -using Microsoft.Build.BuildEngine; -using System.Threading; - -namespace Microsoft.Build.UnitTests -{ - /// - /// Helper class to simulate application configuration read - /// - internal class ToolsetConfigurationReaderTestHelper - { - private static ExeConfigurationFileMap configFile; - private static string testFolderFullPath = null; - private static Exception exceptionToThrow = null; - - internal static string WriteConfigFile(string content) - { - return WriteConfigFile(content, null); - } - - internal static string WriteConfigFile(string content, Exception exception) - { - exceptionToThrow = exception; - testFolderFullPath = Path.Combine(Path.GetTempPath(), "configFileTests"); - Directory.CreateDirectory(testFolderFullPath); - string configFilePath = Path.Combine(testFolderFullPath, "test.exe.config"); - - if (File.Exists(configFilePath)) - { - File.Delete(configFilePath); - } - - File.WriteAllText(configFilePath, content); - configFile = new ExeConfigurationFileMap(); - configFile.ExeConfigFilename = configFilePath; - return configFilePath; - } - - internal static void CleanUp() - { - try - { - if (testFolderFullPath != null && Directory.Exists(testFolderFullPath)) - { - for (int i = 0; i < 5; i++) - { - try - { - Directory.Delete(testFolderFullPath, true /* recursive */); - break; - } - catch (Exception) - { - Thread.Sleep(1000); - // Eat exceptions from the delete - } - } - } - } - finally - { - exceptionToThrow = null; - } - } - - /// - /// Creates a config file and loads a Configuration from it - /// - /// configuration object - internal static Configuration ReadApplicationConfigurationTest() - { - if (exceptionToThrow != null) - { - throw exceptionToThrow; - } - - return ConfigurationManager.OpenMappedExeConfiguration(configFile, ConfigurationUserLevel.None); - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/ToolsetConfigurationReader_Tests.cs b/src/Deprecated/Engine.UnitTests/ToolsetConfigurationReader_Tests.cs deleted file mode 100644 index 13390e24c6c..00000000000 --- a/src/Deprecated/Engine.UnitTests/ToolsetConfigurationReader_Tests.cs +++ /dev/null @@ -1,434 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.IO; -using System.Text; -using System.Collections.Generic; -using System.Configuration; -using Microsoft.Win32; -using NUnit.Framework; -using Microsoft.Build.BuildEngine; - -namespace Microsoft.Build.UnitTests -{ - /// - /// Unit tests for ToolsetConfigurationReader class - /// - [TestFixture] - public class ToolsetConfigurationReaderTests - { - private static string msbuildToolsets = "msbuildToolsets"; - - [SetUp] - public void Setup() - { - } - - [TearDown] - public void Teardown() - { - ToolsetConfigurationReaderTestHelper.CleanUp(); - } - - #region "msbuildToolsets element tests" - - /// - /// msbuildToolsets element is empty - /// - [Test] - public void MSBuildToolsetsTest_EmptyElement() - { - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@" - - -
- - - "); - - Configuration config = ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest(); - ToolsetConfigurationSection msbuildToolsetSection = config.GetSection(msbuildToolsets) as ToolsetConfigurationSection; - - Assertion.AssertNotNull(msbuildToolsetSection); - Assertion.AssertEquals(null, msbuildToolsetSection.Default); - Assertion.AssertNotNull(msbuildToolsetSection.Toolsets); - Assertion.AssertEquals(0, msbuildToolsetSection.Toolsets.Count); - } - - /// - /// tests if ToolsetConfigurationReaderTests is successfully initialized from the config file - /// - [Test] - public void MSBuildToolsetsTest_Basic() - { - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@" - - -
- - - - - - - "); - - Configuration config = ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest(); - ToolsetConfigurationSection msbuildToolsetSection = config.GetSection(msbuildToolsets) as ToolsetConfigurationSection; - - Assertion.AssertEquals(msbuildToolsetSection.Default, "2.0"); - Assertion.AssertEquals(1, msbuildToolsetSection.Toolsets.Count); - - Assertion.AssertEquals(msbuildToolsetSection.Toolsets.GetElement(0).toolsVersion, "2.0"); - Assertion.AssertEquals(msbuildToolsetSection.Toolsets.GetElement("2.0").PropertyElements.Count, 1); - Assertion.AssertEquals(msbuildToolsetSection.Toolsets.GetElement("2.0").PropertyElements.GetElement("MSBuildBinPath").Value, - @"D:\windows\Microsoft.NET\Framework\v2.0.x86ret\"); - } - - - /// - /// tests if ToolsetConfigurationReaderTests is successfully initialized from the config file - /// - [Test] - public void MSBuildToolsetsTest_BasicWithOtherConfigEntries() - { - // NOTE: for some reason, MUST be the first element under - // for the API to read it. The docs don't make this clear. - - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@" - - -
- - - - - - - - - - - - - - - - - - - "); - - Configuration config = ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest(); - ToolsetConfigurationSection msbuildToolsetSection = config.GetSection(msbuildToolsets) as ToolsetConfigurationSection; - - Assertion.AssertEquals(msbuildToolsetSection.Default, "2.0"); - Assertion.AssertEquals(1, msbuildToolsetSection.Toolsets.Count); - - Assertion.AssertEquals(msbuildToolsetSection.Toolsets.GetElement(0).toolsVersion, "2.0"); - Assertion.AssertEquals(msbuildToolsetSection.Toolsets.GetElement("2.0").PropertyElements.Count, 1); - Assertion.AssertEquals(msbuildToolsetSection.Toolsets.GetElement("2.0").PropertyElements.GetElement("MSBuildBinPath").Value, - @"D:\windows\Microsoft.NET\Framework\v2.0.x86ret\"); - } - #endregion - - #region "toolsVersion element tests" - - #region "Invalid cases (exception is expected to be thrown)" - - /// - /// name attribute is missing from toolset element - /// - [Test] - [ExpectedException(typeof(ConfigurationErrorsException))] - public void ToolsVersionTest_NameNotSpecified() - { - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@" - - -
- - - - - - - - - - "); - - Configuration config = ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest(); - - ToolsetConfigurationSection msbuildToolsetSection = config.GetSection(msbuildToolsets) as ToolsetConfigurationSection; - } - - /// - /// More than 1 toolset element with the same name - /// - [Test] - [ExpectedException(typeof(ConfigurationErrorsException))] - public void ToolsVersionTest_MultipleElementsWithSameName() - { - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@" - - -
- - - - - - - - - - "); - - Configuration config = ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest(); - - ToolsetConfigurationSection msbuildToolsetSection = config.GetSection(msbuildToolsets) as ToolsetConfigurationSection; - } - - /// - /// empty toolset element - /// - [Test] - [ExpectedException(typeof(ConfigurationErrorsException))] - public void ToolsVersionTest_EmptyElement() - { - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@" - - -
- - - - - - - - "); - - Configuration config = ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest(); - - ToolsetConfigurationSection msbuildToolsetSection = config.GetSection(msbuildToolsets) as ToolsetConfigurationSection; - } - - #endregion - - #region "Valid cases (No exception expected)" - - /// - /// only 1 toolset is specified - /// - [Test] - public void ToolsVersionTest_SingleElement() - { - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@" - - -
- - - - - - - "); - - Configuration config = ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest(); - - ToolsetConfigurationSection msbuildToolsetSection = config.GetSection(msbuildToolsets) as ToolsetConfigurationSection; - - Assertion.AssertEquals(msbuildToolsetSection.Default, "3.5"); - Assertion.AssertEquals(1, msbuildToolsetSection.Toolsets.Count); - Assertion.AssertEquals(msbuildToolsetSection.Toolsets.GetElement(0).toolsVersion, "3.5"); - Assertion.AssertEquals(msbuildToolsetSection.Toolsets.GetElement("3.5").PropertyElements.Count, 1); - Assertion.AssertEquals(msbuildToolsetSection.Toolsets.GetElement("3.5").PropertyElements.GetElement("MSBuildBinPath").Value, - @"D:\windows\Microsoft.NET\Framework\v3.5.x86ret\"); - } - - #endregion - #endregion - - #region "Property" - - #region "Invalid cases (exception is expected to be thrown)" - - /// - /// name attribute is missing - /// - [Test] - [ExpectedException(typeof(ConfigurationErrorsException))] - public void PropertyTest_NameNotSpecified() - { - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@" - - -
- - - - - - - "); - - Configuration config = ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest(); - - ToolsetConfigurationSection msbuildToolsetSection = config.GetSection(msbuildToolsets) as ToolsetConfigurationSection; - } - - /// - /// value attribute is missing - /// - [Test] - [ExpectedException(typeof(ConfigurationErrorsException))] - public void PropertyTest_ValueNotSpecified() - { - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@" - - -
- - - - - - - "); - - Configuration config = ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest(); - - ToolsetConfigurationSection msbuildToolsetSection = config.GetSection(msbuildToolsets) as ToolsetConfigurationSection; - } - - /// - /// more than 1 property element with the same name - /// - [Test] - [ExpectedException(typeof(ConfigurationErrorsException))] - public void PropertyTest_MultipleElementsWithSameName() - { - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@" - - -
- - - - - - - - "); - - Configuration config = ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest(); - - ToolsetConfigurationSection msbuildToolsetSection = config.GetSection(msbuildToolsets) as ToolsetConfigurationSection; - } - - /// - /// property element is an empty element - /// - [Test] - [ExpectedException(typeof(ConfigurationErrorsException))] - public void PropertyTest_EmptyElement() - { - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@" - - -
- - - - - - - - "); - - Configuration config = ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest(); - - ToolsetConfigurationSection msbuildToolsetSection = config.GetSection(msbuildToolsets) as ToolsetConfigurationSection; - } - #endregion - - #region "Valid cases" - - /// - /// more than 1 property element specified - /// - [Test] - public void PropertyTest_MultipleElement() - { - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@" - - -
- - - - - - - - "); - - Configuration config = ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest(); - - ToolsetConfigurationSection msbuildToolsetSection = config.GetSection(msbuildToolsets) as ToolsetConfigurationSection; - - Assertion.AssertEquals(msbuildToolsetSection.Default, "2.0"); - Assertion.AssertEquals(1, msbuildToolsetSection.Toolsets.Count); - Assertion.AssertEquals(2, msbuildToolsetSection.Toolsets.GetElement("2.0").PropertyElements.Count); - - Assertion.AssertEquals(msbuildToolsetSection.Toolsets.GetElement("2.0").PropertyElements.GetElement("MSBuildBinPath").Value, - @"D:\windows\Microsoft.NET\Framework\v2.0.x86ret\"); - Assertion.AssertEquals(msbuildToolsetSection.Toolsets.GetElement("2.0").PropertyElements.GetElement("SomeOtherPropertyName").Value, - @"SomeOtherPropertyValue"); - } - - /// - /// tests GetElement(string name) function in propertycollection class - /// - [Test] - public void PropertyTest_GetValueByName() - { - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@" - - -
- - - - - - - - "); - - Configuration config = ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest(); - - ToolsetConfigurationSection msbuildToolsetSection = config.GetSection(msbuildToolsets) as ToolsetConfigurationSection; - - // Verifications - Assertion.AssertEquals(msbuildToolsetSection.Default, "2.0"); - Assertion.AssertEquals(1, msbuildToolsetSection.Toolsets.Count); - Assertion.AssertEquals(2, msbuildToolsetSection.Toolsets.GetElement("2.0").PropertyElements.Count); - Assertion.AssertEquals(@"D:\windows\Microsoft.NET\Framework\v2.0.x86ret\", - msbuildToolsetSection.Toolsets.GetElement("2.0").PropertyElements.GetElement("MSBuildBinPath").Value); - Assertion.AssertEquals(@"SomeOtherPropertyValue", - msbuildToolsetSection.Toolsets.GetElement("2.0").PropertyElements.GetElement("SomeOtherPropertyName").Value); - } - - #endregion - #endregion - } -} diff --git a/src/Deprecated/Engine.UnitTests/ToolsetReader_Tests.cs b/src/Deprecated/Engine.UnitTests/ToolsetReader_Tests.cs deleted file mode 100644 index 2ace0785e85..00000000000 --- a/src/Deprecated/Engine.UnitTests/ToolsetReader_Tests.cs +++ /dev/null @@ -1,2259 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.IO; -using System.Collections.Generic; -using System.Configuration; -using Microsoft.Win32; -using System.Text; -using NUnit.Framework; -using Microsoft.Build.BuildEngine; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.UnitTests -{ - /// - /// Unit tests for ToolsetReader class and its derived classes - /// - [TestFixture] - public class ToolsetReaderTests - { - // The registry key that is passed as the baseKey parameter to the ToolsetRegistryReader class - private RegistryKey testRegistryKey = null; - // Subkey "4.0" - private RegistryKey currentVersionRegistryKey = null; - // Subkey "ToolsVersions" - private RegistryKey toolsVersionsRegistryKey = null; - - // Path to the registry key under HKCU - // Note that this is a test registry key created solely for unit testing. - private const string testRegistryPath = @"msbuildUnitTests"; - - /// - /// Reset the testRegistryKey - /// - [SetUp] - public void Setup() - { - TearDown(); - testRegistryKey = Registry.CurrentUser.CreateSubKey(testRegistryPath); - currentVersionRegistryKey = Registry.CurrentUser.CreateSubKey(testRegistryPath + "\\" + Constants.AssemblyVersion); - toolsVersionsRegistryKey = Registry.CurrentUser.CreateSubKey(testRegistryPath + "\\ToolsVersions"); - } - - [TearDown] - public void TearDown() - { - ToolsetConfigurationReaderTestHelper.CleanUp(); - - DeleteTestRegistryKey(); - } - - /// - /// Helper class to delete the testRegistryKey tree. - /// - private void DeleteTestRegistryKey() - { - if (Registry.CurrentUser.OpenSubKey(testRegistryPath) != null) - { - Registry.CurrentUser.DeleteSubKeyTree(testRegistryPath); - } - } - - /// - /// Test to make sure machine.config file has the section registered - /// and we are picking it up from there. - /// - [Test] - public void GetToolsetDataFromConfiguration_SectionNotRegisteredInConfigFile() - { - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@" - - - - - - - - - "); - - ToolsetReader reader = new ToolsetConfigurationReader(new ReadApplicationConfiguration( - ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest)); - - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - string defaultToolsVersion = reader.ReadToolsets(values, new BuildPropertyGroup(), new BuildPropertyGroup(), true); - - Assertion.AssertEquals(null, defaultToolsVersion); - Assertion.AssertEquals(0, values.Count); - } - - #region "Reading from application configuration file tests" - - /// - /// Tests that the data is correctly populated using function GetToolsetDataFromConfiguration - /// - [Test] - public void GetToolsetDataFromConfiguration_Basic() - { - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@" - - -
- - - - - - - - - - "); - - ToolsetReader reader = new ToolsetConfigurationReader(new ReadApplicationConfiguration( - ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest)); - - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - string defaultToolsVersion = reader.ReadToolsets(values, new BuildPropertyGroup(), new BuildPropertyGroup(), true); - - Assertion.AssertEquals("2.0", defaultToolsVersion); - Assertion.AssertEquals(2, values.Count); - Assertion.AssertEquals(0, values["2.0"].BuildProperties.Count); - Assertion.AssertEquals(@"D:\windows\Microsoft.NET\Framework\v2.0.x86ret", values["2.0"].ToolsPath); - Assertion.AssertEquals(0, values["3.5"].BuildProperties.Count); - Assertion.AssertEquals(@"D:\windows\Microsoft.NET\Framework\v3.5.x86ret", values["3.5"].ToolsPath); - } - - /// - /// Relative paths can be used in a config file value - /// - [Test] - public void RelativePathInValue() - { - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@" - - -
- - - - - - - - - - - - - "); - - ToolsetReader reader = new ToolsetConfigurationReader(new ReadApplicationConfiguration( - ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest)); - - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - BuildPropertyGroup pg = new BuildPropertyGroup(); - pg.SetProperty("DotDotSlash", @"..\"); - reader.ReadToolsets(values, new BuildPropertyGroup(), pg, true); - - string expected1 = Path.GetFullPath(Path.Combine(FileUtilities.CurrentExecutableDirectory, @"..\foo")); - string expected2 = Path.GetFullPath(Path.Combine(FileUtilities.CurrentExecutableDirectory, @"..\bar")); - Console.WriteLine(values["2.0"].ToolsPath); - Assertion.AssertEquals(expected1, values["2.0"].ToolsPath); - Assertion.AssertEquals(expected2, values["3.0"].ToolsPath); - } - - /// - /// Invalid relative path in msbuildbinpath value - /// - [Test] - public void InvalidRelativePath() - { - string invalidRelativePath = @"..\|invalid|"; - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@" - - -
- - - - - - - "); - - ToolsetReader reader = new ToolsetConfigurationReader(new ReadApplicationConfiguration( - ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest)); - - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - reader.ReadToolsets(values, new BuildPropertyGroup(), new BuildPropertyGroup(), true); - - // Don't crash (consistent with invalid absolute path) - Assertion.AssertEquals(invalidRelativePath, values["2.0"].ToolsPath); - } - - /// - /// Tests the case where application configuration file is invalid - /// - [Test] - [ExpectedException(typeof(InvalidToolsetDefinitionException))] - public void GetToolsetDataFromConfiguration_InvalidXmlFile() - { - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@""); - - ToolsetReader reader = new ToolsetConfigurationReader(new ReadApplicationConfiguration( - ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest)); - - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - - reader.ReadToolsets(values, new BuildPropertyGroup(), new BuildPropertyGroup(), true); - } - - /// - /// Tests the case where application configuration file is invalid - /// - [Test] - [ExpectedException(typeof(InvalidToolsetDefinitionException))] - public void GetToolsetDataFromConfiguration_InvalidConfigFile() - { - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@" - - -
- - - - - - - - "); - - ToolsetReader reader = new ToolsetConfigurationReader(new ReadApplicationConfiguration( - ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest)); - - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - - reader.ReadToolsets(values, new BuildPropertyGroup(), new BuildPropertyGroup(), true); - } - - /// - /// Tests the case where application configuration file is empty - /// - [Test] - [ExpectedException(typeof(InvalidToolsetDefinitionException))] - public void GetToolsetDataFromConfiguration_FileEmpty() - { - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@""); - - ToolsetReader reader = new ToolsetConfigurationReader(new ReadApplicationConfiguration( - ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest)); - - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - - reader.ReadToolsets(values, new BuildPropertyGroup(), new BuildPropertyGroup(), true); - } - - /// - /// Tests the case when ReadConfiguration throws exception - /// Make sure that we don't eat it and always throw ConfigurationErrorsException - /// - [Test] - [ExpectedException(typeof(InvalidToolsetDefinitionException))] - public void GetToolsetDataFromConfiguration_ConfigurationExceptionThrown() - { - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@"", new ConfigurationException()); - - ToolsetReader reader = new ToolsetConfigurationReader(new ReadApplicationConfiguration( - ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest)); - - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - - // this should throw ... - reader.ReadToolsets(values, new BuildPropertyGroup(), new BuildPropertyGroup(), true); - } - - /// - /// Tests the case when ReadConfiguration throws exception - /// Make sure that we don't eat it and always throw ConfigurationErrorsException - /// - [Test] - [ExpectedException(typeof(InvalidToolsetDefinitionException))] - public void GetToolsetDataFromConfiguration_ConfigurationErrorsExceptionThrown() - { - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@"", new ConfigurationErrorsException()); - - ToolsetReader reader = new ToolsetConfigurationReader(new ReadApplicationConfiguration( - ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest)); - - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - - // this should throw ... - reader.ReadToolsets(values, new BuildPropertyGroup(), new BuildPropertyGroup(), true); - } - - /// - /// Tests the case where default attribute is not specified in the config file - /// - [Test] - public void GetToolsetDataFromConfiguration_DefaultAttributeNotSpecified() - { - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@" - - -
- - - - - - - "); - - ToolsetReader reader = new ToolsetConfigurationReader(new ReadApplicationConfiguration( - ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest)); - - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - - string defaultToolsVersion = reader.ReadToolsets(values, new BuildPropertyGroup(), new BuildPropertyGroup(), true); - - Assertion.AssertEquals(null, defaultToolsVersion); - Assertion.AssertEquals(1, values.Count); - Assertion.AssertEquals(0, values["2.0"].BuildProperties.Count); - Assertion.AssertEquals(@"D:\windows\Microsoft.NET\Framework\v2.0.x86ret", values["2.0"].ToolsPath); - } - - /// - /// Default toolset has no toolsVersion element definition - /// - [Test] - public void GetToolsetDataFromConfiguration_DefaultToolsetUndefined() - { - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@" - - -
- - - - - - - "); - - ToolsetReader reader = new ToolsetConfigurationReader(new ReadApplicationConfiguration( - ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest)); - - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - - // Does not throw - reader.ReadToolsets(values, new BuildPropertyGroup(), new BuildPropertyGroup(), true); - } - - /// - /// Tests the case where msbuildToolsets is not specified in the config file - /// Basically in the code we should be checking if config.GetSection("msbuildToolsets") returns a null - /// - [Test] - public void GetToolsetDataFromConfiguration_MSBuildToolsetsNodeNotPresent() - { - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@" - - -
- - "); - - ToolsetReader reader = new ToolsetConfigurationReader(new ReadApplicationConfiguration( - ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest)); - - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - - string defaultToolsVersion = reader.ReadToolsets(values, new BuildPropertyGroup(), new BuildPropertyGroup(), true); - - Assertion.AssertEquals(null, defaultToolsVersion); - Assertion.AssertEquals(0, values.Count); - } - - /// - /// Tests that we handle empty MSBuildToolsets element correctly - /// - [Test] - public void GetToolsetDataFromConfiguration_EmptyMSBuildToolsetsNode() - { - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@" - - -
- - - "); - - ToolsetReader reader = new ToolsetConfigurationReader(new ReadApplicationConfiguration( - ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest)); - - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - - string defaultToolsVersion = reader.ReadToolsets(values, new BuildPropertyGroup(), new BuildPropertyGroup(), true); - - Assertion.AssertEquals(null, defaultToolsVersion); - Assertion.AssertEquals(0, values.Count); - } - - /// - /// Tests the case where only default ToolsVersion is specified in the application configuration file - /// - [Test] - public void GetToolsetDataFromConfiguration_OnlyDefaultSpecified() - { - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@" - - -
- - - "); - - ToolsetReader reader = new ToolsetConfigurationReader(new ReadApplicationConfiguration( - ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest)); - - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - - reader.ReadToolsets(values, new BuildPropertyGroup(), new BuildPropertyGroup(), true); - } - - /// - /// Tests the case where only one ToolsVersion data is specified in the application configuration file - /// - [Test] - public void GetToolsetDataFromConfiguration_OneToolsVersionNode() - { - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@" - - -
- - - - - - - "); - - ToolsetReader reader = new ToolsetConfigurationReader(new ReadApplicationConfiguration( - ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest)); - - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - - string defaultToolsVersion = reader.ReadToolsets(values, new BuildPropertyGroup(), new BuildPropertyGroup(), true); - - Assertion.AssertEquals("2.0", defaultToolsVersion); - Assertion.AssertEquals(@"D:\windows\Microsoft.NET\Framework\v2.0.x86ret", values["2.0"].ToolsPath); - Assertion.AssertEquals(1, values.Count); - } - - /// - /// Tests the case when an invalid value of ToolsVersion is specified - /// - [Test] - [ExpectedException(typeof(InvalidToolsetDefinitionException))] - public void GetToolsetDataFromConfiguration_ToolsVersionIsEmptyString() - { - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@" - - -
- - - - - - - - - - "); - - ToolsetReader reader = new ToolsetConfigurationReader(new ReadApplicationConfiguration( - ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest)); - - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - - //this should throw ... - reader.ReadToolsets(values, new BuildPropertyGroup(), new BuildPropertyGroup(), true); - } - - /// - /// If both MSBuildToolsPath and MSBuildBinPath are present, they must match - /// - [Test] - public void GetToolsetDataFromConfiguration_ToolsPathAndBinPathDiffer() - { - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@" - - -
- - - - - - - - "); - - ToolsetReader reader = new ToolsetConfigurationReader(new ReadApplicationConfiguration( - ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest)); - - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - - //this should throw ... - bool caught = false; - try - { - reader.ReadToolsets(values, new BuildPropertyGroup(), new BuildPropertyGroup(), true); - } - catch (InvalidToolsetDefinitionException) - { - caught = true; - } - Assertion.Assert(caught); - } - - /// - /// Tests the case when a blank value of PropertyName is specified in the config file - /// - [Test] - [ExpectedException(typeof(InvalidToolsetDefinitionException))] - public void BlankPropertyNameInConfigFile() - { - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@" - - -
- - - - - - - - "); - - ToolsetReader reader = new ToolsetConfigurationReader(new ReadApplicationConfiguration( - ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest)); - - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - - //this should throw ... - reader.ReadToolsets(values, new BuildPropertyGroup(), new BuildPropertyGroup(), true); - } - - /// - /// Tests the case when a blank property name is specified in the registry - /// - [Test] - [ExpectedException(typeof(InvalidToolsetDefinitionException))] - public void BlankPropertyNameInRegistry() - { - RegistryKey rk = toolsVersionsRegistryKey.CreateSubKey("2.0"); - rk.SetValue("MSBuildBinPath", "someBinPath"); - rk.SetValue("", "foo"); - - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - - // Should throw ... - string defaultToolsVersion = ToolsetReader.ReadAllToolsets - ( - values, - new ToolsetRegistryReader(new MockRegistryKey(testRegistryPath)), - new ToolsetConfigurationReader(new ReadApplicationConfiguration(ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest)), - new BuildPropertyGroup(), - new BuildPropertyGroup(), - ToolsetDefinitionLocations.Registry - ); - } - - /// - /// Tests the case when a blank property value is specified in the config file - /// - [Test] - public void BlankPropertyValueInConfigFile() - { - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@" - - -
- - - - - - - - "); - - ToolsetReader reader = new ToolsetConfigurationReader(new ReadApplicationConfiguration( - ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest)); - - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - - //this should not throw ... - reader.ReadToolsets(values, new BuildPropertyGroup(), new BuildPropertyGroup(), true); - } - - /// - /// Tests the case when a blank property value is specified in the registry - /// - [Test] - public void BlankPropertyValueInRegistry() - { - RegistryKey rk = toolsVersionsRegistryKey.CreateSubKey("2.0"); - rk.SetValue("MSBuildBinPath", "someBinPath"); - rk.SetValue("foo", ""); - - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - - // Should not throw ... - string defaultToolsVersion = ToolsetReader.ReadAllToolsets - ( - values, - new ToolsetRegistryReader(new MockRegistryKey(testRegistryPath)), - new ToolsetConfigurationReader(new ReadApplicationConfiguration(ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest)), - new BuildPropertyGroup(), - new BuildPropertyGroup(), - ToolsetDefinitionLocations.Registry - ); - } - - /// - /// Tests the case when an invalid value of PropertyName is specified in the config file - /// - [Test] - [ExpectedException(typeof(InvalidToolsetDefinitionException))] - public void InvalidPropertyNameInConfigFile() - { - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@" - - -
- - - - - - - - "); - - ToolsetReader reader = new ToolsetConfigurationReader(new ReadApplicationConfiguration( - ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest)); - - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - - //this should throw ... - reader.ReadToolsets(values, new BuildPropertyGroup(), new BuildPropertyGroup(), true); - } - - /// - /// Tests the case when an invalid value of PropertyName is specified in the registry - /// - [Test] - [ExpectedException(typeof(InvalidToolsetDefinitionException))] - public void InvalidPropertyNameInRegistry() - { - RegistryKey rk = toolsVersionsRegistryKey.CreateSubKey("2.0"); - rk.SetValue("MSBuildBinPath", "someBinPath"); - rk.SetValue("foo|bar", "x"); - - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - - // Should throw ... - string defaultToolsVersion = ToolsetReader.ReadAllToolsets - ( - values, - new ToolsetRegistryReader(new MockRegistryKey(testRegistryPath)), - new ToolsetConfigurationReader(new ReadApplicationConfiguration(ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest)), - new BuildPropertyGroup(), - new BuildPropertyGroup(), - ToolsetDefinitionLocations.Registry - ); - } - - /// - /// Tests that empty string is an invalid value for MSBuildBinPath - /// - [Test] - [ExpectedException(typeof(InvalidToolsetDefinitionException))] - public void GetToolsetDataFromConfiguration_PropertyValueIsEmptyString1() - { - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@" - - -
- - - - - - - "); - - ToolsetReader reader = new ToolsetConfigurationReader(new ReadApplicationConfiguration( - ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest)); - - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - - string defaultToolsVersion = reader.ReadToolsets(values, new BuildPropertyGroup(), new BuildPropertyGroup(), true); - - Assertion.AssertEquals(1, values.Count); - Assertion.AssertEquals(0, values["2.0"].BuildProperties.Count); - Assertion.AssertEquals(String.Empty, values["2.0"].ToolsPath); - } - - /// - /// Tests that empty string is a valid property value for an arbitrary property - /// - [Test] - public void GetToolsetDataFromConfiguration_PropertyValueIsEmptyString2() - { - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@" - - -
- - - - - - - - "); - - ToolsetReader reader = new ToolsetConfigurationReader(new ReadApplicationConfiguration( - ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest)); - - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - - string defaultToolsVersion = reader.ReadToolsets(values, new BuildPropertyGroup(), new BuildPropertyGroup(), true); - - Assertion.AssertEquals(1, values.Count); - Assertion.AssertEquals(1, values["2.0"].BuildProperties.Count); - Assertion.AssertEquals(String.Empty, values["2.0"].BuildProperties["foo"].Value); - } - - /// - /// Tests that any escaped xml in config file, is treated well - /// Note that this comes for free with the current implementation using the - /// framework api to access section in the config file - /// - [Test] - public void GetToolsetDataFromConfiguration_XmlEscapedCharacters() - { - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@" - - -
- - - - - - - - "); - - ToolsetReader reader = new ToolsetConfigurationReader(new ReadApplicationConfiguration( - ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest)); - - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - - string defaultToolsVersion = reader.ReadToolsets(values, new BuildPropertyGroup(), new BuildPropertyGroup(), true); - - Assertion.AssertEquals("2>.0", defaultToolsVersion); - Assertion.AssertEquals(1, values.Count); - Assertion.AssertEquals(@"some>value", values["2>.0"].BuildProperties["foo"].Value); - } - #endregion - - #region "GetToolsetData tests" - - /// - /// Tests the case where registry and config file contains different toolsVersion - /// - [Test] - public void GetToolsetData_NoConflict() - { - // Set up registry with two tools versions and one property each - currentVersionRegistryKey.SetValue("DefaultToolsVersion", "2.0"); - RegistryKey key1 = toolsVersionsRegistryKey.CreateSubKey("2.0"); - key1.SetValue("MSBuildBinPath", @"D:\somepath"); - RegistryKey key2 = toolsVersionsRegistryKey.CreateSubKey("3.5"); - key2.SetValue("MSBuildBinPath", @"D:\somepath2"); - - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@" - - -
- - - - - - - - - - "); - - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - - string defaultToolsVersion = ToolsetReader.ReadAllToolsets - ( - values, - new ToolsetRegistryReader(new MockRegistryKey(testRegistryPath)), - new ToolsetConfigurationReader(new ReadApplicationConfiguration(ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest)), - new BuildPropertyGroup(), - new BuildPropertyGroup(), - ToolsetDefinitionLocations.ConfigurationFile | ToolsetDefinitionLocations.Registry - ); - - // Verifications - Assertion.AssertEquals(4, values.Count); - Assertion.AssertEquals("4.5", defaultToolsVersion); - Assertion.AssertEquals(@"D:\somepath", values["2.0"].ToolsPath); - Assertion.AssertEquals(@"D:\somepath2", values["3.5"].ToolsPath); - Assertion.AssertEquals(@"D:\windows\Microsoft.NET\Framework\v2.0.x86ret", values["4.5"].ToolsPath); - Assertion.AssertEquals(@"D:\windows\Microsoft.NET\Framework\v3.5.x86ret", values["5.0"].ToolsPath); - } - - /// - /// Tests that ToolsetInitialization are respected. - /// - [Test] - public void ToolsetInitializationFlagsSetToNone() - { - // Set up registry with two tools versions and one property each - currentVersionRegistryKey.SetValue("DefaultToolsVersion", "2.0"); - RegistryKey key1 = toolsVersionsRegistryKey.CreateSubKey("2.0"); - key1.SetValue("MSBuildBinPath", @"D:\somepath"); - RegistryKey key2 = testRegistryKey.CreateSubKey("3.5"); - key2.SetValue("MSBuildBinPath", @"D:\somepath2"); - - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@" - - -
- - - - - - - - - - "); - - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - - string defaultToolsVersion = ToolsetReader.ReadAllToolsets - ( - values, - new ToolsetRegistryReader(new MockRegistryKey(testRegistryPath)), - new ToolsetConfigurationReader(new ReadApplicationConfiguration(ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest)), - new BuildPropertyGroup(), - new BuildPropertyGroup(), - ToolsetDefinitionLocations.None - ); - - // Verifications - Assertion.AssertEquals(1, values.Count); - - string expectedDefault = "2.0"; - if (FrameworkLocationHelper.PathToDotNetFrameworkV20 == null) - { - expectedDefault = "4.0"; - } - - Assertion.AssertEquals(expectedDefault, defaultToolsVersion); - } - - /// - /// Tests that ToolsetInitialization are respected. - /// - [Test] - public void ToolsetInitializationFlagsSetToRegistry() - { - // Set up registry with two tools versions and one property each - currentVersionRegistryKey.SetValue("DefaultToolsVersion", "2.0"); - RegistryKey key1 = toolsVersionsRegistryKey.CreateSubKey("2.0"); - key1.SetValue("MSBuildBinPath", @"D:\somepath"); - RegistryKey key2 = toolsVersionsRegistryKey.CreateSubKey("3.5"); - key2.SetValue("MSBuildBinPath", @"D:\somepath2"); - - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@" - - -
- - - - - - - - - - "); - - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - - string defaultToolsVersion = ToolsetReader.ReadAllToolsets - ( - values, - new ToolsetRegistryReader(new MockRegistryKey(testRegistryPath)), - new ToolsetConfigurationReader(new ReadApplicationConfiguration(ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest)), - new BuildPropertyGroup(), - new BuildPropertyGroup(), - ToolsetDefinitionLocations.Registry - ); - - // Verifications - Assertion.AssertEquals(2, values.Count); - Assertion.AssertEquals("2.0", defaultToolsVersion); - Assertion.AssertEquals(@"D:\somepath", values["2.0"].ToolsPath); - Assertion.AssertEquals(@"D:\somepath2", values["3.5"].ToolsPath); - } - - [Test] - [ExpectedException(typeof(InvalidToolsetDefinitionException))] - public void ThrowOnNonStringRegistryValueTypes() - { - RegistryKey rk = toolsVersionsRegistryKey.CreateSubKey("2.0"); - rk.SetValue("MSBuildBinPath", "someBinPath"); - - // Non-string - rk.SetValue("QuadWordValue", 42, RegistryValueKind.QWord); - - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - - // Should throw ... - string defaultToolsVersion = ToolsetReader.ReadAllToolsets - ( - values, - new ToolsetRegistryReader(new MockRegistryKey(testRegistryPath)), - new ToolsetConfigurationReader(new ReadApplicationConfiguration(ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest)), - new BuildPropertyGroup(), - new BuildPropertyGroup(), - ToolsetDefinitionLocations.Registry - ); - } - - [Test] - public void PropertiesInRegistryCannotReferToOtherPropertiesInRegistry() - { - RegistryKey rk = toolsVersionsRegistryKey.CreateSubKey("2.0"); - rk.SetValue("MSBuildBinPath", "c:\\x$(p1)"); - rk.SetValue("p0", "$(p1)"); - rk.SetValue("p1", "v"); - rk.SetValue("p2", "$(p1)"); - rk.SetValue("MSBuildToolsPath", "c:\\x$(p1)"); - - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - - string defaultToolsVersion = ToolsetReader.ReadAllToolsets - ( - values, - new ToolsetRegistryReader(new MockRegistryKey(testRegistryPath)), - new ToolsetConfigurationReader(new ReadApplicationConfiguration(ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest)), - new BuildPropertyGroup(), - new BuildPropertyGroup(), - ToolsetDefinitionLocations.Registry - ); - - Assertion.AssertEquals("", values["2.0"].BuildProperties["p0"].Value); - Assertion.AssertEquals("v", values["2.0"].BuildProperties["p1"].Value); - Assertion.AssertEquals("", values["2.0"].BuildProperties["p2"].Value); - Assertion.AssertEquals("c:\\x", values["2.0"].ToolsPath); - } - - /// - /// Tests that ToolsetInitialization are respected. - /// - [Test] - public void ToolsetInitializationFlagsSetToConfigurationFile() - { - // Set up registry with two tools versions and one property each - currentVersionRegistryKey.SetValue("DefaultToolsVersion", "2.0"); - RegistryKey key1 = toolsVersionsRegistryKey.CreateSubKey("2.0"); - key1.SetValue("MSBuildBinPath", @"D:\somepath"); - RegistryKey key2 = toolsVersionsRegistryKey.CreateSubKey("3.5"); - key2.SetValue("MSBuildBinPath", @"D:\somepath2"); - - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@" - - -
- - - - - - - - - - "); - - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - - string defaultToolsVersion = ToolsetReader.ReadAllToolsets - ( - values, - new ToolsetRegistryReader(new MockRegistryKey(testRegistryPath)), - new ToolsetConfigurationReader(new ReadApplicationConfiguration(ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest)), - new BuildPropertyGroup(), - new BuildPropertyGroup(), - ToolsetDefinitionLocations.ConfigurationFile - ); - - // Verifications - Assertion.AssertEquals(2, values.Count); - Assertion.AssertEquals("4.5", defaultToolsVersion); - Assertion.AssertEquals(@"D:\windows\Microsoft.NET\Framework\v2.0.x86ret", values["4.5"].ToolsPath); - Assertion.AssertEquals(@"D:\windows\Microsoft.NET\Framework\v3.5.x86ret", values["5.0"].ToolsPath); - } - - /// - /// Properties in the configuration file may refer to a registry location by using the syntax for example - /// "$(Registry:HKEY_LOCAL_MACHINE\Software\Vendor\Tools@TaskLocation)", where "HKEY_LOCAL_MACHINE\Software\Vendor\Tools" is the key and - /// "TaskLocation" is the name of the value. The name of the value and the preceding "@" may be omitted if - /// the default value is desired. - /// - [Test] - public void PropertyInConfigurationFileReferencesRegistryLocation() - { - // Registry Read - RegistryKey key1 = Registry.CurrentUser.CreateSubKey(@"Software\Vendor\Tools"); - key1.SetValue("TaskLocation", @"somePathToTasks"); - key1.SetValue("TargetsLocation", @"D:\somePathToTargets"); - key1.SetValue("SchemaLocation", @"Schemas"); - key1.SetValue(null, @"D:\somePathToDefault"); //this sets the default value for this key - - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@" - - -
- - - - - - - - - "); - - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - - string defaultToolsVersion = ToolsetReader.ReadAllToolsets - ( - values, - new ToolsetRegistryReader(new MockRegistryKey(testRegistryPath)), - new ToolsetConfigurationReader(new ReadApplicationConfiguration(ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest)), - new BuildPropertyGroup(), - new BuildPropertyGroup(), - ToolsetDefinitionLocations.ConfigurationFile | ToolsetDefinitionLocations.Registry - ); - - Assertion.AssertEquals(1, values.Count); - Assertion.AssertEquals(@"D:\somePathToTasks", values["2.0"].ToolsPath); - Assertion.AssertEquals(2, values["2.0"].BuildProperties.Count); - Assertion.AssertEquals(@"D:\somePathToDefault", values["2.0"].BuildProperties["p1"].Value); - Assertion.AssertEquals(@"D:\somePathToDefault\somePathToTasks\Schemas\2.0", values["2.0"].BuildProperties["p2"].Value); - - Registry.CurrentUser.DeleteSubKeyTree(@"Software\Vendor"); - } - - [Test] - [ExpectedException(typeof(InvalidToolsetDefinitionException))] - public void ToolsPathInRegistryHasInvalidPathChars() - { - currentVersionRegistryKey.SetValue("DefaultToolsVersion", "2.0"); - RegistryKey key1 = toolsVersionsRegistryKey.CreateSubKey("2.0"); - key1.SetValue("MSBuildBinPath", @"D:\some\foo|bar\path\"); - - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - - // should throw... - string defaultToolsVersion = ToolsetReader.ReadAllToolsets - ( - values, - new ToolsetRegistryReader(new MockRegistryKey(testRegistryPath)), - null, - new BuildPropertyGroup(), - new BuildPropertyGroup(), - ToolsetDefinitionLocations.Registry - ); - } - - [Test] - [ExpectedException(typeof(InvalidToolsetDefinitionException))] - public void SamePropertyDefinedMultipleTimesForSingleToolsVersionInConfigurationFile() - { - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@" - - -
- - - - - - - - - - "); - - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - - string defaultToolsVersion = ToolsetReader.ReadAllToolsets - ( - values, - null, - new ToolsetConfigurationReader(new ReadApplicationConfiguration(ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest)), - new BuildPropertyGroup(), - new BuildPropertyGroup(), - ToolsetDefinitionLocations.ConfigurationFile - ); - } - - [Test] - [ExpectedException(typeof(InvalidToolsetDefinitionException))] - public void SamePropertyDifferentCaseDefinedMultipleTimesForSingleToolsVersionInConfigurationFile() - { - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@" - - -
- - - - - - - - - - "); - - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - - string defaultToolsVersion = ToolsetReader.ReadAllToolsets - ( - values, - null, - new ToolsetConfigurationReader(new ReadApplicationConfiguration(ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest)), - new BuildPropertyGroup(), - new BuildPropertyGroup(), - ToolsetDefinitionLocations.ConfigurationFile - ); - } - - [Test] - [ExpectedException(typeof(InvalidToolsetDefinitionException))] - public void SameToolsVersionDefinedMultipleTimesInConfigurationFile() - { - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@" - - -
- - - - - - - - - - - - - - - - "); - - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - - string defaultToolsVersion = ToolsetReader.ReadAllToolsets - ( - values, - null, - new ToolsetConfigurationReader(new ReadApplicationConfiguration(ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest)), - new BuildPropertyGroup(), - new BuildPropertyGroup(), - ToolsetDefinitionLocations.ConfigurationFile - ); - } - - [Test] - [ExpectedException(typeof(InvalidToolsetDefinitionException))] - public void SameToolsVersionDifferentCaseDefinedMultipleTimesInConfigurationFile() - { - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@" - - -
- - - - - - - - - - - - - - - - "); - - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - - string defaultToolsVersion = ToolsetReader.ReadAllToolsets - ( - values, - null, - new ToolsetConfigurationReader(new ReadApplicationConfiguration(ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest)), - new BuildPropertyGroup(), - new BuildPropertyGroup(), - ToolsetDefinitionLocations.ConfigurationFile - ); - } - - [Test] - [ExpectedException(typeof(InvalidToolsetDefinitionException))] - public void CannotSetReservedPropertyInConfigFile() - { - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@" - - -
- - - - - - - - "); - - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - - string defaultToolsVersion = ToolsetReader.ReadAllToolsets - ( - values, - null, - new ToolsetConfigurationReader(new ReadApplicationConfiguration(ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest)), - new BuildPropertyGroup(), - new BuildPropertyGroup(), - ToolsetDefinitionLocations.ConfigurationFile - ); - } - - [Test] - [ExpectedException(typeof(InvalidToolsetDefinitionException))] - public void CannotSetReservedPropertyInRegistry() - { - // Registry Read - RegistryKey key1 = toolsVersionsRegistryKey.CreateSubKey("2.0"); - key1.SetValue("MSBuildBinPath", @"D:\somepath"); - key1.SetValue("MSBuildProjectFile", @"SomeRegistryValue"); - - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - - string defaultToolsVersion = ToolsetReader.ReadAllToolsets - ( - values, - new ToolsetRegistryReader(new MockRegistryKey(testRegistryPath)), - null, - new BuildPropertyGroup(), - new BuildPropertyGroup(), - ToolsetDefinitionLocations.Registry - ); - } - - /// - /// Properties defined in previously processed toolset definitions should - /// not affect the evaluation of subsequent toolset definitions. - /// - [Test] - public void NoInterferenceBetweenToolsetDefinitions() - { - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@" - - -
- - - - - - - - - - - - - - "); - - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - - string defaultToolsVersion = ToolsetReader.ReadAllToolsets - ( - values, - null, - new ToolsetConfigurationReader(new ReadApplicationConfiguration(ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest)), - new BuildPropertyGroup(), - new BuildPropertyGroup(), - ToolsetDefinitionLocations.ConfigurationFile - ); - - Assertion.AssertEquals(2, values.Count); - - Assertion.AssertEquals(@"D:\20\some\folder\on\disk", values["2.0"].ToolsPath); - Assertion.AssertEquals(2, values["2.0"].BuildProperties.Count); - Assertion.AssertEquals(@"another", values["2.0"].BuildProperties["p1"].Value); - Assertion.AssertEquals(@"fourthValue", values["2.0"].BuildProperties["p4"].Value); - - Assertion.AssertEquals(@"D:\35\some\folder\on\disk", values["3.5"].ToolsPath); - Assertion.AssertEquals(2, values["3.5"].BuildProperties.Count); - Assertion.AssertEquals(@"somevalue", values["3.5"].BuildProperties["p2"].Value); - Assertion.AssertEquals(@"propertyValue", values["3.5"].BuildProperties["p3"].Value); - } - - /// - /// Properties in the configuration file may refer to a registry location by using the syntax for example - /// "$(Registry:HKEY_LOCAL_MACHINE\Software\Vendor\Tools@TaskLocation)", where "HKEY_LOCAL_MACHINE\Software\Vendor\Tools" is the key and - /// "TaskLocation" is the name of the value. The name of the value and the preceding "@" may be omitted if - /// the default value is desired. - /// - - [Test] - public void ConfigFileInvalidRegistryExpression1() - { - // No location - ConfigFileInvalidRegistryExpressionHelper(@""); - } - - [Test] - public void ConfigFileInvalidRegistryExpression2() - { - // Bogus key expression - ConfigFileInvalidRegistryExpressionHelper(@""); - } - - [Test] - public void ConfigFileInvalidRegistryExpression3() - { - // No registry location just @ - ConfigFileInvalidRegistryExpressionHelper(@""); - } - - [Test] - public void ConfigFileInvalidRegistryExpression4() - { - // Double @ - ConfigFileInvalidRegistryExpressionHelper(@""); - } - - [Test] - public void ConfigFileInvalidRegistryExpression5() - { - // Trailing @ - ConfigFileInvalidRegistryExpressionHelper(@""); - } - - [Test] - public void ConfigFileInvalidRegistryExpression6() - { - // Leading @ - ConfigFileInvalidRegistryExpressionHelper(@""); - } - - [Test] - public void ConfigFileInvalidRegistryExpression7() - { - // Bogus hive - ConfigFileInvalidRegistryExpressionHelper(@""); - } - - [Test] - public void ConfigFileStringEmptyRegistryExpression1() - { - // Regular undefined property beginning with "Registry" - ConfigFileValidRegistryExpressionHelper(@"", - String.Empty); - } - - [Test] - public void ConfigFileStringEmptyRegistryExpression2() - { - // Nonexistent key - ConfigFileValidRegistryExpressionHelper(@"", - String.Empty); - } - - [Test] - public void ConfigFileNonPropertyRegistryExpression1() - { - // Property not terminated with paren, does not look like property - ConfigFileValidRegistryExpressionHelper(@"", - @"$(Registry:HKEY_CURRENT_USER\Software\Vendor\Tools@TaskLocation"); - } - - [Test] - public void ConfigFileNonPropertyRegistryExpression2() - { - // Missing colon, looks like regular property (admittedly with invalid property name chars, but we don't - // error for that today) - ConfigFileValidRegistryExpressionHelper(@"", - String.Empty); - } - - [Test] - public void ConfigFileItemExpressionsDoNotExpandInConfigurationProperties() - { - // Expect that item expressions such as '@(SomeItem)' are not evaluated in any way, e.g., they are treated literally - ConfigFileValidRegistryExpressionHelper(@"", - @"@(SomeItem)"); - } - - [Test] - public void RegistryInvalidRegistryExpression1() - { - // Bogus key expression - RegistryInvalidRegistryExpressionHelper("$(Registry:__bogus__)"); - } - - [Test] - public void RegistryValidRegistryExpression1() - { - // Regular undefined property beginning with "Registry" - RegistryValidRegistryExpressionHelper("$(Registry)", String.Empty); - } - - [Test] - public void RegistryValidRegistryExpressionRecursive() - { - // Property pointing to itself - should not hang :-) - RegistryValidRegistryExpressionHelper - (@"$(Registry:HKEY_CURRENT_USER\" + testRegistryPath + @"\ToolsVersions\2.0@p)", - @"$(Registry:HKEY_CURRENT_USER\" + testRegistryPath + @"\ToolsVersions\2.0@p)"); - } - - private void RegistryInvalidRegistryExpressionHelper(string propertyExpression) - { - bool caught = false; - try - { - // this should throw... - RegistryValidRegistryExpressionHelper(propertyExpression, String.Empty); - } - catch (InvalidToolsetDefinitionException ex) - { - Console.WriteLine(ex.Message); - caught = true; - } - - Assertion.AssertEquals(true, caught); - } - - private void RegistryValidRegistryExpressionHelper(string propertyExpression, string expectedValue) - { - // Registry Read - currentVersionRegistryKey.SetValue("DefaultToolsVersion", "2.0"); - RegistryKey key1 = toolsVersionsRegistryKey.CreateSubKey("2.0"); - key1.SetValue("MSBuildBinPath", "xxxx"); - key1.SetValue("p", propertyExpression); - - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - - ToolsetReader.ReadAllToolsets - ( - values, - new ToolsetRegistryReader(new MockRegistryKey(testRegistryPath)), - new ToolsetConfigurationReader(new ReadApplicationConfiguration(ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest)), - new BuildPropertyGroup(), - new BuildPropertyGroup(), - ToolsetDefinitionLocations.Registry - ); - - Assertion.AssertEquals(1, values.Count); - Assertion.AssertEquals(expectedValue, values["2.0"].BuildProperties["p"].Value); - } - - /// - /// Tests that an invalid registry property expression causes an exception (resulting in a project load error) - /// - /// - private void ConfigFileInvalidRegistryExpressionHelper(string propertyExpression) - { - bool caught = false; - try - { - // this should throw... - ConfigFileValidRegistryExpressionHelper(propertyExpression, String.Empty); - } - catch (InvalidToolsetDefinitionException ex) - { - Console.WriteLine(ex.Message); - caught = true; - } - - Assertion.AssertEquals(true, caught); - } - - /// - /// Tests that a specified registry property expression evaluates to specified value - /// - /// - private void ConfigFileValidRegistryExpressionHelper(string propertyExpression, string expectedValue) - { - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@" - - -
- - - - - " + propertyExpression + @" - - - "); - - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - - - ToolsetReader.ReadAllToolsets - ( - values, - new ToolsetRegistryReader(new MockRegistryKey(testRegistryPath)), - new ToolsetConfigurationReader(new ReadApplicationConfiguration(ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest)), - new BuildPropertyGroup(), - new BuildPropertyGroup(), - ToolsetDefinitionLocations.ConfigurationFile - ); - - Assertion.AssertEquals(1, values.Count); - Assertion.AssertEquals(expectedValue, values["2.0"].BuildProperties["p"].Value); - } - - /// - /// Tests the case where application configuration file overrides a value already specified in the registry - /// - [Test] - public void GetToolsetData_ConflictingPropertyValuesSameCase() - { - // Registry Read - RegistryKey key1 = toolsVersionsRegistryKey.CreateSubKey("2.0"); - key1.SetValue("MSBuildBinPath", @"D:\somepath"); - - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@" - - -
- - - - - - - "); - - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - - string defaultToolsVersion = ToolsetReader.ReadAllToolsets - ( - values, - new ToolsetRegistryReader(new MockRegistryKey(testRegistryPath)), - new ToolsetConfigurationReader(new ReadApplicationConfiguration(ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest)), - new BuildPropertyGroup(), - new BuildPropertyGroup(), - ToolsetDefinitionLocations.ConfigurationFile | ToolsetDefinitionLocations.Registry - ); - - Assertion.AssertEquals(1, values.Count); - Assertion.AssertEquals(0, values["2.0"].BuildProperties.Count); - Assertion.AssertEquals(@"D:\somedifferentpath", values["2.0"].ToolsPath); - } - - /// - /// Tests when properties are defined in the registry as - /// well as in the config file for the same tools version. - /// We should not merge them; we should take the config file ones only - /// - [Test] - public void GetToolsetData_NoMerging() - { - // Registry Read - RegistryKey key1 = toolsVersionsRegistryKey.CreateSubKey("2.0"); - key1.SetValue("MSBuildBinPath", @"D:\somepath"); - key1.SetValue("SomeRegistryProperty", @"SomeRegistryValue"); - - // Set the config file contents as needed - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@" - - -
- - - - - - - - "); - - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - - string defaultToolsVersion = ToolsetReader.ReadAllToolsets - ( - values, - new ToolsetRegistryReader(new MockRegistryKey(testRegistryPath)), - new ToolsetConfigurationReader(new ReadApplicationConfiguration(ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest)), - new BuildPropertyGroup(), - new BuildPropertyGroup(), - ToolsetDefinitionLocations.ConfigurationFile | ToolsetDefinitionLocations.Registry - ); - - Assertion.AssertEquals(1, values.Count); - Assertion.AssertEquals(1, values["2.0"].BuildProperties.Count); - Assertion.AssertEquals(@"D:\someotherpath", values["2.0"].ToolsPath); - Assertion.AssertEquals(null, values["2.0"].BuildProperties["SomeRegistryProperty"]); // Was zapped - Assertion.AssertEquals(@"SomeConfigValue", values["2.0"].BuildProperties["SomeConfigProperty"].Value); - } - - /// - /// The absence of the ToolsVersion attribute on the main Project element in a project file means - /// that the engine's default tools version should be used. - /// - [Test] - public void ToolsVersionAttributeNotSpecifiedOnProjectElementAndDefaultVersionSpecifiedInRegistry() - { - Engine e = new Engine(); - e.AddToolset(new Toolset("2.0", "20toolsPath")); - e.AddToolset(new Toolset("4.0", "40toolsPath")); - - string projectPath = ObjectModelHelpers.CreateFileInTempProjectDirectory("x.proj", @""); - - Project project = e.CreateNewProject(); - project.Load(projectPath); - - Assertion.AssertEquals("2.0", project.ToolsVersion); - Assertion.AssertEquals("2.0", project.DefaultToolsVersion); - } - - /// - /// Tests the case when no values are specified in the registry - /// - [Test] - public void GetToolsetData_RegistryNotPresent() - { - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@" - - -
- - - - - - - "); - - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - - string defaultToolsVersion = ToolsetReader.ReadAllToolsets - ( - values, - new ToolsetRegistryReader(new MockRegistryKey(testRegistryPath)), - new ToolsetConfigurationReader(new ReadApplicationConfiguration(ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest)), - new BuildPropertyGroup(), - new BuildPropertyGroup(), - ToolsetDefinitionLocations.ConfigurationFile | ToolsetDefinitionLocations.Registry - ); - - Assertion.AssertEquals(1, values.Count); - Assertion.AssertEquals(0, values["2.0"].BuildProperties.Count); - Assertion.AssertEquals(@"D:\somedifferentpath", values["2.0"].ToolsPath); - } - - /// - /// Test the case where nothing is specified in the config file - /// Note that config file not present is same as config file - /// with no MSBuildToolsets Section - /// - [Test] - public void GetToolsetData_ConfigFileNotPresent() - { - // Registry Read - RegistryKey key1 = toolsVersionsRegistryKey.CreateSubKey("2.0"); - key1.SetValue("MSBuildBinPath", @"D:\somepath"); - - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - - string defaultToolsVersion = ToolsetReader.ReadAllToolsets - ( - values, - new ToolsetRegistryReader(new MockRegistryKey(testRegistryPath)), - new ToolsetConfigurationReader(new ReadApplicationConfiguration(ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest)), - new BuildPropertyGroup(), - new BuildPropertyGroup(), - ToolsetDefinitionLocations.ConfigurationFile | ToolsetDefinitionLocations.Registry - ); - - Assertion.AssertEquals(1, values.Count); - Assertion.AssertEquals(0, values["2.0"].BuildProperties.Count); - Assertion.AssertEquals(@"D:\somepath", values["2.0"].ToolsPath); - } - - /// - /// Tests the case where nothing is specified in registry and config file - /// - [Test] - public void GetToolsetData_RegistryAndConfigNotPresent() - { - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - - string defaultToolsVersion = ToolsetReader.ReadAllToolsets - ( - values, - new ToolsetRegistryReader(new MockRegistryKey(testRegistryPath)), - new ToolsetConfigurationReader(new ReadApplicationConfiguration(ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest)), - new BuildPropertyGroup(), - new BuildPropertyGroup(), - ToolsetDefinitionLocations.ConfigurationFile | ToolsetDefinitionLocations.Registry - ); - - Assertion.AssertEquals(1 /* fallback */, values.Count); - } - - /// - /// Tests the case when reading config file throws an exception - /// - [Test] - [ExpectedException(typeof(InvalidToolsetDefinitionException))] - public void GetToolsetData_ReadConfigThrowsException() - { - // Registry Read - RegistryKey key1 = toolsVersionsRegistryKey.CreateSubKey("2.0"); - key1.SetValue("MSBuildBinPath", @"D:\somepath"); - - // Set the config helper to throw exception - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@"", new ConfigurationException()); - - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - - ToolsetReader.ReadAllToolsets - ( - values, - new ToolsetRegistryReader(new MockRegistryKey(testRegistryPath)), - new ToolsetConfigurationReader(new ReadApplicationConfiguration(ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest)), - new BuildPropertyGroup(), - new BuildPropertyGroup(), - ToolsetDefinitionLocations.ConfigurationFile | ToolsetDefinitionLocations.Registry - ); - } - - /// - /// Tests the case where reading from registry throws exception - /// - [Test] - [ExpectedException(typeof(InvalidToolsetDefinitionException))] - public void GetToolsetData_ReadRegistryOpenSubKeyThrowsException() - { - RegistryKeyWrapper mockRegistryKey = - new MockRegistryKey(testRegistryPath, MockRegistryKey.WhereToThrow.OpenSubKey); - - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@" - - -
- - - - - - - "); - - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - - string defaultToolsVersion = ToolsetReader.ReadAllToolsets - ( - values, - new ToolsetRegistryReader(mockRegistryKey), - new ToolsetConfigurationReader(new ReadApplicationConfiguration(ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest)), - new BuildPropertyGroup(), - new BuildPropertyGroup(), - ToolsetDefinitionLocations.ConfigurationFile | ToolsetDefinitionLocations.Registry - ); - } - - #endregion - - #region "SetDefaultToolsetVersion tests" - - /// - /// Tests that the default ToolsVersion is correctly resolved when specified - /// in registry and config file - /// - [Test] - public void SetDefaultToolsetVersion_SpecifiedInRegistryAndConfigFile() - { - // Set up registry with two tools versions and one property each - currentVersionRegistryKey.SetValue("DefaultToolsVersion", "2.0"); - RegistryKey key1 = toolsVersionsRegistryKey.CreateSubKey("2.0"); - key1.SetValue("MSBuildBinPath", @"D:\somepath"); - RegistryKey key2 = toolsVersionsRegistryKey.CreateSubKey("3.5"); - key2.SetValue("MSBuildBinPath", @"D:\somepath2"); - - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@" - - -
- - - - - - - - - - "); - - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - - string defaultToolsVersion = ToolsetReader.ReadAllToolsets - ( - values, - new ToolsetRegistryReader(new MockRegistryKey(testRegistryPath)), - new ToolsetConfigurationReader(new ReadApplicationConfiguration(ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest)), - new BuildPropertyGroup(), - new BuildPropertyGroup(), - ToolsetDefinitionLocations.ConfigurationFile | ToolsetDefinitionLocations.Registry - ); - - Assertion.AssertEquals("5.0", defaultToolsVersion); - } - - /// - /// Tests that the default ToolsVersion is correctly resolved when specified in registry only - /// - [Test] - public void SetDefaultToolsetVersion_SpecifiedOnlyInRegistry() - { - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@" - - -
- - - - - - - - - - "); - - // Set up registry with two tools versions and one property each - currentVersionRegistryKey.SetValue("DefaultToolsVersion", "3.5"); - RegistryKey key2 = toolsVersionsRegistryKey.CreateSubKey("3.5"); - key2.SetValue("MSBuildBinPath", @"D:\somepath2"); - - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - - string defaultToolsVersion = ToolsetReader.ReadAllToolsets - ( - values, - new ToolsetRegistryReader(new MockRegistryKey(testRegistryPath)), - new ToolsetConfigurationReader(new ReadApplicationConfiguration(ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest)), - new BuildPropertyGroup(), - new BuildPropertyGroup(), - ToolsetDefinitionLocations.ConfigurationFile | ToolsetDefinitionLocations.Registry - ); - - Assertion.AssertEquals("3.5", defaultToolsVersion); - } - - /// - /// Tests that the default ToolsVersion is correctly resolved - /// when specified in config file only - /// - [Test] - public void SetDefaultToolsetVersion_SpecifiedOnlyInConfigFile() - { - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@" - - -
- - - - - - - - - - "); - - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - - string defaultToolsVersion = ToolsetReader.ReadAllToolsets - ( - values, - new ToolsetRegistryReader(new MockRegistryKey(testRegistryPath)), - new ToolsetConfigurationReader(new ReadApplicationConfiguration(ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest)), - new BuildPropertyGroup(), - new BuildPropertyGroup(), - ToolsetDefinitionLocations.ConfigurationFile | ToolsetDefinitionLocations.Registry - ); - - - Assertion.AssertEquals("5.0", defaultToolsVersion); - } - - /// - /// Tests that the default ToolsVersion is correctly resolved when specified nowhere - /// - [Test] - public void SetDefaultToolsetVersion_SpecifiedNowhere() - { - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@" - - -
- - - - - - - - - - "); - - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - - string defaultToolsVersion = ToolsetReader.ReadAllToolsets - ( - values, - new ToolsetRegistryReader(new MockRegistryKey(testRegistryPath)), - new ToolsetConfigurationReader(new ReadApplicationConfiguration(ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest)), - new BuildPropertyGroup(), - new BuildPropertyGroup(), - ToolsetDefinitionLocations.ConfigurationFile | ToolsetDefinitionLocations.Registry - ); - - string expectedDefault = "2.0"; - if (FrameworkLocationHelper.PathToDotNetFrameworkV20 == null) - { - expectedDefault = "4.0"; - } - - Assertion.AssertEquals(expectedDefault, defaultToolsVersion); // built-in default - } - - /// - /// Tests that properties are properly expanded when reading them from the config file - /// - [Test] - public void PropertiesInToolsetsFromConfigFileAreExpanded() - { - // $(COMPUTERNAME) is just a convenient env var. $(NUMBER_OF_PROCESSORS) isn't defined on Longhorn - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@" - - -
- - - - - - - - - - "); - - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - - Engine e = new Engine(); - BuildPropertyGroup initialProperties = new BuildPropertyGroup(); - initialProperties.ImportProperties(e.EnvironmentProperties); - initialProperties.ImportProperties(e.GlobalProperties); - - string defaultToolsVersion = ToolsetReader.ReadAllToolsets - ( - values, - new ToolsetRegistryReader(new MockRegistryKey(testRegistryPath)), - new ToolsetConfigurationReader(new ReadApplicationConfiguration(ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest)), - new BuildPropertyGroup(), - initialProperties, - ToolsetDefinitionLocations.ConfigurationFile | ToolsetDefinitionLocations.Registry - ); - - Assertion.AssertEquals("v1", values["3.5"].BuildProperties["p1"].Value); - // Properties can refer to other properties also defined in the config file - Assertion.AssertEquals("__v1__", values["3.5"].BuildProperties["p2"].Value); - Assertion.AssertEquals(Environment.MachineName, values["3.5"].BuildProperties["p3"].Value); - } - - /// - /// Tests that properties in MSBuildToolsPath are properly expanded when reading them from the config file - /// - [Test] - public void PropertiesInToolsetsFromConfigFileAreExpandedInToolsPath() - { - // $(COMPUTERNAME) is just a convenient env var. $(NUMBER_OF_PROCESSORS) isn't defined on Longhorn - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@" - - -
- - - - - - - - - - - "); - - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - - Engine e = new Engine(); - BuildPropertyGroup initialProperties = new BuildPropertyGroup(); - initialProperties.ImportProperties(e.EnvironmentProperties); - initialProperties.ImportProperties(e.GlobalProperties); - - string defaultToolsVersion = ToolsetReader.ReadAllToolsets - ( - values, - new ToolsetRegistryReader(new MockRegistryKey(testRegistryPath)), - new ToolsetConfigurationReader(new ReadApplicationConfiguration(ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest)), - new BuildPropertyGroup(), - initialProperties, - ToolsetDefinitionLocations.ConfigurationFile | ToolsetDefinitionLocations.Registry - ); - - Assertion.AssertEquals("Microsoft.NET", values["3.5"].BuildProperties["p1"].Value); - Assertion.AssertEquals("windows", values["3.5"].BuildProperties["p2"].Value); - string expectedToolsPath = @"D:\windows\Microsoft.NET\Framework\v2.0.x86ret\" + Environment.MachineName; - Assertion.AssertEquals(expectedToolsPath, values["3.5"].ToolsPath); - Assertion.AssertEquals("v3" + expectedToolsPath, values["3.5"].BuildProperties["p3"].Value); - } - - /// - /// Global properties are available, but they cannot be overwritten by other toolset properties, just as they cannot - /// be overwritten by project file properties. - /// - [Test] - public void GlobalPropertiesInToolsetsAreExpandedButAreNotOverwritten() - { - ToolsetConfigurationReaderTestHelper.WriteConfigFile(@" - - -
- - - - - - - - - - "); - - Engine e = new Engine(ToolsetDefinitionLocations.None); - ToolsetCollection values = new ToolsetCollection(e); - - BuildPropertyGroup globalProperties = e.GlobalProperties; - globalProperties.SetProperty("gp1", "gv1"); - - BuildPropertyGroup initialProperties = new BuildPropertyGroup(); - initialProperties.ImportProperties(e.EnvironmentProperties); - initialProperties.ImportProperties(globalProperties); - - string defaultToolsVersion = ToolsetReader.ReadAllToolsets - ( - values, - new ToolsetRegistryReader(new MockRegistryKey(testRegistryPath)), - new ToolsetConfigurationReader(new ReadApplicationConfiguration(ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest)), - globalProperties, - initialProperties, - ToolsetDefinitionLocations.ConfigurationFile | ToolsetDefinitionLocations.Registry - ); - - Assertion.AssertEquals("gv1", values["3.5"].BuildProperties["p1"].Value); - Assertion.AssertEquals("gv1", values["3.5"].BuildProperties["p2"].Value); - } - - - #endregion - } - - internal class MockRegistryKey : RegistryKeyWrapper - { - public enum WhereToThrow - { - None, - Name, - GetValue, - GetValueNames, - GetSubKeyNames, - OpenSubKey - } - - private WhereToThrow whereToThrow = WhereToThrow.None; - private string subKeyThatDoesNotExist = null; - - /// - /// Construct the mock key with a specified key - /// - /// - protected MockRegistryKey(RegistryKey wrappedKey, RegistryKey registryHive) - : base(wrappedKey, registryHive) - { } - - /// - /// Construct the mock key with a wrapper - /// - /// - public MockRegistryKey(string path) - : base(path, Registry.CurrentUser) - { } - - /// - /// Construct the mock key with a wrapper and a designated method - /// to throw from - /// - /// - /// - public MockRegistryKey(string path, WhereToThrow whereToThrow) - : base(path, Registry.CurrentUser) - { - this.whereToThrow = whereToThrow; - } - - /// - /// Construct the mock key with a wrapper and a designated subkey - /// to refuse to open - /// - /// - /// - public MockRegistryKey(string path, string subKeyThatDoesNotExist) - : base(path, Registry.CurrentUser) - { - this.subKeyThatDoesNotExist = subKeyThatDoesNotExist; - } - - /// - /// Name of the registry key - /// - public override string Name - { - get - { - if (whereToThrow == WhereToThrow.Name) - { - throw new RegistryException("registryException", "registry"); - } - return base.Name; - } - } - - /// - /// Gets the value with name "name" stored under this registry key - /// - public override object GetValue(string name) - { - if (whereToThrow == WhereToThrow.GetValue) - { - throw new RegistryException("registryException", "registry"); - } - return base.GetValue(name); - } - - /// - /// Gets the names of all values underneath this registry key - /// - public override string[] GetValueNames() - { - if (whereToThrow == WhereToThrow.GetValueNames) - { - throw new RegistryException("registryException", "registry"); - } - return base.GetValueNames(); - } - - /// - /// Gets the names of all sub keys immediately below this registry key - /// - /// - public override string[] GetSubKeyNames() - { - if (whereToThrow == WhereToThrow.GetSubKeyNames) - { - throw new RegistryException("registryException", "registry"); - } - return base.GetSubKeyNames(); - } - - /// - /// Returns the sub key with name "name" as a read only key - /// - public override RegistryKeyWrapper OpenSubKey(string name) - { - if (whereToThrow == WhereToThrow.OpenSubKey) - { - throw new RegistryException("registryException", "registry"); - } - - if (subKeyThatDoesNotExist == name) - { - // Return wrapper around null key - return new MockRegistryKey((RegistryKey)null, Registry.LocalMachine); - } - - return base.OpenSubKey(name); - } - - } -} - diff --git a/src/Deprecated/Engine.UnitTests/ToolsetRegistryReader_Tests.cs b/src/Deprecated/Engine.UnitTests/ToolsetRegistryReader_Tests.cs deleted file mode 100644 index 846fa1e8929..00000000000 --- a/src/Deprecated/Engine.UnitTests/ToolsetRegistryReader_Tests.cs +++ /dev/null @@ -1,296 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections.Generic; -using System.Configuration; -using NUnit.Framework; - -using Microsoft.Build.BuildEngine; -using Microsoft.Build.BuildEngine.Shared; -using Microsoft.Win32; - -namespace Microsoft.Build.UnitTests -{ - /// - /// Unit test for ToolsetRegistryReader class - /// - [TestFixture] - public class ToolsetRegistryReader_Tests - { - // The registry key that is passed as the baseKey parameter to the ToolsetRegistryReader class - private RegistryKey testRegistryKey = null; - // Subkey "4.0" - private RegistryKey currentVersionRegistryKey = null; - // Subkey "ToolsVersions" - private RegistryKey toolsVersionsRegistryKey = null; - - // Path to the registry key under HKCU - // Note that this is a test registry key created solely for unit testing. - private const string testRegistryPath = @"msbuildUnitTests"; - - /// - /// Reset the testRegistryKey - /// - [SetUp] - public void Setup() - { - DeleteTestRegistryKey(); - testRegistryKey = Registry.CurrentUser.CreateSubKey(testRegistryPath); - currentVersionRegistryKey = Registry.CurrentUser.CreateSubKey(testRegistryPath + "\\" + Constants.AssemblyVersion); - toolsVersionsRegistryKey = Registry.CurrentUser.CreateSubKey(testRegistryPath + "\\ToolsVersions"); - } - - [TearDown] - public void TearDown() - { - DeleteTestRegistryKey(); - } - - /// - /// Helper class to delete the testRegistryKey tree. - /// - private void DeleteTestRegistryKey() - { - if (Registry.CurrentUser.OpenSubKey(testRegistryPath) != null) - { - Registry.CurrentUser.DeleteSubKeyTree(testRegistryPath); - } - } - - /// - /// If the base key has been deleted, then we just don't get any information (no exception) - /// - [Test] - public void ReadRegistry_DeletedKey() - { - DeleteTestRegistryKey(); - - ToolsetReader reader = new ToolsetRegistryReader(new MockRegistryKey(testRegistryPath)); - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - - string defaultToolsVersion = reader.ReadToolsets(values, new BuildPropertyGroup(), new BuildPropertyGroup(), false); - Assertion.AssertEquals(0, values.Count); - } - - /// - /// Tests the tools version 4.0 is written to the the registry at install time - /// - [Test] - public void DefaultValuesInRegistryCreatedBySetup() - { - ToolsetReader reader = new ToolsetRegistryReader(); //we don't use the test registry key because we want to verify the install - - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - - string defaultToolsVersion = reader.ReadToolsets(values, new BuildPropertyGroup(), new BuildPropertyGroup(), false); - - // Check the values in the data - Assertion.Assert("Tools version 4.0 should be defined by default", values.Contains("4.0")); - Assertion.AssertEquals("Default tools version should be 2.0", "2.0", defaultToolsVersion); - - if (FrameworkLocationHelper.PathToDotNetFrameworkV35 != null) - { - Assertion.Assert("Tools version 2.0 should be defined by default if .NET FX 3.5 exists on the machine.", values.Contains("2.0")); - Assertion.Assert("Tools version 3.5 should be defined by default if .NET FX 3.5 exists on the machine.", values.Contains("3.5")); - } - } - - /// - /// Tests we handle no default toolset specified in the registry - /// - [Test] - public void DefaultValueInRegistryDoesNotExist() - { - ToolsetReader reader = new ToolsetRegistryReader(new MockRegistryKey(testRegistryPath, "3.5" /* fail to find subkey 3.5 */)); - - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - - // Should not throw - string defaultToolsVersion = reader.ReadToolsets(values, new BuildPropertyGroup(), new BuildPropertyGroup(), false); - - Assertion.AssertEquals(null, defaultToolsVersion); - } - - /// - /// The base key exists but contains no subkey or values: this is okay - /// - [Test] - public void ReadRegistry_NoSubkeyNoValues() - { - ToolsetReader reader = new ToolsetRegistryReader(new MockRegistryKey(testRegistryPath)); - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - string defaultToolsVersion = reader.ReadToolsets(values, new BuildPropertyGroup(), new BuildPropertyGroup(), false); - - Assertion.AssertEquals(0, values.Count); - Assertion.AssertEquals(null, defaultToolsVersion); - } - - /// - /// Here we validate that MSBuild does not fail when there are unrecognized values underneath - /// the ToolsVersion key. - /// - [Test] - public void ReadRegistry_NoSubkeysOnlyValues() - { - toolsVersionsRegistryKey.SetValue("Name1", "Value1"); - toolsVersionsRegistryKey.SetValue("Name2", "Value2"); - - ToolsetReader reader = new ToolsetRegistryReader(new MockRegistryKey(testRegistryPath)); - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - string defaultToolsVersion = reader.ReadToolsets(values, new BuildPropertyGroup(), new BuildPropertyGroup(), false); - - Assertion.AssertEquals(0, values.Count); - Assertion.AssertEquals(null, defaultToolsVersion); - } - - /// - /// Basekey has only 1 subkey - /// - [Test] - public void ReadRegistry_OnlyOneSubkey() - { - RegistryKey key1 = toolsVersionsRegistryKey.CreateSubKey("tv1"); - key1.SetValue("msbuildtoolspath", "c:\\xxx"); - - ToolsetReader reader = new ToolsetRegistryReader(new MockRegistryKey(testRegistryPath)); - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - string defaultToolsVersion = reader.ReadToolsets(values, new BuildPropertyGroup(), new BuildPropertyGroup(), false); - - Assertion.AssertEquals(null, defaultToolsVersion); - Assertion.AssertEquals(1, values.Count); - Assertion.AssertEquals(0, values["tv1"].BuildProperties.Count); - Assertion.Assert(0 == String.Compare("c:\\xxx", values["tv1"].ToolsPath, StringComparison.OrdinalIgnoreCase)); - } - - /// - /// Basic case - /// - [Test] - public void ReadRegistry_Basic() - { - RegistryKey key1 = toolsVersionsRegistryKey.CreateSubKey("tv1"); - key1.SetValue("msbuildtoolspath", "c:\\xxx"); - key1.SetValue("name1", "value1"); - RegistryKey key2 = toolsVersionsRegistryKey.CreateSubKey("tv2"); - key2.SetValue("name2", "value2"); - key2.SetValue("msbuildtoolspath", "c:\\yyy"); - - ToolsetReader reader = new ToolsetRegistryReader(new MockRegistryKey(testRegistryPath)); - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - string defaultToolsVersion = reader.ReadToolsets(values, new BuildPropertyGroup(), new BuildPropertyGroup(), false); - - Assertion.AssertEquals(2, values.Count); - Assertion.AssertEquals(1, values["tv1"].BuildProperties.Count); - Assertion.Assert(0 == String.Compare("c:\\xxx", values["tv1"].ToolsPath, StringComparison.OrdinalIgnoreCase)); - Assertion.Assert(0 == String.Compare("value1", values["tv1"].BuildProperties["name1"].Value, StringComparison.OrdinalIgnoreCase)); - Assertion.AssertEquals(1, values["tv2"].BuildProperties.Count); - Assertion.Assert(0 == String.Compare("c:\\yyy", values["tv2"].ToolsPath, StringComparison.OrdinalIgnoreCase)); - Assertion.Assert(0 == String.Compare("value2", values["tv2"].BuildProperties["name2"].Value, StringComparison.OrdinalIgnoreCase)); - } - - /// - /// baseKey contains some non-String data - /// - [Test] - [ExpectedException(typeof(InvalidToolsetDefinitionException))] - public void ReadRegistry_NonStringData() - { - RegistryKey key1 = toolsVersionsRegistryKey.CreateSubKey("tv1"); - key1.SetValue("msbuildtoolspath", "c:\\xxx"); - key1.SetValue("name1", "value1"); - RegistryKey key2 = toolsVersionsRegistryKey.CreateSubKey("tv2"); - key2.SetValue("msbuildtoolspath", "c:\\xxx"); - key2.SetValue("name2", new String[] { "value2a", "value2b" }, RegistryValueKind.MultiString); - - ToolsetReader reader = new ToolsetRegistryReader(new MockRegistryKey(testRegistryPath)); - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - string defaultToolsVersion = reader.ReadToolsets(values, new BuildPropertyGroup(), new BuildPropertyGroup(), false); - } - - /// - /// Registry has the following structure - /// [HKCU]\basekey\ - /// Key1 - /// SubKey1 - /// Key2 - /// SubKey2 - /// - [Test] - public void ReadRegistry_IgnoreSubKeysExceptTopMostSubKeys() - { - RegistryKey key1 = toolsVersionsRegistryKey.CreateSubKey("tv1"); - key1.SetValue("msbuildtoolspath", "c:\\xxx"); - key1.SetValue("name1", "value1"); - RegistryKey subKey1 = key1.CreateSubKey("SubKey1"); - subKey1.SetValue("name1a", "value1a"); - subKey1.SetValue("name2a", "value2a"); - RegistryKey key2 = toolsVersionsRegistryKey.CreateSubKey("tv2"); - key2.SetValue("msbuildtoolspath", "c:\\yyy"); - key2.SetValue("name2", "value2"); - RegistryKey subKey2 = key2.CreateSubKey("SubKey2"); - subKey2.SetValue("name3a", "value3a"); - subKey2.SetValue("name2a", "value2a"); - - ToolsetReader reader = new ToolsetRegistryReader(new MockRegistryKey(testRegistryPath)); - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - string defaultToolsVersion = reader.ReadToolsets(values, new BuildPropertyGroup(), new BuildPropertyGroup(), false); - - Assertion.AssertEquals(2, values.Count); - Assertion.AssertEquals(1, values["tv1"].BuildProperties.Count); - Assertion.Assert(0 == String.Compare("c:\\xxx", values["tv1"].ToolsPath, StringComparison.OrdinalIgnoreCase)); - Assertion.Assert(0 == String.Compare("value1", values["tv1"].BuildProperties["name1"].Value, StringComparison.OrdinalIgnoreCase)); - Assertion.AssertEquals(1, values["tv2"].BuildProperties.Count); - Assertion.Assert(0 == String.Compare("c:\\yyy", values["tv2"].ToolsPath, StringComparison.OrdinalIgnoreCase)); - Assertion.Assert(0 == String.Compare("value2", values["tv2"].BuildProperties["name2"].Value, StringComparison.OrdinalIgnoreCase)); - } - - /// - /// Regular case of getting default tools version - /// - [Test] - public void GetDefaultToolsVersionFromRegistry_Basic() - { - currentVersionRegistryKey.SetValue("DefaultToolsVersion", "tv1"); - RegistryKey key1 = toolsVersionsRegistryKey.CreateSubKey("tv1"); // Need matching tools version - key1.SetValue("msbuildtoolspath", "c:\\xxx"); - - ToolsetReader reader = new ToolsetRegistryReader(new MockRegistryKey(testRegistryPath)); - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - string defaultToolsVersion = reader.ReadToolsets(values, new BuildPropertyGroup(), new BuildPropertyGroup(), false); - - Assertion.AssertEquals("tv1", defaultToolsVersion); - } - - /// - /// Default value is not set - /// - [Test] - public void GetDefaultToolsVersionFromRegistry_DefaultValueNotSet() - { - ToolsetReader reader = new ToolsetRegistryReader(new MockRegistryKey(testRegistryPath)); - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - string defaultToolsVersion = reader.ReadToolsets(values, new BuildPropertyGroup(), new BuildPropertyGroup(), false); - - Assertion.AssertEquals(null, defaultToolsVersion); - } - - /// - /// "DefaultToolsVersion" has non-String data - /// - [Test] - [ExpectedException(typeof(InvalidToolsetDefinitionException))] - public void GetDefaultToolsVersionFromRegistry_NonStringData() - { - currentVersionRegistryKey.SetValue("DefaultToolsVersion", new String[] { "2.0.xxxx.a", "2.0.xxxx.b" }, RegistryValueKind.MultiString); - - ToolsetReader reader = new ToolsetRegistryReader(new MockRegistryKey(testRegistryPath)); - ToolsetCollection values = new ToolsetCollection(new Engine(ToolsetDefinitionLocations.None)); - string defaultToolsVersion = reader.ReadToolsets(values, new BuildPropertyGroup(), new BuildPropertyGroup(), false); - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/Toolset_Tests.cs b/src/Deprecated/Engine.UnitTests/Toolset_Tests.cs deleted file mode 100644 index d94a85bcbf2..00000000000 --- a/src/Deprecated/Engine.UnitTests/Toolset_Tests.cs +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Configuration; -using System.IO; -using NUnit.Framework; -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine; -using System.Xml; - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class Toolset_Tests - { - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void ToolsetCtorErrors1() - { - Toolset t = new Toolset(null, "x"); - } - - [Test] - [ExpectedException(typeof(ArgumentNullException))] - public void ToolsetCtorErrors2() - { - Toolset t = new Toolset("x", null); - } - - [Test] - [ExpectedException(typeof(ArgumentException))] - public void ToolsetCtorErrors3() - { - Toolset t = new Toolset(String.Empty, "x"); - } - - [Test] - public void Regress27993_TrailingSlashTrimmedFromMSBuildToolsPath() - { - Toolset t; - - t = new Toolset("x", "C:"); - Assertion.AssertEquals(@"C:", t.ToolsPath); - t = new Toolset("x", @"C:\"); - Assertion.AssertEquals(@"C:\", t.ToolsPath); - t = new Toolset("x", @"C:\\"); - Assertion.AssertEquals(@"C:\", t.ToolsPath); - - t = new Toolset("x", @"C:\foo"); - Assertion.AssertEquals(@"C:\foo", t.ToolsPath); - t = new Toolset("x", @"C:\foo\"); - Assertion.AssertEquals(@"C:\foo", t.ToolsPath); - t = new Toolset("x", @"C:\foo\\"); - Assertion.AssertEquals(@"C:\foo\", t.ToolsPath); // trim at most one slash - - t = new Toolset("x", @"\\foo\share"); - Assertion.AssertEquals(@"\\foo\share", t.ToolsPath); - t = new Toolset("x", @"\\foo\share\"); - Assertion.AssertEquals(@"\\foo\share", t.ToolsPath); - t = new Toolset("x", @"\\foo\share\\"); - Assertion.AssertEquals(@"\\foo\share\", t.ToolsPath); // trim at most one slash - } - } - } diff --git a/src/Deprecated/Engine.UnitTests/UsingTaskCollection_Tests.cs b/src/Deprecated/Engine.UnitTests/UsingTaskCollection_Tests.cs deleted file mode 100644 index d19f7cb7428..00000000000 --- a/src/Deprecated/Engine.UnitTests/UsingTaskCollection_Tests.cs +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections.Generic; -using System.Reflection; -using System.Text; - -using NUnit.Framework; -using Microsoft.Build.BuildEngine; - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class UsingTaskCollection_Tests - { - [Test] - public void TestICollectionMethods() - { - Project project = ObjectModelHelpers.CreateInMemoryProject(string.Format(@" - - - - - - - - - - - - - ", new Uri(Assembly.GetExecutingAssembly().EscapedCodeBase).LocalPath, Assembly.GetExecutingAssembly().FullName)); - - UsingTaskCollection usingTasks = project.UsingTasks; - - Assertion.AssertEquals(2, usingTasks.Count); - - UsingTask[] array = new UsingTask[2]; - usingTasks.CopyTo(array, 0); - - Assertion.AssertEquals(usingTasks[0], array[0]); - Assertion.AssertEquals(usingTasks[1], array[1]); - - object[] arrayObjects = new object[2]; - usingTasks.CopyTo(arrayObjects, 0); - - Assertion.AssertEquals(usingTasks[0], arrayObjects[0]); - Assertion.AssertEquals(usingTasks[1], arrayObjects[1]); - - Assertion.AssertEquals("Microsoft.Build.UnitTests.Project_Tests.WashCar", usingTasks[0].TaskName); - Assertion.AssertEquals("Microsoft.Build.UnitTests.Project_Tests.Message", usingTasks[1].TaskName); - - Assert.IsFalse(usingTasks.IsSynchronized, "Expected IsSynchronized to be false"); - Assert.IsNotNull(usingTasks.SyncRoot, "Expected SynchRoot to not be null"); - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/Utilities_Tests.cs b/src/Deprecated/Engine.UnitTests/Utilities_Tests.cs deleted file mode 100644 index 89e9a47c74a..00000000000 --- a/src/Deprecated/Engine.UnitTests/Utilities_Tests.cs +++ /dev/null @@ -1,418 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Xml; -using System.Reflection; -using System.Collections; -using System.Collections.Specialized; -using System.Text.RegularExpressions; - -using NUnit.Framework; - -using Microsoft.Build.Framework; -using BuildEngine = Microsoft.Build.BuildEngine; -using Microsoft.Build.BuildEngine; - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class UtilitiesTest - { - private static XmlAttribute fakeAttribute = (new XmlDocument()).CreateAttribute("foo"); - - /// - /// Tests our "Condition" parser's ability to extract certain property values - /// out, for the purposes of VS populating the "Configuration" and "Platform" - /// dropdown boxes. This one tests the following expression: - /// - /// '$(Configuration)' == 'Debug' - /// - /// - /// RGoel - [Test] - public void GatherReferencedPropertyNames1 () - { - Hashtable conditionedProperties = new Hashtable(StringComparer.OrdinalIgnoreCase); - - BuildEngine.Utilities.GatherReferencedPropertyNames(" '$(Configuration)' == 'Debug' ", fakeAttribute, - new Expander(new BuildPropertyGroup ()), conditionedProperties); - - StringCollection configurations = (StringCollection) conditionedProperties["CONFIGURATION"]; - - Assertion.AssertEquals(1, configurations.Count); - Assertion.AssertEquals("Debug", configurations[0]); - } - - /// - /// Tests our "Condition" parser's ability to extract certain property values - /// out, for the purposes of VS populating the "Configuration" and "Platform" - /// dropdown boxes. This one tests the following expression: - /// - /// 'Debug' != '$(Configuration)' - /// - /// - /// RGoel - [Test] - public void GatherReferencedPropertyNames2 () - { - Hashtable conditionedProperties = new Hashtable(StringComparer.OrdinalIgnoreCase); - - BuildEngine.Utilities.GatherReferencedPropertyNames(" 'Debug' != '$(Configuration)' ", fakeAttribute, - new Expander(new BuildPropertyGroup ()), conditionedProperties); - - StringCollection configurations = (StringCollection) conditionedProperties["CONFIGURATION"]; - - Assertion.AssertEquals(1, configurations.Count); - Assertion.AssertEquals("Debug", configurations[0]); - } - - /// - /// Tests our "Condition" parser's ability to extract certain property values - /// out, for the purposes of VS populating the "Configuration" and "Platform" - /// dropdown boxes. This one tests the following expression: - /// - /// '$(Configuration)|$(Platform)' != 'Debug|x86' - /// - /// - /// RGoel - [Test] - public void GatherReferencedPropertyNames3 () - { - Hashtable conditionedProperties = new Hashtable(StringComparer.OrdinalIgnoreCase); - - BuildEngine.Utilities.GatherReferencedPropertyNames(" '$(Configuration)|$(Platform)' != 'Debug|x86' ", fakeAttribute, - new Expander(new BuildPropertyGroup ()), conditionedProperties); - - StringCollection configurations = (StringCollection) conditionedProperties["CONFIGURATION"]; - StringCollection platforms = (StringCollection) conditionedProperties["PLATFORM"]; - - Assertion.AssertEquals(1, configurations.Count); - Assertion.AssertEquals(1, platforms.Count); - Assertion.AssertEquals("Debug", configurations[0]); - Assertion.AssertEquals("x86", platforms[0]); - } - - /// - /// Tests our "Condition" parser's ability to extract certain property values - /// out, for the purposes of VS populating the "Configuration" and "Platform" - /// dropdown boxes. This one tests the following expression: - /// - /// 'Debug|x86' == '$(Configuration)|$(Platform)' - /// - /// - /// RGoel - [Test] - public void GatherReferencedPropertyNames4 () - { - Hashtable conditionedProperties = new Hashtable(StringComparer.OrdinalIgnoreCase); - - BuildEngine.Utilities.GatherReferencedPropertyNames(" 'Debug|x86' == '$(Configuration)|$(Platform)' ", fakeAttribute, - new Expander(new BuildPropertyGroup ()), conditionedProperties); - - StringCollection configurations = (StringCollection) conditionedProperties["CONFIGURATION"]; - StringCollection platforms = (StringCollection) conditionedProperties["PLATFORM"]; - - Assertion.AssertEquals(1, configurations.Count); - Assertion.AssertEquals(1, platforms.Count); - Assertion.AssertEquals("Debug", configurations[0]); - Assertion.AssertEquals("x86", platforms[0]); - } - - /// - /// Tests our "Condition" parser's ability to extract certain property values - /// out, for the purposes of VS populating the "Configuration" and "Platform" - /// dropdown boxes. This one tests the following expression: - /// - /// '$(Configuration)|$(Platform)|$(Machine)' == 'Debug|x86|RGOEL3' - /// - /// - /// RGoel - [Test] - public void GatherReferencedPropertyNames5 () - { - Hashtable conditionedProperties = new Hashtable(StringComparer.OrdinalIgnoreCase); - - BuildEngine.Utilities.GatherReferencedPropertyNames(" '$(Configuration)|$(Platform)|$(Machine)' == 'Debug|x86|RGOEL3' ", fakeAttribute, - new Expander(new BuildPropertyGroup ()), conditionedProperties); - - StringCollection configurations = (StringCollection) conditionedProperties["CONFIGURATION"]; - StringCollection platforms = (StringCollection) conditionedProperties["PLATFORM"]; - StringCollection machines = (StringCollection) conditionedProperties["MACHINE"]; - - Assertion.AssertEquals(1, configurations.Count); - Assertion.AssertEquals(1, platforms.Count); - Assertion.AssertEquals(1, machines.Count); - Assertion.AssertEquals("Debug", configurations[0]); - Assertion.AssertEquals("x86", platforms[0]); - Assertion.AssertEquals("RGOEL3", machines[0]); - } - - /// - /// Tests our "Condition" parser's ability to extract certain property values - /// out, for the purposes of VS populating the "Configuration" and "Platform" - /// dropdown boxes. This one tests the following expression: - /// - /// '$(Configuration)|$(Platform)|$(Machine)' == 'Debug' - /// - /// - /// RGoel - [Test] - public void GatherReferencedPropertyNames6 () - { - Hashtable conditionedProperties = new Hashtable(StringComparer.OrdinalIgnoreCase); - - BuildEngine.Utilities.GatherReferencedPropertyNames(" '$(Configuration)|$(Platform)|$(Machine)' == 'Debug' ", fakeAttribute, - new Expander(new BuildPropertyGroup ()), conditionedProperties); - - StringCollection configurations = (StringCollection) conditionedProperties["CONFIGURATION"]; - - Assertion.AssertEquals(1, configurations.Count); - Assertion.AssertNull(conditionedProperties["PLATFORM"]); - Assertion.AssertNull(conditionedProperties["MACHINE"]); - Assertion.AssertEquals("Debug", configurations[0]); - } - - /// - /// Tests our "Condition" parser's ability to extract certain property values - /// out, for the purposes of VS populating the "Configuration" and "Platform" - /// dropdown boxes. This one tests the following expression: - /// - /// '$(Configuration)' == 'Debug|x86|RGOEL3' - /// - /// - /// RGoel - [Test] - public void GatherReferencedPropertyNames7 () - { - Hashtable conditionedProperties = new Hashtable(StringComparer.OrdinalIgnoreCase); - - BuildEngine.Utilities.GatherReferencedPropertyNames(" '$(Configuration)' == 'Debug|x86|RGOEL3' ", fakeAttribute, - new Expander(new BuildPropertyGroup ()), conditionedProperties); - - StringCollection configurations = (StringCollection) conditionedProperties["CONFIGURATION"]; - - Assertion.AssertEquals(1, configurations.Count); - Assertion.AssertNull(conditionedProperties["PLATFORM"]); - Assertion.AssertNull(conditionedProperties["MACHINE"]); - Assertion.AssertEquals("Debug|x86|RGOEL3", configurations[0]); - } - - /// - /// Verify Condition is illegal on ProjectExtensions tag - /// - /// danmose - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void IllegalConditionOnProjectExtensions() - { - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - "); - } - - /// - /// Verify ProjectExtensions cannot exist twice - /// - /// danmose - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void RepeatedProjectExtensions() - { - Project p = ObjectModelHelpers.CreateInMemoryProject(@" - - - - - - "); - } - - /// - /// Tests that we can correctly pass a CDATA tag containing less-than signs into a property value. - /// - /// RGoel - [Test] - public void GetCDATAWithLessThanSignFromXmlNode() - { - string xmlText = ""; - string xmlContents = GetXmlContents(xmlText); - Assertion.AssertEquals(" - /// Tests that we can correctly pass an Xml element named "CDATA" into a property value. - /// - /// RGoel - [Test] - public void GetLiteralCDATAWithLessThanSignFromXmlNode() - { - string xmlText = "This is not a real , just trying to fool the reader."; - string xmlContents = GetXmlContents(xmlText); - - // Notice the extra space after "CDATA" because it normalized the XML. - Assertion.AssertEquals("This is not a real , just trying to fool the reader.", xmlContents); - } - - /// - /// Tests that we can correctly pass a simple CDATA tag into a property value. - /// - /// RGoel - [Test] - public void GetCDATAFromXmlNode() - { - string xmlText = ""; - string xmlContents = GetXmlContents(xmlText); - Assertion.AssertEquals("whatever", xmlContents); - } - - /// - /// Tests that we can correctly pass a literal string called "CDATA" into a property value. - /// - /// RGoel - [Test] - public void GetLiteralCDATAFromXmlNode() - { - string xmlText = "This is not a real CDATA, just trying to fool the reader."; - string xmlContents = GetXmlContents(xmlText); - Assertion.AssertEquals("This is not a real CDATA, just trying to fool the reader.", xmlContents); - } - - /// - /// Tests that we can correctly parse a property that is Xml containing a CDATA tag. - /// - /// RGoel - [Test] - public void GetCDATAOccurringDeeperWithMoreXml() - { - string xmlText = ""; - string xmlContents = GetXmlContents(xmlText); - Assertion.AssertEquals("", xmlContents); - } - - /// - /// Tests that we can correctly pass CDATA where the CDATA tag itself is surrounded by whitespace - /// - /// RGoel - [Test] - public void GetCDATAWithSurroundingWhitespace() - { - string xmlText = " "; - string xmlContents = GetXmlContents(xmlText); - Assertion.AssertEquals("foo", xmlContents); - } - - /// - /// Tests that we can correctly parse a property that is some text concatenated with some XML. - /// - /// RGoel - [Test] - public void GetTextContainingLessThanSignFromXmlNode() - { - string xmlText = "This is some text contain a node , & an escaped character."; - string xmlContents = GetXmlContents(xmlText); - - // Notice the extra space in the xml node because it normalized the XML, and the - // change from single quotes to double-quotes. - Assertion.AssertEquals("This is some text contain a node , & an escaped character.", xmlContents); - } - - /// - /// Tests that we can correctly parse a property containing text with an escaped character. - /// - /// RGoel - [Test] - public void GetTextFromXmlNode() - { - string xmlText = "This is some text & an escaped character."; - string xmlContents = GetXmlContents(xmlText); - Assertion.AssertEquals("This is some text & an escaped character.", xmlContents); - } - - /// - /// Tests that comments are removed if there is no other XML in the value. - /// In other words, .InnerText is used even if there are comments (as long as nothing else looks like XML in the string) - /// - [Test] - public void GetTextFromTextNodeWithXmlComment() - { - string xmlText = "foo; biz; & boz"; - string xmlContents = GetXmlContents(xmlText); - Assertion.AssertEquals("foo; biz; & boz", xmlContents); - } - - [Test] - public void GetTextFromTextNodeWithXmlComment2() - { - string xmlText = "xyz"; - string xmlContents = GetXmlContents(xmlText); - Assertion.AssertEquals("xyz", xmlContents); - } - - [Test] - public void GetTextFromTextNodeWithXmlComment3() - { - string xmlText = ""; - string xmlContents = GetXmlContents(xmlText); - Assertion.AssertEquals("", xmlContents); - } - - [Test] - public void GetTextFromTextNodeWithXmlComment4() - { - string xmlText = "-->"; - string xmlContents = GetXmlContents(xmlText); - Assertion.AssertEquals("-->", xmlContents); - } - - [Test] - public void GetTextFromTextNodeWithXmlComment5() - { - string xmlText = "<"; - string xmlContents = GetXmlContents(xmlText); - // Should get XML; note space after x added - Assertion.AssertEquals("<", xmlContents); - } - - [Test] - public void GetTextFromTextNodeWithXmlComment6() - { - string xmlText = ""; - string xmlContents = GetXmlContents(xmlText); - // Should get XML; note space after x added - Assertion.AssertEquals("", xmlContents); - } - - [Test] - public void GetTextFromTextNodeWithXmlComment7() - { - string xmlText = ""; - string xmlContents = GetXmlContents(xmlText); - // Should get XML; note space after x added - Assertion.AssertEquals("", xmlContents); - } - - private static string GetXmlContents(string xmlText) - { - XmlDocument xmldoc = new XmlDocument(); - xmldoc.LoadXml(xmlText); - - XmlElement rootElement = (XmlElement)xmldoc.FirstChild; - Console.WriteLine("originalxml = " + xmlText); - Console.WriteLine("innerText = " + rootElement.InnerText); - Console.WriteLine("innerXml = " + rootElement.InnerXml); - Console.WriteLine("-----------"); - - string xmlContents = BuildEngine.Utilities.GetXmlNodeInnerContents(rootElement); - return xmlContents; - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/VCProjectParser_Tests.cs b/src/Deprecated/Engine.UnitTests/VCProjectParser_Tests.cs deleted file mode 100644 index d879b420870..00000000000 --- a/src/Deprecated/Engine.UnitTests/VCProjectParser_Tests.cs +++ /dev/null @@ -1,314 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections.Generic; -using System.IO; -using System.Text; - -using NUnit.Framework; -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class VCProjectParser_Tests - { - public void TestGetReferencedProjectGuids() - { - string vcProjectContents = - #region FullVCProjectFile - @" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "; - #endregion - - string realVcProjectContents = vcProjectContents.Replace('\'', '"'); - string tempPath = Path.GetTempFileName(); - - File.WriteAllText(tempPath, realVcProjectContents); - - try - { - List referencedProjectGuids = VCProjectParser.GetReferencedProjectGuids(tempPath); - Assertion.AssertEquals(3, referencedProjectGuids.Count); - Assertion.Assert(referencedProjectGuids.Contains("{C19D89DA-997C-46D7-8569-0F6B14D5EE58}")); - Assertion.Assert(referencedProjectGuids.Contains("{95EDBFFD-540C-42C2-BE2C-F026B9169744}")); - Assertion.Assert(referencedProjectGuids.Contains("{2B050DEB-56B6-463E-BC33-581BC33B3BD8}")); - } - finally - { - File.Delete(tempPath); - } - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/XmlSearcher_Tests.cs b/src/Deprecated/Engine.UnitTests/XmlSearcher_Tests.cs deleted file mode 100644 index 91a3ddf7adc..00000000000 --- a/src/Deprecated/Engine.UnitTests/XmlSearcher_Tests.cs +++ /dev/null @@ -1,225 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.IO; -using System.Xml; -using NUnit.Framework; -using Microsoft.Build.BuildEngine; - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class XmlSearcher_Tests - { - /// - /// Tests to make sure we can compute the correct element/attribute numbers - /// for given Xml nodes. - /// - /// RGoel - [Test] - public void GetElementAttributeNumberOfXmlNode() - { - string projectFileContents = @" - - - - true - - 4 - - - goo - - - - - - c:\\msbengine.dll - - - - - "; - - projectFileContents = projectFileContents.Replace ("`", "\""); - XmlDocument doc = new XmlDocument(); - doc.LoadXml(projectFileContents); - - int elementNumber; - int attributeNumber; - - // Find the element/attribute number of the node. - Assertion.Assert(XmlSearcher.GetElementAndAttributeNumber( - // - doc.FirstChild.ChildNodes[0]. ChildNodes[0], - out elementNumber, - out attributeNumber)); - Assertion.AssertEquals(3, elementNumber); - Assertion.AssertEquals(0, attributeNumber); - - // Find the element/attribute number of the "4" inside the tag. - Assertion.Assert(XmlSearcher.GetElementAndAttributeNumber( - // 4 - doc.FirstChild.ChildNodes[0]. ChildNodes[1]. ChildNodes[0], - out elementNumber, - out attributeNumber)); - Assertion.AssertEquals(6, elementNumber); - Assertion.AssertEquals(0, attributeNumber); - - // Find the element/attribute number of the node. - Assertion.Assert(XmlSearcher.GetElementAndAttributeNumber( - // - doc.FirstChild.ChildNodes[0]. ChildNodes[2], - out elementNumber, - out attributeNumber)); - Assertion.AssertEquals(7, elementNumber); - Assertion.AssertEquals(0, attributeNumber); - - // Find the element/attribute number of the "goo" node. - Assertion.Assert(XmlSearcher.GetElementAndAttributeNumber( - // goo - doc.FirstChild.ChildNodes[0]. ChildNodes[3], - out elementNumber, - out attributeNumber)); - Assertion.AssertEquals(8, elementNumber); - Assertion.AssertEquals(0, attributeNumber); - - // Find the element/attribute number of the node. - Assertion.Assert(XmlSearcher.GetElementAndAttributeNumber( - // - doc.FirstChild.ChildNodes[1].ChildNodes[1], - out elementNumber, - out attributeNumber)); - Assertion.AssertEquals(12, elementNumber); - Assertion.AssertEquals(0, attributeNumber); - - // Find the element/attribute number of the "Condition" attribute on the node. - Assertion.Assert(XmlSearcher.GetElementAndAttributeNumber( - // Condition - doc.FirstChild.ChildNodes[1].ChildNodes[0].Attributes[1], - out elementNumber, - out attributeNumber)); - Assertion.AssertEquals(11, elementNumber); - Assertion.AssertEquals(2, attributeNumber); - - // Try passing in an Xml element that doesn't even exist in the above document. - // This should fail. - Assertion.Assert(!XmlSearcher.GetElementAndAttributeNumber( - (new XmlDocument()).CreateElement("Project"), - out elementNumber, - out attributeNumber)); - } - - /// - /// Find the line/column number of a particular XML element. - /// - /// RGoel - [Test] - public void GetLineColumnOfXmlNode() - { - string projectFileContents = - "" + "\r\n" + - "" + "\r\n" + - " " + "\r\n" + - " true" + "\r\n" + - " " + "\r\n" + - " 4" + "\r\n" + - " " + "\r\n" + - " " + "\r\n" + - " goo" + "\r\n" + - " " + "\r\n" + - " " + "\r\n" + - "" + "\r\n" + - "" ; - - int foundLineNumber; - int foundColumnNumber; - - // Okay, we're going to try and find the line/column number for the node. - // This is the 7th element in the hierarchy. - // Correct answer is: - // Line Number 9 - // Column Number 5 - GetLineColumnFromProjectFileContentsHelper(projectFileContents, - 7, 0, out foundLineNumber, out foundColumnNumber); - Assertion.AssertEquals(9, foundLineNumber); - Assertion.AssertEquals(5, foundColumnNumber); - - // Okay, we're going to try and find the line/column number for the "4" in the property. - // This is the 6th element in the hierarchy. - // Correct answer is: - // Line Number 6 - // Column Number 19 - // This is because the text node actually begins immediately after the closing ">" in "". - GetLineColumnFromProjectFileContentsHelper(projectFileContents, - 6, 0, out foundLineNumber, out foundColumnNumber); - Assertion.AssertEquals(6, foundLineNumber); - Assertion.AssertEquals(19, foundColumnNumber); - - // Okay, we're going to try and find the line/column number for the BogusAttrib attribute. - // This is on the 2nd element in the hierarchy, and it is the 2nd attribute in that element. - // Correct answer is: - // Line Number 4 - // Column Number 18 - GetLineColumnFromProjectFileContentsHelper(projectFileContents, - 2, 2, out foundLineNumber, out foundColumnNumber); - Assertion.AssertEquals(4, foundLineNumber); - Assertion.AssertEquals(18, foundColumnNumber); - - // Okay, we're going to try and find the line/column number for the "goo" beneath . - // This is the 8th element in the hierarchy. - // Correct answer is: - // Line Number 9 - // Column Number 17 - GetLineColumnFromProjectFileContentsHelper(projectFileContents, - 8, 0, out foundLineNumber, out foundColumnNumber); - Assertion.AssertEquals(9, foundLineNumber); - Assertion.AssertEquals(17, foundColumnNumber); - - // Let's try passing in a bogus element number. - GetLineColumnFromProjectFileContentsHelper(projectFileContents, - 25, 0, out foundLineNumber, out foundColumnNumber); - Assertion.AssertEquals(0, foundLineNumber); - Assertion.AssertEquals(0, foundColumnNumber); - - // And let's try passing in a bogus attribute number. - GetLineColumnFromProjectFileContentsHelper(projectFileContents, - 7, 4, out foundLineNumber, out foundColumnNumber); - Assertion.AssertEquals(0, foundLineNumber); - Assertion.AssertEquals(0, foundColumnNumber); - } - - /// - /// Given a string representing the contents of the project file, create a project file - /// on disk with those contents. Then call the method to find the line/column number of - /// a particular node in the project file, based on the element/attribute number of that node. - /// - /// - /// an instance of our special line-number-enabled reader - /// RGoel - private void GetLineColumnFromProjectFileContentsHelper - ( - string projectFileContents, - int xmlElementNumberToSearchFor, - int xmlAttributeNumberToSearchFor, - out int foundLineNumber, - out int foundColumnNumber - ) - { - string projectFile = ObjectModelHelpers.CreateTempFileOnDisk(projectFileContents); - - XmlSearcher.GetLineColumnByNodeNumber(projectFile, - xmlElementNumberToSearchFor, xmlAttributeNumberToSearchFor, - out foundLineNumber, out foundColumnNumber); - - // Delete the temp file. - File.Delete(projectFile); - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/XmlTestUtilities.cs b/src/Deprecated/Engine.UnitTests/XmlTestUtilities.cs deleted file mode 100644 index 1d53b74a255..00000000000 --- a/src/Deprecated/Engine.UnitTests/XmlTestUtilities.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections.Generic; -using System.Text; -using NUnit.Framework; -using System.Xml; -using Microsoft.Build.BuildEngine; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.UnitTests -{ - internal static class XmlTestUtilities - { - internal static XmlElement CreateBasicElementWithOneAttribute(string elementName, string attributeName, string attributeValue) - { - XmlElement element = CreateBasicElement(elementName); - AddAttribute(element, attributeName, attributeValue); - return element; - } - - internal static void AddAttribute(XmlNode element, string attributeName, string attributeValue) - { - XmlAttribute attribute = element.OwnerDocument.CreateAttribute(attributeName); - element.Attributes.Append(attribute); - attribute.Value = attributeValue; - } - - internal static XmlElement AddChildElement(XmlNode parentElement, string childName) - { - XmlElement element = parentElement.OwnerDocument.CreateElement(childName, XMakeAttributes.defaultXmlNamespace); - parentElement.AppendChild(element); - return element; - } - - internal static XmlElement AddChildElementWithInnerText(XmlNode parentElement, string childName, string innerText) - { - XmlElement element = AddChildElement(parentElement, childName); - element.InnerText = innerText; - return element; - } - - internal static XmlElement CreateBasicElement(string elementName) - { - XmlDocument doc = new XmlDocument(); - XmlElement element = doc.CreateElement(elementName, XMakeAttributes.defaultXmlNamespace); - return element; - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/enginehelpers.cs b/src/Deprecated/Engine.UnitTests/enginehelpers.cs deleted file mode 100644 index b0ffab3708f..00000000000 --- a/src/Deprecated/Engine.UnitTests/enginehelpers.cs +++ /dev/null @@ -1,182 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.IO; -using System.Xml; -using System.Text; -using System.Reflection; -using Microsoft.Build.BuildEngine; -using NUnit.Framework; -using System.Collections; -using Microsoft.Build.Framework; -using System.Text.RegularExpressions; -using System.Collections.Generic; - - -namespace Microsoft.Build.UnitTests -{ - /* - * Class: ObjectModelHelpers - * Owner: jomof - * - * Utility methods for unit tests that work through the object model. - * - */ - sealed public class EngineHelpers - { - internal static string EnsureNoLeadingSlash(string path) - { - if (path.Length > 0 && IsSlash(path[0])) - { - path = path.Substring(1); - } - - return path; - } - - internal static string EnsureNoTrailingSlash(string path) - { - if (EndsWithSlash(path)) - { - path = path.Substring(0, path.Length - 1); - } - - return path; - } - - internal static bool EndsWithSlash(string fileSpec) - { - return (fileSpec.Length > 0) - ? IsSlash(fileSpec[fileSpec.Length - 1]) - : false; - } - - internal static bool IsSlash(char c) - { - return ((c == Path.DirectorySeparatorChar) || (c == Path.AltDirectorySeparatorChar)); - } - - /// - /// Amazingly sophisticated :) helper function to determine if the set of ITaskItems returned from - /// a task match the expected set of ITaskItems. It can also check that the ITaskItems have the expected - /// metadata, and that the ITaskItems are returned in the correct order. - /// - /// The "expectedItemsString" is a formatted way of easily specifying which items you expect to see. - /// The format is: - /// - /// itemspec1 : metadataname1=metadatavalue1 ; metadataname2=metadatavalue2 ; ... - /// itemspec2 : metadataname3=metadatavalue3 ; metadataname4=metadatavalue4 ; ... - /// itemspec3 : metadataname5=metadatavalue5 ; metadataname6=metadatavalue6 ; ... - /// - /// (Each item needs to be on its own line.) - /// - /// - /// - /// - /// RGoel - static internal void AssertItemsMatch - ( - string expectedItemsString, - BuildItem[] actualItems - ) - { - AssertItemsMatch(expectedItemsString, actualItems, true); - } - - /// - /// Amazingly sophisticated :) helper function to determine if the set of ITaskItems returned from - /// a task match the expected set of ITaskItems. It can also check that the ITaskItems have the expected - /// metadata, and that the ITaskItems are returned in the correct order. - /// - /// The "expectedItemsString" is a formatted way of easily specifying which items you expect to see. - /// The format is: - /// - /// itemspec1 : metadataname1=metadatavalue1 ; metadataname2=metadatavalue2 ; ... - /// itemspec2 : metadataname3=metadatavalue3 ; metadataname4=metadatavalue4 ; ... - /// itemspec3 : metadataname5=metadatavalue5 ; metadataname6=metadatavalue6 ; ... - /// - /// (Each item needs to be on its own line.) - /// - /// - /// - /// - /// RGoel - static internal void AssertItemsMatch - ( - string expectedItemsString, - BuildItem[] actualItems, - bool orderOfItemsShouldMatch - ) - { - ITaskItem[] actualTaskItems = new ITaskItem[actualItems.Length]; - - int i = 0; - foreach (BuildItem actualItem in actualItems) - { - actualTaskItems[i++] = new Microsoft.Build.BuildEngine.TaskItem(actualItem); - } - - ObjectModelHelpers.AssertItemsMatch(expectedItemsString, actualTaskItems, orderOfItemsShouldMatch); - } - - /// - /// Amazingly sophisticated :) helper function to determine if the set of ITaskItems returned from - /// a task match the expected set of ITaskItems. It can also check that the ITaskItems have the expected - /// metadata, and that the ITaskItems are returned in the correct order. - /// - /// The "expectedItemsString" is a formatted way of easily specifying which items you expect to see. - /// The format is: - /// - /// itemspec1 : metadataname1=metadatavalue1 ; metadataname2=metadatavalue2 ; ... - /// itemspec2 : metadataname3=metadatavalue3 ; metadataname4=metadatavalue4 ; ... - /// itemspec3 : metadataname5=metadatavalue5 ; metadataname6=metadatavalue6 ; ... - /// - /// (Each item needs to be on its own line.) - /// - /// - /// - /// - /// RGoel - static internal void AssertItemsMatch - ( - string expectedItemsString, - BuildItemGroup actualItems - ) - { - AssertItemsMatch(expectedItemsString, actualItems, true); - } - - /// - /// Amazingly sophisticated :) helper function to determine if the set of ITaskItems returned from - /// a task match the expected set of ITaskItems. It can also check that the ITaskItems have the expected - /// metadata, and that the ITaskItems are returned in the correct order. - /// - /// The "expectedItemsString" is a formatted way of easily specifying which items you expect to see. - /// The format is: - /// - /// itemspec1 : metadataname1=metadatavalue1 ; metadataname2=metadatavalue2 ; ... - /// itemspec2 : metadataname3=metadatavalue3 ; metadataname4=metadatavalue4 ; ... - /// itemspec3 : metadataname5=metadatavalue5 ; metadataname6=metadatavalue6 ; ... - /// - /// (Each item needs to be on its own line.) - /// - /// - /// - /// - /// RGoel - static internal void AssertItemsMatch - ( - string expectedItemsString, - BuildItemGroup actualItems, - bool orderOfItemsShouldMatch - ) - { - AssertItemsMatch(expectedItemsString, actualItems.ToArray(), orderOfItemsShouldMatch); - } - } -} diff --git a/src/Deprecated/Engine.UnitTests/projectschemavalidationhandler_tests.cs b/src/Deprecated/Engine.UnitTests/projectschemavalidationhandler_tests.cs deleted file mode 100644 index 38f8fe15228..00000000000 --- a/src/Deprecated/Engine.UnitTests/projectschemavalidationhandler_tests.cs +++ /dev/null @@ -1,292 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.IO; -using System.Resources; -using System.Reflection; -using NUnit.Framework; -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine; -using Microsoft.Build.BuildEngine.Shared; -using System.Xml; - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class ProjectSchemaValidationHandlerTest - { - /*********************************************************************** - * - * Test: ProjectSchemaValidationHandlerTest.VerifyProjectSchema - * Owner: JomoF - * - * This calls VerifyProjectSchema to validate a project XML - * specified in a string - * - **********************************************************************/ - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void VerifyInvalidProjectSchema - ( - ) - { - string[] msbuildTempXsdFilenames = new string[] {}; - try - { - // Create schema files in the temp folder - msbuildTempXsdFilenames = PrepareSchemaFiles(); - - string projectContents = @" - - - - - "; - - Engine buildEngine = new Engine(@"c:\"); - ProjectSchemaValidationHandler validator = new ProjectSchemaValidationHandler(null, buildEngine.LoggingServices, @"c:\"); - - try - { - validator.VerifyProjectSchema(ObjectModelHelpers.CleanupFileContents(projectContents), - msbuildTempXsdFilenames[0]); - } - catch (InvalidProjectFileException e) - { - Assertion.AssertEquals(e.BaseMessage, ResourceUtilities.FormatResourceString("ProjectSchemaErrorHalt")); - - throw; - } - } - finally - { - CleanupSchemaFiles(msbuildTempXsdFilenames); - } - } - - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void VerifyInvalidSchemaItself1 - ( - ) - { - string invalidSchemaFile = null; - try - { - // Create schema files in the temp folder - invalidSchemaFile = Path.GetTempFileName(); - - File.WriteAllText(invalidSchemaFile, ""); - - string projectContents = @" - - - - "; - - Engine buildEngine = new Engine(@"c:\"); - ProjectSchemaValidationHandler validator = new ProjectSchemaValidationHandler(null, buildEngine.LoggingServices, @"c:\"); - - try - { - validator.VerifyProjectSchema(ObjectModelHelpers.CleanupFileContents(projectContents), invalidSchemaFile); - } - catch (InvalidProjectFileException e) - { - Console.WriteLine(e.Message); - Assertion.Assert(e.ErrorCode.Contains("MSB4070") || e.BaseMessage.Contains("MSB4070")); - - throw; - } - } - finally - { - if (invalidSchemaFile != null) File.Delete(invalidSchemaFile); - } - } - - [Test] - [ExpectedException(typeof(InvalidProjectFileException))] - public void VerifyInvalidSchemaItself2 - ( - ) - { - string invalidSchemaFile = null; - try - { - // Create schema files in the temp folder - invalidSchemaFile = Path.GetTempFileName(); - - File.WriteAllText(invalidSchemaFile, @" - - - - - - - - - - -"); - - string projectContents = @" - - - - "; - - Engine buildEngine = new Engine(@"c:\"); - ProjectSchemaValidationHandler validator = new ProjectSchemaValidationHandler(null, buildEngine.LoggingServices, @"c:\"); - - try - { - validator.VerifyProjectSchema(ObjectModelHelpers.CleanupFileContents(projectContents), invalidSchemaFile); - } - catch (InvalidProjectFileException e) - { - Console.WriteLine(e.Message); - Assertion.Assert(e.ErrorCode.Contains("MSB4070") || e.BaseMessage.Contains("MSB4070")); - - throw; - } - } - finally - { - if (invalidSchemaFile != null) File.Delete(invalidSchemaFile); - } - } - - /*********************************************************************** - * - * Test: ProjectSchemaValidationHandlerTest.VerifyProjectSchema - * Owner: JomoF - * - * This calls VerifyProjectSchema to validate a project XML - * specified in a string - * - **********************************************************************/ - [Test] - public void VerifyValidProjectSchema - ( - ) - { - string[] msbuildTempXsdFilenames = new string[] {}; - try - { - // Create schema files in the temp folder - msbuildTempXsdFilenames = PrepareSchemaFiles(); - - string projectContents = @" - - - - "; - - Engine e = new Engine(@"c:\"); - ProjectSchemaValidationHandler validator = new ProjectSchemaValidationHandler(null, e.LoggingServices, @"c:\"); - - validator.VerifyProjectSchema(ObjectModelHelpers.CleanupFileContents(projectContents), - msbuildTempXsdFilenames[0]); - } - finally - { - CleanupSchemaFiles(msbuildTempXsdFilenames); - } - } - - /// - /// The test has a valid project file, importing an invalid project file. - /// We should not validate imported files against the schema in V1, so this - /// should not be caught by the schema - /// - /// danmose - [Test] - public void VerifyInvalidImportNotCaughtBySchema - ( - ) - { - string[] msbuildTempXsdFilenames = new string[] {}; - - string importedProjectFilename = ObjectModelHelpers.CreateTempFileOnDisk(@" - - - - - "); - - string projectFilename = ObjectModelHelpers.CreateTempFileOnDisk(@" - - - - - ", importedProjectFilename); - - try - { - // Create schema files in the temp folder - msbuildTempXsdFilenames = PrepareSchemaFiles(); - - Project p = new Project(new Engine(@"c:\")); - p.IsValidated = true; - p.SchemaFile = msbuildTempXsdFilenames[0]; - p.Load(projectFilename); - } - finally - { - CleanupSchemaFiles(msbuildTempXsdFilenames); - File.Delete(projectFilename); - File.Delete(importedProjectFilename); - } - } - - /// - /// MSBuild schemas are embedded as a resource into Microsoft.Build.Engine.UnitTests.dll. - /// Extract the stream from the resource and write the XSDs out to a temporary file, - /// so that our schema validator can access it. - /// - /// danmose - private string[] PrepareSchemaFiles() - { - Stream msbuildXsdStream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Microsoft.Build.Engine.Unittest.Microsoft.Build.xsd"); - StreamReader msbuildXsdStreamReader = new StreamReader(msbuildXsdStream); - string msbuildXsdContents = msbuildXsdStreamReader.ReadToEnd(); - string msbuildTempXsdFilename = Path.GetTempFileName(); - File.WriteAllText(msbuildTempXsdFilename, msbuildXsdContents); - msbuildXsdStream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Microsoft.Build.Engine.Unittest.Microsoft.Build.Core.xsd"); - msbuildXsdStreamReader = new StreamReader(msbuildXsdStream); - msbuildXsdContents = msbuildXsdStreamReader.ReadToEnd(); - string msbuildXsdSubDirectory = Path.Combine(Path.GetTempPath(), "MSBuild"); - Directory.CreateDirectory(msbuildXsdSubDirectory); - string msbuildTempXsdFilename2 = Path.Combine(msbuildXsdSubDirectory, "Microsoft.Build.Core.xsd"); - File.WriteAllText(msbuildTempXsdFilename2, msbuildXsdContents); - msbuildXsdStream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Microsoft.Build.Engine.Unittest.Microsoft.Build.CommonTypes.xsd"); - msbuildXsdStreamReader = new StreamReader(msbuildXsdStream); - msbuildXsdContents = msbuildXsdStreamReader.ReadToEnd(); - string msbuildTempXsdFilename3 = Path.Combine(msbuildXsdSubDirectory, "Microsoft.Build.CommonTypes.xsd"); - File.WriteAllText(msbuildTempXsdFilename3, msbuildXsdContents); - return new string[] { msbuildTempXsdFilename, msbuildTempXsdFilename2, msbuildTempXsdFilename3 }; - } - - private void CleanupSchemaFiles(string[] msbuildTempXsdFilenames) - { - foreach (string file in msbuildTempXsdFilenames) - { - if (File.Exists(file)) - { - File.Delete(file); - } - } - string msbuildXsdSubDirectory = Path.Combine(Path.GetTempPath(), "MSBuild"); - if (Directory.Exists(msbuildXsdSubDirectory)) - { - Directory.Delete(msbuildXsdSubDirectory); - } - } - } -} diff --git a/src/Deprecated/Engine/AssemblyInfo.cs b/src/Deprecated/Engine/AssemblyInfo.cs deleted file mode 100644 index c5b1b730cff..00000000000 --- a/src/Deprecated/Engine/AssemblyInfo.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Resources; -using System.Security.Permissions; -using System.Runtime.CompilerServices; - -#pragma warning disable 618 -[assembly: SecurityPermission(SecurityAction.RequestMinimum, Flags = SecurityPermissionFlag.Execution)] -#pragma warning restore 618 - -[assembly: InternalsVisibleTo("Microsoft.Build.Unittest, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")] -[assembly: InternalsVisibleTo("Microsoft.Build.Engine.Unittest, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")] -[assembly: InternalsVisibleTo("Microsoft.Build.Framework.Unittest, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")] -[assembly: InternalsVisibleTo("Microsoft.Build.Tasks.Cop, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")] - -[assembly: CLSCompliant(true)] - -[assembly: NeutralResourcesLanguage("en")] diff --git a/src/Deprecated/Engine/Caching/BuildItemCacheEntry.cs b/src/Deprecated/Engine/Caching/BuildItemCacheEntry.cs deleted file mode 100644 index 5d7aa08520c..00000000000 --- a/src/Deprecated/Engine/Caching/BuildItemCacheEntry.cs +++ /dev/null @@ -1,170 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections.Generic; -using System.IO; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// A cache entry holding an array of build items - /// - internal class BuildItemCacheEntry : CacheEntry - { - #region Constructors - - /// - /// Default constructor - /// - internal BuildItemCacheEntry() - { - } - - /// - /// Public constructor - /// - /// - /// - internal BuildItemCacheEntry(string name, BuildItem[] buildItems) - : base(name) - { - this.buildItems = buildItems; - } - - #endregion - - #region Properties - - private BuildItem[] buildItems; - - /// - /// Task items held by this cache entry - /// - internal BuildItem[] BuildItems - { - get { return buildItems; } - set { buildItems = value; } - } - - #endregion - - #region Methods - - /// - /// Returns true if the given cache entry contains equivalent contents - /// - /// - /// - internal override bool IsEquivalent(CacheEntry other) - { - if ((other == null) || (other.GetType() != this.GetType())) - { - return false; - } - - BuildItemCacheEntry otherEntry = (BuildItemCacheEntry)other; - - if (this.Name != otherEntry.Name) - { - return false; - } - - if ((this.BuildItems == null && otherEntry.BuildItems != null) || - (this.BuildItems != null && otherEntry.BuildItems == null)) - { - return false; - } - - if ((this.BuildItems == null) && (otherEntry.BuildItems == null)) - { - return true; - } - - if (this.BuildItems.Length != otherEntry.BuildItems.Length) - { - return false; - } - - for (int i = 0; i < this.BuildItems.Length; i++) - { - if ((this.BuildItems[i] == null && otherEntry.BuildItems[i] != null) || - (this.BuildItems[i] != null && otherEntry.BuildItems[i] == null)) - { - return false; - } - - if ((this.BuildItems[i].FinalItemSpecEscaped != otherEntry.BuildItems[i].FinalItemSpecEscaped) || - (this.BuildItems[i].GetCustomMetadataCount() != otherEntry.BuildItems[i].GetCustomMetadataCount())) - { - return false; - } - - HashSet otherEntryMetadataNames = new HashSet(otherEntry.BuildItems[i].GetAllCustomMetadataNames(), StringComparer.Ordinal); - - foreach (string metadataName in this.BuildItems[i].GetAllCustomMetadataNames()) - { - if ((!otherEntryMetadataNames.Contains(metadataName)) || - (this.BuildItems[i].GetEvaluatedMetadataEscaped(metadataName) != otherEntry.BuildItems[i].GetEvaluatedMetadataEscaped(metadataName))) - { - return false; - } - } - } - - return true; - } - - #endregion - - #region CustomSerializationToStream - internal override void WriteToStream(BinaryWriter writer) - { - base.WriteToStream(writer); - if (buildItems == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - writer.Write((Int32)buildItems.Length); - foreach (BuildItem item in buildItems) - { - if (item == null) - { - writer.Write((byte)0); - } - writer.Write((byte)1); - item.WriteToStream(writer); - } - } - } - - internal override void CreateFromStream(BinaryReader reader) - { - base.CreateFromStream(reader); - buildItems = null; - if (reader.ReadByte() != 0) - { - int sizeOfArray = reader.ReadInt32(); - buildItems = new BuildItem[sizeOfArray]; - for (int j = 0; j < sizeOfArray; j++) - { - BuildItem itemToAdd = null; - if (reader.ReadByte() != 0) - { - itemToAdd = new BuildItem(null, string.Empty); - itemToAdd.CreateFromStream(reader); - } - buildItems[j] = itemToAdd; - } - } - } - #endregion - } -} diff --git a/src/Deprecated/Engine/Caching/BuildResultCacheEntry.cs b/src/Deprecated/Engine/Caching/BuildResultCacheEntry.cs deleted file mode 100644 index 1d58a30e4a7..00000000000 --- a/src/Deprecated/Engine/Caching/BuildResultCacheEntry.cs +++ /dev/null @@ -1,92 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System.IO; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// A cache entry representing a build result (task items + build success/failure) - /// - internal class BuildResultCacheEntry : BuildItemCacheEntry - { - #region Constructors - - /// - /// Default constructor - /// - internal BuildResultCacheEntry() - { - } - - /// - /// Public constructor - /// - /// - /// - /// - internal BuildResultCacheEntry(string name, BuildItem[] buildItems, bool buildResult) - : base(name, buildItems) - { - this.buildResult = buildResult; - } - - #endregion - - #region Properties - - private bool buildResult; - - /// - /// Build result of this target (success, failure, skipped) - /// - internal bool BuildResult - { - get { return buildResult; } - set { buildResult = value; } - } - - #endregion - - #region Methods - - /// - /// Returns true if the given cache entry contains equivalent contents - /// - /// - /// - internal override bool IsEquivalent(CacheEntry other) - { - if ((other == null) || (other.GetType() != this.GetType())) - { - return false; - } - - if (!base.IsEquivalent(other)) - { - return false; - } - - return this.BuildResult == ((BuildResultCacheEntry)other).BuildResult; - } - #endregion - - #region CustomSerializationToStream - internal override void WriteToStream(BinaryWriter writer) - { - base.WriteToStream(writer); - writer.Write(buildResult); - } - - internal override void CreateFromStream(BinaryReader reader) - { - base.CreateFromStream(reader); - buildResult = reader.ReadBoolean(); - } - #endregion - } -} diff --git a/src/Deprecated/Engine/Caching/CacheEntry.cs b/src/Deprecated/Engine/Caching/CacheEntry.cs deleted file mode 100644 index b9c8a59e74c..00000000000 --- a/src/Deprecated/Engine/Caching/CacheEntry.cs +++ /dev/null @@ -1,93 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System.IO; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// Abstract base class for cache entries - /// - internal abstract class CacheEntry - { - #region Constructors - - /// - /// Default constructor - /// - protected CacheEntry() - { - } - - /// - /// Public constructor - /// - /// - protected CacheEntry(string name) - { - this.name = name; - } - - #endregion - - #region Properties - - private string name; - - /// - /// Name of the cache entry - /// - internal string Name - { - get { return name; } - set { name = value; } - } - - #endregion - - #region Methods - - /// - /// Returns true if the given cache entry contains equivalent contents - /// - /// - /// - internal abstract bool IsEquivalent(CacheEntry other); - - #endregion - - #region CustomSerializationToStream - - internal virtual void WriteToStream(BinaryWriter writer) - { - if (name == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - writer.Write(name); - } - } - - internal virtual void CreateFromStream(BinaryReader reader) - { - if (reader.ReadByte() == 0) - { - name = null; - } - else - { - name = reader.ReadString(); - } - } - - #endregion - - } -} diff --git a/src/Deprecated/Engine/Caching/CacheEntryCustomSerializer.cs b/src/Deprecated/Engine/Caching/CacheEntryCustomSerializer.cs deleted file mode 100644 index 809067d4616..00000000000 --- a/src/Deprecated/Engine/Caching/CacheEntryCustomSerializer.cs +++ /dev/null @@ -1,68 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.IO; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - internal static class CacheEntryCustomSerializer - { - private enum CacheEntryTypes - { - BuildItem = 1, - BuildResult = 2, - Property = 3 - } - - internal static void WriteToStream(CacheEntry entry, BinaryWriter writer) - { - Type entryType = entry.GetType(); - if (typeof(BuildItemCacheEntry) == entryType) - { - writer.Write((byte)CacheEntryTypes.BuildItem); - entry.WriteToStream(writer); - } - else if (typeof(BuildResultCacheEntry) == entryType) - { - writer.Write((byte)CacheEntryTypes.BuildResult); - entry.WriteToStream(writer); - } - else if (typeof(PropertyCacheEntry) == entryType) - { - writer.Write((byte)CacheEntryTypes.Property); - entry.WriteToStream(writer); - } - } - - internal static CacheEntry CreateFromStream(BinaryReader reader) - { - CacheEntryTypes entryType = (CacheEntryTypes)reader.ReadByte(); - CacheEntry entry = null; - - switch (entryType) - { - case CacheEntryTypes.BuildItem: - entry = new BuildItemCacheEntry(); - break; - case CacheEntryTypes.BuildResult: - entry = new BuildResultCacheEntry(); - break; - case CacheEntryTypes.Property: - entry = new PropertyCacheEntry(); - break; - default: - ErrorUtilities.VerifyThrow(false, "Should not get to the default of CacheEntryCustomSerializer CreateFromStream"); - break; - } - - entry.CreateFromStream(reader); - return entry; - } - } -} diff --git a/src/Deprecated/Engine/Caching/PropertyCacheEntry.cs b/src/Deprecated/Engine/Caching/PropertyCacheEntry.cs deleted file mode 100644 index d70ee64af30..00000000000 --- a/src/Deprecated/Engine/Caching/PropertyCacheEntry.cs +++ /dev/null @@ -1,111 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System.IO; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// A cache entry holding a name-value pair - /// - internal class PropertyCacheEntry : CacheEntry - { - #region Constructors - - /// - /// Default constructor - /// - internal PropertyCacheEntry() - { - } - - /// - /// Public constructor - /// - /// - /// - internal PropertyCacheEntry(string name, string value) - : base(name) - { - this.value = value; - } - - #endregion - - #region Properties - - private string value; - - /// - /// String value held by this cache entry - /// - internal string Value - { - get { return this.value; } - set { this.value = value; } - } - - #endregion - - #region Methods - - /// - /// Returns true if the given cache entry contains equivalent contents - /// - /// - /// - internal override bool IsEquivalent(CacheEntry other) - { - if ((other == null) || (other.GetType() != this.GetType())) - { - return false; - } - - PropertyCacheEntry otherEntry = (PropertyCacheEntry)other; - - if (this.Name != otherEntry.Name) - { - return false; - } - - return this.Value == otherEntry.Value; - } - - #region CustomSerializationToStream - internal override void WriteToStream(BinaryWriter writer) - { - base.WriteToStream(writer); - - if (value == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - writer.Write(value); - } - } - - internal override void CreateFromStream(BinaryReader reader) - { - base.CreateFromStream(reader); - - if (reader.ReadByte() == 0) - { - value = null; - } - else - { - value = reader.ReadString(); - } - } - #endregion - - #endregion - } -} diff --git a/src/Deprecated/Engine/Choose/Choose.cs b/src/Deprecated/Engine/Choose/Choose.cs deleted file mode 100644 index 4440f2adc84..00000000000 --- a/src/Deprecated/Engine/Choose/Choose.cs +++ /dev/null @@ -1,248 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System.Xml; -using System.Collections; - -using Microsoft.Build.BuildEngine.Shared; - -using error = Microsoft.Build.BuildEngine.Shared.ErrorUtilities; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// Class representing the Choose construct. The Choose class holds the list - /// of When blocks and the Otherwise block. It also contains other data such - /// as the XmlElement, parent project, etc. - /// - internal class Choose : IItemPropertyGrouping - { - #region Member Data - private ArrayList whenClauseList = null; - private When otherwiseClause = null; - private When whenLastTaken = null; - - // If this is a persisted , this boolean tells us whether - // it came from the main project file, or an imported project file. - private bool importedFromAnotherProject; - - // Maximum nesting level of elements. No reasonable project needs more - // than this. - private const int maximumChooseNesting = 50; - - #endregion - - #region Constructors - - /// - /// Empty constructor for the Choose object. This really should only - /// be used by unit tests. - /// - /// - /// - /// DavidLe - internal Choose - ( - ) - { - whenClauseList = new ArrayList(); - } - - /// - /// Constructor for the Choose object. Parses the contents of the Choose - /// and sets up list of When blocks - /// - /// - /// - /// DavidLe - /// - /// - /// - /// - /// stack overflow guard - internal Choose - ( - Project parentProject, - GroupingCollection parentGroupingCollection, - XmlElement chooseElement, - bool importedFromAnotherProject, - int nestingDepth - ) - { - whenClauseList = new ArrayList(); - - error.VerifyThrow(chooseElement != null, "Need valid element."); - - // Make sure this really is the node. - ProjectXmlUtilities.VerifyThrowElementName(chooseElement, XMakeElements.choose); - - // Stack overflow guard. The only way in the MSBuild file format that MSBuild elements can be - // legitimately nested without limit is the construct. So, enforce a nesting limit - // to avoid blowing our stack. - nestingDepth++; - ProjectErrorUtilities.VerifyThrowInvalidProject(nestingDepth <= maximumChooseNesting, chooseElement, "ChooseOverflow", maximumChooseNesting); - - this.importedFromAnotherProject = importedFromAnotherProject; - - // This is coming from an existing XML element, so - // walk through all the attributes and child elements, creating the - // necessary When objects. - - // No attributes on the element, so don't allow any. - ProjectXmlUtilities.VerifyThrowProjectNoAttributes(chooseElement); - - bool foundOtherwise = false; - // Loop through the child nodes of the element. - foreach (XmlNode chooseChildNode in chooseElement) - { - switch (chooseChildNode.NodeType) - { - // Handle XML comments under the node (just ignore them). - case XmlNodeType.Comment: - // fall through - case XmlNodeType.Whitespace: - // ignore whitespace - break; - - case XmlNodeType.Element: - // The only two types of child nodes that a element can contain - // is are elements and zero or one elements. - - ProjectXmlUtilities.VerifyThrowProjectValidNamespace((XmlElement)chooseChildNode); - - if (chooseChildNode.Name == XMakeElements.when) - { - // don't allow to follow - ProjectErrorUtilities.VerifyThrowInvalidProject(!foundOtherwise, - chooseChildNode, "WhenNotAllowedAfterOtherwise"); - When newWhen = new When(parentProject, - parentGroupingCollection, - (XmlElement)chooseChildNode, - importedFromAnotherProject, - When.Options.ProcessWhen, - nestingDepth); - this.whenClauseList.Add(newWhen); - } - else if (chooseChildNode.Name == XMakeElements.otherwise) - { - ProjectErrorUtilities.VerifyThrowInvalidProject(!foundOtherwise, - chooseChildNode, "MultipleOtherwise"); - When newWhen = new When(parentProject, - parentGroupingCollection, - (XmlElement)chooseChildNode, - importedFromAnotherProject, - When.Options.ProcessOtherwise, - nestingDepth); - otherwiseClause = newWhen; - foundOtherwise = true; - } - else - { - ProjectXmlUtilities.ThrowProjectInvalidChildElement(chooseChildNode); - } - break; - - default: - // Unrecognized child element. - ProjectXmlUtilities.ThrowProjectInvalidChildElement(chooseChildNode); - break; - } - } - ProjectErrorUtilities.VerifyThrowInvalidProject(this.whenClauseList.Count != 0, - chooseElement, "ChooseMustContainWhen"); - } - #endregion - - #region Properties - - /// - /// The list of When nodes inside this Choose - /// - internal ArrayList Whens - { - get - { - return whenClauseList; - } - } - - /// - /// The Otherwise node inside this Choose. May be null. - /// - internal When Otherwise - { - get - { - return otherwiseClause; - } - } - - /// - /// True if this Choose is located in an imported project. - /// - internal bool IsImported - { - get - { - return importedFromAnotherProject; - } - } - - #endregion - - #region Methods - - /// - /// Evaluates the Choose clause by stepping through each when and evaluating. - /// - /// - /// - /// DavidLe - /// - /// - /// - /// - /// - internal void Evaluate - ( - BuildPropertyGroup parentPropertyBag, - bool ignoreCondition, bool honorCondition, - Hashtable conditionedPropertiesTable, - ProcessingPass pass - ) - { - if (pass == ProcessingPass.Pass1) - { - whenLastTaken = null; - bool whenTaken = false; - foreach (When currentWhen in this.whenClauseList) - { - if (currentWhen.EvaluateCondition(parentPropertyBag, conditionedPropertiesTable)) - { - whenTaken = true; - currentWhen.Evaluate(parentPropertyBag, ignoreCondition, honorCondition, conditionedPropertiesTable, pass); - whenLastTaken = currentWhen; - break; - } - } - if (!whenTaken && otherwiseClause != null) - { - // Process otherwise - whenLastTaken = otherwiseClause; - otherwiseClause.Evaluate(parentPropertyBag, ignoreCondition, honorCondition, conditionedPropertiesTable, pass); - } - } - else - { - ErrorUtilities.VerifyThrow(pass == ProcessingPass.Pass2, "ProcessingPass must be Pass1 or Pass2."); - whenLastTaken?.Evaluate(parentPropertyBag, ignoreCondition, honorCondition, conditionedPropertiesTable, pass); - } - } - - #endregion - } -} diff --git a/src/Deprecated/Engine/Choose/GroupEnumeratorHelper.cs b/src/Deprecated/Engine/Choose/GroupEnumeratorHelper.cs deleted file mode 100644 index 6c164a2b84c..00000000000 --- a/src/Deprecated/Engine/Choose/GroupEnumeratorHelper.cs +++ /dev/null @@ -1,147 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System.Collections; - -using error = Microsoft.Build.BuildEngine.Shared.ErrorUtilities; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// Helper class that basically just implements an IEnumerable over a - /// GroupingCollection. This object allows you to use the GroupingCollection - /// in foreach statements. - /// - internal sealed class GroupEnumeratorHelper : IEnumerable - { - internal enum ListType - { - PropertyGroupsTopLevelAndChoose, // return Choose and BuildPropertyGroup - ItemGroupsTopLevelAndChoose, // return Choose and BuildItemGroup - PropertyGroupsTopLevel, - ItemGroupsTopLevel, - PropertyGroupsAll, - ItemGroupsAll, - ChoosesTopLevel - }; - - #region Member Data - - // Reference to the GroupingCollection object to get the - // enumerator from. - private GroupingCollection groupingCollection; - - // Type of enumerator to return - private ListType type; - - #endregion - - #region Constructors - - /// - /// Constructor for the GroupEnumeratorHelper. At construction - /// time, you specify the GroupingCollection to use, and the type - /// of enumerator you wish to get. - /// - /// - /// - /// DavidLe - /// - /// - /// IEnumerator - internal GroupEnumeratorHelper - ( - GroupingCollection groupingCollection, - ListType type - ) - { - error.VerifyThrow(groupingCollection != null, "GroupingCollection is null"); - - this.groupingCollection = groupingCollection; - this.type = type; - } - - #endregion - - - #region Methods - - /// - /// Returns an enumerator into the GroupingCollection specified - /// at instantiation time. - /// - /// - /// - /// DavidLe - /// IEnumerator - public IEnumerator GetEnumerator() - { - foreach (IItemPropertyGrouping group in this.groupingCollection) - { - if ((group is BuildItemGroup) && - ((this.type == ListType.ItemGroupsTopLevel) || (this.type == ListType.ItemGroupsTopLevelAndChoose) || (this.type == ListType.ItemGroupsAll))) - { - yield return group; - } - else if ((group is BuildPropertyGroup) && - ((this.type == ListType.PropertyGroupsTopLevel) || (this.type == ListType.PropertyGroupsTopLevelAndChoose) || (this.type == ListType.PropertyGroupsAll))) - { - yield return group; - } - else if (group is Choose) - { - if ((this.type == ListType.ChoosesTopLevel) || (this.type == ListType.ItemGroupsTopLevelAndChoose) || (this.type == ListType.PropertyGroupsTopLevelAndChoose)) - { - yield return group; - } - // Recurse into Choose groups to find all item/property groups - else if ((this.type == ListType.ItemGroupsAll) || (this.type == ListType.PropertyGroupsAll)) - { - Choose choose = (Choose)group; - - foreach (When when in choose.Whens) - { - if (this.type == ListType.ItemGroupsAll) - { - foreach (IItemPropertyGrouping nestedGroup in when.PropertyAndItemLists.ItemGroupsAll) - { - yield return nestedGroup; - } - } - else if (this.type == ListType.PropertyGroupsAll) - { - foreach (IItemPropertyGrouping nestedGroup in when.PropertyAndItemLists.PropertyGroupsAll) - { - yield return nestedGroup; - } - } - } - - if (choose.Otherwise != null) - { - if (this.type == ListType.ItemGroupsAll) - { - foreach (IItemPropertyGrouping nestedGroup in choose.Otherwise.PropertyAndItemLists.ItemGroupsAll) - { - yield return nestedGroup; - } - } - else if (this.type == ListType.PropertyGroupsAll) - { - foreach (IItemPropertyGrouping nestedGroup in choose.Otherwise.PropertyAndItemLists.PropertyGroupsAll) - { - yield return nestedGroup; - } - } - } - } - } - } - } - #endregion - } -} diff --git a/src/Deprecated/Engine/Choose/GroupingCollection.cs b/src/Deprecated/Engine/Choose/GroupingCollection.cs deleted file mode 100644 index 68b63ff1db0..00000000000 --- a/src/Deprecated/Engine/Choose/GroupingCollection.cs +++ /dev/null @@ -1,679 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections; - -using Microsoft.Build.BuildEngine.Shared; - -using error = Microsoft.Build.BuildEngine.Shared.ErrorUtilities; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// Collection that contains all the Choose, BuildPropertyGroup and BuildItemGroup blocks - /// in a Project. - /// - internal class GroupingCollection : IEnumerable - { - #region Member Data - - // This is the list of groups contained in this collection. - private ArrayList combinedGroupList = null; - private int propertyGroupCount = 0; - private int itemGroupCount = 0; - private int chooseCount = 0; - private GroupingCollection parentGroupingCollection; - - #endregion - - #region Constructors - - /// - /// GroupingCollection constructor. Basically just initializes internal - /// data structures. - /// - /// - /// - /// The parent collection of this grouping collection, null for the master collection - /// DavidLe - /// IEnumerator - internal GroupingCollection - ( - GroupingCollection parentGroupingCollection - ) - { - this.combinedGroupList = new ArrayList(); - this.parentGroupingCollection = parentGroupingCollection; - } - - #endregion - - #region PropertyGroupCollection ICollection support - - /// - /// Encapsulates updating the property group count for this and any parent grouping collections. - /// - /// - /// LukaszG - internal void ChangePropertyGroupCount(int delta) - { - this.propertyGroupCount += delta; - ErrorUtilities.VerifyThrow(this.propertyGroupCount >= 0, "The property group count should never be negative"); - - parentGroupingCollection?.ChangePropertyGroupCount(delta); - } - - /// - /// Read-only property returns the number of PropertyGroups stored within the collection. - /// - /// - /// - /// DavidLe - internal int PropertyGroupCount - { - get - { - return this.propertyGroupCount; - } - } - - /// - /// - internal object SyncRoot - { - get - { - return this.combinedGroupList.SyncRoot; - } - } - - /// - /// - internal bool IsSynchronized - { - get - { - return this.combinedGroupList.IsSynchronized; - } - } - /// - /// This ICollection method copies the contents of this collection to an - /// array. - /// - /// - /// - /// DavidLe - /// - /// - internal void PropertyCopyTo - ( - Array array, - int index - ) - { - foreach (BuildPropertyGroup propertyGroup in this.PropertyGroupsAll) - { - array.SetValue(propertyGroup, index++); - } - } - - /// - /// This method returns an IEnumerator object, which allows - /// the caller to enumerate through the BuildPropertyGroup objects - /// contained in this GroupCollection. - /// - /// - /// - /// DavidLe - /// IEnumerator - internal IEnumerator GetPropertyEnumerator - ( - ) - { - error.VerifyThrow(this.combinedGroupList != null, "Arraylist not initialized!"); - return new GroupEnumeratorHelper(this, GroupEnumeratorHelper.ListType.PropertyGroupsAll).GetEnumerator(); - } - - #endregion - - #region ItemGroupCollection ICollection support - - /// - /// Encapsulates updating the item group count for this and any parent grouping collections. - /// - /// - /// LukaszG - internal void ChangeItemGroupCount(int delta) - { - this.itemGroupCount += delta; - ErrorUtilities.VerifyThrow(this.itemGroupCount >= 0, "The item group count should never be negative"); - - parentGroupingCollection?.ChangeItemGroupCount(delta); - } - - /// - /// Read-only property returns the number of ItemGroups stored within the collection. - /// - /// - /// - /// DavidLe - internal int ItemGroupCount - { - get - { - return this.itemGroupCount; - } - } - - /// - /// This ICollection method copies the contents of this collection to an - /// array. - /// - /// - /// - /// DavidLe - /// - /// - /// IEnumerator - internal void ItemCopyTo - ( - Array array, - int index - ) - { - foreach (BuildItemGroup itemGroup in this.ItemGroupsAll) - { - array.SetValue(itemGroup, index++); - } - } - - /// - /// This method returns an IEnumerator object, which allows - /// the caller to enumerate through the BuildItemGroup objects - /// contained in this GroupCollection. - /// - /// - /// - /// DavidLe - /// IEnumerator - internal IEnumerator GetItemEnumerator - ( - ) - { - error.VerifyThrow(this.combinedGroupList != null, "Arraylist not initialized!"); - return new GroupEnumeratorHelper(this, GroupEnumeratorHelper.ListType.ItemGroupsAll).GetEnumerator(); - } - - #endregion - - #region Various enumerators for selecting different groups from this collection - - internal GroupEnumeratorHelper PropertyGroupsTopLevelAndChooses - { - get - { - return new GroupEnumeratorHelper(this, GroupEnumeratorHelper.ListType.PropertyGroupsTopLevelAndChoose); - } - } - - internal GroupEnumeratorHelper ItemGroupsTopLevelAndChooses - { - get - { - return new GroupEnumeratorHelper(this, GroupEnumeratorHelper.ListType.ItemGroupsTopLevelAndChoose); - } - } - - internal GroupEnumeratorHelper PropertyGroupsTopLevel - { - get - { - return new GroupEnumeratorHelper(this, GroupEnumeratorHelper.ListType.PropertyGroupsTopLevel); - } - } - - internal GroupEnumeratorHelper ItemGroupsTopLevel - { - get - { - return new GroupEnumeratorHelper(this, GroupEnumeratorHelper.ListType.ItemGroupsTopLevel); - } - } - - internal GroupEnumeratorHelper PropertyGroupsAll - { - get - { - return new GroupEnumeratorHelper(this, GroupEnumeratorHelper.ListType.PropertyGroupsAll); - } - } - - internal GroupEnumeratorHelper ItemGroupsAll - { - get - { - return new GroupEnumeratorHelper(this, GroupEnumeratorHelper.ListType.ItemGroupsAll); - } - } - - internal GroupEnumeratorHelper ChoosesTopLevel - { - get - { - return new GroupEnumeratorHelper(this, GroupEnumeratorHelper.ListType.ChoosesTopLevel); - } - } - - #endregion - - #region Methods - - /// - /// This IEnumerable method returns an IEnumerator object, which allows - /// the caller to enumerate through the Grouping objects (Choose, BuildPropertyGroup, - /// and BuildItemGroup) contained in this BuildItemGroupCollection. - /// - /// - /// - /// DavidLe - /// IEnumerator - public IEnumerator GetEnumerator - ( - ) - { - error.VerifyThrow(this.combinedGroupList != null, "Arraylist not initialized!"); - - return combinedGroupList.GetEnumerator(); - } - - /// - /// Adds a new BuildPropertyGroup as the first element of our collection. - /// This method does nothing to manipulate the project's XML content. - /// - /// - /// - /// DavidLe - /// - internal void InsertAtBeginning - ( - BuildPropertyGroup newPropertyGroup - ) - { - error.VerifyThrow(this.combinedGroupList != null, "Arraylist not initialized!"); - - this.combinedGroupList.Insert(0, newPropertyGroup); - newPropertyGroup.ParentCollection = this; - ChangePropertyGroupCount(1); - } - - /// - /// Adds a new BuildPropertyGroup to our collection, at the specified insertion - /// point. This method does nothing to manipulate the project's XML content. - /// - /// - /// - /// DavidLe - /// - /// - internal void InsertAfter - ( - BuildPropertyGroup newPropertyGroup, - BuildPropertyGroup insertionPoint - ) - { - InsertAfter((IItemPropertyGrouping)newPropertyGroup, (IItemPropertyGrouping)insertionPoint); - } - - /// - /// Adds a new BuildPropertyGroup as the last element of our collection. - /// This method does nothing to manipulate the project's XML content. - /// - /// - /// - /// DavidLe - /// - internal void InsertAtEnd - ( - BuildPropertyGroup newPropertyGroup - ) - { - InsertAtEnd((IItemPropertyGrouping)newPropertyGroup); - } - - /// - /// Removes a BuildPropertyGroup from our collection. This method does nothing - /// to manipulate the project's XML content. - /// - /// - /// - /// DavidLe - /// - internal void RemovePropertyGroup - ( - BuildPropertyGroup propertyGroup - ) - { - error.VerifyThrow(this.combinedGroupList != null, "Arraylist not initialized!"); - - this.combinedGroupList.Remove(propertyGroup); - ChangePropertyGroupCount(-1); - propertyGroup.ParentCollection = null; - error.VerifyThrow(this.propertyGroupCount >= 0, "Too many calls to RemovePropertyGroup()."); - } - - /// - /// Adds a new BuildItemGroup to our collection, at the specified insertion - /// point. This method does nothing to manipulate the project's XML content. - /// - /// - /// - /// DavidLe - /// - /// - internal void InsertAfter - ( - BuildItemGroup newItemGroup, - BuildItemGroup insertionPoint - ) - { - InsertAfter((IItemPropertyGrouping)newItemGroup, (IItemPropertyGrouping)insertionPoint); - } - - /// - /// Adds a new BuildItemGroup as the last element of our collection. - /// This method does nothing to manipulate the project's XML content. - /// - /// - /// - /// DavidLe - /// - internal void InsertAtEnd - ( - BuildItemGroup newItemGroup - ) - { - InsertAtEnd((IItemPropertyGrouping)newItemGroup); - } - - /// - /// Removes a BuildItemGroup from our collection. This method does nothing - /// to manipulate the project's XML content. - /// - /// - /// - /// DavidLe - /// - internal void RemoveItemGroup - ( - BuildItemGroup itemGroupToRemove - ) - { - error.VerifyThrow(this.combinedGroupList != null, "Arraylist not initialized!"); - - this.combinedGroupList.Remove(itemGroupToRemove); - itemGroupToRemove.ParentCollection = null; - - ChangeItemGroupCount(-1); - error.VerifyThrow(this.itemGroupCount >= 0, "Too many calls to RemoveItemGroup()."); - } - - /// - /// Inserts a new item group after the specified insertion point. This method - /// does nothing to manipulate the project's XML content. - /// - /// - /// - /// DavidLe - /// - /// - internal void InsertAfter - ( - IItemPropertyGrouping newGroup, - IItemPropertyGrouping insertionPoint - ) - { - error.VerifyThrow(this.combinedGroupList != null, "Arraylist not initialized!"); - - this.combinedGroupList.Insert(this.combinedGroupList.IndexOf(insertionPoint) + 1, - newGroup); - if (newGroup is BuildItemGroup) - { - ((BuildItemGroup)newGroup).ParentCollection = this; - ChangeItemGroupCount(1); - } - else if (newGroup is BuildPropertyGroup) - { - ((BuildPropertyGroup)newGroup).ParentCollection = this; - ChangePropertyGroupCount(1); - } - else if (newGroup is Choose) - { - this.chooseCount++; - } - } - - /// - /// Inserts a new BuildItemGroup at the end of the list of ItemGroups. This method - /// does nothing to manipulate the project's XML content. - /// - /// - /// - /// DavidLe - /// - internal void InsertAtEnd - ( - IItemPropertyGrouping newGroup - ) - { - error.VerifyThrow(this.combinedGroupList != null, "Arraylist not initialized!"); - - this.combinedGroupList.Add(newGroup); - if (newGroup is BuildItemGroup) - { - ((BuildItemGroup)newGroup).ParentCollection = this; - ChangeItemGroupCount(1); - } - else if (newGroup is BuildPropertyGroup) - { - ((BuildPropertyGroup)newGroup).ParentCollection = this; - ChangePropertyGroupCount(1); - } - else if (newGroup is Choose) - { - this.chooseCount++; - } - } - - /// - /// Removes a Choose block from the list. This method does nothing to manipulate - /// the project's XML content. - /// - /// - /// - /// DavidLe - /// - internal void RemoveChoose - ( - Choose choose - ) - { - error.VerifyThrow(this.combinedGroupList != null, "Arraylist not initialized!"); - - this.combinedGroupList.Remove(choose); - this.chooseCount--; - error.VerifyThrow(this.chooseCount >= 0, "Too many calls to RemoveChoose()."); - } - - /// - /// Removes all ItemGroups, PropertyGroups and Choose's from our - /// collection. This method does nothing to manipulate the project's XML content. - /// - /// - /// - /// DavidLe - internal void Clear - ( - ) - { - error.VerifyThrow(this.combinedGroupList != null, "Arraylist not initialized!"); - - this.combinedGroupList.Clear(); - ChangeItemGroupCount(-this.itemGroupCount); // set to 0 and update parent collections - ChangePropertyGroupCount(-this.propertyGroupCount); // set to 0 and update parent collections - chooseCount = 0; - } - - /// - /// Removes all PropertyGroups from the collection. Recurses into Chooses - /// in the collection removing PropertyGroups as well. - /// - /// - /// - /// DavidLe - internal void RemoveAllPropertyGroups() - { - // Need to copy the collection to an array, because we're not allowed - // to modify a collection while it's being enumerated. - ArrayList localPropertyGroups = new ArrayList(this.propertyGroupCount); - - foreach (BuildPropertyGroup propertyGroup in this.PropertyGroupsAll) - { - if (!propertyGroup.IsImported) - { - localPropertyGroups.Add(propertyGroup); - } - } - - foreach (BuildPropertyGroup propertyGroupToRemove in localPropertyGroups) - { - propertyGroupToRemove.ParentProject.RemovePropertyGroup(propertyGroupToRemove); - } - } - - /// - /// Removes all PropertyGroups with a given condtion from the collection. - /// Recurses into Chooses in the collection removing PropertyGroups as well. - /// - /// - /// - /// DavidLe - internal void RemoveAllPropertyGroupsByCondition(string condition, bool includeImportedPropertyGroups) - { - ArrayList propertiesToRemove = new ArrayList(); - foreach (BuildPropertyGroup propertyGroup in this.PropertyGroupsAll) - { - if (String.Equals(condition.Trim(), propertyGroup.Condition.Trim(), StringComparison.OrdinalIgnoreCase) - && (!propertyGroup.IsImported || includeImportedPropertyGroups)) - { - propertiesToRemove.Add(propertyGroup); - } - } - foreach (BuildPropertyGroup propertyGroup in propertiesToRemove) - { - if (propertyGroup.IsImported) - { - propertyGroup.ParentProject.RemoveImportedPropertyGroup(propertyGroup); - } - else - { - propertyGroup.ParentProject.RemovePropertyGroup(propertyGroup); - } - } - } - - /// - /// Removes all ItemGroups from the collection. - /// Recurses into Chooses in the collection removing ItemGroups as well. - /// - /// - /// - /// DavidLe - internal void RemoveAllItemGroups() - { - // Need to copy the collection to an array, because we're not allowed - // to modify a collection while it's being enumerated. - ArrayList localItemGroups = new ArrayList(this.itemGroupCount); - - foreach (BuildItemGroup itemGroup in ItemGroupsAll) - { - if (!itemGroup.IsImported) - { - localItemGroups.Add(itemGroup); - } - } - - foreach (BuildItemGroup itemGroupToRemove in localItemGroups) - { - itemGroupToRemove.ParentProject.RemoveItemGroup(itemGroupToRemove); - } - } - - /// - /// Removes all ItemGroups with a given condtion from the collection. - /// Recurses into Chooses in the collection removing ItemGroups as well. - /// - /// - /// - /// DavidLe - /// - internal void RemoveAllItemGroupsByCondition(string condition) - { - ArrayList itemsToRemove = new ArrayList(this.itemGroupCount); - - foreach (BuildItemGroup itemGroup in this.ItemGroupsAll) - { - if (String.Equals(condition.Trim(), itemGroup.Condition.Trim(), StringComparison.OrdinalIgnoreCase) - && !itemGroup.IsImported) - { - itemsToRemove.Add(itemGroup); - } - } - foreach (BuildItemGroup itemGroup in itemsToRemove) - { - itemGroup.ParentProject.RemoveItemGroup(itemGroup); - } - } - - /// - /// Removes all Items of a given typoe from the collection. - /// Recurses into Chooses in the collection removing Items as well. - /// - /// - /// - /// DavidLe - /// - internal void RemoveItemsByName(string itemName) - { - BuildItemGroup itemsToRemove = new BuildItemGroup(); - - foreach (BuildItemGroup itemGroup in this.ItemGroupsAll) - { - // Now loop through the Items in the BuildItemGroup, and keep track of the - // ones that are of the requested item type. - foreach (BuildItem item in itemGroup) - { - if ((String.Equals(item.Name, itemName, StringComparison.OrdinalIgnoreCase)) && - !item.IsImported - ) - { - // We're not allowed to remove an item from a collection while - // the collection is being enumerated. So we have to track it - // in a separate list. - itemsToRemove.AddItem(item); - } - } - } - foreach (BuildItem itemToRemove in itemsToRemove) - { - itemToRemove.ParentPersistedItemGroup.ParentProject.RemoveItem(itemToRemove); - } - } - - #endregion - } -} diff --git a/src/Deprecated/Engine/Choose/When.cs b/src/Deprecated/Engine/Choose/When.cs deleted file mode 100644 index d995c8833ac..00000000000 --- a/src/Deprecated/Engine/Choose/When.cs +++ /dev/null @@ -1,292 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections; -using System.Xml; - -using Microsoft.Build.BuildEngine.Shared; - -using error = Microsoft.Build.BuildEngine.Shared.ErrorUtilities; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// Class representing a When block (also used to represent the Otherwise - /// block on a Choose). - /// - internal class When - { - #region Member Data - - public enum Options - { - ProcessWhen, - ProcessOtherwise, - }; - - private GroupingCollection propertyAndItemLists = null; - private Project parentProject = null; - - // This is the "Condition" attribute on the element above. - private XmlAttribute conditionAttribute = null; - - #endregion - - #region Constructors - - /// - /// Constructor for the When block. Parses the contents of the When block (property - /// groups, item groups, and nested chooses) and stores them. - /// - /// - /// - /// DavidLe - /// - /// - /// - /// - /// - /// stack overflow guard - internal When( - Project parentProject, - GroupingCollection parentGroupingCollection, - XmlElement whenElement, - bool importedFromAnotherProject, - Options options, - int nestingDepth - ) - { - // Make sure the node has been given to us. - error.VerifyThrow(whenElement != null, "Need valid (non-null) element."); - - // Make sure this really is the node. - error.VerifyThrow(whenElement.Name == XMakeElements.when || whenElement.Name == XMakeElements.otherwise, - "Expected <{0}> or <{1}> element; received <{2}> element.", - XMakeElements.when, XMakeElements.otherwise, whenElement.Name); - - this.propertyAndItemLists = new GroupingCollection(parentGroupingCollection); - this.parentProject = parentProject; - - string elementName = ((options == Options.ProcessWhen) ? XMakeElements.when : XMakeElements.otherwise); - - if (options == Options.ProcessWhen) - { - conditionAttribute = ProjectXmlUtilities.GetConditionAttribute(whenElement, /*verify sole attribute*/ true); - ProjectErrorUtilities.VerifyThrowInvalidProject(conditionAttribute != null, whenElement, "MissingCondition", XMakeElements.when); - } - else - { - ProjectXmlUtilities.VerifyThrowProjectNoAttributes(whenElement); - } - - ProcessWhenChildren(whenElement, parentProject, importedFromAnotherProject, nestingDepth); - } - #endregion - - #region Properties - - /// - /// Property containing the condition for the When clause. - /// - /// - /// - /// DavidLe - /// string - internal string Condition - { - get - { - return (this.conditionAttribute == null) ? String.Empty : this.conditionAttribute.Value; - } - } - - /// - /// Property containing the condition for the When clause. - /// - /// - /// - /// DavidLe - /// string - internal XmlAttribute ConditionAttribute - { - get - { - return this.conditionAttribute; - } - } - #endregion - - /// - /// The collection of all sub-groups (item/property groups and chooses) inside this When - /// - internal GroupingCollection PropertyAndItemLists - { - get - { - return this.propertyAndItemLists; - } - } - - #region Methods - - /// - /// Helper method for processing the children of a When. Only parses Choose, - /// PropertyGroup, and ItemGroup. All other tags result in an error. - /// - /// - /// - /// DavidLe - /// - /// - /// - /// - /// Number of parent <Choose> elements this is nested inside - private void ProcessWhenChildren - ( - XmlElement parentNode, - Project parentProjectForChildren, bool importedFromAnotherProject, - int nestingDepth - ) - { - // Loop through the child nodes of the element. - foreach (XmlNode whenChildNode in parentNode) - { - switch (whenChildNode.NodeType) - { - // Handle XML comments under the node (just ignore them). - case XmlNodeType.Comment: - // fall through - case XmlNodeType.Whitespace: - // ignore whitespace - break; - - case XmlNodeType.Element: - { - // Make sure this element doesn't have a custom namespace - ProjectXmlUtilities.VerifyThrowProjectValidNamespace((XmlElement)whenChildNode); - - // The only three types of child nodes that a element can contain - // are , and . - switch (whenChildNode.Name) - { - case XMakeElements.itemGroup: - BuildItemGroup newItemGroup = new BuildItemGroup((XmlElement)whenChildNode, importedFromAnotherProject, parentProjectForChildren); - this.propertyAndItemLists.InsertAtEnd(newItemGroup); - break; - - // Process the element. - case XMakeElements.propertyGroup: - BuildPropertyGroup newPropertyGroup = new BuildPropertyGroup(parentProjectForChildren, (XmlElement)whenChildNode, importedFromAnotherProject); - newPropertyGroup.EnsureNoReservedProperties(); - this.propertyAndItemLists.InsertAtEnd(newPropertyGroup); - break; - - // Process the element. - case XMakeElements.choose: - Choose newChoose = new Choose(parentProjectForChildren, this.PropertyAndItemLists, (XmlElement)whenChildNode, - importedFromAnotherProject, nestingDepth); - this.propertyAndItemLists.InsertAtEnd(newChoose); - break; - - default: - { - ProjectXmlUtilities.ThrowProjectInvalidChildElement(whenChildNode); - break; - } - } - } - break; - - default: - { - ProjectXmlUtilities.ThrowProjectInvalidChildElement(whenChildNode); - break; - } - } - } - } - - /// - /// Evaluates a When clause. Checks if the condition is true, and if it is, - /// applies all of the contained property group, item lists, and import statements. - /// Returns true if the When clause is process (because the condition is true), false - /// otherwise. - /// - /// - /// - /// DavidLe - /// - /// - /// bool - internal bool EvaluateCondition - ( - BuildPropertyGroup parentPropertyBag, - Hashtable conditionedPropertiesTable - ) - { - if ( - (this.Condition != null) - && - !Utilities.EvaluateCondition(this.Condition, this.ConditionAttribute, - new Expander(parentPropertyBag, parentProject.EvaluatedItemsByName), - conditionedPropertiesTable, ParserOptions.AllowProperties, this.parentProject.ParentEngine.LoggingServices, this.parentProject.ProjectBuildEventContext) - ) - { - return false; - } - - return true; - } - - /// - /// Evaluates a When clause. Checks if the condition is true, and if it is, - /// applies all of the contained property group, item lists, and import statements. - /// Returns true if the When clause is process (because the condition is true), false - /// otherwise. - /// - /// - /// - /// DavidLe - /// - /// - /// - /// - /// - /// bool - internal void Evaluate - ( - BuildPropertyGroup parentPropertyBag, - bool ignoreCondition, bool honorCondition, - Hashtable conditionedPropertiesTable, - ProcessingPass pass - ) - { - foreach (IItemPropertyGrouping propOrItem in this.propertyAndItemLists) - { - // This is where we selectively evaluate PropertyGroups or Itemgroups during their respective passes. - // Once we go to a one-pass model, we'll simple spin through all the children and evaluate. - if (propOrItem is BuildPropertyGroup && - pass == ProcessingPass.Pass1) - { - ((BuildPropertyGroup)propOrItem).Evaluate(parentPropertyBag, conditionedPropertiesTable, pass); - } - else if (propOrItem is BuildItemGroup && - pass == ProcessingPass.Pass2) - { - ((BuildItemGroup)propOrItem).Evaluate(parentPropertyBag, parentProject.EvaluatedItemsByName, ignoreCondition, honorCondition, pass); - } - else if (propOrItem is Choose) - { - ((Choose)propOrItem).Evaluate(parentPropertyBag, ignoreCondition, honorCondition, conditionedPropertiesTable, pass); - } - } - } - - #endregion - } -} diff --git a/src/Deprecated/Engine/Collections/CopyOnWriteHashtable.cs b/src/Deprecated/Engine/Collections/CopyOnWriteHashtable.cs deleted file mode 100644 index 1913af98416..00000000000 --- a/src/Deprecated/Engine/Collections/CopyOnWriteHashtable.cs +++ /dev/null @@ -1,247 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// A hashtable wrapper that defers copying until the data is written. - /// - internal sealed class CopyOnWriteHashtable : IDictionary, ICloneable - { - // Either of these can act as the true backing writeableData. - private Hashtable writeableData = null; - - // These are references to someone else's backing writeableData. - private Hashtable readonlyData = null; - - // This is used to synchronize access to the readonlyData and writeableData fields. - private object sharedLock; - - // Carry around the StringComparer when possible to make Clear less expensive. - private StringComparer stringComparer = null; - - #region Construct - /// - /// Construct as a traditional data-backed hashtable. - /// - /// - internal CopyOnWriteHashtable(StringComparer stringComparer) - : this(0, stringComparer) - { - this.sharedLock = new object(); - } - - /// - /// Construct with specified initial capacity. If the capacity is known - /// up front, specifying it avoids unnecessary rehashing operations - /// - internal CopyOnWriteHashtable(int capacity, StringComparer stringComparer) - { - ErrorUtilities.VerifyThrowArgumentNull(stringComparer, nameof(stringComparer)); - this.sharedLock = new object(); - - if (capacity == 0) - { - // Actually 0 tells the Hashtable to use its default, but let's not rely on that - writeableData = new Hashtable(stringComparer); - } - else - { - writeableData = new Hashtable(capacity, stringComparer); - } - readonlyData = null; - this.stringComparer = stringComparer; - } - - /// - /// Construct over an IDictionary instance. - /// - /// - /// The string comparer to use. - internal CopyOnWriteHashtable(IDictionary dictionary, StringComparer stringComparer) - { - ErrorUtilities.VerifyThrowArgumentNull(dictionary, nameof(dictionary)); - ErrorUtilities.VerifyThrowArgumentNull(stringComparer, nameof(stringComparer)); - - this.sharedLock = new object(); - CopyOnWriteHashtable source = dictionary as CopyOnWriteHashtable; - if (source != null) - { - if (source.stringComparer.GetHashCode() == stringComparer.GetHashCode()) - { - // If we're copying another CopyOnWriteHashtable then we can defer the clone until later. - ConstructFrom(source); - return; - } - else - { - // Technically, it would be legal to fall through here and let a new hashtable be constructed. - // However, Engine is supposed to use consistent case comparisons everywhere and so, for us, - // this means a bug in the engine code somewhere. - throw new InternalErrorException("Bug: Changing the case-sensitiveness of a copied hash-table."); - } - } - - // Can't defer this because we don't control what gets written to the dictionary exogenously. - writeableData = new Hashtable(dictionary, stringComparer); - readonlyData = null; - this.stringComparer = stringComparer; - } - - /// - /// Construct a shallow copy over another instance of this class. - /// - /// - private CopyOnWriteHashtable(CopyOnWriteHashtable that) - { - this.sharedLock = new object(); - ConstructFrom(that); - } - - /// - /// Implementation of construction logic. - /// - /// - private void ConstructFrom(CopyOnWriteHashtable that) - { - lock (that.sharedLock) - { - this.writeableData = null; - - // If the source it was writeable, need to transform it into - // read-only because we don't want subsequent writes to bleed through. - if (that.writeableData != null) - { - that.readonlyData = that.writeableData; - that.writeableData = null; - } - - this.readonlyData = that.readonlyData; - this.stringComparer = that.stringComparer; - } - } - - /// - /// Whether or not this CopyOnWriteHashtable is currently a shallow or deep copy. - /// This state can change from true->false when this hashtable is written to. - /// - internal bool IsShallowCopy - { - get - { - return this.readonlyData != null; - } - } - #endregion - #region Pass-through Hashtable methods. - public bool Contains(Object key) { return ReadOperation.Contains(key); } - public void Add(Object key, Object value) { WriteOperation.Add(key, value); } - public void Clear() - { - lock (sharedLock) - { - ErrorUtilities.VerifyThrow(stringComparer != null, "Should have a valid string comparer."); - - writeableData = new Hashtable(stringComparer); - readonlyData = null; - } - } - - IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable)ReadOperation).GetEnumerator(); } - public IDictionaryEnumerator GetEnumerator() { return ReadOperation.GetEnumerator(); } - public void Remove(Object key) { WriteOperation.Remove(key); } - public bool IsFixedSize { get { return ReadOperation.IsFixedSize; } } - public bool IsReadOnly { get { return ReadOperation.IsFixedSize; } } - public ICollection Keys { get { return ReadOperation.Keys; } } - public ICollection Values { get { return ReadOperation.Values; } } - public void CopyTo(Array array, int arrayIndex) { ReadOperation.CopyTo(array, arrayIndex); } - public int Count { get { return ReadOperation.Count; } } - public bool IsSynchronized { get { return ReadOperation.IsSynchronized; } } - public Object SyncRoot { get { return ReadOperation.SyncRoot; } } - public bool ContainsKey(Object key) { return ReadOperation.Contains(key); } - - public Object this[Object key] - { - get - { - return ReadOperation[key]; - } - set - { - lock (sharedLock) - { - if (writeableData != null) - { - writeableData[key] = value; - } - else - { - // Setting to exactly the same value? Skip the the Clone in this case. - if (readonlyData[key] != value || (!readonlyData.ContainsKey(key))) - { - WriteOperation[key] = value; - } - } - } - } - } - #endregion - - /// - /// Clone this. - /// - /// - public Object Clone() - { - return new CopyOnWriteHashtable(this); - } - - /// - /// Returns a hashtable instance for reading from. - /// - private Hashtable ReadOperation - { - get - { - lock (sharedLock) - { - if (readonlyData != null) - { - return readonlyData; - } - - return writeableData; - } - } - } - - /// - /// Returns a hashtable instance for writting to. - /// Clones the readonly hashtable if necessary to create a writeable version. - /// - private Hashtable WriteOperation - { - get - { - lock (sharedLock) - { - if (writeableData == null) - { - writeableData = (Hashtable)readonlyData.Clone(); - readonlyData = null; - } - - return writeableData; - } - } - } - } -} diff --git a/src/Deprecated/Engine/Collections/DualQueue.cs b/src/Deprecated/Engine/Collections/DualQueue.cs deleted file mode 100644 index c5f80e33746..00000000000 --- a/src/Deprecated/Engine/Collections/DualQueue.cs +++ /dev/null @@ -1,326 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System.Threading; -using System.Collections.Generic; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class provides a multiple-writer, single-reader queue. This queue can be written to - /// by multiple threads at a time, but it is designed to be only read by a single thread. - /// The way is works is as follows: we have two queues, one for reading from, and one for - /// writing to. The writing queue is protected by a mutex so that multiple threads can write to - /// it. When a reading thread wants to read all the queued items, we swap the writing queue - /// for another (empty) one. The writing queue then becomes the reading queue, and the empty - /// queue becomes the new writing queue. This allows the reader to safely read from the swapped - /// out queue without regard to new items being written to the other queue. - /// - /// - internal sealed class DualQueue - { - #region Constructors - - /// - /// Default constructor. - /// - internal DualQueue() - { - this.queueReadyEvent = new ManualResetEvent(false /* event is reset initially */); - this.queueEmptyEvent = null; - this.queueLock = new object(); - this.backingQueueA = new Queue(); - this.backingQueueB = new Queue(); - - this.queue = this.backingQueueA; - } - - #endregion - - #region Properties - /// - /// Event indicating that there are items in the queue - /// - internal WaitHandle QueueReadyEvent - { - get - { - return this.queueReadyEvent; - } - } - - /// - /// Event indicating that the queue is empty - /// - internal WaitHandle QueueEmptyEvent - { - get - { - // Lazily allocate the queue empty event - lock (queueLock) - { - if (this.queueEmptyEvent == null) - { - this.queueEmptyEvent = new ManualResetEvent(false /* event is reset initially */); - } - } - return this.queueEmptyEvent; - } - } - - /// - /// Primairly used for testing to get the count of items posted to the queue - /// - /// - internal int Count - { - get - { - // Sum both as the number of items is the sum of items in both queues - Queue readingQueue = backingQueueB; - - // figure out the current reading queue - if (queue == backingQueueB) - { - readingQueue = backingQueueA; - } - - return readingQueue.Count + writingQueueCount; - } - } - - /// - /// The count of items in the writing queue. Used to decide if the queue is backing up - /// - /// - internal int WritingQueueCount - { - get - { - return writingQueueCount; - } - } - - #endregion - - #region Methods - - /// - /// Adds the given item to the queue. - /// - /// - internal void Enqueue(T item) - { - lock (queueLock) - { - // queue the event - queue.Enqueue(item); - - writingQueueCount++; - - // if the queue transitions from empty to non-empty reset the queue empty event and raise queue ready event - if (writingQueueCount == 1) - { - // raise the event saying queue contains data - queueReadyEvent.Set(); - - // reset queue empty - queueEmptyEvent?.Reset(); - } - } - } - - /// - /// Adds the given items to the queue. - /// - /// - internal void EnqueueArray(T[] items) - { - lock (queueLock) - { - // queue the event - foreach (T item in items) - { - queue.Enqueue(item); - } - - writingQueueCount += items.Length; - - // if the queue transitions from empty to non-empty reset the queue empty event - if (writingQueueCount == items.Length) - { - // raise the event saying queue contains data - queueReadyEvent.Set(); - - // reset queue empty - queueEmptyEvent?.Reset(); - } - } - } - - /// - /// Clear the contents of the queue - /// - internal void Clear() - { - lock (queueLock) - { - backingQueueA.Clear(); - backingQueueB.Clear(); - writingQueueCount = 0; - // reset queue ready event because the queue is now empty - queueReadyEvent.Reset(); - // raise queue empty event because the queue is now empty - queueEmptyEvent?.Set(); - } - } - - /// - /// Gets an item off the queue. - /// - /// The top item off the queue, or null if queue is empty. - internal T Dequeue() - { - return GetTopItem(true); - } - - /// - /// Get a pointer to the top item without dequeueing it - /// - /// The top item off the queue, or null if queue is empty. - internal T Peek() - { - return GetTopItem(false); - } - - /// - /// Finds the top item in the queue. If passed in argument is true the top value is dequeued - /// - /// The top item off the queue, or null if queue is empty. - private T GetTopItem(bool dequeue) - { - Queue readingQueue = GetReadingQueue(); - T item = default(T); - - if (readingQueue.Count > 0) - { - item = dequeue ? readingQueue.Dequeue() : readingQueue.Peek(); - } - - // if the reading queue is now empty - if (readingQueue.Count == 0) - { - // wait until the current writer (if any) is done with the posting queue - lock (queueLock) - { - // confirm both queues are now empty -- this check is important because - // a writer may have added to the queue while we were waiting for a lock - if ((backingQueueA.Count == 0) && (backingQueueB.Count == 0)) - { - // signal there are no more items to read - queueReadyEvent.Reset(); - - queueEmptyEvent?.Set(); - } - } - } - - return item; - } - - /// - /// Returns one of the two behind-the-scenes queues that is not being - /// used for posting into. - /// - /// The queue to read from. - private Queue GetReadingQueue() - { - Queue readingQueue = backingQueueB; - - // figure out the current reading queue - if (queue == backingQueueB) - { - readingQueue = backingQueueA; - } - - // if the current reading queue is non-empty, return it; otherwise, if - // the current posting queue is non-empty, swap it for the reading queue - // and return it instead; if both are empty, just return the current reading - // queue -- this logic allows us to lock only when strictly necessary - if (readingQueue.Count == 0) - { - lock (queueLock) - { - if (queue.Count > 0) - { - Queue postingQueue = queue; - queue = readingQueue; - readingQueue = postingQueue; - - writingQueueCount = 0; - } - } - } - - return readingQueue; - } - - /// - /// Primairly used for unit tests to verify a item is in one of the internal queues - /// - /// Items to check for in the two internal queues - /// - internal bool Contains(T item) - { - // The dual queue in general contains an item if the item exists - // in one or even both of the backing queues - return backingQueueA.Contains(item) || backingQueueB.Contains(item); - } - #endregion - - #region Data - - /// - /// This event is set when the queue contains items to read. - /// - private ManualResetEvent queueReadyEvent; - - /// - /// This event is set when the queue is empty - /// - private ManualResetEvent queueEmptyEvent; - - /// - /// This object protects the posting queue. - /// - private object queueLock; - - /// - /// This queue reference serves as the "posting queue". This queue reference - /// points to one of the two queues that are swapped behind the scenes. - /// - private Queue queue; - - /// - /// One of the two behind-the-scenes queues that are swapped. - /// - private Queue backingQueueA; - - /// - /// One of the two behind-the-scenes queues that are swapped. - /// - private Queue backingQueueB; - - /// - /// Count of the current writer queue - we only own the reader queue in Count so we have to keep - /// the count for the writer queue separately. - /// - private int writingQueueCount; - - #endregion - } -} diff --git a/src/Deprecated/Engine/Collections/HashTableUtility.cs b/src/Deprecated/Engine/Collections/HashTableUtility.cs deleted file mode 100644 index f143143524e..00000000000 --- a/src/Deprecated/Engine/Collections/HashTableUtility.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections.Generic; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// Tools for working with Hashtables. - /// - internal static class HashTableUtility - { - /// - /// Compares the given hashtables. - /// - /// SumedhK - /// May be null - /// May be null - /// - /// -1, if first hashtable is "less than" the second one - /// 0, if hashtables have identical keys and equivalent (case-insensitive) values - /// +1, if first hashtable is "greater than" the second one - /// - internal static int Compare(Dictionary h1, Dictionary h2) - { - if (h1 == h2) // eg null - { - return 0; - } - else if (h1 == null) - { - return -1; - } - else if (h2 == null) - { - return +1; - } - - int comparison = Math.Sign(h1.Count - h2.Count); - - if (comparison == 0) - { - foreach (KeyValuePair h1Entry in h1) - { - // NOTE: String.Compare() allows null values -- any string, - // including the empty string (""), compares greater than a - // null reference, and two null references compare equal - comparison = String.Compare(h1Entry.Value, h2[h1Entry.Key], - StringComparison.OrdinalIgnoreCase); - - if (comparison != 0) - { - break; - } - } - } - - return comparison; - } - } -} diff --git a/src/Deprecated/Engine/Conditionals/AndExpressionNode.cs b/src/Deprecated/Engine/Conditionals/AndExpressionNode.cs deleted file mode 100644 index f6b4714046f..00000000000 --- a/src/Deprecated/Engine/Conditionals/AndExpressionNode.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// Performs logical AND on children - /// Does not update conditioned properties table - /// - internal sealed class AndExpressionNode : OperatorExpressionNode - { - /// - /// Evaluate as boolean - /// - internal override bool BoolEvaluate(ConditionEvaluationState state) - { - ProjectErrorUtilities.VerifyThrowInvalidProject - (LeftChild.CanBoolEvaluate(state), - state.conditionAttribute, - "ExpressionDoesNotEvaluateToBoolean", - LeftChild.GetUnexpandedValue(state), - LeftChild.GetExpandedValue(state), - state.parsedCondition); - - if (!LeftChild.BoolEvaluate(state)) - { - // Short circuit - return false; - } - else - { - ProjectErrorUtilities.VerifyThrowInvalidProject - (RightChild.CanBoolEvaluate(state), - state.conditionAttribute, - "ExpressionDoesNotEvaluateToBoolean", - RightChild.GetUnexpandedValue(state), - RightChild.GetExpandedValue(state), - state.parsedCondition); - - return RightChild.BoolEvaluate(state); - } - } - - #region REMOVE_COMPAT_WARNING - private bool possibleAndCollision = true; - internal override bool PossibleAndCollision - { - set { this.possibleAndCollision = value; } - get { return this.possibleAndCollision; } - } - #endregion - } -} diff --git a/src/Deprecated/Engine/Conditionals/CharacterUtilities.cs b/src/Deprecated/Engine/Conditionals/CharacterUtilities.cs deleted file mode 100644 index 9921f9a13ff..00000000000 --- a/src/Deprecated/Engine/Conditionals/CharacterUtilities.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -namespace Microsoft.Build.BuildEngine -{ - internal static class CharacterUtilities - { - internal static bool IsNumberStart(char candidate) - { - return candidate == '+' || candidate == '-' || candidate == '.' || char.IsDigit(candidate); - } - - internal static bool IsSimpleStringStart(char candidate) - { - return candidate == '_' || char.IsLetter(candidate); - } - - internal static bool IsSimpleStringChar(char candidate) - { - return IsSimpleStringStart(candidate) || char.IsDigit(candidate); - } - - internal static bool IsHexAlphabetic(char candidate) - { - return candidate == 'a' || candidate == 'b' || candidate == 'c' || candidate == 'd' || candidate == 'e' || candidate == 'f' || - candidate == 'A' || candidate == 'B' || candidate == 'C' || candidate == 'D' || candidate == 'E' || candidate == 'F'; - } - - internal static bool IsHexDigit(char candidate) - { - return char.IsDigit(candidate) || IsHexAlphabetic(candidate); - } - } -} diff --git a/src/Deprecated/Engine/Conditionals/ConditionEvaluationState.cs b/src/Deprecated/Engine/Conditionals/ConditionEvaluationState.cs deleted file mode 100644 index df9a96b548c..00000000000 --- a/src/Deprecated/Engine/Conditionals/ConditionEvaluationState.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System.Collections; -using System.Xml; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// All the state necessary for the evaluation of conditionals so that the expression tree - /// is stateless and reusable - /// - internal struct ConditionEvaluationState - { - internal XmlAttribute conditionAttribute; - internal Expander expanderToUse; - internal Hashtable conditionedPropertiesInProject; - internal string parsedCondition; - - internal ConditionEvaluationState(XmlAttribute conditionAttribute, Expander expanderToUse, Hashtable conditionedPropertiesInProject, string parsedCondition) - { - this.conditionAttribute = conditionAttribute; - this.expanderToUse = expanderToUse; - this.conditionedPropertiesInProject = conditionedPropertiesInProject; - this.parsedCondition = parsedCondition; - } - } -} diff --git a/src/Deprecated/Engine/Conditionals/EqualExpressionNode.cs b/src/Deprecated/Engine/Conditionals/EqualExpressionNode.cs deleted file mode 100644 index eca80addba0..00000000000 --- a/src/Deprecated/Engine/Conditionals/EqualExpressionNode.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// Compares for equality - /// - internal sealed class EqualExpressionNode : MultipleComparisonNode - { - /// - /// Compare numbers - /// - protected override bool Compare(double left, double right) - { - return left == right; - } - - /// - /// Compare booleans - /// - protected override bool Compare(bool left, bool right) - { - return left == right; - } - - /// - /// Compare strings - /// - protected override bool Compare(string left, string right) - { - return String.Equals(left, right, StringComparison.OrdinalIgnoreCase); - } - } -} diff --git a/src/Deprecated/Engine/Conditionals/FunctionCallExpressionNode.cs b/src/Deprecated/Engine/Conditionals/FunctionCallExpressionNode.cs deleted file mode 100644 index 66cc6c8674e..00000000000 --- a/src/Deprecated/Engine/Conditionals/FunctionCallExpressionNode.cs +++ /dev/null @@ -1,157 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System.Collections; -using System.Collections.Generic; -using System.IO; -using System; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// Evaluates a function expression, such as "Exists('foo')" - /// - internal sealed class FunctionCallExpressionNode : OperatorExpressionNode - { - private ArrayList arguments; - private string functionName; - - private FunctionCallExpressionNode() { } - - internal FunctionCallExpressionNode(string functionName, ArrayList arguments) - { - this.functionName = functionName; - this.arguments = arguments; - } - - /// - /// Evaluate node as boolean - /// - internal override bool BoolEvaluate(ConditionEvaluationState state) - { - if (String.Equals(functionName, "exists", StringComparison.OrdinalIgnoreCase)) - { - // Check we only have one argument - VerifyArgumentCount(1, state); - - // Expand properties and items, and verify the result is an appropriate scalar - string expandedValue = ExpandArgumentForScalarParameter("exists", (GenericExpressionNode)arguments[0], state); - - if (Project.PerThreadProjectDirectory != null && !String.IsNullOrEmpty(expandedValue)) - { - try - { - expandedValue = Path.GetFullPath(Path.Combine(Project.PerThreadProjectDirectory, expandedValue)); - } - catch (Exception e) // Catching Exception, but rethrowing unless it's an IO related exception. - { - if (ExceptionHandling.NotExpectedException(e)) - { - throw; - } - - // Ignore invalid characters or path related exceptions - - // We will ignore the PathTooLong exception caused by GetFullPath becasue in single proc this code - // is not executed and the condition is just evaluated to false as File.Exists and Directory.Exists does not throw in this situation. - // To be consistant with that we will return a false in this case also. - // DevDiv Bugs: 46035 - - return false; - } - } - - // Both Exists functions return false if the value is null or empty - return File.Exists(expandedValue) || Directory.Exists(expandedValue); - } - else if (String.Equals(functionName, "HasTrailingSlash", StringComparison.OrdinalIgnoreCase)) - { - // Check we only have one argument - VerifyArgumentCount(1, state); - - // Expand properties and items, and verify the result is an appropriate scalar - string expandedValue = ExpandArgumentForScalarParameter("HasTrailingSlash", (GenericExpressionNode)arguments[0], state); - - // Is the last character a backslash? - if (expandedValue.Length != 0) - { - char lastCharacter = expandedValue[expandedValue.Length - 1]; - // Either back or forward slashes satisfy the function: this is useful for URL's - return lastCharacter == Path.DirectorySeparatorChar || lastCharacter == Path.AltDirectorySeparatorChar; - } - else - { - return false; - } - } - // We haven't implemented any other "functions" - else - { - ProjectErrorUtilities.VerifyThrowInvalidProject( - false, - state.conditionAttribute, - "UndefinedFunctionCall", - state.parsedCondition, - this.functionName); - - return false; - } - } - - /// - /// Expands properties and items in the argument, and verifies that the result is consistent - /// with a scalar parameter type. - /// - /// Function name for errors - /// Argument to be expanded - /// Scalar result - /// danmose - private string ExpandArgumentForScalarParameter(string function, GenericExpressionNode argumentNode, ConditionEvaluationState state) - { - string argument = argumentNode.GetUnexpandedValue(state); - - List items = state.expanderToUse.ExpandAllIntoTaskItems(argument, state.conditionAttribute); - - string expandedValue = String.Empty; - - if (items.Count == 0) - { - // Empty argument, that's fine. - } - else if (items.Count == 1) - { - expandedValue = items[0].ItemSpec; - } - else // too many items for the function - { - // We only allow a single item to be passed into a scalar parameter. - ProjectErrorUtilities.VerifyThrowInvalidProject(false, - state.conditionAttribute, - "CannotPassMultipleItemsIntoScalarFunction", function, argument, - state.expanderToUse.ExpandAllIntoString(argument, state.conditionAttribute)); - } - - return expandedValue; - } - - /// - /// Check that the number of function arguments is correct. - /// - /// - private void VerifyArgumentCount(int expected, ConditionEvaluationState state) - { - ProjectErrorUtilities.VerifyThrowInvalidProject - (arguments.Count == expected, - state.conditionAttribute, - "IncorrectNumberOfFunctionArguments", - state.parsedCondition, - arguments.Count, - expected); - } - } -} diff --git a/src/Deprecated/Engine/Conditionals/GenericExpressionNode.cs b/src/Deprecated/Engine/Conditionals/GenericExpressionNode.cs deleted file mode 100644 index 2fcb5fc2cc8..00000000000 --- a/src/Deprecated/Engine/Conditionals/GenericExpressionNode.cs +++ /dev/null @@ -1,85 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// Base class for all expression nodes. - /// - internal abstract class GenericExpressionNode - { - internal abstract bool CanBoolEvaluate(ConditionEvaluationState state); - internal abstract bool CanNumericEvaluate(ConditionEvaluationState state); - internal abstract bool BoolEvaluate(ConditionEvaluationState state); - internal abstract double NumericEvaluate(ConditionEvaluationState state); - - /// - /// Value after any item and property expressions are expanded - /// - /// - internal abstract string GetExpandedValue(ConditionEvaluationState state); - - /// - /// Value before any item and property expressions are expanded - /// - /// - internal abstract string GetUnexpandedValue(ConditionEvaluationState state); - - /// - /// If any expression nodes cache any state for the duration of evaluation, - /// now's the time to clean it up - /// - internal abstract void ResetState(); - - /// - /// The main evaluate entry point for expression trees - /// - /// - /// - internal bool Evaluate(ConditionEvaluationState state) - { - ProjectErrorUtilities.VerifyThrowInvalidProject( - CanBoolEvaluate(state), - state.conditionAttribute, - "ConditionNotBooleanDetail", - state.parsedCondition, - GetExpandedValue(state)); - - return BoolEvaluate(state); - } - - #region REMOVE_COMPAT_WARNING - internal virtual bool PossibleAndCollision - { - set { /* do nothing */ } - get { return false; } - } - - internal virtual bool PossibleOrCollision - { - set { /* do nothing */ } - get { return false; } - } - - internal bool PotentialAndOrConflict() - { - // The values of the functions are assigned to boolean locals - // in order to force evaluation of the functions even when the - // first one returns false - bool detectOr = DetectOr(); - bool detectAnd = DetectAnd(); - return detectOr && detectAnd; - } - - internal abstract bool DetectOr(); - internal abstract bool DetectAnd(); - #endregion - - } -} diff --git a/src/Deprecated/Engine/Conditionals/GreaterThanExpressionNode.cs b/src/Deprecated/Engine/Conditionals/GreaterThanExpressionNode.cs deleted file mode 100644 index 9f2a5084ae0..00000000000 --- a/src/Deprecated/Engine/Conditionals/GreaterThanExpressionNode.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -namespace Microsoft.Build.BuildEngine -{ - /// - /// Compares for left > right - /// - internal sealed class GreaterThanExpressionNode : NumericComparisonExpressionNode - { - /// - /// Compare numerically - /// - protected override bool Compare(double left, double right) - { - return left > right; - } - } -} diff --git a/src/Deprecated/Engine/Conditionals/GreaterThanOrEqualExpressionNode.cs b/src/Deprecated/Engine/Conditionals/GreaterThanOrEqualExpressionNode.cs deleted file mode 100644 index d601ae68143..00000000000 --- a/src/Deprecated/Engine/Conditionals/GreaterThanOrEqualExpressionNode.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -namespace Microsoft.Build.BuildEngine -{ - /// - /// Compares for left >= right - /// - internal sealed class GreaterThanOrEqualExpressionNode : NumericComparisonExpressionNode - { - /// - /// Compare numerically - /// - protected override bool Compare(double left, double right) - { - return left >= right; - } - } -} diff --git a/src/Deprecated/Engine/Conditionals/LessThanExpressionNode.cs b/src/Deprecated/Engine/Conditionals/LessThanExpressionNode.cs deleted file mode 100644 index 0b9ef6853ee..00000000000 --- a/src/Deprecated/Engine/Conditionals/LessThanExpressionNode.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -namespace Microsoft.Build.BuildEngine -{ - /// - /// Compares for left < right - /// - internal sealed class LessThanExpressionNode : NumericComparisonExpressionNode - { - /// - /// Compare numerically - /// - protected override bool Compare(double left, double right) - { - return left < right; - } - } -} diff --git a/src/Deprecated/Engine/Conditionals/LessThanOrEqualExpressionNode.cs b/src/Deprecated/Engine/Conditionals/LessThanOrEqualExpressionNode.cs deleted file mode 100644 index 14a0a6c2e62..00000000000 --- a/src/Deprecated/Engine/Conditionals/LessThanOrEqualExpressionNode.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -namespace Microsoft.Build.BuildEngine -{ - /// - /// Compares for left <= right - /// - internal sealed class LessThanOrEqualExpressionNode : NumericComparisonExpressionNode - { - /// - /// Compare numerically - /// - protected override bool Compare(double left, double right) - { - return left <= right; - } - } -} diff --git a/src/Deprecated/Engine/Conditionals/MultipleComparisonExpressionNode.cs b/src/Deprecated/Engine/Conditionals/MultipleComparisonExpressionNode.cs deleted file mode 100644 index ac037127800..00000000000 --- a/src/Deprecated/Engine/Conditionals/MultipleComparisonExpressionNode.cs +++ /dev/null @@ -1,105 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// Evaluates as boolean and evaluates children as boolean, numeric, or string. - /// Order in which comparisons are attempted is numeric, boolean, then string. - /// Updates conditioned properties table. - /// - internal abstract class MultipleComparisonNode : OperatorExpressionNode - { - private bool conditionedPropertiesUpdated = false; - - /// - /// Compare numbers - /// - protected abstract bool Compare(double left, double right); - - /// - /// Compare booleans - /// - protected abstract bool Compare(bool left, bool right); - - /// - /// Compare strings - /// - protected abstract bool Compare(string left, string right); - - /// - /// Evaluates as boolean and evaluates children as boolean, numeric, or string. - /// Order in which comparisons are attempted is numeric, boolean, then string. - /// Updates conditioned properties table. - /// - internal override bool BoolEvaluate(ConditionEvaluationState state) - { - ProjectErrorUtilities.VerifyThrowInvalidProject - (LeftChild != null && RightChild != null, - state.conditionAttribute, - "IllFormedCondition", - state.parsedCondition); - - if (LeftChild.CanNumericEvaluate(state) && RightChild.CanNumericEvaluate(state)) - { - return Compare(LeftChild.NumericEvaluate(state), RightChild.NumericEvaluate(state)); - } - else if (LeftChild.CanBoolEvaluate(state) && RightChild.CanBoolEvaluate(state)) - { - return Compare(LeftChild.BoolEvaluate(state), RightChild.BoolEvaluate(state)); - } - else // string comparison - { - string leftExpandedValue = LeftChild.GetExpandedValue(state); - string rightExpandedValue = RightChild.GetExpandedValue(state); - - ProjectErrorUtilities.VerifyThrowInvalidProject - (leftExpandedValue != null && rightExpandedValue != null, - state.conditionAttribute, - "IllFormedCondition", - state.parsedCondition); - - if (!conditionedPropertiesUpdated) - { - string leftUnexpandedValue = LeftChild.GetUnexpandedValue(state); - string rightUnexpandedValue = RightChild.GetUnexpandedValue(state); - - if (leftUnexpandedValue != null) - { - Utilities.UpdateConditionedPropertiesTable - (state.conditionedPropertiesInProject, - leftUnexpandedValue, - rightExpandedValue); - } - - if (rightUnexpandedValue != null) - { - Utilities.UpdateConditionedPropertiesTable - (state.conditionedPropertiesInProject, - rightUnexpandedValue, - leftExpandedValue); - } - - conditionedPropertiesUpdated = true; - } - - return Compare(leftExpandedValue, rightExpandedValue); - } - } - - /// - /// Reset temporary state - /// - internal override void ResetState() - { - base.ResetState(); - conditionedPropertiesUpdated = false; - } - } -} diff --git a/src/Deprecated/Engine/Conditionals/NotEqualExpressionNode.cs b/src/Deprecated/Engine/Conditionals/NotEqualExpressionNode.cs deleted file mode 100644 index 17fc5e7c863..00000000000 --- a/src/Deprecated/Engine/Conditionals/NotEqualExpressionNode.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// Compares for inequality - /// - internal sealed class NotEqualExpressionNode : MultipleComparisonNode - { - /// - /// Compare numbers - /// - protected override bool Compare(double left, double right) - { - return left != right; - } - - /// - /// Compare booleans - /// - protected override bool Compare(bool left, bool right) - { - return left != right; - } - - /// - /// Compare strings - /// - protected override bool Compare(string left, string right) - { - return !String.Equals(left, right, StringComparison.OrdinalIgnoreCase); - } - } -} diff --git a/src/Deprecated/Engine/Conditionals/NotExpressionNode.cs b/src/Deprecated/Engine/Conditionals/NotExpressionNode.cs deleted file mode 100644 index 17fc122cc85..00000000000 --- a/src/Deprecated/Engine/Conditionals/NotExpressionNode.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -namespace Microsoft.Build.BuildEngine -{ - /// - /// Performs logical NOT on left child - /// Does not update conditioned properties table - /// - internal sealed class NotExpressionNode : OperatorExpressionNode - { - /// - /// Evaluate as boolean - /// - internal override bool BoolEvaluate(ConditionEvaluationState state) - { - return !LeftChild.BoolEvaluate(state); - } - - internal override bool CanBoolEvaluate(ConditionEvaluationState state) - { - return LeftChild.CanBoolEvaluate(state); - } - - /// - /// Returns unexpanded value with '!' prepended. Useful for error messages. - /// - internal override string GetUnexpandedValue(ConditionEvaluationState state) - { - return "!" + LeftChild.GetUnexpandedValue(state); - } - - /// - /// Returns expanded value with '!' prepended. Useful for error messages. - /// - internal override string GetExpandedValue(ConditionEvaluationState state) - { - return "!" + LeftChild.GetExpandedValue(state); - } - } -} diff --git a/src/Deprecated/Engine/Conditionals/NumericComparisonExpressionNode.cs b/src/Deprecated/Engine/Conditionals/NumericComparisonExpressionNode.cs deleted file mode 100644 index ea6e3c80780..00000000000 --- a/src/Deprecated/Engine/Conditionals/NumericComparisonExpressionNode.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// Evaluates a numeric comparison, such as less-than, or greater-or-equal-than - /// Does not update conditioned properties table. - /// - internal abstract class NumericComparisonExpressionNode : OperatorExpressionNode - { - /// - /// Compare numbers - /// - protected abstract bool Compare(double left, double right); - - /// - /// Evaluate as boolean - /// - internal override bool BoolEvaluate(ConditionEvaluationState state) - { - ProjectErrorUtilities.VerifyThrowInvalidProject - (LeftChild.CanNumericEvaluate(state) && RightChild.CanNumericEvaluate(state), - state.conditionAttribute, - "ComparisonOnNonNumericExpression", - state.parsedCondition, - /* helpfully display unexpanded token and expanded result in error message */ - LeftChild.CanNumericEvaluate(state) ? RightChild.GetUnexpandedValue(state) : LeftChild.GetUnexpandedValue(state), - LeftChild.CanNumericEvaluate(state) ? RightChild.GetExpandedValue(state) : LeftChild.GetExpandedValue(state)); - - return Compare(LeftChild.NumericEvaluate(state), RightChild.NumericEvaluate(state)); - } - } -} diff --git a/src/Deprecated/Engine/Conditionals/NumericExpressionNode.cs b/src/Deprecated/Engine/Conditionals/NumericExpressionNode.cs deleted file mode 100644 index 8d1c921e271..00000000000 --- a/src/Deprecated/Engine/Conditionals/NumericExpressionNode.cs +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// Represents a number - evaluates as numeric. - /// - internal sealed class NumericExpressionNode : OperandExpressionNode - { - private string value; - - private NumericExpressionNode() { } - - internal NumericExpressionNode(string value) - { - this.value = value; - } - - /// - /// Evaluate as boolean - /// - internal override bool BoolEvaluate(ConditionEvaluationState state) - { - // Should be unreachable: all calls check CanBoolEvaluate() first - ErrorUtilities.VerifyThrow(false, "Can't evaluate a numeric expression as boolean."); - return false; - } - - /// - /// Evaluate as numeric - /// - internal override double NumericEvaluate(ConditionEvaluationState state) - { - return ConversionUtilities.ConvertDecimalOrHexToDouble(value); - } - - /// - /// Whether it can be evaluated as a boolean: never allowed for numerics - /// - internal override bool CanBoolEvaluate(ConditionEvaluationState state) - { - // Numeric expressions are never allowed to be treated as booleans. - return false; - } - - internal override bool CanNumericEvaluate(ConditionEvaluationState state) - { - // It is not always possible to numerically evaluate even a numerical expression - - // for example, it may overflow a double. So check here. - return ConversionUtilities.ValidDecimalOrHexNumber(value); - } - - internal override string GetUnexpandedValue(ConditionEvaluationState state) - { - return value; - } - - internal override string GetExpandedValue(ConditionEvaluationState state) - { - return value; - } - - /// - /// If any expression nodes cache any state for the duration of evaluation, - /// now's the time to clean it up - /// - internal override void ResetState() - { - } - } -} diff --git a/src/Deprecated/Engine/Conditionals/OperandExpressionNode.cs b/src/Deprecated/Engine/Conditionals/OperandExpressionNode.cs deleted file mode 100644 index fc92a743b34..00000000000 --- a/src/Deprecated/Engine/Conditionals/OperandExpressionNode.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -namespace Microsoft.Build.BuildEngine -{ - /// - /// Base class for all nodes that are operands (are leaves in the parse tree) - /// - internal abstract class OperandExpressionNode : GenericExpressionNode - { - #region REMOVE_COMPAT_WARNING - - internal override bool DetectAnd() - { - return false; - } - - internal override bool DetectOr() - { - return false; - } - #endregion - - } -} diff --git a/src/Deprecated/Engine/Conditionals/OperatorExpressionNode.cs b/src/Deprecated/Engine/Conditionals/OperatorExpressionNode.cs deleted file mode 100644 index 90daa06c3a6..00000000000 --- a/src/Deprecated/Engine/Conditionals/OperatorExpressionNode.cs +++ /dev/null @@ -1,138 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// Base class for nodes that are operators (have children in the parse tree) - /// - internal abstract class OperatorExpressionNode : GenericExpressionNode - { - /// - /// Storage for the left and right children of the operator - /// - private GenericExpressionNode leftChild, rightChild; - - /// - /// Numeric evaluation is never allowed for operators - /// - internal override double NumericEvaluate(ConditionEvaluationState state) - { - // Should be unreachable: all calls check CanNumericEvaluate() first - ErrorUtilities.VerifyThrow(false, "Cannot numeric evaluate an operator"); - return 0.0D; - } - - /// - /// Whether boolean evaluation is allowed: always allowed for operators - /// - internal override bool CanBoolEvaluate(ConditionEvaluationState state) - { - return true; - } - - /// - /// Whether the node can be evaluated as a numeric: by default, - /// this is not allowed - /// - internal override bool CanNumericEvaluate(ConditionEvaluationState state) - { - return false; - } - - /// - /// Value after any item and property expressions are expanded - /// - /// - internal override string GetExpandedValue(ConditionEvaluationState state) - { - return null; - } - - /// - /// Value before any item and property expressions are expanded - /// - /// - internal override string GetUnexpandedValue(ConditionEvaluationState state) - { - return null; - } - - /// - /// If any expression nodes cache any state for the duration of evaluation, - /// now's the time to clean it up - /// - internal override void ResetState() - { - leftChild?.ResetState(); - - rightChild?.ResetState(); - } - - /// - /// Storage for the left child - /// - internal GenericExpressionNode LeftChild - { - set { this.leftChild = value; } - get { return this.leftChild; } - } - - /// - /// Storage for the right child - /// - internal GenericExpressionNode RightChild - { - set { this.rightChild = value; } - get { return this.rightChild; } - } - - #region REMOVE_COMPAT_WARNING - internal override bool DetectAnd() - { - // Read the state of the current node - bool detectedAnd = this.PossibleAndCollision; - // Reset the flags on the current node - this.PossibleAndCollision = false; - // Process the children of the node if preset - bool detectAndRChild = false; - bool detectAndLChild = false; - if (RightChild != null) - { - detectAndRChild = RightChild.DetectAnd(); - } - if (LeftChild != null) - { - detectAndLChild = LeftChild.DetectAnd(); - } - return detectedAnd || detectAndRChild || detectAndLChild; - } - - internal override bool DetectOr() - { - // Read the state of the current node - bool detectedOr = this.PossibleOrCollision; - // Reset the flags on the current node - this.PossibleOrCollision = false; - // Process the children of the node if preset - bool detectOrRChild = false; - bool detectOrLChild = false; - if (RightChild != null) - { - detectOrRChild = RightChild.DetectOr(); - } - if (LeftChild != null) - { - detectOrLChild = LeftChild.DetectOr(); - } - return detectedOr || detectOrRChild || detectOrLChild; - } - #endregion - } -} diff --git a/src/Deprecated/Engine/Conditionals/OrExpressionNode.cs b/src/Deprecated/Engine/Conditionals/OrExpressionNode.cs deleted file mode 100644 index 39d1df39fbe..00000000000 --- a/src/Deprecated/Engine/Conditionals/OrExpressionNode.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// Performs logical OR on children - /// Does not update conditioned properties table - /// - internal sealed class OrExpressionNode : OperatorExpressionNode - { - /// - /// Evaluate as boolean - /// - internal override bool BoolEvaluate(ConditionEvaluationState state) - { - ProjectErrorUtilities.VerifyThrowInvalidProject - (LeftChild.CanBoolEvaluate(state), - state.conditionAttribute, - "ExpressionDoesNotEvaluateToBoolean", - LeftChild.GetUnexpandedValue(state), - LeftChild.GetExpandedValue(state), - state.parsedCondition); - - if (LeftChild.BoolEvaluate(state)) - { - // Short circuit - return true; - } - else - { - ProjectErrorUtilities.VerifyThrowInvalidProject - (RightChild.CanBoolEvaluate(state), - state.conditionAttribute, - "ExpressionDoesNotEvaluateToBoolean", - RightChild.GetUnexpandedValue(state), - RightChild.GetExpandedValue(state), - state.parsedCondition); - - return RightChild.BoolEvaluate(state); - } - } - - #region REMOVE_COMPAT_WARNING - private bool possibleOrCollision = true; - internal override bool PossibleOrCollision - { - set { this.possibleOrCollision = value; } - get { return this.possibleOrCollision; } - } - #endregion - } -} diff --git a/src/Deprecated/Engine/Conditionals/Parser.cs b/src/Deprecated/Engine/Conditionals/Parser.cs deleted file mode 100644 index 48cb79aa33b..00000000000 --- a/src/Deprecated/Engine/Conditionals/Parser.cs +++ /dev/null @@ -1,409 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System.Collections; -using System.Xml; -using System; -using Microsoft.Build.BuildEngine.Shared; - -using Microsoft.Build.Framework; - -namespace Microsoft.Build.BuildEngine -{ - [Flags] - internal enum ParserOptions - { - None = 0x0, - AllowProperties = 0x1, - AllowItemLists = 0x2, - AllowPropertiesAndItemLists = AllowProperties | AllowItemLists, - AllowItemMetadata = 0x4, - AllowPropertiesAndItemMetadata = AllowProperties | AllowItemMetadata, - AllowAll = AllowProperties | AllowItemLists | AllowItemMetadata - }; - - /// - /// This class implements the grammar for complex conditionals. - /// - /// The usage is: - /// Parser p = new Parser(CultureInfo); - /// ExpressionTree t = p.Parse(expression, XmlNode); - /// - /// The expression tree can then be evaluated and re-evaluated as needed. - /// - internal sealed class Parser - { - private Scanner lexer; - private XmlAttribute conditionAttribute; - private ParserOptions options; - internal int errorPosition = 0; // useful for unit tests - - #region REMOVE_COMPAT_WARNING - - private bool warnedForExpression = false; - - private BuildEventContext logBuildEventContext; - /// - /// Location contextual information which are attached to logging events to - /// say where they are in relation to the process, engine, project, target,task which is executing - /// - internal BuildEventContext LogBuildEventContext - { - get - { - return logBuildEventContext; - } - set - { - logBuildEventContext = value; - } - } - private EngineLoggingServices loggingServices; - /// - /// Engine Logging Service reference where events will be logged to - /// - internal EngineLoggingServices LoggingServices - { - set - { - this.loggingServices = value; - } - - get - { - return this.loggingServices; - } - } - #endregion - - internal Parser() - { - // nothing to see here, move along. - } - - // - // Main entry point for parser. - // You pass in the expression you want to parse, and you get an - // ExpressionTree out the back end. - // - internal GenericExpressionNode Parse(string expression, XmlAttribute conditionAttributeRef, ParserOptions optionSettings) - { - // We currently have no support (and no scenarios) for disallowing property references - // in Conditions. - ErrorUtilities.VerifyThrow(0 != (optionSettings & ParserOptions.AllowProperties), - "Properties should always be allowed."); - - this.conditionAttribute = conditionAttributeRef; - this.options = optionSettings; - - lexer = new Scanner(expression, options); - if (!lexer.Advance()) - { - errorPosition = lexer.GetErrorPosition(); - ProjectErrorUtilities.VerifyThrowInvalidProject(false, this.conditionAttribute, lexer.GetErrorResource(), expression, errorPosition, lexer.UnexpectedlyFound); - } - GenericExpressionNode node = Expr(expression); - if (!lexer.IsNext(Token.TokenType.EndOfInput)) - { - errorPosition = lexer.GetErrorPosition(); - ProjectErrorUtilities.VerifyThrowInvalidProject(false, this.conditionAttribute, "UnexpectedTokenInCondition", expression, lexer.IsNextString(), errorPosition); - } - return node; - } - - // - // Top node of grammar - // See grammar for how the following methods relate to each - // other. - // - private GenericExpressionNode Expr(string expression) - { - GenericExpressionNode node = BooleanTerm(expression); - if (!lexer.IsNext(Token.TokenType.EndOfInput)) - { - node = ExprPrime(expression, node); - } - - #region REMOVE_COMPAT_WARNING - // Check for potential change in behavior - if (LoggingServices != null && !warnedForExpression && - node.PotentialAndOrConflict()) - { - // We only want to warn once even if there multiple () sub expressions - warnedForExpression = true; - // Try to figure out where this expression was located - string projectFile = String.Empty; - int lineNumber = 0; - int columnNumber = 0; - if (this.conditionAttribute != null) - { - projectFile = XmlUtilities.GetXmlNodeFile(this.conditionAttribute, String.Empty /* no project file if XML is purely in-memory */); - XmlSearcher.GetLineColumnByNode(this.conditionAttribute, out lineNumber, out columnNumber); - } - // Log a warning regarding the fact the expression may have been evaluated - // incorrectly in earlier version of MSBuild - LoggingServices.LogWarning(logBuildEventContext, new BuildEventFileInfo(projectFile, lineNumber, columnNumber), "ConditionMaybeEvaluatedIncorrectly", expression); - } - #endregion - - return node; - } - - private GenericExpressionNode ExprPrime(string expression, GenericExpressionNode lhs) - { - if (Same(expression, Token.TokenType.EndOfInput)) - { - return lhs; - } - else if (Same(expression, Token.TokenType.Or)) - { - OperatorExpressionNode orNode = new OrExpressionNode(); - GenericExpressionNode rhs = BooleanTerm(expression); - orNode.LeftChild = lhs; - orNode.RightChild = rhs; - return ExprPrime(expression, orNode); - } - else - { - // I think this is ok. ExprPrime always shows up at - // the rightmost side of the grammar rhs, the EndOfInput case - // takes care of things - return lhs; - } - } - - private GenericExpressionNode BooleanTerm(string expression) - { - GenericExpressionNode node = RelationalExpr(expression); - if (node == null) - { - errorPosition = lexer.GetErrorPosition(); - ProjectErrorUtilities.VerifyThrowInvalidProject(false, this.conditionAttribute, "UnexpectedTokenInCondition", expression, lexer.IsNextString(), errorPosition); - } - - if (!lexer.IsNext(Token.TokenType.EndOfInput)) - { - node = BooleanTermPrime(expression, node); - } - return node; - } - - private GenericExpressionNode BooleanTermPrime(string expression, GenericExpressionNode lhs) - { - if (lexer.IsNext(Token.TokenType.EndOfInput)) - { - return lhs; - } - else if (Same(expression, Token.TokenType.And)) - { - GenericExpressionNode rhs = RelationalExpr(expression); - if (rhs == null) - { - errorPosition = lexer.GetErrorPosition(); - ProjectErrorUtilities.VerifyThrowInvalidProject(false, this.conditionAttribute, "UnexpectedTokenInCondition", expression, lexer.IsNextString(), errorPosition); - } - - OperatorExpressionNode andNode = new AndExpressionNode(); - andNode.LeftChild = lhs; - andNode.RightChild = rhs; - return BooleanTermPrime(expression, andNode); - } - else - { - // Should this be error case? - return lhs; - } - } - - private GenericExpressionNode RelationalExpr(string expression) - { - { - GenericExpressionNode lhs = Factor(expression); - if (lhs == null) - { - errorPosition = lexer.GetErrorPosition(); - ProjectErrorUtilities.VerifyThrowInvalidProject(false, this.conditionAttribute, "UnexpectedTokenInCondition", expression, lexer.IsNextString(), errorPosition); - } - - OperatorExpressionNode node = RelationalOperation(expression); - if (node == null) - { - return lhs; - } - GenericExpressionNode rhs = Factor(expression); - node.LeftChild = lhs; - node.RightChild = rhs; - return node; - } - } - - private OperatorExpressionNode RelationalOperation(string expression) - { - OperatorExpressionNode node = null; - if (Same(expression, Token.TokenType.LessThan)) - { - node = new LessThanExpressionNode(); - } - else if (Same(expression, Token.TokenType.GreaterThan)) - { - node = new GreaterThanExpressionNode(); - } - else if (Same(expression, Token.TokenType.LessThanOrEqualTo)) - { - node = new LessThanOrEqualExpressionNode(); - } - else if (Same(expression, Token.TokenType.GreaterThanOrEqualTo)) - { - node = new GreaterThanOrEqualExpressionNode(); - } - else if (Same(expression, Token.TokenType.EqualTo)) - { - node = new EqualExpressionNode(); - } - else if (Same(expression, Token.TokenType.NotEqualTo)) - { - node = new NotEqualExpressionNode(); - } - return node; - } - - private GenericExpressionNode Factor(string expression) - { - // Checks for TokenTypes String, Numeric, Property, ItemMetadata, and ItemList. - GenericExpressionNode arg = this.Arg(expression); - - // If it's one of those, return it. - if (arg != null) - { - return arg; - } - - // If it's not one of those, check for other TokenTypes. - Token current = lexer.CurrentToken; - if (Same(expression, Token.TokenType.Function)) - { - if (!Same(expression, Token.TokenType.LeftParenthesis)) - { - errorPosition = lexer.GetErrorPosition(); - ProjectErrorUtilities.VerifyThrowInvalidProject(false, this.conditionAttribute, "UnexpectedTokenInCondition", lexer.IsNextString(), errorPosition); - return null; - } - ArrayList arglist = new ArrayList(); - Arglist(expression, arglist); - if (!Same(expression, Token.TokenType.RightParenthesis)) - { - errorPosition = lexer.GetErrorPosition(); - ProjectErrorUtilities.VerifyThrowInvalidProject(false, this.conditionAttribute, "UnexpectedTokenInCondition", expression, lexer.IsNextString(), errorPosition); - return null; - } - return new FunctionCallExpressionNode(current.String, arglist); - } - else if (Same(expression, Token.TokenType.LeftParenthesis)) - { - GenericExpressionNode child = Expr(expression); - if (Same(expression, Token.TokenType.RightParenthesis)) - { - return child; - } - else - { - errorPosition = lexer.GetErrorPosition(); - ProjectErrorUtilities.VerifyThrowInvalidProject(false, this.conditionAttribute, "UnexpectedTokenInCondition", expression, lexer.IsNextString(), errorPosition); - } - } - else if (Same(expression, Token.TokenType.Not)) - { - OperatorExpressionNode notNode = new NotExpressionNode(); - GenericExpressionNode expr = Factor(expression); - if (expr == null) - { - errorPosition = lexer.GetErrorPosition(); - ProjectErrorUtilities.VerifyThrowInvalidProject(false, this.conditionAttribute, "UnexpectedTokenInCondition", expression, lexer.IsNextString(), errorPosition); - } - notNode.LeftChild = expr; - return notNode; - } - else - { - errorPosition = lexer.GetErrorPosition(); - ProjectErrorUtilities.VerifyThrowInvalidProject(false, this.conditionAttribute, "UnexpectedTokenInCondition", expression, lexer.IsNextString(), errorPosition); - } - return null; - } - - private void Arglist(string expression, ArrayList arglist) - { - if (!lexer.IsNext(Token.TokenType.RightParenthesis)) - { - Args(expression, arglist); - } - } - - private void Args(string expression, ArrayList arglist) - { - GenericExpressionNode arg = Arg(expression); - arglist.Add(arg); - if (Same(expression, Token.TokenType.Comma)) - { - Args(expression, arglist); - } - } - - private GenericExpressionNode Arg(string expression) - { - Token current = lexer.CurrentToken; - if (Same(expression, Token.TokenType.String)) - { - return new StringExpressionNode(current.String); - } - else if (Same(expression, Token.TokenType.Numeric)) - { - return new NumericExpressionNode(current.String); - } - else if (Same(expression, Token.TokenType.Property)) - { - return new StringExpressionNode(current.String); - } - else if (Same(expression, Token.TokenType.ItemMetadata)) - { - return new StringExpressionNode(current.String); - } - else if (Same(expression, Token.TokenType.ItemList)) - { - return new StringExpressionNode(current.String); - } - else - { - return null; - } - } - - private bool Same(string expression, Token.TokenType token) - { - if (lexer.IsNext(token)) - { - if (!lexer.Advance()) - { - errorPosition = lexer.GetErrorPosition(); - if (lexer.UnexpectedlyFound != null) - { - ProjectErrorUtilities.VerifyThrowInvalidProject(false, this.conditionAttribute, lexer.GetErrorResource(), expression, errorPosition, lexer.UnexpectedlyFound); - } - else - { - ProjectErrorUtilities.VerifyThrowInvalidProject(false, this.conditionAttribute, lexer.GetErrorResource(), expression, errorPosition); - } - } - return true; - } - else - { - return false; - } - } - } -} diff --git a/src/Deprecated/Engine/Conditionals/Scanner.cs b/src/Deprecated/Engine/Conditionals/Scanner.cs deleted file mode 100644 index 58a1ad65a64..00000000000 --- a/src/Deprecated/Engine/Conditionals/Scanner.cs +++ /dev/null @@ -1,686 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System.Globalization; -using System; -using System.Diagnostics; - -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// Class: Scanner - /// This class does the scanning of the input and returns tokens. - /// The usage pattern is: - /// Scanner s = new Scanner(expression, CultureInfo) - /// do { - /// s.Advance(); - /// while (s.IsNext(Token.EndOfInput)); - /// - /// After Advance() is called, you can get the current token (s.CurrentToken), - /// check it's type (s.IsNext()), get the string for it (s.NextString()). - /// - internal sealed class Scanner - { - private string expression; - private int parsePoint; - private Token lookahead; - private bool errorState; - private int errorPosition; - // What we found instead of what we were looking for - private string unexpectedlyFound = null; - private ParserOptions options; - private string errorResource = null; - - // Shared instances of "hardcoded" token strings. These are only used - // in error messages. - private const string comma = ","; - private const string leftParenthesis = "("; - private const string rightParenthesis = ")"; - private const string lessThan = "<"; - private const string greaterThan = ">"; - private const string lessThanOrEqualTo = "<="; - private const string greaterThanOrEqualTo = ">="; - private const string equalTo = "=="; - private const string notEqualTo = "!="; - private const string not = "!"; - private static string endOfInput = null; - - /// - /// Lazily format resource string to help avoid (in some perf critical cases) even loading - /// resources at all. - /// - private string EndOfInput - { - get - { - if (endOfInput == null) - { - endOfInput = ResourceUtilities.FormatResourceString("EndOfInputTokenName"); - } - - return endOfInput; - } - } - - private Scanner() { } - // - // Constructor takes the string to parse and the culture. - // - internal Scanner(string expressionToParse, ParserOptions options) - { - // We currently have no support (and no scenarios) for disallowing property references - // in Conditions. - ErrorUtilities.VerifyThrow(0 != (options & ParserOptions.AllowProperties), - "Properties should always be allowed."); - - this.expression = expressionToParse; - this.parsePoint = 0; - this.errorState = false; - this.errorPosition = -1; // invalid - this.options = options; - } - - /// - /// If the lexer errors, it has the best knowledge of the error message to show. For example, - /// 'unexpected character' or 'illformed operator'. This method returns the name of the resource - /// string that the parser should display. - /// - /// Intentionally not a property getter to avoid the debugger triggering the Assert dialog - /// - internal string GetErrorResource() - { - if (errorResource == null) - { - // I do not believe this is reachable, but provide a reasonable default. - Debug.Assert(false, "What code path did not set an appropriate error resource? Expression: " + expression); - unexpectedlyFound = EndOfInput; - return "UnexpectedCharacterInCondition"; - } - else - { - return errorResource; - } - } - - internal bool IsNext(Token.TokenType type) - { - return lookahead.IsToken(type); - } - - internal string IsNextString() - { - return lookahead.String; - } - - internal Token CurrentToken - { - get { return lookahead; } - } - - internal int GetErrorPosition() - { - Debug.Assert(-1 != errorPosition); // We should have set it - return errorPosition; - } - - // The string (usually a single character) we found unexpectedly. - // We might want to show it in the error message, to help the user spot the error. - internal string UnexpectedlyFound - { - get - { - return unexpectedlyFound; - } - } - - /// - /// Advance - /// returns true on successful advance - /// and false on an erroneous token - /// - /// Doesn't return error until the bogus input is encountered. - /// Advance() returns true even after EndOfInput is encountered. - /// - internal bool Advance() - { - if (errorState) - { - return false; - } - - if (lookahead?.IsToken(Token.TokenType.EndOfInput) == true) - { - return true; - } - - SkipWhiteSpace(); - - // Update error position after skipping whitespace - errorPosition = parsePoint + 1; - - if (parsePoint >= expression.Length) - { - lookahead = new Token(Token.TokenType.EndOfInput, null /* end of input */); - } - else - { - switch (expression[parsePoint]) - { - case ',': - lookahead = new Token(Token.TokenType.Comma, comma); - parsePoint++; - break; - case '(': - lookahead = new Token(Token.TokenType.LeftParenthesis, leftParenthesis); - parsePoint++; - break; - case ')': - lookahead = new Token(Token.TokenType.RightParenthesis, rightParenthesis); - parsePoint++; - break; - case '$': - if (!ParseProperty()) - { - return false; - } - - break; - case '%': - // If the caller specified that he DOESN'T want to allow item metadata ... - if ((this.options & ParserOptions.AllowItemMetadata) == 0) - { - errorPosition = this.parsePoint; - errorState = true; - errorResource = "UnexpectedCharacterInCondition"; - unexpectedlyFound = "%"; - return false; - } - if (!ParseItemMetadata()) - { - return false; - } - - break; - case '@': - int start = this.parsePoint; - // If the caller specified that he DOESN'T want to allow item lists ... - if ((this.options & ParserOptions.AllowItemLists) == 0) - { - if ((parsePoint + 1) < expression.Length && expression[parsePoint + 1] == '(') - { - errorPosition = start + 1; - errorState = true; - errorResource = "ItemListNotAllowedInThisConditional"; - return false; - } - } - if (!ParseItemList()) - { - return false; - } - - break; - case '!': - // negation and not-equal - if ((parsePoint + 1) < expression.Length && expression[parsePoint + 1] == '=') - { - lookahead = new Token(Token.TokenType.NotEqualTo, notEqualTo); - parsePoint += 2; - } - else - { - lookahead = new Token(Token.TokenType.Not, not); - parsePoint++; - } - break; - case '>': - // gt and gte - if ((parsePoint + 1) < expression.Length && expression[parsePoint + 1] == '=') - { - lookahead = new Token(Token.TokenType.GreaterThanOrEqualTo, greaterThanOrEqualTo); - parsePoint += 2; - } - else - { - lookahead = new Token(Token.TokenType.GreaterThan, greaterThan); - parsePoint++; - } - break; - case '<': - // lt and lte - if ((parsePoint + 1) < expression.Length && expression[parsePoint + 1] == '=') - { - lookahead = new Token(Token.TokenType.LessThanOrEqualTo, lessThanOrEqualTo); - parsePoint += 2; - } - else - { - lookahead = new Token(Token.TokenType.LessThan, lessThan); - parsePoint++; - } - break; - case '=': - if ((parsePoint + 1) < expression.Length && expression[parsePoint + 1] == '=') - { - lookahead = new Token(Token.TokenType.EqualTo, equalTo); - parsePoint += 2; - } - else - { - errorPosition = parsePoint + 2; // expression[parsePoint + 1], counting from 1 - errorResource = "IllFormedEqualsInCondition"; - if ((parsePoint + 1) < expression.Length) - { - // store the char we found instead - unexpectedlyFound = Convert.ToString(expression[parsePoint + 1], CultureInfo.InvariantCulture); - } - else - { - unexpectedlyFound = EndOfInput; - } - parsePoint++; - errorState = true; - return false; - } - break; - case '\'': - if (!ParseQuotedString()) - { - return false; - } - - break; - default: - // Simple strings, function calls, decimal numbers, hex numbers - if (!ParseRemaining()) - { - return false; - } - - break; - } - } - return true; - } - - /// - /// Parses either the $(propertyname) syntax or the %(metadataname) syntax, - /// and returns the parsed string beginning with the '$' or '%', and ending with the - /// closing parenthesis. - /// - /// - /// RGoel, DavidLe - private string ParsePropertyOrItemMetadata() - { - int start = parsePoint; // set start so that we include "$(" or "%(" - parsePoint++; - - if (parsePoint < expression.Length && expression[parsePoint] != '(') - { - errorState = true; - errorPosition = start + 1; - errorResource = "IllFormedPropertyOpenParenthesisInCondition"; - unexpectedlyFound = Convert.ToString(expression[parsePoint], CultureInfo.InvariantCulture); - return null; - } - - parsePoint = ScanForPropertyExpressionEnd(expression, parsePoint++); - - // Maybe we need to generate an error for invalid characters in property/metadata name? - // For now, just wait and let the property/metadata evaluation handle the error case. - - if (parsePoint >= expression.Length) - { - errorState = true; - errorPosition = start + 1; - errorResource = "IllFormedPropertyCloseParenthesisInCondition"; - unexpectedlyFound = EndOfInput; - return null; - } - - parsePoint++; - return expression.Substring(start, parsePoint - start); - } - - /// - /// Scan for the end of the property expression - /// - private static int ScanForPropertyExpressionEnd(string expression, int index) - { - int nestLevel = 0; - - while (index < expression.Length) - { - if (expression[index] == '(') - { - nestLevel++; - } - else if (expression[index] == ')') - { - nestLevel--; - } - - // We have reached the end of the parenthesis nesting - // this should be the end of the property expression - // If it is not then the calling code will determine that - if (nestLevel == 0) - { - return index; - } - else - { - index++; - } - } - - return index; - } - - /// - /// Parses a string of the form $(propertyname). - /// - /// - /// RGoel, DavidLe - private bool ParseProperty() - { - string propertyExpression = this.ParsePropertyOrItemMetadata(); - - if (propertyExpression == null) - { - return false; - } - else - { - this.lookahead = new Token(Token.TokenType.Property, propertyExpression); - return true; - } - } - - /// - /// Parses a string of the form %(itemmetadataname). - /// - /// - /// RGoel - private bool ParseItemMetadata() - { - string itemMetadataExpression = this.ParsePropertyOrItemMetadata(); - - if (itemMetadataExpression == null) - { - // The ParsePropertyOrItemMetadata method returns the correct error resources - // for parsing properties such as $(propertyname). At this stage in the Whidbey - // cycle, we're not allowed to add new string resources, so I can't add a new - // resource specific to item metadata, so here, we just change the error to - // the generic "UnexpectedCharacter". - errorResource = "UnexpectedCharacterInCondition"; - return false; - } - else - { - this.lookahead = new Token(Token.TokenType.ItemMetadata, itemMetadataExpression); - return true; - } - } - - private bool ParseInternalItemList() - { - int start = parsePoint; - parsePoint++; - - if (parsePoint < expression.Length && expression[parsePoint] != '(') - { - // @ was not followed by ( - errorPosition = start + 1; - errorResource = "IllFormedItemListOpenParenthesisInCondition"; - // Not useful to set unexpectedlyFound here. The message is going to be detailed enough. - errorState = true; - return false; - } - parsePoint++; - // Maybe we need to generate an error for invalid characters in itemgroup name? - // For now, just let item evaluation handle the error. - bool fInReplacement = false; - while (parsePoint < expression.Length) - { - if (expression[parsePoint] == '\'') - { - fInReplacement = !fInReplacement; - } - else if (expression[parsePoint] == ')' && !fInReplacement) - { - break; - } - parsePoint++; - } - if (parsePoint >= expression.Length) - { - errorPosition = start + 1; - if (fInReplacement) - { - // @( ... ' was never followed by a closing quote before the closing parenthesis - errorResource = "IllFormedItemListQuoteInCondition"; - } - else - { - // @( was never followed by a ) - errorResource = "IllFormedItemListCloseParenthesisInCondition"; - } - // Not useful to set unexpectedlyFound here. The message is going to be detailed enough. - errorState = true; - return false; - } - parsePoint++; - return true; - } - - private bool ParseItemList() - { - int start = parsePoint; - if (!ParseInternalItemList()) - { - return false; - } - lookahead = new Token(Token.TokenType.ItemList, expression.Substring(start, parsePoint - start)); - return true; - } - - private bool ParseQuotedString() - { - parsePoint++; - int start = parsePoint; - while (parsePoint < expression.Length && expression[parsePoint] != '\'') - { - // Standalone percent-sign must be allowed within a condition because it's - // needed to escape special characters. However, percent-sign followed - // by open-parenthesis is an indication of an item metadata reference, and - // that is only allowed in certain contexts. - if ((expression[parsePoint] == '%') && ((parsePoint + 1) < expression.Length) && (expression[parsePoint + 1] == '(')) - { - // If the caller specified that he DOESN'T want to allow item metadata... - if ((this.options & ParserOptions.AllowItemMetadata) == 0) - { - errorPosition = start + 1; - errorState = true; - errorResource = "UnexpectedCharacterInCondition"; - unexpectedlyFound = "%"; - return false; - } - } - else if (expression[parsePoint] == '@' && ((parsePoint + 1) < expression.Length) && (expression[parsePoint + 1] == '(')) - { - // If the caller specified that he DOESN'T want to allow item lists ... - if ((this.options & ParserOptions.AllowItemLists) == 0) - { - errorPosition = start + 1; - errorState = true; - errorResource = "ItemListNotAllowedInThisConditional"; - return false; - } - - // Item lists have to be parsed because of the replacement syntax e.g. @(Foo,'_'). - // I have to know how to parse those so I can skip over the tic marks. I don't - // have to do that with other things like propertygroups, hence itemlists are - // treated specially. - - ParseInternalItemList(); - continue; - } - parsePoint++; - } - if (parsePoint >= expression.Length) - { - // Quoted string wasn't closed - errorState = true; - errorPosition = start; // The message is going to say "expected after position n" so don't add 1 here. - errorResource = "IllFormedQuotedStringInCondition"; - // Not useful to set unexpectedlyFound here. By definition it got to the end of the string. - return false; - } - string originalTokenString = expression.Substring(start, parsePoint - start); - - lookahead = new Token(Token.TokenType.String, originalTokenString); - parsePoint++; - return true; - } - - private bool ParseRemaining() - { - int start = parsePoint; - if (CharacterUtilities.IsNumberStart(expression[parsePoint])) // numeric - { - if (!ParseNumeric(start)) - { - return false; - } - } - else if (CharacterUtilities.IsSimpleStringStart(expression[parsePoint])) // simple string (handle 'and' and 'or') - { - if (!ParseSimpleStringOrFunction(start)) - { - return false; - } - } - else - { - // Something that wasn't a number or a letter, like a newline (%0a) - errorState = true; - errorPosition = start + 1; - errorResource = "UnexpectedCharacterInCondition"; - unexpectedlyFound = Convert.ToString(expression[parsePoint], CultureInfo.InvariantCulture); - return false; - } - return true; - } - private bool ParseSimpleStringOrFunction(int start) - { - SkipSimpleStringChars(); - if (string.Equals(expression.Substring(start, parsePoint - start), "and", StringComparison.OrdinalIgnoreCase)) - { - lookahead = new Token(Token.TokenType.And, expression.Substring(start, parsePoint - start)); - } - else if (string.Equals(expression.Substring(start, parsePoint - start), "or", StringComparison.OrdinalIgnoreCase)) - { - lookahead = new Token(Token.TokenType.Or, expression.Substring(start, parsePoint - start)); - } - else - { - int end = parsePoint; - SkipWhiteSpace(); - if (parsePoint < expression.Length && expression[parsePoint] == '(') - { - lookahead = new Token(Token.TokenType.Function, expression.Substring(start, end - start)); - } - else - { - string tokenValue = expression.Substring(start, end - start); - lookahead = new Token(Token.TokenType.String, tokenValue); - } - } - return true; - } - private bool ParseNumeric(int start) - { - if ((expression.Length - parsePoint) > 2 && expression[parsePoint] == '0' && (expression[parsePoint + 1] == 'x' || expression[parsePoint + 1] == 'X')) - { - // Hex number - parsePoint += 2; - SkipHexDigits(); - lookahead = new Token(Token.TokenType.Numeric, expression.Substring(start, parsePoint - start)); - } - else if (CharacterUtilities.IsNumberStart(expression[parsePoint])) - { - // Decimal number - if (expression[parsePoint] == '+') - { - parsePoint++; - } - else if (expression[parsePoint] == '-') - { - parsePoint++; - } - SkipDigits(); - if (parsePoint < expression.Length && expression[parsePoint] == '.') - { - parsePoint++; - } - if (parsePoint < expression.Length) - { - SkipDigits(); - } - // Do we need to error on malformed input like 0.00.00)? or will the conversion handle it? - // For now, let the conversion generate the error. - lookahead = new Token(Token.TokenType.Numeric, expression.Substring(start, parsePoint - start)); - } - else - { - // Unreachable - errorState = true; - errorPosition = start + 1; - return false; - } - return true; - } - private void SkipWhiteSpace() - { - while (parsePoint < expression.Length && char.IsWhiteSpace(expression[parsePoint])) - { - parsePoint++; - } - - return; - } - private void SkipDigits() - { - while (parsePoint < expression.Length && char.IsDigit(expression[parsePoint])) - { - parsePoint++; - } - - return; - } - private void SkipHexDigits() - { - while (parsePoint < expression.Length && CharacterUtilities.IsHexDigit(expression[parsePoint])) - { - parsePoint++; - } - - return; - } - private void SkipSimpleStringChars() - { - while (parsePoint < expression.Length && CharacterUtilities.IsSimpleStringChar(expression[parsePoint])) - { - parsePoint++; - } - - return; - } - } -} diff --git a/src/Deprecated/Engine/Conditionals/StringExpressionNode.cs b/src/Deprecated/Engine/Conditionals/StringExpressionNode.cs deleted file mode 100644 index 1b50b71ac2e..00000000000 --- a/src/Deprecated/Engine/Conditionals/StringExpressionNode.cs +++ /dev/null @@ -1,84 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// Node representing a string - /// - internal sealed class StringExpressionNode : OperandExpressionNode - { - private string value; - private string cachedExpandedValue; - - internal StringExpressionNode(string value) - { - this.value = value; - this.cachedExpandedValue = null; - } - - /// - /// Evaluate as boolean - /// - internal override bool BoolEvaluate(ConditionEvaluationState state) - { - return ConversionUtilities.ConvertStringToBool(GetExpandedValue(state)); - } - - /// - /// Evaluate as numeric - /// - internal override double NumericEvaluate(ConditionEvaluationState state) - { - return ConversionUtilities.ConvertDecimalOrHexToDouble(GetExpandedValue(state)); - } - - internal override bool CanBoolEvaluate(ConditionEvaluationState state) - { - return ConversionUtilities.CanConvertStringToBool(GetExpandedValue(state)); - } - - internal override bool CanNumericEvaluate(ConditionEvaluationState state) - { - return ConversionUtilities.ValidDecimalOrHexNumber(GetExpandedValue(state)); - } - - /// - /// Value before any item and property expressions are expanded - /// - /// - internal override string GetUnexpandedValue(ConditionEvaluationState state) - { - return value; - } - - /// - /// Value after any item and property expressions are expanded - /// - /// - internal override string GetExpandedValue(ConditionEvaluationState state) - { - if (cachedExpandedValue == null) - { - cachedExpandedValue = state.expanderToUse.ExpandAllIntoString(value, state.conditionAttribute); - } - - return cachedExpandedValue; - } - - /// - /// If any expression nodes cache any state for the duration of evaluation, - /// now's the time to clean it up - /// - internal override void ResetState() - { - cachedExpandedValue = null; - } - } -} diff --git a/src/Deprecated/Engine/Conditionals/Token.cs b/src/Deprecated/Engine/Conditionals/Token.cs deleted file mode 100644 index 88fe9857196..00000000000 --- a/src/Deprecated/Engine/Conditionals/Token.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class represents a token in the Complex Conditionals grammar. It's - /// really just a bag that contains the type of the token and the string that - /// was parsed into the token. This isn't very useful for operators, but - /// is useful for strings and such. - /// - internal sealed class Token - { - /// - /// Valid tokens - /// - internal enum TokenType - { - Comma, LeftParenthesis, RightParenthesis, - LessThan, GreaterThan, LessThanOrEqualTo, GreaterThanOrEqualTo, - And, Or, - EqualTo, NotEqualTo, Not, - Property, String, Numeric, ItemList, ItemMetadata, Function, - EndOfInput - }; - - private TokenType tokenType; - private string tokenString; - - /// - /// Constructor takes the token type and the string that - /// represents the token - /// - /// - /// - internal Token(TokenType type, string tokenString) - { - this.tokenType = type; - this.tokenString = tokenString; - } - - /// - /// - /// - /// - /// - internal bool IsToken(TokenType type) - { - return tokenType == type; - } - - internal TokenType Type - { - get { return tokenType; } - } - - internal string String - { - get { return tokenString; } - } - } -} diff --git a/src/Deprecated/Engine/Engine/BatchingEngine.cs b/src/Deprecated/Engine/Engine/BatchingEngine.cs deleted file mode 100644 index 04aa8cc8791..00000000000 --- a/src/Deprecated/Engine/Engine/BatchingEngine.cs +++ /dev/null @@ -1,420 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Xml; -using System.Collections; - -using Microsoft.Build.BuildEngine.Shared; -using System.Collections.Generic; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class is used by objects in the build engine that have the ability to execute themselves in batches, to partition the - /// items they consume into "buckets", based on the values of select item metadata. - /// - /// - /// What batching does - /// - /// Batching partitions the items consumed by the batchable object into buckets, where each bucket - /// contains a set of items that have the same value set on all item metadata consumed by the object. - /// Metadata consumed may be unqualified, for example %(m), or qualified by the item list to which it - /// refers, for example %(a.m). - /// - /// If metadata is qualified, for example %(a.m), then this is considered distinct to metadata with the - /// same name on a different item type. For example, %(a.m) is distinct to %(b.m), and items of type �b� - /// are considered to always have a blank value for %(a.m). This means items of type �b� will only be - /// placed in buckets where %(a.m) is blank. However %(a.m) is equivalent to %(m) on items of type �a�. - /// - /// There is an extra ambiguity rule: every items consumed by the object must have an explicit value for - /// every piece of unqualified metadata. For example, if @(a), %(m), and %(a.n) are consumed, every item - /// of type �a� must have a value for the metadata �m� but need not all necessarily have a value for the - /// metadata �n�. This rule eliminates ambiguity about whether items that do not define values for an - /// unqualified metadata should go in all buckets, or just into buckets with a blank value for - /// that metadata. - /// - /// For example - /// - /// - /// - /// m0 - /// - /// - /// m1 - /// - /// - /// n0 - /// - /// - /// n1 - /// - /// - /// - /// - /// - /// - /// - /// - /// Will produce 5 buckets: - /// - /// a={a1;a2.m0} b={.} - /// a={a3.m1} b={.} - /// a={.} b={b1.n0} - /// a={.} b={b2;b3.n1} - /// a={.} b={b4.} - /// - /// - internal static class BatchingEngine - { - #region Methods - - /// - /// Determines how many times the batchable object needs to be executed (each execution is termed a "batch"), and prepares - /// buckets of items to pass to the object in each batch. - /// - /// ArrayList containing ItemBucket objects, each one representing an execution batch. - internal static ArrayList PrepareBatchingBuckets - ( - XmlNode parentNode, - List batchableObjectParameters, - Lookup lookup - ) - { - return PrepareBatchingBuckets(parentNode, batchableObjectParameters, lookup, null); - } - - /// - /// Determines how many times the batchable object needs to be executed (each execution is termed a "batch"), and prepares - /// buckets of items to pass to the object in each batch. - /// - /// - /// - /// - /// Any item type that can be considered an implicit input to this batchable object. - /// This is useful for items inside targets, where the item name is plainly an item type that's an "input" to the object. - /// ArrayList containing ItemBucket objects, each one representing an execution batch. - internal static ArrayList PrepareBatchingBuckets - ( - XmlNode parentNode, - List batchableObjectParameters, - Lookup lookup, - string implicitBatchableItemType - ) - { - ErrorUtilities.VerifyThrow(parentNode != null, "Need the XML node that represents the batchable object."); - ErrorUtilities.VerifyThrow(batchableObjectParameters != null, "Need the parameters of the batchable object to determine if it can be batched."); - ErrorUtilities.VerifyThrow(lookup != null, "Need to specify the lookup."); - - ItemsAndMetadataPair pair = ExpressionShredder.GetReferencedItemNamesAndMetadata(batchableObjectParameters); - - // All the @(itemname) item list references in the tag, including transforms, etc. - // The keys in the hashtable are the item names, and the values are all String.Empty (not used). - Hashtable consumedItemReferences = pair.Items; - - // All the %(itemname.metadataname) references in the tag (not counting those embedded - // inside item transforms), and note that the itemname portion is optional. - // The keys in the returned hash table are the qualified metadata names (e.g. "EmbeddedResource.Culture" - // or just "Culture"). The values are MetadataReference structs, which simply split out the item - // name (possibly null) and the actual metadata name. - Dictionary consumedMetadataReferences = pair.Metadata; - - ArrayList buckets = null; - if (consumedMetadataReferences?.Count > 0) - { - // Add any item types that we were explicitly told to assume. - if (implicitBatchableItemType != null) - { - consumedItemReferences = Utilities.CreateTableIfNecessary(consumedItemReferences); - consumedItemReferences[implicitBatchableItemType] = String.Empty; - } - - // This method goes through all the item list references and figures out which ones - // will be participating in batching, and which ones won't. We get back a hashtable - // where the key is the item name that will be participating in batching. The values - // are all String.Empty (not used). This method may return additional item names - // that weren't represented in "consumedItemReferences"... this would happen if there - // were qualified metadata references in the consumedMetadataReferences table, such as - // %(EmbeddedResource.Culture). - Hashtable itemListsToBeBatched = GetItemListsToBeBatched(parentNode, consumedMetadataReferences, consumedItemReferences, lookup); - - // At this point, if there were any metadata references in the tag, but no item - // references to batch on, we've got a problem because we can't figure out which - // item lists the user wants us to batch. - if (itemListsToBeBatched.Count == 0) - { - foreach (string unqualifiedMetadataName in consumedMetadataReferences.Keys) - { - // Of course, since this throws an exception, there's no way we're ever going - // to really loop here... it's just that the foreach is the only way I can - // figure out how to get data out of the hashtable without knowing any of the - // keys! - ProjectErrorUtilities.VerifyThrowInvalidProject(false, - parentNode, "CannotReferenceItemMetadataWithoutItemName", unqualifiedMetadataName); - } - } - else - { - // If the batchable object consumes item metadata as well as items to be batched, - // we need to partition the items consumed by the object. - buckets = BucketConsumedItems(parentNode, lookup, itemListsToBeBatched, consumedMetadataReferences); - } - } - - // if the batchable object does not consume any item metadata or items, or if the item lists it consumes are all - // empty, then the object does not need to be batched - if ((buckets == null) || (buckets.Count == 0)) - { - // create a default bucket that references the project items and properties -- this way we always have a bucket - buckets = new ArrayList(1); - buckets.Add(new ItemBucket(null, null, lookup, buckets.Count)); - } - - return buckets; - } - - /// - /// Of all the item lists that are referenced in this batchable object, which ones should we - /// batch on, and which ones should we just pass in wholesale to every invocation of the - /// target/task? - /// - /// Rule #1. If the user has referenced any *qualified* item metadata such as %(EmbeddedResource.Culture), - /// then that item list "EmbeddedResource" will definitely get batched. - /// - /// Rule #2. For all the unqualified item metadata such as %(Culture), we make sure that - /// every single item in every single item list being passed into the task contains a value - /// for that metadata. If not, it's an error. If so, we batch all of those item lists. - /// - /// All other item lists will not be batched, and instead will be passed in wholesale to all buckets. - /// - /// Hashtable containing the item names that should be batched. - private static Hashtable GetItemListsToBeBatched - ( - XmlNode parentNode, - Dictionary consumedMetadataReferences, // Key is [string] potentially qualified metadata name - // Value is [struct MetadataReference] - Hashtable consumedItemReferenceNames, // Key is [string] item name. - // Value is always String.Empty (unused). - Lookup lookup - ) - { - // The keys in this hashtable are the names of the items that we will batch on. - // The values are always String.Empty (not used). - Hashtable itemListsToBeBatched = new Hashtable(StringComparer.OrdinalIgnoreCase); - - // Loop through all the metadata references and find the ones that are qualified - // with an item name. - foreach (MetadataReference consumedMetadataReference in consumedMetadataReferences.Values) - { - if (consumedMetadataReference.itemName != null) - { - // Rule #1. Qualified metadata reference. - // For metadata references that are qualified with an item name - // (e.g., %(EmbeddedResource.Culture) ), we add that item name to the list of - // consumed item names, even if the item name wasn't otherwise referenced via - // @(...) syntax, and even if every item in the list doesn't necessary contain - // a value for this metadata. This is the special power that you get by qualifying - // the metadata reference with an item name. - itemListsToBeBatched[consumedMetadataReference.itemName] = String.Empty; - - // Also add this qualified item to the consumed item references list, because - // %(EmbeddedResource.Culture) effectively means that @(EmbeddedResource) is - // being consumed, even though we may not see literally "@(EmbeddedResource)" - // in the tag anywhere. Adding it to this list allows us (down below in this - // method) to check that every item in this list has a value for each - // unqualified metadata reference. - consumedItemReferenceNames = Utilities.CreateTableIfNecessary(consumedItemReferenceNames); - consumedItemReferenceNames[consumedMetadataReference.itemName] = String.Empty; - } - } - - // Loop through all the metadata references and find the ones that are unqualified. - foreach (MetadataReference consumedMetadataReference in consumedMetadataReferences.Values) - { - if (consumedMetadataReference.itemName == null) - { - // Rule #2. Unqualified metadata reference. - // For metadata references that are unqualified, every single consumed item - // must contain a value for that metadata. If any item doesn't, it's an error - // to use unqualified metadata. - if (consumedItemReferenceNames != null) - { - foreach (string consumedItemName in consumedItemReferenceNames.Keys) - { - // Loop through all the items in the item list. - BuildItemGroup items = lookup.GetItems(consumedItemName); - - if (items != null) - { - // Loop through all the items in the BuildItemGroup. - foreach (BuildItem item in items) - { - ProjectErrorUtilities.VerifyThrowInvalidProject( - item.HasMetadata(consumedMetadataReference.metadataName), - parentNode, "ItemDoesNotContainValueForUnqualifiedMetadata", - item.Include, consumedItemName, consumedMetadataReference.metadataName); - } - } - - // This item list passes the test of having every single item containing - // a value for this metadata. Therefore, add this item list to the batching list. - // Also, to save doing lookup.GetItems again, put the items in the table as the value. - itemListsToBeBatched[consumedItemName] = items; - } - } - } - } - - return itemListsToBeBatched; - } - - /// - /// Partitions the items consumed by the batchable object into buckets, where each bucket contains a set of items that - /// have the same value set on all item metadata consumed by the object. - /// - /// - /// PERF NOTE: Given n items and m batching metadata that produce l buckets, it is usually the case that n > l > m, - /// because a batchable object typically uses one or two item metadata to control batching, and only has a handful of - /// buckets. The number of buckets is typically only large if a batchable object is using single-item batching - /// (where l == n). Any algorithm devised for bucketing therefore, should try to minimize n and l in its complexity - /// equation. The algorithm below has a complexity of O(n*lg(l)*m/2) in its comparisons, and is effectively O(n) when - /// l is small, and O(n*lg(n)) in the worst case as l -> n. However, note that the comparison complexity is not the - /// same as the operational complexity for this algorithm. The operational complexity of this algorithm is actually - /// O(n*m + n*lg(l)*m/2 + n*l/2 + n + l), which is effectively O(n^2) in the worst case. The additional complexity comes - /// from the array and metadata operations that are performed. However, those operations are extremely cheap compared - /// to the comparison operations, which dominate the time spent in this method. - /// - /// ArrayList containing ItemBucket objects (can be empty), each one representing an execution batch. - private static ArrayList BucketConsumedItems - ( - XmlNode parentNode, - Lookup lookup, - Hashtable itemListsToBeBatched, - Dictionary consumedMetadataReferences - ) - { - ErrorUtilities.VerifyThrow(itemListsToBeBatched.Count > 0, "Need item types consumed by the batchable object."); - ErrorUtilities.VerifyThrow(consumedMetadataReferences.Count > 0, "Need item metadata consumed by the batchable object."); - - ArrayList buckets = new ArrayList(); - - // Get and iterate through the list of item names that we're supposed to batch on. - foreach (DictionaryEntry entry in itemListsToBeBatched) - { - string itemName = (string)entry.Key; - - // Use the previously-fetched items, if possible - BuildItemGroup items; - if (entry.Value is BuildItemGroup) - { - items = (BuildItemGroup)entry.Value; - } - else - { - items = lookup.GetItems(itemName); - } - - if (items != null) - { - foreach (BuildItem item in items) - { - // Get this item's values for all the metadata consumed by the batchable object. - Dictionary itemMetadataValues = GetItemMetadataValues(parentNode, item, consumedMetadataReferences); - - // put the metadata into a dummy bucket we can use for searching - ItemBucket dummyBucket = ItemBucket.GetDummyBucketForComparisons(itemMetadataValues); - - // look through all previously created buckets to find a bucket whose items have the same values as - // this item for all metadata consumed by the batchable object - int matchingBucketIndex = buckets.BinarySearch(dummyBucket); - - ItemBucket matchingBucket = (matchingBucketIndex >= 0) - ? (ItemBucket)buckets[matchingBucketIndex] - : null; - - // If we didn't find a bucket that matches this item, create a new one, adding - // this item to the bucket. - if (matchingBucket == null) - { - matchingBucket = new ItemBucket(itemListsToBeBatched.Keys, itemMetadataValues, lookup, buckets.Count); - - // make sure to put the new bucket into the appropriate location - // in the sorted list as indicated by the binary search - // NOTE: observe the ~ operator (bitwise complement) in front of - // the index -- see MSDN for more information on the return value - // from the ArrayList.BinarySearch() method - buckets.Insert(~matchingBucketIndex, matchingBucket); - } - - // We already have a bucket for this type of item, so add this item to - // the bucket. - matchingBucket.AddItem(item); - } - } - } - - // Put the buckets back in the order in which they were discovered, so that the first - // item declared in the project file ends up in the first batch passed into the target/task. - ArrayList orderedBuckets = ArrayList.Repeat(null, buckets.Count); - foreach (ItemBucket bucket in buckets) - { - orderedBuckets[bucket.BucketSequenceNumber] = bucket; - } - return orderedBuckets; - } - - /// - /// Gets the values of the specified metadata for the given item. - /// The keys in the dictionary returned may be qualified and/or unqualified, exactly - /// as they are found in the metadata reference. - /// For example if %(x) is found, the key is "x", if %(z.x) is found, the key is "z.x". - /// This dictionary in each bucket is used by Expander to expand exactly the same metadata references, so - /// %(x) is expanded using the key "x", and %(z.x) is expanded using the key "z.x". - /// - /// the metadata values - private static Dictionary GetItemMetadataValues - ( - XmlNode parentNode, - BuildItem item, - Dictionary consumedMetadataReferences - ) - { - Dictionary itemMetadataValues = new Dictionary(consumedMetadataReferences.Count, StringComparer.OrdinalIgnoreCase); - - foreach (KeyValuePair consumedMetadataReference in consumedMetadataReferences) - { - string metadataQualifiedName = consumedMetadataReference.Key; - string metadataItemName = consumedMetadataReference.Value.itemName; - string metadataName = consumedMetadataReference.Value.metadataName; - - if ( - (metadataItemName != null) && - (!String.Equals(item.Name, metadataItemName, StringComparison.OrdinalIgnoreCase)) - ) - { - itemMetadataValues[metadataQualifiedName] = String.Empty; - } - else - { - try - { - itemMetadataValues[metadataQualifiedName] = item.GetEvaluatedMetadataEscaped(metadataName); - } - catch (InvalidOperationException e) - { - ProjectErrorUtilities.VerifyThrowInvalidProject(false, parentNode, - "CannotEvaluateItemMetadata", metadataName, e.Message); - } - } - } - - return itemMetadataValues; - } - - #endregion - } -} diff --git a/src/Deprecated/Engine/Engine/BuildRequest.cs b/src/Deprecated/Engine/Engine/BuildRequest.cs deleted file mode 100644 index 08612a49045..00000000000 --- a/src/Deprecated/Engine/Engine/BuildRequest.cs +++ /dev/null @@ -1,849 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Diagnostics; -using System.Collections; -using System.Text; -using System.IO; - -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// Request for a linear evaluation of a list of targets in a project - /// - [DebuggerDisplay("BuildRequest (Project={ProjectFileName}, Targets={System.String.Join(\";\", TargetNames)}, NodeIndex={NodeIndex}, HandleId={HandleId})")] - internal class BuildRequest - { - #region Constructors - - internal BuildRequest() - { - // used for serialization - } - - /// - /// Called by the Engine - /// - internal BuildRequest - ( - int handleId, - string projectFileName, - string[] targetNames, - BuildPropertyGroup globalProperties, - string toolsetVersion, - int requestId, - bool useResultsCache, - bool unloadProjectsOnCompletion - ) - : - this - ( - handleId, - projectFileName, - targetNames, - (IDictionary)null, - toolsetVersion, - requestId, - useResultsCache, - unloadProjectsOnCompletion - ) - { - // Create a hashtable out of the BuildPropertyGroup passed in. - // This constructor is called only through the object model. - if (globalProperties != null) - { - Hashtable globalPropertiesTable = new Hashtable(globalProperties.Count); - foreach (BuildProperty property in globalProperties) - { - globalPropertiesTable.Add(property.Name, property.FinalValue); - } - - this.globalPropertiesPassedByTask = globalPropertiesTable; - this.globalProperties = globalProperties; - } - } - - /// - /// Called by the TEM ("generated" request) - /// - internal BuildRequest - ( - int handleId, - string projectFileName, - string[] targetNames, - IDictionary globalProperties, - string toolsetVersion, - int requestId, - bool useResultsCache, - bool unloadProjectsOnCompletion - ) - { - this.handleId = handleId; - this.nodeIndex = EngineCallback.invalidNode; - this.projectFileName = projectFileName; - this.targetNames = targetNames; - this.parentEngine = null; - this.outputsByTarget = null; - this.resultByTarget = new Hashtable(StringComparer.OrdinalIgnoreCase); - this.globalPropertiesPassedByTask = null; - this.globalProperties = null; - this.buildSucceeded = false; - this.buildSettings = BuildSettings.None; - this.projectToBuild = null; - this.fireProjectStartedFinishedEvents = false; - this.requestId = requestId; - this.useResultsCache = useResultsCache; - this.unloadProjectsOnCompletion = unloadProjectsOnCompletion; - this.restoredFromCache = false; - this.toolsetVersion = toolsetVersion; - this.isExternalRequest = false; - this.parentHandleId = EngineCallback.invalidEngineHandle; - this.projectId = 0; - this.startTime = 0; - this.processingTotalTime = 0; - this.taskTime = 0; - this.toolsVersionPeekedFromProjectFile = false; - - if (globalProperties is Hashtable) - { - this.globalPropertiesPassedByTask = (Hashtable)globalProperties; - } - else if (globalProperties != null) - { - // We were passed an IDictionary that was not a Hashtable. It may - // not be serializable, so convert it into a Hashtable, which is. - this.globalPropertiesPassedByTask = new Hashtable(globalProperties.Count); - foreach (DictionaryEntry newGlobalProperty in globalProperties) - { - this.globalPropertiesPassedByTask.Add(newGlobalProperty.Key, - newGlobalProperty.Value); - } - } - } - #endregion - - #region Properties - /// - /// The engine is set inside the proxy prior to enqueing the request - /// - internal Engine ParentEngine - { - get - { - return this.parentEngine; - } - set - { - this.parentEngine = value; - } - } - /// - /// The outputs of the build request - /// - internal IDictionary OutputsByTarget - { - get - { - return this.outputsByTarget; - } - set - { - this.outputsByTarget = value; - } - } - - /// - /// Build result per target - /// - internal Hashtable ResultByTarget - { - get - { - return this.resultByTarget; - } - } - - /// - /// The result of the build request - /// - internal bool BuildSucceeded - { - get - { - return this.buildSucceeded; - } - set - { - this.buildSucceeded = value; - } - } - - /// - /// The list of targets that need to be evaluated - /// - internal string[] TargetNames - { - get - { - return this.targetNames; - } - } - - /// - /// The build settings - /// - internal BuildSettings BuildSettings - { - get - { - return this.buildSettings; - } - set - { - this.buildSettings = value; - } - } - - /// - /// The project to be evaluated - /// - internal Project ProjectToBuild - { - get - { - return this.projectToBuild; - } - set - { - this.projectToBuild = value; - } - } - - internal bool FireProjectStartedFinishedEvents - { - get - { - return this.fireProjectStartedFinishedEvents; - } - set - { - this.fireProjectStartedFinishedEvents = value; - } - } - - internal int NodeIndex - { - get - { - return this.nodeIndex; - } - set - { - this.nodeIndex = value; - } - } - - /// - /// Maps the BuildRequest to the TaskExecutionContext. - /// If BuildRequest originated in the Engine itself in CreateLocalBuildRequest, HandleId is EngineCallback.invalidEngineHandle. - /// - internal int HandleId - { - get - { - return this.handleId; - } - set - { - this.handleId = value; - } - } - - internal int ParentHandleId - { - get - { - return parentHandleId; - } - set - { - parentHandleId = value; - } - } - - internal int ProjectId - { - get - { - return this.projectId; - } - set - { - this.projectId = value; - } - } - - internal int ParentRequestId - { - get - { - return this.parentRequestId; - } - set - { - this.parentRequestId = value; - } - } - - internal string ProjectFileName - { - get - { - return this.projectFileName; - } - set - { - this.projectFileName = value; - } - } - - internal BuildPropertyGroup GlobalProperties - { - get - { - return this.globalProperties; - } - set - { - this.globalProperties = value; - } - } - - internal IDictionary GlobalPropertiesPassedByTask - { - get - { - return this.globalPropertiesPassedByTask; - } - } - - internal bool BuildCompleted - { - get - { - return this.buildCompleted; - } - set - { - this.buildCompleted = value; - } - } - - internal int RequestId - { - get - { - return this.requestId; - } - set - { - this.requestId = value; - } - } - - /// - /// Returns true if this BuildRequest came from a task, rather than - /// the Host Engine itself. - /// - internal bool IsGeneratedRequest - { - get - { - return handleId != EngineCallback.invalidEngineHandle; - } - } - - /// - /// This is set to true if the build request was sent from the parent process - /// - internal bool IsExternalRequest - { - get - { - return isExternalRequest; - } - set - { - isExternalRequest = value; - } - } - - internal bool UnloadProjectsOnCompletion - { - get - { - return this.unloadProjectsOnCompletion; - } - } - - internal bool UseResultsCache - { - get - { - return this.useResultsCache; - } - set - { - this.useResultsCache = value; - } - } - - internal string DefaultTargets - { - get - { - return this.defaultTargets; - } - set - { - this.defaultTargets = value; - } - } - - internal string InitialTargets - { - get - { - return this.initialTargets; - } - set - { - this.initialTargets = value; - } - } - - internal BuildEventContext ParentBuildEventContext - { - get - { - return buildEventContext; - } - - set - { - buildEventContext = value; - } - } - - - internal string ToolsetVersion - { - get - { - return toolsetVersion; - } - set - { - this.toolsetVersion = value; - } - } - - internal InvalidProjectFileException BuildException - { - get - { - return buildException; - } - set - { - buildException = value; - } - } - - internal bool ToolsVersionPeekedFromProjectFile - { - get - { - return toolsVersionPeekedFromProjectFile; - } - set - { - toolsVersionPeekedFromProjectFile = value; - } - } - - /// - /// True if the build results in this requests have been restored from the cache - /// (in which case there's no point in caching them again) - /// - internal bool RestoredFromCache - { - get - { - return this.restoredFromCache; - } - } - - // Temp timing data properties - internal long StartTime - { - get { return startTime; } - set { startTime = value; } - } - - internal long ProcessingStartTime - { - get { return processingStartTime; } - set { processingStartTime = value; } - } - - internal long ProcessingTotalTime - { - get { return processingTotalTime; } - set { processingTotalTime = value; } - } - - #endregion - - #region Methods - - /// - /// Restore the default values which do not travel over the wire - /// - internal void RestoreNonSerializedDefaults() - { - this.outputsByTarget = new Hashtable(); - this.resultByTarget = new Hashtable(StringComparer.OrdinalIgnoreCase); - this.projectToBuild = null; - this.buildSettings = BuildSettings.None; - this.fireProjectStartedFinishedEvents = true; - this.nodeIndex = EngineCallback.invalidNode; - this.buildCompleted = false; - this.buildSucceeded = false; - this.defaultTargets = null; - this.initialTargets = null; - this.restoredFromCache = false; - this.isExternalRequest = false; - this.parentHandleId = EngineCallback.invalidEngineHandle; - this.projectId = 0; - this.startTime = 0; - this.taskTime = 0; - this.processingTotalTime = 0; - } - - /// - /// Initialize this build request with a cached build result - /// - /// - internal void InitializeFromCachedResult(BuildResult cachedResult) - { - this.OutputsByTarget = cachedResult.OutputsByTarget; - this.BuildSucceeded = cachedResult.EvaluationResult; - this.BuildCompleted = true; - this.DefaultTargets = cachedResult.DefaultTargets; - this.InitialTargets = cachedResult.InitialTargets; - this.projectId = cachedResult.ProjectId; - this.restoredFromCache = true; - } - - internal BuildResult GetBuildResult() - { - // Calculate the time spent on this build request - int totalTime = 0; - int engineTime = 0; - int taskTimeMs = 0; - if (startTime != 0) - { - TimeSpan totalTimeSpan = new TimeSpan(DateTime.Now.Ticks - startTime); - totalTime = (int)totalTimeSpan.TotalMilliseconds; - } - if (processingTotalTime != 0) - { - TimeSpan processingTimeSpan = new TimeSpan(processingTotalTime); - engineTime = (int)processingTimeSpan.TotalMilliseconds; - } - if (taskTime != 0) - { - TimeSpan taskTimeSpan = new TimeSpan(taskTime); - taskTimeMs = (int)taskTimeSpan.TotalMilliseconds; - } - return new BuildResult(outputsByTarget, resultByTarget, buildSucceeded, handleId, requestId, projectId, useResultsCache, defaultTargets, initialTargets, totalTime, engineTime, taskTimeMs); - } - - /// - /// Provides unique identifers for the caching system so we can retrieve this set of targets - /// at a later time. This list should be either a null array or a list of strings which are not null. - /// - /// - internal string GetTargetNamesList() - { - string list = null; - if (targetNames != null) - { - if (targetNames.Length == 1) - { - list = targetNames[0]; - } - else - { - StringBuilder targetsBuilder = new StringBuilder(); - foreach (string target in targetNames) - { - //We are making sure that null targets are not concatonated because they do not count as a valid target - ErrorUtilities.VerifyThrowArgumentNull(target, "target should not be null"); - targetsBuilder.Append(target); - targetsBuilder.Append(';'); - } - list = targetsBuilder.ToString(); - } - } - - return list; - } - - /// - /// This method is called after a task finishes execution in order to add the time spent executing - /// the task to the total used by the build request - /// - /// execution time of the last task - internal void AddTaskExecutionTime(long executionTime) - { - taskTime += executionTime; - } - - #endregion - - #region Member data - - private int requestId; - private int handleId; - private string projectFileName; - private string[] targetNames; - private BuildPropertyGroup globalProperties; - private string toolsetVersion; - private bool unloadProjectsOnCompletion; - private bool useResultsCache; - // This is the event context of the task / host which made the buildRequest - // the buildEventContext is used to determine who the parent project is - private BuildEventContext buildEventContext; - - #region CustomSerializationToStream - internal void WriteToStream(BinaryWriter writer) - { - writer.Write((Int32)requestId); - writer.Write((Int32)handleId); - #region ProjectFileName - if (projectFileName == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - writer.Write(projectFileName); - } - #endregion - #region TargetNames - //Write Number of HashItems - if (targetNames == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - writer.Write((Int32)targetNames.Length); - foreach (string targetName in targetNames) - { - if (targetName == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - writer.Write(targetName); - } - } - } - #endregion - #region GlobalProperties - // Write the global properties - if (globalProperties == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - globalProperties.WriteToStream(writer); - } - #endregion - #region ToolsetVersion - if (toolsetVersion == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - writer.Write(toolsetVersion); - } - #endregion - writer.Write(unloadProjectsOnCompletion); - writer.Write(useResultsCache); - #region BuildEventContext - if (buildEventContext == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - writer.Write((Int32)buildEventContext.NodeId); - writer.Write((Int32)buildEventContext.ProjectContextId); - writer.Write((Int32)buildEventContext.TargetId); - writer.Write((Int32)buildEventContext.TaskId); - } - #endregion - #region ToolsVersionPeekedFromProjectFile - // We need to pass this over shared memory because where ever this project is being built needs to know - // if the tools version was an override or was retreived from the project file - if (!this.toolsVersionPeekedFromProjectFile) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - } - #endregion - } - - internal static BuildRequest CreateFromStream(BinaryReader reader) - { - BuildRequest request = new BuildRequest(); - request.requestId = reader.ReadInt32(); - request.handleId = reader.ReadInt32(); - #region ProjectFileName - if (reader.ReadByte() == 0) - { - request.projectFileName = null; - } - else - { - request.projectFileName = reader.ReadString(); - } - #endregion - #region TargetNames - if (reader.ReadByte() == 0) - { - request.targetNames = null; - } - else - { - int numberOfTargetNames = reader.ReadInt32(); - request.targetNames = new string[numberOfTargetNames]; - for (int i = 0; i < numberOfTargetNames; i++) - { - if (reader.ReadByte() == 0) - { - request.targetNames[i] = null; - } - else - { - request.targetNames[i] = reader.ReadString(); - } - } - } - #endregion - #region GlobalProperties - if (reader.ReadByte() == 0) - { - request.globalProperties = null; - } - else - { - request.globalProperties = new BuildPropertyGroup(); - request.globalProperties.CreateFromStream(reader); - } - #endregion - #region ToolsetVersion - if (reader.ReadByte() == 0) - { - request.toolsetVersion = null; - } - else - { - request.toolsetVersion = reader.ReadString(); - } - #endregion - request.unloadProjectsOnCompletion = reader.ReadBoolean(); - request.useResultsCache = reader.ReadBoolean(); - #region BuildEventContext - if (reader.ReadByte() == 0) - { - request.buildEventContext = null; - } - else - { - // Re create event context - int nodeId = reader.ReadInt32(); - int projectContextId = reader.ReadInt32(); - int targetId = reader.ReadInt32(); - int taskId = reader.ReadInt32(); - request.buildEventContext = new BuildEventContext(nodeId, targetId, projectContextId, taskId); - } - #endregion - #region ToolsVersionPeekedFromProjectFile - // We need to pass this over shared memory because where ever this project is being built needs to know - // if the tools version was an override or was retreived from the project file - if (reader.ReadByte() == 0) - { - request.toolsVersionPeekedFromProjectFile = false; - } - else - { - request.toolsVersionPeekedFromProjectFile = true; - } - #endregion - return request; - } - #endregion - - private InvalidProjectFileException buildException; - private string defaultTargets; - private string initialTargets; - private IDictionary outputsByTarget; - private Hashtable resultByTarget; - private bool buildCompleted; - private bool buildSucceeded; - private Hashtable globalPropertiesPassedByTask; - private int nodeIndex; - private Engine parentEngine; - private Project projectToBuild; - private bool fireProjectStartedFinishedEvents; - private BuildSettings buildSettings; - private bool restoredFromCache; - private bool isExternalRequest; - private int parentHandleId; - private int parentRequestId; - private int projectId; - // Timing data - used to profile the build - private long startTime; - private long processingStartTime; - private long processingTotalTime; - private long taskTime; - // We peeked at the tools version from the project file because the tools version was null - private bool toolsVersionPeekedFromProjectFile; - #endregion - } -} diff --git a/src/Deprecated/Engine/Engine/BuildResult.cs b/src/Deprecated/Engine/Engine/BuildResult.cs deleted file mode 100644 index 921eb36531e..00000000000 --- a/src/Deprecated/Engine/Engine/BuildResult.cs +++ /dev/null @@ -1,426 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections; -using System.IO; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class is a container for build results travelling from the engine to the node - /// - internal class BuildResult - { - #region Constructions - - internal BuildResult() - { - // used for serialization - } - - /// - /// Constructor - /// - internal BuildResult - ( - IDictionary outputsByTarget, Hashtable resultByTarget, bool evaluationResult, - int handleId, int requestId, int projectId, bool useResultCache, - string defaultTargets, string initialTargets, - int totalTime, int engineTime, int taskTime - ) - { - this.outputsByTarget = outputsByTarget; - this.resultByTarget = resultByTarget; - this.handleId = handleId; - this.requestId = requestId; - this.projectId = projectId; - this.flags = (byte)((evaluationResult ? 1 : 0) | (useResultCache ? 2 : 0)); - this.defaultTargets = defaultTargets; - this.initialTargets = initialTargets; - this.totalTime = totalTime; - this.engineTime = engineTime; - this.taskTime = taskTime; - } - - /// - /// Copy constructor - /// - internal BuildResult - (BuildResult buildResultToCopy, bool deepCopy) - { - ErrorUtilities.VerifyThrowArgumentNull(buildResultToCopy, "Cannot have a null build result passed in"); - this.flags = buildResultToCopy.flags; - this.handleId = buildResultToCopy.handleId; - this.requestId = buildResultToCopy.requestId; - this.projectId = buildResultToCopy.projectId; - this.outputsByTarget = new Hashtable(); - this.defaultTargets = buildResultToCopy.defaultTargets; - this.initialTargets = buildResultToCopy.initialTargets; - this.resultByTarget = new Hashtable(buildResultToCopy.resultByTarget, StringComparer.OrdinalIgnoreCase); - - if (buildResultToCopy.outputsByTarget == null) - { - return; - } - - if (deepCopy) - { - // Copy all the old data - foreach (DictionaryEntry entry in buildResultToCopy.outputsByTarget) - { - // Make deep copies of all the target outputs before - // passing them back - BuildItem[] originalArray = (BuildItem[])entry.Value; - BuildItem[] itemArray = new BuildItem[originalArray.Length]; - for (int i = 0; i < originalArray.Length; i++) - { - if (!originalArray[i].IsUninitializedItem) - { - itemArray[i] = originalArray[i].Clone(); - itemArray[i].CloneVirtualMetadata(); - } - else - { - itemArray[i] = new BuildItem(null, originalArray[i].FinalItemSpecEscaped); - } - } - - this.outputsByTarget.Add(entry.Key, itemArray); - } - } - else - { - // Create a new hashtable but point at the same data - foreach (DictionaryEntry entry in buildResultToCopy.outputsByTarget) - { - this.outputsByTarget.Add(entry.Key, entry.Value); - } - } - } - - #endregion - - #region Properties - internal IDictionary OutputsByTarget - { - get - { - return this.outputsByTarget; - } - } - - internal Hashtable ResultByTarget - { - get - { - return this.resultByTarget; - } - } - - internal bool EvaluationResult - { - get - { - return (this.flags & 1) == 0 ? false : true; - } - } - - internal int HandleId - { - get - { - return this.handleId; - } - set - { - this.handleId = value; - } - } - - internal int RequestId - { - get - { - return this.requestId; - } - set - { - this.requestId = value; - } - } - - internal int ProjectId - { - get - { - return this.projectId; - } - } - - internal bool UseResultCache - { - get - { - return (this.flags & 2) == 0 ? false : true; - } - } - - internal string DefaultTargets - { - get - { - return this.defaultTargets; - } - } - - internal string InitialTargets - { - get - { - return this.initialTargets; - } - } - - /// - /// Total time spent on the build request measured from the time it is received to the time build - /// result is created. This number will be 0 if the result was in the cache. - /// - internal int TotalTime - { - get - { - return this.totalTime; - } - } - - /// - /// Total time spent in the engine working on the build request. This number will be 0 if the result - /// was in the cache. - /// - internal int EngineTime - { - get - { - return this.engineTime; - } - } - - /// - /// Total time spent in the running tasks for the build request. This number will be 0 if the result - /// was in the cache. - /// - internal int TaskTime - { - get - { - return this.taskTime; - } - } - #endregion - - #region Methods - - /// - /// BuildItems are passed around internally, including across the wire. Before passing these - /// to tasks, they need to be converted into TaskItems using this method. - /// - internal void ConvertToTaskItems() - { - // If outputsByTarget was null then we dont have to re-create anything as nothing was passed over - if (outputsByTarget != null) - { - string[] keys = new string[outputsByTarget.Count]; - outputsByTarget.Keys.CopyTo(keys, 0); - for (int key_index = 0; key_index < keys.Length; key_index++) - { - object key = keys[key_index]; - BuildItem[] originalArray = (BuildItem[])outputsByTarget[key]; - outputsByTarget[key] = BuildItem.ConvertBuildItemArrayToTaskItems(originalArray); - } - } - } - #endregion - - #region Data - private IDictionary outputsByTarget; - private Hashtable resultByTarget; - private byte flags; - private int handleId; - private int requestId; - private int projectId; - private string defaultTargets; - private string initialTargets; - - // Timing data related to the execution of the request - private int totalTime; - private int engineTime; - private int taskTime; - - #endregion - - #region CustomSerializationToStream - internal void WriteToStream(BinaryWriter writer) - { - ErrorUtilities.VerifyThrow(resultByTarget != null, "resultsByTarget cannot be null"); - #region OutputsByTarget - if (outputsByTarget == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - writer.Write((Int32)outputsByTarget.Count); - foreach (string key in outputsByTarget.Keys) - { - writer.Write(key); - if (outputsByTarget[key] == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - BuildItem[] items = ((BuildItem[])outputsByTarget[key]); - writer.Write((Int32)items.Length); - foreach (BuildItem item in items) - { - if (item == null) - { - writer.Write((byte)0); - } - writer.Write((byte)1); - item.WriteToStream(writer); - } - } - } - } - #endregion - #region ResultByTarget - //Write Number of HashItems - writer.Write((Int32)resultByTarget.Count); - foreach (string key in resultByTarget.Keys) - { - writer.Write(key); - writer.Write((Int32)resultByTarget[key]); - } - #endregion - writer.Write((byte)flags); - writer.Write((Int32)handleId); - writer.Write((Int32)requestId); - writer.Write((Int32)projectId); - #region DefaultTargets - if (defaultTargets == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - writer.Write(defaultTargets); - } - #endregion - #region InitialTargets - if (initialTargets == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - writer.Write(initialTargets); - } - #endregion - #region Timing data - writer.Write((Int32)totalTime); - writer.Write((Int32)engineTime); - writer.Write((Int32)taskTime); - #endregion - } - - internal static BuildResult CreateFromStream(BinaryReader reader) - { - BuildResult buildResult = new BuildResult(); - #region OutputsByTarget - if (reader.ReadByte() == 0) - { - buildResult.outputsByTarget = null; - } - else - { - int numberOfElements = reader.ReadInt32(); - buildResult.outputsByTarget = new Hashtable(numberOfElements, StringComparer.OrdinalIgnoreCase); - for (int i = 0; i < numberOfElements; i++) - { - string key = reader.ReadString(); - BuildItem[] value = null; - if (reader.ReadByte() != 0) - { - int sizeOfArray = reader.ReadInt32(); - value = new BuildItem[sizeOfArray]; - for (int j = 0; j < sizeOfArray; j++) - { - BuildItem itemToAdd = null; - if (reader.ReadByte() != 0) - { - itemToAdd = new BuildItem(null, string.Empty); - itemToAdd.CreateFromStream(reader); - } - value[j] = itemToAdd; - } - } - buildResult.outputsByTarget.Add(key, value); - } - } - #endregion - #region ResultsByTarget - //Write Number of HashItems - int numberOfHashKeyValuePairs = reader.ReadInt32(); - buildResult.resultByTarget = new Hashtable(numberOfHashKeyValuePairs, StringComparer.OrdinalIgnoreCase); - for (int i = 0; i < numberOfHashKeyValuePairs; i++) - { - string key = reader.ReadString(); - int value = reader.ReadInt32(); - buildResult.resultByTarget.Add(key, (Target.BuildState)value); - } - #endregion - buildResult.flags = reader.ReadByte(); - buildResult.handleId = reader.ReadInt32(); - buildResult.requestId = reader.ReadInt32(); - buildResult.projectId = reader.ReadInt32(); - #region DefaultTargets - if (reader.ReadByte() == 0) - { - buildResult.defaultTargets = null; - } - else - { - buildResult.defaultTargets = reader.ReadString(); - } - #endregion - #region InitialTargets - if (reader.ReadByte() == 0) - { - buildResult.initialTargets = null; - } - else - { - buildResult.initialTargets = reader.ReadString(); - } - #endregion - #region Timing data - buildResult.totalTime = reader.ReadInt32(); - buildResult.engineTime = reader.ReadInt32(); - buildResult.taskTime = reader.ReadInt32(); - #endregion - return buildResult; - } - #endregion - } -} diff --git a/src/Deprecated/Engine/Engine/BuildTask.cs b/src/Deprecated/Engine/Engine/BuildTask.cs deleted file mode 100644 index ca1e9c4dffc..00000000000 --- a/src/Deprecated/Engine/Engine/BuildTask.cs +++ /dev/null @@ -1,706 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Xml; -using System.Collections; - -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine.Shared; - -using error = Microsoft.Build.BuildEngine.Shared.ErrorUtilities; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// This class represents a single task. - /// - /// - /// [!WARNING] - /// > This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// rgoel - public class BuildTask - { - #region Member Data - - // The task XML element, if this is a persisted target. - private XmlElement taskElement = null; - - // This is the "Condition" attribute on the task element. - private XmlAttribute conditionAttribute = null; - - // This is the "ContinueOnError" attribute on the task element. - private XmlAttribute continueOnErrorAttribute = null; - - // The target to which this task belongs. - private Target parentTarget = null; - - // The name of the task. - private string taskName = String.Empty; - - // If this is a persisted task element, this boolean tells us whether - // it came from the main project file or an imported project file. - private bool importedFromAnotherProject = false; - - // This is the optional host object for this particular task. The actual task - // object will get passed this host object, and can communicate with it as it - // wishes. Although it is declared generically as an "Object" here, the actual - // task will cast it to whatever it expects. - private ITaskHost hostObject = null; - - #endregion - - #region Constructors - /// - /// This constructor initializes a persisted task from an existing task - /// element which exists either in the main project file or one of the - /// imported files. - /// - /// - /// - /// - /// rgoel - internal BuildTask - ( - XmlElement taskElement, - Target parentTarget, - bool importedFromAnotherProject - ) - { - // Make sure a valid node has been given to us. - error.VerifyThrow(taskElement != null, "Need a valid XML node."); - - // Make sure a valid target has been given to us. - error.VerifyThrow(parentTarget != null, "Need a valid target parent."); - - this.taskElement = taskElement; - this.parentTarget = parentTarget; - this.conditionAttribute = null; - this.continueOnErrorAttribute = null; - this.importedFromAnotherProject = importedFromAnotherProject; - - // Loop through all the attributes on the task element. - foreach (XmlAttribute taskAttribute in taskElement.Attributes) - { - switch (taskAttribute.Name) - { - case XMakeAttributes.condition: - this.conditionAttribute = taskAttribute; - break; - - case XMakeAttributes.continueOnError: - this.continueOnErrorAttribute = taskAttribute; - break; - - // this only makes sense in the context of the new OM, - // so just ignore it. - case XMakeAttributes.msbuildRuntime: - // do nothing - break; - - // this only makes sense in the context of the new OM, - // so just ignore it. - case XMakeAttributes.msbuildArchitecture: - // do nothing - break; - } - } - - this.taskName = taskElement.Name; - } - - #endregion - - #region Properties - - /// - /// Read-only accessor for XML element representing this task. - /// - /// - /// RGoel - internal XmlElement TaskXmlElement - { - get - { - return this.taskElement; - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Accessor for the task's "name" element. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// RGoel - public string Name - { - get - { - return this.taskName; - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Accessor for the task's "condition". - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// RGoel - public string Condition - { - get - { - return (this.conditionAttribute == null) ? String.Empty : this.conditionAttribute.Value; - } - - set - { - // If this Task object is not actually represented by a - // task element in the project file, then do not allow - // the caller to set the condition. - error.VerifyThrowInvalidOperation(this.taskElement != null, - "CannotSetCondition"); - - // If this task was imported from another project, we don't allow modifying it. - error.VerifyThrowInvalidOperation(!this.importedFromAnotherProject, - "CannotModifyImportedProjects"); - - this.conditionAttribute = ProjectXmlUtilities.SetOrRemoveAttribute(taskElement, XMakeAttributes.condition, value); - - this.MarkTaskAsDirty(); - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Accessor for the task's "ContinueOnError". - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// RGoel - public bool ContinueOnError - { - get - { - Expander expander = new Expander(parentTarget.ParentProject.evaluatedProperties, parentTarget.ParentProject.evaluatedItemsByName); - - // NOTE: if the ContinueOnError attribute contains an item metadata reference, this property is meaningless - // because we are unable to batch -- this property will always be 'false' in that case - if ((continueOnErrorAttribute != null) && - ConversionUtilities.ConvertStringToBool - ( - expander.ExpandAllIntoString(continueOnErrorAttribute.Value, continueOnErrorAttribute) - )) - { - return true; - } - else - { - return false; - } - } - - set - { - // If this Task object is not actually represented by a - // task element in the project file, then do not allow - // the caller to set the attribute. - error.VerifyThrowInvalidOperation(this.taskElement != null, - "CannotSetContinueOnError"); - - // If this task was imported from another project, we don't allow modifying it. - error.VerifyThrowInvalidOperation(!this.importedFromAnotherProject, - "CannotModifyImportedProjects"); - - if (value) - { - this.taskElement.SetAttribute(XMakeAttributes.continueOnError, "true"); - } - else - { - // Set the new "ContinueOnError" attribute on the task element. - this.taskElement.SetAttribute(XMakeAttributes.continueOnError, "false"); - } - - this.continueOnErrorAttribute = this.taskElement.Attributes[XMakeAttributes.continueOnError]; - - this.MarkTaskAsDirty(); - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// System.Type object corresponding to the task class that implements - /// the functionality that runs this task object. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// RGoel - public Type Type - { - get - { - // put verify throw for target name - ErrorUtilities.VerifyThrow(this.ParentTarget != null, "ParentTarget should not be null"); - Engine parentEngine = this.ParentTarget.ParentProject.ParentEngine; - Project parentProject = this.ParentTarget.ParentProject; - string projectFileOfTaskNode = XmlUtilities.GetXmlNodeFile(taskElement, parentProject.FullFileName); - BuildEventContext taskContext = new BuildEventContext - ( - parentProject.ProjectBuildEventContext.NodeId, - this.ParentTarget.Id, - parentProject.ProjectBuildEventContext.ProjectContextId, - parentProject.ProjectBuildEventContext.TaskId - ); - - int handleId = parentEngine.EngineCallback.CreateTaskContext(parentProject, ParentTarget, null, taskElement, - EngineCallback.inProcNode, taskContext); - EngineLoggingServices loggingServices = parentEngine.LoggingServices; - TaskExecutionModule taskExecutionModule = parentEngine.NodeManager.TaskExecutionModule; - - TaskEngine taskEngine = new TaskEngine(taskElement, null, - projectFileOfTaskNode, parentProject.FullFileName, loggingServices, handleId, taskExecutionModule, taskContext); - - ErrorUtilities.VerifyThrowInvalidOperation(taskEngine.FindTask(), - "MissingTaskError", taskName, parentEngine.ToolsetStateMap[ParentTarget.ParentProject.ToolsVersion].ToolsPath); - - return taskEngine.TaskClass.Type; - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Accessor for the "host object" for this task. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// RGoel - public ITaskHost HostObject - { - get - { - return this.hostObject; - } - - set - { - this.hostObject = value; - } - } - - /// - /// Accessor for parent Target object. - /// - /// - /// RGoel - internal Target ParentTarget - { - get - { - return this.parentTarget; - } - - set - { - this.parentTarget = value; - } - } - - #endregion - - #region Methods - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// This retrieves the list of all parameter names from the element - /// node of this task. Note that it excludes anything that a specific - /// property is exposed for or that isn't valid here (Name, Condition, - /// ContinueOnError). - /// - /// Note that if there are none, it returns string[0], rather than null, - /// as it makes writing foreach statements over the return value so - /// much simpler. - /// - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// rgoel - public string[] GetParameterNames() - { - if (this.taskElement == null) - { - return new string[0]; - } - - ArrayList list = new ArrayList(); - foreach (XmlAttribute attrib in this.taskElement.Attributes) - { - string attributeValue = attrib.Name; - - if (!XMakeAttributes.IsSpecialTaskAttribute(attributeValue)) - { - list.Add(attributeValue); - } - } - - return (string[])list.ToArray(typeof(string)); - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// This retrieves an arbitrary attribute from the task element. These - /// are attributes that the project author has placed on the task element - /// that have no meaning to MSBuild other than that they get passed to the - /// task itself as arguments. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// RGoel - public string GetParameterValue - ( - string attributeName - ) - { - // You can only request the value of user-defined attributes. The well-known - // ones, like "ContinueOnError" for example, are accessed through other means. - error.VerifyThrowArgument(!XMakeAttributes.IsSpecialTaskAttribute(attributeName), - "CannotAccessKnownAttributes", attributeName); - - error.VerifyThrowInvalidOperation(this.taskElement != null, - "CannotUseParameters"); - - // If this is a persisted Task, grab the attribute directly from the - // task element. - return taskElement.GetAttribute(attributeName) ?? string.Empty; - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// This sets an arbitrary attribute on the task element. These - /// are attributes that the project author has placed on the task element - /// that get passed in to the task. - /// - /// This optionally escapes the parameter value so it will be treated as a literal. - /// - /// - /// - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// RGoel - public void SetParameterValue - ( - string parameterName, - string parameterValue, - bool treatParameterValueAsLiteral - ) - { - this.SetParameterValue(parameterName, treatParameterValueAsLiteral ? EscapingUtilities.Escape(parameterValue) : parameterValue); - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// This sets an arbitrary attribute on the task element. These - /// are attributes that the project author has placed on the task element - /// that get passed in to the task. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// RGoel - public void SetParameterValue - ( - string parameterName, - string parameterValue - ) - { - // You can only set the value of user-defined attributes. The well-known - // ones, like "ContinueOnError" for example, are accessed through other means. - error.VerifyThrowArgument(!XMakeAttributes.IsSpecialTaskAttribute(parameterName), - "CannotAccessKnownAttributes", parameterName); - - // If this task was imported from another project, we don't allow modifying it. - error.VerifyThrowInvalidOperation(!this.importedFromAnotherProject, - "CannotModifyImportedProjects"); - - error.VerifyThrowInvalidOperation(this.taskElement != null, - "CannotUseParameters"); - - // If this is a persisted Task, set the attribute directly on the - // task element. - taskElement.SetAttribute(parameterName, parameterValue); - - this.MarkTaskAsDirty(); - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Adds an Output tag to this task element - /// - /// - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// LukaszG - public void AddOutputItem(string taskParameter, string itemName) - { - AddOutputItem(taskParameter, itemName, null); - } - - /// - /// Adds an Output tag to this task element, with a condition - /// - /// - /// - /// May be null - internal void AddOutputItem(string taskParameter, string itemName, string condition) - { - // If this task was imported from another project, we don't allow modifying it. - error.VerifyThrowInvalidOperation(!this.importedFromAnotherProject, - "CannotModifyImportedProjects"); - - error.VerifyThrowInvalidOperation(this.taskElement != null, - "CannotUseParameters"); - - XmlElement newOutputElement = this.taskElement.OwnerDocument.CreateElement(XMakeElements.output, XMakeAttributes.defaultXmlNamespace); - newOutputElement.SetAttribute(XMakeAttributes.taskParameter, taskParameter); - newOutputElement.SetAttribute(XMakeAttributes.itemName, itemName); - - if (condition != null) - { - newOutputElement.SetAttribute(XMakeAttributes.condition, condition); - } - - this.taskElement.AppendChild(newOutputElement); - - this.MarkTaskAsDirty(); - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Adds an Output tag to this task element - /// - /// - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// LukaszG - public void AddOutputProperty(string taskParameter, string propertyName) - { - // If this task was imported from another project, we don't allow modifying it. - error.VerifyThrowInvalidOperation(!this.importedFromAnotherProject, - "CannotModifyImportedProjects"); - - error.VerifyThrowInvalidOperation(this.taskElement != null, - "CannotUseParameters"); - - XmlElement newOutputElement = this.taskElement.OwnerDocument.CreateElement(XMakeElements.output, XMakeAttributes.defaultXmlNamespace); - newOutputElement.SetAttribute(XMakeAttributes.taskParameter, taskParameter); - newOutputElement.SetAttribute(XMakeAttributes.propertyName, propertyName); - - this.taskElement.AppendChild(newOutputElement); - - this.MarkTaskAsDirty(); - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Runs the task associated with this object. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// RGoel - public bool Execute - ( - ) - { - error.VerifyThrowInvalidOperation(this.taskElement != null, - "CannotExecuteUnassociatedTask"); - - error.VerifyThrowInvalidOperation(this.parentTarget != null, - "CannotExecuteUnassociatedTask"); - - return this.parentTarget.ExecuteOneTask(this.taskElement, this.HostObject); - } - - /// - /// Indicates that something has changed within the task element, so the project - /// needs to be saved and re-evaluated at next build. Send the "dirtiness" - /// notification up the chain. - /// - /// RGoel - private void MarkTaskAsDirty - ( - ) - { - - - // This is a change to the contents of the target. - this.ParentTarget?.MarkTargetAsDirty(); - - } - - #endregion - } -} diff --git a/src/Deprecated/Engine/Engine/CacheManager.cs b/src/Deprecated/Engine/Engine/CacheManager.cs deleted file mode 100644 index 0d9d9c19f37..00000000000 --- a/src/Deprecated/Engine/Engine/CacheManager.cs +++ /dev/null @@ -1,253 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections; -using System.Collections.Generic; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// Internal enum for distinguishing between cache content types - /// - internal enum CacheContentType - { - // Cached build results for targets - only accessible internally from the engine - BuildResults = 0, - - // Items cached from tasks - Items = 1, - - // Properties cached from tasks - Properties = 2, - LastContentTypeIndex = 2 - } - - /// - /// This class is responsible for maintaining the set of object - /// cached during a build session. This class is not thread safe and - /// is intended to be used from the Engine thread. - /// - internal class CacheManager - { - #region Constructors - internal CacheManager(string defaultVersion) - { - cacheContents = new Hashtable[(int)CacheContentType.LastContentTypeIndex + 1]; - - for (int i = 0; i < (int)CacheContentType.LastContentTypeIndex + 1; i++) - { - cacheContents[i] = new Hashtable(StringComparer.OrdinalIgnoreCase); - } - - this.defaultToolsVersion = defaultVersion; - } - - #endregion - - #region Properties - #endregion - - #region Methods - private CacheScope GetCacheScopeIfExists(string scopeName, BuildPropertyGroup scopeProperties, string scopeToolsVersion, CacheContentType cacheContentType) - { - CacheScope cacheScope = null; - - // Default the version to the default engine version - if (scopeToolsVersion == null) - { - scopeToolsVersion = defaultToolsVersion; - } - - // Retrieve list of scopes by this name - if (cacheContents[(int)cacheContentType].ContainsKey(scopeName)) - { - List scopesByName = (List)cacheContents[(int)cacheContentType][scopeName]; - - // If the list exists search for matching scope properties otherwise create the list - if (scopesByName != null) - { - lock (cacheManagerLock) - { - for (int i = 0; i < scopesByName.Count; i++) - { - if (scopesByName[i].ScopeProperties.IsEquivalent(scopeProperties) && (String.Equals(scopeToolsVersion, scopesByName[i].ScopeToolsVersion, StringComparison.OrdinalIgnoreCase))) - { - cacheScope = scopesByName[i]; - break; - } - } - } - } - } - - return cacheScope; - } - - /// - /// This method return a cache scope with particular name and properties. If the cache - /// scope doesn't exist it will be created. This method is thread safe. - /// - internal CacheScope GetCacheScope(string scopeName, BuildPropertyGroup scopeProperties, string scopeToolsVersion, CacheContentType cacheContentType) - { - // If the version is not specified default to the engine version - if (scopeToolsVersion == null) - { - scopeToolsVersion = defaultToolsVersion; - } - - // Retrieve the cache scope if it exists - CacheScope cacheScope = GetCacheScopeIfExists(scopeName, scopeProperties, scopeToolsVersion, cacheContentType); - // If the scope doesn't exist create it - if (cacheScope == null) - { - lock (cacheManagerLock) - { - cacheScope = GetCacheScopeIfExists(scopeName, scopeProperties, scopeToolsVersion, cacheContentType); - - if (cacheScope == null) - { - // If the list of scopes doesn't exist create it - if (!cacheContents[(int)cacheContentType].ContainsKey(scopeName)) - { - cacheContents[(int)cacheContentType].Add(scopeName, new List()); - } - // Create the scope and add it to the list - List scopesByName = (List)cacheContents[(int)cacheContentType][scopeName]; - cacheScope = new CacheScope(scopeName, scopeProperties, scopeToolsVersion); - scopesByName.Add(cacheScope); - } - } - } - - return cacheScope; - } - - /// - /// Sets multiple cache entries for the given scope - /// - /// - /// - /// - internal void SetCacheEntries(CacheEntry[] entries, string scopeName, BuildPropertyGroup scopeProperties, string scopeToolsVersion, CacheContentType cacheContentType) - { - // If the list exists search for matching scope properties otherwise create the list - CacheScope cacheScope = GetCacheScope(scopeName, scopeProperties, scopeToolsVersion, cacheContentType); - - // Add the entry to the right scope - cacheScope.AddCacheEntries(entries); - } - - /// - /// Gets multiple cache entries from the given scope. - /// - /// - /// - /// - /// - internal CacheEntry[] GetCacheEntries(string[] names, string scopeName, BuildPropertyGroup scopeProperties, string scopeToolsVersion, CacheContentType cacheContentType) - { - CacheScope cacheScope = GetCacheScopeIfExists(scopeName, scopeProperties, scopeToolsVersion, cacheContentType); - - if (cacheScope != null) - { - return cacheScope.GetCacheEntries(names); - } - - return new CacheEntry[names.Length]; - } - - /// - /// This method get a result from the cache if every target is cached. - /// If any of the target are not present in the cache null is returned. This method is not thread safe. - /// - internal BuildResult GetCachedBuildResult(BuildRequest buildRequest, out ArrayList actuallyBuiltTargets) - { - actuallyBuiltTargets = null; - - if (!buildRequest.UseResultsCache) - { - return null; - } - - // Retrieve list of scopes by this name - string projectName = buildRequest.ProjectToBuild == null ? - buildRequest.ProjectFileName : buildRequest.ProjectToBuild.FullFileName; - - // If the list exists search for matching scope properties otherwise create the list - CacheScope cacheScope = GetCacheScopeIfExists(projectName, buildRequest.GlobalProperties, buildRequest.ToolsetVersion, CacheContentType.BuildResults); - - // If there is no cache entry for this project return null - if (cacheScope == null) - { - return null; - } - - return cacheScope.GetCachedBuildResult(buildRequest, out actuallyBuiltTargets); - } - - /// - /// Clear a particular scope - /// - /// - /// - /// - internal void ClearCacheScope(string projectName, BuildPropertyGroup buildPropertyGroup, string toolsVersion, CacheContentType cacheContentType) - { - // Retrieve list of scopes by this name - if (cacheContents[(int)cacheContentType].ContainsKey(projectName)) - { - List scopesByName = (List)cacheContents[(int)cacheContentType][projectName]; - - // If the list exists search for matching scope properties otherwise create the list - if (scopesByName != null) - { - // If the version is not specified default to the engine version - if (toolsVersion == null) - { - toolsVersion = defaultToolsVersion; - } - - lock (cacheManagerLock) - { - for (int i = 0; i < scopesByName.Count; i++) - { - if (scopesByName[i].ScopeProperties.IsEquivalent(buildPropertyGroup) && (String.Equals(toolsVersion, scopesByName[i].ScopeToolsVersion, StringComparison.OrdinalIgnoreCase))) - { - scopesByName.RemoveAt(i); - break; - } - } - } - } - } - } - - /// - /// Clears the whole contents of the cache. - /// - internal void ClearCache() - { - // Abandon the old cache contents - for (int i = 0; i < (int)CacheContentType.LastContentTypeIndex + 1; i++) - { - cacheContents[i] = new Hashtable(StringComparer.OrdinalIgnoreCase); - } - } - - #endregion - - #region Data - // Array of cache contents per namespace - private Hashtable[] cacheContents; - // Lock object for the cache manager - private object cacheManagerLock = new object(); - // The default toolset version - private string defaultToolsVersion; - #endregion - } -} diff --git a/src/Deprecated/Engine/Engine/CacheScope.cs b/src/Deprecated/Engine/Engine/CacheScope.cs deleted file mode 100644 index 5ddeae99288..00000000000 --- a/src/Deprecated/Engine/Engine/CacheScope.cs +++ /dev/null @@ -1,440 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections; -using System.Threading; -using Microsoft.Build.BuildEngine.Shared; -using System.Globalization; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// The purpose of this class is to contain a set of cache entries which belong to - /// a particular scope. The scope is defined as string (project file name) X set of - /// string ( global properties ). This class is thread safe and can be used from multiple - /// threads. It is also lock free for multiple readers (via use of Hashtable as - /// the backing store). - /// We use a ReaderWriterLock in here so that when a request comes in for multiple - /// cache entries we guarantee that all the entries come from a consistent view of - /// the cache at some point in time. Without a lock we might get a write in between - /// the reads and half of the entries would represent the values before the write and - /// the rest after. This is unacceptable as at no point in time the cache actually contained - /// the entries that would be returned without the lock. This is required by the caching APIs - /// provided to the tasks which support retrieving multiple entries at once. - /// - internal class CacheScope - { - #region Constructors - - /// - /// This constructor creates a scope for a particular name and set of properties - /// - internal CacheScope(string scopeName, BuildPropertyGroup scopeProperties, string scopeToolsVersion) - { - // Make certain we don't cache a reference to a Project object, which would defeat - // the purpose of this cache - scopeProperties.ClearParentProject(); - - this.scopeName = scopeName; - this.scopeToolsVersion = scopeToolsVersion; - this.scopeProperties = scopeProperties; - this.cacheContents = new Hashtable(StringComparer.OrdinalIgnoreCase); - } - #endregion - - #region Properties - /// - /// Set of cached project file properties - /// - internal BuildPropertyGroup ScopeProperties - { - get - { - return this.scopeProperties; - } - } - - /// - /// Usually the project file name - /// - internal string ScopeName - { - get - { - return this.scopeName; - } - } - - /// - /// Usually the version of the toolset used - /// - internal string ScopeToolsVersion - { - get - { - return this.scopeToolsVersion; - } - } - #endregion - - #region Methods - - /// - /// This method adds an entry to the cache in a thread-safe way - /// - internal void AddCacheEntry(CacheEntry cacheEntry) - { - cacheScopeReaderWriterLock.AcquireWriterLock(Timeout.Infinite); - - try - { - if (cacheEntry != null) - { - AddCacheEntryInternal(cacheEntry); - } - } - finally - { - cacheScopeReaderWriterLock.ReleaseWriterLock(); - } - } - - /// - /// This method adds multiple entries to the cache in a thread-safe way. - /// - /// - internal void AddCacheEntries(CacheEntry[] cacheEntries) - { - cacheScopeReaderWriterLock.AcquireWriterLock(Timeout.Infinite); - - try - { - for (int i = 0; i < cacheEntries.Length; i++) - { - if (cacheEntries[i] != null) - { - AddCacheEntryInternal(cacheEntries[i]); - } - } - } - finally - { - cacheScopeReaderWriterLock.ReleaseWriterLock(); - } - } - - /// - /// This method adds an entry to the cache, without taking a lock - /// - private void AddCacheEntryInternal(CacheEntry cacheEntry) - { - if (!cacheContents.ContainsKey(cacheEntry.Name)) - { - cacheContents.Add(cacheEntry.Name, cacheEntry); - } - else - { - CacheEntry existingCacheEntry = (CacheEntry)cacheContents[cacheEntry.Name]; - // Make sure the cache values, if overwritten, stay the same. We do not currently support - // changing the cached value to something else. This allows us to not have a notification - // mechanism for changed values and if a node has a cached entry it can assume it's up to date. - // This can change in the future if we discover a compelling scenario for changing cache values. - if (!cacheEntry.IsEquivalent(existingCacheEntry)) - { - ErrorUtilities.VerifyThrowInvalidOperation(false, "CannotModifyCacheEntryValues"); - } - } - } - - /// - /// This method return the cache entry for a given name. If the cache entry doesn't exist it - /// return null. This method is thread safe. - /// - internal CacheEntry GetCacheEntry(string name) - { - if (cacheContents.ContainsKey(name)) - { - return (CacheEntry)cacheContents[name]; - } - - return null; - } - - /// - /// This method returns the requested set of cache entries. This method is thread safe - /// - /// - /// - internal CacheEntry[] GetCacheEntries(string[] names) - { - CacheEntry[] results = new CacheEntry[names.Length]; - - // This is read only, but since we're processing multiple entries we want to present a consistent - // view of the cache... we don't want a write between our reads - cacheScopeReaderWriterLock.AcquireReaderLock(Timeout.Infinite); - - try - { - for (int i = 0; i < names.Length; i++) - { - results[i] = GetCacheEntry(names[i]); - } - } - finally - { - cacheScopeReaderWriterLock.ReleaseReaderLock(); - } - - return results; - } - - /// - /// This method removes an entry from the cache if it exists and does nothing if it doesn't exist - /// This method is thread safe. - /// - internal void ClearCacheEntry(string name) - { - if (cacheContents.ContainsKey(name)) - { - cacheScopeReaderWriterLock.AcquireWriterLock(Timeout.Infinite); - - try - { - cacheContents.Remove(name); - } - finally - { - cacheScopeReaderWriterLock.ReleaseWriterLock(); - } - } - } - - /// - /// This method returns true if the cache entry for a given name is present in the cache. - /// This method is thread safe. - /// - internal bool ContainsCacheEntry(string name) - { - return cacheContents.ContainsKey(name); - } - - /// - /// This method adds cached results for each target results for which are contained inside - /// the build result. This method is thread safe. - /// - internal void AddCacheEntryForBuildResults(BuildResult buildResult) - { - ErrorUtilities.VerifyThrow(buildResult != null, "Expect a non-null build result"); - - // Don't cache results if they are marked as uncacheable - if (!buildResult.UseResultCache) - { - return; - } - - cacheScopeReaderWriterLock.AcquireWriterLock(Timeout.Infinite); - - try - { - if (!ContainsCacheEntry(Constants.defaultTargetCacheName)) - { - // If the project file is malformed the build may fail without initializing the initialtargets or - // the default targests fields. The retrieval code expects non-null values - // so it is necessary to replace null with empty string - ErrorUtilities.VerifyThrow(!buildResult.EvaluationResult || (buildResult.InitialTargets != null - && buildResult.DefaultTargets != null), - "Expect initial targets to be non-null for successful builds"); - string defaultTargets = buildResult.DefaultTargets ?? String.Empty; - PropertyCacheEntry defaultTargetsCacheEntry = new PropertyCacheEntry(Constants.defaultTargetCacheName, defaultTargets); - AddCacheEntryInternal(defaultTargetsCacheEntry); - - string initialTargets = buildResult.InitialTargets ?? String.Empty; - PropertyCacheEntry initialTargetsCacheEntry = new PropertyCacheEntry(Constants.initialTargetCacheName, initialTargets); - AddCacheEntryInternal(initialTargetsCacheEntry); - } - - if (!ContainsCacheEntry(Constants.projectIdCacheName)) - { - PropertyCacheEntry projectIdCacheEntry = new PropertyCacheEntry(Constants.projectIdCacheName, buildResult.ProjectId.ToString(CultureInfo.InvariantCulture)); - AddCacheEntryInternal(projectIdCacheEntry); - } - - IDictionary outputsByTargetName = buildResult.OutputsByTarget; - - //Create single entry for each target in the request - foreach (DictionaryEntry entry in buildResult.ResultByTarget) - { - Target.BuildState buildState = (Target.BuildState)entry.Value; - - // Only cache successful and failed targets - if ((buildState == Target.BuildState.CompletedSuccessfully) || - (buildState == Target.BuildState.CompletedUnsuccessfully)) - { - BuildItem[] targetOutputs = null; - - // Only cache output items for successful targets - if (buildState == Target.BuildState.CompletedSuccessfully) - { - ErrorUtilities.VerifyThrow(buildResult.OutputsByTarget.Contains(entry.Key), - "We must have build results for successful targets"); - - BuildItem[] outputItems = (BuildItem[])buildResult.OutputsByTarget[entry.Key]; - - // It's essential that we clear out any pointers to the project from the BuildItem; - // otherwise the cache will hold onto the project, and not save any memory. - if (outputItems != null) - { - for (int i = 0; i < outputItems.Length; i++) - { - outputItems[i] = outputItems[i].VirtualClone(true /* remove references to minimise transitive size */); - } - } - - targetOutputs = (BuildItem[])buildResult.OutputsByTarget[entry.Key]; - } - - BuildResultCacheEntry cacheEntry = new BuildResultCacheEntry((string)entry.Key, targetOutputs, - buildState == Target.BuildState.CompletedSuccessfully); - - if (Engine.debugMode) - { - Console.WriteLine("+++Adding cache entry for " + (string)entry.Key + " in " + - this.ScopeName + " result: " + (buildState == Target.BuildState.CompletedSuccessfully)); - } - - AddCacheEntryInternal(cacheEntry); - } - } - } - finally - { - cacheScopeReaderWriterLock.ReleaseWriterLock(); - } - } - - /// - /// Get a cached build result if available for the given request. This method is thread safe. - /// - /// - /// - /// - internal BuildResult GetCachedBuildResult(BuildRequest buildRequest, out ArrayList actuallyBuiltTargets) - { - actuallyBuiltTargets = null; - - PropertyCacheEntry defaultTargetsCacheEntry, initialTargetsCacheEntry, projectIdCacheEntry; - - // No writes here, but since we're reading multiple values we want to get a consistent view of the cache - cacheScopeReaderWriterLock.AcquireReaderLock(Timeout.Infinite); - - try - { - defaultTargetsCacheEntry = (PropertyCacheEntry)GetCacheEntry(Constants.defaultTargetCacheName); - initialTargetsCacheEntry = (PropertyCacheEntry)GetCacheEntry(Constants.initialTargetCacheName); - projectIdCacheEntry = (PropertyCacheEntry)GetCacheEntry(Constants.projectIdCacheName); - } - finally - { - cacheScopeReaderWriterLock.ReleaseReaderLock(); - } - - // If we ever built anything in this project we must have the default and initial targets. - if (defaultTargetsCacheEntry == null && initialTargetsCacheEntry == null) - { - return null; - } - - ErrorUtilities.VerifyThrow(projectIdCacheEntry != null, "We should always have the projectId cache entry"); - - ErrorUtilities.VerifyThrow(defaultTargetsCacheEntry != null && initialTargetsCacheEntry != null, - "We should have both the initial and default targets in the cache"); - - ArrayList targetsToBuild = new ArrayList(initialTargetsCacheEntry.Value.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries)); - - if (buildRequest.TargetNames == null || buildRequest.TargetNames.Length == 0) - { - targetsToBuild.AddRange(defaultTargetsCacheEntry.Value.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries)); - } - else - { - targetsToBuild.AddRange(buildRequest.TargetNames); - } - - // Create variable to hold the cached outputs - Hashtable outputsByTargetName = new Hashtable(targetsToBuild.Count); - Hashtable resultByTarget = new Hashtable(targetsToBuild.Count, StringComparer.OrdinalIgnoreCase); - - bool overallSuccess = true; - bool missingValues = false; - - // No writes here, but since we're reading multiple values we want to get a consistent view of the cache - cacheScopeReaderWriterLock.AcquireReaderLock(Timeout.Infinite); - - try - { - for (int i = 0; i < targetsToBuild.Count; i++) - { - string targetName = EscapingUtilities.UnescapeAll((string)targetsToBuild[i]); - if (ContainsCacheEntry(targetName)) - { - BuildResultCacheEntry cacheEntry = (BuildResultCacheEntry)GetCacheEntry(targetName); - overallSuccess = overallSuccess && cacheEntry.BuildResult; - resultByTarget[targetName] = (cacheEntry.BuildResult) ? - Target.BuildState.CompletedSuccessfully : Target.BuildState.CompletedUnsuccessfully; - - // Restore output items for successful targets - if (cacheEntry.BuildResult) - { - outputsByTargetName[targetName] = cacheEntry.BuildItems; - } - // We found a failed target - cut the loop short - else - { - break; - } - } - else - { - missingValues = true; - break; - } - } - } - finally - { - cacheScopeReaderWriterLock.ReleaseReaderLock(); - } - - if (missingValues) - { - return null; - } - - actuallyBuiltTargets = targetsToBuild; - - return new BuildResult(outputsByTargetName, resultByTarget, overallSuccess, buildRequest.HandleId, buildRequest.RequestId, - int.Parse(projectIdCacheEntry.Value, CultureInfo.InvariantCulture), false /* use results cache */, - defaultTargetsCacheEntry.Value, initialTargetsCacheEntry.Value, 0, 0, 0); - } - - #endregion - - #region Data - // This is normally the name of the project file to which the cached entries refer - private string scopeName; - // The version of the toolset the project uses - private string scopeToolsVersion; - // This is normally a set of properties for the project file to which the cached entries refer - private BuildPropertyGroup scopeProperties; - // This dictionary contains all the cached items within the current scope - private Hashtable cacheContents; - // Synchronization between multiple threads - private static ReaderWriterLock cacheScopeReaderWriterLock = new ReaderWriterLock(); - #endregion - } -} diff --git a/src/Deprecated/Engine/Engine/Engine.cs b/src/Deprecated/Engine/Engine/Engine.cs deleted file mode 100644 index f86f29afae3..00000000000 --- a/src/Deprecated/Engine/Engine/Engine.cs +++ /dev/null @@ -1,3071 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.IO; -using System.Xml; -using System.Diagnostics; -using System.Collections; -using System.Collections.Generic; -using System.Reflection; -using System.Globalization; -using System.Threading; - -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine.Shared; - -using error = Microsoft.Build.BuildEngine.Shared.ErrorUtilities; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// Flags for controlling the build. - /// - [Flags] - public enum BuildSettings - { - /// - /// The default build. - /// - None = 0, - - /// - /// When this flag is passed in, MSBuild assumes that no important external - /// state has changed (for example, no files reference by the project have - /// been modified) and doesn't rebuild any previously built targets. - /// - DoNotResetPreviouslyBuiltTargets = 1 - }; - - /// - /// Flags for controlling the project load. - /// - [Flags] - public enum ProjectLoadSettings - { - /// - /// Normal load - /// - None = 0, - - /// - /// Ignore nonexistent targets files when loading the project - /// - IgnoreMissingImports = 1 - } - - /// - /// Flags for controlling the toolset initialization. - /// - [Flags] - public enum ToolsetDefinitionLocations - { - /// - /// Do not read toolset information from any external location. - /// - None = 0, - - /// - /// Read toolset information from the exe configuration file. - /// - ConfigurationFile = 1, - - /// - /// Read toolset information from the registry (HKLM\Software\Microsoft\MSBuild\ToolsVersions). - /// - Registry = 2 - } - - /// - /// This class represents the MSBuild engine. In a system of project-to-project dependencies, this class keeps track of the - /// various projects being built, so that we can avoid building the same target in the same project more than once in a given - /// build. - /// - /// RGoel - [Obsolete("This class has been deprecated. Please use Microsoft.Build.Evaluation.ProjectCollection from the Microsoft.Build assembly instead.")] - public class Engine - { - #region Member Data - - // For those folks who want to share a single Engine object across many projects - // in a single AppDomain, we have a global one here that they can use. - private static Engine globalEngine; - - // This is just a dummy XmlDocument that we use when we need to create a new - // XmlElement or XmlAttribute that does not belong to any specific XML document. - // All XmlElements and XmlAttributes must have an associated XmlDocument ... - // hence this object. - private static XmlDocument globalDummyXmlDoc; - - // Dictionary of toolset states - // K: tools version - // V: matching toolset state - private Dictionary toolsetStateMap; - - // The collection of toolsets registered with this engine. - private ToolsetCollection toolsets; - - // The name of the current default toolsVersion. Starts with Constants.defaultVersion - private string defaultToolsVersion; - - // The node Id which the engine is running on - private int nodeId; - - // the engine's version stamp - private static Version engineVersion; - - // The initial set of properties to be used in building. - // This should include any properties that were set on the XMake - // command-line. This should not include environment variables, - // as those are added by the engine itself. - private BuildPropertyGroup engineGlobalProperties; - - // The properties gathered from the environment variables. This is populated - // by the engine itself, so callers need not do anything with this. - private readonly BuildPropertyGroup environmentProperties; - - // A list of projects currently loaded, indexed by project file fullpath. - private Hashtable projectsLoadedByHost; - - // A list of projects that are part of the current build. - private ProjectManager cacheOfBuildingProjects; - - // The number of projects that are currently in the process of building. - private int numberOfProjectsInProgress = 0; - - // This is the default value used by newly created projects for whether or not the building - // of targets is enabled. This is for security purposes in case a host wants to closely - // control which projects it allows to run targets/tasks. - private bool buildEnabled = true; - - // used to cache imported projects so that we do not repeatedly parse the project files - // PERF NOTE: even in a medium-sized build, since almost every project imports the same .targets files, we load the same - // XML over and over again - private Hashtable importedProjectsCache; - - // The logging services used to process all events raised by either engine or tasks. This - // logging service while running on the child maybe directing events to another logging service - // or out of the process - private EngineLoggingServices primaryLoggingServices; - - // External logging service responsible for sending the events from child to the parent - private EngineLoggingServices externalLoggingServices; - - // An event used by the logging service to indicate that it should be flushed - private ManualResetEvent flushRequestEvent; - - private DualQueue buildRequests; - - private ManualResetEvent engineAbortEvent = new ManualResetEvent(false); - - // a cached version of the engineAbortEvent so we don't have to wait on it to determine the value. - // If we do have to wait for something to happen we still need the event though. - private volatile bool engineAbortCachedValue = false; - - private object engineAbortLock = new object(); - - private DualQueue engineCommands; - - private DualQueue taskOutputUpdates; - - private Scheduler scheduler; - - private Router router; - - private EngineCallback engineCallback; - - // the engine's event source - private readonly EventSource eventSource; - - private EventSource eventSourceForForwarding; - - // the central or old style loggers listening to build events - private ArrayList loggers; - - // the forwarding loggers listening to build events - private ArrayList forwardingLoggers; - - // Node manager for the engine, directs requests to and from remote nodes - private NodeManager nodeManager; - - private CacheManager cacheManager; - - // this seed is used to generate unique logger ids for each distributed logger - private int lastUsedLoggerId; - - // this boolean is true if central logging is enabled - private bool enabledCentralLogging; - - // The class used to observe engine operation to collect data and detect errors - private Introspector introspector; - - // Last time stamp of activity in the engine build loop - private long lastLoopActivity; - - // Number of CPUs this engine is instantiated with - private int numberOfCpus; - - // The current directory at the time the Engine was constructed -- - // if msbuild.exe is hosting, this is the current directory when - // msbuild.exe was started - private string startupDirectory; - - // Next TaskId for tasks which will be run on this engine instance - private int nextTaskId = 0; - - // Counter for project objects - private int nextTargetId = 0; - - // Counter for project objects - private int nextProjectId = 0; - - // Counter of node Ids - private int nextNodeId = 1; - - // Context of the event in which the fatal error terminating the execution occurred - private BuildEventContext fatalErrorContext; - - // File name of the project in which fatal error occurred (cached in order to avoid complexity in the - // finally clause) - private string fatalErrorProjectName; - - // parameters used to configure the local node provider - private string localNodeProviderParameters; - - // Set to true once the local node provider has been initialize - private bool initializedLocaLNodeProvider; - - internal static bool debugMode = (Environment.GetEnvironmentVariable("MSBUILDDEBUG") == "1"); - - // True if timing data for the build should be collected - private bool profileBuild = (Environment.GetEnvironmentVariable("MSBUILDPROFILE") == "1"); - - /// - /// A array of string which list the properties that should be serialized accross from the child node - /// - private string[] propertyListToSerialize; - - /// - /// A ; delimited string which says which properties should be serialized accross from the child node - /// - private string forwardPropertiesFromChild = null; - #endregion - - #region Constructors - - /// - /// Default constructor that reads toolset information from both the registry - /// and configuration file. - /// The need for parameterless constructor is dictated by COM interop. - /// - public Engine() - : this(1 /* cpu */, false /* not child node */, 0 /* default NodeId */, null/*No msbuild.exe path*/, null, ToolsetDefinitionLocations.ConfigurationFile | ToolsetDefinitionLocations.Registry) - { - } - - /// - /// Constructor to initialize binPath. - /// - [Obsolete("If you were simply passing in the .NET Framework location as the BinPath, just change to the parameterless Engine() constructor. Otherwise, you can define custom toolsets in the registry or config file, or by adding elements to the Engine's ToolsetCollection. Then use either the Engine() or Engine(ToolsetLocations) constructor instead.")] - public Engine(string binPath) - : this(1 /* number of cpus */, false /* not child node */, 0 /* default NodeId */, null/*No msbuild.exe path*/, null, ToolsetDefinitionLocations.ConfigurationFile | ToolsetDefinitionLocations.Registry) - { - // If a binpath was passed, overwrite the tools path of the default - // tools version with it: this is how we emulate the old behavior of binpath - if (binPath != null) - { - BinPath = binPath; - } - } - - /// - /// Constructor providing the global properties the engine should inherit. - /// - public Engine(BuildPropertyGroup globalProperties) - : this(globalProperties, ToolsetDefinitionLocations.ConfigurationFile | ToolsetDefinitionLocations.Registry) - { - } - - /// - /// Constructor to specify whether toolsets should be initialized from the msbuild configuration file and from the registry - /// - public Engine(ToolsetDefinitionLocations locations) - : this(null, locations) - { - } - - /// - /// Constructor to specify the global properties the engine should inherit and - /// the locations the engine should inspect for toolset definitions. - /// - public Engine(BuildPropertyGroup globalProperties, ToolsetDefinitionLocations locations) - : this(1 /* cpu */, false /* not child node */, 0 /* default NodeId */, null/*No msbuild.exe path*/, globalProperties, locations) - { - } - - /// - /// Constructor used by msbuild.exe and any other multiproc aware MSBuild hosts. - /// - public Engine(BuildPropertyGroup globalProperties, ToolsetDefinitionLocations locations, int numberOfCpus, string localNodeProviderParameters) - : this(numberOfCpus, false, 0 /* default NodeId */, localNodeProviderParameters, globalProperties, locations) - { - } - - /// - /// Constructor used to initialize an Engine on a child node. Called only by LocalNode to create a child node's engine. - /// - internal Engine(BuildPropertyGroup globalProperties, ToolsetDefinitionLocations locations, int numberOfCpus, bool isChildNode, int parentNodeId, string startupDirectory, string localNodeProviderParameters) - : this(numberOfCpus, isChildNode, parentNodeId, localNodeProviderParameters, globalProperties, locations) - { - // Override the startup directory with the one we were passed - ErrorUtilities.VerifyThrow(startupDirectory != null, "Need startup directory"); - this.startupDirectory = startupDirectory; - - forwardPropertiesFromChild = Environment.GetEnvironmentVariable("MSBuildForwardPropertiesFromChild"); - // Get a list of properties which should be serialized - if (!String.IsNullOrEmpty(forwardPropertiesFromChild)) - { - propertyListToSerialize = forwardPropertiesFromChild.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries); - } - } - - /// - /// Constructor to init all data except for BinPath which is initialized separately because - /// a parameterless constructor is needed for COM interop - /// - internal Engine - ( - int numberOfCpus, - bool isChildNode, - int parentNodeId, - string localNodeProviderParameters, - BuildPropertyGroup globalProperties, - ToolsetDefinitionLocations locations - ) - { - // No need to check whether locations parameter - // is null, because it is a value type - - this.startupDirectory = Environment.CurrentDirectory; - this.engineGlobalProperties = globalProperties ?? new BuildPropertyGroup(); - this.environmentProperties = new BuildPropertyGroup(); - this.toolsetStateMap = new Dictionary(StringComparer.OrdinalIgnoreCase); - this.toolsets = new ToolsetCollection(this); - - // Every environment variable can be referenced just like a property - // from the project file. Here, we go ahead and add all the environment - // variables to the property bag, so they can be treated just like any - // other property later on. - this.environmentProperties.GatherEnvironmentVariables(); - - this.projectsLoadedByHost = new Hashtable(StringComparer.OrdinalIgnoreCase); - - this.cacheOfBuildingProjects = new ProjectManager(); - - this.eventSource = new EventSource(); - - this.buildEnabled = true; - - this.flushRequestEvent = new ManualResetEvent(false); - - this.primaryLoggingServices = new EngineLoggingServicesInProc(eventSource, false, flushRequestEvent); - - // Read any toolsets from the registry and config file - PopulateToolsetStateMap(locations); - - this.nodeId = parentNodeId; - this.localNodeProviderParameters = localNodeProviderParameters; - this.numberOfCpus = numberOfCpus; - - if (this.numberOfCpus == 1 && !isChildNode) - { - this.primaryLoggingServices.FlushBuildEventsImmediatly = true; - } - - this.buildRequests = new DualQueue(); - - this.taskOutputUpdates = new DualQueue(); - - this.engineCommands = new DualQueue(); - - this.engineCallback = new EngineCallback(this); - this.nodeManager = new NodeManager(this.numberOfCpus, isChildNode, this); - this.scheduler = new Scheduler(this.nodeId, this); - this.router = new Router(this, scheduler); - this.cacheManager = new CacheManager(this.DefaultToolsVersion); - - this.lastUsedLoggerId = EngineLoggingServicesInProc.FIRST_AVAILABLE_LOGGERID; - - this.enabledCentralLogging = false; - - this.introspector = new Introspector(this, cacheOfBuildingProjects, nodeManager); - - // Initialize the node provider - InitializeLocalNodeProvider(locations); - } - - /// - /// Accessor wrapper for the engine abort event and cached value. This method is thread safe. - /// - /// - internal void SetEngineAbortTo(bool value) - { - lock (engineAbortLock) - { - this.engineAbortCachedValue = value; - - if (value) - { - engineAbortEvent.Set(); - } - else - { - engineAbortEvent.Reset(); - } - } - } - - /// - /// Initialize the local node provider - /// Only happens on the parent node. - /// - private void InitializeLocalNodeProvider(ToolsetDefinitionLocations locations) - { - // Check if the local node provider has already been initialized - if (initializedLocaLNodeProvider) - { - return; - } - - // Don't register a local node provider if this is a child node engine - if (!Router.ChildMode && numberOfCpus > 1) - { - LocalNodeProvider localNodeProvider = new LocalNodeProvider(); - - string configuration; - if (localNodeProviderParameters.EndsWith(";", StringComparison.OrdinalIgnoreCase)) - { - configuration = localNodeProviderParameters + "maxcpucount=" + Convert.ToString(numberOfCpus, CultureInfo.InvariantCulture); - } - else - { - configuration = localNodeProviderParameters + ";maxcpucount=" + Convert.ToString(numberOfCpus, CultureInfo.InvariantCulture); - } - - localNodeProvider.Initialize(configuration, engineCallback, engineGlobalProperties, locations, startupDirectory); - this.nodeManager.RegisterNodeProvider(localNodeProvider); - - initializedLocaLNodeProvider = true; - } - } - - #endregion - - #region Properties - - /// - /// Obsolete way to get or set the tools path for the current default tools version. - /// - /// - /// BinPath is an obsolete concept. We retain it for now for all the hosts that use the BinPath - /// property, or the Engine(binPath) constructor, but internally it is just the tools path - /// of the default tools version. - /// - /// The MSBuild path. - [Obsolete("Avoid setting BinPath. If you were simply passing in the .NET Framework location as the BinPath, no other action is necessary. Otherwise, define Toolsets instead in the registry or config file, or by adding elements to the Engine's ToolsetCollection, in order to use a custom BinPath.")] - public string BinPath - { - get - { - return this.ToolsetStateMap[this.defaultToolsVersion].ToolsPath; - } - set - { - error.VerifyThrowArgumentNull(value, "BinPath"); - - // Replace the toolspath for the default tools version with this binpath - UpdateToolsPath(defaultToolsVersion, value); - } - } - - /// - /// Is this engine in the process of building? - /// - public bool IsBuilding - { - get - { - return numberOfProjectsInProgress > 0; - } - } - - /// - /// The node Id the current engine instance is running on - /// - internal int NodeId - { - get { return nodeId; } - } - - /// - /// Gets the dummy owner document for "virtual" items. - /// - /// SumedhK - /// PERF NOTE: this property helps to delay creation of the XmlDocument object - /// The dummy XmlDocument. - internal static XmlDocument GlobalDummyXmlDoc - { - get - { - if (globalDummyXmlDoc == null) - { - globalDummyXmlDoc = new XmlDocument(); - } - - return globalDummyXmlDoc; - } - } - - /// - /// An array of strings which list the properties that should be serialized from the child node to the parent node - /// - internal string[] PropertyListToSerialize - { - get - { - return propertyListToSerialize; - } - } - /// - /// Returns an instance of the Engine that is global (shared) for this AppDomain. - /// Delays creation until necessary. - /// - /// The global Engine instance. - /// RGoel - public static Engine GlobalEngine - { - get - { - if (Engine.globalEngine == null) - { - Engine.globalEngine = new Engine(); - } - - return Engine.globalEngine; - } - } - - /// - /// Gets the file version of the file in which the Engine assembly lies. - /// - /// - /// This is the Windows file version (specifically the value of the ProductVersion - /// resource), not necessarily the assembly version. - /// - /// RGoel - /// The engine version string. - public static Version Version - { - // If you want the assembly version, use Engine.Constants.AssemblyVersion. - get - { - if (engineVersion == null) - { - string msbuildPath; - try - { - // Get the file version from the currently executing assembly. - // Use .CodeBase instead of .Location, because .Location doesn't - // work when Microsoft.Build.Engine.dll has been shadow-copied, for example - // in scenarios where NUnit is loading Microsoft.Build.Engine. - msbuildPath = new Uri(Assembly.GetExecutingAssembly().EscapedCodeBase).LocalPath; - } - catch (InvalidOperationException) - { - // Workaround for Watson Bug: #161292 people getting relative uri crash here. - // Last resort. We may have a problem when the assembly is shadow-copied. - msbuildPath = Path.GetFullPath(typeof(Engine).Assembly.Location); - } - - var versionInfo = FileVersionInfo.GetVersionInfo(msbuildPath); - engineVersion = new Version(versionInfo.FileMajorPart, versionInfo.FileMinorPart, versionInfo.FileBuildPart, versionInfo.FilePrivatePart); - } - - return engineVersion; - } - } - - /// - /// Accessor for the engine's global properties. Global properties are those that would be set via the /p: switch at the - /// command-line, or things that the IDE wants to set before building a project (such as the "Configuration" property). - /// These global properties shall be applied to all projects that are built with this engine. - /// - /// RGoel - /// The global property bag. - public BuildPropertyGroup GlobalProperties - { - get - { - return this.engineGlobalProperties; - } - - set - { - this.engineGlobalProperties = value; - } - } - - /// - /// Read-only accessor for the environment variables. - /// - /// The property bag of environment variables. - /// RGoel - internal BuildPropertyGroup EnvironmentProperties - { - get - { - return this.environmentProperties; - } - } - - /// - /// Get a new TaskId - /// (NOT Thread safe) - /// - internal int GetNextTaskId() - { - return this.nextTaskId++; - } - - /// - /// Returns an ID that is unique among all targets for this project. - /// (NOT Thread safe) - /// - internal int GetNextTargetId() - { - return nextTargetId++; - } - - /// - /// This ID can be used to keep distinct task registries for each project object, even when the project objects - /// are loaded from the same path on disk, but have different global properties - /// (NOT Thread safe) - /// - internal int GetNextProjectId() - { - return nextProjectId++; - } - - /// - /// Gets a node ID for the provided engine - /// (NOT Thread safe) - /// - internal int GetNextNodeId() - { - return nextNodeId++; - } - - /// - /// This is the default value used by newly created projects for whether or not the building - /// of targets is enabled. This is for security purposes in case a host wants to closely - /// control which projects it allows to run targets/tasks. - /// - /// RGoel - public bool BuildEnabled - { - get - { - return this.buildEnabled; - } - - set - { - this.buildEnabled = value; - } - } - - /// - /// Gets the cache of projects imported during the build. - /// - /// PERF NOTE: this property helps to delay creation of the cache - /// SumedhK - /// Hashtable of imported projects. - internal Hashtable ImportedProjectsCache - { - get - { - if (importedProjectsCache == null) - { - importedProjectsCache = new Hashtable(StringComparer.OrdinalIgnoreCase); - } - - return importedProjectsCache; - } - } - - /// - /// Returns the table of projects loaded by the host. - /// - /// RGoel - /// Marked "internal" for unit tests only. To maintain encapsulation, please try not to - /// use this accessor in real msbuild code, except from within this class. - internal Hashtable ProjectsLoadedByHost - { - get - { - return this.projectsLoadedByHost; - } - } - - /// - /// Dictionary of toolset states - /// K: tools version - /// V: matching toolset state - /// - internal Dictionary ToolsetStateMap - { - get - { - return this.toolsetStateMap; - } - } - - /// - /// Returns the collection of Toolsets recognized by this Engine instance. - /// - public ToolsetCollection Toolsets - { - get - { - return this.toolsets; - } - } - - /// - /// Returns the service that can be used to log events - /// - internal EngineLoggingServices LoggingServices - { - get - { - return this.primaryLoggingServices; - } - set - { - this.primaryLoggingServices = value; - } - } - - /// - /// Provide the number of Cpus the engine was started with. This is used to communicate this number with the project for - /// the reserved property MSBuildBuildNodeCount - /// - internal int EngineCpuCount - { - get - { - return numberOfCpus; - } - } - - /// - /// The external logging service is used on the child to forward events from child to parent - /// - internal EngineLoggingServices ExternalLoggingServices - { - get - { - return externalLoggingServices; - } - set - { - this.externalLoggingServices = value; - } - } - internal Scheduler Scheduler - { - get - { - return this.scheduler; - } - } - - internal Router Router - { - get - { - return this.router; - } - } - - internal NodeManager NodeManager - { - get - { - return this.nodeManager; - } - } - - internal CacheManager CacheManager - { - get - { - return this.cacheManager; - } - } - - internal Introspector Introspector - { - get - { - return this.introspector; - } - } - - internal EngineCallback EngineCallback - { - get - { - return engineCallback; - } - } - - internal bool EnabledCentralLogging - { - get - { - return enabledCentralLogging; - } - } - - /// - /// Return true if the timing data for the build should be collected - /// - internal bool ProfileBuild - { - get - { - return profileBuild; - } - } - - /// - /// Returns the event that can be used to trigger a flush of logging services - /// - internal ManualResetEvent FlushRequestEvent - { - get - { - return flushRequestEvent; - } - } - - /// - /// The current directory at the time the Engine was constructed -- - /// if msbuild.exe is hosting, this is the current directory when - /// msbuild.exe was started - /// - internal string StartupDirectory - { - get { return startupDirectory; } - } - - #endregion - - #region Methods - - /// - /// Return the global task registry for a particular toolset. - /// - internal ITaskRegistry GetTaskRegistry(BuildEventContext buildEventContext, string toolsetVersion) - { - error.VerifyThrow(toolsetVersion != null, "Expect non-null toolset version"); - error.VerifyThrow(toolsetStateMap.ContainsKey(toolsetVersion), "Expected to see the toolset in the table"); - - ToolsetState toolsetState = toolsetStateMap[toolsetVersion]; - - return toolsetState.GetTaskRegistry(buildEventContext); - } - - /// - /// Adds a new toolset to the engine. Any pre-existing toolset with the same - /// tools version is replaced with the provided toolset. - /// - /// the Toolset - internal void AddToolset(Toolset toolset) - { - error.VerifyThrowArgumentNull(toolset, nameof(toolset)); - - if (toolsetStateMap.ContainsKey(toolset.ToolsVersion)) - { - // It already exists: replace it with the new toolset - toolsetStateMap[toolset.ToolsVersion] = new ToolsetState(this, toolset); - - // We must be sure to notify all of the loaded projects with this - // tools version that they are dirty so they will later pick up any changes - // to the ToolsetState. - DirtyProjectsUsingToolsVersion(toolset.ToolsVersion); - } - else - { - toolsetStateMap.Add(toolset.ToolsVersion, new ToolsetState(this, toolset)); - } - } - - /// - /// Updates the tools path for the specified tools version. If no toolset with - /// that tools version exists, it creates a new one. - /// - internal void UpdateToolsPath(string toolsVersion, string toolsPath) - { - BuildPropertyGroup buildProperties = null; - - if (toolsetStateMap.ContainsKey(toolsVersion)) - { - buildProperties = toolsetStateMap[toolsVersion].BuildProperties.Clone(true /* deep clone */); - } - - toolsets.Add(new Toolset(toolsVersion, toolsPath, buildProperties)); - } - - /// - /// Marks as dirty any projects currently using the specified tools version, - /// so they'll update with any new values in it - /// - private void DirtyProjectsUsingToolsVersion(string toolsVersion) - { - foreach (Project project in projectsLoadedByHost.Values) - { - if (String.Equals(project.ToolsVersion, toolsVersion, StringComparison.OrdinalIgnoreCase)) - { - project.MarkProjectAsDirtyForReprocessXml(); - } - } - } - - /// - /// Populate ToolsetStateMap with a dictionary of (toolset version, ToolsetState) - /// using information from the registry and config file, if any. - /// - /// Internal for unit testing purposes only - /// - internal void PopulateToolsetStateMap(ToolsetDefinitionLocations locations) - { - BuildPropertyGroup initialProperties = new BuildPropertyGroup(); - initialProperties.ImportProperties(EnvironmentProperties); - initialProperties.ImportProperties(GlobalProperties); - - string defaultVersionFromReaders = ToolsetReader.ReadAllToolsets(toolsets, GlobalProperties, initialProperties, locations); - - // If we got a default version from the registry or config file, we should - // use that from now on. The readers guarantee that any default version they return - // has a corresponding Toolset too. - if (defaultVersionFromReaders != null) - { - this.DefaultToolsVersion = defaultVersionFromReaders; - } - else - { - // We're going to choose a hard coded default tools version of 2.0. - // But don't overwrite any existing tools path for this default we're choosing. - if (!toolsetStateMap.ContainsKey(Constants.defaultToolsVersion)) - { - string pathTo20Framework = FrameworkLocationHelper.PathToDotNetFrameworkV20; - - if (pathTo20Framework == null) - { - // We have been given no default, so we want to choose 2.0, but .NET 2.0 is not installed. - // In general we do not verify that MSBuildToolsPath's point to a valid location, - // so failing here would be inconsistent. The build might not even use this toolset. - // Instead, synthesize what would be the path to the .NET 2.0 install location. - // If the build tries to use the default toolset, the problem will be discovered then. - pathTo20Framework = Path.Combine(Environment.SystemDirectory, @"Microsoft.NET\Framework\v2.0.50727"); - } - - // There's no tools path already for 2.0, so use the path to the v2.0 .NET Framework. - // If an old-fashioned caller sets BinPath property, or passed a BinPath to the constructor, - // that will overwrite what we're setting here. - toolsets.Add(new Toolset(Constants.defaultToolsVersion, pathTo20Framework)); - } - - // Now update the default tools version to 2.0 - DefaultToolsVersion = Constants.defaultToolsVersion; - } - } - - /// - /// The default tools version of this Engine. Projects use this tools version if they - /// aren't otherwise told what tools version to use. - /// This value is gotten from the .exe.config file, or else in the registry, - /// or if neither specify a default tools version then it is hard-coded to the tools version "2.0". - /// - public string DefaultToolsVersion - { - get - { - ErrorUtilities.VerifyThrow(this.defaultToolsVersion != null, - "The entry for the default tools version should have been created by now"); - - return this.defaultToolsVersion; - } - set - { - // We don't allow DefaultToolsVersion to be set after any projects have been loaded by the - // engine, because the semantics would be odd. - ErrorUtilities.VerifyThrowInvalidOperation(this.ProjectsLoadedByHost.Count == 0, - "CannotSetDefaultToolsVersionAfterLoadingProjects"); - - ErrorUtilities.VerifyThrowArgumentNull(value, "value"); - - // We don't check there is actually a matching toolset, because the default for 4.0 is 2.0 - // even if 2.0 isn't installed - - this.defaultToolsVersion = value; - } - } - - /// - /// Called to register loggers with the engine. Once loggers are registered, all build events will be sent to them. - /// - /// Logger indicating it failed in a controlled way - /// Logger threw arbitrary exception - public void RegisterLogger(ILogger logger) - { - error.VerifyThrowArgumentNull(logger, nameof(logger)); - - // Since we are registering a central logger - need to make sure central logging is enabled for all nodes - if (!enabledCentralLogging) - { - enabledCentralLogging = true; - nodeManager.UpdateSettings(enabledCentralLogging, this.primaryLoggingServices.OnlyLogCriticalEvents, true); - } - - RegisterLoggerInternal(logger, eventSource, false); - } - - /// - /// Initializes the logger and adds it to the list of loggers maintained by the engine - /// - /// Logger indicating it failed in a controlled way - /// Logger threw arbitrary exception - private void RegisterLoggerInternal(ILogger logger, EventSource sourceForLogger, bool forwardingLogger) - { - try - { - if (logger is INodeLogger) - { - ((INodeLogger)logger).Initialize(sourceForLogger, this.numberOfCpus); - } - else - { - logger.Initialize(sourceForLogger); - } - } - // Polite logger failure - catch (LoggerException) - { - throw; - } - catch (Exception e) - { - InternalLoggerException.Throw(e, null, "FatalErrorWhileInitializingLogger", false, logger.GetType().Name); - } - - if (forwardingLogger) - { - if (forwardingLoggers == null) - { - forwardingLoggers = new ArrayList(); - } - - forwardingLoggers.Add(logger); - } - else - { - if (loggers == null) - { - loggers = new ArrayList(); - } - - loggers.Add(logger); - } - } - - /// - /// Called to register distributed loggers with the engine. - /// This method is not thread safe. All loggers should registered prior to - /// starting the build in order to guarantee uniform behavior - /// - /// Logger indicating it failed in a controlled way - /// Logger threw arbitrary exception - public void RegisterDistributedLogger(ILogger centralLogger, LoggerDescription forwardingLogger) - { - error.VerifyThrowArgumentNull(forwardingLogger, nameof(forwardingLogger)); - if (centralLogger == null) - { - centralLogger = new NullCentralLogger(); - } - - // If this is the first distributed logger we need to create an event source for local - // forwarding loggers - if (eventSourceForForwarding == null) - { - eventSourceForForwarding = new EventSource(); - ((EngineLoggingServicesInProc)primaryLoggingServices).RegisterEventSource - (EngineLoggingServicesInProc.LOCAL_FORWARDING_EVENTSOURCE, eventSourceForForwarding); - } - // Assign a unique logger Id to this distributed logger - int loggerId = lastUsedLoggerId; - lastUsedLoggerId++; - forwardingLogger.LoggerId = loggerId; - - //Create and configure the local node logger - IForwardingLogger localForwardingLogger = null; - try - { - localForwardingLogger = forwardingLogger.CreateForwardingLogger(); - // Check if the class was not found in the assembly - if (localForwardingLogger == null) - { - InternalLoggerException.Throw(null, null, "LoggerNotFoundError", true, forwardingLogger.Name); - } - // Configure the object - EventRedirector newRedirector = new EventRedirector(forwardingLogger.LoggerId, primaryLoggingServices); - localForwardingLogger.BuildEventRedirector = newRedirector; - localForwardingLogger.Parameters = forwardingLogger.LoggerSwitchParameters; - localForwardingLogger.Verbosity = forwardingLogger.Verbosity; - localForwardingLogger.NodeId = nodeId; - // Convert the path to the logger DLL to full path before passing it to the node provider - forwardingLogger.ConvertPathsToFullPaths(); - } - // Polite logger failure - catch (LoggerException) - { - throw; - } - // Logger class was not found - catch (InternalLoggerException) - { - throw; - } - catch (Exception e) - { - InternalLoggerException.Throw(e, null, "LoggerCreationError", true, forwardingLogger.Name); - } - - // Register the local forwarding logger to listen for all local events - RegisterLoggerInternal(localForwardingLogger, eventSourceForForwarding, true); - - //Register this logger's node logger with the node manager so that all - //the nodes instantiate this node logger and forward the events - nodeManager.RegisterNodeLogger(forwardingLogger); - - // Create a private event source that will be used by this distributed logger and register - // the central logger with the engine - EventSource privateEventSource = new EventSource(); - RegisterLoggerInternal(centralLogger, privateEventSource, false); - - // Register the private event source with the logging services so that the events from the local - // node logger are forwarded to the central logger - ((EngineLoggingServicesInProc)primaryLoggingServices).RegisterEventSource(forwardingLogger.LoggerId, privateEventSource); - } - - /// - /// Stop forwarding events to any loggers - /// - internal void BeginEatingLoggingEvents() - { - primaryLoggingServices.BeginEatingEvents(); - } - - /// - /// Resume forwarding events to loggers - /// - internal void EndEatingLoggingEvents() - { - primaryLoggingServices.EndEatingEvents(); - } - - /// - /// Clear out all registered loggers so that none are registered. - /// - /// Logger indicating it failed in a controlled way - /// Logger threw arbitrary exception - public void UnregisterAllLoggers() - { - if (forwardingLoggers?.Count > 0) - { - // Disconnect forwarding loggers from the event source - ((EngineLoggingServicesInProc)primaryLoggingServices).UnregisterEventSource - (EngineLoggingServicesInProc.LOCAL_FORWARDING_EVENTSOURCE); - // Shutdown forwarding loggers - UnregisterLoggersInternal(forwardingLoggers); - forwardingLoggers = null; - } - - // Make that events generated during the shutdown of forwarding loggers reach central loggers - primaryLoggingServices.ProcessPostedLoggingEvents(); - // Disconnect central and old style loggers - primaryLoggingServices.Shutdown(); - // Shutdown central and old style loggers - UnregisterLoggersInternal(loggers); - loggers = null; - } - - /// - /// Call shutdown method on each of the loggers in the given list - /// - internal void UnregisterLoggersInternal(ArrayList loggersToUnregister) - { - if (loggersToUnregister != null) - { - foreach (ILogger logger in loggersToUnregister) - { - try - { - logger.Shutdown(); - } - // Polite logger failure - catch (LoggerException) - { - throw; - } - catch (Exception e) - { - InternalLoggerException.Throw(e, null, "FatalErrorDuringLoggerShutdown", false, logger.GetType().Name); - } - } - } - } - - /// - /// Log BuildFinished event (if there is no unhandled exception) and clear - /// the projects loaded by host from the - /// - internal void EndingEngineExecution(bool buildResult, bool exitedDueToError) - { - // Don't log BuildFinished if there is an unhandled exception - if (!exitedDueToError) - { - // Log BuildFinished event first to the forwarding loggers and then to the - // central logger. On the child node all events maybe being forwarding to the - // parent node, so post the event directly to the forwarding loggers. - if (Router.ChildMode) - { - if (loggers?.Count > 0) - { - // Flush all the events currently in the queue - LoggingServices.ProcessPostedLoggingEvents(); - - LoggingServices.LogBuildFinished(buildResult, EngineLoggingServicesInProc.CENTRAL_ENGINE_EVENTSOURCE); - - // Flush the queue causing the forwarding loggers to process all event and the BuildFinished event - LoggingServices.ProcessPostedLoggingEvents(); - } - } - else - { - // Cause the events to be posted to the child nodes and there event queues to be flushed - NodeManager.ShutdownNodes(buildResult ? Node.NodeShutdownLevel.BuildCompleteSuccess : - Node.NodeShutdownLevel.BuildCompleteFailure); - - // Post the event to old style loggers and forwarding loggers on parent node - LoggingServices.LogBuildFinished(buildResult); - - // Cause the forwarding loggers to process BuildFinished event and whatever other events - // were in the queue (on the child the event are flushed to the level of the outofproc logging service) - LoggingServices.ProcessPostedLoggingEvents(); - - // Post the event to all the central loggers - LoggingServices.LogBuildFinished(buildResult, EngineLoggingServicesInProc.ALL_PRIVATE_EVENTSOURCES); - - // Flush the queue causing the central loggers to process any event sent to them - LoggingServices.ProcessPostedLoggingEvents(); - } - } - - foreach (string loadedProjectFullPath in projectsLoadedByHost.Keys) - { - // For each of the projects that the host has actually loaded (and holding on to), - // remove all projects with that same fullpath from the ProjectManager. There are - // a couple of reasons for this: - // 1. Because the host is hanging on to this projects, during design-time the host - // might decide to change the GlobalProperties on one of these projects. He might - // change the GlobalProperties such that they now are equivalent to the GlobalProperties - // for one of the projects in the ProjectManager. That would get weird because - // we'd end up with two projects with the same fullpath and same GlobalProperties, - // and we wouldn't know which one to choose (on the next build). - // 2. Because the host is hanging on to the projects, it may decide to make in-memory - // changes to the project. On next build, we need to take those changes into - // account, and any instances of Project in the ProjectManager won't have those - // changes. - this.cacheOfBuildingProjects.RemoveProjects(loadedProjectFullPath); - } - } - - /// - /// Called when the host is done with this engine; unregisters loggers and - /// shuts down nodes and TEM's. - /// - public void Shutdown() - { - // First shutdown the nodes, this may generate some logging events - NodeManager.ShutdownNodes(Node.NodeShutdownLevel.PoliteShutdown); - // Shutdown the loggers. First shutdown the forwarding loggers allowing them to generate events - UnregisterAllLoggers(); - } - - /// - /// Creates a new empty Project object that is associated with this engine. All projects must be associated with an - /// engine, because they need loggers, global properties, reserved properties, etc. - /// - /// RGoel - /// The created project. - public Project CreateNewProject - ( - ) - { - return new Project(this); - } - - /// - /// Retrieves the project object for the specified project file full path, if it has - /// been loaded by this Engine. Returns null if this project is unknown to us. - /// - /// - /// The project object associated with this engine that matches the full path. - /// RGoel - public Project GetLoadedProject - ( - string projectFullFileName - ) - { - ErrorUtilities.VerifyThrowArgumentNull(projectFullFileName, nameof(projectFullFileName)); - return (Project)this.projectsLoadedByHost[projectFullFileName]; - } - - /// - /// Removes a project object from our hash table of loaded projects. After this is - /// called, it is illegal to attempt to do anything else with the Project, so don't - /// call it unless you are completely done with the project. - /// - /// IDEs should call this when they're done with a particular project. This - /// causes us to unhook the project from the Engine object, so that there - /// will be no more references to the project, and the garbage collector - /// can clean up. - /// - /// - /// RGoel - public void UnloadProject - ( - Project project - ) - { - error.VerifyThrowArgumentNull(project, nameof(project)); - - ErrorUtilities.VerifyThrow(project.IsLoadedByHost, "How did the caller get a reference to this Project object if it's not marked as loaded?"); - // Make sure this project object is associated with this engine object. - ErrorUtilities.VerifyThrowInvalidOperation(project.ParentEngine == this, "IncorrectObjectAssociation", "Project", "Engine"); - - // Host is mucking with this project. Remove the cached versions of - // all projects with this same full path. Over aggressively getting rid - // of stuff from the cache is better than accidentally leaving crud in - // there. - UnloadProject(project, true /* Unload all versions */); - } - - internal void UnloadProject(Project project, bool unloadAllVersions) - { - if (project.FullFileName.Length > 0) - { - if (this.projectsLoadedByHost.Contains(project.FullFileName)) - { - this.projectsLoadedByHost.Remove(project.FullFileName); - } - if (unloadAllVersions) - { - this.cacheOfBuildingProjects.RemoveProjects(project.FullFileName); - } - else - { - this.cacheOfBuildingProjects.RemoveProject(project); - } - } - project.ClearParentEngine(); - } - - /// - /// Notifies the engine on a project rename, so that we can update our hash tables. - /// - /// - /// - /// - /// RGoel - internal void OnRenameProject - ( - Project project, - string oldFullFileName, - string newFullFileName - ) - { - ErrorUtilities.VerifyThrow(project.IsLoadedByHost, "This method can only be called for projects loaded by the host."); - - oldFullFileName = oldFullFileName ?? String.Empty; - newFullFileName = newFullFileName ?? String.Empty; - if (oldFullFileName == newFullFileName) - { - // Nothing to do, since this really isn't a rename. - return; - } - // We don't store nameless projects. So only if the old name was non-empty, remove - // it from our hash table. - if (oldFullFileName.Length > 0) - { - error.VerifyThrow((Project)projectsLoadedByHost[oldFullFileName] == project, "The engine's loaded project table was not up-to-date."); - this.projectsLoadedByHost.Remove(oldFullFileName); - - // Host is mucking with this project. Remove the cached versions of - // all projects with this same full path. Over aggressively getting rid - // of stuff from the cache is better than accidentally leaving crud in - // there. - this.cacheOfBuildingProjects.RemoveProjects(oldFullFileName); - } - // We don't store nameless projects. So only if the new name is non-empty, add - // it to our hash table. - if (newFullFileName.Length > 0) - { - // If there's already a project with this new name in our table ... - Project oldProject = (Project)projectsLoadedByHost[newFullFileName]; - if (oldProject != null) - { - // Our IDE should never do this. BUT in case someone does, just - // kick out the previous project from the table. - this.UnloadProject(oldProject); - } - - this.projectsLoadedByHost[newFullFileName] = project; - - // Host is mucking with this project. Remove the cached versions of - // all projects with this same full path. Over aggressively getting rid - // of stuff from the cache is better than accidentally leaving crud in - // there. - this.cacheOfBuildingProjects.RemoveProjects(newFullFileName); - } - - if ((oldFullFileName.Length > 0) && (newFullFileName.Length > 0)) - { - // MSBuild projects keep track of PropertyGroups that are imported from other - // files. It does this tracking by using the project file name of the imported - // file. So when a project gets renamed, as is being done here, we need - // to go update all those imported PropertyGroup records with the new filename. - - // Loop through every loaded project, and inform it about the newly named - // file, so it can react accordingly. - foreach (Project loadedProject in projectsLoadedByHost.Values) - { - // Note: We notify every project, even though every project is probably - // not actually importing this file that just got renamed. - loadedProject.OnRenameOfImportedFile(oldFullFileName, newFullFileName); - } - } - } - - /// - /// Remove all references to Project objects from our cache. This is called by the - /// IDE on Solution Close. - /// - /// RGoel - public void UnloadAllProjects - ( - ) - { - Debug.Assert(this.projectsLoadedByHost.Count == 0, "Shouldn't the host have unloaded the projects already?"); - - // Copy the contents of the hashtable into a temporary array, because we can't - // be modifying the hashtable while we're iterating through it. - Project[] arrayOfprojectsLoadedByHost = new Project[this.projectsLoadedByHost.Count]; - this.projectsLoadedByHost.Values.CopyTo(arrayOfprojectsLoadedByHost, 0); - - foreach (Project project in arrayOfprojectsLoadedByHost) - { - // This removes the project from the projectsLoadedByHost hashtable. - this.UnloadProject(project); - } - - ErrorUtilities.VerifyThrow(this.projectsLoadedByHost.Count == 0, "All projects did not get unloaded?"); - - this.cacheOfBuildingProjects.Clear(); - } - - /// - /// When true, only log critical events such as warnings and errors. Has to be in here for API compat - /// - public bool OnlyLogCriticalEvents - { - get - { - return this.primaryLoggingServices.OnlyLogCriticalEvents; - } - set - { - this.primaryLoggingServices.OnlyLogCriticalEvents = value; - nodeManager.UpdateSettings(enabledCentralLogging, value, true); - } - } - - /// - /// Builds the default targets in an already-loaded project. - /// - /// - /// RGoel - public bool BuildProject - ( - Project project - ) - { - return BuildProject(project, null, null, BuildSettings.None); - } - - /// - /// Builds a single target in an already-loaded project. - /// - /// - /// - /// RGoel - public bool BuildProject - ( - Project project, - string targetName - ) - { - return BuildProject(project, (targetName == null) ? null : new string[] { targetName }, null, BuildSettings.None); - } - - /// - /// Builds a list of targets in an already-loaded project. - /// - /// - /// - /// RGoel - public bool BuildProject - ( - Project project, - string[] targetNames - ) - { - return BuildProject(project, targetNames, null, BuildSettings.None); - } - - /// - /// Builds a list of targets in an already-loaded project, and returns the target outputs. - /// - /// - /// - /// - /// RGoel - public bool BuildProject - ( - Project project, - string[] targetNames, - IDictionary targetOutputs // can be null if outputs are not needed - ) - { - return BuildProject(project, targetNames, targetOutputs, BuildSettings.None); - } - - /// - /// Builds a list of targets in an already-loaded project using the specified - /// flags, and returns the target outputs. - /// - /// RGoel - /// - /// - /// - /// whether previously built targets should be reset or not - /// true, if build succeeds - public bool BuildProject - ( - Project project, - string[] targetNames, - IDictionary targetOutputs, // can be null if outputs are not needed - BuildSettings buildFlags - ) - { - return PostProjectEvaluationRequests(project, new string[] { null }, new string[1][] { targetNames }, - new BuildPropertyGroup[] { null }, new IDictionary[] { targetOutputs }, buildFlags, new string[] { null }); - } - - /// - /// Main engine loop. - /// - internal BuildResult EngineBuildLoop(BuildRequest terminatingBuildRequest) - { - ErrorUtilities.VerifyThrow(this.numberOfProjectsInProgress == 0 || terminatingBuildRequest != null, - "We can only call this method once"); - - // Create an array of events to which this thread responds - WaitHandle[] waitHandles = new WaitHandle[5]; - waitHandles[0] = engineAbortEvent; // Exit event - waitHandles[1] = engineCommands.QueueReadyEvent; // New engine command - waitHandles[2] = buildRequests.QueueReadyEvent; // New build request - waitHandles[3] = taskOutputUpdates.QueueReadyEvent; // New task outputs - waitHandles[4] = flushRequestEvent; // A logging service needs a flush - - BuildResult buildResult = null; - bool continueExecution = true; - lastLoopActivity = DateTime.Now.Ticks; - int loopTimeout = Introspector.initialLoopTimeout; // Inactivity timeout which triggers deadlock check - int loopTimeoutRemaining = Introspector.initialLoopTimeout; - int flushTimeout = EngineLoggingServices.flushTimeoutInMS; // Timeout with which the log is flushed - bool forceFlush = false; - while ( - continueExecution && - (terminatingBuildRequest == null || !terminatingBuildRequest.BuildCompleted) - ) - { - int eventType; - - // See if we have anything to do without waiting on the handles which is expensive - // for kernel mode objects. - if (this.engineAbortCachedValue) - { - eventType = 0; - } - else if (engineCommands.Count > 0) - { - eventType = 1; - } - else if (buildRequests.Count > 0) - { - eventType = 2; - } - else if (taskOutputUpdates.Count > 0) - { - eventType = 3; - } - else if (primaryLoggingServices.NeedsFlush(lastLoopActivity)) - { - eventType = 4; - } - else - { - // Nothing going on at the moment, go to sleep and wait for something to happen - eventType = WaitHandle.WaitAny(waitHandles, flushTimeout, false); - } - - if (eventType == WaitHandle.WaitTimeout) - { - // Decrement time remaining until deadlock check - if (loopTimeoutRemaining != Timeout.Infinite) - { - loopTimeoutRemaining = flushTimeout > loopTimeoutRemaining ? - 0 : loopTimeoutRemaining - flushTimeout; - } - // Always force a flush on a time - forceFlush = true; - - // If time has run out perform deadlock check - if (loopTimeoutRemaining == 0) - { - loopTimeout = - introspector.DetectDeadlock(buildRequests.Count + this.taskOutputUpdates.Count, - lastLoopActivity, loopTimeout); - loopTimeoutRemaining = loopTimeout; - } - } - else if (eventType == 0) - { - continueExecution = false; - SetEngineAbortTo(false); - } - // Received an engine command - else if (eventType == 1) - { - EngineCommand engineCommand = this.engineCommands.Dequeue(); - ErrorUtilities.VerifyThrow(engineCommand != null, "Should have gotten a command"); - // Execute the command - engineCommand.Execute(this); - - // Don't consider node status request to be activity - if (!(engineCommand is RequestStatusEngineCommand)) - { - lastLoopActivity = DateTime.Now.Ticks; - loopTimeoutRemaining = loopTimeout; - } - } - // New build requests have been posted - else if (eventType == 2) - { - BuildRequest currentRequest = this.buildRequests.Dequeue(); - ErrorUtilities.VerifyThrow(currentRequest != null, "Should have gotten an evalution request"); - - //Console.WriteLine( "Child mode: " + Scheduler.ChildMode +" Got request to build " + currentRequest.GetTargetNamesList() + " in " + currentRequest.ProjectFileName + " Time: " + DateTime.Now.ToLongTimeString() + ":" + DateTime.Now.Millisecond); - - if (!currentRequest.BuildCompleted) - { - if (currentRequest.ProjectToBuild != null) - { - Scheduler.NotifyOfSchedulingDecision(currentRequest, EngineCallback.inProcNode); - BuildProjectInternal(currentRequest, null, null, true); - } - else - { - BuildProjectFileInternal(currentRequest); - } - } - else - { - InvalidProjectFileException projectException = currentRequest.BuildException; - primaryLoggingServices.LogInvalidProjectFileError(currentRequest.ParentBuildEventContext, projectException); - Scheduler.NotifyOfSchedulingDecision(currentRequest, this.nodeId); - HandleProjectFileInternalException(currentRequest); - } - lastLoopActivity = DateTime.Now.Ticks; - loopTimeoutRemaining = loopTimeout; - } - // New task outputs have been posted - else if (eventType == 3) - { - TaskExecutionContext taskExecutionContext = this.taskOutputUpdates.Dequeue(); - ErrorUtilities.VerifyThrow(taskExecutionContext != null, "Should have gotten a task update"); - - // Clear the node proxy state, all the write to the proxy state should come from the engine thread - EngineCallback.ClearContextState(taskExecutionContext.HandleId); - - if (Engine.debugMode) - { - if (taskExecutionContext.BuildContext.BuildRequest != null) - { - Console.WriteLine("NodeId: " + NodeId + " Got output update " + taskExecutionContext.ParentProject.FullFileName + " HandleId: " + taskExecutionContext.BuildContext.BuildRequest.HandleId + " Time: " + DateTime.Now.ToLongTimeString() + ":" + DateTime.Now.Millisecond); - } - else - { - Console.WriteLine("NodeId: " + NodeId + " Got output update " + taskExecutionContext.ParentProject.FullFileName + " HandleId: None Time: " + DateTime.Now.ToLongTimeString() + ":" + DateTime.Now.Millisecond); - } - } - - // In inproc scenario we may receive a task done notification for a build context - // which has already completed with an exception. In this case we can ignore the - // notification because the context is already completed. - if (!taskExecutionContext.BuildContext.BuildComplete) - { - BuildProjectInternal(taskExecutionContext.BuildContext.BuildRequest, taskExecutionContext.BuildContext, taskExecutionContext, false); - } - else - { - if (Engine.debugMode) - { - if (taskExecutionContext.BuildContext.BuildRequest != null) - { - Console.WriteLine("Ignoring task output notification. NodeId: " + NodeId + " Got output update " + taskExecutionContext.ParentProject.FullFileName + " HandleId: " + taskExecutionContext.BuildContext.BuildRequest.HandleId); - } - else - { - Console.WriteLine("Ignoring task output notification. NodeId: " + NodeId + " Got output update " + taskExecutionContext.ParentProject.FullFileName); - } - } - } - - lastLoopActivity = DateTime.Now.Ticks; - loopTimeoutRemaining = loopTimeout; - } - else if (eventType == 4) - { - // Clear the flush requested event, the logging providers are flushed at the end of the loop - flushRequestEvent.Reset(); - forceFlush = true; - } - else - { - ErrorUtilities.VerifyThrow(false, "The event type should be 0, 1, 2 or 3"); - } - - if (NodeManager.TaskExecutionModule == null) - { - // Shutting down, eg due to deadlock. Attempt to flush. - forceFlush = true; - } - - // If necessary flush the queue of logging events (it may have already been flushed recently) - if (LoggingServices.NeedsFlush(lastLoopActivity) || forceFlush) - { - if (LoggingServices.ProcessPostedLoggingEvents()) - { - lastLoopActivity = DateTime.Now.Ticks; - loopTimeoutRemaining = loopTimeout; - } - } - - if (ExternalLoggingServices != null && (ExternalLoggingServices.NeedsFlush(lastLoopActivity) || forceFlush)) - { - if (ExternalLoggingServices.ProcessPostedLoggingEvents()) - { - lastLoopActivity = DateTime.Now.Ticks; - loopTimeoutRemaining = loopTimeout; - } - } - - // Reset the flag forcing the flushing of logging providers - forceFlush = false; - - // TEM will be null if we're shutting down - if (NodeManager.TaskExecutionModule != null) - { - if (!NodeManager.TaskExecutionModule.UseBreadthFirstTraversal /* using depth first traversal */ && - buildRequests.Count == 0 && taskOutputUpdates.Count == 0 && - NodeManager.TaskExecutionModule.IsIdle - ) - { - NodeManager.TaskExecutionModule.UseBreadthFirstTraversal = true; /* use breadth first traversal */ - if (Router.ChildMode) - { - // Send the status back to the parent as the parent needs to know this node has run out of work, so it can switch the entire system - // to breadth first traversal - Router.ParentNode.PostStatus(new NodeStatus(true /* use breadth first traversal */), false /* don't block waiting on the send */); - } - else - { - // Send the traversal switch directly to all child nodes as the parent has run out of work - NodeManager.ChangeNodeTraversalType(true /* use breadth first traversal */); - } - } - } - } - - if (terminatingBuildRequest != null) - { - buildResult = terminatingBuildRequest.GetBuildResult(); - } - - return buildResult; - } - - /// - /// Builds the specific targets in an MSBuild project. Since projects can build other projects, this method may get called - /// back recursively. It keeps track of the projects being built, so that it knows when we've popped back out to the root - /// of the callstack again, so we can reset the state of all the projects. Otherwise, you wouldn't be able to do more - /// than one build using the same Engine object, because the 2nd, 3rd, etc. builds would just say "hmm, looks like this - /// project has already been built, so I'm not going to build it again". - /// - private void BuildProjectInternal - ( - BuildRequest buildRequest, - ProjectBuildState buildContext, - TaskExecutionContext taskExecutionContext, - bool initialCall - ) - { - Project project = buildRequest.ProjectToBuild; - - bool exitedDueToError = true; - - try - { - SetBuildItemCurrentDirectory(project); - if (initialCall) - { - // Make sure we were passed in a project object. - error.VerifyThrowArgument(project != null, "MissingProject", "Project"); - - // Make sure this project object is associated with this engine object. - error.VerifyThrowInvalidOperation(project.ParentEngine == this, "IncorrectObjectAssociation", "Project", "Engine"); - } - - try - { - if (initialCall) - { - BuildProjectInternalInitial(buildRequest, project); - } - else - { - BuildProjectInternalContinue(buildRequest, buildContext, taskExecutionContext, project); - } - - exitedDueToError = false; - } - /********************************************************************************************************************** - * WARNING: Do NOT add any more catch blocks below! Exceptions should be caught as close to their point of origin as - * possible, and converted into one of the known exceptions. The code that causes an exception best understands the - * reason for the exception, and only that code can provide the proper error message. We do NOT want to display - * messages from unknown exceptions, because those messages are most likely neither localized, nor composed in the - * canonical form with the correct prefix. - *********************************************************************************************************************/ - // Handle errors in the project file. - catch (InvalidProjectFileException e) - { - primaryLoggingServices.LogInvalidProjectFileError(buildRequest.ParentBuildEventContext, e); - } - // Handle logger failures -- abort immediately - catch (LoggerException) - { - // Polite logger failure - throw; - } - catch (InternalLoggerException) - { - // Logger threw arbitrary exception - throw; - } - // Handle all other errors. These errors are completely unexpected, so - // make sure to give the callstack as well. - catch (Exception) - { - fatalErrorContext = buildRequest.ParentBuildEventContext; - fatalErrorProjectName = project.FullFileName; - - // Rethrow so that the host can catch it and possibly rethrow it again - // so that Watson can give the user the option to send us an error report. - throw; - } - - /********************************************************************************************************************** - * WARNING: Do NOT add any more catch blocks above! - *********************************************************************************************************************/ - finally - { - FinishBuildProjectInProgress(buildRequest, buildContext, exitedDueToError); - } - } - finally - { - // Flush out all the logging messages, which may have been posted outside target execution - primaryLoggingServices.ProcessPostedLoggingEvents(); - - if (buildRequest?.BuildCompleted == true || exitedDueToError) - { - } - } - } - - /// - /// On the initial call to BuildProjectInternal the number of projects in progress in incremented - /// to indicate a new project build request is in progress. - /// - private void BuildProjectInternalInitial(BuildRequest buildRequest, Project project) - { - bool startRootProjectBuild = this.numberOfProjectsInProgress == 0 && !Router.ChildMode; - /* - The number of projects in progress is incremented prior to starting the root project build - so if there is an error the number of projects inprogress is decrement from 1 rather than 0. - Decrementing from 0 projects in progress causes an exception. - */ - IncrementProjectsInProgress(); - - if (ProfileBuild) - { - buildRequest.StartTime = DateTime.Now.Ticks; - buildRequest.ProcessingStartTime = buildRequest.StartTime; - } - - if (startRootProjectBuild) - { - StartRootProjectBuild(buildRequest, project); - } - - project.BuildInternal(buildRequest); - } - - /// - /// Sets the current Directory and PerThreadProjectDirectory to the project.ProjectDirectory - /// This is done so any BuildItems on this thread have the correct root directory, - /// so that they can evaluate their built-in metadata correctly while building; - /// also so that "exists" conditions can evaluate relative paths. - /// - private void SetBuildItemCurrentDirectory(Project project) - { - if (!Router.SingleThreadedMode) - { - Project.PerThreadProjectDirectory = project.ProjectDirectory; - } - else // We are in single thread mode and need to make sure the project directory is the current directory - { - if (Directory.GetCurrentDirectory() != project.ProjectDirectory && !string.IsNullOrEmpty(project.ProjectDirectory)) - { - Directory.SetCurrentDirectory(project.ProjectDirectory); - } - } - } - - /// - /// This method will continue a project build which is in progress - /// - private void BuildProjectInternalContinue(BuildRequest buildRequest, ProjectBuildState buildContext, TaskExecutionContext taskExecutionContext, Project project) - { - if (buildRequest != null && ProfileBuild) - { - buildRequest.ProcessingStartTime = DateTime.Now.Ticks; - } - - project.ContinueBuild(buildContext, taskExecutionContext); - } - - private void IncrementProjectsInProgress() - { - Interlocked.Increment(ref this.numberOfProjectsInProgress); - } - - private void FinishBuildProjectInProgress(BuildRequest buildRequest, ProjectBuildState buildContext, bool exitedDueToError) - { - if (buildRequest != null && ProfileBuild) - { - buildRequest.ProcessingTotalTime += DateTime.Now.Ticks - buildRequest.ProcessingStartTime; - } - - if (buildRequest?.BuildCompleted == true || - buildContext?.BuildComplete == true) - { - DecrementProjectsInProgress(); - } - - if (exitedDueToError) - { - SetEngineAbortTo(true); - } - } - - internal void DecrementProjectsInProgress() - { - ErrorUtilities.VerifyThrow(this.numberOfProjectsInProgress != 0, "Number of Projects in progress should not be 0 before the count is decremented"); - Interlocked.Decrement(ref this.numberOfProjectsInProgress); - CheckForBuildCompletion(); - } - - private void CheckForBuildCompletion() - { - // If the number of projects in progress reaches zero again, we've popped back - // out of the root of the recursion. - if (this.numberOfProjectsInProgress == 0 && this.buildRequests.Count == 0) - { - // Fire the event that says the overall build is complete. - if (!Router.ChildMode) - { - SetEngineAbortTo(true); - } - - if (Engine.debugMode) - { - Console.WriteLine(" Done All projects and my queue is empty, EngineNodeID: " + this.nodeId); - } - } - } - - /// - /// Engine.BuildProject gets called recursively when projects use the - /// MSBuild *task* to build other child projects. If "numberOfProjectsInProgress" - /// is 0, then we know we are currently NOT in a recursive call. We - /// are really being called at the top level. - /// - private void StartRootProjectBuild(BuildRequest buildRequest, Project project) - { - foreach (Project loadedProject in projectsLoadedByHost.Values) - { - // There should be no projects in the ProjectManager with the same full path, global properties and tools version - // as any of the loaded projects. If there are, something went badly awry, because - // we were supposed to have deleted them after the last build. - ErrorUtilities.VerifyThrow(this.cacheOfBuildingProjects.GetProject(loadedProject.FullFileName, loadedProject.GlobalProperties, loadedProject.ToolsVersion) == null, - "Project shouldn't be in ProjectManager already."); - - // Add the loaded project to the list of projects being built, just - // so that during the build, we have only one place we need to look - // instead of having to search multiple lists. - this.cacheOfBuildingProjects.AddProject(loadedProject); - } - - if (0 == (buildRequest.BuildSettings & BuildSettings.DoNotResetPreviouslyBuiltTargets)) - { - // Reset the build state for all projects that are still cached from the - // last build and the currently loaded projects that we just added to - // the ProjectManager. - this.cacheOfBuildingProjects.ResetBuildStatusForAllProjects(); - - // Clear the project build results cache - this.cacheManager.ClearCache(); - - // Reset the build state for the project that we're going to build. This may not - // be in the ProjectManager if it doesn't have a FullFileName property. - project.ResetBuildStatus(); - } - } - - /// - /// Loads a project file from disk, and builds the default targets. - /// - /// RGoel - /// - /// true, if build succeeds - public bool BuildProjectFile - ( - string projectFile - ) - { - return this.BuildProjectFile(projectFile, null, this.GlobalProperties, null, BuildSettings.None); - } - - /// - /// Loads a project file from disk, and builds the specified target. - /// - /// RGoel - /// - /// Can be null, if caller wants to build the default targets for the project. - /// true, if build succeeds - public bool BuildProjectFile - ( - string projectFile, - string targetName - ) - { - return this.BuildProjectFile(projectFile, new string[] { targetName }, this.GlobalProperties, - null, BuildSettings.None); - } - - /// - /// Loads a project file from disk, and builds the specified list of targets. - /// - /// RGoel - /// - /// Can be null, if caller wants to build the default targets for the project. - /// true, if build succeeds - public bool BuildProjectFile - ( - string projectFile, - string[] targetNames - ) - { - return this.BuildProjectFile(projectFile, targetNames, this.GlobalProperties, - null, BuildSettings.None); - } - - /// - /// Loads a project file from disk, and builds the specified list of targets. This overload - /// takes a set of global properties to use for the build. - /// - /// RGoel - /// - /// Can be null, if caller wants to build the default targets for the project. - /// Can be null if no global properties are needed. - /// true, if build succeeds - public bool BuildProjectFile - ( - string projectFile, - string[] targetNames, - BuildPropertyGroup globalProperties - ) - { - return this.BuildProjectFile(projectFile, targetNames, globalProperties, - null, BuildSettings.None); - } - - /// - /// Loads a project file from disk, and builds the specified list of targets. This overload - /// takes a set of global properties to use for the build and returns the target outputs. - /// - /// RGoel - /// - /// Can be null, if caller wants to build the default targets for the project. - /// Can be null if no global properties are needed. - /// Can be null if outputs are not needed. - /// true, if build succeeds - public bool BuildProjectFile - ( - string projectFile, - string[] targetNames, - BuildPropertyGroup globalProperties, - IDictionary targetOutputs - ) - { - return this.BuildProjectFile(projectFile, targetNames, globalProperties, - targetOutputs, BuildSettings.None); - } - - /// - /// Loads a project file from disk, and builds the specified list of targets. This overload - /// takes a set of global properties to use for the build, returns the target outputs, and also - /// allows the caller to specify additional build flags. - /// - /// - /// If this project file is already in our list of in-progress projects, we use the - /// existing Project object instead of instantiating a new one. Always use this method to - /// build projects within projects, otherwise the build won't be optimized. - /// - /// - /// Can be null, if caller wants to build the default targets for the project. - /// Can be null if no global properties are needed. - /// Can be null if outputs are not needed. - /// Specifies additional options to alter the behavior of the build. - /// true, if build succeeds - public bool BuildProjectFile - ( - string projectFile, - string[] targetNames, - BuildPropertyGroup globalProperties, - IDictionary targetOutputs, - BuildSettings buildFlags - ) - { - error.VerifyThrowArgumentNull(projectFile, "projectFileName"); - error.VerifyThrowArgument(projectFile.Length > 0, "EmptyProjectFileName"); - - return BuildProjectFile(projectFile, targetNames, globalProperties, targetOutputs, buildFlags, null); - } - - /// - /// Loads a project file from disk, and builds the specified list of targets. This overload - /// takes a set of global properties to use for the build, returns the target outputs, and also - /// allows the caller to specify additional build flags. - /// - /// - /// If this project file is already in our list of in-progress projects, we use the - /// existing Project object instead of instantiating a new one. Always use this method to - /// build projects within projects, otherwise the build won't be optimized. - /// - /// - /// Can be null, if caller wants to build the default targets for the project. - /// Can be null if no global properties are needed. - /// Can be null if outputs are not needed. - /// Specifies additional options to alter the behavior of the build. - /// Tools version to impose on the project in this build - /// true, if build succeeds - public bool BuildProjectFile - ( - string projectFile, - string[] targetNames, - BuildPropertyGroup globalProperties, - IDictionary targetOutputs, - BuildSettings buildFlags, - string toolsVersion - ) - { - return PostProjectEvaluationRequests - (null, new string[] { projectFile }, new string[][] { targetNames }, - new BuildPropertyGroup[] { globalProperties }, new IDictionary[] { targetOutputs }, buildFlags, - new string[] { toolsVersion }); - } - - /// - /// Loads a set of project files from disk, and builds the given list of targets for each one. This overload - /// takes a set of global properties for each project to use for the build, returns the target outputs, - /// and also allows the caller to specify additional build flags. - /// - /// Array of project files to build (can't be null) - /// Array of targets for each project(can't be null) - /// Array of properties for each project (can't be null) - /// Array of tables for target outputs (can't be null) - /// - /// Tools version to impose on the project in this build - /// True if all given project build successfully - public bool BuildProjectFiles - ( - string[] projectFiles, - string[][] targetNamesPerProject, - BuildPropertyGroup[] globalPropertiesPerProject, - IDictionary[] targetOutputsPerProject, - BuildSettings buildFlags, - string[] toolsVersions - ) - { - // Verify the arguments to the API - error.VerifyThrowArgumentArraysSameLength(projectFiles, targetNamesPerProject, "projectFiles", "targetNamesPerProject"); - error.VerifyThrowArgument(projectFiles.Length > 0, "projectFilesEmpty"); - error.VerifyThrowArgumentArraysSameLength(projectFiles, globalPropertiesPerProject, "projectFiles", "globalPropertiesPerProject"); - error.VerifyThrowArgumentArraysSameLength(projectFiles, targetOutputsPerProject, "projectFiles", "targetOutputsPerProject"); - error.VerifyThrowArgumentArraysSameLength(projectFiles, toolsVersions, "projectFiles", "toolsVersions"); - - // Verify the entries in the project file array - for (int i = 0; i < projectFiles.Length; i++) - { - error.VerifyThrowArgumentNull(projectFiles[i], "projectFiles[" + i + "]"); - error.VerifyThrowArgument(projectFiles[i].Length > 0, "projectFilesEmptyElement", i); - } - - return PostProjectEvaluationRequests - (null, projectFiles, targetNamesPerProject, globalPropertiesPerProject, targetOutputsPerProject, - buildFlags, toolsVersions); - } - - internal bool PostProjectEvaluationRequests - ( - Project project, - string[] projectFiles, - string[][] targetNames, - BuildPropertyGroup[] globalPropertiesPerProject, - IDictionary[] targetOutputsPerProject, - BuildSettings buildFlags, - string[] toolVersions - ) - { - string currentDirectory = Environment.CurrentDirectory; - string currentPerThreadProjectDirectory = Project.PerThreadProjectDirectory; - fatalErrorContext = null; - - BuildEventContext buildEventContext; - - // Already have an instantiated project in the OM and it has not fired a project started event for itself yet - if (project?.HaveUsedInitialProjectContextId == false) - { - buildEventContext = project.ProjectBuildEventContext; - } - else // Dont have an already instantiated project, need to make a new context - { - buildEventContext = new BuildEventContext( - this.nodeId, - BuildEventContext.InvalidTargetId, - BuildEventContext.InvalidProjectContextId, - BuildEventContext.InvalidTaskId - ); - } - - // Currently, MSBuild requires that the calling thread be marked "STA" -- single - // threaded apartment. This is because today we are calling the tasks' Execute() - // method on this main thread, and there are tasks out there that create unmarshallable - // COM objects that require the "Apartment" threading model. Once the engine supports - // multi-threaded builds, and is spinning up its own threads to call the tasks, then - // we don't care so much about the STA vs. MTA designation on the main thread. But for - // now, we do. - if (Environment.GetEnvironmentVariable("MSBUILDOLDOM") != "1" && Thread.CurrentThread.GetApartmentState() != ApartmentState.STA) - { - // Bug VSWhidbey 126031. Really, we would like to, - // - // error.VerifyThrowInvalidOperation((Thread.CurrentThread.ApartmentState == ApartmentState.STA),"STARequired"); - // - // But NUnit-console.exe is not in the STA and so we would get some assert dialogs - // and build failures. If we ever upgrade to NUnit 2.1 or later, there is an option - // to tell NUnit to run in STA mode, and then maybe we can be more strict here. - primaryLoggingServices.LogWarning(buildEventContext, new BuildEventFileInfo(/* there is truly no file associated with this warning */ String.Empty), - "STARequired", Thread.CurrentThread.GetApartmentState()); - } - - BuildRequest[] buildRequests = new BuildRequest[projectFiles.Length]; - Hashtable[] targetOutputsWorkingCopy = new Hashtable[buildRequests.Length]; - for (int i = 0; i < buildRequests.Length; i++) - { - // if the caller wants to retrieve target outputs, create a working copy to avoid clobbering - // other data in the hashtable - if (targetOutputsPerProject[i] != null) - { - targetOutputsWorkingCopy[i] = new Hashtable(StringComparer.OrdinalIgnoreCase); - } - - buildRequests[i] = - CreateLocalBuildRequest(buildEventContext, project, projectFiles[i], targetNames[i], - globalPropertiesPerProject[i], targetOutputsWorkingCopy[i], buildFlags, - toolVersions[i]); - } - - bool overallResult = true; - bool exitedDueToError = true; - try - { - // Reset the current directory stored in the per thread variable for the current thread - Project.PerThreadProjectDirectory = null; - // Initialize the scheduler with the current information - Scheduler.Initialize(NodeManager.GetNodeDescriptions()); - // Fire the event that says the overall build is beginning. - LoggingServices.LogBuildStarted(); - LoggingServices.ProcessPostedLoggingEvents(); - // Post all the build requests into the engine queue - PostBuildRequests(buildRequests); - // Trigger the actual build (this call will not return until build is complete) - EngineBuildLoop(null); - - for (int i = 0; i < buildRequests.Length; i++) - { - // Collect the outputs - BuildResult buildResult = buildRequests[i].GetBuildResult(); - if (buildResult.OutputsByTarget != null && targetOutputsPerProject[i] != null) - { - buildResult.ConvertToTaskItems(); - foreach (DictionaryEntry de in buildResult.OutputsByTarget) - { - targetOutputsPerProject[i][de.Key] = de.Value; - } - } - overallResult = overallResult && buildRequests[i].BuildSucceeded; - } - - exitedDueToError = false; - } - catch (Exception e) - { - // Only log the error once at the root of the recursion for unhandled exceptions, instead of - // logging the error multiple times for each level of project-to-project - // recursion until we get to the top of the stack. - if (fatalErrorContext != null) - { - primaryLoggingServices.LogFatalBuildError(fatalErrorContext, e, new BuildEventFileInfo(fatalErrorProjectName)); - } - else - { - primaryLoggingServices.LogFatalBuildError(buildEventContext, e, new BuildEventFileInfo(String.Empty)); - } - - // Rethrow so that the host can catch it and possibly rethrow it again - // so that Watson can give the user the option to send us an error report. - throw; - } - finally - { - // Post build finished event if the finally is not being executed due to an exception - EndingEngineExecution(overallResult, exitedDueToError); - // Reset the current directory to the value before this - // project built - Environment.CurrentDirectory = currentDirectory; - // We reset the path back to the original value in case the - // host is depending on the current directory to find projects - Project.PerThreadProjectDirectory = currentPerThreadProjectDirectory; - } - - return overallResult; - } - - /// - /// Create a build request which will be posted to the local engine queue, having a HandleId of -1 meaning it came from the local - /// engine rather than an engine call back - /// - /// - private BuildRequest CreateLocalBuildRequest(BuildEventContext buildEventContext, Project project, string projectFile, string[] targetNames, BuildPropertyGroup globalProperties, IDictionary targetOutputs, BuildSettings buildFlags, string toolsVersion) - { - // Global Properties should not be null as this will cause a crash when we try and cache the build result of the project. - // Whidby also set global properties to empty if they were null. - if (globalProperties == null) - { - globalProperties = new BuildPropertyGroup(); - } - - BuildRequest buildRequest = new BuildRequest(EngineCallback.invalidEngineHandle, projectFile, targetNames, globalProperties, toolsVersion, -1, true, false); - buildRequest.ParentBuildEventContext = buildEventContext; - // Set the project object to the passed in project - buildRequest.ProjectToBuild = project; - // Set the request build flags - buildRequest.BuildSettings = buildFlags; - // Set the boolean requesting the project start/finish events - buildRequest.FireProjectStartedFinishedEvents = true; - // Set the dictionary to return target outputs in, if any - buildRequest.OutputsByTarget = targetOutputs; - // If the tools version is null and we have a project object then use the project's tools version - // If we do not have a project and we have a null tools version then the build request's tools version will be null, which will later be set in BuildProjectFileInternal - if (String.IsNullOrEmpty(toolsVersion) && project != null) - { - buildRequest.ToolsetVersion = project.ToolsVersion; - } - // Set project filename correctly if only the project object is passed in - if (buildRequest.ProjectFileName == null) - { - buildRequest.ProjectFileName = project.FullFileName; - } - return buildRequest; - } - - /// - /// Loads a project file from disk, and builds the specified list of targets. This overload - /// takes a set of global properties to use for the build, returns the target outputs, and also - /// allows the caller to specify additional build flags. - /// - /// - /// If this project file is already in our list of in-progress projects, we use the - /// existing Project object instead of instantiating a new one. Always use this method to - /// build projects within projects, otherwise the build won't be optimized. - /// - internal void BuildProjectFileInternal - ( - BuildRequest buildRequest - ) - { - string projectFile = buildRequest.ProjectFileName; - - error.VerifyThrowArgumentNull(projectFile, "projectFileName"); - error.VerifyThrowArgument(projectFile.Length > 0, "EmptyProjectFileName"); - // When we get to this point the global properties should not be null, as they are used to determine if a project has already been loaded / built before. - error.VerifyThrow(buildRequest.GlobalProperties != null, "Global Properties should not be null"); - - // Convert the project filename to a fully qualified path. - FileInfo projectFileInfo = new FileInfo(projectFile); - - // If the project file doesn't actually exist on disk, it's a failure. - ErrorUtilities.VerifyThrowArgument(projectFileInfo.Exists, "ProjectFileNotFound", projectFile); - - try - { - ArrayList actuallyBuiltTargets; - - // If the tools version is empty take a quick peek at the project file to determine if it has a tools version defined - if (String.IsNullOrEmpty(buildRequest.ToolsetVersion)) - { - buildRequest.ToolsetVersion = XmlUtilities.GetAttributeValueForElementFromFile(buildRequest.ProjectFileName, XMakeAttributes.project, XMakeAttributes.toolsVersion); - buildRequest.ToolsVersionPeekedFromProjectFile = true; - } - - // Check if there is a cached result available for this build - BuildResult cachedResult = cacheManager.GetCachedBuildResult(buildRequest, out actuallyBuiltTargets); - if (cachedResult != null) - { - // Notify the scheduler of the dependecy and indicate that it will be evaluated (aka retrieved from the cache locally) - Scheduler.NotifyOfSchedulingDecision(buildRequest, this.nodeId); - ProcessCachedResult(buildRequest, projectFileInfo, actuallyBuiltTargets, cachedResult); - } - else - { - // There's no cached result: we have to build it. Figure out which node to build it on. - Project matchingProjectCurrentlyLoaded = null; - - // See if we have a project loaded by the host already that matches the full path, in the - // list of projects which were loaded at the beginning of the build. - Project projectCurrentlyLoaded = (Project)this.projectsLoadedByHost[projectFileInfo.FullName]; - - if (projectCurrentlyLoaded != null) - { - // See if the global properties and tools version match. - if (projectCurrentlyLoaded.IsEquivalentToProject - ( - projectCurrentlyLoaded.FullFileName, - buildRequest.GlobalProperties, - buildRequest.ToolsetVersion - ) - ) - { - // If so, use it. - matchingProjectCurrentlyLoaded = projectCurrentlyLoaded; - } - } - - // Decide to build the project on either the current node or remote node - string toolsVersionToUse = buildRequest.ToolsetVersion ?? DefaultToolsVersion; - - // If a matching project is currently loaded, we will build locally. - bool isLocal = (matchingProjectCurrentlyLoaded != null); - - // If not, we need to search our cache of building projects to see if we have built this project - // locally already. - if (!isLocal) - { - // Determine if the project was previously loaded, but is now unloaded. - bool projectWasPreviouslyLoaded = this.cacheOfBuildingProjects.HasProjectBeenLoaded(projectFileInfo.FullName, buildRequest.GlobalProperties, toolsVersionToUse); - - // We do this check because we need to know if the project is already building on this node. - // Unlike the check of projectsLoadedByHost, this will also find projects which were added - // after the start of the build, such as MSBuild task-generated build requests. - bool projectIsLoaded = this.cacheOfBuildingProjects.GetProject(projectFileInfo.FullName, buildRequest.GlobalProperties, toolsVersionToUse) != null; - - isLocal = projectWasPreviouslyLoaded || projectIsLoaded; - } - - int nodeIndex = EngineCallback.inProcNode; - - // If the project, properties and tools version is not known locally, it is either being services by a remote node - // or we need to let the scheduler pick a node for it to be serviced by using its algorithm. - if (!isLocal) - { - nodeIndex = cacheOfBuildingProjects.GetRemoteProject(projectFileInfo.FullName, buildRequest.GlobalProperties, toolsVersionToUse); - } - - int evaluationNode = Scheduler.CalculateNodeForBuildRequest(buildRequest, nodeIndex); - if (matchingProjectCurrentlyLoaded == null && evaluationNode == EngineCallback.inProcNode) - { - // We haven't already got this project loaded in this Engine, or it was previously unloaded from this Engine, - // and we've been scheduled to build it on this node. So create a new project if necessary. - // If we peeked at the project file then we need to make sure that if the tools version in the project is not marked as an override then - // the project's tools version is the same. If they are the same then override should be false. - try - { - matchingProjectCurrentlyLoaded = GetMatchingProject(projectCurrentlyLoaded, - projectFileInfo.FullName, buildRequest.GlobalProperties, - buildRequest.ToolsetVersion, buildRequest.TargetNames, buildRequest.ParentBuildEventContext, buildRequest.ToolsVersionPeekedFromProjectFile); - } - catch (InvalidProjectFileException e) - { - primaryLoggingServices.LogInvalidProjectFileError(buildRequest.ParentBuildEventContext, e); - throw; - } - } - - if (evaluationNode != EngineCallback.inProcNode) - { - // The project will be evaluated remotely so add a record - // indicating where this project is being evaluated - if (evaluationNode != EngineCallback.parentNode) - { - cacheOfBuildingProjects.AddRemoteProject(projectFileInfo.FullName, buildRequest.GlobalProperties, toolsVersionToUse, evaluationNode); - } - } - - if (Engine.debugMode) - { - Console.WriteLine("###Missing cached result for " + buildRequest.GetTargetNamesList() + " in " + - buildRequest.ProjectFileName + " - building"); - } - - if (evaluationNode == EngineCallback.inProcNode) - { - ErrorUtilities.VerifyThrow(cacheOfBuildingProjects.GetRemoteProject(projectFileInfo.FullName, buildRequest.GlobalProperties, toolsVersionToUse) == EngineCallback.invalidNode, - "Should not build remote projects"); - buildRequest.ProjectToBuild = matchingProjectCurrentlyLoaded; - this.BuildProjectInternal(buildRequest, null, null, true); - } - else - { - // Increment number of projects in progress - if (!buildRequest.IsGeneratedRequest) - { - IncrementProjectsInProgress(); - } - Router.PostBuildRequest(buildRequest, evaluationNode); - } - } - } - catch (InvalidProjectFileException) - { - // eat the exception because it has already been logged - HandleProjectFileInternalException(buildRequest); - } - } - - private void HandleProjectFileInternalException(BuildRequest buildRequest) - { - // Flush out all the logging messages, which may have been posted outside target execution - primaryLoggingServices.ProcessPostedLoggingEvents(); - - // Mark evaluation as complete - buildRequest.BuildCompleted = true; - - if (buildRequest.HandleId != EngineCallback.invalidEngineHandle) - { - Router.PostDoneNotice(buildRequest); - } - - CheckForBuildCompletion(); - } - - /// - /// Pretend we're actually building a project when really we're just retrieving the results from the cache. - /// - /// - /// - /// - /// - private void ProcessCachedResult - ( - BuildRequest buildRequest, - FileInfo projectFileInfo, - ArrayList actuallyBuiltTargets, - BuildResult cachedResult - ) - { - buildRequest.InitializeFromCachedResult(cachedResult); - - if (Engine.debugMode) - { - Console.WriteLine("===Reusing cached result for " + buildRequest.GetTargetNamesList() + " in " + - buildRequest.ProjectFileName + " result is " + buildRequest.BuildSucceeded + " EngineNodeID: " + this.nodeId); - } - - BuildEventContext requestContext = buildRequest.ParentBuildEventContext; - BuildEventContext currentContext = new BuildEventContext(this.nodeId, BuildEventContext.InvalidTargetId, GetNextProjectId(), BuildEventContext.InvalidTaskId); - - primaryLoggingServices.LogProjectStarted(cachedResult.ProjectId, requestContext, currentContext, projectFileInfo.FullName, - buildRequest.GetTargetNamesList(), - new BuildPropertyGroupProxy(new BuildPropertyGroup()), - new BuildItemGroupProxy(new BuildItemGroup())); - primaryLoggingServices.LogComment(currentContext, MessageImportance.Low, "ToolsVersionInEffectForBuild", buildRequest.ToolsetVersion); - - for (int i = 0; i < actuallyBuiltTargets.Count; i++) - { - string builtTargetName = EscapingUtilities.UnescapeAll((string)actuallyBuiltTargets[i]); - Target.BuildState buildState = (Target.BuildState)cachedResult.ResultByTarget[builtTargetName]; - buildRequest.ResultByTarget[builtTargetName] = buildState; - - primaryLoggingServices.LogComment(currentContext, - (buildState == Target.BuildState.CompletedSuccessfully) ? "TargetAlreadyCompleteSuccess" : "TargetAlreadyCompleteFailure", - builtTargetName); - - if (buildState == Target.BuildState.CompletedUnsuccessfully) - { - break; - } - } - - primaryLoggingServices.LogProjectFinished(currentContext, projectFileInfo.FullName, cachedResult.EvaluationResult); - - if (!buildRequest.IsGeneratedRequest) - { - CheckForBuildCompletion(); - } - else - { - Router.PostDoneNotice(buildRequest); - } - } - - /// - /// Returns a project object that matches the full path and global properties passed in. - /// First, it checks our cache of building projects to see if such a project already exists. - /// If so, we reuse that. Otherwise, we create a new Project object with the specified - /// full path and global properties. The "existingProject" parameter passed in is just - /// so we can reuse the Xml if there's already a project available with the same full path. - /// - /// - /// - /// - /// - internal Project GetMatchingProject - ( - Project existingProject, - string projectFullPath, - BuildPropertyGroup globalPropertiesToUse, - string toolsVersion, - string[] targetNames, - BuildEventContext buildEventContext, - bool toolsVersionPeekedFromProjectFile - ) - { - // See if we already have a project with the exact same full path and global properties - // that the caller is requesting us to build. If so, use that. - Project returnProject = this.cacheOfBuildingProjects.GetProject(projectFullPath, globalPropertiesToUse, toolsVersion); - - // If this project was not found in our list, create a new project, - // and load the contents from the project file. - if (returnProject == null) - { -#if DEBUG - if (!String.IsNullOrEmpty(Environment.GetEnvironmentVariable("MSBUILDASSERTONLOADMULTIPLECOPIESOFPROJECT"))) - { - if (this.projectsLoadedByHost.Contains(projectFullPath)) - { - // We're about to load a second copy of a project that is already loaded in the IDE. - // This assert can fire when different projects in the IDE have different sets of - // global properties. For example, suppose there are two projects loaded in the IDE, - // ProjectA and ProjectB. Suppose the project system has given ProjectA two global - // properties (e.g., Configuration=Debug and Platform=AnyCPU), and has given ProjectB - // three global properties (e.g., Configuration=Foobar, Platform=x86, and DevEnvDir=c:\vs). - // Now, if ProjectB has a P2P reference to ProjectA, we've got a problem because when - // ProjectB calls the task to grab the output of ProjectA, the engine is going - // to try and merge together the global properties, and the merged set will consist - // of all three properties. Since we won't have a copy of ProjectA in our projectsLoadedByHost - // list that has all three of the same global properties, we'll decide we have to create - // a new Project object, and this is a big unnecessary perf hit (as well as being incorrect). - // If a user customized his build process and is explicitly passing in Properties to the - // task, then we would be entering this codepath for a totally legitimate - // scenario, so we don't want to disallow it. We just want to know about it if it happens - // to anyone before we ship, just so we can investigate to see if there may be a bug - // somewhere. - if (this.projectsLoadedByHost.Count > 1) - { - // The assert condition (projectsLoadedByHost.Count == 1) is there because - // for command-line builds using msbuild.exe, the # of projects loaded by the host will - // always be exactly 1. We don't want to assert for command-line builds, because then - // we'd be firing this all the time for perfectly legitimate scenarios. - // We also don't want to assert in razzle, because the razzle build is expected to do this - // to accomplish traversal. - Debug.Assert(!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("_NTROOT")), - "This assertion is here to catch potential bugs wrt MSBuild and VS integration. " + - "It is okay to ignore this assert only if you are in the IDE and have customized " + - "your build process such that you are passing the Properties parameter into the " + - " task in way that causes the same project to be built with different " + - "sets of global properties. However, if you are just using a standard VS-generated project, " + - "this assert should not fire, so please open a bug under the \\VSCORE\\MSBuild\\VSIntegration " + - "path."); - } - } - } -#endif - - // Check if the project has been previously unloaded due to a user request during the current build - // In this case reloaded a project is an error because we can't ensure a consistent state of the reloaded project - // and the cached resulted of the original - string toolsVersionToUse = toolsVersion ?? DefaultToolsVersion; - if (this.cacheOfBuildingProjects.HasProjectBeenLoaded(projectFullPath, globalPropertiesToUse, toolsVersionToUse)) - { - string joinedNames = ResourceUtilities.FormatResourceString("DefaultTargets"); - if (targetNames?.Length > 0) - { - joinedNames = EscapingUtilities.UnescapeAll(String.Join(";", targetNames)); - } - BuildEventFileInfo fileInfo = new BuildEventFileInfo(projectFullPath); - string errorCode; - string helpKeyword; - string message = ResourceUtilities.FormatResourceString(out errorCode, out helpKeyword, "ReloadingPreviouslyUnloadedProject", projectFullPath, joinedNames); - throw new InvalidProjectFileException(projectFullPath, fileInfo.Line, fileInfo.Column, fileInfo.EndLine, fileInfo.EndColumn, message, null, errorCode, helpKeyword); - } - // This creates a new project. - try - { - // If the tools version was peeked from the project file then we reset the tools version to null as the tools version is read by the project object again - // when setting or getting the ToolsVersion property. If the tools version was not peeked from the project file than it is an override. - if (toolsVersionPeekedFromProjectFile) - { - toolsVersion = null; - } - returnProject = new Project(this, toolsVersion); - } - catch (InvalidOperationException) - { - BuildEventFileInfo fileInfo = new BuildEventFileInfo(projectFullPath); - string errorCode; - string helpKeyword; - string message = ResourceUtilities.FormatResourceString(out errorCode, out helpKeyword, "UnrecognizedToolsVersion", toolsVersion); - throw new InvalidProjectFileException(projectFullPath, fileInfo.Line, fileInfo.Column, fileInfo.EndLine, fileInfo.EndColumn, message, null, errorCode, helpKeyword); - } - - // We're only building this project ... it is not loaded by a host, and we - // should feel free to discard this whenever we like. - returnProject.IsLoadedByHost = false; - - // Give it the global properties that were requested. - returnProject.GlobalProperties = globalPropertiesToUse; - - // Load the project file. If we don't already have an XmlDocument for this - // project file, load it off disk. Otherwise, use one of the XmlDocuments - // that we already have. Two advantages: 1.) perf 2.) using the in-memory - // contents that the host may have altered. - if (existingProject != null) - { - //Console.WriteLine("Reusing an existing project: " + projectFullPath); - returnProject.FullFileName = projectFullPath; - returnProject.LoadFromXmlDocument(existingProject.XmlDocument, buildEventContext, existingProject.LoadSettings); - } - else - { - //Console.WriteLine("Found new project: " + projectFullPath); - returnProject.Load(projectFullPath, buildEventContext, ProjectLoadSettings.None); - } - - // Add the newly created Project object to the ProjectManager. - this.cacheOfBuildingProjects.AddProject(returnProject); - } - - return returnProject; - } - - /// - /// When using the MSBuild task to build a child project, we need to figure out the set of - /// global properties that the child should be built with. It is a merge of whatever - /// properties the parent project was being built with, plus whatever properties were - /// actually passed into the MSBuild task (in the "Properties" parameter). However, - /// the slightly wrinkle is the child project may have actually been one that is - /// currently loaded in the IDE, and the IDE controls what Configuration/Platform each - /// project should be built with, so we have to honor that too. So, the order in which - /// we look at global properties are: - /// - /// 1. Whatever global properties the parent project was building with. (The parent - /// project is the one that called the <MSBuild< task. - /// 2. If the child project was already previously loaded by the host, whatever global - /// properties were sent into the child project by the host (via Project.GlobalProperties). - /// 3. Whatever properties were passed into the "Properties" parameter of the <MSBuild< - /// task. - /// - /// - /// - /// - /// - /// RGoel - /// merged PropertyGroup - internal BuildPropertyGroup MergeGlobalProperties - ( - BuildPropertyGroup parentProjectGlobalProperties, - BuildPropertyGroup postMergeProperties, - string childProjectFile, - IDictionary globalPropertiesPassedIntoTask - ) - { - if (childProjectFile != null) - { - // The childProject can be null (if user wants us to just use the calling project as the - // callee project). But if it's not null, it really shouldn't be blank, and it should - // exist on disk. If it doesn't we can't get its full path. - error.VerifyThrowArgument(childProjectFile.Length > 0, "EmptyProjectFileName"); - - // If the project file doesn't actually exist on disk, it's a failure. - ErrorUtilities.VerifyThrowArgument(File.Exists(childProjectFile), "ProjectFileNotFound", childProjectFile); - } - - // Create a new BuildPropertyGroup to represent the final set of global properties that we're going to - // use for the child project. - BuildPropertyGroup finalGlobalProperties = new BuildPropertyGroup(); - - // Start with the global properties from the parent project. - if (postMergeProperties == null) - { - finalGlobalProperties.ImportProperties(parentProjectGlobalProperties); - } - else - { - finalGlobalProperties.ImportProperties(postMergeProperties); - } - - // childProjectFile could be null when no Projects were passed into the MSBuild task, which - // means parentProject == childProject, which means no need to import the same properties again. - if (childProjectFile != null) - { - // Get the full path of the child project file. - string childProjectFullPath = Path.GetFullPath(childProjectFile); - - // Find out if there's a project already loaded with the same full path. - Project loadedProjectWithSameFullPath = (Project)this.projectsLoadedByHost[childProjectFullPath]; - - // Then ... if there is a loaded project with the same full path, merge in its global properties. - // This way, we honor whatever settings the IDE has requested for this project (e.g. Configuration=Release, or whatever). - if (loadedProjectWithSameFullPath != null) - { - finalGlobalProperties.ImportProperties(loadedProjectWithSameFullPath.GlobalProperties); - } - } - - // Finally, whatever global properties were passed into the task ... those are the final winners. - if (globalPropertiesPassedIntoTask != null) - { - foreach (DictionaryEntry newGlobalProperty in globalPropertiesPassedIntoTask) - { - finalGlobalProperties.SetProperty((string)newGlobalProperty.Key, - (string)newGlobalProperty.Value); - } - } - - return finalGlobalProperties; - } - - internal void PostBuildRequests(BuildRequest[] buildRequestArray) - { - buildRequests.EnqueueArray(buildRequestArray); - } - - internal void PostBuildRequest(BuildRequest buildRequest) - { - buildRequests.Enqueue(buildRequest); - } - - internal void PostTaskOutputUpdates(TaskExecutionContext executionContext) - { - taskOutputUpdates.Enqueue(executionContext); - } - - internal void PostEngineCommand(EngineCommand engineCommand) - { - engineCommands.Enqueue(engineCommand); - } - - internal TaskExecutionContext GetTaskOutputUpdates() - { - TaskExecutionContext taskExecutionContext = taskOutputUpdates.Dequeue(); - - if (taskExecutionContext != null) - { - // Clear the node proxy state, all the write to the proxy state should come from the engine thread - EngineCallback.ClearContextState(taskExecutionContext.HandleId); - } - - return taskExecutionContext; - } - - /// - /// This function collects status about the inprogress targets and engine operations. - /// This function should always run from the engine domain because it touch engine data - /// structures. - /// - internal NodeStatus RequestStatus(int requestId) - { - // Find out the list of the inprogress waiting targets - List outstandingRequests = new List(); - int[] handleIds = NodeManager.TaskExecutionModule.GetWaitingTaskData(outstandingRequests); - Target[] waitingTargets = EngineCallback.GetListOfTargets(handleIds); - - // Find out the list of targets waiting due to dependency or onerror call but not actively in progress - List inProgressProject = cacheOfBuildingProjects.GetInProgressProjects(); - List inProgressTargets = new List(); - foreach (Project project in inProgressProject) - { - foreach (Target target in project.Targets) - { - if (target.ExecutionState?.BuildingRequiredTargets == true) - { - inProgressTargets.Add(target); - } - } - } - TargetInProgessState[] stateOfInProgressTargets = - new TargetInProgessState[waitingTargets.Length + inProgressTargets.Count]; - for (int i = 0; i < waitingTargets.Length; i++) - { - stateOfInProgressTargets[i] = null; - // Skip if the in progress task has already completed (the task is running in the TEM domain) - if (waitingTargets[i] != null) - { - TargetExecutionWrapper executionState = waitingTargets[i].ExecutionState; - // Skip the target if it has already completed - if (executionState != null) - { - stateOfInProgressTargets[i] = - new TargetInProgessState(EngineCallback, waitingTargets[i], executionState.GetWaitingBuildContexts(), - executionState.InitiatingBuildContext, - outstandingRequests[i], waitingTargets[i].ParentProject.FullFileName); - } - } - } - for (int i = 0; i < inProgressTargets.Count; i++) - { - TargetExecutionWrapper executionState = inProgressTargets[i].ExecutionState; - ErrorUtilities.VerifyThrow(executionState != null, - "Engine thread is blocked so target state should not change"); - - stateOfInProgressTargets[waitingTargets.Length + i] = - new TargetInProgessState(EngineCallback, inProgressTargets[i], executionState.GetWaitingBuildContexts(), - executionState.InitiatingBuildContext, - null, inProgressTargets[i].ParentProject.FullFileName); - } - - NodeStatus nodeStatus = new NodeStatus(requestId, true, buildRequests.Count + taskOutputUpdates.Count, - NodeManager.TaskExecutionModule.LastTaskActivity(), - lastLoopActivity, false); - - nodeStatus.StateOfInProgressTargets = stateOfInProgressTargets; - - return nodeStatus; - } - - internal void PostNodeStatus(int postingNodeId, NodeStatus nodeStatus) - { - if (nodeStatus.RequestId != NodeStatus.UnrequestedStatus) - { - nodeManager.PostNodeStatus(postingNodeId, nodeStatus); - } - else if (nodeStatus.UnhandledException != null) - { - PostEngineCommand(new ReportExceptionEngineCommand(nodeStatus.UnhandledException)); - } - else - { - if (!Router.ChildMode) - { - // If we are changing to breadth first traversal it means we are out of work. Traversal type is false when depth first is requested - if (nodeStatus.TraversalType) - { - Scheduler.NotifyOfBlockedNode(postingNodeId); - } - else if (Engine.debugMode && !nodeStatus.TraversalType) - { - Console.WriteLine("Switch to Depth first traversal is requested by " + postingNodeId); - } - } - - PostEngineCommand(new ChangeTraversalTypeCommand(nodeStatus.TraversalType, false)); - } - } - - #endregion - - /// - /// Reset the cache of loaded projects and all other per build data - /// - internal void ResetPerBuildDataStructures() - { - // Reset the build state for all projects that are still cached from the - // last build and the currently loaded projects that we just added to - // the ProjectManager. - this.cacheOfBuildingProjects.ResetBuildStatusForAllProjects(); - // Clear all the cached results - this.CacheManager.ClearCache(); - } - } -} diff --git a/src/Deprecated/Engine/Engine/EngineCallback.cs b/src/Deprecated/Engine/Engine/EngineCallback.cs deleted file mode 100644 index a8bdfe7a632..00000000000 --- a/src/Deprecated/Engine/Engine/EngineCallback.cs +++ /dev/null @@ -1,617 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Xml; -using System.Globalization; - -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class is an external representation of engine communication with the TEM or child nodes. - /// - internal class EngineCallback : IEngineCallback - { - #region Constructors - /// - /// Creates a callback class. There should only be one callback per engine under normal - /// circumstances. - /// - internal EngineCallback(Engine parentEngine) - { - this.parentEngine = parentEngine; - } - #endregion - - #region Methods for accessing engine internals from the node - - /// - /// This method is called by the node to request evaluation of a target that was - /// requested by a task via IBuildEngine interface. It posts the - /// request into a queue in the engine - /// - /// - public void PostBuildRequestsToHost(BuildRequest[] buildRequests) - { - if (buildRequests.Length > 0) - { - // We can safely assume that all requests need to be routed to the same engine because - // they originated from the same task - for (int i = 0; i < buildRequests.Length; i++) - { - ProcessBuildRequest(buildRequests[i]); - } - - parentEngine.PostBuildRequests(buildRequests); - } - } - - /// - /// Called on the main node only. - /// - public Exception PostCacheEntriesToHost(int nodeId, CacheEntry[] entries, string scopeName, BuildPropertyGroup scopeProperties, string scopeToolsVersion, CacheContentType cacheContentType) - { - try - { - parentEngine.CacheManager.SetCacheEntries(entries, scopeName, scopeProperties, scopeToolsVersion, cacheContentType); - } - catch (InvalidOperationException e) - { - return e; - } - - return null; - } - - /// - /// Called on the main node only. - /// - public CacheEntry[] GetCachedEntriesFromHost(int nodeId, string[] names, string scopeName, BuildPropertyGroup scopeProperties, string scopeToolsVersion, CacheContentType cacheContentType) - { - return parentEngine.CacheManager.GetCacheEntries(names, scopeName, scopeProperties, scopeToolsVersion, cacheContentType); - } - - private void ProcessBuildRequest(BuildRequest buildRequest) - { - ExecutionContext executionContext = GetExecutionContextFromHandleId(buildRequest.HandleId); - // Restore the requests non-serialized data to the correct state - buildRequest.RestoreNonSerializedDefaults(); - buildRequest.NodeIndex = executionContext.NodeIndex; - - ErrorUtilities.VerifyThrow(buildRequest.ParentBuildEventContext != null, "Should not have a null parentBuildEventContext"); - ErrorUtilities.VerifyThrow(buildRequest.IsGeneratedRequest, "Should not be sending a non generated request from the child node to the parent node"); - - // For buildRequests originating from the TEM - additional initialization is necessary - TaskExecutionContext taskExecutionContext = executionContext as TaskExecutionContext; - if (taskExecutionContext != null) - { - Project parentProject = taskExecutionContext.ParentProject; - buildRequest.ParentHandleId = taskExecutionContext.TriggeringBuildRequest.HandleId; - buildRequest.ParentRequestId = taskExecutionContext.TriggeringBuildRequest.RequestId; - - if (buildRequest.ToolsetVersion == null && parentProject.OverridingToolsVersion) - { - // If the MSBuild task (or whatever) didn't give us a specific tools version, - // but the parent project is using an overridden tools version, then use that one - buildRequest.ToolsetVersion = parentProject.ToolsVersion; - } - - try - { - if (buildRequest.GlobalProperties == null) - { - try - { - // Make sure we have a blank global properties because if there is a problem merging them we wont have a crash when we try and cache the build result. - buildRequest.GlobalProperties = new BuildPropertyGroup(); - buildRequest.GlobalProperties = - parentEngine.MergeGlobalProperties(parentProject.GlobalProperties, null, - buildRequest.ProjectFileName, - buildRequest.GlobalPropertiesPassedByTask); - } - catch (ArgumentException e) - { - ConvertToInvalidProjectException(buildRequest, parentProject, e); - } - catch (InvalidOperationException e) - { - ConvertToInvalidProjectException(buildRequest, parentProject, e); - } - } - - // We need to figure out which project object this request is refering to - if (buildRequest.ProjectFileName == null) - { - ErrorUtilities.VerifyThrow(parentProject != null, "Parent project must be non-null"); - - // This means the caller (the MSBuild task) wants us to use the same project as the calling - // project. This allows people to avoid passing in the Projects parameter on the MSBuild task. - Project projectToBuild = parentProject; - - // If the parent project (the calling project) already has the same set of global properties - // as what is being requested, just re-use it. Otherwise, we need to instantiate a new - // project object that has the same project contents but different global properties. - if (!projectToBuild.GlobalProperties.IsEquivalent(buildRequest.GlobalProperties) && - (String.Equals(parentProject.ToolsVersion, buildRequest.ToolsetVersion, StringComparison.OrdinalIgnoreCase))) - { - projectToBuild = parentEngine.GetMatchingProject(parentProject, - parentProject.FullFileName, buildRequest.GlobalProperties, - buildRequest.ToolsetVersion, buildRequest.TargetNames, buildRequest.ParentBuildEventContext, buildRequest.ToolsVersionPeekedFromProjectFile); - } - buildRequest.ProjectToBuild = projectToBuild; - buildRequest.ProjectFileName = projectToBuild.FullFileName; - buildRequest.FireProjectStartedFinishedEvents = false; - } - } - catch (InvalidProjectFileException e) - { - buildRequest.BuildCompleted = true; - // Store message so it can be logged by the engine build loop - buildRequest.BuildException = e; - } - } - else - { - RequestRoutingContext requestRoutingContext = executionContext as RequestRoutingContext; - buildRequest.ParentHandleId = requestRoutingContext.ParentHandleId; - buildRequest.ParentRequestId = requestRoutingContext.ParentRequestId; - } - } - - /// - /// If there is an exception in process build request we will wrap it in an invalid project file exception as any exceptions caught here are really problems with a project file - /// this exception will be handled in the engine and logged - /// - private static void ConvertToInvalidProjectException(BuildRequest buildRequest, Project parentProject, Exception e) - { - BuildEventFileInfo fileInfo = new BuildEventFileInfo(buildRequest.ProjectFileName); - throw new InvalidProjectFileException(parentProject.FullFileName, fileInfo.Line, fileInfo.Column, fileInfo.EndLine, fileInfo.EndColumn, e.Message, null, null, null); - } - - /// - /// This method is used by the node to post the task outputs to the engine. - /// Items and properties output by the task return to the engine thread via the Lookup the - /// TaskEngine was passed, not via posting to the queue here. - /// - internal void PostTaskOutputs - ( - int handleId, - bool taskExecutedSuccessfully, - Exception thrownException, - long executionTime - ) - { - TaskExecutionContext executionContext = GetTaskContextFromHandleId(handleId); - // Set the outputs on the context - executionContext.SetTaskOutputs(taskExecutedSuccessfully, thrownException, executionTime); - // Submit it to the queue - parentEngine.PostTaskOutputUpdates(executionContext); - } - - /// - /// This method is used by the child node to post results of a build request back to the - /// parent node. The parent node then decides if need to re-route the results to another node - /// that requested the evaluation or if it will consume the result locally - /// - /// - public void PostBuildResultToHost(BuildResult buildResult) - { - RequestRoutingContext routingContext = GetRoutingContextFromHandleId(buildResult.HandleId); - ErrorUtilities.VerifyThrow(routingContext.CacheScope != null, "Cache scope should be created for this context"); - - // Cache the results - routingContext.CacheScope.AddCacheEntryForBuildResults(buildResult); - - if (Engine.debugMode) - { - Console.WriteLine("Received result for HandleId " + buildResult.HandleId + ":" + buildResult.RequestId + " mapped to " + routingContext.ParentHandleId + ":" + routingContext.ParentRequestId); - } - - // Update the results with the original handle id and request id, so that - buildResult.HandleId = routingContext.ParentHandleId; - - // If the build result is created from a generated build request a done notice should be posted as other targets could be waiting for this target to finish - if (buildResult.HandleId != invalidEngineHandle) - { - buildResult.RequestId = routingContext.ParentRequestId; - parentEngine.Router.PostDoneNotice(routingContext.ParentNodeIndex, buildResult); - } - else // The build results need to be stored into the build request so they can be sent back to the host that requested the build - { - routingContext.TriggeringBuildRequest.OutputsByTarget = buildResult.OutputsByTarget; - routingContext.TriggeringBuildRequest.BuildSucceeded = buildResult.EvaluationResult; - routingContext.TriggeringBuildRequest.BuildCompleted = true; - parentEngine.PostEngineCommand(new HostBuildRequestCompletionEngineCommand()); - } - - // At this point the execution context we created for the execution of this build request can be deleted - lock (freedContexts) - { - freedContexts.Add(routingContext); - } - } - - /// - /// Called either on the main or child node. This is the routing method for setting cache entries. - /// - public void SetCacheEntries - ( - int handleId, CacheEntry[] entries, - string cacheScope, string cacheKey, string cacheVersion, - CacheContentType cacheContentType, bool localNodeOnly - ) - { - TaskExecutionContext executionContext = GetTaskContextFromHandleId(handleId); - BuildPropertyGroup scopeProperties; - - if (cacheKey == null) - { - Project parentProject = executionContext.ParentProject; - scopeProperties = parentProject.GlobalProperties; - } - else - { - // Property values are compared using case sensitive comparisons because the case of property values do have meaning. - // In this case we are using properties in a manner where we do not want case sensitive comparisons. - // There is not enough benefit for this one special case to add case insensitive - // comparisons to build properties. We instead uppercase all of the keys for both get and set CachedEntries. - scopeProperties = new BuildPropertyGroup(); - scopeProperties.SetProperty("CacheKey", cacheKey.ToUpper(CultureInfo.InvariantCulture)); - } - - if (cacheScope == null) - { - cacheScope = executionContext.ParentProject.FullFileName; - } - - if (cacheVersion == null) - { - cacheVersion = executionContext.ParentProject.ToolsVersion; - } - - parentEngine.CacheManager.SetCacheEntries(entries, cacheScope, scopeProperties, cacheVersion, cacheContentType); - - // Also send these to the parent if we're allowed to - if (parentEngine.Router.ChildMode && !localNodeOnly) - { - Exception exception = parentEngine.Router.ParentNode.PostCacheEntriesToHost(entries, cacheScope, scopeProperties, cacheVersion, cacheContentType); - - // If we had problems on the parent node, rethrow the exception here - if (exception != null) - { - throw exception; - } - } - } - - /// - /// Called either on the main or child node. This is the routing method for getting cache entries. - /// - public CacheEntry[] GetCacheEntries - ( - int handleId, string[] names, - string cacheScope, string cacheKey, string cacheVersion, - CacheContentType cacheContentType, bool localNodeOnly - ) - { - TaskExecutionContext executionContext = GetTaskContextFromHandleId(handleId); - BuildPropertyGroup scopeProperties; - - if (cacheKey == null) - { - Project parentProject = executionContext.ParentProject; - scopeProperties = parentProject.GlobalProperties; - } - else - { - // Property values are compared using case sensitive comparisons because the case of property values do have meaning. - // In this case we are using properties in a manner where we do not want case sensitive comparisons. - // There is not enough benefit for this one special case to add case insensitive - // comparisons to build properties. We instead uppercase all of the keys for both get and set CachedEntries. - scopeProperties = new BuildPropertyGroup(); - scopeProperties.SetProperty("CacheKey", cacheKey.ToUpper(CultureInfo.InvariantCulture)); - } - - if (cacheScope == null) - { - cacheScope = executionContext.ParentProject.FullFileName; - } - - if (cacheVersion == null) - { - cacheVersion = executionContext.ParentProject.ToolsVersion; - } - - CacheEntry[] result = parentEngine.CacheManager.GetCacheEntries(names, cacheScope, scopeProperties, cacheVersion, cacheContentType); - - bool haveCompleteResult = (result.Length == names.Length); - - if (haveCompleteResult) - { - for (int i = 0; i < result.Length; i++) - { - if (result[i] == null) - { - haveCompleteResult = false; - break; - } - } - } - - // If we didn't have the complete result locally, check with the parent if allowed. - if (!haveCompleteResult && parentEngine.Router.ChildMode && !localNodeOnly) - { - result = parentEngine.Router.ParentNode.GetCachedEntriesFromHost(names, cacheScope, scopeProperties, cacheVersion, cacheContentType); - parentEngine.CacheManager.SetCacheEntries(result, cacheScope, scopeProperties, cacheVersion, cacheContentType); - } - - return result; - } - - /// - /// Submit the logging message to the engine queue. Note that we are currently not utilizing the - /// handleId, but plan to do so in the future to fill out the data structure passed to the engine - /// - public void PostLoggingMessagesToHost(int nodeId, NodeLoggingEvent[] nodeLoggingEventArray) - { - // We can safely assume that all messages need to be routed to the same engine because - // they originated from the same task. This is true as long as we don't allow multiple engines within - // a single process to utilize external nodes. - if (nodeLoggingEventArray.Length > 0) - { - parentEngine.LoggingServices.PostLoggingEvents(nodeLoggingEventArray); - } - } - - /// - /// Figure out the line and column number of the task XML node in the original - /// project context - /// - internal void GetLineColumnOfXmlNode(int handleId, out int lineNumber, out int columnNumber) - { - TaskExecutionContext executionContext = GetTaskContextFromHandleId(handleId); - XmlSearcher.GetLineColumnByNode(executionContext.TaskNode, out lineNumber, out columnNumber); - } - - /// - /// Gets the default engine task registry. If the TEM runs out-of proc with the engine we should send the task declarations for all the default tasks parsed out of the *.tasks XML instead. - /// - /// The default engine task registry. - internal ITaskRegistry GetEngineTaskRegistry(int handleId) - { - TaskExecutionContext executionContext = GetTaskContextFromHandleId(handleId); - return parentEngine.GetTaskRegistry(executionContext.BuildEventContext, - executionContext.ParentProject.ToolsVersion); - } - - /// - /// Gets the project task registry. If the TEM runs out-of proc with the engine we should send the task declarations for all the using tasks parsed out of project XML instead. - /// - /// The default engine task registry. - internal ITaskRegistry GetProjectTaskRegistry(int handleId) - { - TaskExecutionContext executionContext = GetTaskContextFromHandleId(handleId); - return executionContext.ParentProject.TaskRegistry; - } - - /// - /// Get the version of the toolset used by the project - /// - /// - /// - internal string GetToolsPath(int handleId) - { - TaskExecutionContext executionContext = GetTaskContextFromHandleId(handleId); - return parentEngine.ToolsetStateMap[executionContext.ParentProject.ToolsVersion].ToolsPath; - } - - /// - /// This method is called to post the status of the node - /// - public void PostStatus(int nodeId, NodeStatus nodeStatus, bool blockUntilSent) - { - parentEngine.PostNodeStatus(nodeId, nodeStatus); - } - - /// - /// This method is only used in by the inproc node - /// - internal Engine GetParentEngine() - { - return parentEngine; - } - - /// - /// This method converts a list handles to inprogress contexts into a list of target objects - /// - internal Target[] GetListOfTargets(int[] handleIds) - { - Target[] targets = new Target[handleIds.Length]; - - for (int i = 0; i < handleIds.Length; i++) - { - TaskExecutionContext executionContext = GetTaskContextFromHandleId(handleIds[i]); - if (executionContext != null) - { - targets[i] = executionContext.ParentTarget; - } - else - { - targets[i] = null; - } - } - - return targets; - } - - #endregion - - #region Methods for managing execution contexts - - /// - /// Given a handleId, this method returns the corresponding ExecutionContext. This - /// context contains only value type data and can be used from any domain. - /// - internal ExecutionContext GetExecutionContextFromHandleId(int handleId) - { - // We don't need to lock the hashtable because it is thread safe for multiple readers - return (ExecutionContext)executionContexts[handleId]; - } - - /// - /// Given a handleId, this method returns the corresponding RequestRoutingContext. This context - /// contains some data (such as parent projet or parent target) which should only be accessed from - /// within the engine domain. - /// - internal TaskExecutionContext GetTaskContextFromHandleId(int handleId) - { - // We don't need to lock the hashtable because it is thread safe for multiple readers - return (TaskExecutionContext)executionContexts[handleId]; - } - - /// - /// Given a handleId, this method returns the corresponding RequestRoutingContext. This - /// context contains only value type data and can be used from any domain - /// - internal RequestRoutingContext GetRoutingContextFromHandleId(int handleId) - { - // We don't need to lock the hashtable because it is thread safe for multiple readers - return (RequestRoutingContext)executionContexts[handleId]; - } - - /// - /// This method creates a new TaskExecutionContext and return a integer token that maps to it. - /// This method is not thread safe and must be called only from the engine thread. - /// - internal int CreateTaskContext - ( - Project parentProject, - Target parentTarget, - ProjectBuildState buildContext, - XmlElement taskNode, - int nodeIndex, - BuildEventContext taskContext - ) - { - int handleId = nextContextId; - nextContextId++; - - TaskExecutionContext executionContext = - new TaskExecutionContext(parentProject, parentTarget, taskNode, buildContext, handleId, nodeIndex, taskContext); - - executionContexts.Add(handleId, executionContext); - - return handleId; - } - - /// - /// This method creates a new routing context. This method is not thread safe and must be called - /// only from the engine thread. - /// - internal int CreateRoutingContext - ( - int nodeIndex, - int parentHandleId, - int parentNodeIndex, - int parentRequestId, - CacheScope cacheScope, - BuildRequest triggeringBuildRequest, - BuildEventContext buildEventContext - ) - { - int handleId = nextContextId; - nextContextId++; - - RequestRoutingContext executionContext = - new RequestRoutingContext(handleId, nodeIndex, parentHandleId, parentNodeIndex, parentRequestId, - cacheScope, triggeringBuildRequest, buildEventContext); - - executionContexts.Add(handleId, executionContext); - - return handleId; - } - - /// - /// This method maps the given handleId to null. The entry will be later removed by the engine thread. - /// - internal void ClearContextState(int handleId) - { - if (handleId != invalidEngineHandle) - { - ErrorUtilities.VerifyThrow(executionContexts.ContainsKey(handleId), "The table must contain this entry"); - executionContexts.Remove(handleId); - } - - // Check if there are freed contexts waiting to be deleted - if (freedContexts.Count > freeListThreshold) - { - lock (freedContexts) - { - foreach (ExecutionContext executionContext in freedContexts) - { - executionContexts.Remove(executionContext.HandleId); - } - freedContexts.Clear(); - } - } - } - - #endregion - - #region Constants - /// - /// Number assigned to an invalid engine handle, This handleId is used by Buildrequests - /// to show they are a routing context - /// - internal const int invalidEngineHandle = -1; - - /// - /// NodeId for an inproc node - /// - internal const int inProcNode = 0; - - /// - /// NodeId for the parent node - /// - internal const int parentNode = -1; - - /// - /// Invalid NodeId - /// - internal const int invalidNode = -2; - #endregion - - #region Data - /// - /// This hashtable contains the all the executionContexts for the current process - /// - private Hashtable executionContexts = new Hashtable(); - /// - /// List of contexts that should be removed from the hashtable by the engine thread - /// - private List freedContexts = new List(2 * freeListThreshold); - /// - /// The counter used to generate unique identifiers for each context - /// - private int nextContextId = 0; - /// - /// The pointer to the engine to which this callback class corresponds - /// - private Engine parentEngine; - /// - /// The count of objects on the free list which triggers a deletion - /// - private const int freeListThreshold = 10; - #endregion - - } -} diff --git a/src/Deprecated/Engine/Engine/EngineCommand.cs b/src/Deprecated/Engine/Engine/EngineCommand.cs deleted file mode 100644 index f07861b2d3d..00000000000 --- a/src/Deprecated/Engine/Engine/EngineCommand.cs +++ /dev/null @@ -1,139 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - #region Base Command Class - /// - /// Base class for classes which wrap operations that should be executed on the engine thread - /// - internal class EngineCommand - { - internal virtual void Execute(Engine parentEngine) - { - ErrorUtilities.VerifyThrow(false, "Should overwrite the execute method"); - } - } - #endregion - - #region RequestStatus - /// - /// Wrapper class for a node status request - /// - internal class RequestStatusEngineCommand : EngineCommand - { - internal RequestStatusEngineCommand(int requestId) - { - this.requestId = requestId; - } - - internal override void Execute(Engine parentEngine) - { - NodeStatus nodeStatus = parentEngine.RequestStatus(requestId); - ErrorUtilities.VerifyThrow(parentEngine.Router.ParentNode != null, - "Method should be called only on child nodes"); - parentEngine.Router.ParentNode.PostStatus(nodeStatus, false /* don't block waiting on the send */); - } - - #region Data - private int requestId; - #endregion - } - #endregion - - #region HostBuildRequestCompletion - /// - /// Wrapper class for a reporting completion of a host build request to the engine - /// - internal class HostBuildRequestCompletionEngineCommand : EngineCommand - { - internal HostBuildRequestCompletionEngineCommand() - { - } - - internal override void Execute(Engine parentEngine) - { - parentEngine.DecrementProjectsInProgress(); - } - - #region Data - #endregion - } - #endregion - - #region ReportException - /// - /// Wrapper class for a reporting completion of a host build request to the engine - /// - internal class ReportExceptionEngineCommand : EngineCommand - { - internal ReportExceptionEngineCommand(Exception e) - { - this.e = e; - } - - internal override void Execute(Engine parentEngine) - { - // Figure out if the exception occurred on a parent or child engine - // On the parent rethrow nicely and make sure the finallies run - // On the child try to communicate with the parent - if success, exit - // if failure rethrow and hope Watson will pick the exception up - string message = ResourceUtilities.FormatResourceString("RethrownEngineException"); - throw new Exception(message, e); - } - - #region Data - private Exception e; - #endregion - } - #endregion - - #region ChangeTraversalType - /// - /// Wrapper class for a changing the traversal approach used by the TEM - /// - internal class ChangeTraversalTypeCommand : EngineCommand - { - /// - /// Create a command that will switch the traversal of the system to breadthFirst traversal or depth first traveral. - /// changeLocalTraversalOnly is used to determine whether or not to change the traversal for the whole system or only the current node. - /// changeLocalTraversalOnly is set to true in the when a node is first started and in the updateNodeSettings method as these traversal changes are for the local node only. The reason - /// is because updateNodeSettings is called when the parent has told the node to switch traversal types, there is no need to forward the change to the engine again. - /// Also, when a node starts up it is set to breadth first traversal, this is the default so the parent engine need not be notified of this change. - /// - internal ChangeTraversalTypeCommand(bool breadthFirstTraversal, bool changeLocalTraversalOnly) - { - this.breadthFirstTraversal = breadthFirstTraversal; - this.changeLocalTraversalOnly = changeLocalTraversalOnly; - } - - internal override void Execute(Engine parentEngine) - { - parentEngine.NodeManager.TaskExecutionModule.UseBreadthFirstTraversal = breadthFirstTraversal; - if (!parentEngine.Router.ChildMode) - { - parentEngine.NodeManager.ChangeNodeTraversalType(breadthFirstTraversal); - } - else - { - if (!changeLocalTraversalOnly) - { - parentEngine.Router.ParentNode.PostStatus(new NodeStatus(breadthFirstTraversal), false /* don't block waiting on the send */); - } - } - } - - #region Data - private bool breadthFirstTraversal; - private bool changeLocalTraversalOnly; - #endregion - } - #endregion -} diff --git a/src/Deprecated/Engine/Engine/EngineLoggingServices.cs b/src/Deprecated/Engine/Engine/EngineLoggingServices.cs deleted file mode 100644 index 018b94a2ae6..00000000000 --- a/src/Deprecated/Engine/Engine/EngineLoggingServices.cs +++ /dev/null @@ -1,1022 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.IO; -using System.Collections; -using System.Threading; - -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This abstract class defines a logging service, provided by the engine, for internal logging - /// purposes. This class is very different from the IBuildEngine interface which provides logging - /// services for tasks. This class allows for better encapsulation by making it clear when only - /// logging services are needed and not the rest of the engine data and methods. This class allows - /// us to provide different implementations of logging services for engine components that are - /// either in-proc (engine process) or out-of-proc (node process). - /// - /// - /// We have made this an abstract class and not an interface to avoid forcing the "public" access - /// modifier on the implementation of the internal logging services. - /// - internal abstract class EngineLoggingServices - { - #region Initialization/Shutdown methods - - /// - /// Initializes the base class data. Sub-classes must call this method in their constructor. - /// - protected void Initialize(ManualResetEvent flushRequestEventIn) - { - this.loggingQueueOfBuildEvents = new DualQueue(); - this.loggingQueueOfNodeEvents = new DualQueue(); - this.lastFlushTime = DateTime.Now.Ticks; - this.flushRequestEvent = flushRequestEventIn; - this.requestedQueueFlush = false; - } - - /// - /// Causes all events to be discarded until EndEatingEvents() is called. - /// - internal void BeginEatingEvents() - { - paused = true; - } - - /// - /// Ensures events are no longer discarded if BeginEatingEvents() had been called. - /// - internal void EndEatingEvents() - { - paused = false; - } - - /// - /// Shutdown the logging service as appropriate - /// - internal virtual void Shutdown() - { - ErrorUtilities.VerifyThrow(false, "This method should be defined in a subclass"); - } - - #endregion - - #region Queue handling methods - - /// - /// Called to add a logging event to the posting queue. - /// - /// - internal void PostLoggingEvent(BuildEventArgs e) - { - ErrorUtilities.VerifyThrowArgumentNull(e, nameof(e)); - - if (paused) - { - // Throw out the event - return; - } - - if (flushBuildEventsImmediatly) - { - ProcessBuildEvent(e); - } - else - { - // queue the event - loggingQueueOfBuildEvents.Enqueue(e); - - if (!requestedQueueFlush && loggingQueueOfBuildEvents.WritingQueueCount > flushQueueSize) - { - requestedQueueFlush = true; - flushRequestEvent.Set(); - } - } - } - - /// - /// Called to add logging events to the posting queue. - /// - /// - internal void PostLoggingEvents(BuildEventArgs[] eventArray) - { - ErrorUtilities.VerifyThrowArgumentNull(eventArray, nameof(eventArray)); - - if (paused) - { - // Throw out the event - return; - } - - if (flushBuildEventsImmediatly) - { - for (int i = 0; i < eventArray.Length; i++) - { - ProcessBuildEvent(eventArray[i]); - } - } - else - { - loggingQueueOfBuildEvents.EnqueueArray(eventArray); - - if (!requestedQueueFlush && loggingQueueOfBuildEvents.WritingQueueCount > flushQueueSize) - { - requestedQueueFlush = true; - flushRequestEvent.Set(); - } - } - } - - /// - /// Called to add a logging event to the posting queue. - /// - /// - internal void PostLoggingEvent(NodeLoggingEvent e) - { - ErrorUtilities.VerifyThrowArgumentNull(e, nameof(e)); - - if (paused) - { - // Throw out the event - return; - } - - // queue the event - loggingQueueOfNodeEvents.Enqueue(e); - - if (!requestedQueueFlush && loggingQueueOfNodeEvents.WritingQueueCount > flushQueueSize) - { - requestedQueueFlush = true; - flushRequestEvent.Set(); - } - } - - /// - /// Called to add logging events to the posting queue. - /// - /// - internal void PostLoggingEvents(NodeLoggingEvent[] eventArray) - { - ErrorUtilities.VerifyThrowArgumentNull(eventArray, nameof(eventArray)); - - if (paused) - { - // Throw out the event - return; - } - - loggingQueueOfNodeEvents.EnqueueArray(eventArray); - - if (!requestedQueueFlush && loggingQueueOfNodeEvents.WritingQueueCount > flushQueueSize) - { - requestedQueueFlush = true; - flushRequestEvent.Set(); - } - } - - /// - /// Abstract method that must be implemented for either in-proc or out-of-proc logging. - /// This method is called to process the events batched up in the reading queue. In the - /// in-proc implementation, this will actually raise the events. In the out-of-proc - /// implementation, this will send the events from the node process to the engine. - /// - internal abstract bool ProcessPostedLoggingEvents(); - - /// - /// This method is to process a single build event, by default if this method is used - /// the event should be posted and processed - /// - /// - internal virtual void ProcessBuildEvent(BuildEventArgs buildEventArgs) - { - PostLoggingEvent(buildEventArgs); - ProcessPostedLoggingEvents(); - } - - /// - /// Return true if the queue needs to be flushed - /// - internal virtual bool NeedsFlush(long currentTickCount) - { - if (this.flushBuildEventsImmediatly) - { - return false; - } - - // Force a flush if there are many events accumulated - if (loggingQueueOfBuildEvents.Count > flushQueueSize || loggingQueueOfNodeEvents.Count > flushQueueSize) - { - return true; - } - // Only obtain current time if the timestamp is not passed in to avoid extra native calls - if (currentTickCount == 0) - { - currentTickCount = DateTime.Now.Ticks; - } - - return (currentTickCount - lastFlushTime) > flushTimeoutInTicks; - } - - #endregion - - #region Event based logging methods - /// - /// Raises ErrorEvent and AnyEvent at all registered loggers. - /// - /// t-jeffv, SumedhK - /// - internal void LogErrorEvent(BuildErrorEventArgs e) - { - // We are intentionally passing in null for the "sender" object, even when - // the event is coming from task. This is because we don't want to allow - // tight coupling between loggers and tasks in this way. It's not good - // for a logger to be able to call back into a task. It could be a security - // issue, and it apparently will also cause us problems if we adopt the - // new Longhorn Add-In Programming Model. - - ErrorUtilities.VerifyThrowArgumentNull(e, nameof(e)); - PostLoggingEvent(e); - } - - /// - /// Raises MessageEvent and AnyEvent at all registered loggers. - /// - /// t-jeffv, SumedhK - /// - internal void LogMessageEvent(BuildMessageEventArgs e) - { - if (!OnlyLogCriticalEvents) - { - // We are intentionally passing in null for the "sender" object, even when - // the event is coming from task. This is because we don't want to allow - // tight coupling between loggers and tasks in this way. It's not good - // for a logger to be able to call back into a task. It could be a security - // issue, and it apparently will also cause us problems if we adopt the - // new Longhorn Add-In Programming Model. - - ErrorUtilities.VerifyThrowArgumentNull(e, nameof(e)); - PostLoggingEvent(e); - } - } - - /// - /// Raises WarningEvent and AnyEvent at all registered loggers. - /// - /// t-jeffv, SumedhK - /// - internal void LogWarningEvent(BuildWarningEventArgs e) - { - // We are intentionally passing in null for the "sender" object, even when - // the event is coming from task. This is because we don't want to allow - // tight coupling between loggers and tasks in this way. It's not good - // for a logger to be able to call back into a task. It could be a security - // issue, and it apparently will also cause us problems if we adopt the - // new Longhorn Add-In Programming Model. - - ErrorUtilities.VerifyThrowArgumentNull(e, nameof(e)); - PostLoggingEvent(e); - } - - /// - /// Raises CustomEvent and AnyEvent at all registered loggers. - /// - /// t-jeffv, SumedhK - /// - internal void LogCustomEvent(CustomBuildEventArgs e) - { - // We are intentionally passing in null for the "sender" object, even when - // the event is coming from task. This is because we don't want to allow - // tight coupling between loggers and tasks in this way. It's not good - // for a logger to be able to call back into a task. It could be a security - // issue, and it apparently will also cause us problems if we adopt the - // new Longhorn Add-In Programming Model. - - ErrorUtilities.VerifyThrowArgumentNull(e, nameof(e)); - PostLoggingEvent(e); - } - #endregion - - #region Log comments - /************************************************************************************************************************** - * WARNING: Do not add overloads that allow raising events without specifying a file. In general ALL events should have a - * file associated with them. We've received a LOT of feedback from dogfooders about the lack of information in our - * events. If an event TRULY does not have an associated file, then String.Empty can be passed in for the file. However, - * that burden should lie on the caller -- these wrapper methods should NOT make it easy to skip the filename. - *************************************************************************************************************************/ - /// - /// Logs a low-priority comment with all registered loggers using the specified resource string. - /// - internal virtual void LogComment(BuildEventContext buildEventContext, string messageResourceName, params object[] messageArgs) - { - if (!OnlyLogCriticalEvents) - { - LogComment(buildEventContext, MessageImportance.Low, messageResourceName, messageArgs); - } - } - - /// - /// Logs a custom-priority comment with all registered loggers using the specified resource string. - /// - /// SumedhK - /// - /// - /// - internal virtual void LogComment(BuildEventContext buildEventContext, MessageImportance importance, string messageResourceName, params object[] messageArgs) - { - if (!OnlyLogCriticalEvents) - { - ErrorUtilities.VerifyThrow(messageResourceName != null, "Need resource string for comment message."); - - LogCommentFromText(buildEventContext, importance, ResourceUtilities.FormatResourceString(messageResourceName, messageArgs)); - } - } - - /// - /// Logs a custom-priority comment with all registered loggers using the given text. - /// - internal virtual void LogCommentFromText(BuildEventContext buildEventContext, MessageImportance importance, string message) - { - if (!OnlyLogCriticalEvents) - { - ErrorUtilities.VerifyThrow(message != null, - "Need comment message."); - - BuildMessageEventArgs e = new BuildMessageEventArgs - ( - message, - null, - "MSBuild", - importance - ); - e.BuildEventContext = buildEventContext; - PostLoggingEvent(e); - } - } - - #endregion - - #region Log errors - /************************************************************************************************************************** - * WARNING: Do not add overloads that allow raising events without specifying a file. In general ALL events should have a - * file associated with them. We've received a LOT of feedback from dogfooders about the lack of information in our - * events. If an event TRULY does not have an associated file, then String.Empty can be passed in for the file. However, - * that burden should lie on the caller -- these wrapper methods should NOT make it easy to skip the filename. - *************************************************************************************************************************/ - - /// - /// Logs an error with all registered loggers using the specified resource string. - /// - /// SumedhK - /// - /// - /// - internal virtual void LogError(BuildEventContext location, BuildEventFileInfo file, string messageResourceName, params object[] messageArgs) - { - LogError(location, null, file, messageResourceName, messageArgs); - } - - /// - /// Logs an error with all registered loggers using the specified resource string. - /// - /// SumedhK - /// Can be null. - /// - /// - /// - internal virtual void LogError(BuildEventContext buildEventContext, string subcategoryResourceName, BuildEventFileInfo file, string messageResourceName, params object[] messageArgs) - { - ErrorUtilities.VerifyThrow(messageResourceName != null, "Need resource string for error message."); - - string errorCode; - string helpKeyword; - string message = ResourceUtilities.FormatResourceString(out errorCode, out helpKeyword, messageResourceName, messageArgs); - - LogErrorFromText(buildEventContext, subcategoryResourceName, errorCode, helpKeyword, file, message); - } - - /// - /// Logs an error with all registered loggers using the given text. - /// - /// SumedhK - /// Can be null. - /// Can be null. - /// Can be null. - /// - /// - internal virtual void LogErrorFromText(BuildEventContext buildEventContext, string subcategoryResourceName, string errorCode, string helpKeyword, BuildEventFileInfo file, string message) - { - ErrorUtilities.VerifyThrow(file != null, "Must specify the associated file."); - ErrorUtilities.VerifyThrow(message != null, "Need error message."); - - string subcategory = null; - - if (subcategoryResourceName != null) - { - subcategory = AssemblyResources.GetString(subcategoryResourceName); - } - - BuildErrorEventArgs e = - new BuildErrorEventArgs - ( - subcategory, - errorCode, - file.File, - file.Line, - file.Column, - file.EndLine, - file.EndColumn, - message, - helpKeyword, - "MSBuild" - ); - e.BuildEventContext = buildEventContext; - PostLoggingEvent(e); - } - - /// - /// Logs an error regarding an invalid project file with all registered loggers. - /// - /// SumedhK - /// - internal virtual void LogInvalidProjectFileError(BuildEventContext buildEventContext, InvalidProjectFileException invalidProjectFileException) - { - ErrorUtilities.VerifyThrow(invalidProjectFileException != null, "Need exception context."); - - // Don't log the exception more than once. - if (!invalidProjectFileException.HasBeenLogged) - { - BuildErrorEventArgs e = - new BuildErrorEventArgs - ( - invalidProjectFileException.ErrorSubcategory, - invalidProjectFileException.ErrorCode, - invalidProjectFileException.ProjectFile, - invalidProjectFileException.LineNumber, - invalidProjectFileException.ColumnNumber, - invalidProjectFileException.EndLineNumber, - invalidProjectFileException.EndColumnNumber, - invalidProjectFileException.BaseMessage, - invalidProjectFileException.HelpKeyword, - "MSBuild" - ); - e.BuildEventContext = buildEventContext; - PostLoggingEvent(e); - - invalidProjectFileException.HasBeenLogged = true; - } - } - - /// - /// Logs an error regarding an unexpected build failure with all registered loggers. - /// This will include a stack dump. - /// - /// SumedhK - /// - /// - internal virtual void LogFatalBuildError(BuildEventContext buildEventContext, Exception exception, BuildEventFileInfo file) - { - LogFatalError(buildEventContext, exception, file, "FatalBuildError"); - } - - /// - /// Logs an error regarding an unexpected task failure with all registered loggers. - /// This will include a stack dump. - /// - /// SumedhK - /// - /// - /// - internal virtual void LogFatalTaskError(BuildEventContext buildEventContext, Exception exception, BuildEventFileInfo file, string taskName) - { - ErrorUtilities.VerifyThrow(taskName != null, "Must specify the name of the task that failed."); - - LogFatalError(buildEventContext, exception, file, "FatalTaskError", taskName); - } - - /// - /// Logs an error regarding an unexpected failure with all registered loggers using the specified resource string. - /// This will include a stack dump. - /// - /// SumedhK - /// - /// - /// - /// - internal virtual void LogFatalError(BuildEventContext buildEventContext, Exception exception, BuildEventFileInfo file, string messageResourceName, params object[] messageArgs) - { - ErrorUtilities.VerifyThrow(messageResourceName != null, "Need resource string for error message."); - - string errorCode; - string helpKeyword; - string message = ResourceUtilities.FormatResourceString(out errorCode, out helpKeyword, messageResourceName, messageArgs); -#if DEBUG - message += Environment.NewLine + "This is an unhandled exception -- PLEASE OPEN A BUG."; -#endif - if (exception != null) - { - message += Environment.NewLine + exception.ToString(); - } - - LogErrorFromText(buildEventContext, null, errorCode, helpKeyword, file, message); - } - - #endregion - - #region Log warnings - /************************************************************************************************************************** - * WARNING: Do not add overloads that allow raising events without specifying a file. In general ALL events should have a - * file associated with them. We've received a LOT of feedback from dogfooders about the lack of information in our - * events. If an event TRULY does not have an associated file, then String.Empty can be passed in for the file. However, - * that burden should lie on the caller -- these wrapper methods should NOT make it easy to skip the filename. - *************************************************************************************************************************/ - - /// - /// Logs an warning regarding an unexpected task failure with all registered loggers. - /// This will include a stack dump. - /// - /// RGoel - /// - /// - /// - internal virtual void LogTaskWarningFromException(BuildEventContext buildEventContext, Exception exception, BuildEventFileInfo file, string taskName) - { - ErrorUtilities.VerifyThrow(taskName != null, "Must specify the name of the task that failed."); - ErrorUtilities.VerifyThrow(file != null, "Must specify the associated file."); - - string warningCode; - string helpKeyword; - string message = ResourceUtilities.FormatResourceString(out warningCode, out helpKeyword, "FatalTaskError", taskName); -#if DEBUG - message += Environment.NewLine + "This is an unhandled exception -- PLEASE OPEN A BUG."; -#endif - - if (exception != null) - { - message += Environment.NewLine + exception.ToString(); - } - - LogWarningFromText(buildEventContext, null, warningCode, helpKeyword, file, message); - } - - /// - /// Logs a warning with all registered loggers using the specified resource string. - /// - /// SumedhK - /// - /// - /// - internal virtual void LogWarning(BuildEventContext buildEventContext, BuildEventFileInfo file, string messageResourceName, params object[] messageArgs) - { - LogWarning(buildEventContext, null, file, messageResourceName, messageArgs); - } - - /// - /// Logs a warning with all registered loggers using the specified resource string. - /// - /// SumedhK - /// Can be null. - /// - /// - /// - internal virtual void LogWarning(BuildEventContext buildEventContext, string subcategoryResourceName, BuildEventFileInfo file, string messageResourceName, params object[] messageArgs) - { - ErrorUtilities.VerifyThrow(messageResourceName != null, "Need resource string for warning message."); - - string warningCode; - string helpKeyword; - string message = ResourceUtilities.FormatResourceString(out warningCode, out helpKeyword, messageResourceName, messageArgs); - - LogWarningFromText(buildEventContext, subcategoryResourceName, warningCode, helpKeyword, file, message); - } - - /// - /// Logs a warning with all registered loggers using the given text. - /// - /// SumedhK - /// Can be null. - /// Can be null. - /// Can be null. - /// - /// - internal virtual void LogWarningFromText(BuildEventContext buildEventContext, string subcategoryResourceName, string warningCode, string helpKeyword, BuildEventFileInfo file, string message) - { - ErrorUtilities.VerifyThrow(file != null, "Must specify the associated file."); - ErrorUtilities.VerifyThrow(message != null, "Need warning message."); - - string subcategory = null; - - if (subcategoryResourceName != null) - { - subcategory = AssemblyResources.GetString(subcategoryResourceName); - } - - BuildWarningEventArgs e = new BuildWarningEventArgs - ( - subcategory, - warningCode, - file.File, - file.Line, - file.Column, - file.EndLine, - file.EndColumn, - message, - helpKeyword, - "MSBuild" - ); - e.BuildEventContext = buildEventContext; - PostLoggingEvent(e); - } - - #endregion - - #region Log status - /************************************************************************************************************************** - * WARNING: Do not add overloads that allow raising events without specifying a file. In general ALL events should have a - * file associated with them. We've received a LOT of feedback from dogfooders about the lack of information in our - * events. If an event TRULY does not have an associated file, then String.Empty can be passed in for the file. However, - * that burden should lie on the caller -- these wrapper methods should NOT make it easy to skip the filename. - *************************************************************************************************************************/ - - /// - /// Logs that the build has started with all loggers (only called on the main node) - /// - internal virtual void LogBuildStarted() - { - // If we're only logging critical events, don't risk causing all the resources to load by formatting - // a string that won't get emitted anyway. - string message = String.Empty; - if (!OnlyLogCriticalEvents) - { - message = ResourceUtilities.FormatResourceString("BuildStarted"); - } - - BuildStartedEventArgs e = new BuildStartedEventArgs(message, null /* no help keyword */); - PostLoggingEvent(e); - - // Wrap the event to be sent to central loggers - NodeLoggingEventWithLoggerId nodeEventToCentralLoggers = - new NodeLoggingEventWithLoggerId(e, EngineLoggingServicesInProc.ALL_PRIVATE_EVENTSOURCES); - PostLoggingEvent(nodeEventToCentralLoggers); - } - - /// - /// Logs that the build has finished with all loggers, except for forwarding loggers. - /// - internal virtual void LogBuildStarted(int loggerId) - { - // If we're only logging critical events, don't risk causing all the resources to load by formatting - // a string that won't get emitted anyway. - string message = String.Empty; - if (!OnlyLogCriticalEvents) - { - message = ResourceUtilities.FormatResourceString("BuildStarted"); - } - - BuildStartedEventArgs e = new BuildStartedEventArgs(message, null /* no help keyword */); - - // Wrap the BuildStarted event so it is only sent to the loggers to - // the specified logger id - NodeLoggingEventWithLoggerId nodeEvent = - new NodeLoggingEventWithLoggerId(e, loggerId); - PostLoggingEvent(nodeEvent); - } - - /// - /// Logs that the build has finished with all registered loggers. - /// - /// - internal virtual void LogBuildFinished(bool success) - { - // If we're only logging critical events, don't risk causing all the resources to load by formatting - // a string that won't get emitted anyway. - string message = String.Empty; - if (!OnlyLogCriticalEvents) - { - message = ResourceUtilities.FormatResourceString(success ? "BuildFinishedSuccess" : "BuildFinishedFailure"); - } - - BuildFinishedEventArgs e = new BuildFinishedEventArgs(message, null /* no help keyword */, success); - - PostLoggingEvent(e); - } - - /// - /// Logs that the build has finished to a particular logger Id - /// - internal virtual void LogBuildFinished(bool success, int loggerId) - { - // If we're only logging critical events, don't risk causing all the resources to load by formatting - // a string that won't get emitted anyway. - string message = String.Empty; - if (!OnlyLogCriticalEvents) - { - message = ResourceUtilities.FormatResourceString(success ? "BuildFinishedSuccess" : "BuildFinishedFailure"); - } - - BuildFinishedEventArgs e = new BuildFinishedEventArgs(message, null /* no help keyword */, success); - - // Wrap the BuildFinished event so it is only sent to the loggers to - // the specified logger id - NodeLoggingEventWithLoggerId nodeEvent = - new NodeLoggingEventWithLoggerId(e, loggerId); - PostLoggingEvent(nodeEvent); - } - - /// - /// Logs that a project build has started with all registered loggers. - /// - /// SumedhK - /// project file - /// target names - /// properties list - /// items list - internal virtual void LogProjectStarted(int projectId, BuildEventContext parentBuildEventContext, BuildEventContext projectBuildEventContext, string projectFile, string targetNames, IEnumerable properties, IEnumerable items) - { - if (!OnlyLogCriticalEvents) - { - ProjectStartedEventArgs e; - - if (!string.IsNullOrEmpty(targetNames)) - { - e = new ProjectStartedEventArgs - ( - projectId, - ResourceUtilities.FormatResourceString("ProjectStartedPrefixForTopLevelProjectWithTargetNames", Path.GetFileName(projectFile), targetNames), - null, // no help keyword - projectFile, - targetNames, - properties, - items, - parentBuildEventContext - ); - } - else - { - e = new ProjectStartedEventArgs - ( - projectId, - ResourceUtilities.FormatResourceString("ProjectStartedPrefixForTopLevelProjectWithDefaultTargets", Path.GetFileName(projectFile)), - null, // no help keyword - projectFile, - targetNames, - properties, - items, - parentBuildEventContext - ); - } - - e.BuildEventContext = projectBuildEventContext; - - PostLoggingEvent(e); - } - } - - /// - /// Logs that a project build has finished with all registered loggers. - /// - /// SumedhK - /// - /// - internal virtual void LogProjectFinished(BuildEventContext buildEventContext, string projectFile, bool success) - { - if (!OnlyLogCriticalEvents) - { - string message = ResourceUtilities.FormatResourceString(success ? "ProjectFinishedSuccess" : "ProjectFinishedFailure", Path.GetFileName(projectFile)); - - ProjectFinishedEventArgs e = new ProjectFinishedEventArgs - ( - message, - null, // no help keyword - projectFile, - success - ); - e.BuildEventContext = buildEventContext; - PostLoggingEvent(e); - } - } - - /// - /// Logs that a target build has started with all registered loggers. - /// - /// SumedhK - /// Name of target - /// Main project file - /// Project file actually containing the target - internal virtual void LogTargetStarted(BuildEventContext buildEventContext, string targetName, string projectFile, string projectFileOfTargetElement) - { - if (!OnlyLogCriticalEvents) - { - TargetStartedEventArgs e = new TargetStartedEventArgs - ( - ResourceUtilities.FormatResourceString("TargetStarted", targetName, Path.GetFileName(projectFile)), - null, // no help keyword - targetName, - projectFile, - projectFileOfTargetElement - ); - e.BuildEventContext = buildEventContext; - PostLoggingEvent(e); - } - } - - /// - /// Logs that a target build has finished with all registered loggers. - /// - /// SumedhK - /// - /// main project file - /// - /// project file actually containing the target - internal virtual void LogTargetFinished(BuildEventContext buildEventContext, string targetName, string projectFile, string projectFileOfTargetElement, bool success) - { - if (!OnlyLogCriticalEvents) - { - string message = ResourceUtilities.FormatResourceString(success ? "TargetFinishedSuccess" : "TargetFinishedFailure", targetName, Path.GetFileName(projectFile)); - - TargetFinishedEventArgs e = new TargetFinishedEventArgs - ( - message, - null, // no help keyword - targetName, - projectFile, - projectFileOfTargetElement, - success - ); - - e.BuildEventContext = buildEventContext; - PostLoggingEvent(e); - } - } - - /// - /// Logs that task execution has started with all registered loggers. - /// - /// SumedhK - /// - /// - /// project file actually containing the task - internal virtual void LogTaskStarted(BuildEventContext buildEventContext, string taskName, string projectFile, string projectFileOfTaskNode) - { - if (!OnlyLogCriticalEvents) - { - TaskStartedEventArgs e = new TaskStartedEventArgs - ( - ResourceUtilities.FormatResourceString("TaskStarted", taskName), - null, // no help keyword - projectFile, - projectFileOfTaskNode, - taskName - ); - e.BuildEventContext = buildEventContext; - PostLoggingEvent(e); - } - } - - /// - /// Logs that a task has finished executing with all registered loggers. - /// - /// SumedhK - /// - /// - /// - /// project file actually containing the task - internal virtual void LogTaskFinished(BuildEventContext buildEventContext, string taskName, string projectFile, string projectFileOfTaskNode, bool success) - { - if (!OnlyLogCriticalEvents) - { - string message = ResourceUtilities.FormatResourceString(success ? "TaskFinishedSuccess" : "TaskFinishedFailure", taskName); - - TaskFinishedEventArgs e = new TaskFinishedEventArgs - ( - message, - null, // no help keyword - projectFile, - projectFileOfTaskNode, - taskName, - success - ); - e.BuildEventContext = buildEventContext; - PostLoggingEvent(e); - } - } - - #endregion - - #region Properties - - /// - /// When true, only log critical events such as warnings and errors. - /// - internal bool OnlyLogCriticalEvents - { - get - { - return this.onlyLogCriticalEvents; - } - set - { - this.onlyLogCriticalEvents = value; - } - } - - /// - /// Chains another logging service to this service. All incoming local events will be forwarded to the - /// chained logging service. - /// - internal EngineLoggingServices ForwardingService - { - get - { - return this.forwardingService; - } - set - { - this.forwardingService = value; - } - } - - /// - /// When true, only log critical events such as warnings and errors. - /// - internal bool FlushBuildEventsImmediatly - { - get - { - return this.flushBuildEventsImmediatly; - } - set - { - this.flushBuildEventsImmediatly = value; - } - } - - #endregion - - #region Data - - /// - /// Use to optimize away status messages. When this is set to true, only "critical" - /// events like errors are logged. - /// - protected bool onlyLogCriticalEvents; - - /// - /// Whether the loggers are paused. If they are paused, we do not pass on any events. - /// - private bool paused; - - // In single proc we would like to flush the logging events right away rather than queueing them up - // we only want to flush build events because node events can only come in a multi proc build - protected bool flushBuildEventsImmediatly; - - /// - /// A dual queue which allows for one reader multiple writer access (used to receive events from - /// the engine and the TEM) - /// - protected DualQueue loggingQueueOfBuildEvents; - - /// - /// A dual queue which allows for one reader multiple writer access (used to receive events from - /// other nodes) - /// - protected DualQueue loggingQueueOfNodeEvents; - - /// - /// If there are multiple logging services hooked up to an engine, the events - /// are forwarding from the top service down. - /// - protected EngineLoggingServices forwardingService; - - /// - /// Last timestamp when the queue was flushed - /// - protected long lastFlushTime; - - /// - /// If the number of items in the queue goes up in a spike the logging service can request - /// a flush of the queue. To prevent multiple requests this flag is used to indicate that - /// flush request has already been posted - /// - protected bool requestedQueueFlush; - - /// - /// An event used to request a flush of the logging service. Typically triggered due to - /// a spike in logging activity. - /// - protected ManualResetEvent flushRequestEvent; - - internal const int flushTimeoutInMS = 500; // flush the queue at least every 1/2 second - internal const int flushTimeoutInTicks = 500 * 10000; // flush the queue at least every 1/2 second - internal const int flushQueueSize = 1000; // flush the queue every time 1000 events accumulate - - #endregion - } -} diff --git a/src/Deprecated/Engine/Engine/EngineLoggingServicesInProc.cs b/src/Deprecated/Engine/Engine/EngineLoggingServicesInProc.cs deleted file mode 100644 index 24f9abb42e4..00000000000 --- a/src/Deprecated/Engine/Engine/EngineLoggingServicesInProc.cs +++ /dev/null @@ -1,166 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections.Generic; -using System.Threading; - -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class implements the in-proc (engine process) logging services, provided by the engine for - /// internal logging purposes. - /// - internal class EngineLoggingServicesInProc : EngineLoggingServices - { - #region Constructors - - /// - /// Private default constructor -- do not allow instantation w/o parameters. - /// - private EngineLoggingServicesInProc() - { - // do nothing - } - - /// - /// Creates an instance of this class for the given engine event source. - /// - /// - /// - internal EngineLoggingServicesInProc(EventSource eventSource, bool onlyLogCriticalEvents, ManualResetEvent flushRequestEvent) - { - this.onlyLogCriticalEvents = onlyLogCriticalEvents; - this.engineEventSource = eventSource; - - // Allocate the table mapping logger ids to event sources - this.eventSources = new Dictionary(); - RegisterEventSource(CENTRAL_ENGINE_EVENTSOURCE, eventSource); - - base.Initialize(flushRequestEvent); - } - - #endregion - - #region Methods - - /// - /// This function logs out all the messages currently posted to the queue. The active queue is swapped - /// with the secondary queue to enable posting of messages while this function is running - /// - internal override bool ProcessPostedLoggingEvents() - { - bool processedEvents = false; - lastFlushTime = DateTime.Now.Ticks; - - // Process all the events posted with a logger Id - NodeLoggingEvent nodeLoggingEvent; - - // We may get a single event for multiple messages - while ((nodeLoggingEvent = loggingQueueOfNodeEvents.Dequeue()) != null) - { - int loggerId = nodeLoggingEvent.LoggerId; - if (loggerId != ALL_PRIVATE_EVENTSOURCES) - { - ErrorUtilities.VerifyThrow(eventSources.ContainsKey(loggerId), "Logger Id should be registered"); - ErrorUtilities.VerifyThrow(loggerId != LOCAL_FORWARDING_EVENTSOURCE, "Should not use FWD loggers"); - eventSources[loggerId].RaiseStronglyTypedEvent(nodeLoggingEvent.BuildEvent); - } - else - { - // Post event to all central loggers - foreach (KeyValuePair eventSource in eventSources) - { - if (eventSource.Key >= FIRST_AVAILABLE_LOGGERID) - { - eventSource.Value.RaiseStronglyTypedEvent(nodeLoggingEvent.BuildEvent); - } - } - } - processedEvents = true; - } - - // Process all the events in that have been already posted - BuildEventArgs buildEventArgs; - - // We may get a single event for multiple messages - while ((buildEventArgs = loggingQueueOfBuildEvents.Dequeue()) != null) - { - ProcessBuildEvent(buildEventArgs); - processedEvents = true; - } - - requestedQueueFlush = false; - return processedEvents; - } - - /// - /// This method process a single BuildEvent argument, it will raise the event to registered loggers and - /// check to see if the there are forwarding loggers who need to see the event also, if so the message will - /// be posted to another logger - /// - /// - internal override void ProcessBuildEvent(BuildEventArgs buildEventArgs) - { - engineEventSource.RaiseStronglyTypedEvent(buildEventArgs); - - // Check if there are local forwarding loggers that should see this event - if (eventSources.ContainsKey(LOCAL_FORWARDING_EVENTSOURCE)) - { - eventSources[LOCAL_FORWARDING_EVENTSOURCE].RaiseStronglyTypedEvent(buildEventArgs); - } - - // Check if it necessary to forward the event to another logging service - forwardingService?.PostLoggingEvent(buildEventArgs); - } - - internal void RegisterEventSource(int loggerId, EventSource eventSource) - { - ErrorUtilities.VerifyThrow(!eventSources.ContainsKey(loggerId), "Should not see duplicate logger ids"); - eventSources[loggerId] = eventSource; - } - - internal void UnregisterEventSource(int loggerId) - { - if (eventSources.ContainsKey(loggerId)) - { - eventSources[loggerId].UnregisterAllLoggers(); - eventSources.Remove(loggerId); - } - } - - /// - /// Shutdown the logging service as appropriate - /// - internal override void Shutdown() - { - foreach (EventSource eventSource in eventSources.Values) - { - eventSource.UnregisterAllLoggers(); - } - } - - #endregion - - #region Data - - // A table mapping logger ids to event sources - private Dictionary eventSources; - // cached pointer to the engines main event source (also available in eventSources[0]) - private readonly EventSource engineEventSource; - - internal const int CENTRAL_ENGINE_EVENTSOURCE = 0; - internal const int LOCAL_FORWARDING_EVENTSOURCE = 1; - internal const int ALL_PRIVATE_EVENTSOURCES = 2; - internal const int FIRST_AVAILABLE_LOGGERID = 3; - - #endregion - } -} diff --git a/src/Deprecated/Engine/Engine/EngineLoggingServicesOutProc.cs b/src/Deprecated/Engine/Engine/EngineLoggingServicesOutProc.cs deleted file mode 100644 index 61eb63a4541..00000000000 --- a/src/Deprecated/Engine/Engine/EngineLoggingServicesOutProc.cs +++ /dev/null @@ -1,164 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Threading; - -using Microsoft.Build.Framework; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class implements the out-of-proc (node process) logging services, provided by the engine - /// for internal logging purposes. - /// - internal class EngineLoggingServicesOutProc : EngineLoggingServices - { - #region Constructors - - /// - /// Private default constructor -- do not allow instantation w/o parameters. - /// - private EngineLoggingServicesOutProc() - { - // do nothing - } - - /// - /// Creates an instance of this class for the given engine event source. - /// - internal EngineLoggingServicesOutProc(Node parentNode, ManualResetEvent flushRequestEvent) - { - this.parentNode = parentNode; -#pragma warning disable 1717 - this.onlyLogCriticalEvents = onlyLogCriticalEvents; -#pragma warning restore 1717 - this.loggingQueueReadLock = new object(); - this.eventArray = new NodeLoggingEvent[eventArrayChunkSize]; - base.Initialize(flushRequestEvent); - } - #endregion - - #region Methods - - /// - /// The out of proc logging service is concerned with flushing the events out to the node provider - /// to be sent to the parent engine. Events which are not marked with a logger id end up being wrapped - /// in a NodeLoggingEvent which was a default loggerId of 0. All events posted as BuildEventArgs fall - /// into this category. Events with a loggerId need be posted as NodeLoggerEventWithLoggerId objects. - /// This function is thread safe and is called both from the engine thread and communication threads to - /// ensure that the events are delivered in coherent order. - /// - internal override bool ProcessPostedLoggingEvents() - { - lock (loggingQueueReadLock) - { - bool processedEvents = false; - - lastFlushTime = DateTime.Now.Ticks; - - // We use a local array to hold the items that will be dequeueed. We can't reuse the queues because - // we give up the control of the data structure once we pass it to the node provider and we also need to maintain - // order between buildEventArgs and nodeLoggingEvent. - current = 0; - - // Process all the events in that have been already posted - BuildEventArgs buildEventArgs = null; - - // Grab all the event args out of the queue - while ((buildEventArgs = loggingQueueOfBuildEvents.Dequeue()) != null) - { - AddToCurrentArray(new NodeLoggingEvent(buildEventArgs)); - processedEvents = true; - } - - // Grab all the forwarded events - NodeLoggingEvent nodeLoggingEvent = null; - while ((nodeLoggingEvent = loggingQueueOfNodeEvents.Dequeue()) != null) - { - AddToCurrentArray(nodeLoggingEvent); - processedEvents = true; - } - - // If there are event - post them to the parent - if (current != 0) - { - NodeLoggingEvent[] trimmedEventArray = new NodeLoggingEvent[current]; - Array.Copy(eventArray, trimmedEventArray, current); - parentNode.PostLoggingMessagesToHost(trimmedEventArray); - current = 0; - } - requestedQueueFlush = false; - - return processedEvents; - } - } - - /// - /// Adds an event to an array. If the array is full it is posted to the parent and a new array is created - /// - /// - private void AddToCurrentArray(NodeLoggingEvent e) - { - eventArray[current] = e; - current++; - - if (current == eventArrayChunkSize) - { - parentNode.PostLoggingMessagesToHost(eventArray); - eventArray = new NodeLoggingEvent[eventArrayChunkSize]; - current = 0; - } - } - - /// - /// Shutdown the logging service as appropriate - /// - internal override void Shutdown() - { - // Do nothing - } - - /// - /// Reports an exception thrown while sending logging event to the node - /// - internal void ReportLoggingFailure(Exception e) - { - parentNode.ReportUnhandledError(e); - } - - #endregion - - #region Data - /// - /// This mutex protects the queue from multiple readers, which may happen in the - /// out of proc implementation - /// - protected object loggingQueueReadLock; - - /// - /// If this engine is running in child mode the parent node is used to post logging messages - /// - private Node parentNode; - - /// - /// Current count of items in the array of events (access should be protected with loggingQueueReadLock) - /// - private int current; - - /// - /// Array of events to be send to the parent (access should be protected with loggingQueueReadLock) - /// - private NodeLoggingEvent[] eventArray; - - /// - /// The number of events in one array posted to the parent. - /// - private const int eventArrayChunkSize = 100; - #endregion - } -} diff --git a/src/Deprecated/Engine/Engine/EngineProxy.cs b/src/Deprecated/Engine/Engine/EngineProxy.cs deleted file mode 100644 index be9ddf33e89..00000000000 --- a/src/Deprecated/Engine/Engine/EngineProxy.cs +++ /dev/null @@ -1,686 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections; -using System.Collections.Generic; -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine.Shared; -using System.Runtime.Remoting.Lifetime; -using System.Runtime.Remoting; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class serves as a surrogate for the build engine. It limits access to the build engine by implementing only a subset - /// of all public methods on the Engine class. - /// - internal sealed class EngineProxy : MarshalByRefObject, IBuildEngine3 - { - #region Data - // The logging interface - private EngineLoggingServices loggingServices; - - // We've already computed and cached the line/column number of the task node in the project file. - private bool haveProjectFileLocation = false; - - // The line number of the task node in the calling project file. - private int lineNumber; - - // The column number of the task node in the calling project file. - private int columnNumber; - - /// - /// The full path to the project that's currently building. - /// - private string parentProjectFullFileName; - - /// - /// The project file that contains the XML for task. This may be an import file and not the primary - /// project file - /// - private string projectFileOfTaskNode; - - /// - /// The token identifing the context of this evaluation - /// - private int handleId; - - /// - /// Continue on error value per batch exposed via IBuildEngine - /// - private bool continueOnError; - - /// - /// The module within which this class has been created. Used for all callbacks to - /// engine. - /// - private TaskExecutionModule parentModule; - - /// - /// Event contextual information, this tells the loggers where the task events were fired from - /// - private BuildEventContext buildEventContext; - - /// - /// True if the task connected to this proxy is alive - /// - private bool activeProxy; - - /// - /// This reference type is used to block access to a single entry methods of the interface - /// - private object callbackMonitor; - - /// - /// A client sponsor is a class - /// which will respond to a lease renewal request and will - /// increase the lease time allowing the object to stay in memory - /// - private ClientSponsor sponsor; - - /// - /// Will hold cached copy of typeof(BuildErrorEventArgs) used by each call to LogError - /// - private static Type buildErrorEventArgsType = null; - - /// - /// Will hold cached copy of typeof(BuildErrorEventArgs) used by each call to LogError - /// - private static Type buildWarningEventArgsType = null; - - #endregion - - /// - /// Private default constructor disallows parameterless instantiation. - /// - private EngineProxy() - { - // do nothing - } - - /// - /// Create an instance of this class to represent the IBuildEngine2 interface to the task - /// including the event location where the log messages are raised - /// - /// Parent Task Execution Module - /// - /// the full path to the currently building project - /// the path to the actual file (project or targets) where the task invocation is located - /// - /// Event Context where events will be seen to be raised from. Task messages will get this as their event context - internal EngineProxy - ( - TaskExecutionModule parentModule, - int handleId, - string parentProjectFullFileName, - string projectFileOfTaskNode, - EngineLoggingServices loggingServices, - BuildEventContext buildEventContext - ) - { - ErrorUtilities.VerifyThrow(parentModule != null, "No parent module."); - ErrorUtilities.VerifyThrow(loggingServices != null, "No logging services."); - ErrorUtilities.VerifyThrow(projectFileOfTaskNode != null, "Need project file path string"); - - this.parentModule = parentModule; - this.handleId = handleId; - this.parentProjectFullFileName = parentProjectFullFileName; - this.projectFileOfTaskNode = projectFileOfTaskNode; - this.loggingServices = loggingServices; - this.buildEventContext = buildEventContext; - this.callbackMonitor = new object(); - - activeProxy = true; - } - - /// - /// Stub implementation -- forwards to engine being proxied. - /// - public void LogErrorEvent(BuildErrorEventArgs e) - { - ErrorUtilities.VerifyThrowArgumentNull(e, nameof(e)); - ErrorUtilities.VerifyThrowInvalidOperation(activeProxy, "AttemptingToLogFromInactiveTask"); - - if (parentModule.IsRunningMultipleNodes && !e.GetType().IsSerializable) - { - loggingServices.LogWarning(buildEventContext, new BuildEventFileInfo(string.Empty), "ExpectedEventToBeSerializable", e.GetType().Name); - return; - } - - string message = GetUpdatedMessage(e.File, e.Message, parentProjectFullFileName); - - if (ContinueOnError) - { - // Convert the error into a warning. We do this because the whole point of - // ContinueOnError is that a project author expects that the task might fail, - // but wants to ignore the failures. This implies that we shouldn't be logging - // errors either, because you should never have a successful build with errors. - BuildWarningEventArgs warningEvent = new BuildWarningEventArgs - (e.Subcategory, - e.Code, - e.File, - e.LineNumber, - e.ColumnNumber, - e.EndLineNumber, - e.EndColumnNumber, - message, // this is the new message from above - e.HelpKeyword, - e.SenderName); - - warningEvent.BuildEventContext = buildEventContext; - loggingServices.LogWarningEvent(warningEvent); - - // Log a message explaining why we converted the previous error into a warning. - loggingServices.LogComment(buildEventContext, MessageImportance.Normal, "ErrorConvertedIntoWarning"); - } - else - { - if (e.GetType().Equals(BuildErrorEventArgsType)) - { - // We'd like to add the project file to the subcategory, but since this property - // is read-only on the BuildErrorEventArgs type, this requires creating a new - // instance. However, if some task logged a custom error type, we don't want to - // impolitely (as we already do above on ContinueOnError) throw the custom type - // data away. - e = new BuildErrorEventArgs - ( - e.Subcategory, - e.Code, - e.File, - e.LineNumber, - e.ColumnNumber, - e.EndLineNumber, - e.EndColumnNumber, - message, // this is the new message from above - e.HelpKeyword, - e.SenderName - ); - } - - e.BuildEventContext = buildEventContext; - loggingServices.LogErrorEvent(e); - } - } - - /// - /// Stub implementation -- forwards to engine being proxied. - /// - public void LogWarningEvent(BuildWarningEventArgs e) - { - ErrorUtilities.VerifyThrowArgumentNull(e, nameof(e)); - ErrorUtilities.VerifyThrowInvalidOperation(activeProxy, "AttemptingToLogFromInactiveTask"); - - if (parentModule.IsRunningMultipleNodes && !e.GetType().IsSerializable) - { - loggingServices.LogWarning(buildEventContext, new BuildEventFileInfo(string.Empty), "ExpectedEventToBeSerializable", e.GetType().Name); - return; - } - - if (e.GetType().Equals(BuildWarningEventArgsType)) - { - // We'd like to add the project file to the message, but since this property - // is read-only on the BuildWarningEventArgs type, this requires creating a new - // instance. However, if some task logged a custom warning type, we don't want - // to impolitely throw the custom type data away. - - string message = GetUpdatedMessage(e.File, e.Message, parentProjectFullFileName); - - e = new BuildWarningEventArgs - ( - e.Subcategory, - e.Code, - e.File, - e.LineNumber, - e.ColumnNumber, - e.EndLineNumber, - e.EndColumnNumber, - message, // this is the new message from above - e.HelpKeyword, - e.SenderName - ); - } - - e.BuildEventContext = buildEventContext; - loggingServices.LogWarningEvent(e); - } - - /// - /// - /// - /// File field from the original BuildEventArgs - /// Message field from the original BuildEventArgs - /// Full file name of the parent (building) project. - /// - private static string GetUpdatedMessage(string file, string message, string parentProjectFullFileName) - { -#if BUILDING_DF_LKG - // In the dogfood LKG, add the project path to the end, because we need it to help diagnose builds. - - // Don't bother doing anything if we don't have a project path (e.g., we loaded from XML directly) - if (String.IsNullOrEmpty(parentProjectFullFileName)) - { - return message; - } - - // Don't bother adding the project file path if it's already in the file part - if (String.Equals(file, parentProjectFullFileName, StringComparison.OrdinalIgnoreCase)) - { - return message; - } - - string updatedMessage = String.IsNullOrEmpty(message) ? - String.Format(CultureInfo.InvariantCulture, "[{0}]", parentProjectFullFileName) : - String.Format(CultureInfo.InvariantCulture, "{0} [{1}]", message, parentProjectFullFileName); - - return updatedMessage; -#else - // In the regular product, don't modify the message. We want to do this properly, with a field on the event args, in a future version. - return message; -#endif - } - - /// - /// Stub implementation -- forwards to engine being proxied. - /// - public void LogMessageEvent(BuildMessageEventArgs e) - { - ErrorUtilities.VerifyThrowArgumentNull(e, nameof(e)); - ErrorUtilities.VerifyThrowInvalidOperation(activeProxy, "AttemptingToLogFromInactiveTask"); - - if (parentModule.IsRunningMultipleNodes && !e.GetType().IsSerializable) - { - loggingServices.LogWarning(buildEventContext, new BuildEventFileInfo(string.Empty), "ExpectedEventToBeSerializable", e.GetType().Name); - return; - } - e.BuildEventContext = buildEventContext; - loggingServices.LogMessageEvent(e); - } - - /// - /// Stub implementation -- forwards to engine being proxied. - /// - public void LogCustomEvent(CustomBuildEventArgs e) - { - ErrorUtilities.VerifyThrowArgumentNull(e, nameof(e)); - ErrorUtilities.VerifyThrowInvalidOperation(activeProxy, "AttemptingToLogFromInactiveTask"); - - if (parentModule.IsRunningMultipleNodes && !e.GetType().IsSerializable) - { - loggingServices.LogWarning(buildEventContext, new BuildEventFileInfo(string.Empty), "ExpectedEventToBeSerializable", e.GetType().Name); - return; - } - - e.BuildEventContext = buildEventContext; - loggingServices.LogCustomEvent(e); - } - - /// - /// Returns true if the ContinueOnError flag was set to true for this particular task - /// in the project file. - /// - public bool ContinueOnError - { - get - { - ErrorUtilities.VerifyThrowInvalidOperation(activeProxy, "AttemptingToLogFromInactiveTask"); - - return this.continueOnError; - } - } - - /// - /// Called by the task engine to update the value for each batch - /// - /// - internal void UpdateContinueOnError(bool shouldContinueOnError) - { - this.continueOnError = shouldContinueOnError; - } - - /// - /// Retrieves the line number of the task node withing the project file that called it. - /// - /// This method is expensive in terms of perf. Do not call it in mainline scenarios. - /// RGoel - public int LineNumberOfTaskNode - { - get - { - ErrorUtilities.VerifyThrowInvalidOperation(activeProxy, "AttemptingToLogFromInactiveTask"); - - ComputeProjectFileLocationOfTaskNode(); - return this.lineNumber; - } - } - - /// - /// Retrieves the line number of the task node withing the project file that called it. - /// - /// This method is expensive in terms of perf. Do not call it in mainline scenarios. - /// RGoel - public int ColumnNumberOfTaskNode - { - get - { - ErrorUtilities.VerifyThrowInvalidOperation(activeProxy, "AttemptingToLogFromInactiveTask"); - - ComputeProjectFileLocationOfTaskNode(); - return this.columnNumber; - } - } - - /// - /// Returns the full path to the project file that contained the call to this task. - /// - public string ProjectFileOfTaskNode - { - get - { - ErrorUtilities.VerifyThrowInvalidOperation(activeProxy, "AttemptingToLogFromInactiveTask"); - - return projectFileOfTaskNode; - } - } - - /// - /// Computes the line/column number of the task node in the project file (or .TARGETS file) - /// that called it. - /// - private void ComputeProjectFileLocationOfTaskNode() - { - if (!haveProjectFileLocation) - { - parentModule.GetLineColumnOfXmlNode(handleId, out this.lineNumber, out this.columnNumber); - haveProjectFileLocation = true; - } - } - - /// - /// Stub implementation -- forwards to engine being proxied. - /// - /// - /// - /// - /// - /// result of call to engine - public bool BuildProjectFile - ( - string projectFileName, - string[] targetNames, - IDictionary globalProperties, - IDictionary targetOutputs - ) - { - return BuildProjectFile(projectFileName, targetNames, globalProperties, targetOutputs, null); - } - - /// - /// Stub implementation -- forwards to engine being proxied. - /// - /// - /// - /// - /// - /// Tools Version to override on the project. May be null - /// result of call to engine - public bool BuildProjectFile - ( - string projectFileName, - string[] targetNames, - IDictionary globalProperties, - IDictionary targetOutputs, - string toolsVersion - ) - { - lock (callbackMonitor) - { - ErrorUtilities.VerifyThrowInvalidOperation(activeProxy, "AttemptingToLogFromInactiveTask"); - - // Wrap the project name into an array - string[] projectFileNames = new string[1]; - projectFileNames[0] = projectFileName; - string[] toolsVersions = new string[1]; - toolsVersions[0] = toolsVersion; - IDictionary[] targetOutputsPerProject = new IDictionary[1]; - targetOutputsPerProject[0] = targetOutputs; - IDictionary[] globalPropertiesPerProject = new IDictionary[1]; - globalPropertiesPerProject[0] = globalProperties; - return parentModule.BuildProjectFile(handleId, projectFileNames, targetNames, globalPropertiesPerProject, targetOutputsPerProject, - loggingServices, toolsVersions, false, false, buildEventContext); - } - } - - /// - /// Stub implementation -- forwards to engine being proxied. - /// - /// - /// - /// - /// - /// Tools Version to overrides per project. May contain null values - /// - /// result of call to engine - public bool BuildProjectFilesInParallel - ( - string[] projectFileNames, - string[] targetNames, - IDictionary[] globalProperties, - IDictionary[] targetOutputsPerProject, - string[] toolsVersions, - bool useResultsCache, - bool unloadProjectsOnCompletion - ) - { - lock (callbackMonitor) - { - return parentModule.BuildProjectFile(handleId, projectFileNames, targetNames, globalProperties, - targetOutputsPerProject, loggingServices, - toolsVersions, useResultsCache, unloadProjectsOnCompletion, buildEventContext); - } - } - - /// - /// Not implemented for the proxy - /// - public void Yield() - { - } - - /// - /// Not implemented for the proxy - /// - public void Reacquire() - { - } - - /// - /// Stub implementation -- forwards to engine being proxied. - /// - /// - /// 1) it is acceptable to pass null for both targetNames and targetOutputs - /// 2) if no targets are specified, the default targets are built - /// - /// - /// The project to build. - /// The targets in the project to build (can be null). - /// An array of hashtables of additional global properties to apply - /// to the child project (array entries can be null). - /// The key and value in the hashtable should both be strings. - /// A list of global properties which should be removed. - /// A tools version recognized by the Engine that will be used during this build (can be null). - /// Should the target outputs be returned in the BuildEngineResults - /// Returns a structure containing the success or failures of the build and the target outputs by project. - public BuildEngineResult BuildProjectFilesInParallel - ( - string[] projectFileNames, - string[] targetNames, - IDictionary[] globalProperties, - IList[] removeGlobalProperties, - string[] toolsVersions, - bool returnTargetOutputs - ) - { - lock (callbackMonitor) - { - ErrorUtilities.VerifyThrowInvalidOperation(activeProxy, "AttemptingToLogFromInactiveTask"); - - ErrorUtilities.VerifyThrowArgumentNull(projectFileNames, nameof(projectFileNames)); - ErrorUtilities.VerifyThrowArgumentNull(globalProperties, "globalPropertiesPerProject"); - - Dictionary[] targetOutputsPerProject = null; - - if (returnTargetOutputs) - { - targetOutputsPerProject = new Dictionary[projectFileNames.Length]; - for (int i = 0; i < targetOutputsPerProject.Length; i++) - { - targetOutputsPerProject[i] = new Dictionary(StringComparer.OrdinalIgnoreCase); - } - } - - bool result = parentModule.BuildProjectFile(handleId, projectFileNames, targetNames, globalProperties, - targetOutputsPerProject, loggingServices, - toolsVersions, false, false, buildEventContext); - - return new BuildEngineResult(result, new List>(targetOutputsPerProject)); - } - } - - /// - /// InitializeLifetimeService is called when the remote object is activated. - /// This method will determine how long the lifetime for the object will be. - /// - public override object InitializeLifetimeService() - { - // Each MarshalByRef object has a reference to the service which - // controls how long the remote object will stay around - ILease lease = (ILease)base.InitializeLifetimeService(); - - // Set how long a lease should be initially. Once a lease expires - // the remote object will be disconnected and it will be marked as being availiable - // for garbage collection - int initialLeaseTime = 1; - - string initialLeaseTimeFromEnvironment = Environment.GetEnvironmentVariable("MSBUILDENGINEPROXYINITIALLEASETIME"); - - if (!String.IsNullOrEmpty(initialLeaseTimeFromEnvironment)) - { - int leaseTimeFromEnvironment; - if (int.TryParse(initialLeaseTimeFromEnvironment, out leaseTimeFromEnvironment) && leaseTimeFromEnvironment > 0) - { - initialLeaseTime = leaseTimeFromEnvironment; - } - } - - lease.InitialLeaseTime = TimeSpan.FromMinutes(initialLeaseTime); - - // Make a new client sponsor. A client sponsor is a class - // which will respond to a lease renewal request and will - // increase the lease time allowing the object to stay in memory - sponsor = new ClientSponsor(); - - // When a new lease is requested lets make it last 1 minutes longer. - int leaseExtensionTime = 1; - - string leaseExtensionTimeFromEnvironment = Environment.GetEnvironmentVariable("MSBUILDENGINEPROXYLEASEEXTENSIONTIME"); - if (!String.IsNullOrEmpty(leaseExtensionTimeFromEnvironment)) - { - int leaseExtensionFromEnvironment; - if (int.TryParse(leaseExtensionTimeFromEnvironment, out leaseExtensionFromEnvironment) && leaseExtensionFromEnvironment > 0) - { - leaseExtensionTime = leaseExtensionFromEnvironment; - } - } - - sponsor.RenewalTime = TimeSpan.FromMinutes(leaseExtensionTime); - - // Register the sponsor which will increase lease timeouts when the lease expires - lease.Register(sponsor); - - return lease; - } - - /// - /// Indicates to the EngineProxy that it is no longer needed. - /// Called by TaskEngine when the task using the EngineProxy is done. - /// - internal void MarkAsInActive() - { - activeProxy = false; - - // Since the task has a pointer to this class it may store it in a static field. Null out - // internal data so the leak of this object doesn't lead to a major memory leak. - loggingServices = null; - parentModule = null; - buildEventContext = null; - - // Clear out the sponsor (who is responsible for keeping the EngineProxy remoting lease alive until the task is done) - // this will be null if the engineproxy was never sent accross an appdomain boundry. - if (sponsor != null) - { - ILease lease = (ILease)RemotingServices.GetLifetimeService(this); - lease?.Unregister(sponsor); - - sponsor.Close(); - sponsor = null; - } - } - - #region Properties - /// - /// Provide a way to change the BuildEventContext of the engine proxy. This is important in batching where each batch will need its own buildEventContext. - /// - internal BuildEventContext BuildEventContext - { - get { return buildEventContext; } - set { buildEventContext = value; } - } - - /// - /// This property allows a task to query whether or not the system is running in single process mode or multi process mode. - /// Single process mode is where the engine is initialized with the number of cpus = 1 and the engine is not a child engine. - /// The engine is in multi process mode when the engine is initialized with a number of cpus > 1 or the engine is a child engine. - /// - public bool IsRunningMultipleNodes - { - get { return parentModule.IsRunningMultipleNodes; } - } - - /// - /// Cached copy of typeof(BuildErrorEventArgs) used during each call to LogError - /// - private static Type BuildErrorEventArgsType - { - get - { - if (buildErrorEventArgsType == null) - { - buildErrorEventArgsType = typeof(BuildErrorEventArgs); - } - return buildErrorEventArgsType; - } - } - - /// - /// Cached copy of typeof(BuildWarningEventArgs) used during each call to LogWarning - /// - private static Type BuildWarningEventArgsType - { - get - { - if (buildWarningEventArgsType == null) - { - buildWarningEventArgsType = typeof(BuildWarningEventArgs); - } - return buildWarningEventArgsType; - } - } - - #endregion - } -} diff --git a/src/Deprecated/Engine/Engine/EventRedirector.cs b/src/Deprecated/Engine/Engine/EventRedirector.cs deleted file mode 100644 index 6b2ba26679f..00000000000 --- a/src/Deprecated/Engine/Engine/EventRedirector.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This is a small redirector that decorates the events that are forwarded by - /// a particular node logger with the id of the central logger and passes them to the engine - /// logging service - /// - internal class EventRedirector : IEventRedirector - { - #region Constructors - /// - /// Initalize this class with a central logger id identifying the central logger to which - /// these events should be forwarded and a logging service that will do the forwarding - /// - /// central logger id - /// engine logging service - internal EventRedirector(int loggerId, EngineLoggingServices loggingService) - { - this.loggerId = loggerId; - this.loggingService = loggingService; - } - #endregion - - #region Methods implementing ICentrolLogger - - /// - /// This method is called by the node loggers to forward the events to cenral logger - /// - void IEventRedirector.ForwardEvent(BuildEventArgs buildEvent) - { - // Don't allow forwarding loggers to forward build started - ErrorUtilities.VerifyThrowInvalidOperation(!(buildEvent is BuildStartedEventArgs), "DontForwardBuildStarted"); - // Don't allow forwarding loggers to forward build finished - ErrorUtilities.VerifyThrowInvalidOperation(!(buildEvent is BuildFinishedEventArgs), "DontForwardBuildFinished"); - // Mark the event with the logger id metadata and post it to the queue - NodeLoggingEventWithLoggerId loggingEvent = new NodeLoggingEventWithLoggerId(buildEvent, loggerId); - loggingService.PostLoggingEvent(loggingEvent); - } - - #endregion - - #region Data - // The Id of the central logger to which this event should be forwarded - private int loggerId; - // The engine logging service that will forward the event to the right central logger - private EngineLoggingServices loggingService; - #endregion - } -} diff --git a/src/Deprecated/Engine/Engine/EventSource.cs b/src/Deprecated/Engine/Engine/EventSource.cs deleted file mode 100644 index 7428ad2d1e5..00000000000 --- a/src/Deprecated/Engine/Engine/EventSource.cs +++ /dev/null @@ -1,666 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; - -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class raises events on behalf of the build engine to all registered loggers. - /// - /// SumedhK - internal sealed class EventSource : MarshalByRefObject, IEventSource - { - /// - /// Default constructor. - /// - /// SumedhK - internal EventSource() - { - // do nothing - } - - /// - /// Clears out all events. - /// - /// SumedhK - internal void UnregisterAllLoggers() - { - MessageRaised = null; - ErrorRaised = null; - WarningRaised = null; - BuildStarted = null; - BuildFinished = null; - ProjectStarted = null; - ProjectFinished = null; - TargetStarted = null; - TargetFinished = null; - TaskStarted = null; - TaskFinished = null; - CustomEventRaised = null; - StatusEventRaised = null; - AnyEventRaised = null; - } - - /// - /// Raises a message event to all registered loggers. - /// - /// SumedhK - /// - /// - internal void RaiseMessageEvent(object sender, BuildMessageEventArgs e) - { - if (MessageRaised != null) - { - try - { - MessageRaised(sender, e); - } - catch (LoggerException) - { - // if a logger has failed politely, abort immediately - // first unregister all loggers, since other loggers may receive remaining events in unexpected orderings - // if a fellow logger is throwing in an event handler. - this.UnregisterAllLoggers(); - throw; - } - catch (Exception exception) - { - // first unregister all loggers, since other loggers may receive remaining events in unexpected orderings - // if a fellow logger is throwing in an event handler. - this.UnregisterAllLoggers(); - InternalLoggerException.Throw(exception, e, "FatalErrorWhileLogging", false); - } - } - - RaiseAnyEvent(sender, e); - } - - /// - /// Raises an error event to all registered loggers. - /// - /// SumedhK - /// - /// - internal void RaiseErrorEvent(object sender, BuildErrorEventArgs e) - { - if (ErrorRaised != null) - { - try - { - ErrorRaised(sender, e); - } - catch (LoggerException) - { - // if a logger has failed politely, abort immediately - // first unregister all loggers, since other loggers may receive remaining events in unexpected orderings - // if a fellow logger is throwing in an event handler. - this.UnregisterAllLoggers(); - throw; - } - catch (Exception exception) - { - // first unregister all loggers, since other loggers may receive remaining events in unexpected orderings - // if a fellow logger is throwing in an event handler. - this.UnregisterAllLoggers(); - InternalLoggerException.Throw(exception, e, "FatalErrorWhileLogging", false); - } - } - - RaiseAnyEvent(sender, e); - } - - /// - /// Raises a warning event to all registered loggers. - /// - /// SumedhK - /// - /// - internal void RaiseWarningEvent(object sender, BuildWarningEventArgs e) - { - if (WarningRaised != null) - { - try - { - WarningRaised(sender, e); - } - catch (LoggerException) - { - // if a logger has failed politely, abort immediately - // first unregister all loggers, since other loggers may receive remaining events in unexpected orderings - // if a fellow logger is throwing in an event handler. - this.UnregisterAllLoggers(); - throw; - } - catch (Exception exception) - { - // first unregister all loggers, since other loggers may receive remaining events in unexpected orderings - // if a fellow logger is throwing in an event handler. - this.UnregisterAllLoggers(); - InternalLoggerException.Throw(exception, e, "FatalErrorWhileLogging", false); - } - } - - RaiseAnyEvent(sender, e); - } - - /// - /// Raises a "build started" event to all registered loggers. - /// - /// SumedhK - /// - /// - internal void RaiseBuildStartedEvent(object sender, BuildStartedEventArgs e) - { - if (BuildStarted != null) - { - try - { - BuildStarted(sender, e); - } - catch (LoggerException) - { - // if a logger has failed politely, abort immediately - // first unregister all loggers, since other loggers may receive remaining events in unexpected orderings - // if a fellow logger is throwing in an event handler. - this.UnregisterAllLoggers(); - throw; - } - catch (Exception exception) - { - // first unregister all loggers, since other loggers may receive remaining events in unexpected orderings - // if a fellow logger is throwing in an event handler. - this.UnregisterAllLoggers(); - InternalLoggerException.Throw(exception, e, "FatalErrorWhileLogging", false); - } - } - - RaiseStatusEvent(sender, e); - } - - /// - /// Raises a "build finished" event to all registered loggers. - /// - /// SumedhK - /// - /// - internal void RaiseBuildFinishedEvent(object sender, BuildFinishedEventArgs e) - { - if (BuildFinished != null) - { - try - { - BuildFinished(sender, e); - } - catch (LoggerException) - { - // if a logger has failed politely, abort immediately - // first unregister all loggers, since other loggers may receive remaining events in unexpected orderings - // if a fellow logger is throwing in an event handler. - this.UnregisterAllLoggers(); - throw; - } - catch (Exception exception) - { - // first unregister all loggers, since other loggers may receive remaining events in unexpected orderings - // if a fellow logger is throwing in an event handler. - this.UnregisterAllLoggers(); - InternalLoggerException.Throw(exception, e, "FatalErrorWhileLogging", false); - } - } - - RaiseStatusEvent(sender, e); - } - - /// - /// Raises a "project build started" event to all registered loggers. - /// - /// SumedhK - /// - /// - internal void RaiseProjectStartedEvent(object sender, ProjectStartedEventArgs e) - { - if (ProjectStarted != null) - { - try - { - ProjectStarted(sender, e); - } - catch (LoggerException) - { - // if a logger has failed politely, abort immediately - // first unregister all loggers, since other loggers may receive remaining events in unexpected orderings - // if a fellow logger is throwing in an event handler. - this.UnregisterAllLoggers(); - throw; - } - catch (Exception exception) - { - // first unregister all loggers, since other loggers may receive remaining events in unexpected orderings - // if a fellow logger is throwing in an event handler. - this.UnregisterAllLoggers(); - InternalLoggerException.Throw(exception, e, "FatalErrorWhileLogging", false); - } - } - - RaiseStatusEvent(sender, e); - } - - /// - /// Raises a "project build finished" event to all registered loggers. - /// - /// SumedhK - /// - /// - internal void RaiseProjectFinishedEvent(object sender, ProjectFinishedEventArgs e) - { - if (ProjectFinished != null) - { - try - { - ProjectFinished(sender, e); - } - catch (LoggerException) - { - // if a logger has failed politely, abort immediately - // first unregister all loggers, since other loggers may receive remaining events in unexpected orderings - // if a fellow logger is throwing in an event handler. - this.UnregisterAllLoggers(); - throw; - } - catch (Exception exception) - { - // first unregister all loggers, since other loggers may receive remaining events in unexpected orderings - // if a fellow logger is throwing in an event handler. - this.UnregisterAllLoggers(); - InternalLoggerException.Throw(exception, e, "FatalErrorWhileLogging", false); - } - } - - RaiseStatusEvent(sender, e); - } - - /// - /// Raises a "target build started" event to all registered loggers. - /// - /// SumedhK - /// - /// - internal void RaiseTargetStartedEvent(object sender, TargetStartedEventArgs e) - { - if (TargetStarted != null) - { - try - { - TargetStarted(sender, e); - } - catch (LoggerException) - { - // if a logger has failed politely, abort immediately - // first unregister all loggers, since other loggers may receive remaining events in unexpected orderings - // if a fellow logger is throwing in an event handler. - this.UnregisterAllLoggers(); - throw; - } - catch (Exception exception) - { - // first unregister all loggers, since other loggers may receive remaining events in unexpected orderings - // if a fellow logger is throwing in an event handler. - this.UnregisterAllLoggers(); - InternalLoggerException.Throw(exception, e, "FatalErrorWhileLogging", false); - } - } - - RaiseStatusEvent(sender, e); - } - - /// - /// Raises a "target build finished" event to all registered loggers. - /// - /// SumedhK - /// - /// - internal void RaiseTargetFinishedEvent(object sender, TargetFinishedEventArgs e) - { - if (TargetFinished != null) - { - try - { - TargetFinished(sender, e); - } - catch (LoggerException) - { - // if a logger has failed politely, abort immediately - // first unregister all loggers, since other loggers may receive remaining events in unexpected orderings - // if a fellow logger is throwing in an event handler. - this.UnregisterAllLoggers(); - throw; - } - catch (Exception exception) - { - // first unregister all loggers, since other loggers may receive remaining events in unexpected orderings - // if a fellow logger is throwing in an event handler. - this.UnregisterAllLoggers(); - InternalLoggerException.Throw(exception, e, "FatalErrorWhileLogging", false); - } - } - - RaiseStatusEvent(sender, e); - } - - /// - /// Raises a "task execution started" event to all registered loggers. - /// - /// SumedhK - /// - /// - internal void RaiseTaskStartedEvent(object sender, TaskStartedEventArgs e) - { - if (TaskStarted != null) - { - try - { - TaskStarted(sender, e); - } - catch (LoggerException) - { - // if a logger has failed politely, abort immediately - // first unregister all loggers, since other loggers may receive remaining events in unexpected orderings - // if a fellow logger is throwing in an event handler. - this.UnregisterAllLoggers(); - throw; - } - catch (Exception exception) - { - // first unregister all loggers, since other loggers may receive remaining events in unexpected orderings - // if a fellow logger is throwing in an event handler. - this.UnregisterAllLoggers(); - InternalLoggerException.Throw(exception, e, "FatalErrorWhileLogging", false); - } - } - - RaiseStatusEvent(sender, e); - } - - /// - /// Raises a "task finished executing" event to all registered loggers. - /// - /// SumedhK - /// - /// - internal void RaiseTaskFinishedEvent(object sender, TaskFinishedEventArgs e) - { - if (TaskFinished != null) - { - try - { - TaskFinished(sender, e); - } - catch (LoggerException) - { - // if a logger has failed politely, abort immediately - // first unregister all loggers, since other loggers may receive remaining events in unexpected orderings - // if a fellow logger is throwing in an event handler. - this.UnregisterAllLoggers(); - throw; - } - catch (Exception exception) - { - // first unregister all loggers, since other loggers may receive remaining events in unexpected orderings - // if a fellow logger is throwing in an event handler. - this.UnregisterAllLoggers(); - InternalLoggerException.Throw(exception, e, "FatalErrorWhileLogging", false); - } - } - - RaiseStatusEvent(sender, e); - } - - /// - /// Raises a custom event to all registered loggers. - /// - /// SumedhK - /// - /// - internal void RaiseCustomEvent(object sender, CustomBuildEventArgs e) - { - if (CustomEventRaised != null) - { - try - { - CustomEventRaised(sender, e); - } - catch (LoggerException) - { - // if a logger has failed politely, abort immediately - // first unregister all loggers, since other loggers may receive remaining events in unexpected orderings - // if a fellow logger is throwing in an event handler. - this.UnregisterAllLoggers(); - throw; - } - catch (Exception exception) - { - // first unregister all loggers, since other loggers may receive remaining events in unexpected orderings - // if a fellow logger is throwing in an event handler. - this.UnregisterAllLoggers(); - InternalLoggerException.Throw(exception, e, "FatalErrorWhileLogging", false); - } - } - - RaiseAnyEvent(sender, e); - } - - /// - /// Raises a catch-all build status event to all registered loggers. - /// - /// SumedhK - /// - /// - internal void RaiseStatusEvent(object sender, BuildStatusEventArgs e) - { - if (StatusEventRaised != null) - { - try - { - StatusEventRaised(sender, e); - } - catch (LoggerException) - { - // if a logger has failed politely, abort immediately - // first unregister all loggers, since other loggers may receive remaining events in unexpected orderings - // if a fellow logger is throwing in an event handler. - this.UnregisterAllLoggers(); - throw; - } - catch (Exception exception) - { - // first unregister all loggers, since other loggers may receive remaining events in unexpected orderings - // if a fellow logger is throwing in an event handler. - this.UnregisterAllLoggers(); - InternalLoggerException.Throw(exception, e, "FatalErrorWhileLogging", false); - } - } - - RaiseAnyEvent(sender, e); - } - - /// - /// Raises a catch-all build event to all registered loggers. - /// - /// SumedhK - /// - /// - internal void RaiseAnyEvent(object sender, BuildEventArgs e) - { - if (AnyEventRaised != null) - { - try - { - AnyEventRaised(sender, e); - } - catch (LoggerException) - { - // if a logger has failed politely, abort immediately - // first unregister all loggers, since other loggers may receive remaining events in unexpected orderings - // if a fellow logger is throwing in an event handler. - this.UnregisterAllLoggers(); - throw; - } - catch (Exception exception) - { - // first unregister all loggers, since other loggers may receive remaining events in unexpected orderings - // if a fellow logger is throwing in an event handler. - this.UnregisterAllLoggers(); - InternalLoggerException.Throw(exception, e, "FatalErrorWhileLogging", false); - } - } - } - - /// - /// Raises the given event to all registered loggers. - /// This method casts the events extracted from the queue to a more specific type. - /// - /// - internal void RaiseStronglyTypedEvent(BuildEventArgs e) - { - switch (e) - { - case BuildMessageEventArgs buildMessageEvent: - RaiseMessageEvent(null, buildMessageEvent); - break; - case TaskStartedEventArgs taskStartedEvent: - RaiseTaskStartedEvent(null, taskStartedEvent); - break; - case TaskFinishedEventArgs taskFinishedEvent: - RaiseTaskFinishedEvent(null, taskFinishedEvent); - break; - case TargetStartedEventArgs targetStartedEvent: - RaiseTargetStartedEvent(null, targetStartedEvent); - break; - case TargetFinishedEventArgs targetFinishedEvent: - RaiseTargetFinishedEvent(null, targetFinishedEvent); - break; - case ProjectStartedEventArgs projectStartedEvent: - RaiseProjectStartedEvent(null, projectStartedEvent); - break; - case ProjectFinishedEventArgs projectFinishedEvent: - RaiseProjectFinishedEvent(null, projectFinishedEvent); - break; - case BuildStartedEventArgs buildStartedEvent: - RaiseBuildStartedEvent(null, buildStartedEvent); - break; - case BuildFinishedEventArgs buildFinishedEvent: - RaiseBuildFinishedEvent(null, buildFinishedEvent); - break; - case CustomBuildEventArgs customBuildEvent: - RaiseCustomEvent(null, customBuildEvent); - break; - case BuildStatusEventArgs buildStatusEvent: - RaiseStatusEvent(null, buildStatusEvent); - break; - case BuildWarningEventArgs buildWarningEvent: - RaiseWarningEvent(null, buildWarningEvent); - break; - case BuildErrorEventArgs buildErrorEvent: - RaiseErrorEvent(null, buildErrorEvent); - break; - default: - ErrorUtilities.VerifyThrow(false, "Unknown event args type."); - break; - } - } - - /// - /// This event is raised to log a message. - /// - /// t-jeffv, sumedhk - public event BuildMessageEventHandler MessageRaised; - - /// - /// This event is raised to log an error. - /// - /// t-jeffv, sumedhk - public event BuildErrorEventHandler ErrorRaised; - - /// - /// This event is raised to log a warning. - /// - /// t-jeffv, sumedhk - public event BuildWarningEventHandler WarningRaised; - - /// - /// this event is raised to log the start of a build - /// - /// t-jeffv, sumedhk - public event BuildStartedEventHandler BuildStarted; - - /// - /// this event is raised to log the end of a build - /// - /// t-jeffv, sumedhk - public event BuildFinishedEventHandler BuildFinished; - - /// - /// this event is raised to log the start of a project build - /// - /// t-jeffv, sumedhk - public event ProjectStartedEventHandler ProjectStarted; - - /// - /// this event is raised to log the end of a project build - /// - /// t-jeffv, sumedhk - public event ProjectFinishedEventHandler ProjectFinished; - - /// - /// this event is raised to log the start of a target build - /// - /// t-jeffv, sumedhk - public event TargetStartedEventHandler TargetStarted; - - /// - /// this event is raised to log the end of a target build - /// - /// t-jeffv, sumedhk - public event TargetFinishedEventHandler TargetFinished; - - /// - /// this event is raised to log the start of task execution - /// - /// t-jeffv, sumedhk - public event TaskStartedEventHandler TaskStarted; - - /// - /// this event is raised to log the end of task execution - /// - /// t-jeffv, sumedhk - public event TaskFinishedEventHandler TaskFinished; - - /// - /// this event is raised to log a custom event - /// - /// t-jeffv, sumedhk - public event CustomBuildEventHandler CustomEventRaised; - - /// - /// this event is raised to log build status events, such as - /// build/project/target/task started/stopped - /// - /// t-jeffv, sumedhk - public event BuildStatusEventHandler StatusEventRaised; - - /// - /// This event is raised to log that some event has - /// occurred. It is raised on every event. - /// - /// t-jeffv, sumedhk - public event AnyEventHandler AnyEventRaised; - } -} diff --git a/src/Deprecated/Engine/Engine/ExecutionContext.cs b/src/Deprecated/Engine/Engine/ExecutionContext.cs deleted file mode 100644 index 026de371572..00000000000 --- a/src/Deprecated/Engine/Engine/ExecutionContext.cs +++ /dev/null @@ -1,76 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using Microsoft.Build.Framework; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// Base class for data container shared between the Engine data domain and the TaskExecutionModule (TEM) - /// data domain - /// - internal class ExecutionContext - { - #region Constructors - /// - /// Default constructor - /// - internal ExecutionContext(int handleId, int nodeIndex, BuildEventContext buildEventContext) - { - this.handleId = handleId; - this.nodeIndex = nodeIndex; - this.buildEventContext = buildEventContext; - } - #endregion - - #region Properties - - /// - /// The token id corresponding to this context - /// - internal int HandleId - { - get - { - return this.handleId; - } - } - - /// - /// The node on which this context is being executed - /// - internal int NodeIndex - { - get - { - return this.nodeIndex; - } - } - - /// - /// The logging context - /// - internal BuildEventContext BuildEventContext - { - get - { - return this.buildEventContext; - } - } - - #endregion - - #region Data - // The handle for the context - private int handleId; - // The node of execution - private int nodeIndex; - // The logging context - private BuildEventContext buildEventContext; - #endregion - } -} diff --git a/src/Deprecated/Engine/Engine/Expander.cs b/src/Deprecated/Engine/Engine/Expander.cs deleted file mode 100644 index bb29943dc58..00000000000 --- a/src/Deprecated/Engine/Engine/Expander.cs +++ /dev/null @@ -1,2116 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Xml; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Text.RegularExpressions; - -using Microsoft.Build.BuildEngine.Shared; -using Microsoft.Win32; -using System.IO; -using System.Security; -using System.Globalization; -using System.Reflection; - -namespace Microsoft.Build.BuildEngine -{ - internal class Expander - { - /// - /// Debugging aid and emergency exit for customers. - /// Allows any functions to be used not just the safe list. - /// - private static bool enableAllPropertyFunctions = (Environment.GetEnvironmentVariable("MSBUILDENABLEALLPROPERTYFUNCTIONS") == "1"); - - // Items and properties to refer to - private ReadOnlyLookup lookup; - - // If we're only initialized with properties, store them directly - // instead of using the overhead of a lookup - private BuildPropertyGroup properties; - - // Table of metadata values. - // May have some qualified keys (type.name) or all unqualified. - // If all unqualified, the implicitMetadataItemType field indicates the type. - private Dictionary itemMetadata; - private string implicitMetadataItemType; - - // An optional item definition library to refer to when expanding metadata in expressions - private SpecificItemDefinitionLibrary specificItemDefinitionLibrary; - - private ExpanderOptions options; - - /// - /// Accessor for the item metadata used for metadata expansion (not counting metadata - /// referenced inside a transform). - /// - internal Dictionary ItemMetadata - { - get { return itemMetadata; } - } - - #region Constructors - - /// - /// Special cased constructor. Where we are only going to expand properties, - /// it's a waste of memory to use a lookup. Just use the property group. - /// PERF: This improves the EvaluateAllPropertyGroups codepath. - /// - internal Expander(BuildPropertyGroup properties) - { - this.options = ExpanderOptions.ExpandProperties; - this.properties = properties; - } - - /// - /// Special cased constructor. Where we are only going to expand properties and metadata, - /// it's a waste of memory to use a lookup. Just use the property group. - /// PERF: This improves the EvaluateAllItemDefinitions codepath. - /// - internal Expander(BuildPropertyGroup properties, string implicitMetadataItemType, Dictionary unqualifiedItemMetadata) - { - this.options = ExpanderOptions.ExpandPropertiesAndMetadata; - this.properties = properties; - this.itemMetadata = unqualifiedItemMetadata; - this.implicitMetadataItemType = implicitMetadataItemType; - } - - // Used in many places - internal Expander(BuildPropertyGroup properties, Hashtable items) - : this(new ReadOnlyLookup(items, properties), null, ExpanderOptions.ExpandPropertiesAndItems) - { - } - - // Used by BuildItemGroup.Evaluate - internal Expander(BuildPropertyGroup properties, Hashtable items, ExpanderOptions options) - : this(new ReadOnlyLookup(items, properties), null, options) - { - } - - // Used by ItemBucket - internal Expander(ReadOnlyLookup lookup, Dictionary itemMetadata) - : this(lookup, itemMetadata, ExpanderOptions.ExpandAll) - { - } - - // Used by IntrinsicTask - internal Expander(ReadOnlyLookup lookup) - : this(lookup, null, ExpanderOptions.ExpandPropertiesAndItems) - { - } - - // Used by unit tests - internal Expander(ReadOnlyLookup lookup, Dictionary itemMetadata, ExpanderOptions options) - { - ErrorUtilities.VerifyThrow(options != ExpanderOptions.Invalid, "Must specify options"); - - this.lookup = lookup; - this.itemMetadata = itemMetadata; - this.options = options; - } - - /// - /// Create an expander from another expander, but with different - /// options - /// - internal Expander(Expander expander, ExpanderOptions options) - : this(expander.lookup, expander.itemMetadata, options) - { - } - - internal Expander(Expander expander, SpecificItemDefinitionLibrary itemDefinitionLibrary) - : this(expander.lookup, null, expander.options) - { - if (implicitMetadataItemType == null) - { - this.itemMetadata = expander.itemMetadata; - } - this.specificItemDefinitionLibrary = itemDefinitionLibrary; - } - - #endregion - - /// - /// Adds metadata to the table being used by this expander. - /// This is useful when expanding metadata definitions that may refer to other values defined - /// immediately above: as each value is expanded, it is added to the table in the expander. - /// - internal void SetMetadataInMetadataTable(string itemType, string name, string value) - { - ErrorUtilities.VerifyThrow((options & ExpanderOptions.ExpandMetadata) != 0, "Must be expanding metadata"); - ErrorUtilities.VerifyThrow(implicitMetadataItemType == null || String.Equals(implicitMetadataItemType, itemType, StringComparison.OrdinalIgnoreCase), "Unexpected metadata type"); - - if (itemMetadata == null) - { - itemMetadata = new Dictionary(StringComparer.OrdinalIgnoreCase); - implicitMetadataItemType = itemType; - } - - if (String.Equals(implicitMetadataItemType, itemType, StringComparison.OrdinalIgnoreCase)) - { - itemMetadata[name] = value; - } - else - { - itemMetadata[itemType + "." + name] = value; - } - } - - /// - /// Expands item metadata, properties, and items (in that order), and produces a list of TaskItems. - /// - /// - /// - /// - internal List ExpandAllIntoBuildItems - ( - string expression, - XmlAttribute expressionAttribute - ) - { - // We don't know how many items we're going to end up with, but we'll - // keep adding them to this arraylist as we find them. - List buildItems = new List(); - - string evaluatedParameterValue = this.ExpandPropertiesLeaveEscaped(this.ExpandMetadataLeaveEscaped(expression), expressionAttribute); - - if (evaluatedParameterValue.Length > 0) - { - // Take the string that is being passed into the task parameter in the - // project XML file, and split it up by semicolons. Loop through each - // piece individually. - List userSpecifiedItemExpressions = ExpressionShredder.SplitSemiColonSeparatedList(evaluatedParameterValue); - foreach (string userSpecifiedItemExpression in userSpecifiedItemExpressions) - { - BuildItemGroup itemsToAdd = this.ExpandSingleItemListExpressionIntoItemsLeaveEscaped(userSpecifiedItemExpression, expressionAttribute); - if (itemsToAdd != null) - { - foreach (BuildItem itemToAdd in itemsToAdd) - { - buildItems.Add(itemToAdd); - } - } - else - { - // The expression is not of the form @(itemName). Therefore, just - // treat it as a string, and create a new TaskItem from that string. - buildItems.Add(new BuildItem(null, userSpecifiedItemExpression)); - } - } - } - - return buildItems; - } - - /// - /// Expands item metadata, properties, and items (in that order), and produces a list of TaskItems. - /// - /// All data accessed through the TaskItem (ItemSpec and metadata) is going to be unescaped, so it's nice - /// and ready for a task to consume. - /// - /// - /// - /// - /// RGoel - internal List ExpandAllIntoTaskItems - ( - string expression, - XmlAttribute expressionAttribute - ) - { - List buildItems = ExpandAllIntoBuildItems(expression, expressionAttribute); - - List taskItems = new List(buildItems.Count); - for (int i = 0; i < buildItems.Count; i++) - { - if (!buildItems[i].IsUninitializedItem) - { - taskItems.Add(new TaskItem(buildItems[i])); - } - else - { - taskItems.Add(new TaskItem(buildItems[i].FinalItemSpecEscaped)); - } - } - - return taskItems; - } - - /// - /// An overload of ExpandAllIntoString that conveniently only takes in an XmlAttribute whose - /// value we should expand. - /// - /// - /// - /// RGoel - internal string ExpandAllIntoString - ( - XmlAttribute expressionAttribute - ) - { - return this.ExpandAllIntoString(expressionAttribute.Value, expressionAttribute); - } - - /// - /// Expands embedded item metadata, properties, and embedded item lists (in that order) - /// within an expression. - /// - /// - /// The XML attribute containing the string we're trying to expand here. Solely - /// for the purposes of providing line/column number information when there's an error. - /// fully expanded string - /// RGoel - internal string ExpandAllIntoString - ( - string expression, - XmlNode expressionNode - ) - { - return EscapingUtilities.UnescapeAll(this.ExpandAllIntoStringLeaveEscaped(expression, expressionNode)); - } - - /// - /// An overload of ExpandAllIntoString that conveniently only takes in an XmlAttribute whose - /// value we should expand. - /// - /// - /// - /// RGoel - internal string ExpandAllIntoStringLeaveEscaped - ( - XmlAttribute expressionAttribute - ) - { - return this.ExpandAllIntoStringLeaveEscaped(expressionAttribute.Value, expressionAttribute); - } - - /// - /// Expands embedded item metadata, properties, and embedded item lists (in that order) - /// within an expression. - /// - /// - /// The XML attribute containing the string we're trying to expand here. Solely - /// for the purposes of providing line/column number information when there's an error. - /// fully expanded string - /// RGoel - internal string ExpandAllIntoStringLeaveEscaped - ( - string expression, - XmlNode expressionNode - ) - { - ErrorUtilities.VerifyThrow(expression != null, "Must pass in non-null expression."); - if (expression.Length == 0) - { - return expression; - } - - return this.ExpandItemsIntoStringLeaveEscaped(this.ExpandPropertiesLeaveEscaped(this.ExpandMetadataLeaveEscaped(expression), expressionNode), expressionNode); - } - - /// - /// Expands metadata, properties, and items (in that order) into a list of strings. - /// - /// - /// The XML attribute containing the string we're trying to expand here. Solely - /// for the purposes of providing line/column number information when there's an error. - /// - /// RGoel - internal List ExpandAllIntoStringList - ( - string expression, - XmlNode expressionNode - ) - { - List stringList = ExpressionShredder.SplitSemiColonSeparatedList(ExpandAllIntoStringLeaveEscaped(expression, expressionNode)); - - for (int i = 0; i < stringList.Count; i++) - { - stringList[i] = EscapingUtilities.UnescapeAll(stringList[i]); - } - - return stringList; - } - - /// - /// Expands metadata, properties, and items (in that order) into a list of strings. - /// - /// - /// - /// RGoel - internal List ExpandAllIntoStringList - ( - XmlAttribute expressionAttribute - ) - { - return this.ExpandAllIntoStringList(expressionAttribute.Value, expressionAttribute); - } - - /// - /// Expands metadata, properties, and items (in that order) into a list of strings. - /// - /// - /// The XML attribute containing the string we're trying to expand here. Solely - /// for the purposes of providing line/column number information when there's an error. - /// - /// RGoel - internal List ExpandAllIntoStringListLeaveEscaped - ( - string expression, - XmlNode expressionNode - ) - { - return ExpressionShredder.SplitSemiColonSeparatedList(ExpandAllIntoStringLeaveEscaped(expression, expressionNode)); - } - - /// - /// Expands metadata, properties, and items (in that order) into a list of strings. - /// - /// - /// - /// RGoel - internal List ExpandAllIntoStringListLeaveEscaped - ( - XmlAttribute expressionAttribute - ) - { - return ExpandAllIntoStringListLeaveEscaped(expressionAttribute.Value, expressionAttribute); - } - - /// - /// This method takes a string which may contain any number of - /// "$(propertyname)" tags in it. It replaces all those tags with - /// the actual property values, and returns a new string. For example, - /// - /// string processedString = - /// propertyBag.ExpandProperties("Value of NoLogo is $(NoLogo)."); - /// - /// This code might produce: - /// - /// processedString = "Value of NoLogo is true." - /// - /// If the sourceString contains an embedded property which doesn't - /// have a value, then we replace that tag with an empty string. - /// - /// This method leaves the expression escaped. Callers may need to unescape on their own as appropriate. - /// This method leaves the result escaped. Callers may need to unescape on their own as appropriate. - /// - internal string ExpandPropertiesLeaveEscaped - ( - string sourceString, - XmlNode sourceNode - ) - { - return ConvertToString(ExpandPropertiesLeaveTypedAndEscaped(sourceString, sourceNode)); - } - - /// - /// This method takes a string which may contain any number of - /// "$(propertyname)" tags in it. It replaces all those tags with - /// the actual property values, and returns a new string. For example, - /// - /// string processedString = - /// propertyBag.ExpandProperties("Value of NoLogo is $(NoLogo)."); - /// - /// This code might produce: - /// - /// processedString = "Value of NoLogo is true." - /// - /// If the sourceString contains an embedded property which doesn't - /// have a value, then we replace that tag with an empty string. - /// - /// This method leaves the expression escaped. Callers may need to unescape on their own as appropriate. - /// - /// - /// - /// RGoel, JomoF - private object ExpandPropertiesLeaveTypedAndEscaped - ( - string expression, - XmlNode expressionNode - ) - { - if (((options & ExpanderOptions.ExpandProperties) != ExpanderOptions.ExpandProperties) || String.IsNullOrEmpty(expression)) - { - return expression; - } - - // These are also zero-based indices into the sourceString, but - // these tell us where the current property tag begins and ends. - int propertyStartIndex, propertyEndIndex; - - // If there are no substitutions, then just return the string. - propertyStartIndex = expression.IndexOf("$(", StringComparison.Ordinal); - if (propertyStartIndex == -1) - { - return expression; - } - - // We will build our set of results as object components - // so that we can either maintain the object's type in the event - // that we have a single component, or convert to a string - // if concatenation is required. - List results = new List(); - - // The sourceIndex is the zero-based index into the sourceString, - // where we've essentially read up to and copied into the target string. - int sourceIndex = 0; - - // Search for "$(" in the sourceString. Loop until we don't find it - // any more. - while (propertyStartIndex != -1) - { - - // Append the targetString with the portion of the sourceString up to - // (but not including) the "$(", and advance the sourceIndex pointer. - if (propertyStartIndex - sourceIndex > 0) - { - results.Add(expression.Substring(sourceIndex, propertyStartIndex - sourceIndex)); - } - - bool tryExtractPropertyFunction; - bool tryExtractRegistryFunction; - // Following the "$(" we need to locate the matching ')' - // Scan for the matching closing bracket, skipping any nested ones - // This is a very complete, fast validation of parenthesis matching including for nested - // function calls. - propertyEndIndex = ScanForClosingParenthesis(expression, propertyStartIndex + 2, out tryExtractPropertyFunction, out tryExtractRegistryFunction); - - if (propertyEndIndex == -1) - { - // If we didn't find the closing parenthesis, that means this - // isn't really a well-formed property tag. Just literally - // copy the remainder of the sourceString (starting with the "$(" - // that we found) into the targetString, and quit. - results.Add(expression.Substring(propertyStartIndex, expression.Length - propertyStartIndex)); - sourceIndex = expression.Length; - } - else - { - // Aha, we found the closing parenthesis. All the stuff in - // between the "$(" and the ")" constitutes the property body. - // Note: Current propertyStartIndex points to the "$", and - // propertyEndIndex points to the ")". That's why we have to - // add 2 for the start of the substring, and subtract 2 for - // the length. - string propertyBody = expression.Substring(propertyStartIndex + 2, propertyEndIndex - propertyStartIndex - 2); - - // A property value of null will indicate that we're calling a static function on a type - object propertyValue = null; - - // Compat: $() should return String.Empty - if (propertyBody.Length == 0) - { - propertyValue = String.Empty; - } - else if (tryExtractRegistryFunction && propertyBody.StartsWith("Registry:", StringComparison.OrdinalIgnoreCase)) - { - // This is a registry reference, like $(Registry:HKEY_LOCAL_MACHINE\Software\Vendor\Tools@TaskLocation) - propertyValue = ExpandRegistryValue(propertyBody, null); - } - else if (tryExtractPropertyFunction) - { - // This is either a regular property or a function expression - propertyValue = ExpandPropertyBody(propertyBody, propertyValue, properties, options); - } - else // This is a regular property - { - propertyValue = LookupProperty(properties, propertyBody, expressionNode); - } - - // If it's a property function result, it may return null, so check before we add it. - if (propertyValue != null) - { - // Append the property value to our targetString, and advance - // our sourceIndex pointer to the character just after the closing - // parenthesis. - results.Add(propertyValue); - } - sourceIndex = propertyEndIndex + 1; - } - - propertyStartIndex = expression.IndexOf("$(", sourceIndex, StringComparison.Ordinal); - } - // If we have only a single result, then just return it - if (results.Count == 1 && expression.Length == sourceIndex) - { - return results[0]; - } - else - { - // We have more than one result collected, therefore we need to concatenate - // into the final result string. This does mean that we will lose type information. - // However since the user wanted contatenation, then they clearly wanted that to happen. - - // Initialize our output string to empty string. - // PERF: This method is called very often - of the order of 3,000 times per project. - // StringBuilder by default is initialized with a 16 char string and doubles the length - // whenever it's too short. We want to avoid reallocation but also avoid excessive allocation. - // The length of the source string turns out to be a fair compromise. (The final result may - // be longer or it may be shorter.) - StringBuilder result = new StringBuilder(expression.Length); - - // We couldn't find anymore property tags in the expression, - // so just literally copy the remainder into the result - // and return. - if (expression.Length - sourceIndex > 0) - { - results.Add(expression.Substring(sourceIndex, expression.Length - sourceIndex)); - } - - // Create a combined result string from the result components that we've gathered - foreach (object component in results) - { - result.Append(component.ToString()); - } - - return result.ToString(); - } - } - - /// - /// Convert the object into an MSBuild friendly string - /// Arrays are supported. - /// - private static string ConvertToString(object valueToConvert) - { - if (valueToConvert != null) - { - Type valueType = valueToConvert.GetType(); - string convertedString; - - // If the type is a string, then there is nothing to do - if (valueType == typeof(string)) - { - convertedString = (string)valueToConvert; - } - else if (valueToConvert is IDictionary) - { - // If the return type is an IDictionary, then we convert this to - // a semi-colon delimited set of A=B pairs. - // Key and Value are converted to string and escaped - IDictionary dictionary = valueToConvert as IDictionary; - StringBuilder builder = new StringBuilder(); - - foreach (DictionaryEntry entry in dictionary) - { - if (builder.Length > 0) - { - builder.Append(';'); - } - - // convert and escape each key and value in the dictionary entry - builder.Append(EscapingUtilities.Escape(ConvertToString(entry.Key))); - builder.Append('='); - builder.Append(EscapingUtilities.Escape(ConvertToString(entry.Value))); - } - - convertedString = builder.ToString(); - } - else if (valueToConvert is IEnumerable) - { - // If the return is enumerable, then we'll convert to semi-colon delimted elements - // each of which must be converted, so we'll recurse for each element - StringBuilder builder = new StringBuilder(); - - IEnumerable enumerable = (IEnumerable)valueToConvert; - - foreach (object element in enumerable) - { - if (builder.Length > 0) - { - builder.Append(';'); - } - - // we need to convert and escape each element of the array - builder.Append(EscapingUtilities.Escape(ConvertToString(element))); - } - - convertedString = builder.ToString(); - } - else - { - // The fall back is always to just convert to a string directly. - convertedString = valueToConvert.ToString(); - } - - return convertedString; - } - else - { - return String.Empty; - } - } - - /// - /// Scan for the closing bracket that matches the one we've already skipped; - /// essentially, pushes and pops on a stack of parentheses to do this. - /// Takes the expression and the index to start at. - /// Returns the index of the matching parenthesis, or -1 if it was not found. - /// - private static int ScanForClosingParenthesis(string expression, int index) - { - bool potentialPropertyFunction; - bool potentialRegistryFunction; - return ScanForClosingParenthesis(expression, index, out potentialPropertyFunction, out potentialRegistryFunction); - } - - /// - /// Scan for the closing bracket that matches the one we've already skipped; - /// essentially, pushes and pops on a stack of parentheses to do this. - /// Takes the expression and the index to start at. - /// Returns the index of the matching parenthesis, or -1 if it was not found. - /// Also returns flags to indicate if a propertyfunction or registry property is likely - /// to be found in the expression - /// - private static int ScanForClosingParenthesis(string expression, int index, out bool potentialPropertyFunction, out bool potentialRegistryFunction) - { - int nestLevel = 1; - int length = expression.Length; - - potentialPropertyFunction = false; - potentialRegistryFunction = false; - - // Scan for our closing ')' - while (index < length && nestLevel > 0) - { - char character = expression[index]; - - if (character == '(') - { - nestLevel++; - } - else if (character == ')') - { - nestLevel--; - } - else if (character == '.' || character == '[' || character == '$') - { - potentialPropertyFunction = true; - } - else if (character == ':') - { - potentialRegistryFunction = true; - } - - index++; - } - - // We will have parsed past the ')', so step back one character - index--; - - return (nestLevel == 0) ? index : -1; - } - - /// - /// Expand the body of the property, including any functions that it may contain - /// - private object ExpandPropertyBody(string propertyBody, object propertyValue, BuildPropertyGroup properties, ExpanderOptions options) - { - Function function = null; - string propertyName = propertyBody; - - // Trim the body for comatibility reasons: - // Spaces are not valid property name chars, but $( Foo ) is allowed, and should always expand to BLANK. - // Do a very fast check for leading and trailing whitespace, and trim them from the property body if we have any. - // But we will do a property name lookup on the propertyName that we held onto. - if (Char.IsWhiteSpace(propertyBody[0]) || Char.IsWhiteSpace(propertyBody[propertyBody.Length - 1])) - { - propertyBody = propertyBody.Trim(); - } - - // If we don't have a clean propertybody then we'll do deeper checks to see - // if what we have is a function - if (!IsValidPropertyName(propertyBody)) - { - if (propertyBody.Contains(".") || propertyBody[0] == '[') - { - // This is a function - function = Function.ExtractPropertyFunction(propertyBody, propertyValue); - - // We may not have been able to parse out a function - if (function != null) - { - // We will have either extracted the actual property name - // or realised that there is none (static function), and have recorded a null - propertyName = function.ExpressionRootName; - } - else - { - // In the event that we have been handed an unrecognized property body, throw - // an invalid function property exception. - ProjectErrorUtilities.ThrowInvalidProject(null, "InvalidFunctionPropertyExpression", propertyBody, String.Empty); - return null; - } - } - else - { - // In the event that we have been handed an unrecognized property body, throw - // an invalid function property exception. - ProjectErrorUtilities.ThrowInvalidProject(null, "InvalidFunctionPropertyExpression", propertyBody, String.Empty); - return null; - } - } - - // Find the property value in our property collection. This - // will automatically return "" (empty string) if the property - // doesn't exist in the collection, and we're not executing a static function - if (!String.IsNullOrEmpty(propertyName)) - { - BuildProperty property; - if (lookup != null) - { - // We're using a lookup - property = lookup.GetProperty(propertyName); - } - else - { - // We're only using a property group - property = properties[propertyName]; - } - - if (property == null) - { - propertyValue = String.Empty; - } - else - { - propertyValue = property.FinalValueEscaped; - } - } - - if (function != null) - { - // Because of the rich expansion capabilities of MSBuild, we need to keep things - // as strings, since property expansion & string embedding can happen anywhere - // propertyValue can be null here, when we're invoking a static function - propertyValue = function.Execute(this, propertyValue, properties, options); - } - - return propertyValue; - } - - /// - /// Look up a simple property reference by the name of the property, e.g. "Foo" when expanding $(Foo) - /// - private object LookupProperty(BuildPropertyGroup properties, string propertyName, XmlNode expressionNode) - { - // Regular property - BuildProperty property; - object propertyValue; - - if (lookup != null) - { - // We're using a lookup - property = lookup.GetProperty(propertyName); - } - else - { - // We're only using a property group - property = properties[propertyName]; - } - - if (property == null) - { - propertyValue = String.Empty; - - // Support at least $(MSBuildThisFile) - if (expressionNode != null && String.Equals(propertyName, "MSBuildThisFile", StringComparison.OrdinalIgnoreCase)) - { - string thisFile = XmlUtilities.GetXmlNodeFile(expressionNode, String.Empty /* default */); - - if (!String.IsNullOrEmpty(thisFile)) - { - propertyValue = Path.GetFileName(thisFile); - } - } - } - else - { - propertyValue = property.FinalValueEscaped; - } - - return propertyValue; - } - - /// - /// Returns true if the supplied string contains a valid property name - /// - private static bool IsValidPropertyName(string propertyName) - { - if (propertyName.Length == 0 || !XmlUtilities.IsValidInitialElementNameCharacter(propertyName[0])) - { - return false; - } - - for (int n = 1; n < propertyName.Length; n++) - { - if (!XmlUtilities.IsValidSubsequentElementNameCharacter(propertyName[n])) - { - return false; - } - } - - return true; - } - - /// - /// Given a string like "Registry:HKEY_LOCAL_MACHINE\Software\Vendor\Tools@TaskLocation", return the value at that location - /// in the registry. If the value isn't found, returns String.Empty. - /// Properties may refer to a registry location by using the syntax for example - /// "$(Registry:HKEY_LOCAL_MACHINE\Software\Vendor\Tools@TaskLocation)", where "HKEY_LOCAL_MACHINE\Software\Vendor\Tools" is the key and - /// "TaskLocation" is the name of the value. The name of the value and the preceding "@" may be omitted if - /// the default value is desired. - /// - /// Expression to expand, eg "Registry:HKEY_LOCAL_MACHINE\Software\Vendor\Tools@TaskLocation" - /// Location associated with the expression, for purposes of good error messages - /// - private string ExpandRegistryValue(string registryExpression, XmlNode node) - { - string registryLocation = registryExpression.Substring(9); - - // Split off the value name -- the part after the "@" sign. If there's no "@" sign, then it's the default value name - // we want. - int firstAtSignOffset = registryLocation.IndexOf('@'); - int lastAtSignOffset = registryLocation.LastIndexOf('@'); - - ProjectErrorUtilities.VerifyThrowInvalidProject(firstAtSignOffset == lastAtSignOffset, node, "InvalidRegistryPropertyExpression", "$(" + registryExpression + ")", String.Empty); - - string valueName = lastAtSignOffset == -1 || lastAtSignOffset == registryLocation.Length - 1 - ? null : registryLocation.Substring(lastAtSignOffset + 1); - - // If there's no '@', or '@' is first, then we'll use null or String.Empty for the location; otherwise - // the location is the part before the '@' - string registryKeyName = lastAtSignOffset != -1 ? registryLocation.Substring(0, lastAtSignOffset) : registryLocation; - - string result = String.Empty; - if (registryKeyName != null) - { - // We rely on the '@' character to delimit the key and its value, but the registry - // allows this character to be used in the names of keys and the names of values. - // Hence we use our standard escaping mechanism to allow users to access such keys - // and values. - registryKeyName = EscapingUtilities.UnescapeAll(registryKeyName); - - if (valueName != null) - { - valueName = EscapingUtilities.UnescapeAll(valueName); - } - - try - { - object valueFromRegistry = Registry.GetValue(registryKeyName, - valueName, - null /* default if key or value name is not found */); - if (valueFromRegistry != null) - { - // Convert the result to a string that is reasonable for MSBuild - result = ConvertToString(valueFromRegistry); - } - else - { - // This means either the key or value was not found in the registry. In this case, - // we simply expand the property value to String.Empty to imitate the behavior of - // normal properties. - result = String.Empty; - } - } - catch (ArgumentException ex) - { - ProjectErrorUtilities.VerifyThrowInvalidProject(false, node, "InvalidRegistryPropertyExpression", "$(" + registryExpression + ")", ex.Message); - } - catch (IOException ex) - { - ProjectErrorUtilities.VerifyThrowInvalidProject(false, node, "InvalidRegistryPropertyExpression", "$(" + registryExpression + ")", ex.Message); - } - catch (SecurityException ex) - { - ProjectErrorUtilities.VerifyThrowInvalidProject(false, node, "InvalidRegistryPropertyExpression", "$(" + registryExpression + ")", ex.Message); - } - } - - return result; - } - - /// - /// This class represents the function as extracted from a property expression - /// It is also responsible for executing the function - /// - private class Function - { - /// - /// The type that this function will act on - /// - private Type objectType; - - /// - /// The name of the function - /// - private string name; - - /// - /// The arguments for the function - /// - private string[] arguments; - - /// - /// The expression that constitutes this function - /// - private string expression; - - /// - /// The property name that is the context for this function - /// - private string expressionRootName; - - /// - /// The binding flags that will be used during invocation of this function - /// - private BindingFlags bindingFlags; - - /// - /// The remainder of the body once the function and arguments have been extracted - /// - private string remainder; - - /// - /// Construct a function that will be executed during property evaluation - /// - public Function(Type objectType, string expression, string expressionRootName, string name, string[] arguments, BindingFlags bindingFlags, string remainder) - { - this.name = name; - this.arguments = arguments; - this.expressionRootName = expressionRootName; - this.expression = expression; - this.objectType = objectType; - this.bindingFlags = bindingFlags; - this.remainder = remainder; - } - - /// - /// Part of the extraction may result in the name of the property - /// This accessor is used by the Expander - /// Examples of expression root: - /// [System.Diagnostics.Process]::Start - /// SomeMSBuildProperty - /// - public string ExpressionRootName - { - get { return expressionRootName; } - } - - /// - /// The type of the instance on which this function acts - /// - public Type ObjectType - { - get { return objectType; } - } - - /// - /// Extract the function details from the given property function expression - /// - public static Function ExtractPropertyFunction(string expressionFunction, object propertyValue) - { - // If this a expression function rather than a static, then we'll capture the name of the property referenced - string propertyName = null; - - // The type of the object that this function is part - Type objectType = null; - - // By default the expression root is the whole function expression - string expressionRoot = expressionFunction; - - // The arguments for this function start at the first '(' - // If there are no arguments, then we're a property getter - int argumentStartIndex = expressionFunction.IndexOf('('); - - // If we have arguments, then we only want the content up to but not including the '(' - if (argumentStartIndex > -1) - { - expressionRoot = expressionFunction.Substring(0, argumentStartIndex); - } - - // We ended up with something we don't understand - ProjectErrorUtilities.VerifyThrowInvalidProject(!String.IsNullOrEmpty(expressionRoot), null, "InvalidFunctionPropertyExpression", expressionFunction, String.Empty); - - // First we'll see if there is a static function being called - // A static method is the content that follows the last "::", the rest being - // the type - int methodStartIndex; - - // This is a static method call - if (expressionRoot[0] == '[') - { - int typeEndIndex = expressionRoot.IndexOf(']', 1); - - if (typeEndIndex < 1) - { - // We ended up with something other than a function expression - ProjectErrorUtilities.ThrowInvalidProject(null, "InvalidFunctionStaticMethodSyntax", "$(" + expressionFunction + ")"); - } - - string typeName = expressionRoot.Substring(1, typeEndIndex - 1); - methodStartIndex = typeEndIndex + 1; - - // Make an attempt to locate a type that matches the body of the expression. - // We won't throw on error here - objectType = GetTypeForStaticMethod(typeName); - - if (objectType == null) - { - // We ended up with something other than a type - ProjectErrorUtilities.ThrowInvalidProject(null, "InvalidFunctionStaticMethodSyntax", "$(" + expressionFunction + ")"); - } - - if (expressionRoot.Length > methodStartIndex + 2 && expressionRoot[methodStartIndex] == ':' && expressionRoot[methodStartIndex + 1] == ':') - { - // skip over the "::" - methodStartIndex += 2; - } - else - { - // We ended up with something other than a static function expression - ProjectErrorUtilities.ThrowInvalidProject(null, "InvalidFunctionStaticMethodSyntax", "$(" + expressionFunction + ")"); - } - } - else - { - // No static function call was found, look for an instance function call next, such as in SomeStuff.ToLower() - methodStartIndex = expressionRoot.IndexOf('.'); - if (methodStartIndex == -1) - { - // We don't have a function invocation in the expression root, return null - return null; - } - else - { - // skip over the '.'; - methodStartIndex++; - } - } - - // No type matched, therefore the content must be a property reference, or a recursive call as functions - // are chained together - if (objectType == null) - { - int rootEndIndex = expressionRoot.IndexOf('.'); - propertyName = expressionRoot.Substring(0, rootEndIndex); - - // If propertyValue is null (we're not recursing), then we're expecting a valid property name - if (propertyValue == null && !IsValidPropertyName(propertyName)) - { - // We extracted something that wasn't a valid property name, fail. - ProjectErrorUtilities.ThrowInvalidProject(null, "InvalidFunctionPropertyExpression", expressionFunction, String.Empty); - } - - objectType = typeof(string); - } - - // If we are recursively acting on a type that has been already produced - // then pass that type inwards - if (propertyValue != null) - { - objectType = propertyValue.GetType(); - } - - Function function = ConstructFunction(expressionFunction, propertyName, objectType, argumentStartIndex, methodStartIndex); - - return function; - } - - /// - /// Execute the function on the given instance - /// - public object Execute(Expander expander, object objectInstance, BuildPropertyGroup properties, ExpanderOptions options) - { - object[] args = null; - - try - { - // If there is no object instance, then the method invocation will be a static - if (objectInstance == null) - { - // Check that the function that we're going to call is valid to call - if (!IsStaticMethodAvailable(ObjectType, name)) - { - ProjectErrorUtilities.ThrowInvalidProject(null, "InvalidFunctionMethodUnavailable", name, ObjectType.FullName); - } - - bindingFlags |= BindingFlags.Static; - - // For our intrinsic function we need to support calling of internal methods - // since we don't want them to be public - if (objectType == typeof(Microsoft.Build.BuildEngine.IntrinsicFunctions)) - { - bindingFlags |= BindingFlags.NonPublic; - } - } - else - { - bindingFlags |= BindingFlags.Instance; - } - - // We have a methodinfo match, need to plug in the arguments - - args = new object[arguments.Length]; - - // Assemble our arguments ready for passing to our method - for (int n = 0; n < arguments.Length; n++) - { - object argument = expander.ExpandPropertiesLeaveTypedAndEscaped(this.arguments[n], null); - string argumentValue = argument as string; - - if (argumentValue != null) - { - // remove our 'quotes' from the escaped string, leaving escaped quotes intact - args[n] = EscapingUtilities.UnescapeAll(argumentValue.Trim('`', '"', '\'')); - } - else - { - args[n] = argument; - } - } - - // Handle special cases where the object type needs to affect the choice of method - // The default binder and method invoke, often chooses the incorrect Equals and CompareTo and - // fails the comparison, because what we have on the right is generally a string. - // This special casing is to realize that its a comparison that is taking place and handle the - // argument type coercion accordingly; effectively pre-preparing the argument type so - // that it matches the left hand side ready for the default binder�s method invoke. - if (objectInstance != null && args.Length == 1 && (String.Equals("Equals", this.name, StringComparison.OrdinalIgnoreCase) || String.Equals("CompareTo", this.name, StringComparison.OrdinalIgnoreCase))) - { - // change the type of the final unescaped string into the destination - args[0] = Convert.ChangeType(args[0], objectInstance.GetType(), CultureInfo.InvariantCulture); - } - - object functionResult; - // If we've been asked for and instance to be constructed, then we - // need to locate an appropriate constructor and invoke it - if (String.Equals("new", this.name, StringComparison.OrdinalIgnoreCase)) - { - functionResult = LateBindExecute(null /* no previous exception */, BindingFlags.Public | BindingFlags.Instance, null /* no instance for a constructor */, args, true /* is constructor */); - } - else - { - // Execute the function given converted arguments - // The only exception that we should catch to try a late bind here is missing method - // otherwise there is the potential of running a function twice! - try - { - // First use InvokeMember using the standard binder - this will match and coerce as needed - functionResult = objectType.InvokeMember(this.name, bindingFlags, Type.DefaultBinder, objectInstance, args, CultureInfo.InvariantCulture); - } - catch (MissingMethodException ex) // Don't catch and retry on any other exception - { - // If we're invoking a method, then there are deeper attempts that - // can be made to invoke the method - if ((bindingFlags & BindingFlags.InvokeMethod) == BindingFlags.InvokeMethod) - { - // The standard binder failed, so do our best to coerce types into the arguments for the function - // This may happen if the types need coercion, but it may also happen if the object represents a type that contains open type parameters, that is, ContainsGenericParameters returns true. - functionResult = LateBindExecute(ex, bindingFlags, objectInstance, args, false /* is not constructor */); - } - else - { - // We were asked to get a property or field, and we found that we cannot - // locate it. Since there is no further argument coersion possible - // we'll throw right now. - throw; - } - } - } - - // If the result of the function call is a string, then we need to escape the result - // so that we maintain the "engine contains escaped data" state. - // The exception is that the user is explicitly calling MSBuild::Unescape or MSBuild::Escape - if (functionResult is string && !String.Equals("Unescape", name, StringComparison.OrdinalIgnoreCase) && !String.Equals("Escape", name, StringComparison.OrdinalIgnoreCase)) - { - functionResult = EscapingUtilities.Escape((string)functionResult); - } - - // There's nothing left to deal within the function expression, return the result from the execution - if (String.IsNullOrEmpty(remainder)) - { - return functionResult; - } - - // Recursively expand the remaining property body after execution - return expander.ExpandPropertyBody(remainder, functionResult, properties, options); - } - // Exceptions coming from the actual function called are wrapped in a TargetInvocationException - catch (TargetInvocationException ex) - { - // We ended up with something other than a function expression - string partiallyEvaluated = GenerateStringOfMethodExecuted(expression, objectInstance, name, args); - ProjectErrorUtilities.ThrowInvalidProject(null, "InvalidFunctionPropertyExpression", partiallyEvaluated, ex.InnerException.Message.Replace("\r\n", " ")); - return null; - } - // Any other exception was thrown by trying to call it - catch (Exception ex) - { - if (ExceptionHandling.NotExpectedFunctionException(ex)) - { - throw; - } - - // We ended up with something other than a function expression - string partiallyEvaluated = GenerateStringOfMethodExecuted(expression, objectInstance, name, args); - ProjectErrorUtilities.ThrowInvalidProject(null, "InvalidFunctionPropertyExpression", partiallyEvaluated, ex.Message); - return null; - } - } - - /// - /// Make an attempt to create a string showing what we were trying to execute when we failed. - /// This will show any intermediate evaluation which may help the user figure out what happened. - /// - private string GenerateStringOfMethodExecuted(string expression, object objectInstance, string name, object[] args) - { - string parameters = String.Empty; - if (args != null) - { - foreach (object arg in args) - { - if (arg == null) - { - parameters += "null"; - } - else - { - string argString = arg.ToString(); - if (arg is string && argString.Length == 0) - { - parameters += "''"; - } - else - { - parameters += arg.ToString(); - } - } - - parameters += ", "; - } - - if (parameters.Length > 2) - { - parameters = parameters.Substring(0, parameters.Length - 2); - } - } - - if (objectInstance == null) - { - string typeName = objectType.FullName; - - // We don't want to expose the real type name of our intrinsics - // so we'll replace it with "MSBuild" - if (objectType == typeof(Microsoft.Build.BuildEngine.IntrinsicFunctions)) - { - typeName = "MSBuild"; - } - - if ((bindingFlags & BindingFlags.InvokeMethod) == BindingFlags.InvokeMethod) - { - return "[" + typeName + "]::" + name + "(" + parameters + ")"; - } - else - { - return "[" + typeName + "]::" + name; - } - } - else - { - string propertyValue = "\"" + objectInstance as string + "\""; - - if ((bindingFlags & BindingFlags.InvokeMethod) == BindingFlags.InvokeMethod) - { - return propertyValue + "." + name + "(" + parameters + ")"; - } - else - { - return propertyValue + "." + name; - } - } - } - - /// - /// Return a Type object for the type we're trying to call static methods on - /// - private static Type GetTypeForStaticMethod(string typeName) - { - // Ultimately this will be a more in-depth lookup, including assembly name etc. - // for now, we're only supporting a subset of what's in mscorlib + specific additional types - // If the env var MSBUILDENABLEALLPROPERTYFUNCTIONS=1 then we'll allow pretty much anything - Type objectType; - Tuple functionType; - - // For whole types we support them being in different assemblies than mscorlib - // Get the assembly qualified type name if one exists - if (FunctionConstants.AvailableStaticMethods.TryGetValue(typeName, out functionType) && functionType != null) - { - // We need at least one of these set - ErrorUtilities.VerifyThrow(functionType.Item1 != null || functionType.Item2 != null, "Function type information needs either string or type represented."); - - // If we have the type information in Type form, then just return that - if (functionType.Item2 != null) - { - return functionType.Item2; - } - else if (functionType.Item1 != null) - { - // This is a case where the Type is not available at compile time, so - // we are forced to bind by name instead - typeName = functionType.Item1; - - // Get the type from the assembly qualified type name from AvailableStaticMethods - objectType = Type.GetType(typeName, false /* do not throw TypeLoadException if not found */, true /* ignore case */); - - // If we've used it once, chances are that we'll be using it again - // We can record the type here since we know it's available for calling from the fact that is was in the AvailableStaticMethods table - FunctionConstants.AvailableStaticMethods[typeName] = new Tuple(typeName, objectType); - - return objectType; - } - } - - // Get the type from mscorlib (or the currently running assembly) - objectType = Type.GetType(typeName, false /* do not throw TypeLoadException if not found */, true /* ignore case */); - - if (objectType != null) - { - // DO NOT CACHE THE TYPE HERE! - // We don't add the resolved type here in the AvailableStaticMethods. This is because that table is used - // during function parse, but only later during execution do we check for the ability to call specific methods on specific types. - return objectType; - } - - // Note the following code path is only entered when MSBUILDENABLEALLPROPERTYFUNCTIONS == 1 - if (Environment.GetEnvironmentVariable("MSBUILDENABLEALLPROPERTYFUNCTIONS") == "1") - { - // We didn't find the type, so go probing. First in System - if (objectType == null) - { - objectType = GetTypeFromAssembly(typeName, "System"); - } - - // Next in System.Core - if (objectType == null) - { - objectType = GetTypeFromAssembly(typeName, "System.Core"); - } - - // We didn't find the type, so try to find it using the namespace - if (objectType == null) - { - objectType = GetTypeFromAssemblyUsingNamespace(typeName); - } - - if (objectType != null) - { - // If we've used it once, chances are that we'll be using it again - // We can cache the type here, since all functions are enabled - FunctionConstants.AvailableStaticMethods[typeName] = new Tuple(typeName, objectType); - } - } - - return objectType; - } - - /// - /// Gets the specified type using the namespace to guess the assembly that its in - /// - private static Type GetTypeFromAssemblyUsingNamespace(string typeName) - { - string baseName = typeName; - int assemblyNameEnd = baseName.LastIndexOf('.'); - ErrorUtilities.VerifyThrow(assemblyNameEnd > 0, "Invalid typename: {0}", typeName); - - // We will work our way up the namespace looking for an assembly that matches - while (assemblyNameEnd > 0) - { - string candidateAssemblyName = baseName.Substring(0, assemblyNameEnd); - - // Try to load the assembly with the computed name - Type foundType = GetTypeFromAssembly(typeName, candidateAssemblyName); - if (foundType != null) - { - // We have a match, so get the type from that assembly - return foundType; - } - else - { - // Keep looking as we haven't found a match yet - baseName = candidateAssemblyName; - assemblyNameEnd = baseName.LastIndexOf('.'); - } - } - - // We didn't find it, so we need to give up - return null; - } - - /// - /// Get the specified type from the assembly partial name supplied - /// - private static Type GetTypeFromAssembly(string typeName, string candidateAssemblyName) - { - Type objectType = null; - - // Try to load the assembly with the computed name -#pragma warning disable 618 - // Unfortunately Assembly.Load is not an alternative to LoadWithPartialName, since - // Assembly.Load requires the full assembly name to be passed to it. - // Therefore we must ignore the deprecated warning. - Assembly candidateAssembly = Assembly.LoadWithPartialName(candidateAssemblyName); -#pragma warning restore 618 - - if (candidateAssembly != null) - { - objectType = candidateAssembly.GetType(typeName, false /* do not throw TypeLoadException if not found */, true /* ignore case */); - } - - return objectType; - } - - /// - /// Factory method to construct a function for property evaluation - /// - private static Function ConstructFunction(string expressionFunction, string expressionRootName, Type objectType, int argumentStartIndex, int methodStartIndex) - { - // The unevaluated and unexpanded arguments for this function - string[] functionArguments; - - // The name of the function that will be invoked - string functionToInvoke; - - // What's left of the expression once the function has been constructed - string remainder = String.Empty; - - // The binding flags that we will use for this function's execution - BindingFlags defaultBindingFlags = BindingFlags.IgnoreCase | BindingFlags.Public; - - // There are arguments that need to be passed to the function - if (argumentStartIndex > -1 && !expressionFunction.Substring(methodStartIndex, argumentStartIndex - methodStartIndex).Contains(".")) - { - string argumentsContent; - - // separate the function and the arguments - functionToInvoke = expressionFunction.Substring(methodStartIndex, argumentStartIndex - methodStartIndex).Trim(); - - // Skip the '(' - argumentStartIndex++; - - // Scan for the matching closing bracket, skipping any nested ones - int argumentsEndIndex = ScanForClosingParenthesis(expressionFunction, argumentStartIndex); - - // We should never end up in this situation, since the brackets will have been - // validated at the very outermost level (in the initial property parse). However if we - // end up with unmatched brackets here for some reason.. it's an error! - ErrorUtilities.VerifyThrow(argumentsEndIndex != -1, "Unmatched braces when constructing function.", "$(" + expressionFunction + ")"); - - // We have been asked for a method invocation - defaultBindingFlags |= BindingFlags.InvokeMethod; - - // It may be that there are '()' but no actual arguments content - if (argumentStartIndex == expressionFunction.Length - 1) - { - functionArguments = new string[0]; - } - else - { - // we have content within the '()' so let's extract and deal with it - argumentsContent = expressionFunction.Substring(argumentStartIndex, argumentsEndIndex - argumentStartIndex); - - // If there are no arguments, then just create an empty array - if (String.IsNullOrEmpty(argumentsContent)) - { - functionArguments = new string[0]; - } - else - { - // We will keep empty entries so that we can treat them as null - functionArguments = ExtractFunctionArguments(expressionFunction, argumentsContent); - } - - remainder = expressionFunction.Substring(argumentsEndIndex + 1); - } - } - else - { - int nextMethodIndex = expressionFunction.IndexOf('.', methodStartIndex); - int methodLength = expressionFunction.Length - methodStartIndex; - - functionArguments = new string[0]; - - if (nextMethodIndex > 0) - { - methodLength = nextMethodIndex - methodStartIndex; - remainder = expressionFunction.Substring(nextMethodIndex); - } - - string netPropertyName = expressionFunction.Substring(methodStartIndex, methodLength).Trim(); - - ProjectErrorUtilities.VerifyThrowInvalidProject(netPropertyName.Length > 0, null, "InvalidFunctionPropertyExpression", expressionFunction, String.Empty); - - // We have been asked for a property or a field - defaultBindingFlags |= (BindingFlags.GetProperty | BindingFlags.GetField); - - functionToInvoke = netPropertyName; - } - - // either there are no functions left or what we have is another function - if (String.IsNullOrEmpty(remainder) || remainder[0] == '.') - { - // Construct a FunctionInfo will all the content that we just gathered - return new Function(objectType, expressionFunction, expressionRootName, functionToInvoke, functionArguments, defaultBindingFlags, remainder); - } - else - { - // We ended up with something other than a function expression - ProjectErrorUtilities.ThrowInvalidProject(null, "InvalidFunctionPropertyExpression", expressionFunction, String.Empty); - return null; - } - } - - /// - /// Extract the first level of arguments from the content. - /// Splits the content passed in at commas. - /// Returns an array of unexpanded arguments. - /// If there are no arguments, returns an empty array. - /// - private static string[] ExtractFunctionArguments(string expressionFunction, string argumentsContent) - { - List arguments = new List(); - StringBuilder argumentBuilder = new StringBuilder(argumentsContent.Length); - - // Iterate over the contents of the arguments extracting the - // the individual arguments as we go - for (int n = 0; n < argumentsContent.Length; n++) - { - // We found a property expression.. skip over all of it. - if ((n < argumentsContent.Length - 1) && (argumentsContent[n] == '$' && argumentsContent[n + 1] == '(')) - { - int nestedPropertyStart = n; - n += 2; // skip over the opening '$(' - - // Scan for the matching closing bracket, skipping any nested ones - n = ScanForClosingParenthesis(argumentsContent, n); - - ProjectErrorUtilities.VerifyThrowInvalidProject(n != 0, null, "InvalidFunctionPropertyExpression", expressionFunction, String.Empty); - - argumentBuilder.Append(argumentsContent, nestedPropertyStart, (n - nestedPropertyStart) + 1); - } - else if (argumentsContent[n] == '`' || argumentsContent[n] == '"' || argumentsContent[n] == '\'') - { - int quoteStart = n; - n++; // skip over the opening quote - - n = ScanForClosingQuote(argumentsContent[quoteStart], argumentsContent, n); - - ProjectErrorUtilities.VerifyThrowInvalidProject(n != 0, null, "InvalidFunctionPropertyExpression", expressionFunction, String.Empty); - - argumentBuilder.Append(argumentsContent, quoteStart, (n - quoteStart) + 1); - } - else if (argumentsContent[n] == ',') - { - // We have reached the end of the current argument, go ahead and add it - // to our list - AddArgument(arguments, argumentBuilder); - // Create a new argument builder ready for the next argument - argumentBuilder = new StringBuilder(argumentsContent.Length); - } - else - { - argumentBuilder.Append(argumentsContent[n]); - } - } - - // This will either be the one and only argument, or the last one - // so add it to our list - AddArgument(arguments, argumentBuilder); - - return arguments.ToArray(); - } - - /// - /// Skip all characters until we find the matching quote character - /// - private static int ScanForClosingQuote(char quoteChar, string expression, int index) - { - // Scan for our closing quoteChar - while (index < expression.Length) - { - if (expression[index] == quoteChar) - { - return index; - } - index++; - } - - return -1; - } - - /// - /// Add the argument in the StringBuilder to the arguments list, handling nulls - /// appropriately - /// - private static void AddArgument(List arguments, StringBuilder argumentBuilder) - { - // If we don't have something that can be treated as an argument - // then we should treat it as a null so that passing nulls - // becomes possible through an empty argument between commas. - ErrorUtilities.VerifyThrowArgumentNull(argumentBuilder, nameof(argumentBuilder)); - // we reached the end of an argument, add the builder's final result - // to our arguments. - string argValue = argumentBuilder.ToString().Trim(); - // We support passing of null through the argument constant value null - if (String.Equals("null", argValue, StringComparison.OrdinalIgnoreCase)) - { - arguments.Add(null); - } - else - { - arguments.Add(argValue); - } - } - - /// - /// Coerce the arguments according to the parameter types - /// Will only return null if the coercion didn't work due to an InvalidCastException - /// - private static object[] CoerceArguments(object[] args, ParameterInfo[] parameters) - { - object[] coercedArguments = new object[args.Length]; - - try - { - // Do our best to coerce types into the arguments for the function - for (int n = 0; n < parameters.Length; n++) - { - if (args[n] == null) - { - // We can't coerce (object)null -- that's as general - // as it can get! - continue; - } - - // Here we have special case conversions on a type basis - if (parameters[n].ParameterType == typeof(char[])) - { - coercedArguments[n] = args[n].ToString().ToCharArray(); - } - else if (parameters[n].ParameterType.IsEnum && args[n] is string && ((string)args[n]).Contains(".")) - { - Type enumType = parameters[n].ParameterType; - string typeLeafName = enumType.Name + "."; - string typeFullName = enumType.FullName + "."; - - // Enum.parse expects commas between enum components - // We'll support the C# type | syntax too - // We'll also allow the user to specify the leaf or full type name on the enum - string argument = args[n].ToString().Replace('|', ',').Replace(typeFullName, "").Replace(typeLeafName, ""); - - // Parse the string representation of the argument into the destination enum - coercedArguments[n] = Enum.Parse(enumType, argument); - } - else - { - // change the type of the final unescaped string into the destination - coercedArguments[n] = Convert.ChangeType(args[n], parameters[n].ParameterType, CultureInfo.InvariantCulture); - } - } - } - catch (InvalidCastException) - { - // The coercion failed therefore we return null - return null; - } - - return coercedArguments; - } - - /// - /// For this initial implementation of inline functions, only very specific static methods on specific types are - /// available - /// - private bool IsStaticMethodAvailable(Type objectType, string methodName) - { - if (objectType == typeof(Microsoft.Build.BuildEngine.IntrinsicFunctions)) - { - // These are our intrinsic functions, so we're OK with those - return true; - } - else - { - string typeMethod = objectType.FullName + "::" + methodName; - - if (FunctionConstants.AvailableStaticMethods.ContainsKey(objectType.FullName)) - { - // Check our set for the type name - // This enables all statics on the given type - return true; - } - else if (FunctionConstants.AvailableStaticMethods.ContainsKey(typeMethod)) - { - // Check for specific methods on types - return true; - } - else if (Environment.GetEnvironmentVariable("MSBUILDENABLEALLPROPERTYFUNCTIONS") == "1") - { - // If MSBUILDENABLEALLPROPERTYFUNCTION == 1, then anything goes - return true; - } - } - - return false; - } - - /// - /// Construct and instance of objectType based on the constructor or method arguments provided. - /// Arguments must never be null. - /// - private object LateBindExecute(Exception ex, BindingFlags bindingFlags, object objectInstance /* null unless instance method */, object[] args, bool isConstructor) - { - - // First let's try for a method where all arguments are strings.. - Type[] types = new Type[arguments.Length]; - for (int n = 0; n < arguments.Length; n++) - { - types[n] = typeof(string); - } - - MethodBase memberInfo; - if (isConstructor) - { - memberInfo = objectType.GetConstructor(bindingFlags, null, types, null); - } - else - { - memberInfo = objectType.GetMethod(this.name, bindingFlags, null, types, null); - } - - // If we didn't get a match on all string arguments, - // search for a method with the right number of arguments - if (memberInfo == null) - { - MethodBase[] members; - // Gather all methods that may match - if (isConstructor) - { - members = objectType.GetConstructors(bindingFlags); - } - else - { - members = objectType.GetMethods(bindingFlags); - } - - foreach (MethodBase member in members) - { - ParameterInfo[] parameters = member.GetParameters(); - - // Simple match on name and number of params, we will be case insensitive - if (parameters.Length == this.arguments.Length) - { - if (isConstructor || String.Equals(member.Name, this.name, StringComparison.OrdinalIgnoreCase)) - { - // Try to find a method with the right name, number of arguments and - // compatible argument types - // we have a match on the name and argument number - // now let's try to coerce the arguments we have - // into the arguments on the matching method - object[] coercedArguments = CoerceArguments(args, parameters); - - if (coercedArguments != null) - { - // We have a complete match - memberInfo = member; - args = coercedArguments; - break; - } - } - } - } - } - - object functionResult = null; - - // We have a match and coerced arguments, let's construct.. - if (memberInfo != null && args != null) - { - if (isConstructor) - { - functionResult = ((ConstructorInfo)memberInfo).Invoke(args); - } - else - { - functionResult = ((MethodInfo)memberInfo).Invoke(objectInstance /* null if static method */, args); - } - } - else if (!isConstructor) - { - throw ex; - } - - if (functionResult == null && isConstructor) - { - throw new TargetInvocationException(new MissingMethodException()); - } - - return functionResult; - } - } - - /// - /// Expands all embedded item metadata in the given string, using the bucketed items. - /// - /// This method leaves the expression escaped. Callers may need to unescape on their own as appropriate. - /// - /// - /// This method is marked internal only for unit-testing purposes. Ideally - /// it should be private. - /// - /// SumedhK - /// - /// the expanded string - internal string ExpandMetadataLeaveEscaped - ( - string expression - ) - { - if ((options & ExpanderOptions.ExpandMetadata) != ExpanderOptions.ExpandMetadata) - { - return expression; - } - - string result; - - // PERF NOTE: Regex matching is expensive, so if the string doesn't contain any item metadata references, just bail - // out -- pre-scanning the string is actually cheaper than running the Regex, even when there are no matches! - if (expression.IndexOf(ItemExpander.itemMetadataPrefix, StringComparison.Ordinal) == -1) - { - result = expression; - } - // if there are no item vectors in the string - else if (expression.IndexOf(ItemExpander.itemVectorPrefix, StringComparison.Ordinal) == -1) - { - // run a simpler Regex to find item metadata references - result = ItemExpander.itemMetadataPattern.Replace(expression, new MatchEvaluator(ExpandSingleMetadata)); - } - // PERF NOTE: this is a highly targeted optimization for a common pattern observed during profiling - // if the string is a list of item vectors with no separator specifications - else if (ItemExpander.listOfItemVectorsWithoutSeparatorsPattern.IsMatch(expression)) - { - // then even if the string contains item metadata references, those references will only be inside transform - // expressions, and can be safely skipped - result = expression; - } - else - { - // otherwise, run the more complex Regex to find item metadata references not contained in transforms - result = ItemExpander.nonTransformItemMetadataPattern.Replace(expression, new MatchEvaluator(ExpandSingleMetadata)); - } - - return result; - } - - /// - /// Expands a single item metadata. - /// - /// This method is a callback for Regex.Replace(). - /// SumedhK - /// - /// the expanded item metadata - private string ExpandSingleMetadata(Match itemMetadataMatch) - { - ErrorUtilities.VerifyThrow(itemMetadataMatch.Success, "Need a valid item metadata."); - - string metadataName = itemMetadataMatch.Groups["NAME"].Value; - string itemType = null; - - // check if the metadata is qualified with the item type - if (itemMetadataMatch.Groups["ITEM_SPECIFICATION"].Length > 0) - { - itemType = itemMetadataMatch.Groups["TYPE"].Value; - } - - // look up the metadata - we may not have a value for it - string metadataValue = null; - - metadataValue = GetValueFromMetadataTable(itemType, metadataName, metadataValue); - - if (metadataValue == null) - { - metadataValue = GetDefaultMetadataValue(itemType, metadataName, metadataValue); - } - - return metadataValue ?? String.Empty; - } - - /// - /// Retrieves any value we have in our metadata table for the metadata name specified. - /// If no value is available, returns null. - /// - private string GetValueFromMetadataTable(string itemType, string metadataName, string metadataValue) - { - if (itemMetadata == null) - { - return null; - } - - if (implicitMetadataItemType == null) - { - // metadata table has some qualified keys; if the expression is - // qualified, look it up with a qualified key - string key; - if (itemType == null) - { - key = metadataName; - } - else - { - key = itemType + "." + metadataName; - } - - itemMetadata.TryGetValue(key, out metadataValue); - } - else - { - // metadata table has all unqualified keys. - // if we found a qualified metadata, it must match the type - // of all the metadata in our table of unqualified metadata - if (itemType == null || String.Equals(itemType, implicitMetadataItemType, StringComparison.OrdinalIgnoreCase)) - { - itemMetadata.TryGetValue(metadataName, out metadataValue); - } - } - - return metadataValue; - } - - /// - /// Retrieves any value we have for the specified metadata in any table of default metadata we've been assigned. - /// If no value is available, returns null. - /// - private string GetDefaultMetadataValue(string itemType, string metadataName, string metadataValue) - { - if (specificItemDefinitionLibrary == null) - { - return null; - } - - if (itemType == null || String.Equals(itemType, specificItemDefinitionLibrary.ItemType, StringComparison.OrdinalIgnoreCase)) - { - metadataValue = specificItemDefinitionLibrary.GetDefaultMetadataValue(metadataName); - } - - return metadataValue; - } - - /// - /// Takes the specified string and expands all item vectors embedded in it. The expansion is done in 2 passes: - /// 1) the first pass expands only the item vectors that refer to the bucketed items - /// 2) the second pass expands out the remaining item vectors using the project items - /// - /// This method leaves the expression escaped. Callers may need to unescape on their own as appropriate. - /// - /// - /// The XML attribute containing the string we're trying to expand here. Solely - /// for the purposes of providing line/column number information when there's an error. - /// expanded string - /// SumedhK - private string ExpandItemsIntoStringLeaveEscaped - ( - string expression, - XmlNode expressionNode - ) - { - // An empty string always expands to empty - if (String.IsNullOrEmpty(expression) || lookup == null) - { - return expression; - } - - if ((options & ExpanderOptions.ExpandItems) != ExpanderOptions.ExpandItems) - { - return expression; - } - - return ItemExpander.ExpandEmbeddedItemVectors(expression, expressionNode, lookup); - } - - /// - /// Attempts to extract the contents of the given item vector. Returns a virtual BuildItemGroup. - /// This method leaves all the items escaped. Caller may need to unescape them himself if appropriate. - /// - /// - /// The XML attribute that contains the thing we're expanding here. (Only needed - /// for the purpose of logging good error messages with line/column information. - /// a virtual BuildItemGroup containing the items resulting from the expression, or null if the expression was invalid. - /// SumedhK;RGoel - internal BuildItemGroup ExpandSingleItemListExpressionIntoItemsLeaveEscaped - ( - string singleItemVectorExpression, - XmlAttribute itemVectorAttribute - ) - { - if (lookup == null) - { - return null; - } - - Match throwAwayMatch; - return this.ExpandSingleItemListExpressionIntoItemsLeaveEscaped(singleItemVectorExpression, itemVectorAttribute, out throwAwayMatch); - } - - /// - /// Attempts to extract the contents of the given item vector. - /// - /// - /// The XML attribute that contains the thing we're expanding here. (Only needed - /// for the purpose of logging good error messages with line/column information. - /// - /// a virtual BuildItemGroup containing the items resulting from the expression, or null if the expression was invalid. - /// SumedhK;RGoel - internal BuildItemGroup ExpandSingleItemListExpressionIntoItemsLeaveEscaped - ( - string singleItemVectorExpression, - XmlAttribute itemVectorAttribute, - out Match itemVectorMatch - ) - { - ErrorUtilities.VerifyThrow(lookup != null, "Need items"); - - if ((options & ExpanderOptions.ExpandItems) != ExpanderOptions.ExpandItems) - { - itemVectorMatch = null; - return null; - } - - return ItemExpander.ItemizeItemVector(singleItemVectorExpression, itemVectorAttribute, lookup, out itemVectorMatch); - } - } - - /// - /// Indicates to an expander what exactly it should expand - /// - [Flags] - internal enum ExpanderOptions - { - Invalid = 0x0, - ExpandProperties = 0x1, - ExpandItems = 0x2, - ExpandPropertiesAndItems = ExpandProperties | ExpandItems, - ExpandMetadata = 0x4, - ExpandPropertiesAndMetadata = ExpandProperties | ExpandMetadata, - ExpandAll = ExpandPropertiesAndItems | ExpandMetadata - }; -} - - diff --git a/src/Deprecated/Engine/Engine/IEngineCallback.cs b/src/Deprecated/Engine/Engine/IEngineCallback.cs deleted file mode 100644 index 46dbdc61083..00000000000 --- a/src/Deprecated/Engine/Engine/IEngineCallback.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; - -namespace Microsoft.Build.BuildEngine -{ - internal interface IEngineCallback - { - /// - /// This method is called by a child engine or node provider to request the parent engine - /// to build a certain part of the tree which is needed to complete an earlier request - /// received from the parent engine. The parent engine is expected to - /// pass back buildResult once the build is completed - /// - void PostBuildRequestsToHost(BuildRequest[] buildRequests); - - /// - /// This method is called to send results to the parent engine in response to an earlier - /// build request. - /// - /// - void PostBuildResultToHost(BuildResult buildResult); - - /// - /// This method is used to send logging events to the parent engine - /// - /// - /// - void PostLoggingMessagesToHost(int nodeId, NodeLoggingEvent[] nodeLoggingEventArray); - - /// - /// Posts the given set of cache entries to the parent engine. - /// - /// - /// - /// - /// - /// - Exception PostCacheEntriesToHost(int nodeId, CacheEntry[] entries, string scopeName, BuildPropertyGroup scopeProperties, string scopeToolsVersion, CacheContentType cacheContentType); - - /// - /// Retrieves the requested set of cache entries from the engine. - /// - /// - /// - /// - /// - /// - /// - CacheEntry[] GetCachedEntriesFromHost(int nodeId, string[] names, string scopeName, BuildPropertyGroup scopeProperties, string scopeToolsVersion, CacheContentType cacheContentType); - - /// - /// This method is called to post current status to the parent - /// - /// The identifer for the node - /// The filled out status structure - /// If true the call will not return until the data has been - /// written out. - void PostStatus(int nodeId, NodeStatus nodeStatus, bool blockUntilSent); - } -} diff --git a/src/Deprecated/Engine/Engine/IItemPropertyGrouping.cs b/src/Deprecated/Engine/Engine/IItemPropertyGrouping.cs deleted file mode 100644 index 9c350f7ae66..00000000000 --- a/src/Deprecated/Engine/Engine/IItemPropertyGrouping.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -namespace Microsoft.Build.BuildEngine -{ - /// - /// Just an empty interface that is "implemented" by BuildPropertyGroup, BuildItemGroup, and Choose. - /// It's just so we can pass these objects around as similar things. The other alternative would - /// have been just to use "Object", but that's even less strongly typed. - /// - /// DavidLe, RGoel - internal interface IItemPropertyGrouping - { - } -} diff --git a/src/Deprecated/Engine/Engine/INodeDescription.cs b/src/Deprecated/Engine/Engine/INodeDescription.cs deleted file mode 100644 index b7498e70226..00000000000 --- a/src/Deprecated/Engine/Engine/INodeDescription.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -namespace Microsoft.Build.BuildEngine -{ - internal interface INodeDescription - { - // UNDONE - } -} diff --git a/src/Deprecated/Engine/Engine/INodeProvider.cs b/src/Deprecated/Engine/Engine/INodeProvider.cs deleted file mode 100644 index 0f5e2d6106a..00000000000 --- a/src/Deprecated/Engine/Engine/INodeProvider.cs +++ /dev/null @@ -1,93 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This interface is used by to provide an engine coordinating a build with access - /// to child engines which can execute parts of the build. The provider is entirely - /// responsible for establishing and maintaining the communication between the parent - /// engine and the child engines. The provider is also responsible for describing the - /// capabilities of the communication channel and the machines on which the child engines - /// are running so that the parent engine can schedule and coordinate the work appropriately - /// - internal interface INodeProvider - { - /// - /// This method is called by the NodeManager at the engine start up to initialize - /// each provider. The configuration string is passed verbatim from the command line - /// to the node provider. - /// - /// Configuration string - /// Interface to use to make engine callbacks - /// Properties to be passed to the child engine - /// Locations to search to toolset paths - /// Directory from which the parent msbuild.exe was originally invoked - void Initialize(string configuration, IEngineCallback engineCallback, BuildPropertyGroup parentGlobalProperties, - ToolsetDefinitionLocations toolsetSearchLocations, string startupDirectory); - - /// - /// This method is called by the NodeManager after the Initialize method to query - /// the provider about number and capability of the nodes that it can make available to - /// the parent engine. - /// - /// Description of nodes that this provider - INodeDescription[] QueryNodeDescriptions(); - - /// - /// This method is called by the NodeManager after it queries the provider via QueryNodeDescription - /// to provider a unique identifier for each node exposed by the provider. This method can only be called - /// after Initialize method has been called. - /// - /// An array of integer tokens which identify each node - void AssignNodeIdentifiers(int[] nodeIdentifiers); - - /// - /// This method is called by the NodeManager to pass in a description of a forwarding logger - /// that should be loaded on the nodes exposed by the provider. This method can only be called - /// after Initialize method has been called. - /// - /// - void RegisterNodeLogger(LoggerDescription loggerDescription); - - /// - /// This method is called by the scheduler to request one of the nodes exposed by - /// this node provider to build a certain part of the tree. The node is expected to - /// pass back buildResult once the build is completed on the remote node - /// - /// The token indicating which node to use - /// Description of the build request - void PostBuildRequestToNode(int nodeIndex, BuildRequest buildRequest); - - /// - /// This method is called by the coordinating engine to send results requested by a - /// node during intermediate evaluation - /// - /// - /// - void PostBuildResultToNode(int nodeIndex, BuildResult buildResult); - - /// - /// This method is called by the coordinating engine to request the current status of the node. - /// This method is used as both a "ping" and to measure the load on the node. - /// - void RequestNodeStatus(int nodeIndex, int requestId); - - /// - /// This method is called by the NodeManager when the parent engine indicates that is no - /// longer needs the node (typically this is done when the parent engine is shutting down) - /// - void ShutdownNodes(Node.NodeShutdownLevel nodeShutdownLevel); - - /// - /// Tell the nodes to use central logging, UNDONE - /// - void UpdateSettings(bool enableCentralizedLogging, bool enableOnlyLogCriticalEvents, bool useBreadFirstTraversal); - - void PostIntrospectorCommand(int nodeIndex, TargetInProgessState child, TargetInProgessState parent); - } -} diff --git a/src/Deprecated/Engine/Engine/ITaskRegistry.cs b/src/Deprecated/Engine/Engine/ITaskRegistry.cs deleted file mode 100644 index 855f498a83c..00000000000 --- a/src/Deprecated/Engine/Engine/ITaskRegistry.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System.Xml; -using Microsoft.Build.BuildEngine.Shared; -using Microsoft.Build.Framework; - -namespace Microsoft.Build.BuildEngine -{ - internal interface ITaskRegistry - { - void RegisterTask(UsingTask usingTask, Expander expander, EngineLoggingServices loggingServices, BuildEventContext context); - bool GetRegisteredTask(string taskName, string taskProjectFile, XmlNode taskNode, bool exactMatchRequired, EngineLoggingServices loggingServices, BuildEventContext context, out LoadedType taskClass); - void Clear(); - } -} diff --git a/src/Deprecated/Engine/Engine/Import.cs b/src/Deprecated/Engine/Engine/Import.cs deleted file mode 100644 index 2db3879914e..00000000000 --- a/src/Deprecated/Engine/Engine/Import.cs +++ /dev/null @@ -1,284 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System.Xml; - -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// This class represents a single Import element in a project file - /// - /// - /// [!WARNING] - /// > This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// LukaszG - public class Import : IItemPropertyGrouping - { - #region Properties - - private Project parentProject = null; - - /// - /// Returns the parent MSBuild Project object. - /// - internal Project ParentProject - { - get { return this.parentProject; } - set { this.parentProject = value; } - } - - private XmlElement importElement = null; - - /// - /// Returns the source XmlElement this Import is based on. - /// - internal XmlElement ImportElement - { - get { return this.importElement; } - } - - private bool importedFromAnotherProject; - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Returns true if this Import came from an imported project - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// LukaszG - public bool IsImported - { - get { return this.importedFromAnotherProject; } - } - - private XmlAttribute projectPathAttribute = null; - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Returns the original import path from the Import element - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// LukaszG - public string ProjectPath - { - get - { - return this.projectPathAttribute?.Value; - } - set - { - ImportElement.SetAttribute(XMakeAttributes.project, value); - ParentProject.MarkProjectAsDirtyForReprocessXml(); - } - } - - /// - /// Internal accessor for the project path XML attribute - /// - /// LukaszG - internal XmlAttribute ProjectPathAttribute - { - get { return this.projectPathAttribute; } - } - - private string evaluatedProjectPath = null; - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Returns the full evaluated import path - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// LukaszG - public string EvaluatedProjectPath - { - get { return this.evaluatedProjectPath; } - } - - private XmlAttribute conditionAttribute = null; - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// The condition string for this UsingTask - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// LukaszG - public string Condition - { - get - { - return this.conditionAttribute?.Value; - } - set - { - ImportElement.SetAttribute(XMakeAttributes.condition, value); - if (conditionAttribute == null) - { - conditionAttribute = ImportElement.Attributes[XMakeAttributes.condition]; - } - ParentProject.MarkProjectAsDirtyForReprocessXml(); - } - } - - /// - /// Internal accessor for the condition XML attribute - /// - internal XmlAttribute ConditionAttribute - { - get { return this.conditionAttribute; } - } - - #endregion - - #region Constructors - - /// - /// Internal constructor - /// - /// - /// - /// LukaszG - internal Import(XmlElement importElement, Project parentProject, bool isImported) - { - this.importedFromAnotherProject = isImported; - - // Make sure the node has been given to us. - ErrorUtilities.VerifyThrow(importElement != null, - "Need an XML node representing the element."); - - this.importElement = importElement; - - // Make sure we have a valid parent Project - ErrorUtilities.VerifyThrow(parentProject != null, - "Need a parent Project object to instantiate an Import."); - - this.parentProject = parentProject; - - // Make sure this really is the node. - ProjectXmlUtilities.VerifyThrowElementName(importElement, XMakeElements.import); - - // Loop through the list of attributes on the element. - foreach (XmlAttribute importAttribute in importElement.Attributes) - { - switch (importAttribute.Name) - { - // The "project" attribute points us at the project file to import. - case XMakeAttributes.project: - // Just store the attribute value at this point. We want to make sure that we evaluate any - // Condition attribute before looking at the Project attribute - if the Condition is going to be false, - // it's legitimate for the value of the Project attribute to be completely invalid. - // For example, should not cause an error - // that the Project attribute is empty. - this.projectPathAttribute = importAttribute; - break; - - // If the "condition" attribute is present, then it must evaluate to "true". - case XMakeAttributes.condition: - this.conditionAttribute = importAttribute; - break; - - // We've come across an attribute in the element that we - // don't recognize. Fail due to invalid project file. - default: - ProjectXmlUtilities.ThrowProjectInvalidAttribute(importAttribute); - break; - } - } - - ProjectErrorUtilities.VerifyThrowInvalidProject((this.projectPathAttribute != null) && (this.projectPathAttribute.Value.Length != 0), - importElement, "MissingRequiredAttribute", - XMakeAttributes.project, XMakeElements.import); - - // Make sure this node has no children. Our schema doesn't support having - // children beneath the element. - if (importElement.HasChildNodes) - { - // Don't put the "if" condition inside the first parameter to - // VerifyThrow..., because we'll get null reference exceptions, - // since the parameter importElement.FirstChild.Name is being - // passed in regardless of whether the condition holds true or not. - ProjectXmlUtilities.ThrowProjectInvalidChildElement(importElement.FirstChild); - } - } - - #endregion - - /// - /// Sets the full evaluated project path for this import. - /// - /// - /// LukaszG - internal void SetEvaluatedProjectPath(string newEvaluatedProjectPath) - { - this.evaluatedProjectPath = newEvaluatedProjectPath; - } - } -} diff --git a/src/Deprecated/Engine/Engine/ImportCollection.cs b/src/Deprecated/Engine/Engine/ImportCollection.cs deleted file mode 100644 index a397a3a33a0..00000000000 --- a/src/Deprecated/Engine/Engine/ImportCollection.cs +++ /dev/null @@ -1,353 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections; - -using Microsoft.Build.BuildEngine.Shared; -using System.Xml; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// This class represents a collection of all Import elements in a given project file - /// - /// - /// [!WARNING] - /// > This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// LukaszG - public class ImportCollection : IEnumerable, ICollection - { - #region Fields - - private Hashtable imports; - private Project parentProject; - - #endregion - - #region Constructors - - /// - /// Constructor exposed to the outside world - /// - /// LukaszG - internal ImportCollection(Project parentProject) - { - // Make sure we have a valid parent Project - ErrorUtilities.VerifyThrow(parentProject != null, - "Need a parent Project object to instantiate an ImportCollection."); - - this.parentProject = parentProject; - - this.imports = new Hashtable(StringComparer.OrdinalIgnoreCase); - } - - #endregion - - #region IEnumerable Members - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// IEnumerable member method for returning the enumerator - /// - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// LukaszG - public IEnumerator GetEnumerator() - { - ErrorUtilities.VerifyThrow(this.imports != null, "ImportCollection's Hashtable not initialized!"); - return this.imports.Values.GetEnumerator(); - } - - #endregion - - #region ICollection Members - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// ICollection member method for copying the contents of this collection into an array - /// - /// - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// LukaszG - public void CopyTo(Array array, int index) - { - ErrorUtilities.VerifyThrow(this.imports != null, "ImportCollection's Dictionary not initialized!"); - this.imports.Values.CopyTo(array, index); - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// ICollection member property for returning the number of items in this collection - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// LukaszG - public int Count - { - get - { - ErrorUtilities.VerifyThrow(this.imports != null, "ImportCollection's Dictionary not initialized!"); - return this.imports.Count; - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// ICollection member property for determining whether this collection is thread-safe - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// LukaszG - public bool IsSynchronized - { - get - { - ErrorUtilities.VerifyThrow(this.imports != null, "ImportCollection's Dictionary not initialized!"); - return this.imports.IsSynchronized; - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// ICollection member property for returning this collection's synchronization object - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// LukaszG - public object SyncRoot - { - get - { - ErrorUtilities.VerifyThrow(this.imports != null, "ImportCollection's Dictionary not initialized!"); - return this.imports.SyncRoot; - } - } - - #endregion - - #region Members - - /// - /// Read-only accessor for the Project instance that this ImportCollection belongs to. - /// - internal Project ParentProject - { - get { return parentProject; } - } - - /// - /// Removes all Imports from this collection. Does not alter the parent project's XML. - /// - /// LukaszG - internal void Clear() - { - ErrorUtilities.VerifyThrow(this.imports != null, "ImportCollection's Hashtable not initialized!"); - this.imports.Clear(); - } - - /// - /// Gets the Import object with the given index - /// - /// - /// - /// LukaszG - internal Import this[string index] - { - get - { - ErrorUtilities.VerifyThrow(this.imports != null, "ImportCollection's Hashtable not initialized!"); - return (Import)this.imports[index]; - } - set - { - this.imports[index] = value; - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Copy the contents of this collection into a strongly typed array - /// - /// - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// LukaszG - public void CopyTo(Import[] array, int index) - { - ErrorUtilities.VerifyThrow(this.imports != null, "ImportCollection's Hashtable not initialized!"); - this.imports.Values.CopyTo(array, index); - } - - /// - /// Adds a new import to the project ,and adds a corresponding <Import> element to the end of the project. - /// - /// Project file to add the import to - /// Condition. If null, no condition is added. - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public void AddNewImport(string projectFile, string condition) - { - ErrorUtilities.VerifyThrowArgumentLength(projectFile, nameof(projectFile)); - - XmlElement projectElement = this.parentProject.ProjectElement; - XmlElement newImportElement = projectElement.OwnerDocument.CreateElement(XMakeElements.import, XMakeAttributes.defaultXmlNamespace); - - if (condition != null) - { - newImportElement.SetAttribute(XMakeAttributes.condition, condition); - } - newImportElement.SetAttribute(XMakeAttributes.project, projectFile); - - projectElement.AppendChild(newImportElement); - - this.parentProject.MarkProjectAsDirtyForReprocessXml(); - } - - /// - /// Removes an import from the project, and removes the corresponding <Import> element - /// from the project's XML. - /// - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// JeffCal - public void RemoveImport - ( - Import importToRemove - ) - { - ErrorUtilities.VerifyThrowArgumentNull(importToRemove, nameof(importToRemove)); - - // Confirm that it's not an imported import. - ErrorUtilities.VerifyThrowInvalidOperation(!importToRemove.IsImported, - "CannotModifyImportedProjects"); - - // Confirm that the import belongs to this project. - ErrorUtilities.VerifyThrowInvalidOperation(importToRemove.ParentProject == this.parentProject, - "IncorrectObjectAssociation", "Import", "Project"); - - // Remove the Xml for the from the . - this.parentProject.ProjectElement.RemoveChild(importToRemove.ImportElement); - - // Remove the import from our hashtable. - this.imports.Remove(importToRemove.EvaluatedProjectPath); - - // Dissociate the import from the parent project. - importToRemove.ParentProject = null; - - // The project file has been modified and needs to be saved and re-evaluated. - this.parentProject.MarkProjectAsDirtyForReprocessXml(); - } - - #endregion - } -} diff --git a/src/Deprecated/Engine/Engine/ImportedProject.cs b/src/Deprecated/Engine/Engine/ImportedProject.cs deleted file mode 100644 index 7bcfc1ba5b2..00000000000 --- a/src/Deprecated/Engine/Engine/ImportedProject.cs +++ /dev/null @@ -1,80 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.IO; -using System.Xml; - -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class represents a project that has been imported into another project with the <Import> tag. - /// - /// SumedhK - internal sealed class ImportedProject - { - /// - /// Creates an instance of this class for the specified project file. - /// - /// SumedhK - /// The imported project file. - /// Thrown when the project file contains invalid XML. - internal ImportedProject(string projectFile) - { - projectXml = new XmlDocument(); - // NOTE: XmlDocument.Load() may throw an XmlException - projectXml.Load(projectFile); - - FileInfo projectFileInfo = new FileInfo(projectFile); - lastWriteTime = projectFileInfo.LastWriteTime; - fileSize = projectFileInfo.Length; - } - - /// - /// Gets the XML for the imported project. - /// - /// SumedhK - /// The parsed XML from the imported project file. - internal XmlDocument Xml - { - get - { - return projectXml; - } - } - - /// - /// Checks if the imported project file has changed on disk. - /// - /// - /// PERF NOTE: This method deliberately requires the project file path to be passed in, to avoid caching the path string - /// as part of this class. Alternatively, the path could be retrieved from the XmlDocument.BaseURI property (see the - /// method), but again that would be unnecessary work, since the path is - /// available to the calling code. - /// - /// SumedhK - /// The imported project file. - /// true, if project file has changed on disk - internal bool HasChangedOnDisk(string projectFile) - { - FileInfo projectFileInfo = new FileInfo(projectFile); - - return (lastWriteTime != projectFileInfo.LastWriteTime) || (fileSize != projectFileInfo.Length); - } - - // the XML for the imported project - private XmlDocument projectXml; - - // the last time the imported project file was modified - private DateTime lastWriteTime; - - // the size of the imported project file - private long fileSize; - } -} diff --git a/src/Deprecated/Engine/Engine/IntrinsicFunctions.cs b/src/Deprecated/Engine/Engine/IntrinsicFunctions.cs deleted file mode 100644 index 53bb173c271..00000000000 --- a/src/Deprecated/Engine/Engine/IntrinsicFunctions.cs +++ /dev/null @@ -1,393 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections.Generic; -using Microsoft.Build.BuildEngine.Shared; -using Microsoft.Win32; -using System.IO; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// The Intrinsic class provides static methods that can be accessed from MSBuild's - /// property functions using $([MSBuild]::Function(x,y)) - /// - internal static class IntrinsicFunctions - { - /// - /// Add two doubles - /// - internal static double Add(double a, double b) - { - return a + b; - } - - /// - /// Add two longs - /// - internal static long Add(long a, long b) - { - return a + b; - } - - /// - /// Subtract two doubles - /// - internal static double Subtract(double a, double b) - { - return a - b; - } - - /// - /// Subtract two longs - /// - internal static long Subtract(long a, long b) - { - return a - b; - } - - /// - /// Multiply two doubles - /// - internal static double Multiply(double a, double b) - { - return a * b; - } - - /// - /// Multiply two longs - /// - internal static long Multiply(long a, long b) - { - return a * b; - } - - /// - /// Divide two doubles - /// - internal static double Divide(double a, double b) - { - return a / b; - } - - /// - /// Divide two longs - /// - internal static long Divide(long a, long b) - { - return a / b; - } - - /// - /// Modulo two doubles - /// - internal static double Modulo(double a, double b) - { - return a % b; - } - - /// - /// Modulo two longs - /// - internal static long Modulo(long a, long b) - { - return a % b; - } - - /// - /// Escape the string according to MSBuild's escaping rules - /// - internal static string Escape(string unescaped) - { - return EscapingUtilities.Escape(unescaped); - } - - /// - /// Unescape the string according to MSBuild's escaping rules - /// - internal static string Unescape(string escaped) - { - return EscapingUtilities.UnescapeAll(escaped); - } - - /// - /// Perform a bitwise OR on the first and second (first | second) - /// - internal static int BitwiseOr(int first, int second) - { - return first | second; - } - - /// - /// Perform a bitwise AND on the first and second (first & second) - /// - internal static int BitwiseAnd(int first, int second) - { - return first & second; - } - - /// - /// Perform a bitwise XOR on the first and second (first ^ second) - /// - internal static int BitwiseXor(int first, int second) - { - return first ^ second; - } - - /// - /// Perform a bitwise NOT on the first and second (~first) - /// - internal static int BitwiseNot(int first) - { - return ~first; - } - - /// - /// Get the value of the registry key and value, default value is null - /// - internal static object GetRegistryValue(string keyName, string valueName) - { - return Registry.GetValue(keyName, valueName, null /* null to match the $(Regsitry:XYZ@ZBC) behaviour */); - } - - /// - /// Get the value of the registry key and value - /// - internal static object GetRegistryValue(string keyName, string valueName, object defaultValue) - { - return Registry.GetValue(keyName, valueName, defaultValue); - } - - /// - /// Get the value of the registry key from one of the RegistryView's specified - /// - internal static object GetRegistryValueFromView(string keyName, string valueName, object defaultValue, params object[] views) - { - string subKeyName; - - // We will take on handing of default value - // A we need to act on the null return from the GetValue call below - // so we can keep searching other registry views - object result = defaultValue; - - // If we haven't been passed any views, then we'll just use the default view - if (views == null || views.Length == 0) - { - views = new object[] { RegistryView.Default }; - } - - foreach (object viewObject in views) - { - string viewAsString = viewObject as string; - - if (viewAsString != null) - { - string typeLeafName = typeof(RegistryView).Name + "."; - string typeFullName = typeof(RegistryView).FullName + "."; - - // We'll allow the user to specify the leaf or full type name on the RegistryView enum - viewAsString = viewAsString.Replace(typeFullName, "").Replace(typeLeafName, ""); - - // This may throw - and that's fine as the user will receive a controlled version - // of that error. - RegistryView view = (RegistryView)Enum.Parse(typeof(RegistryView), viewAsString, true); - -#pragma warning disable CA2000 // Dispose objects before losing scope is suppressed as a false positive. - using (RegistryKey key = GetBaseKeyFromKeyName(keyName, view, out subKeyName)) - { - if (key != null) - { - using (RegistryKey subKey = key.OpenSubKey(subKeyName, false)) - { - // If we managed to retrieve the subkey, then move onto locating the value - if (subKey != null) - { - result = subKey.GetValue(valueName); - } - - // We've found a value, so stop looking - if (result != null) - { - break; - } - } - } - } -#pragma warning restore CA2000 // Dispose objects before losing scope - } - } - - // We will have either found a result or defaultValue if one wasn't found at this point - return result; - } - - /// - /// Given the absolute location of a file, and a disc location, returns relative file path to that disk location. - /// Throws UriFormatException. - /// - /// - /// The base path we want to relativize to. Must be absolute. - /// Should not include a filename as the last segment will be interpreted as a directory. - /// - /// - /// The path we need to make relative to basePath. The path can be either absolute path or a relative path in which case it is relative to the base path. - /// If the path cannot be made relative to the base path (for example, it is on another drive), it is returned verbatim. - /// - /// relative path (can be the full path) - internal static string MakeRelative(string basePath, string path) - { - string result = FileUtilities.MakeRelative(basePath, path); - - return result; - } - - /// - /// Locate a file in either the directory specified or a location in the - /// direcorty structure above that directory. - /// - internal static string GetDirectoryNameOfFileAbove(string startingDirectory, string fileName) - { - // Canonicalize our starting location - string lookInDirectory = Path.GetFullPath(startingDirectory); - - do - { - // Construct the path that we will use to test against - string possibleFileDirectory = Path.Combine(lookInDirectory, fileName); - - // If we successfully locate the file in the directory that we're - // looking in, simply return that location. Otherwise we'll - // keep moving up the tree. - if (File.Exists(possibleFileDirectory)) - { - // We've found the file, return the directory we found it in - return lookInDirectory; - } - else - { - // GetDirectoryName will return null when we reach the root - // terminating our search - lookInDirectory = Path.GetDirectoryName(lookInDirectory); - } - } - while (lookInDirectory != null); - - // When we didn't find the location, then return an empty string - return String.Empty; - } - - /// - /// Return the string in parameter 'defaultValue' only if parameter 'conditionValue' is empty - /// else, return the value conditionValue - /// - internal static string ValueOrDefault(string conditionValue, string defaultValue) - { - if (String.IsNullOrEmpty(conditionValue)) - { - return defaultValue; - } - else - { - return conditionValue; - } - } - - /// - /// Returns true if a task host exists that can service the requested runtime and architecture - /// values, and false otherwise. - /// - /// - /// The old engine ignores the concept of the task host entirely, so it shouldn't really - /// matter what we return. So we return "true" because regardless of the task host parameters, - /// the task will be successfully run (in-proc). - /// - internal static bool DoesTaskHostExist(string runtime, string architecture) - { - return true; - } - - #region Debug only intrinsics - - /// - /// returns if the string contains escaped wildcards - /// - internal static List __GetListTest() - { - return new List { "A", "B", "C", "D" }; - } - - #endregion - - /// - /// Following function will parse a keyName and returns the basekey for it. - /// It will also store the subkey name in the out parameter. - /// If the keyName is not valid, we will throw ArgumentException. - /// The return value shouldn't be null. - /// Taken from: \ndp\clr\src\BCL\Microsoft\Win32\Registry.cs - /// - private static RegistryKey GetBaseKeyFromKeyName(string keyName, RegistryView view, out string subKeyName) - { - if (keyName == null) - { - throw new ArgumentNullException(nameof(keyName)); - } - - string basekeyName; - int i = keyName.IndexOf('\\'); - if (i != -1) - { - basekeyName = keyName.Substring(0, i).ToUpper(System.Globalization.CultureInfo.InvariantCulture); - } - else - { - basekeyName = keyName.ToUpper(System.Globalization.CultureInfo.InvariantCulture); - } - - RegistryKey basekey = null; - - switch (basekeyName) - { - case "HKEY_CURRENT_USER": - basekey = RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, view); - break; - case "HKEY_LOCAL_MACHINE": - basekey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, view); - break; - case "HKEY_CLASSES_ROOT": - basekey = RegistryKey.OpenBaseKey(RegistryHive.ClassesRoot, view); - break; - case "HKEY_USERS": - basekey = RegistryKey.OpenBaseKey(RegistryHive.Users, view); - break; - case "HKEY_PERFORMANCE_DATA": - basekey = RegistryKey.OpenBaseKey(RegistryHive.PerformanceData, view); - break; - case "HKEY_CURRENT_CONFIG": - basekey = RegistryKey.OpenBaseKey(RegistryHive.CurrentConfig, view); - break; - case "HKEY_DYN_DATA": - basekey = RegistryKey.OpenBaseKey(RegistryHive.DynData, view); - break; - default: - ErrorUtilities.ThrowArgument(keyName); - break; - } - - if (i == -1 || i == keyName.Length) - { - subKeyName = string.Empty; - } - else - { - subKeyName = keyName.Substring(i + 1, keyName.Length - i - 1); - } - - return basekey; - } - } -} diff --git a/src/Deprecated/Engine/Engine/ItemBucket.cs b/src/Deprecated/Engine/Engine/ItemBucket.cs deleted file mode 100644 index 708426b1251..00000000000 --- a/src/Deprecated/Engine/Engine/ItemBucket.cs +++ /dev/null @@ -1,190 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections; -using System.Collections.Generic; - -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class represents a collection of items that are homogeneous w.r.t. - /// a certain set of metadata. - /// - /// SumedhK - internal sealed class ItemBucket : IComparable - { - #region Member data - - /// - /// This single object contains all of the data necessary to perform expansion of metadata, properties, - /// and items. - /// - private Expander expander; - - /// - /// The items for this bucket. - /// - private Lookup lookup; - - /// - /// When buckets are being created for batching purposes, this indicates which order the - /// buckets were created in, so that the target/task being batched gets called with the items - /// in the same order as they were declared in the project file. For example, the first - /// bucket created gets bucketSequenceNumber=0, the second bucket created gets - /// bucketSequenceNumber=1, etc. - /// - private int bucketSequenceNumber; - - #endregion - - #region Constructors - - /// - /// Private default constructor disallows parameterless instantiation. - /// - /// SumedhK - private ItemBucket() - { - // do nothing - } - - /// - /// Creates an instance of this class using the given bucket data. - /// - /// Item types being batched on: null indicates no batching is occurring - /// Hashtable of item metadata values: null indicates no batching is occurring - internal ItemBucket - ( - ICollection itemNames, - Dictionary itemMetadata, - Lookup lookup, - int bucketSequenceNumber - ) - { - ErrorUtilities.VerifyThrow(lookup != null, "Need lookup."); - - // Create our own lookup just for this bucket - this.lookup = lookup.Clone(); - - // Push down the items, so that item changes in this batch are not visible to parallel batches - this.lookup.EnterScope(); - - // Add empty item groups for each of the item names, so that (unless items are added to this bucket) there are - // no item types visible in this bucket among the item types being batched on - if (itemNames != null) - { - foreach (string name in itemNames) - { - this.lookup.PopulateWithItems(name, new BuildItemGroup()); - } - } - - this.expander = new Expander(this.lookup.ReadOnlyLookup, itemMetadata); - this.bucketSequenceNumber = bucketSequenceNumber; - } - - #endregion - - #region Comparison methods - - /// - /// Compares this item bucket against the given one. The comparison is - /// solely based on the values of the item metadata in the buckets. - /// - /// SumedhK - /// - /// - /// -1, if this bucket is "less than" the second one - /// 0, if this bucket is equivalent to the second one - /// +1, if this bucket is "greater than" the second one - /// - public int CompareTo(object obj) - { - return HashTableUtility.Compare(this.Expander.ItemMetadata, ((ItemBucket)obj).Expander.ItemMetadata); - } - - /// - /// Constructs a token bucket object that can be compared against other - /// buckets. This dummy bucket is a patently invalid bucket, and cannot - /// be used for any other operations besides comparison. - /// - /// - /// PERF NOTE: A dummy bucket is intentionally very light-weight, and it - /// allocates a minimum of memory compared to a real bucket. - /// - /// SumedhK - /// - /// An item bucket that is invalid for everything except comparisons. - internal static ItemBucket GetDummyBucketForComparisons(Dictionary itemMetadata) - { - ItemBucket bucket = new ItemBucket(); - bucket.expander = new Expander((ReadOnlyLookup)null, itemMetadata); - - return bucket; - } - - #endregion - - #region Properties - - /// - /// Returns the object that knows how to handle all kinds of expansion for this bucket. - /// - /// RGoel - internal Expander Expander - { - get - { - return this.expander; - } - } - - /// - /// When buckets are being created for batching purposes, this indicates which order the - /// buckets were created in, so that the target/task being batched gets called with the items - /// in the same order as they were declared in the project file. For example, the first - /// bucket created gets bucketSequenceNumber=0, the second bucket created gets - /// bucketSequenceNumber=1, etc. - /// - /// RGoel - internal int BucketSequenceNumber - { - get - { - return this.bucketSequenceNumber; - } - } - - /// - /// The items for this bucket. - /// - internal Lookup Lookup - { - get - { - return this.lookup; - } - } - - #endregion - - #region Methods - - /// - /// Adds a new item to this bucket. - /// - internal void AddItem(BuildItem item) - { - this.lookup.PopulateWithItem(item); - } - - #endregion - } -} diff --git a/src/Deprecated/Engine/Engine/Node.cs b/src/Deprecated/Engine/Engine/Node.cs deleted file mode 100644 index 25b5959951a..00000000000 --- a/src/Deprecated/Engine/Engine/Node.cs +++ /dev/null @@ -1,684 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections; -using System.Collections.Generic; -using System.IO; -using System.Threading; - -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class is a representation of a possible remote work item processing subsystem. - /// Currently wrapped by LocalNode. - /// Owns the Engine on a child node. - /// - internal class Node - { - #region Constructors - /// - /// Initialize the node with the id and the callback object - /// - internal Node - ( - int nodeId, - LoggerDescription[] nodeLoggers, - IEngineCallback parentCallback, - BuildPropertyGroup parentGlobalProperties, - ToolsetDefinitionLocations toolsetSearchLocations, - string parentStartupDirectory - ) - { - this.nodeId = nodeId; - this.parentCallback = parentCallback; - - this.exitNodeEvent = new ManualResetEvent(false); - this.buildRequests = new Queue(); - - this.requestToLocalIdMapping = new Hashtable(); - this.lastRequestIdUsed = 0; - - this.centralizedLogging = false; - this.nodeLoggers = nodeLoggers; - - this.localEngine = null; - this.launchedEngineLoopThread = false; - this.nodeShutdown = false; - this.parentGlobalProperties = parentGlobalProperties; - this.toolsetSearchLocations = toolsetSearchLocations; - this.parentStartupDirectory = parentStartupDirectory; - } - #endregion - - #region Properties - internal Introspector Introspector - { - get - { - if (localEngine != null) - { - return localEngine.Introspector; - } - return null; - } - } - /// - /// This property returns 0 if profiling is not enabled and otherwise returns the - /// total time spent inside user task code - /// - internal int TotalTaskTime - { - get - { - return totalTaskTime; - } - } - - internal int NodeId - { - get { return nodeId; } - } - #endregion - - #region Method used to call from local engine to the host (and parent engine) - - /// - /// This method posts outputs of a build to the node that made the request - /// - /// - internal void PostBuildResultToHost(BuildResult buildResult) - { - try - { - outProcLoggingService.ProcessPostedLoggingEvents(); - parentCallback.PostBuildResultToHost(buildResult); - } - catch (Exception e) - { - ReportUnhandledError(e); - } - } - - internal void PostBuildRequestToHost(BuildRequest currentRequest) - { - // Since this request is going back to the host the local node should not have a project object for it - ErrorUtilities.VerifyThrow(currentRequest.ProjectToBuild == null, "Should not have a project object"); - // Add the request to the mapping hashtable so that we can recognize the outputs - CacheScope cacheScope = localEngine.CacheManager.GetCacheScope(currentRequest.ProjectFileName, currentRequest.GlobalProperties, currentRequest.ToolsetVersion, CacheContentType.BuildResults); - NodeRequestMapping nodeRequestMapping = - new NodeRequestMapping(currentRequest.HandleId, currentRequest.RequestId, cacheScope); - lock (requestToLocalIdMapping) - { - requestToLocalIdMapping.Add(lastRequestIdUsed, nodeRequestMapping); - // Keep the request id local for this node - currentRequest.RequestId = lastRequestIdUsed; - lastRequestIdUsed++; - } - - // Find the original external request that caused us to run this task - TaskExecutionContext taskExecutionContext = localEngine.EngineCallback.GetTaskContextFromHandleId(currentRequest.HandleId); - while (!taskExecutionContext.BuildContext.BuildRequest.IsExternalRequest) - { - ErrorUtilities.VerifyThrow(taskExecutionContext.BuildContext.BuildRequest.IsGeneratedRequest, - "Must be a generated request"); - - taskExecutionContext = - localEngine.EngineCallback.GetTaskContextFromHandleId(taskExecutionContext.BuildContext.BuildRequest.HandleId); - } - - //Modify the request with the data that is expected by the parent engine - currentRequest.HandleId = taskExecutionContext.BuildContext.BuildRequest.HandleId; - currentRequest.NodeIndex = taskExecutionContext.BuildContext.BuildRequest.NodeIndex; - - try - { - outProcLoggingService.ProcessPostedLoggingEvents(); - parentCallback.PostBuildRequestsToHost(new BuildRequest[] { currentRequest }); - } - catch (Exception e) - { - ReportUnhandledError(e); - } - } - - /// - /// Posts the given set of cache entries to the parent engine. - /// - /// - /// - /// - internal Exception PostCacheEntriesToHost(CacheEntry[] entries, string scopeName, BuildPropertyGroup scopeProperties, string scopeToolsVersion, CacheContentType cacheContentType) - { - try - { - return parentCallback.PostCacheEntriesToHost(this.nodeId /* ignored */, entries, scopeName, scopeProperties, scopeToolsVersion, cacheContentType); - } - catch (Exception e) - { - ReportUnhandledError(e); - return null; - } - } - - /// - /// Retrieves the requested set of cache entries from the engine. - /// - /// - /// - /// - /// - internal CacheEntry[] GetCachedEntriesFromHost(string[] names, string scopeName, BuildPropertyGroup scopeProperties, string scopeToolsVersion, CacheContentType cacheContentType) - { - try - { - return parentCallback.GetCachedEntriesFromHost(this.nodeId /* ignored */, names, scopeName, scopeProperties, scopeToolsVersion, cacheContentType); - } - catch (Exception e) - { - ReportUnhandledError(e); - return new CacheEntry[0]; - } - } - - internal void PostLoggingMessagesToHost(NodeLoggingEvent[] nodeLoggingEvents) - { - try - { - parentCallback.PostLoggingMessagesToHost(nodeId, nodeLoggingEvents); - } - catch (Exception e) - { - ReportUnhandledError(e); - } - } - - internal void PostStatus(NodeStatus nodeStatus, bool blockUntilSent) - { - try - { - PostStatusThrow(nodeStatus, blockUntilSent); - } - catch (Exception e) - { - ReportUnhandledError(e); - } - } - - /// - /// A variation of PostStatus that throws instead of calling ReportUnhandledError - /// if there's a problem. This allows ReportUnhandledError itself to post status - /// without the possibility of a loop. - /// - internal void PostStatusThrow(NodeStatus nodeStatus, bool blockUntilSent) - { - parentCallback.PostStatus(nodeId, nodeStatus, blockUntilSent); - } - #endregion - - #region Methods called from the host (and parent engine) - - /// - /// This method lets the host request an evaluation of a build request. A local engine - /// will be created if necessary. - /// - internal void PostBuildRequest - ( - BuildRequest buildRequest - ) - { - buildRequest.RestoreNonSerializedDefaults(); - buildRequest.NodeIndex = EngineCallback.inProcNode; - // A request has come from the parent engine, so mark it as external - buildRequest.IsExternalRequest = true; - - if (localEngine == null) - { - // Check if an an engine has been allocated and if not start the thread that will do that - lock (buildRequests) - { - if (localEngine == null) - { - if (!launchedEngineLoopThread) - { - launchedEngineLoopThread = true; - ThreadStart threadState = new ThreadStart(this.NodeLocalEngineLoop); - Thread taskThread = new Thread(threadState); - taskThread.Name = "MSBuild Child Engine"; - taskThread.SetApartmentState(ApartmentState.STA); - taskThread.Start(); - } - buildRequests.Enqueue(buildRequest); - } - else - { - localEngine.PostBuildRequest(buildRequest); - } - } - } - else - { - if (!buildInProgress) - { - buildInProgress = true; - // If there are forwarding loggers registered - generate a custom build started - if (nodeLoggers.Length > 0) - { - localEngine.LoggingServices.LogBuildStarted(EngineLoggingServicesInProc.CENTRAL_ENGINE_EVENTSOURCE); - localEngine.LoggingServices.ProcessPostedLoggingEvents(); - } - } - localEngine.PostBuildRequest(buildRequest); - } - } - - /// - /// This method lets the engine provide node with results of an evaluation it was waiting on. - /// - internal void PostBuildResult(BuildResult buildResult) - { - ErrorUtilities.VerifyThrow(localEngine != null, "Local engine should be initialized"); - - // Figure out the local handle id - NodeRequestMapping nodeRequestMapping = null; - try - { - lock (requestToLocalIdMapping) - { - nodeRequestMapping = (NodeRequestMapping)requestToLocalIdMapping[buildResult.RequestId]; - requestToLocalIdMapping.Remove(buildResult.RequestId); - } - - if (Engine.debugMode) - { - Console.WriteLine(nodeId + ": Got result for Request Id " + buildResult.RequestId); - Console.WriteLine(nodeId + ": Received result for HandleId " + buildResult.HandleId + ":" + buildResult.RequestId + " mapped to " + nodeRequestMapping.HandleId + ":" + nodeRequestMapping.RequestId); - } - - buildResult.HandleId = nodeRequestMapping.HandleId; - buildResult.RequestId = nodeRequestMapping.RequestId; - nodeRequestMapping.AddResultToCache(buildResult); - - // posts the result to the inproc node - localEngine.Router.PostDoneNotice(0, buildResult); - } - catch (Exception ex) - { - ReportUnhandledError(ex); - } - } - - /// - /// Causes the node to safely shutdown and exit - /// - internal void ShutdownNode(NodeShutdownLevel shutdownLevel) - { - if (shutdownLevel == NodeShutdownLevel.BuildCompleteSuccess || - shutdownLevel == NodeShutdownLevel.BuildCompleteFailure) - { - if (Engine.debugMode) - { - Console.WriteLine("Node.Shutdown: NodeId " + nodeId + ": Clearing engine state and intern table ready for node re-use."); - } - - if (localEngine != null) - { - localEngine.EndingEngineExecution - (shutdownLevel == NodeShutdownLevel.BuildCompleteSuccess ? true : false, false); - localEngine.ResetPerBuildDataStructures(); - outProcLoggingService.ProcessPostedLoggingEvents(); - buildInProgress = false; - } - - // Clear the static table of interned strings - BuildProperty.ClearInternTable(); - } - else - { - if (Engine.debugMode) - { - Console.WriteLine("Node.Shutdown: NodeId " + nodeId + ": Shutting down node due to error."); - } - - // The thread starting the build loop will acquire this lock before starting the loop - // in order to read the build requests. Acquiring it here ensures that build loop doesn't - // get started between the check for null and setting of the flag - lock (buildRequests) - { - if (localEngine == null) - { - nodeShutdown = true; - } - } - - if (localEngine != null) - { - // Indicate to the child engine that we need to exit - localEngine.SetEngineAbortTo(true); - // Wait for the exit event which will be raised once the child engine exits - exitNodeEvent.WaitOne(); - } - } - } - - /// - /// This function is used to update the settings of the engine running on the node - /// - internal void UpdateNodeSettings - ( - bool shouldLogOnlyCriticalEvents, - bool enableCentralizedLogging, - bool useBreadthFirstTraversal - ) - { - this.logOnlyCriticalEvents = shouldLogOnlyCriticalEvents; - this.centralizedLogging = enableCentralizedLogging; - this.useBreadthFirstTraversal = useBreadthFirstTraversal; - - if (localEngine != null) - { - localEngine.LoggingServices.OnlyLogCriticalEvents = this.logOnlyCriticalEvents; - localEngine.PostEngineCommand(new ChangeTraversalTypeCommand(useBreadthFirstTraversal, true)); - } - } - - /// - /// The coordinating engine is requesting status - /// - internal void RequestStatus(int requestId) - { - // Check if the status has been requested before the local - // engine has been started. - if (localEngine == null) - { - NodeStatus nodeStatus = null; - - lock (buildRequests) - { - nodeStatus = new NodeStatus(requestId, true, buildRequests.Count, 0, 0, false); - } - - parentCallback.PostStatus(nodeId, nodeStatus, false); - } - else - { - // Since the local engine has been started - ask it for status - RequestStatusEngineCommand requestStatus = new RequestStatusEngineCommand(requestId); - localEngine.PostEngineCommand(requestStatus); - } - } - - /// - /// This function can be used by the node provider to report a failure which doesn't prevent further - /// communication with the parent node. The node will attempt to notify the parent of the failure, - /// send all outstanding logging events and shutdown. - /// - /// - /// Throws exception (with nested original exception) if reporting to parent fails. - internal void ReportUnhandledError(Exception originalException) - { - NodeStatus nodeStatus = new NodeStatus(originalException); - - if (Engine.debugMode) - { - Console.WriteLine("Node.ReportUnhandledError: " + originalException.Message); - } - - try - { - try - { - PostStatusThrow(nodeStatus, true /* wait for the message to be sent before returning */); - } - catch (Exception ex) - { - // If an error occurred while trying to send the original exception to the parent - // rethrow the original exception - string message = ResourceUtilities.FormatResourceString("FatalErrorOnChildNode", nodeId, ex.Message); - - ErrorUtilities.LaunchMsBuildDebuggerOnFatalError(); - - throw new Exception(message, originalException); - } - } - finally - { - // Makesure we write the exception to a file so even if something goes wrong with the logging or transfer to the parent - // then we will atleast get the message on disk. - LocalNode.DumpExceptionToFile(originalException); - } - - localEngine?.Shutdown(); - } - - /// - /// This method can be used by the node provider to report a fatal communication error, after - /// which further communication with the parent node is no longer possible. The node provider - /// can optionally provide a stream to which the current node state will be logged in order - /// to assist with debugging of the problem. - /// - /// - /// - /// Re-throws exception passed in - internal void ReportFatalCommunicationError(Exception originalException, TextWriter loggingStream) - { - loggingStream?.WriteLine(originalException.ToString()); - - string message = ResourceUtilities.FormatResourceString("FatalErrorOnChildNode", nodeId, originalException.Message); - - ErrorUtilities.LaunchMsBuildDebuggerOnFatalError(); - - throw new Exception(message, originalException); - } - - #endregion - - #region Thread procedure for Engine BuildLoop - - private void NodeLocalEngineLoop() - { - buildInProgress = true; - - // Create a logging service for this build request - localEngine = - new Engine(parentGlobalProperties, toolsetSearchLocations, 1 /* cpus */, true /* child node */, this.nodeId, parentStartupDirectory, null); - localEngine.Router.ChildMode = true; - localEngine.Router.ParentNode = this; - - this.outProcLoggingService = new EngineLoggingServicesOutProc(this, localEngine.FlushRequestEvent); - - if (nodeLoggers.Length != 0) - { - foreach (LoggerDescription loggerDescription in nodeLoggers) - { - IForwardingLogger newLogger = null; - bool exitedDueToError = true; - try - { - newLogger = loggerDescription.CreateForwardingLogger(); - // Check if the class was not found in the assembly - if (newLogger == null) - { - InternalLoggerException.Throw(null, null, "FatalErrorWhileInitializingLogger", true, loggerDescription.Name); - } - newLogger.Verbosity = loggerDescription.Verbosity; - newLogger.Parameters = loggerDescription.LoggerSwitchParameters; - newLogger.NodeId = nodeId; - EventRedirector newRedirector = new EventRedirector(loggerDescription.LoggerId, outProcLoggingService); - newLogger.BuildEventRedirector = newRedirector; - exitedDueToError = false; - } - // Polite logger failure - catch (LoggerException e) - { - ReportUnhandledError(e); - } - // Logger class was not found - catch (InternalLoggerException e) - { - ReportUnhandledError(e); - } - catch (Exception e) - { - // Wrap the exception in a InternalLoggerException and send it to the parent node - string errorCode; - string helpKeyword; - string message = ResourceUtilities.FormatResourceString(out errorCode, out helpKeyword, "FatalErrorWhileInitializingLogger", loggerDescription.Name); - ReportUnhandledError(new InternalLoggerException(message, e, null, errorCode, helpKeyword, true)); - } - - // If there was a failure registering loggers, null out the engine pointer - if (exitedDueToError) - { - localEngine = null; - return; - } - - localEngine.RegisterLogger(newLogger); - } - - localEngine.ExternalLoggingServices = outProcLoggingService; - } - - // Hook up logging service to forward all events to the central engine if necessary - if (centralizedLogging) - { - if (nodeLoggers.Length != 0) - { - localEngine.LoggingServices.ForwardingService = outProcLoggingService; - localEngine.ExternalLoggingServices = outProcLoggingService; - } - else - { - localEngine.LoggingServices = outProcLoggingService; - } - } - - localEngine.LoggingServices.OnlyLogCriticalEvents = this.logOnlyCriticalEvents; - - if (!useBreadthFirstTraversal) - { - localEngine.PostEngineCommand(new ChangeTraversalTypeCommand(useBreadthFirstTraversal, true)); - } - - // Post all the requests that passed in while the engine was being constructed - // into the engine queue - lock (buildRequests) - { - while (buildRequests.Count != 0) - { - BuildRequest buildRequest = buildRequests.Dequeue(); - localEngine.PostBuildRequest(buildRequest); - } - } - - try - { - // If there are forwarding loggers registered - generate a custom build started - if (nodeLoggers.Length > 0) - { - localEngine.LoggingServices.LogBuildStarted(EngineLoggingServicesInProc.CENTRAL_ENGINE_EVENTSOURCE); - localEngine.LoggingServices.ProcessPostedLoggingEvents(); - } - - // Trigger the actual build if shutdown was not called while the engine was being initialized - if (!nodeShutdown) - { - localEngine.EngineBuildLoop(null); - } - } - catch (Exception e) - { - // Unhandled exception during execution. The node has to be shutdown. - ReportUnhandledError(e); - } - finally - { - if (localEngine != null) - { - // Flush all the messages associated before shutting down - localEngine.LoggingServices.ProcessPostedLoggingEvents(); - - NodeManager nodeManager = localEngine.NodeManager; - - // If the local engine is already shutting down, the TEM will be nulled out - if (nodeManager.TaskExecutionModule != null && nodeManager.TaskExecutionModule.TaskExecutionTime != 0) - { - TimeSpan taskTimeSpan = new TimeSpan(localEngine.NodeManager.TaskExecutionModule.TaskExecutionTime); - totalTaskTime = (int)taskTimeSpan.TotalMilliseconds; - } - localEngine.Shutdown(); - } - // Flush all the events to the parent engine - outProcLoggingService.ProcessPostedLoggingEvents(); - // Indicate that the node logger thread should exit - exitNodeEvent.Set(); - } - } - - #endregion - - #region Member data - // Interface provided by the host that is used to communicate with the parent engine - private IEngineCallback parentCallback; - // Id of this node - private int nodeId; - // This event is used to communicate between the thread calling shutdown method and the thread running the Engine.BuildLoop. - private ManualResetEvent exitNodeEvent; - // The engine being used to process build requests - private Engine localEngine; - // The queue of build requests arriving from the parent. The queue is needed to buffer the requests while the local engine is - // being created and initialized - private Queue buildRequests; - // This flag is true if the thread that will be running the Engine.BuildLoop has been launched - private bool launchedEngineLoopThread; - // The logging service that is used to send the event to the parent engine. It maybe hooked up directly to the local engine or cascaded with - // another logging service depending on configuration - private EngineLoggingServicesOutProc outProcLoggingService; - private Hashtable requestToLocalIdMapping; - private int lastRequestIdUsed; - - // Initializes to false by default - private bool logOnlyCriticalEvents; - private bool centralizedLogging; - private bool useBreadthFirstTraversal; - private LoggerDescription[] nodeLoggers; - private bool buildInProgress; - private bool nodeShutdown; - private BuildPropertyGroup parentGlobalProperties; - private ToolsetDefinitionLocations toolsetSearchLocations; - private string parentStartupDirectory; - private int totalTaskTime; - - #endregion - - #region Enums - - internal enum NodeShutdownLevel - { - /// - /// Notify the engine that a build has completed an reset all data structures - /// that should be reset between builds - /// - BuildCompleteSuccess = 0, - BuildCompleteFailure = 1, - /// - /// Wait for in progress operations to finish before returning - /// - PoliteShutdown = 2, - /// - /// Cancel all in progress operations and return - /// - ErrorShutdown = 3 - } - - #endregion - } -} diff --git a/src/Deprecated/Engine/Engine/NodeLoggingEvent.cs b/src/Deprecated/Engine/Engine/NodeLoggingEvent.cs deleted file mode 100644 index c4c4462c63c..00000000000 --- a/src/Deprecated/Engine/Engine/NodeLoggingEvent.cs +++ /dev/null @@ -1,344 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.IO; -using System.Reflection; -using System.Runtime.Serialization.Formatters.Binary; -using System.Collections; -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class wraps BuildEventArgs and used for sending BuildEventArgs across the node boundary - /// - internal class NodeLoggingEvent - { - // Enumeration of logging event types, this is used to recreate the correct type on deserialization - private enum LoggingEventType - { - CustomEvent = 0, - BuildErrorEvent = 1, - BuildFinishedEvent = 2, - BuildMessageEvent = 3, - BuildStartedEvent = 4, - BuildWarningEvent = 5, - ProjectFinishedEvent = 6, - ProjectStartedEvent = 7, - TargetStartedEvent = 8, - TargetFinishedEvent = 9, - TaskStartedEvent = 10, - TaskFinishedEvent = 11, - TaskCommandLineEvent = 12 - } - - #region Constructors - /// - /// This new constructor is required for custom serialization - /// - internal NodeLoggingEvent() - { - } - /// - /// Create an instance of this class wrapping given BuildEventArgs - /// - internal NodeLoggingEvent(BuildEventArgs eventToLog) - { - this.e = eventToLog; - } - #endregion - - #region Properties - /// - /// The BuildEventArgs wrapped by this class - /// - internal BuildEventArgs BuildEvent - { - get - { - return this.e; - } - } - - /// - /// The ID of the central logger to which this event should be forwarded. By default - /// all regular non-forwarded events are sent to all loggers registered on the parent. - /// - internal virtual int LoggerId - { - get - { - return 0; - } - } - - #endregion - - #region CustomSerializationToStream - - /// - /// Converts a BuildEventArg into its associated enumeration Id. - /// Any event which is a derrived event not in the predefined list will be - /// considered a custom event and use .net serialization - /// - private LoggingEventType GetLoggingEventId(BuildEventArgs eventArg) - { - Type eventType = eventArg.GetType(); - if (eventType == typeof(BuildMessageEventArgs)) - { - return LoggingEventType.BuildMessageEvent; - } - else if (eventType == typeof(TaskCommandLineEventArgs)) - { - return LoggingEventType.TaskCommandLineEvent; - } - else if (eventType == typeof(ProjectFinishedEventArgs)) - { - return LoggingEventType.ProjectFinishedEvent; - } - else if (eventType == typeof(ProjectStartedEventArgs)) - { - return LoggingEventType.ProjectStartedEvent; - } - else if (eventType == typeof(TargetStartedEventArgs)) - { - return LoggingEventType.TargetStartedEvent; - } - else if (eventType == typeof(TargetFinishedEventArgs)) - { - return LoggingEventType.TargetFinishedEvent; - } - else if (eventType == typeof(TaskStartedEventArgs)) - { - return LoggingEventType.TaskStartedEvent; - } - else if (eventType == typeof(TaskFinishedEventArgs)) - { - return LoggingEventType.TaskFinishedEvent; - } - else if (eventType == typeof(BuildFinishedEventArgs)) - { - return LoggingEventType.BuildFinishedEvent; - } - else if (eventType == typeof(BuildStartedEventArgs)) - { - return LoggingEventType.BuildStartedEvent; - } - else if (eventType == typeof(BuildWarningEventArgs)) - { - return LoggingEventType.BuildWarningEvent; - } - if (eventType == typeof(BuildErrorEventArgs)) - { - return LoggingEventType.BuildErrorEvent; - } - else - { - return LoggingEventType.CustomEvent; - } - } - - /// - /// Takes in a id (LoggingEventType as an int) and creates the correct specific logging class - /// - private BuildEventArgs GetBuildEventArgFromId(LoggingEventType id) - { - switch (id) - { - case LoggingEventType.BuildErrorEvent: - return new BuildErrorEventArgs(null, null, null, -1, -1, -1, -1, null, null, null); - case LoggingEventType.BuildFinishedEvent: - return new BuildFinishedEventArgs(null, null, false); - case LoggingEventType.BuildMessageEvent: - return new BuildMessageEventArgs(null, null, null, MessageImportance.Normal); - case LoggingEventType.BuildStartedEvent: - return new BuildStartedEventArgs(null, null); - case LoggingEventType.BuildWarningEvent: - return new BuildWarningEventArgs(null, null, null, -1, -1, -1, -1, null, null, null); - case LoggingEventType.ProjectFinishedEvent: - return new ProjectFinishedEventArgs(null, null, null, false); - case LoggingEventType.ProjectStartedEvent: - return new ProjectStartedEventArgs(-1, null, null, null, null, null, null, null); - case LoggingEventType.TargetStartedEvent: - return new TargetStartedEventArgs(null, null, null, null, null); - case LoggingEventType.TargetFinishedEvent: - return new TargetFinishedEventArgs(null, null, null, null, null, false); - case LoggingEventType.TaskStartedEvent: - return new TaskStartedEventArgs(null, null, null, null, null); - case LoggingEventType.TaskFinishedEvent: - return new TaskFinishedEventArgs(null, null, null, null, null, false); - case LoggingEventType.TaskCommandLineEvent: - return new TaskCommandLineEventArgs(null, null, MessageImportance.Normal); - default: - ErrorUtilities.VerifyThrow(false, "Should not get to the default of getBuildEventArgFromId ID:" + id); - return null; - } - } - - internal virtual void WriteToStream(BinaryWriter writer, Hashtable loggingTypeCache) - { - LoggingEventType id = GetLoggingEventId(e); - writer.Write((byte)id); - - if (id != LoggingEventType.CustomEvent) - { - if (!loggingTypeCache.ContainsKey(id)) - { - Type eventType = e.GetType(); - MethodInfo methodInfo = eventType.GetMethod("WriteToStream", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.InvokeMethod); - loggingTypeCache.Add(id, methodInfo); - } - if (loggingTypeCache[id] != null) - { - ((MethodInfo)loggingTypeCache[id]).Invoke(e, new object[] { writer }); - } - else - { - // The customer serialization methods are not availiable, default to .net serialization - writer.BaseStream.Position--; - writer.Write((byte)0); - binaryFormatter.Serialize(writer.BaseStream, e); - } - } - else - { - writer.Write(e.GetType().Assembly.Location); - binaryFormatter.Serialize(writer.BaseStream, e); - } - } - - internal virtual void CreateFromStream(BinaryReader reader, Hashtable loggingTypeCache) - { - LoggingEventType id = (LoggingEventType)reader.ReadByte(); - if (LoggingEventType.CustomEvent != id) - { - e = GetBuildEventArgFromId(id); - if (!loggingTypeCache.Contains(id)) - { - Type eventType = e.GetType(); - MethodInfo methodInfo = eventType.GetMethod("CreateFromStream", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.InvokeMethod); - loggingTypeCache.Add(id, methodInfo); - } - - int packetVersion = (Environment.Version.Major * 10) + Environment.Version.Minor; - ((MethodInfo)loggingTypeCache[id]).Invoke(e, new object[] { reader, packetVersion }); - } - else - { - string fileLocation = reader.ReadString(); - bool resolveAssembly = false; - lock (lockObject) - { - if (customEventsLoaded == null) - { - customEventsLoaded = new Hashtable(StringComparer.OrdinalIgnoreCase); - resolveAssembly = true; - } - else - { - if (!customEventsLoaded.Contains(fileLocation)) - { - resolveAssembly = true; - } - } - // If we are to resolve the assembly add it to the list of assemblies resolved - if (resolveAssembly) - { - customEventsLoaded.Add(fileLocation, null); - } - } - if (resolveAssembly) - { - resolver = new TaskEngineAssemblyResolver(); - resolver.InstallHandler(); - resolver.Initialize(fileLocation); - } - try - { - // codeql[cs/dangerous-binary-deserialization] BinaryFormatter is still present due to the skip-release deprecation requirement of Visual Studio. Removal has been scheduled for Oct 2024 in conjunction with VS 17.3 branching. - e = (BuildEventArgs)binaryFormatter.Deserialize(reader.BaseStream); - } - finally - { - if (resolveAssembly) - { - resolver.RemoveHandler(); - resolver = null; - } - } - } - } - #endregion - - #region Data - // The actual event wrapped by this container class - private BuildEventArgs e; - // Just need one of each per app domain - private static BinaryFormatter binaryFormatter = new BinaryFormatter(); - private TaskEngineAssemblyResolver resolver; - private static Hashtable customEventsLoaded; - private static object lockObject = new object(); - #endregion - } - - /// - /// This class is used to associate wrapped BuildEventArgs with a loggerId which - /// identifies which central logger this event should be delivered to. - /// - internal class NodeLoggingEventWithLoggerId : NodeLoggingEvent - { - #region Constructors - - internal NodeLoggingEventWithLoggerId() - { - } - /// - /// Create a wrapper for a given event associated with a particular loggerId - /// - internal NodeLoggingEventWithLoggerId(BuildEventArgs eventToLog, int loggerId) - : base(eventToLog) - { - this.loggerId = loggerId; - } - #endregion - - #region Properties - /// - /// The ID of the central logger to which this event should be forwarded - /// - internal override int LoggerId - { - get - { - return loggerId; - } - } - #endregion - - #region CustomSerializationToStream - - internal override void WriteToStream(BinaryWriter writer, Hashtable loggingTypeCache) - { - base.WriteToStream(writer, loggingTypeCache); - writer.Write((Int32)loggerId); - } - - internal override void CreateFromStream(BinaryReader reader, Hashtable loggingTypeCache) - { - base.CreateFromStream(reader, loggingTypeCache); - loggerId = reader.ReadInt32(); - } - #endregion - - #region Data - // The id of the central logger to which this event should be forwarded - private int loggerId; - #endregion - } -} diff --git a/src/Deprecated/Engine/Engine/NodeManager.cs b/src/Deprecated/Engine/Engine/NodeManager.cs deleted file mode 100644 index 5846767cc00..00000000000 --- a/src/Deprecated/Engine/Engine/NodeManager.cs +++ /dev/null @@ -1,430 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections.Generic; -using Microsoft.Build.BuildEngine.Shared; -using System.Threading; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class is resposible for managing the node providers - starting, stopping and sharing them. - /// Although child nodes have a NodeManager, theirs do nothing as they never has any NodeProviders registered with them. - /// - internal class NodeManager - { - #region Constructors - /// - /// Default constructor. - /// - internal NodeManager(int cpuCount, bool childMode, Engine parentEngine) - { - nodeList = new List(); - nodeProviders = new List(); - - this.parentEngine = parentEngine; - - this.statusMessageReceived = new ManualResetEvent(false); - - // Create the inproc node, this means that there will always be one node, node 0 - if (taskExecutionModule == null) - { - taskExecutionModule = new TaskExecutionModule(parentEngine.EngineCallback, - cpuCount == 1 && !childMode ? TaskExecutionModule.TaskExecutionModuleMode.SingleProcMode : - TaskExecutionModule.TaskExecutionModuleMode.MultiProcFullNodeMode, parentEngine.ProfileBuild); - } - } - #endregion - - #region Methods - - /// - /// Register an instantiated INodeProvider with the node manager. The node manager will query the nodeprovider - /// for a list of its node descriptions, and add these nodes to a master list of nodes which can be used - /// by the scheduler. QUESTION: Do we allow duplicate Node Providers? - /// - /// - /// - internal bool RegisterNodeProvider(INodeProvider nodeProviderToRegister) - { - ErrorUtilities.VerifyThrowArgumentNull(nodeProviderToRegister, nameof(nodeProviderToRegister)); - - INodeDescription[] nodeDescriptions = nodeProviderToRegister.QueryNodeDescriptions(); - - int[] nodeIds = new int[nodeDescriptions.Length]; - for (int i = 0; i < nodeIds.Length; i++) - { - nodeIds[i] = parentEngine.GetNextNodeId(); - } - nodeProviderToRegister.AssignNodeIdentifiers(nodeIds); - - // Go through all of the nodes as described by nodeDescriptions and add them to out list of nodes - for (int i = 0; i < nodeDescriptions.Length; i++) - { - ProvidersNodeInformation nodeToAddFromProvider = - new ProvidersNodeInformation(i, nodeIds[i], nodeDescriptions[i], nodeProviderToRegister); - nodeList.Add(nodeToAddFromProvider); - } - - nodeProviders.Add(nodeProviderToRegister); - - return true; - } - - /// - /// Provide an array of INodeDescriptionsof the node provided by the node provider for the node. The index of the description - /// is the node index to which the description matches - /// - /// - internal INodeDescription[] GetNodeDescriptions() - { - // The number of node descriptions is the number of nodes from all of the node providers, plus one for the default "0" node - INodeDescription[] nodeDescription = new INodeDescription[nodeList.Count + 1]; - nodeDescription[0] = null; - for (int nodeListIndex = 0; nodeListIndex < nodeList.Count; nodeListIndex++) - { - ProvidersNodeInformation nodeInfo = nodeList[nodeListIndex]; - // +1 because the node description already has the 0 element set to null - nodeDescription[nodeListIndex + 1] = nodeInfo.Description; - } - return nodeDescription; - } - - /// - /// Register node logger with all currently available providers - /// - /// - internal void RegisterNodeLogger(LoggerDescription loggerDescription) - { - foreach (INodeProvider nodeProvider in nodeProviders) - { - nodeProvider.RegisterNodeLogger(loggerDescription); - } - } - - /// - /// Request status from all nodes in the system - /// - /// - /// - internal NodeStatus[] RequestStatusForNodes(int responseTimeout) - { - int requestId = 0; - - statusForNodes = new NodeStatus[nodeList.Count]; - statusReplyCount = 0; - statusMessageReceived.Reset(); - - // Request status from all registered nodes - for (int i = 0; i < nodeList.Count; i++) - { - nodeList[i].NodeProvider.RequestNodeStatus(nodeList[i].NodeIndex, requestId); - } - - long startTime = DateTime.Now.Ticks; - - while (statusReplyCount < nodeList.Count) - { - if (statusMessageReceived.WaitOne(responseTimeout, false)) - { - // We received another reply - statusMessageReceived.Reset(); - // Calculate the time remaining and only continue if there is time left - TimeSpan timeSpent = new TimeSpan(DateTime.Now.Ticks - startTime); - startTime = DateTime.Now.Ticks; - responseTimeout -= (int)timeSpent.TotalMilliseconds; - if (responseTimeout <= 0) - { - Console.WriteLine("Response time out out exceeded :" + DateTime.Now.Ticks); - break; - } - } - else - { - // Timed out waiting for the response from the node - Console.WriteLine("Response time out out exceeded:" + DateTime.Now.Ticks); - break; - } - } - - return statusForNodes; - } - - internal void PostNodeStatus(int nodeId, NodeStatus nodeStatus) - { - ErrorUtilities.VerifyThrow(nodeStatus.RequestId != NodeStatus.UnrequestedStatus, - "Node manager should not receive unrequested status"); - - NodeStatus[] currentStatus = statusForNodes; - - for (int i = 0; i < nodeList.Count; i++) - { - if (nodeList[i].NodeId == nodeId) - { - currentStatus[i] = nodeStatus; - break; - } - } - - statusReplyCount++; - statusMessageReceived.Set(); - } - - internal void PostCycleNotification - ( - int nodeId, - TargetInProgessState child, - TargetInProgessState parent) - { - if (nodeId == 0) - { - parentEngine.Introspector.BreakCycle(child, parent); - } - - for (int i = 0; i < nodeList.Count; i++) - { - if (nodeList[i].NodeId == nodeId) - { - nodeList[i].NodeProvider.PostIntrospectorCommand(nodeList[i].NodeIndex, child, parent); - break; - } - } - } - - /// - /// Shut down each of the nodes for all providers registered to the node manager. - /// Shuts down the TEM. - /// - internal void ShutdownNodes(Node.NodeShutdownLevel nodeShutdownLevel) - { - foreach (INodeProvider nodeProvider in nodeProviders) - { - nodeProvider.ShutdownNodes(nodeShutdownLevel); - } - - // Don't shutdown the TEM if the engine maybe reused for another build - if (nodeShutdownLevel != Node.NodeShutdownLevel.BuildCompleteFailure && - nodeShutdownLevel != Node.NodeShutdownLevel.BuildCompleteSuccess) - { - if (taskExecutionModule != null) - { - taskExecutionModule.Shutdown(); - taskExecutionModule = null; - // At this point we have nulled out the task execution module and have told our task worker threads to exit - // we do not want the engine build loop to continue to do any work becasue the operations of the build loop - // require the task execution module in many cases. Before this fix, when the engine build loop was allowed - // to do work after the task execution module we would get random null reference excetpions depending on - // what was the first line to use the TEM after it was nulled out. - parentEngine.SetEngineAbortTo(true); - } - } - } - - /// - /// Post a build result to a node, the node index is an index into the list of nodes provided by all node providers - /// registered to the node manager, the 0 in index is a local call to taskexecutionmodule - /// - /// - /// - internal void PostBuildResultToNode(int nodeIndex, BuildResult buildResult) - { - ErrorUtilities.VerifyThrow(nodeIndex <= nodeList.Count, "Should not pass a node index higher then the number of nodes in nodeManager"); - if (nodeIndex != 0) - { - nodeList[nodeIndex - 1].NodeProvider.PostBuildResultToNode(nodeList[nodeIndex - 1].NodeIndex, buildResult); - } - else - { - taskExecutionModule.PostBuildResults(buildResult); - } - } - /// - /// Post a build request to a node, the node index is an index into the list of nodes provided by all node providers - /// registered to the node manager, the 0 in index is a local call to taskexecutionmodule - /// - /// - /// - internal void PostBuildRequestToNode(int nodeIndex, BuildRequest buildRequest) - { - ErrorUtilities.VerifyThrow(nodeIndex != 0, "Should not use NodeManager to post to local TEM"); - nodeList[nodeIndex - 1].NodeProvider.PostBuildRequestToNode(nodeList[nodeIndex - 1].NodeIndex, buildRequest); - } - - /// - /// Execute a task on the local node - /// - /// - internal void ExecuteTask(TaskExecutionState taskState) - { - taskExecutionModule.ExecuteTask(taskState); - } - - /// - /// TEMPORARY - /// - internal void UpdateSettings - ( - bool enableOutofProcLogging, - bool enableOnlyLogCriticalEvents, - bool useBreadthFirstTraversal - ) - { - foreach (INodeProvider nodeProvider in nodeProviders) - { - nodeProvider.UpdateSettings(enableOutofProcLogging, enableOnlyLogCriticalEvents, useBreadthFirstTraversal); - } - } - - internal void ChangeNodeTraversalType(bool breadthFirstTraversal) - { - UpdateSettings(parentEngine.EnabledCentralLogging, parentEngine.OnlyLogCriticalEvents, breadthFirstTraversal); - } - - #endregion - - #region Properties - - /// - /// Getter access to the local node - /// - internal TaskExecutionModule TaskExecutionModule - { - get - { - return taskExecutionModule; - } - set - { - taskExecutionModule = value; - } - } - - /// - /// Number of Nodes being managed by NodeManager - /// - internal int MaxNodeCount - { - get - { - // add 1 for the local node (taskExecutionModule) - return nodeList.Count + 1; - } - } - #endregion - - #region Data - /// - /// Pointer to the parent engine - /// - private Engine parentEngine; - /// - /// List of node information of nodes provided by registered node providers - /// - private List nodeList; - /// - /// List of registered node providers - /// - private List nodeProviders; - /// - /// Array of status summaries from the node - /// - private NodeStatus[] statusForNodes; - /// - /// Count of status replies recieved - /// - private int statusReplyCount; - /// - /// An event activated when status message arrives - /// - private ManualResetEvent statusMessageReceived; - /// - /// Local TEM used for executing tasks within the current process - /// - private TaskExecutionModule taskExecutionModule; - #endregion - } - - /// - /// Class which contains, information about each of the nodes provided by each of the node providers registered to node manager - /// - internal class ProvidersNodeInformation - { - #region Constructors - internal ProvidersNodeInformation - ( - int nodeProviderNodeIndex, - int nodeId, - INodeDescription nodeProviderDescription, - INodeProvider nodeProviderReference - ) - { - this.nodeIndex = nodeProviderNodeIndex; - this.nodeId = nodeId; - this.description = nodeProviderDescription; - this.nodeProvider = nodeProviderReference; - } - #endregion - - #region Properties - /// - /// Node provider for node - /// - internal INodeProvider NodeProvider - { - get { return nodeProvider; } - } - - /// - /// Node description for node - /// - internal INodeDescription Description - { - get - { - return description; - } - } - - /// - /// Node index relative to the node provider to which it is attached - /// - internal int NodeIndex - { - get - { - return nodeIndex; - } - } - - /// - /// The nodeId issued by the engine to this node - /// - internal int NodeId - { - get - { - return nodeId; - } - } - #endregion - - #region Data - // Index from nodeProvider of a node which it manages - private int nodeIndex; - - // Node description of node in nodeProvider referenced by nodeIndex; - private INodeDescription description; - - // Reference to the nodeProvider which manages the node referenced by nodeIndex - private INodeProvider nodeProvider; - - // The nodeId issued by the engine to this node - private int nodeId; - #endregion - } -} diff --git a/src/Deprecated/Engine/Engine/NodeRequestMapping.cs b/src/Deprecated/Engine/Engine/NodeRequestMapping.cs deleted file mode 100644 index 2b29c1d3916..00000000000 --- a/src/Deprecated/Engine/Engine/NodeRequestMapping.cs +++ /dev/null @@ -1,61 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class is used to store information needed to interpret the response from - /// the parent engine when it completes the requested evaluation - /// - internal class NodeRequestMapping - { - #region Constructors - - internal NodeRequestMapping - (int handleId, int requestId, CacheScope resultsCache) - { - ErrorUtilities.VerifyThrow(resultsCache != null, "Expect a non-null build result"); - this.handleId = handleId; - this.requestId = requestId; - this.resultsCache = resultsCache; - } - #endregion - - #region Properties - internal int HandleId - { - get - { - return this.handleId; - } - } - - internal int RequestId - { - get - { - return this.requestId; - } - } - #endregion - - #region Methods - internal void AddResultToCache(BuildResult buildResult) - { - resultsCache.AddCacheEntryForBuildResults(buildResult); - } - #endregion - - #region Member Data - private int handleId; - private int requestId; - private CacheScope resultsCache; - #endregion - } -} diff --git a/src/Deprecated/Engine/Engine/NodeWorkerThread.cs b/src/Deprecated/Engine/Engine/NodeWorkerThread.cs deleted file mode 100644 index 9f739801664..00000000000 --- a/src/Deprecated/Engine/Engine/NodeWorkerThread.cs +++ /dev/null @@ -1,422 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Text; -using System.Threading; - -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class is a wrapper around a worker thread that executes a task - /// - internal class TaskWorkerThread - { - enum NodeLoopExecutionMode - { - /// - /// This is a mode of a thread that is not executing a task but is responsible for picking up - /// work items as they arrive to the queue - /// - BaseActiveThread = 0, - /// - /// This is a mode of a thread that was in BaseActiveThread mode and processes a callback via - /// IBuildEngine interface. If a work item arrives while the thread is in this morning it will pass - /// the ownership of the queue to another thread - /// - WaitingActiveThread = 1, - /// - /// This is a mode of a thread that is not watching the work item queue and is waiting for - /// results in order to return back to task execution. - /// - WaitingPassiveThread = 2 - } - - #region Constructors - /// - /// This constructor creates a worker thread which is immediately ready to be activated. Once - /// activated the thread will execute tasks as they appear in the work item queue. Once the - /// thread is blocked from executing tasks it will pass the ownership of the work item queue to another - /// thread - /// - internal TaskWorkerThread() - { - // Create events private to this thread - this.activationEvent = new ManualResetEvent(false); - this.localDoneNoticeEvent = new ManualResetEvent(false); - this.threadActive = false; - this.targetEvaluationResults = new LinkedList(); - - // Clear out the handles cache - BaseActiveThreadWaitHandles = null; - WaitingActiveThreadWaitHandles = null; - WaitingPassiveThreadWaitHandles = null; - - // Start the thread that will be processing the events - ThreadStart threadState = new ThreadStart(this.MainThreadLoop); - Thread taskThread = new Thread(threadState); - //taskThread.SetApartmentState(ApartmentState.STA); - taskThread.Start(); - } - #endregion - - #region Properties - /// - /// This event is triggered by the node when a done notice is received - /// - internal ManualResetEvent LocalDoneNoticeEvent - { - get - { - return this.localDoneNoticeEvent; - } - } - #endregion - - #region Methods - - /// - /// This a base loop of a worker thread. The worker thread is asleep waiting for either an - /// event indicating that it should shut down or that it should become active and take - /// ownership of the work item queue - /// - private void MainThreadLoop() - { - // Create an array of event to the node thread responds - WaitHandle[] waitHandles = new WaitHandle[2]; - waitHandles[0] = exitTaskThreads; - waitHandles[1] = activationEvent; - - bool continueExecution = true; - - while (continueExecution) - { - // Wait for the next work item or an exit command - int eventType = WaitHandle.WaitAny(waitHandles); - - if (eventType == 0) - { - // Exit node event - continueExecution = false; - } - else - { - activationEvent.Reset(); - // Start the base loop, this will return once this is no longer the active thread - NodeActionLoop(NodeLoopExecutionMode.BaseActiveThread, -1, null); - // Add this thread to the inactive list - lock (workerThreadQueue) - { - workerThreadQueue.Enqueue(this); - } - } - } - } - - /// - /// This function calculates the array of events the thread should wait on depending on its - /// execution mode - /// - /// Current execution mode - /// Array of handles to wait on - private WaitHandle [] GetHandlesArray( NodeLoopExecutionMode executionMode ) - { - WaitHandle[] waitHandles = null; - - if (executionMode == NodeLoopExecutionMode.BaseActiveThread) - { - if (BaseActiveThreadWaitHandles == null) - { - BaseActiveThreadWaitHandles = new WaitHandle[2]; - BaseActiveThreadWaitHandles[0] = exitTaskThreads; - BaseActiveThreadWaitHandles[1] = workItemInsertionEvent; - } - waitHandles = BaseActiveThreadWaitHandles; - } - else if (executionMode == NodeLoopExecutionMode.WaitingActiveThread) - { - if (WaitingActiveThreadWaitHandles == null) - { - WaitingActiveThreadWaitHandles = new WaitHandle[3]; - WaitingActiveThreadWaitHandles[0] = exitTaskThreads; - WaitingActiveThreadWaitHandles[1] = workItemInsertionEvent; - WaitingActiveThreadWaitHandles[2] = localDoneNoticeEvent; - } - waitHandles = WaitingActiveThreadWaitHandles; - } - else if (executionMode == NodeLoopExecutionMode.WaitingPassiveThread) - { - if (WaitingPassiveThreadWaitHandles == null) - { - WaitingPassiveThreadWaitHandles = new WaitHandle[2]; - WaitingPassiveThreadWaitHandles[0] = exitTaskThreads; - WaitingPassiveThreadWaitHandles[1] = localDoneNoticeEvent; - } - waitHandles = WaitingPassiveThreadWaitHandles; - } - else - { - ErrorUtilities.VerifyThrow(false, "Unexpected NodeLoopExecutionMode"); - } - - return waitHandles; - } - - /// - /// This is the loop for all active threads. Depending on the current execution mode the thread - /// will listen to different events. There is only one thread at the time that owns the workitem - /// queue and listens for tasks to be executed. There is also only one thread at a time that is - /// execution a task. That thread owns the current directory and the environment block. - /// - /// - /// - /// - private void NodeActionLoop(NodeLoopExecutionMode executionMode, int nodeProxyId, BuildResult [] requestResults) - { - // Create an array of event to the node thread responds - WaitHandle[] waitHandles = GetHandlesArray(executionMode); - - int resultCount = 0; - - // A thread that is waiting for a done notification is no longer - // actively executing a task so the active cound needs to be decreased - if (executionMode != NodeLoopExecutionMode.BaseActiveThread) - { - Interlocked.Decrement(ref activeThreadCount); - threadCountEvent.Set(); - } - - bool continueExecution = true; - while (continueExecution) - { - int eventType = WaitHandle.WaitAny(waitHandles); - - if (Environment.GetEnvironmentVariable("MSBUILDDEBUG") == "1") - { - Console.WriteLine("NodeProxy :" + nodeProxyId + " waking up due " + eventType); - } - - // Node exit event - all threads need to exit - if (eventType == 0) - { - continueExecution = false; - } - // New work item has appeared in the queue - else if (eventType == 1 && executionMode != NodeLoopExecutionMode.WaitingPassiveThread ) - { - ErrorUtilities.VerifyThrow( - executionMode == NodeLoopExecutionMode.WaitingActiveThread || - executionMode == NodeLoopExecutionMode.BaseActiveThread, - "Only active threads should receive work item events"); - - if (executionMode == NodeLoopExecutionMode.BaseActiveThread) - { - TaskExecutionState taskToExecute = null; - lock (workItemQueue) - { - taskToExecute = workItemQueue.Dequeue(); - // We may get a single event for multiple messages so only reset the event - // if the queue is empty - if (workItemQueue.Count == 0) - { - workItemInsertionEvent.Reset(); - } - } - - // Execute the task either directly or on a child thread - ErrorUtilities.VerifyThrow(taskToExecute != null, "Expected a workitem"); - - // Wait until all there are no other active threads, we - // always transition from 0 to 1 atomically before executing the task - while (Interlocked.CompareExchange(ref activeThreadCount, 1, 0) != 0) - { - threadCountEvent.WaitOne(); - threadCountEvent.Reset(); - } - - proxyIdToWorkerThread[taskToExecute.NodeProxyId] = this; - - // Actually execute the task - taskToExecute.ExecuteTask(); - - proxyIdToWorkerThread.Remove(taskToExecute.NodeProxyId); - - // Indicate that this thread is no longer active - Interlocked.Decrement(ref activeThreadCount); - threadCountEvent.Set(); - } - else - { - // Change the thread execution mode since it will no longer be - // listening to the work item queue - executionMode = NodeLoopExecutionMode.WaitingPassiveThread; - threadActive = false; - waitHandles = GetHandlesArray(executionMode); - - TaskWorkerThread workerThread = null; - lock (workerThreadQueue) - { - if (workerThreadQueue.Count != 0) - { - //Console.WriteLine("REUSING a thread"); - workerThread = workerThreadQueue.Dequeue(); - } - } - if (workerThread == null) - { - //Console.WriteLine("CREATING a thread"); - workerThread = new TaskWorkerThread(); - } - - workerThread.ActivateThread(); - } - } - else if (eventType == 1 && executionMode == NodeLoopExecutionMode.WaitingPassiveThread || - eventType == 2 && executionMode == NodeLoopExecutionMode.WaitingActiveThread) - { - // There maybe multiple results in the list so we need to loop over it - // and store the results - int originalResultCount = resultCount; - lock (targetEvaluationResults) - { - //Console.WriteLine("Worker thread for: " + nodeProxyId + " Got results"); - LinkedListNode currentNode = targetEvaluationResults.First; - while (currentNode != null) - { - BuildResult buildResult = currentNode.Value; - ErrorUtilities.VerifyThrow( - buildResult.RequestId < requestResults.Length, - "The request ids should be inside the array"); - requestResults[buildResult.RequestId] = buildResult; - // Increment the result count to indicate that we got another result - resultCount++; - // Go to the next entry in the list (most of the time there will be just one entry) - currentNode = currentNode.Next; - } - targetEvaluationResults.Clear(); - // Reset the handle now that we done with the events - int handleIndex = executionMode == NodeLoopExecutionMode.WaitingPassiveThread ? 1 : 2; - ((ManualResetEvent)waitHandles[handleIndex]).Reset(); - } - ErrorUtilities.VerifyThrow(originalResultCount < resultCount, "We should have found at least 1 result"); - // If we received results for all the requests we need to exit - if (resultCount == requestResults.Length) - { - continueExecution = false; - } - } - // Check if we need to update the state - if (executionMode == NodeLoopExecutionMode.BaseActiveThread && !threadActive) - { - continueExecution = false; - } - } - - ErrorUtilities.VerifyThrow - (resultCount == 0 || executionMode != NodeLoopExecutionMode.BaseActiveThread, - "The base thread should never return a value"); - - // If a thread exits this loop it is back to actively executing the task, - // so the active thread count has to be increased - if (executionMode != NodeLoopExecutionMode.BaseActiveThread) - { - while (Interlocked.CompareExchange(ref activeThreadCount, 1, 0) != 0) - { - threadCountEvent.WaitOne(); - threadCountEvent.Reset(); - } - } - } - - private static TaskWorkerThread GetWorkerThreadForProxyId(int nodeProxyId) - { - ErrorUtilities.VerifyThrow(proxyIdToWorkerThread[nodeProxyId] != null, "Worker thread should be in the table"); - return (TaskWorkerThread)proxyIdToWorkerThread[nodeProxyId]; - } - - /// - /// This method is called to cause a thread to become active and take ownership of the workitem - /// queue - /// - internal void ActivateThread() - { - threadActive = true; - activationEvent.Set(); - } - - /// - /// This function is called when the task executes a callback via IBuildEngine interface. A thread - /// that currently owns the workitem queue will continue to own it, unless a work item comes in while - /// it is inside the callback. A thread that enters the callback no longer owns the current directory and - /// environment block, but it will always regain them before returning to the task. - /// - /// - /// - internal static void WaitForResults(int nodeProxyId, BuildResult[] requestResults) - { - TaskWorkerThread workerThread = TaskWorkerThread.GetWorkerThreadForProxyId(nodeProxyId); - workerThread.NodeActionLoop(workerThread.threadActive ? NodeLoopExecutionMode.WaitingActiveThread : - NodeLoopExecutionMode.WaitingPassiveThread, - nodeProxyId, requestResults); - } - - internal static void PostWorkItem( TaskExecutionState workItem) - { - lock (workItemQueue) - { - workItemQueue.Enqueue(workItem); - workItemInsertionEvent.Set(); - } - } - - internal static void PostBuildResult( BuildResult buildResult) - { - TaskWorkerThread workerThread = TaskWorkerThread.GetWorkerThreadForProxyId(buildResult.NodeProxyId); - - lock (workerThread.targetEvaluationResults) - { - workerThread.targetEvaluationResults.AddLast(new LinkedListNode(buildResult)); - workerThread.LocalDoneNoticeEvent.Set(); - } - } - - internal static void Shutdown() - { - exitTaskThreads.Set(); - } - #endregion - - #region Data - - private ManualResetEvent activationEvent; - private ManualResetEvent localDoneNoticeEvent; - private bool threadActive; - - // Private cache arrays of handles - private WaitHandle[] BaseActiveThreadWaitHandles; - private WaitHandle[] WaitingActiveThreadWaitHandles; - private WaitHandle[] WaitingPassiveThreadWaitHandles; - - // Static data shared between all threads - private static ManualResetEvent exitTaskThreads = new ManualResetEvent(false); - private static Queue workerThreadQueue = new Queue(); - private static int activeThreadCount = 0; - private static ManualResetEvent threadCountEvent = new ManualResetEvent(false); - private static Hashtable proxyIdToWorkerThread = new Hashtable(); - - private LinkedList targetEvaluationResults; - private static Queue workItemQueue = new Queue(); - private static ManualResetEvent workItemInsertionEvent = new ManualResetEvent(false); - - #endregion - } -} diff --git a/src/Deprecated/Engine/Engine/Project.cs b/src/Deprecated/Engine/Engine/Project.cs deleted file mode 100644 index 4f16c9086b6..00000000000 --- a/src/Deprecated/Engine/Engine/Project.cs +++ /dev/null @@ -1,4440 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Xml; -using System.Security; -using System.Collections; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.IO; -using System.Text; -using System.Globalization; - -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine.Shared; - -using error = Microsoft.Build.BuildEngine.Shared.ErrorUtilities; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// The position of a property to be set inside a project file. - /// - public enum PropertyPosition - { - /// - /// Replace existing compatible property if present. - /// Otherwise, if possible, create a new property in an existing compatible property group. - /// If necessary, create a new compatible property group right after the last one in the project. - /// - UseExistingOrCreateAfterLastPropertyGroup = 0, - - /// - /// Replace existing compatible property if present. - /// Otherwise, create the property after the last imported project. - /// - UseExistingOrCreateAfterLastImport = 1 - }; - - /// - /// Whether we are in the first (properties) pass, or the second (items) pass. - /// - internal enum ProcessingPass - { - /// - /// First pass (evaluating properties) - /// - Pass1, - /// - /// Second pass (evaluating items) - /// - Pass2 - }; - - /// - /// This class represents an MSBuild project. It is a container for items, - /// properties, and targets. It can load in project content from in-memory - /// XML or from an XML file, and it can save to an XML file, preserving - /// most whitespace and all XML comments. - /// - /// All Project objects must be associated with an Engine object, in order - /// to get at the loggers and other shared information. Also, when doing - /// a "build", the Engine needs to keep track of which projects are currently - /// building. - /// - [Obsolete("This class has been deprecated. Please use Microsoft.Build.Evaluation.Project from the Microsoft.Build assembly instead.")] - public class Project - { - #region Member Data - - // The parent Engine object for this project. - private Engine parentEngine; - - // Event location contextual information for the current project instance - private BuildEventContext projectBuildEventContext; - - // We need to know if the projectContextId which was generated during the - // instantiation of the project instance has been used. If the Id has been used, - // which would make the value true, we will then generate a new projectContextId - // on the next project started event - private bool haveUsedInitialProjectContextId; - - // A unique ID for this project object that can be used to distinguish projects that - // have the same file path but different global properties - private int projectId; - - // indicates if the project (file) and all its imported files are validated against a schema - private bool isValidated; - - // the schema against which to validate the project (file) and all its imported files - private string schemaFile; - - // The XML document for the main project file. - private XmlDocument mainProjectEntireContents; - - // The XML node of the main project file which was loaded - // (as opposed to any imported project files). - private XmlElement mainProjectElement; - - // The default targets, specified as an optional attribute on the - // element. - private string[] defaultTargetNames; - - // The names of the targets specified in the InitialTargets attributes - // on the node. We separate the ones in the main project from - // the ones in the imported projects to make the object model more sensible. - // These ArrayLists contain strings. - private ArrayList initialTargetNamesInMainProject; - private ArrayList initialTargetNamesInImportedProjects; - - // The fully qualified path to the project file for this project. - // If the project was loaded from in-memory XML, this will empty string. - private string fullFileName; - - // This is the directory containing the project file - private string projectDirectory; - - // The set of global properties for this project. For example, global - // properties may be set at the command-line via the /p: switch. - private BuildPropertyGroup globalProperties; - - // The set of properties coming from environment variables. - private BuildPropertyGroup environmentProperties; - - // The set of XMake reserved properties for this project (e.g., - // XMakeProjectName). - private BuildPropertyGroup reservedProperties; - - // The raw persisted 's in the project file. - private BuildPropertyGroupCollection rawPropertyGroups; - - // The set of all s in the project file after they've been evaluated - // and made useful for end-users. - private TargetCollection targets; - - // The name of the first target in the main project. This is used as the default - // target when one isn't specified in some other way. - private string nameOfFirstTarget = null; - - // The final set of evaluated and expanded property values for this - // project, which includes all global properties, environment properties, - // reserved properties, and properties in the main project file and - // any imported project files - taking into account property precedence - // rules, of course. - internal BuildPropertyGroup evaluatedProperties; - - // This hash table keeps track of the properties that are referenced inside - // any "Condition" attribute in the entire project, and for each such - // property, we keep the list of string values that the property is - // being tested against. This is how the IDE gets at the list of - // configurations for a project. - private Hashtable conditionedPropertiesTable; - - // The raw persisted 's in the project file. - private BuildItemGroupCollection rawItemGroups; - - // The raw collection of all grouping elements (ItemGroup, BuildPropertyGroup, and Choose. - private GroupingCollection rawGroups; - - // Each entry in this contains an BuildItemGroup. Each of these - // ItemGroups represents a list of "BuildItem" objects all of the same item type. - // The key for this Hashtable is a string identifying the item type. - // This table is what is actually used to feed items into the build process - // (the tasks). It represents true reality, and therefore it gets - // re-computed every time something in the project changes (like a property - // value for example). - internal Hashtable evaluatedItemsByName; - - // All the item definitions in the logical project, including imports. - // (Imported definitions don't need to be distinguished, since we don't have OM support - // for item definitions.) - private ItemDefinitionLibrary itemDefinitionLibrary; - - /// - /// A single virtual BuildItemGroup containing all the items in the project, after - /// wildcard and property expansion. This list is what is actually used to - /// feed items into the build process (the tasks). It represents true reality, - /// and therefore it gets re-computed every time something in the project changes - /// (like a property value for example). - /// - internal BuildItemGroup evaluatedItems; - - // This is a Hashtable of ItemGroups. Each BuildItemGroup contains a list of Items - // of a the same type. The key for the Hashtable is the "item type" string. - // The difference between this hashtable and "evaluatedItemsByType" is that - // this one ignores all "Condition"s on the items. So, for example, - // if an item is declared to be active only in the Debug configuration, it - // will show up in this list regardless of the current setting for the - // "Configuration" property. Furthermore, this list never gets re-computed - // due to changes in global properties, project properties, other items, etc. - // This is important for IDE scenarios, because the IDE is going to ask for - // this list of items and store pointers to them in its own data structures. - // Therefore, this list of items must survive for the entire IDE session, in - // case the IDE comes back to MSBuild saying ... "here's this BuildItem you gave - // me a while ago, please delete it for me now". There are a couple things - // that might cause this list to get re-computed, such as adding a new - // tag to the project ... however, the Whidbey VisualStudio IDE has no way - // of doing this, so we're safe there. The data in this table does *not* - // get used for "build" purposes, since it is not entirely accurate and up-to- - // date. It is only to be consumed by the IDE for purposes of displaying - // items in the Solution Explorer (for example). - internal Hashtable evaluatedItemsByNameIgnoringCondition; - - // A single BuildItemGroup containing all the items in the project, after - // wildcard and property expansion, but ignoring "Condition"s. So, for example, - // if an item is declared to be active only in the Debug configuration, it - // will show up in this list regardless of the current setting for the - // "Configuration" property. Furthermore, this list never gets re-computed - // due to changes in global properties, project properties, other items, etc. - // This is important for IDE scenarios, because the IDE is going to ask for - // this list of items and store pointers to them in its own data structures. - // Therefore, this list of items must survive for the entire IDE session, in - // case the IDE comes back to MSBuild saying ... "here's this BuildItem you gave - // me a while ago, please delete it for me now". There are a couple things - // that might cause this list to get re-computed, such as adding a new - // tag to the project ... however, the Whidbey VisualStudio IDE has no way - // of doing this, so we're safe there. The data in this table does *not* - // get used for "build" purposes, since it is not entirely accurate and up-to- - // date. It is only to be consumed by the IDE for purposes of displaying - // items in the Solution Explorer (for example). - internal BuildItemGroup evaluatedItemsIgnoringCondition; - - // This array list contains the ordered list of elements in - // the project file and all the imported files. When we - // object model for these things has been worked out, there should - // be an actual class here that we define, rather than an array list. - private UsingTaskCollection usingTasks; - - // holds all the tasks the project knows about and the assemblies they exist in - // NOTE: tasks and their assemblies are declared in a project with the tag - private ITaskRegistry taskRegistry; - - // The XML node if there is one. - private XmlNode projectExtensionsNode; - - // This hash table simply keeps track of the list of imported project - // files so that we can detect a circular import to prevent infinite - // recursion. - private ImportCollection imports; - - // Tells us if anything has changed that would require us to re-read and re- - // process the XML. The main scenario here would be the addition or removal - // of an tag. - private bool dirtyNeedToReprocessXml; - - // Tells us if anything in this project has changed since the last time - // we evaluated all our properties and items. That could include all sorts - // of things like properties (including global properties), items, etc. - // Note: The only reason this is internal is for unit tests. - private bool dirtyNeedToReevaluate; - - // Tells us whether we need to re-evaluate the conditions on global warnings and errors. - internal bool dirtyNeedToReevaluateGlobalWarningsAndErrors; - - // Tells us if anything in this project has changed since the last time - // we either loaded or saved the project file to disk. That could include all sorts - // of things like properties (including global properties), items, etc. - private bool dirtyNeedToSaveProjectFile; - - // Tells us the timestamp of when the project was last touched in a way - // that would require it to need to be saved. - private DateTime timeOfLastDirty; - - // Tells us whether the project is currently in the "reset" state, meaning - // that all of the targets are marked NotStarted. - private bool isReset; - - // This variable indicates whether a particular project was loaded by the host - // (e.g., the IDE) and therefore needs to be kept around permanently, or whether - // this is just a project that is only being built and thus can be discarded - // when the build is complete. The default is "true", and any Project instantiated - // directly by the host will always have a value of "true", because there's no - // way for the host to change it. The only entity that should every be changing - // this to "false" is the Engine itself because it knows that we're just building - // this project and don't need to keep it around for design-time scenarios. - private bool isLoadedByHost; - - // This controls whether or not the building of targets/tasks is enabled for this - // project. This is for security purposes in case a host wants to closely - // control which projects it allows to run targets/tasks. - private BuildEnabledSetting buildEnabled; - - /// 0 means not building; >=1 means building. - // The refcount may be greater than 1 because the MSBuild task may call back in to - // cause the project to be built again. - private int buildingCount = 0; - - // The MSBuild ToolsVersion associated with the project file - private string toolsVersion = null; - - /// true if the ToolsVersion of this project was overridden; false otherwise. - private bool overridingToolsVersion = false; - - // Whether when we read ToolsVersion="4.0" or greater on the tag, we treat it as "4.0". - // See explanation in DefaultToolsVersion property. - private bool treatinghigherToolsVersionsAs40; - - // Set to true if the client wants this project to be unloaded - private bool needToUnloadProject = false; - - // The load settings for this project - private ProjectLoadSettings loadSettings = ProjectLoadSettings.None; - - /// - /// Items need the project directory in order to evaluate their built-in - /// metadata (like "%(FullPath)") when their itemspec is relative. We store this - /// here in thread-local-storage because we cannot modify the public constructors - /// to require it, and also it can change during the life of a BuildItem - /// (when the item is passed to another project). - /// This is also used when evaluating conditions. - /// - [ThreadStatic] - private static string perThreadProjectDirectory; - - #endregion - - private enum BuildEnabledSetting - { - BuildEnabled, - BuildDisabled, - UseParentEngineSetting - } - - #region Constructors - - /// - /// Creates an instance of this class for the given engine, specifying a tools version to - /// use during builds of this project. - /// - /// RGoel - /// Engine that will build this project. May be null if the global engine is expected. - /// Tools version to use during builds of this project instance. May be null, - /// in which case we will use the value in the Project's ToolsVersion attribute, or else the engine - /// default value. - public Project - ( - Engine engine, - string toolsVersion - ) - { - { - if (engine == null) - { - engine = Engine.GlobalEngine; - } - - this.parentEngine = engine; - this.projectId = parentEngine.GetNextProjectId(); - this.projectBuildEventContext = new BuildEventContext(parentEngine.NodeId, BuildEventContext.InvalidTargetId, parentEngine.GetNextProjectId(), BuildEventContext.InvalidTaskId); - - this.isLoadedByHost = true; - this.buildEnabled = BuildEnabledSetting.UseParentEngineSetting; - - this.isValidated = false; - - // Create a new XML document and add a element. This way, the - // project is always in a valid state from the beginning, and now somebody - // can start programmatically adding stuff to the . - this.mainProjectEntireContents = new XmlDocument(); - this.mainProjectElement = mainProjectEntireContents.CreateElement(XMakeElements.project, XMakeAttributes.defaultXmlNamespace); - this.mainProjectEntireContents.AppendChild(mainProjectElement); - - // initialize all case-insensitive hash-tables - this.conditionedPropertiesTable = new Hashtable(StringComparer.OrdinalIgnoreCase); - this.evaluatedItemsByName = new Hashtable(StringComparer.OrdinalIgnoreCase); - this.evaluatedItemsByNameIgnoringCondition = new Hashtable(StringComparer.OrdinalIgnoreCase); - - // Create the group collection. All collection elements are stored here. - this.rawGroups = new GroupingCollection(null /* null parent means this is the master collection */); - - // Initialize all property-related objects. - // (see above for initialization of this.conditionedPropertiesTable) - this.globalProperties = null; - this.environmentProperties = null; - this.reservedProperties = null; - // We still create the rawPropertyGroups collection, but - // it's just a facade over rawGroups - this.rawPropertyGroups = new BuildPropertyGroupCollection(this.rawGroups); - this.evaluatedProperties = new BuildPropertyGroup(); - - // Initialize all item-related objects. - // (see above for initialization of this.evaluatedItemsByName and this.evaluatedItemsByNameIgnoringCondition - // We still create the rawItemGroups collection, but it's just a facade over rawGroups - this.rawItemGroups = new BuildItemGroupCollection(this.rawGroups); - this.evaluatedItems = new BuildItemGroup(); - this.evaluatedItemsIgnoringCondition = new BuildItemGroup(); - - this.itemDefinitionLibrary = new ItemDefinitionLibrary(this); - - // Initialize all target- and task-related objects. - this.usingTasks = new UsingTaskCollection(); - this.imports = new ImportCollection(this); - this.taskRegistry = new TaskRegistry(); - this.targets = new TargetCollection(this); - - // Initialize the default targets, initial targets, and project file name. - this.defaultTargetNames = new string[0]; - this.initialTargetNamesInMainProject = new ArrayList(); - this.initialTargetNamesInImportedProjects = new ArrayList(); - this.FullFileName = String.Empty; - this.projectDirectory = String.Empty; - - this.projectExtensionsNode = null; - - // If the toolsVersion is null, we will use the value specified in - // the Project element's ToolsVersion attribute, or else the default if that - // attribute is not present. - if (toolsVersion != null) - { - this.ToolsVersion = toolsVersion; - } - - this.MarkProjectAsDirtyForReprocessXml(); - // The project doesn't really need to be saved yet; there's nothing in it! - this.dirtyNeedToSaveProjectFile = false; - this.IsReset = false; - - // Grab some initial properties from the Engine. - // Global properties and reserved properties need to be cloned, because - // different projects may have different sets of properties or values - // for these. Environment properties don't have to be cloned, because - // the environment is captured once at engine instantiation, and - // shared by all projects thereafter. - this.GlobalProperties = this.parentEngine.GlobalProperties; - this.EnvironmentProperties = this.parentEngine.EnvironmentProperties; - } - } - - /// - /// Creates an instance of this class for the given engine. - /// - /// Engine that will build this project. - public Project - ( - Engine engine - ) - : this(engine, null) - { - } - - /// - /// This default constructor creates a new Project object associated with - /// the global Engine object. - /// - /// RGoel - public Project - ( - ) - : this(null) - { - } - - #endregion - - #region Properties - - /// - /// The directory of this project. This is needed for evaluating conditions, - /// and for evaluating itemspecs. It's easier to share it via TLS than to access - /// it directly from every item. - /// - internal static string PerThreadProjectDirectory - { - get { return perThreadProjectDirectory; } - set { perThreadProjectDirectory = value; } - } - - /// - /// The one and only item definition library for this project. - /// - internal ItemDefinitionLibrary ItemDefinitionLibrary - { - get { return itemDefinitionLibrary; } - set { itemDefinitionLibrary = value; } - } - - //Have we used the initial project context Id that was created when the project was instantiated - internal bool HaveUsedInitialProjectContextId - { - get - { - return haveUsedInitialProjectContextId; - } - - set - { - haveUsedInitialProjectContextId = value; - } - } - - // A unique ID for this project object that can be used to distinguish projects that - // have the same file path but different global properties - internal int Id - { - get - { - return projectId; - } - } - - /// - /// Returns the table of evaluated items by type. - /// - /// DavidLe - internal Hashtable EvaluatedItemsByName - { - get - { - return this.evaluatedItemsByName; - } - } - - /// - /// Gets or sets the fully qualified path + filename of the project file. This could be empty-string if the project - /// doesn't have a file associated with it -- for example, if we were given the XML in memory. - /// - /// RGoel - /// The full path of the project file. - public string FullFileName - { - get - { - return fullFileName; - } - - set - { - if (this.IsLoadedByHost) - { - this.ParentEngine.OnRenameProject(this, this.fullFileName, value); - } - - fullFileName = value; - this.SetProjectFileReservedProperties(); - - this.MarkProjectAsDirtyForReevaluation(); - } - } - - /// - /// Read-write accessor for the "DefaultTargets" attribute of the - /// <Project> element. This is passed in and out as a semicolon-separated - /// list of target names. - /// - /// RGoel - public string DefaultTargets - { - get - { - return String.Join("; ", this.defaultTargetNames); - } - - set - { - ErrorUtilities.VerifyThrowArgumentNull(value, "value"); - - // PERF NOTE: we create this property bag each time this accessor is called because this is not a very common - // operation -- it's better to recreate this property bag than keep it around all the time hogging memory - BuildPropertyGroup initialProperties = new BuildPropertyGroup(); - initialProperties.ImportInitialProperties(EnvironmentProperties, ReservedProperties, Toolset.BuildProperties, GlobalProperties); - - // allow "DefaultTargets" to only reference env. vars., command-line properties and reserved properties - SetDefaultTargets(value, initialProperties); - mainProjectElement.SetAttribute(XMakeAttributes.defaultTargets, value); - this.MarkProjectAsDirty(); - } - } - - /// - /// Returns the array of actual target names that will be built by default. First choice is - /// the defaultTargets attribute on the Project node, if not present we fall back to the first target - /// in the project file. Return value is null if there are no targets in the project file. - /// - /// LukaszG - internal string[] DefaultBuildTargets - { - get - { - // If there is a default target name, then use it. Otherwise, just - // pick the first target in the main project. - if (this.defaultTargetNames.Length != 0) - { - return this.defaultTargetNames; - } - else if (this.nameOfFirstTarget != null) - { - return new string[] { this.nameOfFirstTarget }; - } - - return null; - } - } - - /// - /// Read-write accessor for the "InitialTargets" attribute of the - /// <Project> element. This is passed in and out as a semicolon-separated - /// list of target names. The "get" returns all of the initial targets in both - /// the main project and all imported projects (after property expansion). The - /// "set" only sets the initial targets for the main project. - /// - /// RGoel - public string InitialTargets - { - get - { - // Return the concatenation of the initial target names from the main project and the ones from - // all the imported projects. Join target names together with semicolons in between. - return String.Join("; ", (string[])this.CombinedInitialTargetNames.ToArray(typeof(string))); - } - - set - { - ErrorUtilities.VerifyThrowArgumentNull(value, "value"); - - // PERF NOTE: we create this property bag each time this accessor is called because this is not a very common - // operation -- it's better to recreate this property bag than keep it around all the time hogging memory - BuildPropertyGroup initialProperties = new BuildPropertyGroup(); - initialProperties.ImportInitialProperties(EnvironmentProperties, ReservedProperties, Toolset.BuildProperties, GlobalProperties); - - this.initialTargetNamesInMainProject.Clear(); - this.initialTargetNamesInMainProject.AddRange((new Expander(initialProperties)).ExpandAllIntoStringListLeaveEscaped(value, null)); - mainProjectElement.SetAttribute(XMakeAttributes.initialTargets, value); - this.MarkProjectAsDirty(); - } - } - - /// - /// Returns an ArrayList containing strings which are all of the target names that are considerd - /// "initial targets" -- those targets that get run every time before any other targets. - /// - /// RGoel - private ArrayList CombinedInitialTargetNames - { - get - { - ArrayList combinedInitialTargetNames = new ArrayList(this.initialTargetNamesInMainProject.Count + - this.initialTargetNamesInImportedProjects.Count); - - combinedInitialTargetNames.AddRange(this.initialTargetNamesInMainProject); - combinedInitialTargetNames.AddRange(this.initialTargetNamesInImportedProjects); - - return combinedInitialTargetNames; - } - } - - /// - /// Gets the parent engine object. - /// - /// RGoel - /// Engine object. - public Engine ParentEngine - { - get - { - ErrorUtilities.VerifyThrowInvalidOperation(parentEngine != null, "ProjectInvalidUnloaded"); - - return parentEngine; - } - } - - /// - /// This property indicates whether a particular project was loaded by the host - /// (e.g., the IDE) and therefore needs to be kept around permanently, or whether - /// this is just a project that is only being built and thus can be discarded - /// when the build is complete. The default is "true", and any Project instantiated - /// directly by the host will always have a value of "true", because there's no - /// way for the host to change it. The only entity that should every be changing - /// this to "false" is the Engine itself because it knows that we're just building - /// this project and don't need to keep it around for design-time scenarios. - /// - /// RGoel - internal bool IsLoadedByHost - { - get - { - return this.isLoadedByHost; - } - set - { - this.isLoadedByHost = value; - } - } - - /// - /// Indicates if the project (file) is to be validated against a schema. - /// - /// SumedhK - public bool IsValidated - { - get - { - return isValidated; - } - - set - { - isValidated = value; - } - } - - /// - /// Is this project in the process of building? - /// - /// JomoF - internal bool IsBuilding - { - get - { - return buildingCount > 0; - } - } - - /// - /// The schema against which the project (file) and all its imported files are validated. - /// - /// SumedhK - public string SchemaFile - { - get - { - return schemaFile; - } - - set - { - // NOTE: null is ok, in which case we'll validate against the default schema - schemaFile = value; - } - } - - /// - /// This controls whether or not the building of targets/tasks is enabled for this - /// project. This is for security purposes in case a host wants to closely - /// control which projects it allows to run targets/tasks. By default, for a newly - /// created project, we will use whatever setting is in the parent engine. - /// - /// RGoel - public bool BuildEnabled - { - get - { - switch (this.buildEnabled) - { - case BuildEnabledSetting.BuildEnabled: - return true; - - case BuildEnabledSetting.BuildDisabled: - return false; - - case BuildEnabledSetting.UseParentEngineSetting: - return this.ParentEngine.BuildEnabled; - - default: - ErrorUtilities.VerifyThrow(false, "How did this.buildEnabled get a bogus value?"); - return false; - } - } - - set - { - this.buildEnabled = value ? BuildEnabledSetting.BuildEnabled : BuildEnabledSetting.BuildDisabled; - } - } - - /// - /// When gotten, returns the effective tools version being used by this project. - /// If the tools version is being overridden, the overriding value will be the effective tools version. - /// Otherwise, if there is a ToolsVersion attribute on the Project element, that is the effective tools version. - /// Otherwise, the default tools version of the parent engine is the effective tools version. - /// - /// When set, overrides the current tools version of this project with the provided value. - /// - /// NOTE: This is distinct to the ToolsVersion attribute, if any, on the Project element. - /// To get and set the ToolsVersion attribute on the Project element use the Project.DefaultToolsVersion - /// property. - /// - public string ToolsVersion - { - get - { - // We could have a toolsversion already (either from the Project element, or - // from an externally set override value). If not, read it off the Project - // element now - if (!OverridingToolsVersion) - { - return DefaultToolsVersion; - } - - return this.toolsVersion; - } - internal set - { - error.VerifyThrowArgumentLength(value, "value"); - - // Make sure the tools version we're trying to set is recognized by the engine - error.VerifyThrowInvalidOperation(this.ParentEngine.ToolsetStateMap.ContainsKey(value), "UnrecognizedToolsVersion", value); - - this.toolsVersion = value; - this.overridingToolsVersion = true; - - MarkProjectAsDirtyForReprocessXml(); - } - } - - /// - /// Returns true if the ToolsVersion of this project is being overridden; false otherwise. - /// - /// JeffCal - internal bool OverridingToolsVersion - { - get - { - return this.overridingToolsVersion; - } - } - - /// - /// Public read-write accessor for the ToolsVersion xml attribute found on the - /// <Project /> element. If this attribute is not present on the <Project/> - /// element, getting the value will return the default tools version of the parent Engine. - /// - /// NOTE: This value is distinct from the effective tools version used during a build, - /// as that value may be overridden during construction of the Project instance or - /// by setting the Project.ToolsVersion property. Setting this attribute value will not change the - /// effective tools version if it has been overridden. To change the effective tools version, - /// set the Project.ToolsVersion property. - /// - public string DefaultToolsVersion - { - get - { - string toolsVersionAttribute = null; - - if (ProjectElement.HasAttribute(XMakeAttributes.toolsVersion)) - { - toolsVersionAttribute = ProjectElement.GetAttribute(XMakeAttributes.toolsVersion); - - // hosts may need to treat toolsversions later than 4.0 as 4.0 - // given them that ability through an environment variable - if (Environment.GetEnvironmentVariable("MSBUILDTREATHIGHERTOOLSVERSIONASCURRENT") == "1") - { - Version toolsVersionAsVersion; - - if (Version.TryParse(toolsVersionAttribute, out toolsVersionAsVersion)) - { - // This is higher than an FX 4.0 normal toolsversion - // Therefore we need to enter best effort mode - // and present a toolsversion 4.0 - if (toolsVersionAsVersion.Major >= 4 && toolsVersionAsVersion.Minor > 0) - { - toolsVersionAttribute = "4.0"; - treatinghigherToolsVersionsAs40 = true; - } - } - } - - // If the toolset specified in the project is not present - // then we'll use the current version, i.e. "4.0" - if (!this.ParentEngine.ToolsetStateMap.ContainsKey(toolsVersionAttribute)) - { - toolsVersionAttribute = "4.0"; - treatinghigherToolsVersionsAs40 = true; - } - } - - return String.IsNullOrEmpty(toolsVersionAttribute) ? ParentEngine.DefaultToolsVersion - : toolsVersionAttribute; - } - set - { - // We intentionally don't check that this is a known tools version value: it can be anything, - // because the host might want to persist this project and use it later when the tools - // version is actually valid - ProjectElement.SetAttribute(XMakeAttributes.toolsVersion, value); - - if (!overridingToolsVersion) - { - this.toolsVersion = DefaultToolsVersion; - } - - MarkProjectAsDirtyForReprocessXml(); - } - } - - /// - /// Public read accessor to determine if the Project file has the ToolsVersion xml attribute - /// e.g. <Project ToolsVersion="3.5"/> . This is different to knowing the inherited - /// value and allows us to spot Whidbey (VS 8.0) projects. - /// - public bool HasToolsVersionAttribute - { - get - { - return ProjectElement.HasAttribute(XMakeAttributes.toolsVersion); - } - } - - /// - /// This private property is here for convenience so that the error checking needn't be duplicated throughout - /// the project object. - /// - private ToolsetState Toolset - { - get - { - // Check that we actually have a valid tools version at this point. It's possible we don't, if for example, - // we're using a tools version off the project attribute, which is allowed to have any value you like, - // unless you are actually trying to build or load the project. - ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(this.ParentEngine.ToolsetStateMap.ContainsKey(ToolsVersion), - new BuildEventFileInfo(FullFileName), "UnrecognizedToolsVersion", ToolsVersion); - - return this.ParentEngine.ToolsetStateMap[ToolsVersion]; - } - } - - /// - /// The project's task registry. - /// - internal ITaskRegistry TaskRegistry - { - get - { - return taskRegistry; - } - set - { - ErrorUtilities.VerifyThrowArgumentNull(value, "value"); - taskRegistry = value; - } - } - - /// - /// The project directory where the project file is in, this can be empty if the project is constructed in memory and does - /// not come from a file location - /// - internal string ProjectDirectory - { - get - { - return projectDirectory; - } - } - - /// - /// Read-write accessor for the project's global properties collection. - /// To set or modify global properties, a caller can hand us an entire - /// new BuildPropertyGroup here, or can simply modify the properties in the - /// BuildPropertyGroup that is already here. Global properties are those - /// defined via the "/p:" switch on the MSBuild.exe command-line, or - /// properties like "Configuration" set by the IDE prior to invoking MSBuild. - /// - /// RGoel - public BuildPropertyGroup GlobalProperties - { - get - { - // Lazy creation - if (this.globalProperties == null) - { - this.globalProperties = new BuildPropertyGroup(this); - } - - return this.globalProperties; - } - - set - { - error.VerifyThrowArgumentNull(value, "value"); - - // Any time a global property changes (which could happen - // without even calling this "set" accessor), we need to reprocess - // the entire project file from the beginning, reading in all - // the XML again. This is mainly because global properties can - // be referenced inside an tag, and thus a change in a - // global property could result in an entirely different imported - // project file. - // - // However, we know that most project files (particularly VS-generated - // ones) don't use property references inside the tag, and - // it's a pretty big perf hit to reprocess all the XML, so we've decided - // for now to just take a shortcut and only re-evaluate the project file - // instead of re-processing it. - // - // By the way, since normal project properties can also be referenced - // inside an tag, we actually also have the same exact issue for - // normal properties. Again, we intentionally choose to be slightly - // incorrect, so that we don't take the perf hit of re-processing all - // the XML every time any property value changes. - - // Unhook the old globalProperties from this project. - globalProperties?.ClearParentProject(); - - globalProperties = value.Clone(true); - - // Mark the new globalProperties as belonging to this project. - globalProperties.ParentProject = this; - this.MarkProjectAsDirtyForReevaluation(); - } - } - - /// - /// Read-write internal accessor for the property group containing - /// environment variables. - /// - /// RGoel - internal BuildPropertyGroup EnvironmentProperties - { - get - { - if (this.environmentProperties == null) - { - this.environmentProperties = new BuildPropertyGroup(); - // We don't hook up the environment properties with a ParentProject, - // because multiple projects will be sharing the same environment - // block. - } - - return this.environmentProperties; - } - - set - { - this.environmentProperties = value; - } - } - - /// - /// Read-only internal accessor for the property group containing - /// MSBuild reserved properties (like "MSBuildProjectName", for example). - /// - /// RGoel - internal BuildPropertyGroup ReservedProperties - { - get - { - // Lazy creation - if (this.reservedProperties == null) - { - this.reservedProperties = new BuildPropertyGroup(this); - } - - return this.reservedProperties; - } - } - - /// - /// Read-only accessor for the final set of evaluated properties for - /// this project. This takes into account all conditions and property - /// expansions, and gives back a single linear collection of project-level - /// properties, which includes global properties, environment variable - /// properties, reserved properties, and normal/imported properties. - /// Through this collection, the caller can modify any normal - /// properties, and the changes will be reflected in the project file - /// when it is saved again. However, adding or deleting properties - /// from this collection will not impact the project. - /// - /// PERF WARNING: cloning a BuildPropertyGroup can be very expensive -- use - /// only when a copy of the entire property bag is strictly necessary - /// - /// RGoel - public BuildPropertyGroup EvaluatedProperties - { - get - { - this.RefreshProjectIfDirty(); - return this.evaluatedProperties.Clone(false /* shallow clone */); - } - } - - /// - /// Get the event context information for this project instance - /// - internal BuildEventContext ProjectBuildEventContext - { - get - { - return projectBuildEventContext; - } - - set - { - projectBuildEventContext = value; - } - } - - /// - /// Read-only accessor for the final collection of evaluated items, taking - /// into account all conditions and property expansions. Through this - /// collection, the caller can modify any of the items present, and it - /// will be reflected in the project file the next time it is saved. - /// However, adding or deleting items from this collection will not impact - /// the project. - /// - /// RGoel - public BuildItemGroup EvaluatedItems - { - get - { - this.RefreshProjectIfDirty(); - return evaluatedItems.Clone(false); - } - } - - /// - /// Read-only accessor for the collection of evaluated items, taking into - /// account property expansions and wildcards, but ignoring "Condition"s. - /// This way, an IDE can display all items regardless of whether they're - /// relevant for a particular build flavor or not. Through this - /// collection, the caller can modify any of the items present, and it - /// will be reflected in the project file the next time it is saved. - /// However, adding or deleting items from this collection will not impact - /// the project. - /// - /// See the comments for the "evaluatedItemsIgnoringCondition" member - /// variable up above. - /// - /// RGoel - public BuildItemGroup EvaluatedItemsIgnoringCondition - { - get - { - if (this.dirtyNeedToReprocessXml) - { - this.ProcessMainProjectElement(); - } - - return evaluatedItemsIgnoringCondition; - } - } - - /// - /// Read-only accessor for the raw property groups of this project. - /// This is essentially a reflection of the data in the XML for this - /// project's properties as well as any <Import>'d projects. - /// - /// RGoel - public BuildPropertyGroupCollection PropertyGroups - { - get - { - error.VerifyThrow(this.rawPropertyGroups != null, - "Project object not initialized. rawPropertyGroups is null."); - return this.rawPropertyGroups; - } - } - - /// - /// Read-only accessor for the target groups of this project. - /// - /// RGoel - public TargetCollection Targets - { - get - { - error.VerifyThrow(this.targets != null, - "Project object not initialized. targets is null."); - return this.targets; - } - } - - /// - /// Read-only accessor for the UsingTask elements of this project. - /// - /// LukaszG - public UsingTaskCollection UsingTasks - { - get - { - ErrorUtilities.VerifyThrow(this.usingTasks != null, "Project object not initialized. usingTasks is null."); - return this.usingTasks; - } - } - - /// - /// Read-only accessor for the imported projects of this project - /// - /// LukaszG - public ImportCollection Imports - { - get - { - ErrorUtilities.VerifyThrow(this.imports != null, "Project object not initialized. imports is null."); - return this.imports; - } - } - - /// - /// Read-only accessor for the raw item groups of this project. - /// This is essentially a reflection of the data in the XML for this - /// project's items as well as any <Import>'d projects. - /// - /// RGoel - public BuildItemGroupCollection ItemGroups - { - get - { - error.VerifyThrow(this.rawItemGroups != null, - "Project object not initialized. rawItemGroups is null."); - return this.rawItemGroups; - } - } - - /// - /// Read-only accessor for the string of Xml representing this project. - /// Used for verification in unit testing. - /// - /// RGoel - public string Xml - { - get - { - using (StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture)) - { - this.Save((TextWriter)stringWriter); - return stringWriter.ToString(); - } - } - } - - /// - /// Read-only accessor for the XmlDocument representing this project. - /// Used for verification in unit testing. - /// - /// RGoel - internal XmlDocument XmlDocument - { - get - { - return this.mainProjectEntireContents; - } - } - - /// - /// Read-only accessor for main <Project> element. - /// - /// - /// RGoel - internal XmlElement ProjectElement - { - get - { - return this.mainProjectElement; - } - } - - /// - /// Is this project currently in a reset state in terms of the build? That is, - /// is it ready to be built? A project that is reset means that all of the - /// targets are marked "NotStarted", and there are no output items or output - /// properties present in the evaluated lists. - /// - /// - /// This accessor is really just here for unit-testing purposes only. - /// - /// RGoel - internal bool IsReset - { - get - { - return this.isReset; - } - - set - { - this.isReset = value; - } - } - - /// - /// Read-only accessor for conditioned properties table. - /// - /// - /// DavidLe - internal Hashtable ConditionedProperties - { - get - { - return this.conditionedPropertiesTable; - } - } - - /// - /// Tells you whether this project file is dirty such that it would need - /// to get saved to disk. - /// - /// RGoel - public bool IsDirty - { - get - { - return this.dirtyNeedToSaveProjectFile; - } - } - - /// - /// Tells you whether this project file is dirty such that it would need - /// to get reevaluated. - /// - internal bool IsDirtyNeedToReevaluate - { - get { return this.dirtyNeedToReevaluate; } - } - - /// - /// Returns the timestamp of when the project was last touched in a way - /// that would require it to need to be saved. - /// - /// The DateTime object indicating when project was dirtied. - /// RGoel - public DateTime TimeOfLastDirty - { - get - { - return this.timeOfLastDirty; - } - } - - /// - /// Returns the project file's ?xml node, or null if it's not present - /// - /// LukaszG - private XmlDeclaration XmlDeclarationNode - { - get - { - if (mainProjectEntireContents?.HasChildNodes == true) - { - return mainProjectEntireContents.FirstChild as XmlDeclaration; - } - else - { - return null; - } - } - } - - /// - /// Internal method for getting the project file encoding. When we have the managed vsproject assembly, this should be made public. - /// - public Encoding Encoding - { - get - { - // If encoding is unknown (that is, no ?xml node is present), we default to UTF8 - Encoding encoding = Encoding.UTF8; - - XmlDeclaration xmlDeclarationNode = this.XmlDeclarationNode; - - if (xmlDeclarationNode != null) - { - string encodingName = xmlDeclarationNode.Encoding; - - if (encodingName.Length > 0) - { - encoding = Encoding.GetEncoding(encodingName); - } - } - - return encoding; - } - } - - /// - /// Load settings for this project - /// - internal ProjectLoadSettings LoadSettings - { - get - { - return this.loadSettings; - } - } - - #endregion - - /// - /// Returns a single evaluated property value. - /// Call this to retrieve a few properties. If you need to retrieve many properties - /// use EvaluatedProperty accessor. - /// - /// Name of the property to retrieve. - /// The property value. - public string GetEvaluatedProperty(string propertyName) - { - this.RefreshProjectIfDirty(); - - BuildProperty property = this.evaluatedProperties[propertyName]; - - // Project system needs to know the difference between a property not existing, - // a property that is set to empty string. - return property?.FinalValue; - } - - /// - /// Sets the project's default targets from the given list of semi-colon-separated target names after expanding all - /// embedded properties in the list. - /// - /// SumedhK - /// - /// - private void SetDefaultTargets(string defaultTargetsList, BuildPropertyGroup propertyBag) - { - Expander propertyExpander = new Expander(propertyBag); - - this.defaultTargetNames = propertyExpander.ExpandAllIntoStringListLeaveEscaped(defaultTargetsList, null).ToArray(); - - BuildProperty defaultTargetsProperty = new BuildProperty(ReservedPropertyNames.projectDefaultTargets, - propertyExpander.ExpandAllIntoStringLeaveEscaped(defaultTargetsList, null), - PropertyType.ReservedProperty); - - this.ReservedProperties.SetProperty(defaultTargetsProperty); - - // we also need to push this property directly into the evaluatedProperties bucket - // since this property was computed "late", i.e. after the initial evaluation. - this.evaluatedProperties.SetProperty(defaultTargetsProperty); - } - - /// - /// Determines whether a project file can be considered equivalent to this Project, taking into account - /// the set of global properties and the tools version (if any) that that project file - /// is going to be built with. - /// - /// - /// - /// May be null, indicating the value from the project attribute, or the global default, should be used - /// - internal bool IsEquivalentToProject(string projectFullPath, BuildPropertyGroup projectGlobalProperties, string projectToolsVersion) - { - if (!String.Equals(projectFullPath, this.FullFileName, StringComparison.OrdinalIgnoreCase)) - { - return false; - } - - if (projectToolsVersion == null) - { - // There's not going to be a tools version specified for the other project, so it's going - // to use the one on its Project tag (or the global default). How can we figure that out - // without loading it? Well we know that we have the same file path as the other project, - // so we can just look at our own Project tag! - projectToolsVersion = this.DefaultToolsVersion; - } - - return String.Equals(ToolsVersion, projectToolsVersion, StringComparison.OrdinalIgnoreCase) - && this.GlobalProperties.IsEquivalent(projectGlobalProperties); - } - - /// - /// For internal use only by the Engine object when it lets go of a project. - /// - /// RGoel - internal void ClearParentEngine - ( - ) - { - this.parentEngine = null; - } - - /// - /// This forces a re-evaluation of the project the next time somebody - /// calls EvaluatedProperties or EvaluatedItems. It is also a signal - /// that the project file is dirty and needs to be saved to disk. - /// - /// RGoel - public void MarkProjectAsDirty - ( - ) - { - this.MarkProjectAsDirtyForReevaluation(); - this.MarkProjectAsDirtyForSave(); - } - - /// - /// This forces a re-evaluation of the project the next time somebody - /// calls EvaluatedProperties or EvaluatedItems. - /// - /// RGoel - internal void MarkProjectAsDirtyForReevaluation - ( - ) - { - this.dirtyNeedToReevaluate = true; - this.dirtyNeedToReevaluateGlobalWarningsAndErrors = true; - } - - /// - /// This marks a project as needing to be saved to disk. - /// - /// RGoel - internal void MarkProjectAsDirtyForSave - ( - ) - { - this.dirtyNeedToSaveProjectFile = true; - this.timeOfLastDirty = DateTime.Now; - } - - /// - /// Indicates to the project that on the next build, we actually need to walk the - /// entire XML structure from scratch. It's pretty rare that this is required. - /// Examples include changes to <Import> or <Target> tags. These kinds of changes - /// can require us to re-compute some of our data structures, and in some cases, - /// there's no easy way to do it, except to walk the XML again. - /// - /// RGoel - internal void MarkProjectAsDirtyForReprocessXml - ( - ) - { - this.MarkProjectAsDirty(); - this.dirtyNeedToReprocessXml = true; - } - - /// - /// This returns a list of possible values for a particular property. It - /// gathers this list by looking at all of the "Condition" attributes - /// in the project file. - /// - /// - /// - /// RGoel - public string[] GetConditionedPropertyValues - ( - string propertyName - ) - { - this.RefreshProjectIfDirty(); - StringCollection propertyValues = (StringCollection)this.conditionedPropertiesTable[propertyName]; - - if (propertyValues == null) - { - return new string[0]; - } - else - { - // We need to transform the StringCollection into an array, so COM - // clients can access it. - string[] returnArray = new string[propertyValues.Count]; - - int i = 0; - foreach (string propertyValue in propertyValues) - { - // Data leaving the engine, so time to unescape. - returnArray[i++] = EscapingUtilities.UnescapeAll(propertyValue); - } - - return returnArray; - } - } - - /// - /// Retrieves a group of evaluated items of a particular item type. - /// - /// RGoel - /// - /// items of requested type - public BuildItemGroup GetEvaluatedItemsByName - ( - string itemName - ) - { - this.RefreshProjectIfDirty(); - - BuildItemGroup itemsByName = (BuildItemGroup)evaluatedItemsByName[itemName]; - - if (itemsByName == null) - { - return new BuildItemGroup(); - } - else - { - return itemsByName.Clone(false); - } - } - - /// - /// Retrieves a group of evaluated items of a particular item type. This is really just about the items that are persisted - /// in the project file, ignoring all "Condition"s, so that an IDE can display all items regardless of whether they're - /// relevant for a particular build flavor or not. - /// - /// RGoel - /// See the comments for the "evaluatedItemsByNameIgnoringCondition" member variable up above. - /// - /// items of requested type - public BuildItemGroup GetEvaluatedItemsByNameIgnoringCondition - ( - string itemName - ) - { - if (this.dirtyNeedToReprocessXml) - { - this.ProcessMainProjectElement(); - } - - BuildItemGroup itemsByName = (BuildItemGroup)evaluatedItemsByNameIgnoringCondition[itemName]; - - if (itemsByName == null) - { - itemsByName = new BuildItemGroup(); - } - - return itemsByName; - } - - /// - /// Prepares the MSBuildToolsPath and MSBuildBinPath reserved properties - /// - private void ProcessToolsVersionDependentProperties() - { - // Add the XMakeBinPath property, and set its value to the full path of - // where this assembly is currently running from. - this.ReservedProperties.SetProperty(new BuildProperty(ReservedPropertyNames.binPath, - EscapingUtilities.Escape(this.Toolset.ToolsPath), - PropertyType.ReservedProperty)); - - this.ReservedProperties.SetProperty(new BuildProperty(ReservedPropertyNames.toolsPath, - EscapingUtilities.Escape(this.Toolset.ToolsPath), - PropertyType.ReservedProperty)); - - this.ReservedProperties.SetProperty(new BuildProperty(ReservedPropertyNames.toolsVersion, - EscapingUtilities.Escape(ToolsVersion), - PropertyType.ReservedProperty)); - } - - /// - /// Sets the filename for this project, and sets the appropriate MSBuild - /// reserved properties accordingly. - /// - /// rgoel - private void SetProjectFileReservedProperties - ( - ) - { - this.ReservedProperties.SetProperty(new BuildProperty(ReservedPropertyNames.startupDirectory, - EscapingUtilities.Escape(parentEngine.StartupDirectory), PropertyType.ReservedProperty)); - - this.ReservedProperties.SetProperty(new BuildProperty(ReservedPropertyNames.buildNodeCount, - parentEngine.EngineCpuCount.ToString(CultureInfo.CurrentCulture), PropertyType.ReservedProperty)); - - this.ReservedProperties.SetProperty(new BuildProperty(ReservedPropertyNames.programFiles32, - FrameworkLocationHelper.programFiles32, PropertyType.ReservedProperty)); - - this.ReservedProperties.SetProperty(new BuildProperty(ReservedPropertyNames.assemblyVersion, - Constants.AssemblyVersion, PropertyType.ReservedProperty)); - - if (this.fullFileName.Length == 0) - { - // If we don't have a filename for this project, then we can't set all - // the reserved properties related to the project file. However, we - // still need to set the MSBuildProjectDirectory property because this - // is actually used by us to set the current directory before starting - // the build, and after each task finishes. So, here we set - // MSBuildProjectDirectory = . - this.ReservedProperties.SetProperty(new BuildProperty(ReservedPropertyNames.projectDirectory, - EscapingUtilities.Escape(Directory.GetCurrentDirectory()), PropertyType.ReservedProperty)); - } - else - { - FileInfo projectFileInfo = new FileInfo(this.fullFileName); - - string directoryName = projectFileInfo.DirectoryName; - - this.ReservedProperties.SetProperty(new BuildProperty(ReservedPropertyNames.projectDirectory, - EscapingUtilities.Escape(directoryName), PropertyType.ReservedProperty)); - - this.ReservedProperties.SetProperty(new BuildProperty(ReservedPropertyNames.projectFile, - EscapingUtilities.Escape(projectFileInfo.Name), PropertyType.ReservedProperty)); - - this.ReservedProperties.SetProperty(new BuildProperty(ReservedPropertyNames.projectExtension, - EscapingUtilities.Escape(projectFileInfo.Extension), PropertyType.ReservedProperty)); - - this.ReservedProperties.SetProperty(new BuildProperty(ReservedPropertyNames.projectFullPath, - EscapingUtilities.Escape(projectFileInfo.FullName), PropertyType.ReservedProperty)); - - this.ReservedProperties.SetProperty(new BuildProperty(ReservedPropertyNames.projectName, - EscapingUtilities.Escape(Path.GetFileNameWithoutExtension(this.fullFileName)), PropertyType.ReservedProperty)); - - int rootLength = Path.GetPathRoot(directoryName).Length; - string projectDirectoryNoRoot = directoryName.Substring(rootLength); - projectDirectoryNoRoot = FileUtilities.EnsureNoTrailingSlash(projectDirectoryNoRoot); - projectDirectoryNoRoot = FileUtilities.EnsureNoLeadingSlash(projectDirectoryNoRoot); - - this.ReservedProperties.SetProperty(new BuildProperty(ReservedPropertyNames.projectDirectoryNoRoot, - EscapingUtilities.Escape(projectDirectoryNoRoot), PropertyType.ReservedProperty)); - } - - this.projectDirectory = this.ReservedProperties[ReservedPropertyNames.projectDirectory].FinalValue; - } - - /// - /// Resets the state of each target in this project back to "NotStarted", - /// so that a subsequent build will actually build those targets again. - /// - /// rgoel - public void ResetBuildStatus - ( - ) - { - if (!this.IsReset) - { - foreach (Target target in this.targets) - { - target.ResetBuildStatus(); - } - - // get rid of all intermediate (virtual) properties that were output by tasks, and restore any original properties - // that were overridden by those task properties - this.evaluatedProperties.RevertAllOutputProperties(); - - // Delete all intermediate (virtual) items. - this.evaluatedItems.RemoveAllIntermediateItems(); - - foreach (BuildItemGroup itemGroup in this.evaluatedItemsByName.Values) - { - itemGroup.RemoveAllIntermediateItems(); - } - - this.IsReset = true; - } - } - - /// - /// Reads in the contents of this project from a project XML file on disk. - /// - /// - public void Load - ( - string projectFileName - ) - { - Load(projectFileName, ProjectLoadSettings.None); - } - - /// - /// Reads in the contents of this project from a project XML file on disk. - /// - /// - public void Load - ( - string projectFileName, - ProjectLoadSettings projectLoadSettings - ) - { - Load(projectFileName, projectBuildEventContext, projectLoadSettings); - } - - /// - /// Reads in the contents of this project from a project XML file on disk. - /// - /// - internal void Load - ( - string projectFileName, - BuildEventContext buildEventContext, - ProjectLoadSettings projectLoadSettings - ) - { - ErrorUtilities.VerifyThrowArgumentNull(projectFileName, nameof(projectFileName)); - ErrorUtilities.VerifyThrowArgument(projectFileName.Length > 0, "EmptyProjectFileName"); - ErrorUtilities.VerifyThrowArgument(File.Exists(projectFileName), "ProjectFileNotFound", projectFileName); - - { - string projectFullFileName = Path.GetFullPath(projectFileName); - - try - { - XmlDocument projectDocument = null; - if (IsSolutionFilename(projectFileName)) - { - SolutionParser sp = new SolutionParser(); - - sp.SolutionFile = projectFileName; - sp.ParseSolutionFile(); - - // Log any comments from the solution parser - if (sp.SolutionParserComments.Count > 0) - { - foreach (string comment in sp.SolutionParserComments) - { - ParentEngine.LoggingServices.LogCommentFromText(buildEventContext, MessageImportance.Low, comment); - } - } - - // Pass the toolsVersion of this project through, which will be not null if there was a /tv:nn switch - // Although we only get an XmlDocument, not a Project object back, it's still needed - // to determine which tags to put in, whether to put a ToolsVersion parameter - // on task tags, and what MSBuildToolsPath to use when scanning child projects - // for dependency information. - SolutionWrapperProject.Generate(sp, this, toolsVersion, buildEventContext); - } - else if (IsVCProjFilename(projectFileName)) - { - ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(false, new BuildEventFileInfo(projectFileName), "ProjectUpgradeNeededToVcxProj", projectFileName); - } - else - { - projectDocument = new XmlDocument(); - // XmlDocument.Load() may throw an XmlException - projectDocument.Load(projectFileName); - } - - // Setting the FullFileName causes this project to be "registered" with - // the engine. (Well, okay, "registered" is the wrong word ... but the - // engine starts keeping close track of this project in its tables.) - // We want to avoid this until we're sure that the XML is valid and - // the document can be read in. Bug VSWhidbey 415236. - this.FullFileName = projectFullFileName; - - if (!IsSolutionFilename(projectFileName)) - { - InternalLoadFromXmlDocument(projectDocument, projectLoadSettings); - } - - // This project just came off the disk, so it is certainly not dirty yet. - this.dirtyNeedToSaveProjectFile = false; - } - // handle errors in project syntax - catch (InvalidProjectFileException e) - { - ParentEngine.LoggingServices.LogInvalidProjectFileError(buildEventContext, e); - throw; - } - // handle errors in path resolution - catch (SecurityException e) - { - ParentEngine.LoggingServices.LogError(buildEventContext, new BuildEventFileInfo(FullFileName), "InvalidProjectFile", e.Message); - - ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(false, new BuildEventFileInfo(FullFileName), - "InvalidProjectFile", e.Message); - } - // handle errors in path resolution - catch (NotSupportedException e) - { - ParentEngine.LoggingServices.LogError(buildEventContext, new BuildEventFileInfo(FullFileName), "InvalidProjectFile", e.Message); - - ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(false, new BuildEventFileInfo(FullFileName), - "InvalidProjectFile", e.Message); - } - // handle errors in loading project file - catch (IOException e) - { - ParentEngine.LoggingServices.LogError(buildEventContext, new BuildEventFileInfo(FullFileName), "InvalidProjectFile", e.Message); - - ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(false, new BuildEventFileInfo(FullFileName), - "InvalidProjectFile", e.Message); - } - // handle errors in loading project file - catch (UnauthorizedAccessException e) - { - ParentEngine.LoggingServices.LogError(buildEventContext, new BuildEventFileInfo(FullFileName), "InvalidProjectFile", e.Message); - ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(false, new BuildEventFileInfo(FullFileName), - "InvalidProjectFile", e.Message); - } - // handle XML parsing errors (when reading project file) - catch (XmlException e) - { - BuildEventFileInfo fileInfo = new BuildEventFileInfo(e); - - ParentEngine.LoggingServices.LogError(buildEventContext, fileInfo, "InvalidProjectFile", e.Message); - - ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(false, fileInfo, - "InvalidProjectFile", e.Message); - } - finally - { - // Flush the logging queue - ParentEngine.LoggingServices.ProcessPostedLoggingEvents(); - } - } - } - - /// - /// Reads in the contents of this project from a string containing the Xml contents. - /// - /// - public void Load - ( - TextReader textReader - ) - { - Load(textReader, ProjectLoadSettings.None); - } - - /// - /// Reads in the contents of this project from a string containing the Xml contents. - /// - /// - public void Load - ( - TextReader textReader, - ProjectLoadSettings projectLoadSettings - ) - { - ErrorUtilities.VerifyThrowArgumentNull(textReader, nameof(textReader)); - - try - { - XmlDocument projectDocument = new XmlDocument(); - // XmlDocument.Load() may throw an XmlException - projectDocument.Load(textReader); - InternalLoadFromXmlDocument(projectDocument, projectLoadSettings); - - // This means that as far as we know, this project hasn't been saved to disk yet. - this.dirtyNeedToSaveProjectFile = true; - } - // handle errors in project syntax - catch (InvalidProjectFileException e) - { - ParentEngine.LoggingServices.LogInvalidProjectFileError(projectBuildEventContext, e); - throw; - } - // handle XML parsing errors (when reading XML contents) - catch (XmlException e) - { - BuildEventFileInfo fileInfo = new BuildEventFileInfo(e); - - ParentEngine.LoggingServices.LogError(projectBuildEventContext, fileInfo, "InvalidProjectFile", e.Message); - - ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(false, fileInfo, - "InvalidProjectFile", e.Message); - } - } - - /// - /// Reads in the contents of this project from a string containing the Xml contents. - /// - /// - public void LoadXml - ( - string projectXml - ) - { - LoadXml(projectXml, ProjectLoadSettings.None); - } - - /// - /// Reads in the contents of this project from a string containing the Xml contents. - /// - /// - public void LoadXml - ( - string projectXml, - ProjectLoadSettings projectLoadSettings - ) - { - ErrorUtilities.VerifyThrowArgumentNull(projectXml, nameof(projectXml)); - - try - { - XmlDocument projectDocument = new XmlDocument(); - // XmlDocument.Load() may throw an XmlException - projectDocument.LoadXml(projectXml); - - InternalLoadFromXmlDocument(projectDocument, projectLoadSettings); - - // This means that as far as we know, this project hasn't been saved to disk yet. - this.dirtyNeedToSaveProjectFile = true; - } - // handle errors in project syntax - catch (InvalidProjectFileException e) - { - ParentEngine.LoggingServices.LogInvalidProjectFileError(projectBuildEventContext, e); - throw; - } - // handle XML parsing errors (when reading XML contents) - catch (XmlException e) - { - BuildEventFileInfo fileInfo = new BuildEventFileInfo(e); - - ParentEngine.LoggingServices.LogError(projectBuildEventContext, null, fileInfo, "InvalidProjectFile", e.Message); - - ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(false, fileInfo, - "InvalidProjectFile", e.Message); - } - } - - /// - /// Reads in the contents of this project from an in-memory XmlDocument handed to us. - /// - /// - internal void LoadFromXmlDocument - ( - XmlDocument projectXml, - BuildEventContext buildEventContext, - ProjectLoadSettings projectLoadSettings - ) - { - ErrorUtilities.VerifyThrowArgumentNull(projectXml, nameof(projectXml)); - - try - { - InternalLoadFromXmlDocument(projectXml, projectLoadSettings); - } - // handle errors in project syntax - catch (InvalidProjectFileException e) - { - ParentEngine.LoggingServices.LogInvalidProjectFileError(buildEventContext, e); - throw; - } - } - - /// - /// Reads in the contents of this project from an in-memory XmlDocument. - /// - /// This method throws exceptions -- it is the responsibility of the caller to handle them. - /// - private void InternalLoadFromXmlDocument(XmlDocument projectXml, ProjectLoadSettings projectLoadSettings) - { - try - { - ErrorUtilities.VerifyThrow(projectXml != null, "Need project XML."); - - this.loadSettings = projectLoadSettings; - this.mainProjectEntireContents = projectXml; - - // Get the top-level nodes from the XML. - XmlNodeList projectFileNodes = mainProjectEntireContents.ChildNodes; - - // The XML parser will guarantee that we only have one real root element, - // but we need to find it amongst the other types of XmlNode at the root. - foreach (XmlNode childNode in projectFileNodes) - { - if (XmlUtilities.IsXmlRootElement(childNode)) - { - this.mainProjectElement = (XmlElement)childNode; - break; - } - } - - // Verify that we found a non-comment root node - ProjectErrorUtilities.VerifyThrowInvalidProject(this.mainProjectElement != null, - this.mainProjectEntireContents, - "NoRootProjectElement", XMakeElements.project); - - // If we have a node, tell the user they must upgrade the project - ProjectErrorUtilities.VerifyThrowInvalidProject(mainProjectElement.LocalName != XMakeElements.visualStudioProject, - mainProjectElement, "ProjectUpgradeNeeded"); - - // This node must be a node. - ProjectErrorUtilities.VerifyThrowInvalidProject(this.mainProjectElement.LocalName == XMakeElements.project, - this.mainProjectElement, "UnrecognizedElement", this.mainProjectElement.Name); - - ProjectErrorUtilities.VerifyThrowInvalidProject((mainProjectElement.Prefix.Length == 0) && (String.Equals(mainProjectElement.NamespaceURI, XMakeAttributes.defaultXmlNamespace, StringComparison.OrdinalIgnoreCase)), - mainProjectElement, "ProjectMustBeInMSBuildXmlNamespace", XMakeAttributes.defaultXmlNamespace); - - MarkProjectAsDirtyForReprocessXml(); - this.RefreshProjectIfDirty(); - } - catch (InvalidProjectFileException) - { - // Make sure the engine doesn't keep bad projects around - if (this.IsLoadedByHost) - { - Engine rememberParentEngine = this.ParentEngine; - this.ParentEngine.UnloadProject(this); - this.parentEngine = rememberParentEngine; - } - throw; - } - } - - /// - /// Saves the current contents of the project to an XML project file on disk. - /// This method will NOT add the ?xml node if it's not already present - /// - /// - /// RGoel - public void Save - ( - string projectFileName - ) - { - Save(projectFileName, this.Encoding); - } - - /// - /// Saves the current contents of the project to an XML project file on - /// disk using the supplied encoding. - /// - /// - /// - /// LukaszG - public void Save - ( - string projectFileName, - Encoding encoding - ) - { - { - // HIGHCHAR: Project.SaveToFileWithEncoding accepts encoding from caller. - using (ProjectWriter projectWriter = new ProjectWriter(projectFileName, encoding)) - { - projectWriter.Initialize(mainProjectEntireContents, XmlDeclarationNode); - mainProjectEntireContents.Save(projectWriter); - } - - // Update the project filename/path if it has changed. - string newFullProjectFilePath = Path.GetFullPath(projectFileName); - if (!String.Equals(newFullProjectFilePath, this.FullFileName, StringComparison.OrdinalIgnoreCase)) - { - this.FullFileName = newFullProjectFilePath; - } - - // reset the dirty flag - dirtyNeedToSaveProjectFile = false; - } - } - - /// - /// Saves the current contents of the project to a TextWriter object. - /// - /// - /// RGoel - public void Save - ( - TextWriter textWriter - ) - { - using (ProjectWriter projectWriter = new ProjectWriter(textWriter)) - { - projectWriter.Initialize(mainProjectEntireContents, XmlDeclarationNode); - mainProjectEntireContents.Save(projectWriter); - } - } - - /// - /// Adds a new <PropertyGroup> element to the project, and returns the - /// corresponding BuildPropertyGroup object which can then be populated with - /// properties. - /// - /// - /// - /// RGoel - public BuildPropertyGroup AddNewPropertyGroup - ( - bool insertAtEndOfProject - ) - { - BuildPropertyGroup newPropertyGroup = new BuildPropertyGroup - ( - this, - this.mainProjectEntireContents, - false /* Not imported */ - ); - - if (insertAtEndOfProject) - { - this.mainProjectElement.AppendChild(newPropertyGroup.PropertyGroupElement); - this.rawPropertyGroups.InsertAtEnd(newPropertyGroup); - } - else - { - // We add the new property group just after the last property group in the - // main project file. If there are currently no property groups in the main - // project file, we add this one to the very beginning of the project file. - BuildPropertyGroup lastLocalPropertyGroup = this.rawPropertyGroups.LastLocalPropertyGroup; - if (lastLocalPropertyGroup != null) - { - this.mainProjectElement.InsertAfter(newPropertyGroup.PropertyGroupElement, - lastLocalPropertyGroup.PropertyGroupElement); - this.rawPropertyGroups.InsertAfter(newPropertyGroup, lastLocalPropertyGroup); - } - else - { - this.mainProjectElement.PrependChild(newPropertyGroup.PropertyGroupElement); - this.rawPropertyGroups.InsertAtBeginning(newPropertyGroup); - } - } - - this.MarkProjectAsDirty(); - - return newPropertyGroup; - } - - /// - /// Adds a new <PropertyGroup> element to the project, and returns the - /// corresponding BuildPropertyGroup object which can then be populated with - /// properties. - /// - /// DavidLe - /// - /// - private BuildPropertyGroup AddNewImportedPropertyGroup - ( - string importedFilename, - string condition - ) - { - BuildPropertyGroup newPropertyGroup = new BuildPropertyGroup - ( - this, - importedFilename, - condition - ); - - if (this.imports[importedFilename] != null) - { - this.rawGroups.InsertAfter(newPropertyGroup, this.imports[importedFilename]); - } - else - { - this.rawPropertyGroups.InsertAtBeginning(newPropertyGroup); - } - - return newPropertyGroup; - } - - /// - /// Sets (or adds) a property to the project at a sensible location. - /// - /// - /// - /// RGoel - public void SetProperty - ( - string propertyName, - string propertyValue - ) - { - this.SetProperty(propertyName, propertyValue, null); - } - - /// - /// This method is called from the IDE to set a particular property at - /// the project level. The IDE doesn't care which property group it's - /// in, as long as it gets set. This method will search the existing - /// property groups for a property with this name. If found, it will - /// change the value in place. Otherwise, it will either add a new - /// property to that property group, or possibly even add a new property - /// group to the project. - /// - /// This method also takes the "Condition" string for the property group - /// that the IDE wants this property placed under. - /// - /// RGoel, DavidLe - /// - /// - /// - public void SetProperty - ( - string propertyName, - string propertyValue, - string condition - ) - { - SetProperty - ( - propertyName, - propertyValue, - condition, - PropertyPosition.UseExistingOrCreateAfterLastPropertyGroup - ); - } - - /// - /// Sets the value of a property that comes from an imported project. - /// Updates the current project (the one this method is called on) with - /// a property that has no Xml behind it, and updates the imported project - /// with a real backed property. - /// - /// DavidLe - /// - /// - /// - /// - public void SetImportedProperty - ( - string propertyName, - string propertyValue, - string condition, - Project importProject - ) - { - SetImportedProperty - ( - propertyName, - propertyValue, - condition, - importProject, - PropertyPosition.UseExistingOrCreateAfterLastPropertyGroup - ); - } - - /// - /// Set a property at a particular position inside the project file. - /// The property will be in a group that has the specified condition. - /// If necessary, a new property or property group will be created. - /// - /// Property name. - /// Property value. - /// The condition for this property. - /// Specifies the position within the project file for the property. - /// RGoel - public void SetProperty - ( - string propertyName, - string propertyValue, - string condition, - PropertyPosition position - ) - { - SetPropertyAtHelper(propertyName, propertyValue, condition, /* importedProperty */ false, null, position); - } - - /// - /// Sets a property, and optionally escapes it so that it will be treated as a literal - /// value despite any special characters that may be in it. - /// - /// - /// - /// - /// - /// - /// RGoel - public void SetProperty - ( - string propertyName, - string propertyValue, - string condition, - PropertyPosition position, - bool treatPropertyValueAsLiteral - ) - { - this.SetProperty(propertyName, - treatPropertyValueAsLiteral ? EscapingUtilities.Escape(propertyValue) : propertyValue, - condition, position); - } - - /// - /// Set a property at a particular position inside an imported project file. - /// The property will be in a group that has the specified condition. - /// If necessary, a new property or property group will be created. - /// - /// Property name. - /// Property value. - /// The condition for this property. - /// Specifies the project the property is imported from. - /// Specifies the position within the project file for the property. - /// DavidLe - public void SetImportedProperty - ( - string propertyName, - string propertyValue, - string condition, - Project importedProject, - PropertyPosition position - ) - { - SetPropertyAtHelper(propertyName, propertyValue, condition, /* importedProperty */ true, importedProject, position); - importedProject.SetPropertyAtHelper(propertyName, propertyValue, condition, /* importedProperty */ false, null, position); - } - - /// - /// Set a property at a particular position inside an imported project file. - /// The property will be in a group that has the specified condition. - /// If necessary, a new property or property group will be created. - /// - /// Property name. - /// Property value. - /// The condition for this property. - /// Specifies the project the property is imported from. - /// Specifies the position within the project file for the property. - /// - /// RGoel - public void SetImportedProperty - ( - string propertyName, - string propertyValue, - string condition, - Project importedProject, - PropertyPosition position, - bool treatPropertyValueAsLiteral - ) - { - this.SetImportedProperty(propertyName, - treatPropertyValueAsLiteral ? EscapingUtilities.Escape(propertyValue) : propertyValue, - condition, importedProject, position); - } - - /// - /// Set a property at a particular position inside the project file. - /// The property will be in a group that has the specified condition. - /// If necessary, a new property or property group will be created. - /// - /// Property name. - /// Property value. - /// The condition for this property. - /// Is the property an imported property. - /// The project from which the property is imported, if it is an imported property. - /// Specifies the position within the project file for the property. - /// RGoel, JomoF, DavidLe - internal void SetPropertyAtHelper - ( - string propertyName, - string propertyValue, - string condition, - bool importedProperty, - Project importedProject, - PropertyPosition position - ) - { - // Property name must be non-empty. - error.VerifyThrowArgumentLength(propertyName, nameof(propertyName)); - - // Property value must be non-null. - error.VerifyThrowArgument(propertyValue != null, - "CannotSetPropertyToNull"); - - // Condition can be null, but that's the same as empty condition. - if (condition == null) - { - condition = String.Empty; - } - - // Is this an "after import" position? - bool afterImportPosition = (position == PropertyPosition.UseExistingOrCreateAfterLastImport); - - BuildPropertyGroup matchingPropertyGroup = null; - BuildProperty matchingProperty = null; - - string importedFilename = null; - if (importedProperty) - { - importedFilename = importedProject.FullFileName; - } - - // Find a matching property and\or property group. - FindMatchingPropertyPosition(propertyName, condition, afterImportPosition, importedProperty, importedFilename, ref matchingPropertyGroup, ref matchingProperty); - - // If we found the property already in the project file, just change its value. - if (matchingProperty != null) - { - matchingProperty.SetValue(propertyValue); - } - else - { - // Otherwise, add a new property to the last matching property group we - // found. If we didn't find any matching property groups, create a new - // one. - if (matchingPropertyGroup == null) - { - if (importedProperty) - { - matchingPropertyGroup = this.AddNewImportedPropertyGroup(importedFilename, condition); - } - else - { - matchingPropertyGroup = this.AddNewPropertyGroup(afterImportPosition); - matchingPropertyGroup.Condition = condition; - } - } - - if (importedProperty) - { - matchingPropertyGroup.AddNewImportedProperty(propertyName, propertyValue, importedProject); - } - else - { - matchingPropertyGroup.AddNewProperty(propertyName, propertyValue); - } - } - } - - /// - /// This method will attempt to find an existing property group and property that matches the requirements. - /// If no property is found then matchingProperty will be null. - /// If no property group is found then matchingPropertyGroup will be null. - /// - /// The name of the property to match. - /// The condition on the property to match. - /// If true, then the matching property must be after the last import. - /// Is the BuildPropertyGroup imported or not. - /// Name of the imported project (if BuildPropertyGroup is imported). - /// Receives the matching property group. Null if none found. - /// Receives the matching property. Null if none found. - /// RGoel - private void FindMatchingPropertyPosition - ( - string propertyName, - string condition, - bool matchOnlyAfterImport, - bool importedPropertyGroup, - string importedFilename, - ref BuildPropertyGroup matchingPropertyGroup, - ref BuildProperty matchingProperty - ) - { - // Search all of our existing (persisted) PropertyGroups for one - // that is both local to the main project file, and has a "Condition" - // matching the string that was passed in. - foreach (BuildPropertyGroup propertyGroup in this.PropertyGroups) - { - // If property groups after import requested then reset any - // current state when a new import is encountered. - if (!importedPropertyGroup && matchOnlyAfterImport && propertyGroup.IsImported) - { - matchingPropertyGroup = null; - matchingProperty = null; - } - - if (propertyGroup.IsImported == importedPropertyGroup && - (String.Equals(propertyGroup.Condition.Trim(), condition.Trim(), StringComparison.OrdinalIgnoreCase)) && - (!importedPropertyGroup || (importedPropertyGroup && (String.Equals(propertyGroup.ImportedFromFilename, importedFilename, StringComparison.OrdinalIgnoreCase))))) - { - if (matchingPropertyGroup == null) - { - // We found a matching property group. Our current heuristic is - // that we always stick the property into the *first* property group - // that matches the requirements. (That's the reason for the - // "if matchingPropertyGroup==null" above.) - matchingPropertyGroup = propertyGroup; - } - - // Now loop through the property group, and search for the given - // property. - foreach (BuildProperty property in propertyGroup) - { - if (String.Equals(property.Name, propertyName, StringComparison.OrdinalIgnoreCase)) - { - matchingProperty = property; - } - } - } - } - } - - /// - /// Removes all <PropertyGroup>'s from the main project file, but doesn't - /// touch anything in any of the imported project files. - /// - /// RGoel - public void RemoveAllPropertyGroups - ( - ) - { - this.rawGroups.RemoveAllPropertyGroups(); - } - - /// - /// Removes all <PropertyGroup>'s from the main project file that have a - /// specific "Condition". This will not remove any property groups from - /// imported project files. - /// - /// Condition on the PropertyGroups - /// - /// RGoel - public void RemovePropertyGroupsWithMatchingCondition - ( - string matchCondition, - bool includeImportedPropertyGroups - ) - { - this.rawGroups.RemoveAllPropertyGroupsByCondition(matchCondition, includeImportedPropertyGroups); - } - - /// - /// Removes all <PropertyGroup>'s from the main project file that have a - /// specific "Condition". This will not remove any property groups from - /// imported project files. - /// - /// Condition on the PropertyGroups - /// RGoel - public void RemovePropertyGroupsWithMatchingCondition - ( - string matchCondition - ) - { - RemovePropertyGroupsWithMatchingCondition(matchCondition, false /* do not include imported constructs */); - } - - /// - /// Removes a <PropertyGroup> from the main project file. - /// - /// - /// RGoel - public void RemovePropertyGroup - ( - BuildPropertyGroup propertyGroupToRemove - ) - { - error.VerifyThrowArgumentNull(propertyGroupToRemove, nameof(propertyGroupToRemove)); - - // Confirm that it's not an imported property group. - error.VerifyThrowInvalidOperation(!propertyGroupToRemove.IsImported, - "CannotModifyImportedProjects"); - - // Confirm that it's actually a persisted BuildPropertyGroup in the current project. - error.VerifyThrowInvalidOperation( - (propertyGroupToRemove.ParentProject == this) && (propertyGroupToRemove.PropertyGroupElement != null), - "IncorrectObjectAssociation", "BuildPropertyGroup", "Project"); - - // Clear out the children of the property group. - propertyGroupToRemove.Clear(); - - XmlElement parentElement = propertyGroupToRemove.ParentElement; - ErrorUtilities.VerifyThrow(parentElement != null, "Why doesn't this PG have a parent XML element?"); - parentElement.RemoveChild(propertyGroupToRemove.PropertyGroupElement); - - ErrorUtilities.VerifyThrow(propertyGroupToRemove.ParentCollection != null, "Why doesn't this PG have a parent collection?"); - propertyGroupToRemove.ParentCollection.RemovePropertyGroup(propertyGroupToRemove); - - propertyGroupToRemove.ClearParentProject(); - - this.MarkProjectAsDirty(); - } - - /// - /// Removes a <PropertyGroup> from the main project file. - /// - /// - public void RemoveImportedPropertyGroup - ( - BuildPropertyGroup propertyGroupToRemove - ) - { - error.VerifyThrowArgumentNull(propertyGroupToRemove, nameof(propertyGroupToRemove)); - - // Confirm that it's actually a persisted BuildPropertyGroup in the current project. - error.VerifyThrowInvalidOperation( - (propertyGroupToRemove.ParentProject == this) && (propertyGroupToRemove.PropertyGroupElement != null), - "IncorrectObjectAssociation", "BuildPropertyGroup", "Project"); - - // Clear out the children of the property group. - propertyGroupToRemove.ClearImportedPropertyGroup(); - - ErrorUtilities.VerifyThrow(propertyGroupToRemove.ParentCollection != null, "Why doesn't this PG have a parent collection?"); - propertyGroupToRemove.ParentCollection.RemovePropertyGroup(propertyGroupToRemove); - - propertyGroupToRemove.ClearParentProject(); - - this.MarkProjectAsDirtyForReevaluation(); - } - - /// - /// Adds a new <ItemGroup> element to the project, and returns the - /// corresponding BuildItemGroup object which can then be populated with - /// items or anything else that might belong inside an <ItemGroup>. - /// - /// - /// RGoel - public BuildItemGroup AddNewItemGroup - ( - ) - { - BuildItemGroup newItemGroup = new BuildItemGroup - ( - this.mainProjectEntireContents, - false, /* Not imported */ - this /*parent project*/ - ); - - // We normally add the new BuildItemGroup just after the last existing BuildItemGroup - // in the main project file. - BuildItemGroup lastLocalItemGroup = this.rawItemGroups.LastLocalItemGroup; - if (lastLocalItemGroup != null) - { - this.mainProjectElement.InsertAfter(newItemGroup.ItemGroupElement, - lastLocalItemGroup.ItemGroupElement); - this.rawItemGroups.InsertAfter(newItemGroup, lastLocalItemGroup); - } - else - { - // If there are currently no ItemGroups in the main project file, - // then we check two other things ... are there any PropertyGroups - // in the main project file, and are there are any ItemGroups at all - // -- either local or imported. - BuildPropertyGroup lastLocalPropertyGroup = this.rawPropertyGroups.LastLocalPropertyGroup; - if ((this.rawItemGroups.Count == 0) && (lastLocalPropertyGroup != null)) - { - // There are no ItemGroups at all -- either imported or local. - // And there is at least one BuildPropertyGroup in the main project file. - // So, in this case, we add the BuildItemGroup just after the last - // BuildPropertyGroup in the main project file. - - // We don't want to do this if there are some imported ItemGroups, - // because then our ordering would get screwed up. - this.mainProjectElement.InsertAfter(newItemGroup.ItemGroupElement, - lastLocalPropertyGroup.PropertyGroupElement); - } - else - { - // If there are no local PropertyGroups, or we have imported - // ItemGroups, then do the safe thing and just stick this new - // BuildItemGroup on to the very end of the project. - this.mainProjectElement.AppendChild(newItemGroup.ItemGroupElement); - } - - // Add the new BuildItemGroup to the very end of our collection. This should - // be the correct location relative to the other ItemGroups. - this.rawItemGroups.InsertAtEnd(newItemGroup); - } - - this.MarkProjectAsDirty(); - - return newItemGroup; - } - - /// - /// Adds a new item to the project, and optionally escapes the Include value so it's treated as a literal value. - /// - /// - /// - /// - /// - /// RGoel - public BuildItem AddNewItem - ( - string itemName, - string itemInclude, - bool treatItemIncludeAsLiteral - ) - { - return this.AddNewItem(itemName, treatItemIncludeAsLiteral ? EscapingUtilities.Escape(itemInclude) : itemInclude); - } - - /// - /// Called from the IDE to add a new item of a particular type to the project file. This method tries to add the new item - /// near the other items of the same type. - /// - /// RGoel - /// The name of the item list this item belongs to. - /// The value of the item's Include attribute i.e. the item-spec - /// The new item after evaluation. - public BuildItem AddNewItem - ( - string itemName, - string itemInclude - ) - { - ErrorUtilities.VerifyThrowArgumentLength(itemName, nameof(itemName)); - ErrorUtilities.VerifyThrowArgumentLength(itemInclude, nameof(itemInclude)); - - BuildItemGroup matchingItemGroup = null; - - // Search all of our existing (persisted) ItemGroups for one that is: - // 1.) local to the main project file - // 2.) a top-level BuildItemGroup, as opposed to a nested BuildItemGroup. - // 3.) has no "Condition" - // 4.) contains at least one item of the same type as the new item being added. - foreach (BuildItemGroup itemGroup in this.rawItemGroups) - { - if ( - (!itemGroup.IsImported) && - (itemGroup.Condition.Length == 0) - ) - { - // Now loop through the Items in the BuildItemGroup, and see if there's one of - // the same type as the new item being added. - foreach (BuildItem originalItem in itemGroup) - { - if (String.Equals(originalItem.Name, itemName, StringComparison.OrdinalIgnoreCase)) - { - // If the new item that the user is trying to add is already covered by - // a wildcard in an existing item of the project, then there's really - // no need to physically touch the project file. As long as the new item - // is on disk, the next reevaluation will automatically pick it up. When - // customers employ the use of wildcards in their project files, and then - // they add new items through the IDE, they would much prefer that the IDE - // does not touch their project files. - if (originalItem.NewItemSpecMatchesExistingWildcard(itemInclude)) - { - BuildItem tempNewItem = new BuildItem(itemName, itemInclude); - tempNewItem.SetEvaluatedItemSpecEscaped(itemInclude); - tempNewItem.SetFinalItemSpecEscaped((new Expander(evaluatedProperties)).ExpandAllIntoStringLeaveEscaped(itemInclude, null)); - - // We didn't touch the project XML, but we still need to add the new - // item to the appropriate data structures, and we need to have something - // to hand back to the project system so it can modify the new item - // later if needed. - BuildItem newItem = BuildItem.CreateClonedParentedItem(tempNewItem, originalItem); - - AddToItemListByNameIgnoringCondition(newItem); - - // Set up the other half of the parent/child relationship. - newItem.ParentPersistedItem.ChildItems.AddItem(newItem); - - // Don't bother adding to item lists by name, as we're going to have to evaluate the project as a whole later anyway - - // We haven't actually changed the XML for the project, because we're - // just piggybacking onto an existing item that was a wildcard. However, - // we should reevaluate on the next build. - this.MarkProjectAsDirtyForReevaluation(); - - return newItem; - } - - matchingItemGroup = itemGroup; - break; - } - } - } - } - - // If we didn't find a matching BuildItemGroup, create a new one. - if (matchingItemGroup == null) - { - matchingItemGroup = this.AddNewItemGroup(); - } - - // Add the new item to the appropriate place within the BuildItemGroup. This - // will attempt to keep items of the same type physically contiguous. - BuildItem itemToAdd = matchingItemGroup.AddNewItem(itemName, itemInclude); - - // Since we're re-evaluating the project, clear out the previous list of child items - // for each persisted item tag. - itemToAdd.ChildItems.Clear(); - - // Add this new item into the appropriate evaluated item tables for this project. - BuildItemGroup items = BuildItemGroup.ExpandItemIntoItems(ProjectDirectory, itemToAdd, new Expander(evaluatedProperties, evaluatedItemsByName), false /* do not expand metadata */); - - foreach (BuildItem item in items) - { - BuildItem newItem = BuildItem.CreateClonedParentedItem(item, itemToAdd); - - AddToItemListByNameIgnoringCondition(newItem); - - // Set up the other half of the parent/child relationship. - newItem.ParentPersistedItem.ChildItems.AddItem(newItem); - - // Don't bother adding to item lists by name, as we're going to have to evaluate the project as a whole later anyway - } - - this.MarkProjectAsDirty(); - - // Return the *evaluated* item to the caller. This way he can ask for evaluated item metadata, etc. - // It also makes it consistent, because the IDE at project-load asks for all evaluated items, - // and caches those pointers. We know the IDE is going to cache this pointer as well, so we - // should give back an evaluated item here as well. - return (itemToAdd.ChildItems.Count > 0) ? itemToAdd.ChildItems[0] : null; - } - - /// - /// Removes all <ItemGroup>'s from the main project file, but doesn't - /// touch anything in any of the imported project files. - /// - /// RGoel - public void RemoveAllItemGroups - ( - ) - { - this.rawGroups.RemoveAllItemGroups(); - } - - /// - /// Removes all <ItemGroup>'s from the main project file that have a - /// specific "Condition". This will not remove any item groups from - /// imported project files. - /// - /// - /// RGoel - public void RemoveItemGroupsWithMatchingCondition - ( - string matchCondition - ) - { - this.rawGroups.RemoveAllItemGroupsByCondition(matchCondition); - } - - /// - /// Removes a <ItemGroup> from the main project file. - /// - /// - /// RGoel - public void RemoveItemGroup - ( - BuildItemGroup itemGroupToRemove - ) - { - error.VerifyThrowArgumentNull(itemGroupToRemove, nameof(itemGroupToRemove)); - - // Confirm that it's not an imported item group. - error.VerifyThrowInvalidOperation(!itemGroupToRemove.IsImported, - "CannotModifyImportedProjects"); - - // Confirm that it's actually a persisted BuildItemGroup in the current project. - error.VerifyThrowInvalidOperation( - (itemGroupToRemove.ParentProject == this) && (itemGroupToRemove.ItemGroupElement != null), - "IncorrectObjectAssociation", "BuildItemGroup", "Project"); - - // Clear out the children of the BuildItemGroup. - itemGroupToRemove.Clear(); - - XmlElement parentElement = itemGroupToRemove.ParentElement; - ErrorUtilities.VerifyThrow(parentElement != null, "Why doesn't this IG have a parent XML element?"); - parentElement.RemoveChild(itemGroupToRemove.ItemGroupElement); - - // Remove the item group from our collection. - ErrorUtilities.VerifyThrow(itemGroupToRemove.ParentCollection != null, "Why doesn't this IG have a parent collection?"); - itemGroupToRemove.ParentCollection.RemoveItemGroup(itemGroupToRemove); - - itemGroupToRemove.ClearParentProject(); - this.MarkProjectAsDirty(); - } - - /// - /// Removes all items of a particular type from the main project file. - /// - /// - /// RGoel - public void RemoveItemsByName - ( - string itemName - ) - { - this.rawGroups.RemoveItemsByName(itemName); - } - - /// - /// Removes an item from the main project file. - /// - /// - /// RGoel - public void RemoveItem - ( - BuildItem itemToRemove - ) - { - error.VerifyThrowArgumentNull(itemToRemove, nameof(itemToRemove)); - - // Confirm that it's not an imported item. - error.VerifyThrowInvalidOperation(!itemToRemove.IsImported, "CannotModifyImportedProjects"); - BuildItemGroup parentItemGroup; - - if (itemToRemove.ParentPersistedItem == null) - { - // This is either a persisted item that's actually declared in the project file, - // or it's some kind of intermediate virtual item. - - // If the item doesn't have a parent BuildItemGroup associated with it, then it - // must not be a persisted item that's actually declared in the project file. - parentItemGroup = itemToRemove.ParentPersistedItemGroup; - error.VerifyThrowInvalidOperation(parentItemGroup != null, "ObjectIsNotInProject"); - } - else - { - // This is an evaluated item that came from a persisted item tag declared in - // the project file. - - // If the item tag produced more than one evaluated item, then it's time to - // split up the item tag into several new item tags. - itemToRemove.SplitChildItemIfNecessary(); - - error.VerifyThrow(itemToRemove.ParentPersistedItem != null, "No parent BuildItem for item to be removed."); - itemToRemove = itemToRemove.ParentPersistedItem; - - error.VerifyThrow(itemToRemove.ParentPersistedItemGroup != null, - "No parent BuildItemGroup for item to be removed."); - parentItemGroup = itemToRemove.ParentPersistedItemGroup; - } - - parentItemGroup.RemoveItem(itemToRemove); - - if (parentItemGroup.Count == 0) - { - this.RemoveItemGroup(parentItemGroup); - } - - this.MarkProjectAsDirty(); - } - - /// - /// Adds a new <Import> element to the end of the project. - /// - /// - /// - /// RGoel - public void AddNewImport - ( - string projectFile, - string condition - ) - { - imports.AddNewImport(projectFile, condition); - } - - /// - /// Helper for AddNewUsingTaskFromAssemblyName and AddNewUsingTaskFromAssemblyFile - /// - /// - /// - /// - private void AddNewUsingTaskHelper(string taskName, string assembly, bool assemblyFile) - { - XmlElement newUsingTaskElement = this.mainProjectEntireContents.CreateElement(XMakeElements.usingTask, XMakeAttributes.defaultXmlNamespace); - this.mainProjectElement.AppendChild(newUsingTaskElement); - - newUsingTaskElement.SetAttribute(XMakeAttributes.taskName, taskName); - - if (assemblyFile) - { - newUsingTaskElement.SetAttribute(XMakeAttributes.assemblyFile, assembly); - } - else - { - newUsingTaskElement.SetAttribute(XMakeAttributes.assemblyName, assembly); - } - - this.MarkProjectAsDirtyForReprocessXml(); - } - - /// - /// Adds a new <UsingTask> element to the end of the project - /// - /// - /// - /// LukaszG - public void AddNewUsingTaskFromAssemblyName(string taskName, string assemblyName) - { - AddNewUsingTaskHelper(taskName, assemblyName, false /* use assembly name */); - } - - /// - /// Adds a new <UsingTask> element to the end of the project - /// - /// - /// - /// LukaszG - public void AddNewUsingTaskFromAssemblyFile(string taskName, string assemblyFile) - { - AddNewUsingTaskHelper(taskName, assemblyFile, true /* use assembly file */); - } - - /// - /// Sets the project extensions string. - /// - /// JomoF - /// - /// - public void SetProjectExtensions(string id, string content) - { - // Lazily create the extensions node if it doesn't exist. - if (projectExtensionsNode == null) - { - // No need to create the node if there wouldn't be anything to set. - if (content.Length == 0) - { - return; - } - - projectExtensionsNode = mainProjectEntireContents.CreateElement(XMakeElements.projectExtensions, XMakeAttributes.defaultXmlNamespace); - mainProjectElement.AppendChild(projectExtensionsNode); - } - - // Look in the extensions node and see if there is a child that matches - XmlElement idElement = (XmlElement)projectExtensionsNode[id]; - - // Found anything? - if (idElement == null) - { - idElement = mainProjectEntireContents.CreateElement(id, XMakeAttributes.defaultXmlNamespace); - projectExtensionsNode.AppendChild(idElement); - } - - // Now there should be an idElement, set its InnerXml to be xmlText. - idElement.InnerXml = content; - - // We don't need to re-evaluate anything (so don't call MarkProjectAsDirty), - // but the project file still needs to be saved to disk. - this.MarkProjectAsDirtyForSave(); - } - - /// - /// Returns the project extensions string for the given ID. - /// - /// JomoF - /// - /// String value of specified ID. - public string GetProjectExtensions(string id) - { - if (projectExtensionsNode == null) - { - return String.Empty; - } - - // Look in the extensions node and see if there is a child that matches - XmlElement idElement = (XmlElement)projectExtensionsNode[id]; - - // Found anything? - if (idElement == null) - { - // No, so return "". - return String.Empty; - } - - // Now there should be an idElement, return its InnerXml. - // HACK: remove the xmlns attribute, because the IDE's not expecting that - return Utilities.RemoveXmlNamespace(idElement.InnerXml); - } - - /// - /// Builds the default targets in this project. - /// - /// - /// RGoel - public bool Build - ( - ) - { - return this.ParentEngine.BuildProject(this, null, null, BuildSettings.None); - } - - /// - /// Builds the specified target in this project. - /// - /// - /// - /// JomoF - public bool Build - ( - string targetName - ) - { - return this.ParentEngine.BuildProject(this, (targetName == null) ? null : new string[] { targetName }, - null, BuildSettings.None); - } - - /// - /// Builds the specified list of targets in this project. - /// - /// - /// This is the public method that host IDEs can call to build a project. - /// It just turns around and calls "BuildProject" on the engine object. - /// All builds must go through the engine object, because it needs to - /// keep track of the projects that are currently in progress, so that - /// we don't end up in infinite loops when we have circular project-to- - /// project dependencies. - /// - /// - /// - /// RGoel - public bool Build - ( - string[] targetNames // can be null to build the default targets - ) - { - return this.ParentEngine.BuildProject(this, targetNames, null, BuildSettings.None); - } - - /// - /// Builds the specified list of targets in this project, and returns the target outputs. - /// - /// - /// This is the public method that host IDEs can call to build a project. - /// It just turns around and calls "BuildProject" on the engine object. - /// All builds must go through the engine object, because it needs to - /// keep track of the projects that are currently in progress, so that - /// we don't end up in infinite loops when we have circular project-to- - /// project dependencies. - /// - /// - /// - /// - /// RGoel - public bool Build - ( - string[] targetNames, // can be null to build the default targets - IDictionary targetOutputs // can be null if outputs are not needed - ) - { - return this.ParentEngine.BuildProject(this, targetNames, targetOutputs, BuildSettings.None); - } - - /// - /// Builds the specified list of targets in this project using the specified - /// flags, and returns the target outputs. - /// - /// - /// This is the public method that host IDEs can call to build a project. - /// It just turns around and calls "BuildProject" on the engine object. - /// All builds must go through the engine object, because it needs to - /// keep track of the projects that are currently in progress, so that - /// we don't end up in infinite loops when we have circular project-to- - /// project dependencies. - /// - /// - /// - /// - /// - /// RGoel - public bool Build - ( - string[] targetNames, // can be null to build the default targets - IDictionary targetOutputs, // can be null if outputs are not needed - BuildSettings buildFlags - ) - { - return this.ParentEngine.BuildProject(this, targetNames, targetOutputs, buildFlags); - } - - /// - /// This internal method actually performs the build of the specified targets - /// in the project. If no targets are specified, then we build the - /// "defaultTargets" as specified in the attribute of the <Project> element - /// in the XML. - /// - /// - internal void BuildInternal - ( - BuildRequest buildRequest - ) - { - // First, make sure that this project has its targets/tasks enabled. They may have been disabled - // by the host for security reasons. - if (!this.BuildEnabled) - { - this.ParentEngine.LoggingServices.LogError(buildRequest.ParentBuildEventContext, new BuildEventFileInfo(FullFileName), "SecurityProjectBuildDisabled"); - buildRequest.BuildCompleted = true; - - if (buildRequest.HandleId != EngineCallback.invalidEngineHandle) - { - ParentEngine.Router.PostDoneNotice(buildRequest); - } - } - else - { - ProjectBuildState buildContext = InitializeForBuildingTargets(buildRequest); - if (buildContext != null) - { - ContinueBuild(buildContext, null); - } - } - } - - internal void ContinueBuild(ProjectBuildState buildContext, TaskExecutionContext taskExecutionContext) - { - if (Engine.debugMode) - { - Console.WriteLine("Project continue build :" + buildContext.BuildRequest.ProjectFileName + " Handle " + buildContext.BuildRequest.HandleId + " State " + buildContext.CurrentBuildContextState + - " current target " + buildContext.NameOfTargetInProgress + " blocking target " + buildContext.NameOfBlockingTarget); - } - bool exitedDueToError = true; - try - { - if (buildContext.CurrentBuildContextState == ProjectBuildState.BuildContextState.BuildingCurrentTarget) - { - // Execute the next appropriate operation for this target - ErrorUtilities.VerifyThrow(taskExecutionContext != null, "Task context should be non-null"); - taskExecutionContext.ParentTarget.ContinueBuild(taskExecutionContext.BuildContext, taskExecutionContext); - } - else if (buildContext.CurrentBuildContextState == ProjectBuildState.BuildContextState.StartingFirstTarget) - { - // Start the first target of the build request - buildContext.CurrentBuildContextState = ProjectBuildState.BuildContextState.BuildingCurrentTarget; - GetTargetForName(buildContext.NameOfTargetInProgress).Build(buildContext); - } - else if (buildContext.CurrentBuildContextState == ProjectBuildState.BuildContextState.CycleDetected) - { - ErrorUtilities.VerifyThrow( - taskExecutionContext?.ParentTarget != null, - "Unexpected task context. Should not be null"); - // Check that the target is in progress - ErrorUtilities.VerifyThrow( - taskExecutionContext.ParentTarget.TargetBuildState == Target.BuildState.InProgress, - "The target forming the cycle should not be complete"); - // Throw invalid project exeception - ProjectErrorUtilities.VerifyThrowInvalidProject - (false, taskExecutionContext.ParentTarget.TargetElement, - "CircularDependency", taskExecutionContext.ParentTarget.Name); - } - - CalculateNextActionForProjectContext(buildContext); - - exitedDueToError = false; - - if (Engine.debugMode) - { - Console.WriteLine("Project after continue build :" + buildContext.BuildRequest.ProjectFileName + " Handle " + buildContext.BuildRequest.HandleId + " State " + buildContext.CurrentBuildContextState + - " current target " + buildContext.NameOfTargetInProgress + " blocking target " + buildContext.NameOfBlockingTarget); - } - } - catch (InvalidProjectFileException e) - { - // Make sure the Invalid Project error gets logged *before* ProjectFinished. Otherwise, - // the log is confusing. - this.ParentEngine.LoggingServices.LogInvalidProjectFileError(buildContext.ProjectBuildEventContext, e); - } - finally - { - if ((exitedDueToError || buildContext.BuildComplete) && - buildContext.CurrentBuildContextState != ProjectBuildState.BuildContextState.RequestFilled) - { - // If the target that threw an exception is being built due to an - // dependson or onerror relationship, it is necessary to make sure - // the buildrequests waiting on targets below it get notified of the failure. In single - // threaded mode there is only a single outstanding request so this issue is avoided. - if (exitedDueToError) - { - buildContext.RecordBuildException(); - - if (buildContext.NameOfBlockingTarget != null) - { - while (buildContext.NameOfBlockingTarget != null) - { - Target blockingTarget = GetTargetForName(buildContext.NameOfBlockingTarget); - if (blockingTarget.ExecutionState?.BuildingRequiredTargets == true) - { - blockingTarget.ContinueBuild(buildContext, null); - } - - buildContext.RemoveBlockingTarget(); - } - Target inprogressTarget = GetTargetForName(buildContext.NameOfTargetInProgress); - if (inprogressTarget.ExecutionState?.BuildingRequiredTargets == true) - { - inprogressTarget.ContinueBuild(buildContext, null); - } - } - - buildContext.CurrentBuildContextState = ProjectBuildState.BuildContextState.BuildComplete; - } - - this.buildingCount--; - - if (buildContext.BuildRequest.FireProjectStartedFinishedEvents) - { - ParentEngine.LoggingServices.LogProjectFinished(buildContext.ProjectBuildEventContext, FullFileName, buildContext.BuildResult); - } - - // Notify targets in other projects that are waiting on us via IBuildEngine - // interface (via MSBuild and CallTarget tasks). - if (buildContext.BuildRequest.IsGeneratedRequest) - { - if (Engine.debugMode) - { - Console.WriteLine("Notifying about " + buildContext.BuildRequest.ProjectFileName + - " about " + buildContext.TargetNamesToBuild[0] + " on node " + buildContext.BuildRequest.NodeIndex + - " HandleId " + buildContext.BuildRequest.HandleId + " ReqID " + - buildContext.BuildRequest.RequestId); - } - ParentEngine.Router.PostDoneNotice(buildContext.BuildRequest); - } - - // Don't try to unload projects loaded by the host - if (this.buildingCount == 0 && this.needToUnloadProject && !this.IsLoadedByHost) - { - parentEngine.UnloadProject(this, false /* unload only this project version */); - } - - buildContext.CurrentBuildContextState = ProjectBuildState.BuildContextState.RequestFilled; - } - } - } - - internal void CalculateNextActionForProjectContext(ProjectBuildState buildContext) - { - // If the build request has been already complete - if (buildContext.CurrentBuildContextState == ProjectBuildState.BuildContextState.RequestFilled) - { - return; - } - - // In case the first step of the target failed, the target is empty or needs another target - // to be build, it is necessary to recalculate the next action. The loop below is broken as - // soon as a target completes or a target requests a task to be executed. - bool recalculateAction = true; - - while (recalculateAction) - { - recalculateAction = false; - - // Check if there is a dependent target - Target currentTarget; - if (buildContext.NameOfBlockingTarget != null) - { - currentTarget = GetTargetForName(buildContext.NameOfBlockingTarget); - - if (buildContext.CurrentBuildContextState == ProjectBuildState.BuildContextState.StartingBlockingTarget) - { - buildContext.CurrentBuildContextState = ProjectBuildState.BuildContextState.BuildingCurrentTarget; - ExecuteNextActionForProjectContext(buildContext, true); - recalculateAction = true; - } - else if (currentTarget.TargetBuildState != Target.BuildState.InProgress) - { - if (buildContext.CurrentBuildContextState == ProjectBuildState.BuildContextState.WaitingForTarget) - { - // Get target outputs before moving to the next target - currentTarget.Build(buildContext); - } - - buildContext.CurrentBuildContextState = ProjectBuildState.BuildContextState.BuildingCurrentTarget; - buildContext.RemoveBlockingTarget(); - ExecuteNextActionForProjectContext(buildContext, false); - recalculateAction = true; - } - } - else - { - currentTarget = GetTargetForName(buildContext.NameOfTargetInProgress); - if (currentTarget.TargetBuildState != Target.BuildState.InProgress) - { - if (buildContext.CurrentBuildContextState == ProjectBuildState.BuildContextState.WaitingForTarget) - { - // Get target outputs before moving to the next target - currentTarget.Build(buildContext); - buildContext.CurrentBuildContextState = ProjectBuildState.BuildContextState.BuildingCurrentTarget; - } - if (currentTarget.TargetBuildState == Target.BuildState.CompletedUnsuccessfully) - { - // Abort the request and notify everyone - buildContext.RecordBuildCompletion(false); - } - else - { - // Check if there are no more targets to run - if (buildContext.GetNextTarget() == null) - { - // The request is complete - buildContext.RecordBuildCompletion(true); - } - else - { - // Move to the next target in the request - ExecuteNextActionForProjectContext(buildContext, true); - recalculateAction = true; - } - } - } - } - } - } - - private void ExecuteNextActionForProjectContext(ProjectBuildState buildContext, bool initialCall) - { - Target nextTarget; - if (buildContext.NameOfBlockingTarget != null) - { - // Notify the next target in depends on/on error stack - nextTarget = GetTargetForName(buildContext.NameOfBlockingTarget); - } - else - { - nextTarget = GetTargetForName(buildContext.NameOfTargetInProgress); - } - - // Build the target. Note that this could throw an InvalidProjectFileException, in which - // case we want to make sure and still log the ProjectFinished event with completedSuccessfully=false. - if (initialCall) - { - nextTarget.Build(buildContext); - } - else - { - nextTarget.ContinueBuild(buildContext, null); - } - } - - private Target GetTargetForName(string name) - { - string targetNameToBuildUnescaped = EscapingUtilities.UnescapeAll(name); - - // Find the appropriate Target object based on the target name. - Target target = targets[targetNameToBuildUnescaped]; - - // If we couldn't find a target with that name, it's an error. - // (Or should we just continue anyway? This might be useful - // for pre-build and post-build steps.) - ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(target != null, - new BuildEventFileInfo(this.FullFileName), "TargetDoesNotExist", targetNameToBuildUnescaped); - return target; - } - - private ProjectBuildState InitializeForBuildingTargets(BuildRequest buildRequest) - { - ProjectBuildState buildContext = null; - - string[] targetNamesToBuild = buildRequest.TargetNames; - - // Initialize to the parent requests project context id - int projectContextId = buildRequest.ParentBuildEventContext.ProjectContextId; - - BuildEventContext buildEventContext = null; - - // Determine if a project started event is required to be fired, if so we may need a new projectContextId - if (buildRequest.FireProjectStartedFinishedEvents) - { - //If we have not already used the context from the project yet, lets use that as our first event context - if (!haveUsedInitialProjectContextId) - { - buildEventContext = projectBuildEventContext; - haveUsedInitialProjectContextId = true; - } - else // We are going to need a new Project context Id and a new buildEventContext - { - projectContextId = parentEngine.GetNextProjectId(); - } - } - - if (buildEventContext == null) - { - buildEventContext = new BuildEventContext - ( - projectBuildEventContext.NodeId, - projectBuildEventContext.TargetId, - projectContextId, - projectBuildEventContext.TaskId - ); - } - - bool exitedDueToError = true; - - try - { - // Refreshing (reevaluating) a project may end up calling ResetBuildStatus which will mark - // IsReset=true. This is legitimate because when a project is being reevaluated, we want - // to be explicit in saying that any targets that had run previously are no longer valid, - // and we must rebuild them on the next build. - this.RefreshProjectIfDirty(); - - // Only log the project started event after making sure the project is reevaluated if necessary, - // otherwise we could log stale item/property information. - if (!ParentEngine.LoggingServices.OnlyLogCriticalEvents && buildRequest.FireProjectStartedFinishedEvents) - { - string joinedTargetNamesToBuild = null; - if (targetNamesToBuild?.Length > 0) - { - joinedTargetNamesToBuild = EscapingUtilities.UnescapeAll(String.Join(";", targetNamesToBuild)); - } - - // Flag the start of the project build. - // - // This also passes all the current properties/items and their values. The logger might want to use the - // object it gets from this event to see updated property/item values later in the build: so be - // careful to use the original "evaluatedProperties" and "evaluatedItems" table, not the clone - // "EvaluatedProperties" or "EvaluatedItems" table. It's fine to pass these live tables, because we're - // wrapping them in read-only proxies. - BuildPropertyGroup propertyGroupForStartedEvent = this.evaluatedProperties; - - // If we are on the child process we need to fiure out which properties we need to serialize - if (ParentEngine.Router.ChildMode) - { - // Initially set it to empty so that we do not serialize all properties if we are on a child node - propertyGroupForStartedEvent = new BuildPropertyGroup(); - - // Get the list of properties to serialize to the parent node - string[] propertyListToSerialize = parentEngine.PropertyListToSerialize; - if (propertyListToSerialize?.Length > 0) - { - foreach (string propertyToGet in propertyListToSerialize) - { - BuildProperty property = this.evaluatedProperties[propertyToGet]; - - //property can be null if propertyToGet does not exist - if (property != null) - { - propertyGroupForStartedEvent.SetProperty(property); - } - } - } - } - - BuildPropertyGroupProxy propertiesProxy = new BuildPropertyGroupProxy(propertyGroupForStartedEvent); - BuildItemGroupProxy itemsProxy = new BuildItemGroupProxy(this.evaluatedItems); - - ParentEngine.LoggingServices.LogProjectStarted(this.projectId, buildRequest.ParentBuildEventContext, buildEventContext, FullFileName, joinedTargetNamesToBuild, propertiesProxy, itemsProxy); - - // See comment on DefaultToolsVersion setter. - if (treatinghigherToolsVersionsAs40) - { - ParentEngine.LoggingServices.LogComment(buildEventContext, MessageImportance.High, "TreatingHigherToolsVersionAs40", DefaultToolsVersion); - } - - ParentEngine.LoggingServices.LogComment(buildEventContext, MessageImportance.Low, "ToolsVersionInEffectForBuild", ToolsVersion); - } - - // Incrementing the building count. A single project may be building more than once at a time - // because of callbacks by the MSBuild task. - this.buildingCount++; - - // Because we are about to build some targets, we are no longer going to be in the "reset" - // state. - this.IsReset = false; - - // This is an ArrayList of strings, where each string is the name of a target that - // we need to build. We start out by populating it with the list of targets specified - // in the "InitialTargets" attribute of the node. - ArrayList completeListOfTargetNamesToBuild = this.CombinedInitialTargetNames; - - if (buildRequest.UseResultsCache) - { - buildRequest.InitialTargets = string.Join(";", (string[])completeListOfTargetNamesToBuild.ToArray(typeof(string))); - buildRequest.DefaultTargets = (this.DefaultBuildTargets != null) ? string.Join(";", this.DefaultBuildTargets) : string.Empty; - buildRequest.ProjectId = this.projectId; - } - - // If no targets were passed in, use the "defaultTargets" from the - // project file. - if ((targetNamesToBuild == null) || (targetNamesToBuild.Length == 0)) - { - string[] defaultTargetsToBuild = this.DefaultBuildTargets; - - // There wasn't at least one target in the project, then we have - // a problem. - ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(defaultTargetsToBuild != null, - new BuildEventFileInfo(this.FullFileName), "NoTargetSpecified"); - - completeListOfTargetNamesToBuild.AddRange(defaultTargetsToBuild); - } - else - { - completeListOfTargetNamesToBuild.AddRange(targetNamesToBuild); - } - - // Check if the client requests that the project should be unloaded once it is completed - needToUnloadProject = buildRequest.UnloadProjectsOnCompletion || needToUnloadProject; - buildContext = new ProjectBuildState(buildRequest, completeListOfTargetNamesToBuild, buildEventContext); - exitedDueToError = false; - } - catch (InvalidProjectFileException e) - { - // Make sure the Invalid Project error gets logged *before* ProjectFinished. Otherwise, - // the log is confusing. - this.ParentEngine.LoggingServices.LogInvalidProjectFileError(buildEventContext, e); - // Mark the build request as completed and failed. The build context is either not created - // or discarded - buildRequest.BuildCompleted = true; - buildRequest.BuildSucceeded = false; - buildContext = null; - } - finally - { - if (exitedDueToError) - { - this.buildingCount--; - - if (buildRequest.FireProjectStartedFinishedEvents) - { - ParentEngine.LoggingServices.LogProjectFinished( - buildEventContext, - FullFileName, - false); - } - } - } - return buildContext; - } - - /// - /// Checks the dirty flags and calls the necessary methods to update the - /// necessary data structures, etc. - /// - /// RGoel - private void RefreshProjectIfDirty - ( - ) - { - if (this.dirtyNeedToReprocessXml) - { - this.ProcessMainProjectElement(); - } - else if (this.dirtyNeedToReevaluate) - { - this.EvaluateProject(false /*not currently loading*/); - } - } - - /// - /// Process the attributes and all the children of the <Project> tag. - /// This basically just parses through the XML and instantiates the - /// appropriate internal objects. It doesn't actually do any evaluation - /// or building. - /// - /// RGoel - private void ProcessMainProjectElement - ( - ) - { - // Make sure the node has been given to us. - error.VerifyThrow(mainProjectElement != null, - "Need an XML node representing the element."); - - // Make sure this really is the node. - ProjectXmlUtilities.VerifyThrowElementName(mainProjectElement, XMakeElements.project); - - // Technically, this belongs in ProcessProjectAttributes. However, ToolsVersion - // affects strategic reserved properties, so it's better to process it before anything else happens - ProcessToolsVersionDependentProperties(); - - if (IsValidated) - { - // Validate the project schema. If we have a file, then validate that - // because we need the proper line numbers. If this is an anonymous project - // then just validate the XML. - if (mainProjectElement.OwnerDocument.BaseURI.Length != 0) - { - this.Toolset.SchemaValidator(projectBuildEventContext).VerifyProjectFileSchema(FullFileName, SchemaFile); - } - else - { - this.Toolset.SchemaValidator(projectBuildEventContext).VerifyProjectSchema(mainProjectEntireContents.InnerXml, SchemaFile); - } - } - - this.evaluatedItemsByNameIgnoringCondition.Clear(); - this.evaluatedItemsIgnoringCondition.Clear(); - this.targets.Clear(); - this.nameOfFirstTarget = null; - this.defaultTargetNames = new string[0]; - this.initialTargetNamesInImportedProjects.Clear(); - this.initialTargetNamesInMainProject.Clear(); - - this.rawGroups.Clear(); - this.conditionedPropertiesTable.Clear(); - this.usingTasks.Clear(); - this.imports.Clear(); - this.projectExtensionsNode = null; - - // Attributes on the element and in the tags can - // make use of global properties, reserved properties, and environment - // variables ... so we need to set these up early. - this.evaluatedProperties.Clear(); - this.evaluatedProperties.ImportInitialProperties(this.EnvironmentProperties, this.ReservedProperties, this.Toolset.BuildProperties, this.GlobalProperties); - - // Process the attributes of the element. - ProcessProjectAttributes(this.mainProjectElement, false); - - // Figure out where the project is located - this.projectDirectory = !string.IsNullOrEmpty(this.fullFileName) ? - Path.GetDirectoryName(this.fullFileName) : Directory.GetCurrentDirectory(); - - // Process the child elements of the element, instantiating - // internal objects for each of them. - ProcessProjectChildren(this.mainProjectElement, this.ProjectDirectory, false); - - this.EvaluateProject(true /*currently loading*/); - } - - /// - /// Deal with all of the attributes on the <Project> element of the - /// XML project file. - /// - /// - /// - /// RGoel - private void ProcessProjectAttributes - ( - XmlElement projectElement, - bool importedProject - ) - { - // Make sure the node has been given to us. - error.VerifyThrow(projectElement != null, - "Need an XML node representing the element."); - - // Make sure this really is the node. - ProjectXmlUtilities.VerifyThrowElementName(projectElement, XMakeElements.project); - - // Loop through the list of attributes on the element. - // - // NOTE: The "ToolsVersion" attribute is not processed here as you might expect it would be; - // it's handled in ProcessToolsVersionDependentProperties() instead. - foreach (XmlAttribute projectAttribute in projectElement.Attributes) - { - switch (projectAttribute.Name) - { - // The "xmlns" attribute points us at the XSD file which describes the - // schema for the project file. We should use the XSD to validate - // the format of the project file XML. - case XMakeAttributes.xmlns: - break; - - // "MSBuildVersion" attribute is deprecated -- log a warning and ignore it - case XMakeAttributes.msbuildVersion: - ParentEngine.LoggingServices.LogWarning(projectBuildEventContext, Utilities.CreateBuildEventFileInfo(projectAttribute, FullFileName), - "MSBuildVersionAttributeDeprecated"); - break; - - // The "DefaultTargets" attribute is the target that we would build - // if no specific target was given to us by the caller (as part of - // the engine parameters passed in to Engine.BuildProject). - case XMakeAttributes.defaultTargets: - // We take only the first "DefaultTargets" attribute that we see in the chain - // of imports. So if the main project file has a DefaultTargets defined, we - // always take that one. If it doesn't, then we might take one from one of - // the imported files. - if ((defaultTargetNames == null) || (defaultTargetNames.Length == 0)) - { - // NOTE: at this time, evaluatedProperties only contains env. vars., command-line properties and - // reserved properties, and that is all the "DefaultTargets" attribute is allowed to reference - SetDefaultTargets(projectAttribute.Value, evaluatedProperties); - } - break; - - // The "InitialTargets" attribute defines the target that we will always build - // before building any other target. - case XMakeAttributes.initialTargets: - // allow "InitialTargets" to only reference env. vars., command-line properties and reserved properties - List initialTargetsList = (new Expander(evaluatedProperties)).ExpandAllIntoStringListLeaveEscaped(projectAttribute.Value, projectAttribute); - if (importedProject) - { - this.initialTargetNamesInImportedProjects.AddRange(initialTargetsList); - } - else - { - this.initialTargetNamesInMainProject.AddRange(initialTargetsList); - } - break; - - // We've come across an attribute in the element that we - // don't recognize. This is okay; just ignore it. There are many - // attributes that can be present in the root element - // that it is not our job to interpret. The XML parser takes care of - // these automatically. - default: - break; - } - } - } - - /// - /// Process each of the direct children beneath the >Project< element. - /// These include things like <PropertyGroup>, <ItemGroup>, <Target>, etc. - /// This method is simply capturing the data in the form of our own - /// internal objects. It is not actually evaluating any of the properties - /// or other data. - /// - /// - /// - /// - /// RGoel - private void ProcessProjectChildren - ( - XmlElement projectElement, - string projectDirectoryLocation, - bool importedProject - ) - { - // Make sure the node has been given to us. - error.VerifyThrow(projectElement != null, - "Need an XML node representing the element."); - - // Make sure this really is the node. - ProjectXmlUtilities.VerifyThrowElementName(projectElement, XMakeElements.project); - - // Loop through all the direct children of the element. - // This verifies all the XML is legitimate, and creates ordered lists of objects - // representing the top-level nodes (itemgroup, choose, etc.) - // As this progresses, the Chooses and PropertyGroups are evaluated, so that conditions - // on Imports involving properties can be evaluated too, because we need to know whether to - // follow the imports. - // All this comprises "Pass 1". - List childElements = ProjectXmlUtilities.GetValidChildElements(projectElement); - - string currentPerThreadProjectDirectory = Project.PerThreadProjectDirectory; - - try - { - // Make the correct project directory available. This is needed because it is - // used for evaluating "exists" in conditional expressions, for example on elements. - Project.PerThreadProjectDirectory = ProjectDirectory; - - foreach (XmlElement childElement in childElements) - { - switch (childElement.Name) - { - // Process the element. - case XMakeElements.itemDefinitionGroup: - itemDefinitionLibrary.Add(childElement); - break; - - // Process the element. - case XMakeElements.itemGroup: - BuildItemGroup newItemGroup = new BuildItemGroup(childElement, importedProject, /*parent project*/ this); - this.rawItemGroups.InsertAtEnd(newItemGroup); - break; - - // Process the element. - case XMakeElements.propertyGroup: - BuildPropertyGroup newPropertyGroup = new BuildPropertyGroup(this, childElement, importedProject); - newPropertyGroup.EnsureNoReservedProperties(); - this.rawPropertyGroups.InsertAtEnd(newPropertyGroup); - // PropertyGroups/Chooses are evaluated immediately during this scan, as they're needed to figure out whether - // we include Imports. - newPropertyGroup.Evaluate(this.evaluatedProperties, this.conditionedPropertiesTable, ProcessingPass.Pass1); - break; - - // Process the element. - case XMakeElements.choose: - Choose newChoose = new Choose(this, this.rawGroups, childElement, importedProject, 0 /* not nested in another */); - - this.rawGroups.InsertAtEnd(newChoose); - // PropertyGroups/Chooses are evaluated immediately during this scan, as they're needed to figure out whether - // we include Imports. - newChoose.Evaluate(this.evaluatedProperties, false, true, this.conditionedPropertiesTable, ProcessingPass.Pass1); - break; - - // Process the element. - case XMakeElements.target: - XmlElement targetElement = childElement; - Target newTarget = new Target(targetElement, this, importedProject); - - // If a target with this name already exists, log a low priority message. - if (!ParentEngine.LoggingServices.OnlyLogCriticalEvents) - { - if (targets.Exists(newTarget.Name)) - { - ParentEngine.LoggingServices.LogComment(projectBuildEventContext, "OverridingTarget", - targets[newTarget.Name].Name, targets[newTarget.Name].ProjectFileOfTargetElement, - newTarget.Name, newTarget.ProjectFileOfTargetElement); - } - } - - this.targets.AddOverrideTarget(newTarget); - - if (this.nameOfFirstTarget == null) - { - this.nameOfFirstTarget = targetElement.GetAttribute(XMakeAttributes.name); - } - break; - - // Process the element. - case XMakeElements.usingTask: - UsingTask usingTask = new UsingTask(childElement, importedProject); - this.usingTasks.Add(usingTask); - break; - - // Process the element. - case XMakeElements.projectExtensions: - if (!importedProject) - { - ProjectErrorUtilities.VerifyThrowInvalidProject(this.projectExtensionsNode == null, childElement, - "DuplicateProjectExtensions"); - this.projectExtensionsNode = childElement; - - // No attributes are legal on this element - ProjectXmlUtilities.VerifyThrowProjectNoAttributes(childElement); - } - break; - - // Process the , , and elements - case XMakeElements.error: - case XMakeElements.warning: - case XMakeElements.message: - ProjectErrorUtilities.VerifyThrowInvalidProject(false, childElement, "ErrorWarningMessageNotSupported", childElement.Name); - break; - - case XMakeElements.importGroup: - foreach (XmlElement importGroupChild in childElement.ChildNodes) - { - switch (importGroupChild.Name) - { - case XMakeElements.import: - ProcessImportElement(importGroupChild, projectDirectoryLocation, importedProject); - break; - default: - ProjectXmlUtilities.ThrowProjectInvalidChildElement(importGroupChild); - break; - } - } - break; - - // Process the element. - case XMakeElements.import: - ProcessImportElement(childElement, projectDirectoryLocation, importedProject); - break; - - default: - // We've encounted an unknown child element beneath . - ProjectXmlUtilities.ThrowProjectInvalidChildElement(childElement); - break; - } - } - } - finally - { - // Reset back to the original value - Project.PerThreadProjectDirectory = currentPerThreadProjectDirectory; - } - } - - /// - /// Process the <Import> element by loading the child project file, and processing its <Project> element. In a - /// given main project, the same file cannot be imported twice -- this is to prevent circular imports. - /// - /// RGoel - /// - /// - /// - private void ProcessImportElement - ( - XmlElement importElement, - string projectDirectoryLocation, - bool importedProject - ) - { - Import temp = new Import(importElement, this, importedProject); - - if (temp.ConditionAttribute != null) - { - // Do not expand properties or items before passing in the value of the - // condition attribute to EvaluateCondition, otherwise special characters - // inside the property values can really confuse the condition parser. - if (!Utilities.EvaluateCondition(temp.Condition, temp.ConditionAttribute, - new Expander(this.evaluatedProperties), this.conditionedPropertiesTable, - ParserOptions.AllowProperties, ParentEngine.LoggingServices, projectBuildEventContext)) - { - return; - } - } - - // If we got this far, we expect the "Project" attribute to have a reasonable - // value, so process it now. - - // Expand any $(propertyname) references inside the "Project" attribute value. - string expandedImportedFilename = (new Expander(this.evaluatedProperties)).ExpandAllIntoStringLeaveEscaped(temp.ProjectPath, temp.ProjectPathAttribute); - - // Expand any wildcards - string[] importedFilenames = EngineFileUtilities.GetFileListEscaped(projectDirectoryLocation, expandedImportedFilename); - - for (int i = 0; i < importedFilenames.Length; i++) - { - string importedFilename = EscapingUtilities.UnescapeAll(importedFilenames[i]); - ProjectErrorUtilities.VerifyThrowInvalidProject(!string.IsNullOrEmpty(importedFilename), - importElement, "MissingRequiredAttribute", - XMakeAttributes.project, XMakeElements.import); - - Import import = new Import(importElement, this, importedProject); - - try - { - if (!string.IsNullOrEmpty(projectDirectoryLocation)) - { - import.SetEvaluatedProjectPath(Path.GetFullPath(Path.Combine(projectDirectoryLocation, importedFilename))); - } - else - { - import.SetEvaluatedProjectPath(Path.GetFullPath(importedFilename)); - } - } - catch (Exception e) // Catching Exception, but rethrowing unless it's an IO related exception. - { - if (ExceptionHandling.NotExpectedException(e)) - { - throw; - } - - ProjectErrorUtilities.VerifyThrowInvalidProject(false, importElement, "InvalidAttributeValueWithException", importedFilename, XMakeAttributes.project, XMakeElements.import, e.Message); - } - - XmlDocument importedDocument = LoadImportedProject(import); - - if (importedDocument != null) - { - this.rawGroups.InsertAtEnd(import); - - // Get the top-level nodes from the XML. - XmlNodeList importedFileNodes = importedDocument.ChildNodes; - - // The XML parser will guarantee that we only have one real root element, - // but we need to find it amongst the other types of XmlNode at the root. - foreach (XmlNode importedChildNode in importedFileNodes) - { - if (XmlUtilities.IsXmlRootElement(importedChildNode)) - { - // Save the current directory, so we can restore it back later. - string currentDirectory = Directory.GetCurrentDirectory(); - - // If we have a node, tell the user they must upgrade the project - ProjectErrorUtilities.VerifyThrowInvalidProject(importedChildNode.LocalName != XMakeElements.visualStudioProject, - importedChildNode, "ProjectUpgradeNeeded"); - - // This node must be a node. - ProjectErrorUtilities.VerifyThrowInvalidProject(importedChildNode.LocalName == XMakeElements.project, - importedChildNode, "UnrecognizedElement", importedChildNode.Name); - - ProjectErrorUtilities.VerifyThrowInvalidProject((importedChildNode.Prefix.Length == 0) && (String.Equals(importedChildNode.NamespaceURI, XMakeAttributes.defaultXmlNamespace, StringComparison.OrdinalIgnoreCase)), - importedChildNode, "ProjectMustBeInMSBuildXmlNamespace", XMakeAttributes.defaultXmlNamespace); - - // We have the element, so process it. - this.ProcessProjectAttributes((XmlElement)importedChildNode, - /* imported project */ true); - this.ProcessProjectChildren((XmlElement)importedChildNode, - Path.GetDirectoryName(import.EvaluatedProjectPath), - /* imported project */ true); - - break; - } - } - } - } - } - - /// - /// Loads the XML for the specified project that is being imported into the main project. - /// - /// RGoel, SumedhK - /// The project being imported - /// XML for imported project; null, if duplicate import. - private XmlDocument LoadImportedProject(Import import) - { - XmlDocument importedDocument = null; - bool importedFileExists = File.Exists(import.EvaluatedProjectPath); - - // NOTE: don't use ErrorUtilities.VerifyThrowFileExists() here because that exception doesn't carry XML node - // information, and we need that data to show a better error message - - if (!importedFileExists) - { - ProjectErrorUtilities.VerifyThrowInvalidProject((this.loadSettings & ProjectLoadSettings.IgnoreMissingImports) != 0, - import.ProjectPathAttribute, "ImportedProjectNotFound", import.EvaluatedProjectPath); - } - - // Make sure that the file we're about to import hasn't been imported previously. - // This is how we prevent circular dependencies. It so happens that this mechanism - // also prevents the same file from being imported twice, even it it's not a - // circular dependency, but that's fine -- no good reason to do that anyway. - if ((this.imports[import.EvaluatedProjectPath] != null) || - (string.Equals(this.FullFileName, import.EvaluatedProjectPath, StringComparison.OrdinalIgnoreCase))) - { - ParentEngine.LoggingServices.LogWarning(projectBuildEventContext, Utilities.CreateBuildEventFileInfo(import.ProjectPathAttribute, FullFileName), - "DuplicateImport", import.EvaluatedProjectPath); - } - else - { - // See if the imported project is also a top-level project that has been loaded - // by the engine. If so, use the in-memory copy of the imported project instead - // of reading the copy off of the disk. This way, we can reflect any changes - // that have been made to the in-memory copy. - Project importedProject = this.ParentEngine.GetLoadedProject(import.EvaluatedProjectPath); - if (importedProject != null) - { - importedDocument = importedProject.XmlDocument; - } - // The imported project is not part of the engine, so read it off of disk. - else - { - // If the file doesn't exist on disk but we're told to ignore missing imports, simply skip it - if (importedFileExists) - { - // look up the engine's cache to see if we've already loaded this imported project on behalf of another - // top-level project - ImportedProject previouslyImportedProject = (ImportedProject)ParentEngine.ImportedProjectsCache[import.EvaluatedProjectPath]; - - // if this project hasn't been imported before, or if it has changed on disk, we need to load it - if ((previouslyImportedProject?.HasChangedOnDisk(import.EvaluatedProjectPath) != false)) - { - try - { - // Do not validate the imported file against a schema. - // We only validate the parent project against a schema in V1, because without custom - // namespace support, we would have to pollute the msbuild namespace with everything that - // appears anywhere in our targets file. - - // cache this imported project, so that if another top-level project also imports this project, we - // will not re-parse the XML (unless it changes) - previouslyImportedProject = new ImportedProject(import.EvaluatedProjectPath); - ParentEngine.ImportedProjectsCache[import.EvaluatedProjectPath] = previouslyImportedProject; - } - // catch XML exceptions early so that we still have the imported project file name - catch (XmlException e) - { - BuildEventFileInfo fileInfo = new BuildEventFileInfo(e); - ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(false, - fileInfo, - "InvalidImportedProjectFile", e.Message); - } - // catch IO exceptions, for example for when the file is in use. DDB #36839 - catch (Exception e) - { - if (ExceptionHandling.NotExpectedException(e)) - { - throw; - } - - BuildEventFileInfo fileInfo = new BuildEventFileInfo(import.EvaluatedProjectPath); - ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(false, - fileInfo, - "InvalidImportedProjectFile", e.Message); - } - } - - importedDocument = previouslyImportedProject.Xml; - } - } - - // Add the imported filename to our list, so we can be sure not to import - // it again. This helps prevent infinite recursion. - this.imports[import.EvaluatedProjectPath] = import; - } - - return importedDocument; - } - - /// - /// This method gets called by the engine when any loaded project gets renamed (e.g., - /// saved to a different location, etc.). This method should be responsible for updating - /// all internal data structures to reflect the new name of the imported file. - /// - /// - /// - /// RGoel, LukaszG - internal void OnRenameOfImportedFile(string oldFileName, string newFileName) - { - // Loop through every PropertyGroup in the current project. - foreach (BuildPropertyGroup pg in this.PropertyGroups) - { - // If the PropertyGroup is imported ... - if (pg.IsImported) - { - // ... then check the filename of the PropertyGroup to see if it - // matches the *old* file name. - if (String.Equals(pg.ImportedFromFilename, oldFileName, StringComparison.OrdinalIgnoreCase)) - { - // Okay, we found a PropertyGroup that appears to have originated from - // the imported file that just got renamed. We should update the PropertyGroup - // with the new name. - pg.ImportedFromFilename = newFileName; - } - } - } - } - - /// - /// Here, we use the internal objects we created during processing of the - /// XML to actually evaluate the properties, items, targets, etc. We - /// will be evaluating the conditions, and expanding property/item - /// references, etc. We don't actually build though. - /// - /// - /// If this has been called by we don't evaluate properties - /// again, since that's already been done. We don't evaluate import tags again, for the same reason. - /// In such a case, this method represents only evaluation "Pass 2". - /// - /// RGoel - private void EvaluateProject(bool currentlyLoading) - { - { - string currentPerThreadProjectDirectory = Project.PerThreadProjectDirectory; - - try - { - // Make the correct project directory available. During load, we need "exists" (with relative paths) - // on conditions to work correctly, and for wildcards to evaluate relative to the project directory. - Project.PerThreadProjectDirectory = this.ProjectDirectory; - - // In case we've just loaded the project file, we don't want to repeat all - // of the work done during ProcessProjectChildren(...) to evaluate the - // properties. - if (!currentlyLoading) - { - // "Pass 1" - evaluatedProperties.Clear(); - - evaluatedProperties.ImportInitialProperties(this.EnvironmentProperties, this.ReservedProperties, this.Toolset.BuildProperties, this.GlobalProperties); - - conditionedPropertiesTable.Clear(); - - EvaluateAllPropertyGroups(); - } - - // "Pass 1.5" - itemDefinitionLibrary.Evaluate(evaluatedProperties); - - // "Pass 2" - evaluatedItems.Clear(); - evaluatedItemsByName.Clear(); - - taskRegistry.Clear(); - - ResetBuildStatus(); - - // Every time we're essentially processing the XML from scratch, - // evaluate the items ignoring the conditions (the first bool parameter). - // This gives us the complete list of items whether or not they happen to - // be active for a particular build flavor. This is useful for purposes - // of displaying in Solution Explorer. - // But also, at the same time, evaluate the items taking into account - // the "Condition"s correctly (the second bool parameter). This is the real - // list of items that will be used for the purposes of "build". - EvaluateAllItemGroups(this.dirtyNeedToReprocessXml, true); - - EvaluateAllUsingTasks(); - - this.dirtyNeedToReevaluate = false; - this.dirtyNeedToReprocessXml = false; - } - finally - { - // We reset the path back to the original value in case the - // host is depending on the current directory to find projects - Project.PerThreadProjectDirectory = currentPerThreadProjectDirectory; - } - } - } - - /// - /// Walk through all of the PropertyGroups in the project (including - /// imported PropertyGroups) in order, and evaluate the properties. - /// We end up producing a final linear evaluated property collection - /// called this.evaluatedProperties. - /// - /// RGoel - private void EvaluateAllPropertyGroups - ( - ) - { - foreach (IItemPropertyGrouping propertyGroup in this.rawGroups.PropertyGroupsTopLevelAndChooses) - { - if (propertyGroup is BuildPropertyGroup) - { - ((BuildPropertyGroup)propertyGroup).Evaluate(this.evaluatedProperties, this.conditionedPropertiesTable, ProcessingPass.Pass1); - } - else if (propertyGroup is Choose) - { - ((Choose)propertyGroup).Evaluate(this.evaluatedProperties, false, true, this.conditionedPropertiesTable, ProcessingPass.Pass1); - } - else - { - ErrorUtilities.VerifyThrow(false, "Unexpected return type from this.rawGroups.PropertyGroupsAndChooses"); - } - } - } - - /// - /// Evaluate all the <ItemGroup>'s in the project (including imported - /// <ItemGroup>'s) in order, producing a final list of evaluated items. - /// - /// - /// - /// RGoel - private void EvaluateAllItemGroups - ( - bool ignoreCondition, - bool honorCondition - ) - { - error.VerifyThrow(ignoreCondition || honorCondition, "Both ignoreCondition and honorCondition can't be false."); - - foreach (IItemPropertyGrouping itemGroup in this.rawGroups.ItemGroupsTopLevelAndChooses) - { - if (itemGroup is BuildItemGroup) - { - ((BuildItemGroup)itemGroup).Evaluate(this.evaluatedProperties, this.evaluatedItemsByName, ignoreCondition, honorCondition, ProcessingPass.Pass2); - } - else if (itemGroup is Choose) - { - ((Choose)itemGroup).Evaluate(this.evaluatedProperties, ignoreCondition, honorCondition, this.conditionedPropertiesTable, ProcessingPass.Pass2); - } - else - { - ErrorUtilities.VerifyThrow(false, "Unexpected return type from this.rawGroups.ItemGroupsAndChooses"); - } - } - } - - /// - /// This processes the <UsingTask> elements in the project file as well - /// as the imported project files, by adding the necessary data to the - /// task registry. - /// - /// RGoel - private void EvaluateAllUsingTasks() - { - Expander expander = new Expander(evaluatedProperties, evaluatedItemsByName); - - foreach (UsingTask usingTask in this.usingTasks) - { - taskRegistry.RegisterTask(usingTask, expander, ParentEngine.LoggingServices, projectBuildEventContext); - } - } - - /// - /// Adds an item to the appropriate project's evaluated items collection. This method is - /// NOT to be used during the build process to add items that are emitted by tasks. - /// This is only for the purposes of adding statically-declared items in the logical - /// project file, or items added to the project file by an IDE modifying the project contents. - /// - /// The specific item to add to the project - internal void AddToItemListByNameIgnoringCondition(BuildItem item) - { - // Get a reference to the project-level hash table which is supposed to - // contain the list of items of this type regardless of condition. Note that the item type, when - // used as a key into the overall hash table, is case-insensitive. - BuildItemGroup itemListByNameIgnoringCondition = (BuildItemGroup)this.evaluatedItemsByNameIgnoringCondition[item.Name]; - - // If no such BuildItemGroup exists yet, create a new BuildItemGroup and add it to - // the hashtable of ItemGroups by type. - if (itemListByNameIgnoringCondition == null) - { - itemListByNameIgnoringCondition = new BuildItemGroup(); - this.evaluatedItemsByNameIgnoringCondition[item.Name] = itemListByNameIgnoringCondition; - } - - // Actually add the new item to the Project object's data structures. - itemListByNameIgnoringCondition.AddItem(item); - evaluatedItemsIgnoringCondition.AddItem(item); - } - - /// - /// Adds an item to the appropriate project's evaluated items collection. This method is - /// NOT to be used during the build process to add items that are emitted by tasks. - /// This is only for the purposes of adding statically-declared items in the logical - /// project file, or items added to the project file by an IDE modifying the project contents. - /// - /// The specific item to add to the project - internal void AddToItemListByName(BuildItem item) - { - // Get a reference to the project-level hash table which is supposed to - // contain the list of items of this type. Note that the item type, when - // used as a key into the overall hash table, is case-insensitive. - BuildItemGroup itemListByName = (BuildItemGroup)this.evaluatedItemsByName[item.Name]; - - // If no such BuildItemGroup exists yet, create a new BuildItemGroup and add it to - // the hashtable of ItemGroups by type. - if (itemListByName == null) - { - itemListByName = new BuildItemGroup(); - this.evaluatedItemsByName[item.Name] = itemListByName; - } - - // Actually add the new item to the Project object's data structures. - itemListByName.AddItem(item); - evaluatedItems.AddItem(item); - } - - /// - /// This method returns true if the specified filename is a solution file (.sln), otherwise - /// it returns false. - /// - /// - /// - /// jomof - internal static bool IsSolutionFilename(string filename) - { - return string.Equals(Path.GetExtension(filename), ".sln", StringComparison.OrdinalIgnoreCase); - } - - /// - /// Returns true if the specified filename is a VC++ project file, otherwise returns false - /// - /// LukaszG - internal static bool IsVCProjFilename(string filename) - { - return string.Equals(Path.GetExtension(filename), ".vcproj", StringComparison.OrdinalIgnoreCase); - } - } -} diff --git a/src/Deprecated/Engine/Engine/ProjectBuildState.cs b/src/Deprecated/Engine/Engine/ProjectBuildState.cs deleted file mode 100644 index 478876c6fe7..00000000000 --- a/src/Deprecated/Engine/Engine/ProjectBuildState.cs +++ /dev/null @@ -1,343 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Diagnostics; -using System.Collections.Generic; -using System.Collections; - -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class is used to maintain a state of execution of a build request. Once a build request is - /// received it is wrapped in this class - /// - [DebuggerDisplay("ProjectBuildState (NameOfTargetInProgress={NameOfTargetInProgress}, NameOfBlockingTarget={NameOfBlockingTarget}, BuildResult={BuildResult}, BuildComplete={BuildComplete})")] - internal sealed class ProjectBuildState - { - #region Constructors - - /// - /// Create a build request from the list of targets to build and build request object - /// - internal ProjectBuildState(BuildRequest buildRequest, ArrayList targetNamesToBuild, BuildEventContext buildEventContext) - { - this.buildRequest = buildRequest; - this.indexOfTargetInProgress = 0; - this.targetNamesToBuild = targetNamesToBuild; - this.buildContextState = BuildContextState.StartingFirstTarget; - this.projectBuildEventContext = buildEventContext; - } - - #endregion - - #region Properties - /// - /// Current state of the context - /// - internal BuildContextState CurrentBuildContextState - { - get - { - return this.buildContextState; - } - set - { - this.buildContextState = value; - } - } - - /// - /// True if the project build context has been completed either successfully or with a failure - /// - internal bool BuildComplete - { - get - { - return this.buildRequest.BuildCompleted; - } - set - { - this.buildRequest.BuildCompleted = value; - } - } - - /// - /// True if the project build context has been completed successfully, false otherwise - /// - internal bool BuildResult - { - get - { - return this.buildRequest.BuildSucceeded; - } - set - { - this.buildRequest.BuildSucceeded = value; - } - } - - /// - /// Name of the target that blocks the in progress target. Null there is no target - /// blocking the inprogress target - /// - internal string NameOfBlockingTarget - { - get - { - return requiredTargets?.Count > 0 ? - this.requiredTargets.Peek() : null; - } - } - - /// - /// Name of the target currently in progress - /// - internal string NameOfTargetInProgress - { - get - { - return (string)this.targetNamesToBuild[indexOfTargetInProgress]; - } - } - - /// - /// List of targets that need to be completed in order to complete the context - /// - internal ArrayList TargetNamesToBuild - { - get - { - return this.targetNamesToBuild; - } - } - - /// - /// Build request that caused the context to come into existance (either from the host or generated) - /// - internal BuildRequest BuildRequest - { - get - { - return this.buildRequest; - } - } - - #endregion - - #region Methods - /// - /// Move to the next target in the context. Return null if there is no next target - /// - /// - internal string GetNextTarget() - { - if ((indexOfTargetInProgress + 1) < targetNamesToBuild.Count) - { - indexOfTargetInProgress++; - return (string)targetNamesToBuild[indexOfTargetInProgress]; - } - else - { - // All targets in this context have been build - return null; - } - } - - /// - /// Remove the top blocking target - /// - internal void RemoveBlockingTarget() - { - ErrorUtilities.VerifyThrow(requiredTargets.Count > 0, "No target to remove"); - requiredTargets.Pop(); - } - - /// - /// Add another blocking target - /// - internal void AddBlockingTarget(string targetName) - { - if (requiredTargets == null) - { - requiredTargets = new Stack(); - } - buildContextState = BuildContextState.StartingBlockingTarget; - requiredTargets.Push(targetName); - } - - /// - /// Marks the build context and build result as complete with the given result - /// - internal void RecordBuildCompletion(bool result) - { - buildContextState = ProjectBuildState.BuildContextState.BuildComplete; - buildRequest.BuildCompleted = true; - buildRequest.BuildSucceeded = result; - } - - /// - /// Marks the build context and build result appropriate for an exception thrown within - /// a build context - /// - internal void RecordBuildException() - { - buildContextState = ProjectBuildState.BuildContextState.ExceptionThrown; - buildRequest.BuildCompleted = true; - buildRequest.BuildSucceeded = false; - } - - #region Methods used for cycle detection only - /// - /// This method returns true if the top blocking target appears in the stack of - /// blocking targets more than once, thus forming a cycle. - /// - internal bool ContainsCycle(string name) - { - bool containsCycle = false; - if (requiredTargets?.Count > 1) - { - string topTarget = requiredTargets.Pop(); - ErrorUtilities.VerifyThrow(topTarget == name, "Requesting target should be on the top of stack"); - containsCycle = requiredTargets.Contains(name); - requiredTargets.Push(topTarget); - } - if (!containsCycle && requiredTargets?.Count > 0) - { - containsCycle = - (String.Equals(name, (string)targetNamesToBuild[indexOfTargetInProgress], StringComparison.OrdinalIgnoreCase)); - } - return containsCycle; - } - - /// - /// This method return true if a given target name appears anywhere in the list of - /// blocking targets - /// - internal bool ContainsBlockingTarget(string name) - { - bool containsName = false; - if (requiredTargets?.Count > 0) - { - containsName = requiredTargets.Contains(name); - } - return containsName; - } - - /// - /// This method is used by the target cycle detector to find the parent target for - /// the given target. The parent only exists if there is at least 1 - /// blocking target. If there is less than 1 blocking target the parent is determined - /// by the orgin of the build request that caused this build context. - /// - internal string GetParentTarget(string name) - { - string parentName = null; - if (requiredTargets?.Count > 0) - { - parentName = (string)targetNamesToBuild[indexOfTargetInProgress]; - - if (requiredTargets.Count > 1) - { - string[] requiredTargetsArray = requiredTargets.ToArray(); - - for (int i = requiredTargetsArray.Length - 1; i >= 0; i--) - { - if (string.CompareOrdinal(requiredTargetsArray[i], name) != 0) - { - parentName = requiredTargetsArray[i]; - } - else - { - break; - } - } - } - } - return parentName; - } - - /// - /// Contains the event context for the build context, this is created when the ProjectBuildState is created - /// - internal BuildEventContext ProjectBuildEventContext - { - get - { - return this.projectBuildEventContext; - } - } - #endregion - - #endregion - - #region Enums - /// - /// States of execution of a build request - /// - internal enum BuildContextState - { - /// - /// Starting the first target within the request. Default initial state. - /// - StartingFirstTarget, - /// - /// Starting a target due to a depends on or on error relationship - /// - StartingBlockingTarget, - /// - /// The target which is needed is already in progress due to another request, so wait for a result - /// - WaitingForTarget, - /// - /// Currently in progress of building a needed target - /// - BuildingCurrentTarget, - /// - /// Cycle is detected and is caused by this request - /// - CycleDetected, - /// - /// There is an exception thrown during the execution of this request - /// - ExceptionThrown, - /// - /// All needed target have been completed or an error terminating the request has occurred - /// - BuildComplete, - /// - /// The result of the request has been sent back to the requesting party - /// - RequestFilled - } - #endregion - - #region Data - // Stack of targets which need to be completed before the in progress target can continue - private Stack requiredTargets; - - // BuildEventContext for the build context - private BuildEventContext projectBuildEventContext; - - // Index of the currently in progress target - private int indexOfTargetInProgress; - - // List of targets that need to be completed in order to complete the context - // UNDONE should do the right thing and fully unescape before generating this list - private ArrayList targetNamesToBuild; - - // Build request that caused the context to come into existance (either from the host or generated) - private BuildRequest buildRequest; - - // Current state of the context - private BuildContextState buildContextState; - #endregion - } -} diff --git a/src/Deprecated/Engine/Engine/ProjectManager.cs b/src/Deprecated/Engine/Engine/ProjectManager.cs deleted file mode 100644 index 90d91d61884..00000000000 --- a/src/Deprecated/Engine/Engine/ProjectManager.cs +++ /dev/null @@ -1,444 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -#region Using directives - -using System; -using System.Collections; -using System.Collections.Generic; - -using Microsoft.Build.BuildEngine.Shared; - -#endregion - -namespace Microsoft.Build.BuildEngine -{ - internal sealed class ProjectManager - { - #region Constructors - /// - /// Default constructor. Just instantiates the hash table. - /// - /// RGoel - internal ProjectManager() - { - this.projects = new Hashtable(StringComparer.OrdinalIgnoreCase); - this.nodeToProjectsMapping = new Hashtable(StringComparer.OrdinalIgnoreCase); - this.unloadedProjects = new Hashtable(StringComparer.OrdinalIgnoreCase); - } - #endregion - - #region Methods - /// - /// Adds the specified Project object to our data structure, if it's not already present. - /// - /// - internal void AddProject(Project project) - { - // We should never be asked to store a nameless project in our list. - ErrorUtilities.VerifyThrow(project.FullFileName.Length > 0, "Can't store nameless projects"); - - AddProject(projects, project); - } - - /// - /// Removes all projects with the specified full path from our manager. - /// - /// - internal void RemoveProjects - ( - string fullPath - ) - { - this.projects.Remove(fullPath); - } - - /// - /// Searches our tables for a project with same full path, tools version, and global property settings - /// Removes particular project from the project manager. - /// - /// - internal void RemoveProject - ( - Project project - ) - { - // We should never be asked to remove null project - ErrorUtilities.VerifyThrow(project != null, "Shouldn't ask to remove null projects"); - - // See if there's an entry in our table for this particular full path. - ArrayList projectsWithThisFullPath = (ArrayList)this.projects[project.FullFileName]; - - // The project should be in the table - ErrorUtilities.VerifyThrow(projectsWithThisFullPath != null, "Project missing from the list"); - - int project_index = -1; - for (int i = 0; i < projectsWithThisFullPath.Count; i++) - { - if (projectsWithThisFullPath[i] == project) - { - project_index = i; - } - } - - // The project should be in the table - ErrorUtilities.VerifyThrow(project_index != -1, "Project missing from the list"); - - if (project_index != -1) - { - projectsWithThisFullPath.RemoveAt(project_index); - AddUnloadedProjectRecord(project.FullFileName, project.GlobalProperties, project.ToolsVersion); - } - } - - /// - /// Searches our tables for a project with same full path and global property settings - /// as those passed in to the method. - /// - /// - /// - /// Tools version a matching project must have - /// Project object if found, null otherwise. - internal Project GetProject - ( - string projectFileFullPath, - BuildPropertyGroup globalProperties, - string toolsVersion - ) - { - Project project = GetProject(projects, projectFileFullPath, globalProperties, toolsVersion); - - return project; - } - - /// - /// Searches our tables for a project with same project id - /// as the one passed in to the method. Note this method is currently O(n) - /// with the number of projects, so if it used on a hot code path it needs to - /// use an extra hashtable to achieve O(1). - /// - /// - /// Project object if found, null otherwise. - internal Project GetProject - ( - int projectId - ) - { - // Loop through them and find the one with the matching id. - foreach (DictionaryEntry entry in projects) - { - ArrayList projectsWithThisFullPath = (ArrayList)entry.Value; - foreach (Project candidateProject in projectsWithThisFullPath) - { - if (candidateProject.Id == projectId) - { - return candidateProject; - } - } - } - - // No project was found that matched the id specified. - return null; - } - - /// - /// Gets the first project contained in the ProjectManager that matches the full path - /// specified. - /// - /// - /// - internal Project GetFirstProject - ( - string projectFileFullPath - ) - { - // Get the list of projects that have this full path. - ArrayList projectsWithThisFullPath = (ArrayList)this.projects[projectFileFullPath]; - - if ((projectsWithThisFullPath?.Count > 0)) - { - return (Project)projectsWithThisFullPath[0]; - } - - // No project was found that matched the full path specified. - return null; - } - - /// - /// Gets the list of projects which are currently in process of being build (i.e have at least - /// one build request inside the project) - /// - /// List of in progress projects - internal List GetInProgressProjects() - { - List inProgressProjects = new List(); - foreach (DictionaryEntry entry in projects) - { - ArrayList projectsWithThisFullPath = (ArrayList)entry.Value; - foreach (Project candidateProject in projectsWithThisFullPath) - { - if (candidateProject.IsBuilding) - { - inProgressProjects.Add(candidateProject); - } - } - } - return inProgressProjects; - } - - /// - /// Resets the build status of every single project in our ProjectManager. - /// - internal void ResetBuildStatusForAllProjects - ( - ) - { - // Iterate over every single project in our data structures, and reset them all. - foreach (ArrayList projectList in this.projects.Values) - { - foreach (Project project in projectList) - { - project.ResetBuildStatus(); - } - } - // Since the status is reset for all projects it is no longer relevant if the project was loaded before - this.unloadedProjects.Clear(); - } - - /// - /// Clears all references to all projects from this ProjectManager. - /// - internal void Clear - ( - ) - { - this.projects.Clear(); - this.nodeToProjectsMapping.Clear(); - this.unloadedProjects.Clear(); - } - - #region Methods managing the mapping between project and remote nodes - - /// - /// Store a record indicating that project with the given name is assigned to the given node, - /// it's not already present. - /// - internal void AddRemoteProject - ( - string projectFileFullPath, - BuildPropertyGroup globalProperties, - string toolsVersion, - int nodeIndex - ) - { - ErrorUtilities.VerifyThrow(nodeIndex != EngineCallback.parentNode, "Should not try to insert nodeIndex of parentNode"); - AddProjectEntry(nodeToProjectsMapping, projectFileFullPath, globalProperties, toolsVersion, nodeIndex); - } - - /// - /// Get a node that the project has been assigned to - /// - /// Index of the node the project is assigned to and 0 otherwise - internal int GetRemoteProject - ( - string projectFileFullPath, - BuildPropertyGroup globalProperties, - string toolsVersion - ) - { - ProjectEntry projectEntry = GetProjectEntry(nodeToProjectsMapping, projectFileFullPath, globalProperties, toolsVersion); - if (projectEntry != null) - { - return projectEntry.nodeIndex; - } - else - { - return EngineCallback.invalidNode; - } - } - #endregion - - #region Methods managing the record of unloaded projects - - /// - /// This function adds the project to the table of previously loaded projects, if it's - /// not already present. - /// - private void AddUnloadedProjectRecord - ( - string projectFileFullPath, - BuildPropertyGroup globalProperties, - string toolsVersion - ) - { - AddProjectEntry(unloadedProjects, projectFileFullPath, globalProperties, toolsVersion, EngineCallback.invalidNode /* node index not needed */); - } - - /// - /// This functions returns true if a project with the same properties, toolset version and filename has been previously loaded. It - /// will return false for currently loaded projects and projects that have never been loaded. - /// - /// True if exact same instance has been loaded before - internal bool HasProjectBeenLoaded - ( - string projectFileFullPath, - BuildPropertyGroup globalProperties, - string toolsVersion - ) - { - ProjectEntry projectEntry = GetProjectEntry(unloadedProjects, projectFileFullPath, globalProperties, toolsVersion); - if (projectEntry != null) - { - return true; - } - else - { - return false; - } - } - - /// - /// Adds a project to the specified table, if it isn't already present. - /// - internal static void AddProject(Hashtable projectTable, Project project) - { - Project existingEntry = GetProject(projectTable, project.FullFileName, project.GlobalProperties, project.ToolsVersion); - - if (existingEntry != null) - { - // We already have this entry - return; - } - - // See if there's an entry in our table for this particular full path. - ArrayList projectsWithThisFullPath = (ArrayList)projectTable[project.FullFileName]; - - // If not, create one. The "value" in the Hashtable is an ArrayList of projects. - if (projectsWithThisFullPath == null) - { - projectsWithThisFullPath = new ArrayList(); - projectTable[project.FullFileName] = projectsWithThisFullPath; - } - - // Add the specified project to the ArrayList of projects for this particular full path. - projectsWithThisFullPath.Add(project); - } - - /// - /// Add a project entry to the specified table, if it isn't already present. - /// - internal static void AddProjectEntry(Hashtable projectEntryTable, string projectFileFullPath, BuildPropertyGroup globalProperties, string toolsVersion, int nodeIndex) - { - ProjectEntry existingEntry = GetProjectEntry(projectEntryTable, projectFileFullPath, globalProperties, toolsVersion); - - if (existingEntry != null) - { - ErrorUtilities.VerifyThrow(existingEntry.nodeIndex == nodeIndex, "nodeIndex should match existing ProjectEntry"); - // We already have this entry - return; - } - - // See if there's an entry in our table for this particular full path. - ArrayList projectsWithThisFullPath = (ArrayList)projectEntryTable[projectFileFullPath]; - - // If not, create one. The "value" in the Hashtable is an ArrayList of projects. - if (projectsWithThisFullPath == null) - { - projectsWithThisFullPath = new ArrayList(); - projectEntryTable[projectFileFullPath] = projectsWithThisFullPath; - } - - ProjectEntry projectEntry = new ProjectEntry(); - projectEntry.toolsVersion = toolsVersion; - projectEntry.globalProperties = globalProperties; - projectEntry.nodeIndex = nodeIndex; - // Break up the link to the project to avoid keeping it in memory - projectEntry.globalProperties.ClearParentProject(); - - projectsWithThisFullPath.Add(projectEntry); - } - - /// - /// Retrieve any project from the table that has the same file name, global properties, and tools version. - /// - internal static Project GetProject(Hashtable table, string projectFileFullPath, BuildPropertyGroup globalProperties, string toolsVersion) - { - // Get the list of projects that have this full path. - ArrayList projectsWithThisFullPath = (ArrayList)table[projectFileFullPath]; - - if (projectsWithThisFullPath != null) - { - // Loop through them and find the one with the matching set of global properties. - foreach (Project candidateProject in projectsWithThisFullPath) - { - if (candidateProject.IsEquivalentToProject(projectFileFullPath, globalProperties, toolsVersion)) - { - return candidateProject; - } - } - } - - // No project was found that matched the full path and the global properties specified. - return null; - } - - /// - /// Retrieve the project entry from the entry table based on project file name, globalProperties, and toolsVersion. - /// - internal static ProjectEntry GetProjectEntry(Hashtable entryTable, string projectFileFullPath, BuildPropertyGroup globalProperties, string toolsVersion) - { - // Get the list of projects that have this full path. - ArrayList projectsWithFullPath = (ArrayList)entryTable[projectFileFullPath]; - - if (projectsWithFullPath != null) - { - // Loop through them and find the one with the matching set of global properties. - foreach (ProjectEntry projectEntry in projectsWithFullPath) - { - if ((String.Equals(projectEntry.toolsVersion, toolsVersion, StringComparison.OrdinalIgnoreCase)) && - projectEntry.globalProperties.IsEquivalent(globalProperties)) - { - return projectEntry; - } - } - } - return null; - } - #endregion - #endregion - - #region Data - // This hash table tracks all the projects that are currently building, - // or are being kept around from the last build for perf reasons (so - // we don't have to reload the same projects over and over in IDE - // scenarios. - // The key for this hash table is the case-insensitive full path to the - // project file. The value in this hash table is an ArrayList of Project - // objects that came from that full path. The reason there could be - // multiple Project objects with the same full path is because they - // may each be using a different set of global properties, and we can't - // have them tromp on each other. - private Hashtable projects; - // Once the project is loaded on the remote node, all versions of the project - // will be loaded and processed on the same node to reuse the XML. This table - // stores a record of between nodes and projects - private Hashtable nodeToProjectsMapping; - // Table of projects that have been unloaded during the current build - private Hashtable unloadedProjects; - #endregion - - #region Helper class - internal class ProjectEntry - { - internal BuildPropertyGroup globalProperties; - internal string toolsVersion; - internal int nodeIndex; - } - - #endregion - } -} diff --git a/src/Deprecated/Engine/Engine/ProjectSchemaValidationHandler.cs b/src/Deprecated/Engine/Engine/ProjectSchemaValidationHandler.cs deleted file mode 100644 index c7279efa3d0..00000000000 --- a/src/Deprecated/Engine/Engine/ProjectSchemaValidationHandler.cs +++ /dev/null @@ -1,209 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.IO; -using System.Xml; -using System.Xml.Schema; - -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class is used for validating projects against a designated schema. - /// - /// JomoF - internal sealed class ProjectSchemaValidationHandler - { - // The parent Engine object for this project. - private EngineLoggingServices engineLoggingServices; - - // the location of the MSBuild binaries - private string binPath; - - // Set to true if there was a syntax error in the project file. - private bool syntaxError; - - // Event context information of where the event is raised - private BuildEventContext buildEventContext; - - #region Constructors - - /// - /// Private constructor because real constructor needs a file name. - /// - /// JomoF - private ProjectSchemaValidationHandler() - { - // do nothing - } - - /// - /// This constructor initializes all required data. - /// - /// JomoF - /// - /// - internal ProjectSchemaValidationHandler(BuildEventContext buildEventContext, EngineLoggingServices loggingServices, string binPath) - { - this.engineLoggingServices = loggingServices; - this.binPath = binPath; - this.buildEventContext = buildEventContext; - } - #endregion - - #region Methods - - /// - /// Validates a project file against the given schema. - /// - /// JomoF - /// - /// Can be null. - internal void VerifyProjectFileSchema - ( - string projectFile, - string schemaFile - ) - { - using (StreamReader contentReader = new StreamReader(projectFile)) - { - VerifyProjectSchema(contentReader, schemaFile, projectFile); - } - } - - /// - /// Validates a project in an XML string against the given schema. - /// - /// JomoF - /// - /// Can be null. - internal void VerifyProjectSchema - ( - string projectXml, - string schemaFile - ) - { - using (StringReader contentReader = new StringReader(projectXml)) - { - VerifyProjectSchema(contentReader, schemaFile, String.Empty /* no project file for in-memory XML */); - } - } - - /// - /// Validates a project against the given schema -- if no schema is provided, uses the default schema. - /// - /// JomoF - /// - /// Can be null. - /// - private void VerifyProjectSchema - ( - TextReader contentReader, - string schemaFile, - string projectFile - ) - { - // Options for XmlReader object can be set only in constructor. After the object is created, they - // become read-only. Because of that we need to create - // XmlSettings structure, fill it in with correct parameters and pass into XmlReader constructor. - - XmlReaderSettings validatorSettings = new XmlReaderSettings(); - validatorSettings.ValidationType = ValidationType.Schema; - validatorSettings.XmlResolver = null; - validatorSettings.ValidationEventHandler += this.OnSchemaValidationError; - - if (string.IsNullOrEmpty(schemaFile)) - { - schemaFile = Path.Combine(binPath, "Microsoft.Build.xsd"); - } - - // Log the schema file we're using, particularly since it can vary - // according to the toolset being used - engineLoggingServices.LogComment(buildEventContext, "SchemaFileLocation", schemaFile); - - XmlTextReader schemaReader = new XmlTextReader(schemaFile); - schemaReader.DtdProcessing = DtdProcessing.Ignore; - using (schemaReader) - { - try - { - validatorSettings.Schemas.Add(XMakeAttributes.defaultXmlNamespace, schemaReader); - - // We need full path to the project file to be able handle it as URI in ValidationEventHandler. - // Uri class cannot instantiate with relative paths. - if (projectFile.Length != 0) - { - projectFile = Path.GetFullPath(projectFile); - } - - using (XmlReader validator = XmlReader.Create(contentReader, validatorSettings, projectFile)) // May also throw XmlSchemaException - { - this.syntaxError = false; - bool couldRead = true; - - while (couldRead) - { - try - { - couldRead = validator.Read(); - } - catch (XmlException) - { - // We swallow exception here because XmlValidator fires the validation event to report the error - // And we handle the event. Also XmlValidator can continue parsing Xml text after throwing an exception. - // Thus we don't need any special recover here. - } - } - - ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(!this.syntaxError, "SubCategoryForSchemaValidationErrors", - new BuildEventFileInfo(projectFile), "ProjectSchemaErrorHalt"); - } - } - // handle errors in the schema itself - catch (XmlException e) - { - ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(false, "SubCategoryForSchemaValidationErrors", new BuildEventFileInfo(e), - "InvalidSchemaFile", schemaFile, e.Message); - } - // handle errors in the schema itself - catch (XmlSchemaException e) - { - ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(false, "SubCategoryForSchemaValidationErrors", new BuildEventFileInfo(e), - "InvalidSchemaFile", schemaFile, e.Message); - } - } - } - - /// - /// Receives any errors that occur while validating the project's schema. - /// - /// RGoel - /// - /// - private void OnSchemaValidationError(object sender, ValidationEventArgs args) - { - this.syntaxError = true; - - // We should handle empty URI specially, because Uri class does not allow to instantiate with empty string. - string filePath = String.Empty; - - if (args.Exception.SourceUri.Length != 0) - { - filePath = (new Uri(args.Exception.SourceUri)).LocalPath; - } - - engineLoggingServices.LogError(buildEventContext, "SubCategoryForSchemaValidationErrors", - new BuildEventFileInfo(filePath, args.Exception.LineNumber, args.Exception.LinePosition), - "SchemaValidationError", args.Exception.Message); - } - - #endregion - } -} diff --git a/src/Deprecated/Engine/Engine/RegistryKeyWrapper.cs b/src/Deprecated/Engine/Engine/RegistryKeyWrapper.cs deleted file mode 100644 index 7bbbd5d0915..00000000000 --- a/src/Deprecated/Engine/Engine/RegistryKeyWrapper.cs +++ /dev/null @@ -1,250 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.IO; -using System.Security; - -using Microsoft.Build.BuildEngine.Shared; -using Microsoft.Win32; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// Thin wrapper around Microsoft.Win32.RegistryKey that can be - /// subclassed for testing purposes - /// - internal class RegistryKeyWrapper - { - // Path to the key this instance wraps - private string registryKeyPath; - // The key this instance wraps - private RegistryKey wrappedKey; - // The hive this registry key lives under - private RegistryKey registryHive; - // This field will be set to true when we try to open the registry key - private bool attemptedToOpenRegistryKey = false; - - /// - /// Initializes this RegistryKeyWrapper to wrap the specified key. - /// Does not check for a null key. - /// - /// - protected RegistryKeyWrapper(RegistryKey wrappedKey, RegistryKey registryHive) - { - this.wrappedKey = wrappedKey; - this.registryHive = registryHive; - } - - /// - /// Initializes this RegistryKeyWrapper to wrap the key at the specified path - /// and assumes the key is underneath HKLM - /// Note that registryKeyPath should be relative to HKLM. - /// - /// - internal RegistryKeyWrapper(string registryKeyPath) - : this(registryKeyPath, Registry.LocalMachine) - { - } - - /// - /// Initializes this RegistryKeyWrapper to wrap the key at the specified path - /// - /// - /// - internal RegistryKeyWrapper(string registryKeyPath, RegistryKey registryHive) - { - ErrorUtilities.VerifyThrowArgumentNull(registryKeyPath, nameof(registryKeyPath)); - ErrorUtilities.VerifyThrowArgumentNull(registryHive, nameof(registryHive)); - - this.registryKeyPath = registryKeyPath; - this.registryHive = registryHive; - } - - /// - /// Name of the registry key - /// - public virtual string Name - { - get - { - try - { - return Exists() ? WrappedKey.Name : string.Empty; - } - catch (Exception ex) - { - if (NotExpectedException(ex)) - { - throw; - } - - throw new RegistryException(ex.Message, ex); - } - } - } - - /// - /// Gets the value with name "name" stored under this registry key - /// - /// - /// - public virtual object GetValue(string name) - { - try - { - return Exists() ? WrappedKey.GetValue(name) : null; - } - catch (Exception ex) - { - if (NotExpectedException(ex)) - { - throw; - } - - throw new RegistryException(ex.Message, Name + "@" + name, ex); - } - } - - /// - /// Gets the names of all values underneath this registry key - /// - /// - public virtual string[] GetValueNames() - { - try - { - return Exists() ? WrappedKey.GetValueNames() : new string[] { }; - } - catch (Exception ex) - { - if (NotExpectedException(ex)) - { - throw; - } - - throw new RegistryException(ex.Message, Name, ex); - } - } - - /// - /// Gets the names of all sub keys immediately below this registry key - /// - /// - public virtual string[] GetSubKeyNames() - { - try - { - return Exists() ? WrappedKey.GetSubKeyNames() : new string[] { }; - } - catch (Exception ex) - { - if (NotExpectedException(ex)) - { - throw; - } - - throw new RegistryException(ex.Message, Name, ex); - } - } - - /// - /// Returns the RegistryKeyWrapper around the sub key with name "name". If that does - /// not exist, returns a RegistryKeyWrapper around null. - /// - /// - /// - public virtual RegistryKeyWrapper OpenSubKey(string name) - { - ErrorUtilities.VerifyThrowArgumentLength(name, nameof(name)); - - RegistryKeyWrapper wrapper = this; - string[] keyNames = name.Split(new char[] { '\\' }, StringSplitOptions.RemoveEmptyEntries); - - for (int i = 0; i < keyNames.Length && wrapper.Exists(); ++i) - { - try - { - wrapper = new RegistryKeyWrapper(wrapper.WrappedKey.OpenSubKey(keyNames[i], false /* not writeable */), registryHive); - } - catch (Exception ex) - { - if (NotExpectedException(ex)) - { - throw; - } - - throw new RegistryException(ex.Message, wrapper.Name + "\\" + keyNames[i], ex); - } - } - - return wrapper; - } - - /// - /// Returns true if the wrapped registry key exists. - /// - /// - public virtual bool Exists() - { - return WrappedKey != null; - } - - /// - /// Lazy getter for the root tools version registry key: means that this class - /// will never throw registry exceptions from the constructor - /// - private RegistryKey WrappedKey - { - get - { - // If we haven't wrapped a key yet, and we got a path to look at, - // and we haven't tried to look there yet - if (wrappedKey == null && registryKeyPath != null && !attemptedToOpenRegistryKey) - { - try - { - wrappedKey = registryHive.OpenSubKey(registryKeyPath); - } - catch (Exception ex) - { - if (NotExpectedException(ex)) - { - throw; - } - - throw new RegistryException(ex.Message, Name, ex); - } - finally - { - attemptedToOpenRegistryKey = true; - } - } - - return wrappedKey; - } - } - - /// - /// Returns false if this is a known exception thrown by the registry API. - /// - /// - /// - private bool NotExpectedException(Exception e) - { - if (e is SecurityException - || e is UnauthorizedAccessException - || e is IOException - || e is ObjectDisposedException) - { - return false; - } - - return true; - } - } -} diff --git a/src/Deprecated/Engine/Engine/RequestRoutingContext.cs b/src/Deprecated/Engine/Engine/RequestRoutingContext.cs deleted file mode 100644 index c2d5e701a0a..00000000000 --- a/src/Deprecated/Engine/Engine/RequestRoutingContext.cs +++ /dev/null @@ -1,119 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This context is created to contain information about a build request that has been forwarded to - /// a child node for execution. All further communication from the child with regard to the build - /// request (such a logging messages, errors, follow up build requests or build result) will be - /// processing using information from this context. - /// - internal class RequestRoutingContext : ExecutionContext - { - #region Constructors - /// - /// Default constructor for a routing context - /// - internal RequestRoutingContext - ( - int handleId, - int nodeIndex, - int parentHandleId, - int parentNodeIndex, - int parentRequestId, - CacheScope cacheScope, - BuildRequest triggeringBuildRequest, - BuildEventContext buildEventContext - ) - : base(handleId, nodeIndex, buildEventContext) - { - this.parentHandleId = parentHandleId; - this.parentNodeIndex = parentNodeIndex; - this.parentRequestId = parentRequestId; - this.cacheScope = cacheScope; - this.triggeringBuildRequest = triggeringBuildRequest; - } - #endregion - - #region Properties - /// - /// The handle to the parent context which maybe invalidHandle if the request - /// originated from the host. - /// - internal int ParentHandleId - { - get - { - return this.parentHandleId; - } - } - - /// - /// The node from the triggering build request (overwritten on the build request during routing) - /// - internal int ParentNodeIndex - { - get - { - return this.parentNodeIndex; - } - } - - /// - /// The request Id from the triggering build request (overwritten on the build request during routing) - /// - internal int ParentRequestId - { - get - { - return this.parentRequestId; - } - } - - /// - /// The cache scope where the result should be stored - /// - internal CacheScope CacheScope - { - get - { - return this.cacheScope; - } - } - - /// - /// The build request being routed - /// - internal BuildRequest TriggeringBuildRequest - { - get - { - ErrorUtilities.VerifyThrow(triggeringBuildRequest != null, "This must be a routing context"); - return triggeringBuildRequest; - } - } - - #endregion - - #region Data - // The handle Id for the parent context - private int parentHandleId; - // The node from the triggering build request (overwritten on the build request during routing) - private int parentNodeIndex; - // The request Id from the triggering build request (overwritten on the build request during routing) - private int parentRequestId; - // The build request being routed - private BuildRequest triggeringBuildRequest; - // The cache scope where the result should be stored - private CacheScope cacheScope; - #endregion - } -} diff --git a/src/Deprecated/Engine/Engine/Router.cs b/src/Deprecated/Engine/Engine/Router.cs deleted file mode 100644 index 8b785aa17f1..00000000000 --- a/src/Deprecated/Engine/Engine/Router.cs +++ /dev/null @@ -1,217 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This call interfaces with the scheduler and notifies it of events of interest such as build results or - /// build requests. It also routes the build results appropriately depending on if it is running on the child or - /// on the parent. - /// - internal class Router - { - #region Constructors - /// - /// Private constructor to avoid parameterless instantiation - /// - private Router() - { - } - - /// - /// Default constructor - /// - internal Router(Engine parentEngine, Scheduler scheduler) - { - this.nodeManager = parentEngine.NodeManager; - this.parentEngine = parentEngine; - this.scheduler = scheduler; - - this.childMode = false; - this.parentNode = null; - } - #endregion - - #region Properties - - /// - /// Returns true on the child engine and false otherwise. this is used by the engine to determine if the engine is running on a child - /// process or not. The childMode is set to true in the NodeLocalEngineLoop which is only executed on a child process. - /// - internal bool ChildMode - { - get - { - return this.childMode; - } - set - { - this.childMode = value; - } - } - - /// - /// Returns null on the parent engine and a pointer to the node hosting the engine on the child - /// engines - /// - internal Node ParentNode - { - get - { - return this.parentNode; - } - set - { - this.parentNode = value; - } - } - - /// - /// Used by the engine to choose more effecient code path for single proc - /// execution. In general the usage should be minimized by using inheretence and - /// different classes in single proc and multiproc cases - /// - internal bool SingleThreadedMode - { - get - { - return !childMode && nodeManager.MaxNodeCount == 1; - } - } - - #endregion - - #region Methods - - /// - /// This method creates a BuildResult using the information contained in a completed build request and - /// then routes it to the right node. On a child process, this means either consume the result localy, - /// or send it to the parent node. On a parent node, this means either consume the result locally or - /// send it to a child node - /// - internal void PostDoneNotice(BuildRequest buildRequest) - { - // Create a container with the results of the evaluation - BuildResult buildResult = buildRequest.GetBuildResult(); - - // If we're supposed to use caching and this request wasn't restored from cache, cache it - if (buildRequest.UseResultsCache && !buildRequest.RestoredFromCache) - { - CacheScope cacheScope = parentEngine.CacheManager.GetCacheScope(buildRequest.ProjectFileName, buildRequest.GlobalProperties, buildRequest.ToolsetVersion, CacheContentType.BuildResults); - cacheScope.AddCacheEntryForBuildResults(buildResult); - } - - // an external request is any request that came from the parent engine, all requests to a child are external - // unless the project was alredy loaded on the node itself - if (buildRequest.IsExternalRequest) - { - // If the build request was send from outside the current process, - // send the results to the parent engine - parentNode.PostBuildResultToHost(buildResult); - } - else - { - // In the case of a child process, getting to this point means the request will be satisfied locally, the node index should be 0 - // on the parent engine however, the node index can be, 0 for the local node, or can be >0 which represents a child node - PostDoneNotice(buildRequest.NodeIndex, buildResult); - } - } - /// - /// Route a given BuildResult to a given node. - /// - internal void PostDoneNotice(int nodeId, BuildResult buildResult) - { - - - // Notify the scheduler that a given node(nodeId) will be getting a buildResult. - // This method is a no-op if the router is on a child process - scheduler?.NotifyOfBuildResult(nodeId, buildResult); - - - if (nodeId == EngineCallback.inProcNode) - { - // Make a deep copy of the results. This is only necessary if nodeId = EngineCallback.inProcNode because - // that's the only case that this buildResult wouldn't get copied anyway to serialize - // it for the wire. A copy is necessary because the cache may contain the results and the user - // task code should not have pointers to the same copy - buildResult = new BuildResult(buildResult, true); - } - - // Give the result to the node manager which will send the result to the correct node. - nodeManager.PostBuildResultToNode(nodeId, buildResult); - } - - /// - /// This method is called once the engine has decided to sent a build request to a child node. - /// Route the given BuildRequest to the given node. If necessary a routing context is - /// created to manage future communication with the node regarding the build request. - /// - internal void PostBuildRequest(BuildRequest currentRequest, int nodeIndex) - { - // if the request is to be sent to the parent node, post the request back to the host - if (nodeIndex == EngineCallback.parentNode) - { - ParentNode.PostBuildRequestToHost(currentRequest); - } - else - { - // Dont create any contexts if the request was supposed to be processed on the current node - if (nodeIndex != EngineCallback.inProcNode) - { - // Get the cache scope for the request (possibly creating it). The cache scope will contain the taskoutputs of the build request - // which can be reused of the same project/toolsversion/globalproperties is asked for again. - CacheScope cacheScope = parentEngine.CacheManager.GetCacheScope(currentRequest.ProjectFileName, currentRequest.GlobalProperties, currentRequest.ToolsetVersion, CacheContentType.BuildResults); - - // Create a routing context and update the request to refer to the new node handle id - int parentHandleId = currentRequest.HandleId; - currentRequest.HandleId = - parentEngine.EngineCallback.CreateRoutingContext - (nodeIndex, currentRequest.HandleId, currentRequest.NodeIndex, - currentRequest.RequestId, cacheScope, currentRequest, null); - - - - // Check to see if we need to change the traversal strategy of the system - // parentHandleId and node index are not used in the function so it can be ignored - scheduler?.NotifyOfBuildRequest(nodeIndex, currentRequest, parentHandleId); - - - nodeManager.PostBuildRequestToNode(nodeIndex, currentRequest); - } - } - } - - #endregion - - #region Data - /// - /// The node manager is used as a proxy for communication with child nodes - /// - private NodeManager nodeManager; - - /// - /// The parent engine who instantiated the router - /// - private Engine parentEngine; - - /// - /// Scheduler who is responsible for determining which nodes a build request should be sent to. - /// - private Scheduler scheduler; - - /// - /// Is the router instantiated on a child process - /// - private bool childMode; - - /// - /// What is the parent Node on which the engine is hosted if we are a child process - /// - private Node parentNode; - #endregion - } -} diff --git a/src/Deprecated/Engine/Engine/Scheduler.cs b/src/Deprecated/Engine/Engine/Scheduler.cs deleted file mode 100644 index 5171c454631..00000000000 --- a/src/Deprecated/Engine/Engine/Scheduler.cs +++ /dev/null @@ -1,485 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections.Generic; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class is responsible for determining on which node and when a task should be executed. It - /// receives work requests from the Target class and communicates to the appropriate node. - /// - internal class Scheduler - { - #region Constructors - /// - /// Create the scheduler. - /// - /// the id of the node where the scheduler was instantiated on - /// a reference to the engine who instantiated the scheduler - internal Scheduler(int nodeId, Engine parentEngine) - { - this.localNodeId = nodeId; - this.childMode = true; - this.parentEngine = parentEngine; - } - - #endregion - - #region Properties - - #endregion - - #region Methods - /// - /// Provide the scheduler with the information about the available nodes. This function has to be - /// called after the NodeManager has initialzed all the node providers - /// - internal void Initialize(INodeDescription[] nodeDescriptions) - { - this.nodes = nodeDescriptions; - this.childMode = false; - - this.handleIdToScheduleRecord = new Dictionary(); - this.scheduleTableLock = new object(); - - this.totalRequestsPerNode = new int[nodes.Length]; - this.blockedRequestsPerNode = new int[nodes.Length]; - this.postBlockCount = new int[nodes.Length]; - - for (int i = 0; i < totalRequestsPerNode.Length; i++) - { - totalRequestsPerNode[i] = 0; - blockedRequestsPerNode[i] = 0; - postBlockCount[i] = 0; - } - - this.useLoadBalancing = (Environment.GetEnvironmentVariable("MSBUILDLOADBALANCE") != "0"); - this.lastUsedNode = 0; - } - - /// - /// This method specifies which node a particular build request has to be evaluated on. - /// > - /// Id of the node on which the build request should be performed - internal int CalculateNodeForBuildRequest(BuildRequest currentRequest, int nodeIndexCurrent) - { - int nodeUsed = EngineCallback.inProcNode; - if (childMode) - { - // If the project is already loaded on the current node or if the request - // was sent from the parent - evaluate the request locally. In all other - // cases send the request over to the parent - if (nodeIndexCurrent != localNodeId && !currentRequest.IsExternalRequest) - { - // This is the same as using EngineCallback.parentNode - nodeUsed = -1; - } - } - else - { - // In single proc case return the current node - if (nodes.Length == 1) - { - return nodeUsed; - } - - // If the project is not loaded either locally or on a remote node - calculate the best node to use - // If there are nodes with less than "nodeWorkLoadProjectCount" projects in progress, choose the node - // with the lowest in progress projects. Otherwise choose a node which has the least - // number of projects loaded. Resolve a tie in number of projects loaded by looking at the number - // of inprogress projects - nodeUsed = nodeIndexCurrent; - // If we have not chosen an node yet, this can happen if the node was loaded previously on a child node - if (nodeUsed == EngineCallback.invalidNode) - { - if (useLoadBalancing) - { - #region UseLoadBalancing - int blockedNode = EngineCallback.invalidNode; - int blockedNodeRemainingProjectCount = nodeWorkLoadProjectCount; - int leastBusyNode = EngineCallback.invalidNode; - int leastBusyInProgressCount = -1; - int leastLoadedNode = EngineCallback.inProcNode; - int leastLoadedLoadCount = totalRequestsPerNode[EngineCallback.inProcNode]; - int leastLoadedBlockedCount = blockedRequestsPerNode[EngineCallback.inProcNode]; - - for (int i = 0; i < nodes.Length; i++) - { - //postBlockCount indicates the number of projects which should be sent to a node to unblock it due to the - //node running out of work. - if (postBlockCount[i] != 0 && postBlockCount[i] < blockedNodeRemainingProjectCount) - { - blockedNode = i; - blockedNodeRemainingProjectCount = postBlockCount[i]; - } - else - { - // Figure out which node has the least ammount of in progress work - int perNodeInProgress = totalRequestsPerNode[i] - blockedRequestsPerNode[i]; - if ((perNodeInProgress < nodeWorkLoadProjectCount) && - (perNodeInProgress < leastBusyInProgressCount || leastBusyInProgressCount == -1)) - { - leastBusyNode = i; - leastBusyInProgressCount = perNodeInProgress; - } - // Find the node with the least ammount of requests in total - // or if the number of requests are the same find the node with the - // node with the least number of blocked requests - if ((totalRequestsPerNode[i] < leastLoadedLoadCount) || - (totalRequestsPerNode[i] == leastLoadedLoadCount && blockedRequestsPerNode[i] < leastLoadedBlockedCount)) - { - leastLoadedNode = i; - leastLoadedLoadCount = totalRequestsPerNode[i]; - leastLoadedBlockedCount = perNodeInProgress; - } - } - } - - // Give the work to a node blocked due to having no work . If there are no nodes without work - // give the work to the least loaded node - if (blockedNode != EngineCallback.invalidNode) - { - nodeUsed = blockedNode; - postBlockCount[blockedNode]--; - } - else - { - nodeUsed = (leastBusyNode != EngineCallback.invalidNode) ? leastBusyNode : leastLoadedNode; - } - #endregion - } - else - { - // round robin schedule the build request - nodeUsed = (lastUsedNode % nodes.Length); - - // Running total of the number of times this round robin scheduler has been called - lastUsedNode++; - - if (postBlockCount[nodeUsed] != 0) - { - postBlockCount[nodeUsed]--; - } - } - } - - // Update the internal data structure to reflect the scheduling decision - NotifyOfSchedulingDecision(currentRequest, nodeUsed); - } - return nodeUsed; - } - - /// - /// This method is called to update the datastructures to reflect that given request will - /// be built on a given node. - /// - /// - /// - internal void NotifyOfSchedulingDecision(BuildRequest currentRequest, int nodeUsed) - { - // Don't update structures on the child node or in single proc mode - if (childMode || nodes.Length == 1) - { - return; - } - - // Update the count of requests being build on the node - totalRequestsPerNode[nodeUsed]++; - - // Ignore host requests - if (currentRequest.HandleId == EngineCallback.invalidEngineHandle) - { - return; - } - - if (Engine.debugMode) - { - string targetnames = currentRequest.TargetNames != null ? String.Join(";", currentRequest.TargetNames) : "null"; - Console.WriteLine("Sending project " + currentRequest.ProjectFileName + " Target " + targetnames + " to " + nodeUsed); - } - - // Update the records - ScheduleRecordKey recordKey = new ScheduleRecordKey(currentRequest.HandleId, currentRequest.RequestId); - ScheduleRecordKey parentKey = new ScheduleRecordKey(currentRequest.ParentHandleId, currentRequest.ParentRequestId); - ScheduleRecord record = new ScheduleRecord(recordKey, parentKey, nodeUsed, currentRequest.ProjectFileName, - currentRequest.ToolsetVersion, currentRequest.TargetNames); - - lock (scheduleTableLock) - { - ErrorUtilities.VerifyThrow(!handleIdToScheduleRecord.ContainsKey(recordKey), - "Schedule record should not be in the table"); - - handleIdToScheduleRecord.Add(recordKey, record); - - // The ParentHandleId is an invalidEngineHandle when the host is the one who created - // the current request - if (currentRequest.ParentHandleId != EngineCallback.invalidEngineHandle) - { - ErrorUtilities.VerifyThrow(handleIdToScheduleRecord.ContainsKey(parentKey), - "Parent schedule record should be in the table"); - ScheduleRecord parentRecord = handleIdToScheduleRecord[parentKey]; - if (!parentRecord.Blocked) - { - blockedRequestsPerNode[parentRecord.EvaluationNode]++; - } - parentRecord.AddChildRecord(record); - } - } - } - - /// - /// This method is called when a build request is completed on a particular node. NodeId is never used instead we look up the node from the build request - /// and the schedule record table - /// - internal void NotifyOfBuildResult(int nodeId, BuildResult buildResult) - { - if (!childMode && nodes.Length > 1) - { - // Ignore host requests - if (buildResult.HandleId == EngineCallback.invalidEngineHandle) - { - return; - } - - ScheduleRecordKey recordKey = new ScheduleRecordKey(buildResult.HandleId, buildResult.RequestId); - ScheduleRecord scheduleRecord = null; - lock (scheduleTableLock) - { - ErrorUtilities.VerifyThrow(handleIdToScheduleRecord.ContainsKey(recordKey), - "Schedule record should be in the table"); - - scheduleRecord = handleIdToScheduleRecord[recordKey]; - totalRequestsPerNode[scheduleRecord.EvaluationNode]--; - handleIdToScheduleRecord.Remove(recordKey); - - if (scheduleRecord.ParentKey.HandleId != EngineCallback.invalidEngineHandle) - { - ErrorUtilities.VerifyThrow(handleIdToScheduleRecord.ContainsKey(scheduleRecord.ParentKey), - "Parent schedule record should be in the table"); - ScheduleRecord parentRecord = handleIdToScheduleRecord[scheduleRecord.ParentKey]; - - // As long as there are child requests under the parent request the parent request is considered blocked - // Remove this build request from the list of requests the parent request is waiting on. This may unblock the parent request - parentRecord.ReportChildCompleted(recordKey); - - // If completing the child request has unblocked the parent request due to all of the the Child requests being completed - // decrement the number of blocked requests. - if (!parentRecord.Blocked) - { - blockedRequestsPerNode[parentRecord.EvaluationNode]--; - } - } - } - - // Dump some interesting information to the console if profile build is turned on by an environment variable - if (parentEngine.ProfileBuild && scheduleRecord != null && buildResult.TaskTime != 0) - { - Console.WriteLine("N " + scheduleRecord.EvaluationNode + " Name " + scheduleRecord.ProjectName + ":" + - scheduleRecord.ParentKey.HandleId + ":" + scheduleRecord.ParentKey.RequestId + - " Total " + buildResult.TotalTime + " Engine " + buildResult.EngineTime + " Task " + buildResult.TaskTime); - } - } - } - - /// - /// Called when the engine is in the process of sending a buildRequest to a child node. The entire purpose of this method - /// is to switch the traversal strategy of the systems if there are nodes which do not have enough work availiable to them. - /// - internal void NotifyOfBuildRequest(int nodeIndex, BuildRequest currentRequest, int parentHandleId) - { - // This will only be null when the scheduler is instantiated on a child process in which case the initialize method - // of the scheduler will not be called and therefore not initialize totalRequestsPerNode. - if (totalRequestsPerNode != null) - { - // Check if it makes sense to switch from one traversal strategy to the other - if (parentEngine.NodeManager.TaskExecutionModule.UseBreadthFirstTraversal) - { - // Check if a switch to depth first traversal is in order - bool useBreadthFirstTraversal = false; - for (int i = 0; i < totalRequestsPerNode.Length; i++) - { - // Continue using breadth-first traversal as long as the non-blocked work load for this node is below - // the nodeWorkloadProjectCount or its postBlockCount is non-zero - if ((totalRequestsPerNode[i] - blockedRequestsPerNode[i]) < nodeWorkLoadProjectCount || postBlockCount[i] != 0) - { - useBreadthFirstTraversal = true; - break; - } - } - - if (!useBreadthFirstTraversal) - { - if (Engine.debugMode) - { - Console.WriteLine("Switching to depth first traversal because all node have workitems"); - } - parentEngine.NodeManager.TaskExecutionModule.UseBreadthFirstTraversal = false; - - // Switch to depth first and change the traversal strategy of the entire system by notifying all child nodes of the change - parentEngine.PostEngineCommand(new ChangeTraversalTypeCommand(false, false)); - } - } - } - } - - /// - /// Called by the engine to indicate that a particular request is blocked waiting for another - /// request to finish building a target. - /// - internal void NotifyOfBlockedRequest(BuildRequest currentRequest) - { - if (!childMode && nodes.Length > 1) - { - ScheduleRecordKey recordKey = new ScheduleRecordKey(currentRequest.HandleId, currentRequest.RequestId); - - // Ignore host requests - if (currentRequest.HandleId == EngineCallback.invalidEngineHandle) - { - return; - } - - lock (scheduleTableLock) - { - ErrorUtilities.VerifyThrow(handleIdToScheduleRecord.ContainsKey(recordKey), - "Schedule record should be in the table"); - handleIdToScheduleRecord[recordKey].Blocked = true; - blockedRequestsPerNode[handleIdToScheduleRecord[recordKey].EvaluationNode]++; - } - } - } - - /// - /// Called by the engine to indicate that a particular request is no longer blocked waiting for another - /// request to finish building a target - /// - internal void NotifyOfUnblockedRequest(BuildRequest currentRequest) - { - if (!childMode && nodes.Length > 1) - { - ScheduleRecordKey recordKey = new ScheduleRecordKey(currentRequest.HandleId, currentRequest.RequestId); - lock (scheduleTableLock) - { - ErrorUtilities.VerifyThrow(handleIdToScheduleRecord.ContainsKey(recordKey), - "Schedule record should be in the table"); - handleIdToScheduleRecord[recordKey].Blocked = false; - blockedRequestsPerNode[handleIdToScheduleRecord[recordKey].EvaluationNode]--; - } - } - } - - /// - /// Called by the engine to indicate that a node has run out of work - /// - /// - internal void NotifyOfBlockedNode(int nodeId) - { - if (Engine.debugMode) - { - Console.WriteLine("Switch to breadth first traversal is requested by " + nodeId); - } - - postBlockCount[nodeId] = nodeWorkLoadProjectCount / 2; - } - - /// - /// Used by the introspector to dump the state when the nodes are being shutdown due to an error. - /// - internal void DumpState() - { - for (int i = 0; i < totalRequestsPerNode.Length; i++) - { - Console.WriteLine("Node " + i + " Outstanding " + totalRequestsPerNode[i] + " Blocked " + blockedRequestsPerNode[i]); - } - - foreach (ScheduleRecordKey key in handleIdToScheduleRecord.Keys) - { - ScheduleRecord record = handleIdToScheduleRecord[key]; - Console.WriteLine(key.HandleId + ":" + key.RequestId + " " + record.ProjectName + " on node " + record.EvaluationNode); - } - } - #endregion - - #region Data - - /// - /// NodeId of the engine who instantiated the scheduler. This is used to determine if a - /// BuildRequest should be build locally as the project has already been loaded on this node. - /// - private int localNodeId; - - /// - /// An array of nodes to which the scheduler can schedule work. - /// - private INodeDescription[] nodes; - - /// - /// Counts the total number of outstanding requests (no result has been seen for the request) for a node. - /// This is incremented in NotifyOfSchedulingDecision when a request it given to a node - /// and decremented in NotifyOfBuildResult when results are returned (posted) from a node. - /// - private int[] totalRequestsPerNode; - - /// - /// The number of BuildRequests blocked waiting for results for each node. - /// This will be incremented once when a build request is scheduled which was generated as part of a msbuild callback - /// and once for each call to NotifyOfBlockedRequest. - /// - /// It is decremented for each call to NotifyOfUnblockedRequest and once all of the child requests have been fullfilled. - /// - private int[] blockedRequestsPerNode; - - /// - /// Keeps track of how many projects need to be sent to a node after the node has told the scheduler it has run out of work. - /// - private int[] postBlockCount; - - /// - /// Indicates the scheduler should balance work accross nodes. - /// This is only true when the environment variable MSBUILDLOADBALANCE is not 0 - /// - private bool useLoadBalancing; - - /// - /// Lock object for the handleIdToScheduleRecord dictionary - /// - private object scheduleTableLock; - - /// - /// Keep track of build requsts to determine how many requests are blocked waiting on other build requests to complete. - /// - private Dictionary handleIdToScheduleRecord; - - /// - /// Indicates the scheduler is instantiated on a child node. This is being determined by - /// initializaing the variable to true in the constructor and then setting it to false in the - /// initialize method (the initialize method will only be called on the parent engine) - /// - private bool childMode; - - /// - /// Reference to the engine who instantiated the scheduler - /// - private Engine parentEngine; - - /// - /// Number of requests a node should have in an unblocked state before the system switches to a depth first traversal strategy. - /// - private const int nodeWorkLoadProjectCount = 4; - - /// - /// Used to calculate which node a build request should be sent to if the scheduler is operating in a round robin fashion. - /// Each time a build request is scheduled to a node in CalculateNodeForBuildRequest the lastUsedNode is incremented. - /// This value is then mod'd (%) with the number of nodes to alternate which node the next build request goes to. - /// - private int lastUsedNode; - - #endregion - } -} diff --git a/src/Deprecated/Engine/Engine/SchedulerRecord.cs b/src/Deprecated/Engine/Engine/SchedulerRecord.cs deleted file mode 100644 index 9113e2adf50..00000000000 --- a/src/Deprecated/Engine/Engine/SchedulerRecord.cs +++ /dev/null @@ -1,241 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System.Collections.Generic; -using System.Diagnostics; // For the debugger attribute - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class is a container used by the scheduler to keep track of what work is being done by which node. - /// This includes seeing which build requests are blocked waiting for another build request to complete and which - /// are actively in progress - /// - [DebuggerDisplay("Record ({recordKey.handleId},{recordKey.requestId})")] - internal class ScheduleRecord - { - #region Constructors - internal ScheduleRecord - ( - ScheduleRecordKey recordKey, - ScheduleRecordKey parentKey, - int evaluationNode, - string projectName, - string toolsVersion, - string[] targetsBuild - ) - { - this.recordKey = recordKey; - this.parentKey = parentKey; - this.evaluationNode = evaluationNode; - this.blockedFlag = false; - this.projectName = projectName; - this.toolsVersion = toolsVersion; - this.targetsBuild = targetsBuild; - } - #endregion - - #region Properties - /// - /// Returns true if this request is blocked waiting for the child requests to - /// complete - /// - internal bool Blocked - { - get - { - if ((requestIdToChildRecord == null || requestIdToChildRecord.Count == 0) && !blockedFlag) - { - return false; - } - return true; - } - set - { - blockedFlag = value; - } - } - - /// - /// Returns the node on which the request is being build - /// - internal int EvaluationNode - { - get - { - return evaluationNode; - } - } - - /// - /// Key to the parent object - /// - internal ScheduleRecordKey ParentKey - { - get - { - return parentKey; - } - } - - /// - /// Key to the current object - /// - internal ScheduleRecordKey RecordKey - { - get - { - return recordKey; - } - } - - /// - /// Name of the project being build - /// - internal string ProjectName - { - get - { - return projectName; - } - } - - /// - /// The version of the project - /// - internal string ToolsVersion - { - get - { - return toolsVersion; - } - } - - /// - /// Targets being build in the project - /// - internal string[] TargetsBuild - { - get - { - return targetsBuild; - } - } - - #endregion - - #region Methods - - /// - /// Add a child request to this record. Child requests block the parent. - /// - /// - internal void AddChildRecord(ScheduleRecord childRecord) - { - if (requestIdToChildRecord == null) - { - requestIdToChildRecord = new Dictionary(); - } - - requestIdToChildRecord.Add(childRecord.RecordKey, childRecord); - } - - /// - /// Remove a completed child request possibly unblocking the parent - /// - /// - internal void ReportChildCompleted(ScheduleRecordKey key) - { - requestIdToChildRecord.Remove(key); - } - - #endregion - - #region Data - // Key to the current object - private ScheduleRecordKey recordKey; - // Key to the parent object - private ScheduleRecordKey parentKey; - // Name of the project - private string projectName; - // Toolset version - private string toolsVersion; - // Targets being build - private string[] targetsBuild; - // Node on which the request is being build - private int evaluationNode; - // Marks the request as blocked - private bool blockedFlag; - // Dictionary of child requests (lazily initialized) - private Dictionary requestIdToChildRecord; - #endregion - } - - /// - /// This class is used as a key combining both HandleId and RequestId into a single class. - /// - [DebuggerDisplay("Key ({handleId},{requestId})")] - internal class ScheduleRecordKey - { - #region Constructors - internal ScheduleRecordKey(int handleId, int requestId) - { - this.handleId = handleId; - this.requestId = requestId; - } - #endregion - - #region Properties - internal int HandleId - { - get - { - return handleId; - } - } - internal int RequestId - { - get - { - return requestId; - } - } - #endregion - - #region Methods - /// - /// Override the equals operator to give valuetype comparison semantics - /// - public override bool Equals(object obj) - { - ScheduleRecordKey other = obj as ScheduleRecordKey; - if (other != null) - { - if (other.handleId == handleId && other.requestId == requestId) - { - return true; - } - return false; - } - - return base.Equals(obj); - } - - public override int GetHashCode() - { - return handleId + (requestId << 24); - } - #endregion - - #region Data - // Handle Id - private int handleId; - // Request Id - private int requestId; - #endregion - } -} diff --git a/src/Deprecated/Engine/Engine/Target.cs b/src/Deprecated/Engine/Engine/Target.cs deleted file mode 100644 index 19e512008a0..00000000000 --- a/src/Deprecated/Engine/Engine/Target.cs +++ /dev/null @@ -1,979 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Xml; -using System.Diagnostics; // for debugger display attribute -using System.Collections; -using System.Collections.Generic; - -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine.Shared; - -using error = Microsoft.Build.BuildEngine.Shared.ErrorUtilities; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// This class represents a single target in its parent project. - /// - /// - /// [!WARNING] - /// > This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - [DebuggerDisplay("Target (Name = { Name }, Condition = { Condition })")] - public class Target : IEnumerable - { - #region Enums - /// - /// This enumeration contains a list of the possible states that the target could be in, in terms of the build process. - /// - internal enum BuildState - { - // This build for this target has not begun. We don't even know if - // we're going to end up needing to build this target at all. - NotStarted, - - // We've determined that this target needs to be built, and we're - // in the process of doing exactly that. Building other targets - // that are dependents of this target is considered to be part of - // building this target. And so, while we're building other dependent - // targets, our state will be set to "InProgress". - InProgress, - - // This target (and naturally all dependent targets) has been - // successfully built. - CompletedSuccessfully, - - // We have attempted to build this target and all its dependent - // targets. However, something failed during that process, and - // we consider ourselves done with this target. - CompletedUnsuccessfully, - - // This target is to be skipped. This state is the result of a target - // having a condition attribute and that condition evaluating to false. - Skipped - } - #endregion - - #region Member Data - - // The evaluated name of the target. - private string targetName; - - // The parent project.object. We will need this in order get the - // complete list of targets, items, properties, etc. - private Project parentProject; - - // The parent Engine object. - private Engine parentEngine; - - // The state of this target, in terms of the build. - private BuildState buildState; - - // The XML element, if this is a persisted item. For virtual - // items (i.e., those generated by tasks), this would be null. - private XmlElement targetElement = null; - - // This is the "Condition" attribute on the element. - private XmlAttribute conditionAttribute = null; - - // This is the "DependsOnTargets" attribute on the element. - private XmlAttribute dependsOnTargetsAttribute = null; - - // This is the "Inputs" attribute on the element. - private XmlAttribute inputsAttribute = null; - - // This is the "Outputs" attribute on the element. - private XmlAttribute outputsAttribute = null; - - // This contains all of the child task nodes in this node. - private ArrayList taskElementList = null; - - // If this is a persisted element, this boolean tells us whether - // it came from the main parentProject.file or an imported parentProject.file. - private bool importedFromAnotherProject = false; - - // If the Inputs or Outputs attribute changes then we will have to re-calculate the - // targetParameters - private bool recalculateBatchableParameters = false; - - // the project file that the target XML was defined in -- this file could be different from the file of this target's - // parent project if the target was defined in an imported project file - private string projectFileOfTargetElement; - - // the outputs of the target as BuildItems (if it builds successfully) - private List targetOutputItems; - - // We check the target's condition to ensure it doesn't reference item metadata in an attempt to batch. - private bool conditionCheckedForInvalidMetadataReferences = false; - private TargetExecutionWrapper executionState = null; - private List batchableTargetParameters = null; - - // TargetId - private int id; - - #endregion - - #region Constructors - - /// - /// Initializes a persisted target from an existing <Target> element which exists either in the main parent project - /// file or one of the imported files. - /// - /// - /// - /// - internal Target - ( - XmlElement targetElement, - Project project, - bool importedFromAnotherProject - ) - { - // Make sure a valid node has been given to us. - error.VerifyThrow(targetElement != null, "Need a valid XML node."); - - // Make sure this really is the node. - ProjectXmlUtilities.VerifyThrowElementName(targetElement, XMakeElements.target); - - this.targetElement = targetElement; - this.parentProject = project; - this.parentEngine = project.ParentEngine; - this.conditionAttribute = null; - this.taskElementList = null; - this.importedFromAnotherProject = importedFromAnotherProject; - this.buildState = BuildState.NotStarted; - this.id = project.ParentEngine.GetNextTargetId(); - - // The target name and target dependendencies (dependencies on other - // targets) are specified as attributes of the element. - - XmlAttribute returnsAttribute = null; - // Loop through all the attributes on the element. - foreach (XmlAttribute targetAttribute in targetElement.Attributes) - { - switch (targetAttribute.Name) - { - // Process the "condition" attribute. - case XMakeAttributes.condition: - this.conditionAttribute = targetAttribute; - break; - - // Process the "name" attribute. - case XMakeAttributes.name: - this.targetName = EscapingUtilities.UnescapeAll(targetAttribute.Value); - - // Target names cannot contain MSBuild special characters, embedded properties, - // or item lists. - int indexOfSpecialCharacter = this.targetName.IndexOfAny(XMakeElements.illegalTargetNameCharacters); - if (indexOfSpecialCharacter >= 0) - { - ProjectErrorUtilities.VerifyThrowInvalidProject(false, - targetAttribute, "NameInvalid", targetName, targetName[indexOfSpecialCharacter]); - } - - break; - - // Process the "dependsOnTargets" attribute. - case XMakeAttributes.dependsOnTargets: - this.dependsOnTargetsAttribute = targetAttribute; - break; - - case XMakeAttributes.inputs: - this.inputsAttribute = targetAttribute; - recalculateBatchableParameters = true; - break; - - case XMakeAttributes.outputs: - this.outputsAttribute = targetAttribute; - recalculateBatchableParameters = true; - break; - - // This is only recognized by the new OM: - // so that the compat tests keep passing, - // ignore it. - case XMakeAttributes.keepDuplicateOutputs: - break; - - // This is only recognized by the new OM: - // so that the compat tests keep passing, - // ignore it. - case XMakeAttributes.returns: - returnsAttribute = targetAttribute; - break; - - // These are only recognized by the new OM: - // while the solution wrapper generator is using - // the old OM to parse projects for dependencies, - // we must make sure to not fail for these - case XMakeAttributes.beforeTargets: - case XMakeAttributes.afterTargets: - break; - - default: - ProjectXmlUtilities.ThrowProjectInvalidAttribute(targetAttribute); - break; - } - } - - // Hack to help the 3.5 engine at least pretend to still be able to build on top of - // the 4.0 targets. In cases where there is no Outputs attribute, just a Returns attribute, - // we can approximate the correct behaviour by making the Returns attribute our "outputs" attribute. - if (this.outputsAttribute == null && returnsAttribute != null) - { - this.outputsAttribute = returnsAttribute; - recalculateBatchableParameters = true; - } - - // It's considered an error if a target does not have a name. - ProjectErrorUtilities.VerifyThrowInvalidProject(!string.IsNullOrEmpty(targetName), - targetElement, "MissingRequiredAttribute", XMakeAttributes.name, XMakeElements.target); - - this.taskElementList = new ArrayList(); - - // Process each of the child nodes beneath the . - XmlElement anyOnErrorElement = null; - List childElements = ProjectXmlUtilities.GetValidChildElements(targetElement); - - foreach (XmlElement childElement in childElements) - { - bool onErrorOutOfOrder = false; - switch (childElement.Name) - { - case XMakeElements.onError: - anyOnErrorElement = childElement; - break; - - default: - onErrorOutOfOrder = (anyOnErrorElement != null); - this.taskElementList.Add(new BuildTask(childElement, - this, this.importedFromAnotherProject)); - break; - } - - // Check for out-of-order OnError - ProjectErrorUtilities.VerifyThrowInvalidProject(!onErrorOutOfOrder, - anyOnErrorElement, "NodeMustBeLastUnderElement", XMakeElements.onError, XMakeElements.target, childElement.Name); - } - } - - #endregion - - #region Properties - - /// - /// Id for the target - /// - internal int Id - { - get - { - return this.id; - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Gets the target's name as specified in the "Name" attribute. The value of this attribute is never evaluated. - /// - /// The target name string. - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public string Name - { - get - { - return this.targetName; - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Gets the target's unevaluated "DependsOnTargets" string. - /// Returns unevaluated. - /// - /// The raw "DependsOnTargets" string. - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public string DependsOnTargets - { - get - { - return ProjectXmlUtilities.GetAttributeValue(this.dependsOnTargetsAttribute); - } - - set - { - this.dependsOnTargetsAttribute = SetOrRemoveTargetAttribute(XMakeAttributes.dependsOnTargets, value); - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Gets the target's unevaluated "Inputs" string. - /// Returns unevaluated. - /// - /// The raw "Inputs" string. - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public string Inputs - { - get - { - return ProjectXmlUtilities.GetAttributeValue(this.inputsAttribute); - } - set - { - this.inputsAttribute = SetOrRemoveTargetAttribute(XMakeAttributes.inputs, value); - recalculateBatchableParameters = true; - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Gets the target's unevaluated "Outputs" string. - /// Returns unevaluated. - /// - /// The raw "Outputs" string. - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public string Outputs - { - get - { - return ProjectXmlUtilities.GetAttributeValue(this.outputsAttribute); - } - set - { - this.outputsAttribute = SetOrRemoveTargetAttribute(XMakeAttributes.outputs, value); - recalculateBatchableParameters = true; - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Accessor for the item's "condition". Returned unevaluated. - /// - /// Condition string. - /// The raw condition string. - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public string Condition - { - get - { - return ProjectXmlUtilities.GetAttributeValue(this.conditionAttribute); - } - - set - { - this.conditionAttribute = SetOrRemoveTargetAttribute(XMakeAttributes.condition, value); - this.conditionCheckedForInvalidMetadataReferences = false; - } - } - - /// - /// Read-only accessor for accessing the XML attribute for "Condition". Callers should - /// never try and modify this. Go through this.Condition to change the condition. - /// - internal XmlAttribute ConditionAttribute - { - get - { - return this.conditionAttribute; - } - } - - /// - /// Gets the XML representing this target. - /// - /// The XmlElement for the target. - internal XmlElement TargetElement - { - get - { - return this.targetElement; - } - } - - /// - /// Gets the target's unevaluated "DependsOnTargets" XML element. - /// - internal XmlAttribute DependsOnTargetsAttribute - { - get - { - return this.dependsOnTargetsAttribute; - } - } - - /// - /// Gets the filename/path of the project this target was defined in. This file could be different from the file of this - /// target's parent project, because the target could be imported. If the target is only defined in-memory, then it may - /// not have a filename associated with it. - /// - /// The filename/path string of this target's original project, or empty string. - internal string ProjectFileOfTargetElement - { - get - { - if (projectFileOfTargetElement == null) - { - projectFileOfTargetElement = XmlUtilities.GetXmlNodeFile(TargetElement, parentProject.FullFileName); - } - - return projectFileOfTargetElement; - } - } - - /// - /// Read-only accessor for this target's parent Project object. - /// - /// - internal Project ParentProject - { - get - { - return this.parentProject; - } - - set - { - this.parentProject = value; - } - } - - /// - /// Read-only accessor for this target's parent Project object. - /// - /// - internal Engine ParentEngine - { - get - { - return this.parentEngine; - } - } - - /// - /// Calculates the batchable target parameters, which can be changed if inputs and outputs are - /// set after target creation. - /// - internal List GetBatchableTargetParameters() - { - if (recalculateBatchableParameters) - { - batchableTargetParameters = new List(); - - if (inputsAttribute != null) - { - batchableTargetParameters.Add(inputsAttribute.Value); - } - - if (outputsAttribute != null) - { - batchableTargetParameters.Add(outputsAttribute.Value); - } - - recalculateBatchableParameters = false; - } - else if (batchableTargetParameters == null) - { - batchableTargetParameters = new List(); - } - - return batchableTargetParameters; - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// This returns a boolean telling you whether this particular target - /// was imported from another project, or whether it was defined - /// in the main project. - /// - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public bool IsImported - { - get - { - return this.importedFromAnotherProject; - } - } - - internal BuildState TargetBuildState - { - get - { - return this.buildState; - } - } - - internal TargetExecutionWrapper ExecutionState - { - get - { - return executionState; - } - } - - #endregion - - #region Methods - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Allows the caller to use a foreach loop to enumerate through the individual - /// BuildTask objects contained within this Target. - /// - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public IEnumerator GetEnumerator - ( - ) - { - error.VerifyThrow(this.taskElementList != null, "List of TaskElements not initialized!"); - - return this.taskElementList.GetEnumerator(); - } - - /// - /// Sets the build state back to "NotStarted". - /// - internal void ResetBuildStatus - ( - ) - { - this.buildState = BuildState.NotStarted; - } - - /// - /// Update the target data structures since the target has completed - /// - internal void UpdateTargetStateOnBuildCompletion - ( - BuildState stateOfBuild, - List targetOutputItemList - ) - { - this.buildState = stateOfBuild; - this.targetOutputItems = targetOutputItemList; - - // Clear the execution state since the build is completed - executionState = null; - } - - /// - /// Builds this target if it has not already been built as part of its parent project. Before we actually execute the - /// tasks for this target, though, we first call on all the dependent targets to build themselves. - /// This function may throw InvalidProjectFileException - /// - internal void Build - ( - ProjectBuildState buildContext - ) - { - // Depending on the build state, we may do different things. - switch (buildState) - { - case BuildState.InProgress: - // In single proc mode if the build state was already "in progress" - // and somebody just told us to build ourselves, it means that there is - // a loop (circular dependency) in the target dependency graph. In multi - // proc mode we need to analyze the dependency graph before we can - // tell if there a circular dependency or if two independent chains - // of targets happen to need the result of this target. - if (parentEngine.Router.SingleThreadedMode || buildContext.ContainsCycle(this.Name)) - { - ProjectErrorUtilities.VerifyThrowInvalidProject(false, TargetElement, "CircularDependency", targetName); - } - else - { - buildContext.CurrentBuildContextState = ProjectBuildState.BuildContextState.WaitingForTarget; - this.executionState.AddWaitingBuildContext(buildContext); - } - break; - - case BuildState.CompletedSuccessfully: - case BuildState.CompletedUnsuccessfully: - // If this target has already been built as part of this project, - // we're not going to build it again. Just return the result - // from when it was built previously. Note: This condition - // could really only ever hold true if the user specifically - // requested us to build multiple targets and there existed - // a direct or indirect dependency relationship between two or - // more of those top-level targets. - // Note: we aren't really entering the target in question here, so don't use the target - // event context. Using the target ID for skipped messages would force us to - // cache the individual target IDs for unloaded projects and it's not really worth the trouble. - // Just use the parent event context. - parentEngine.LoggingServices.LogComment(buildContext.ProjectBuildEventContext, - (buildState == BuildState.CompletedSuccessfully) ? "TargetAlreadyCompleteSuccess" : "TargetAlreadyCompleteFailure", - this.targetName); - - // Only contexts which are generated from an MSBuild task could need - // the outputs of this target, such contexts have a non-null evaluation - // request - if ((buildState == BuildState.CompletedSuccessfully) && - (buildContext.BuildRequest.OutputsByTarget != null && - buildContext.NameOfBlockingTarget == null)) - { - error.VerifyThrow( - String.Equals(EscapingUtilities.UnescapeAll(buildContext.NameOfTargetInProgress), this.Name, StringComparison.OrdinalIgnoreCase), - "The name of the target in progress is inconsistent with the target being built"); - - error.VerifyThrow(targetOutputItems != null, - "If the target built successfully, we must have its outputs."); - - buildContext.BuildRequest.OutputsByTarget[Name] = targetOutputItems.ToArray(); - } - - if (buildContext.NameOfBlockingTarget == null) - { - buildContext.BuildRequest.ResultByTarget[Name] = buildState; - } - break; - - case BuildState.NotStarted: - case BuildState.Skipped: - { - // Always have to create a new context in build as other projects or targets may try and build this target - BuildEventContext targetBuildEventContext = new BuildEventContext - ( - buildContext.ProjectBuildEventContext.NodeId, - this.id, - buildContext.ProjectBuildEventContext.ProjectContextId, - buildContext.ProjectBuildEventContext.TaskId - ); - - Expander expander = new Expander(this.parentProject.evaluatedProperties, this.parentProject.evaluatedItemsByName); - - // We first make sure no batching was attempted with the target's condition. - if (!conditionCheckedForInvalidMetadataReferences) - { - if (ExpressionShredder.ContainsMetadataExpressionOutsideTransform(this.Condition)) - { - ProjectErrorUtilities.ThrowInvalidProject(this.conditionAttribute, "TargetConditionHasInvalidMetadataReference", targetName, this.Condition); - } - conditionCheckedForInvalidMetadataReferences = true; - } - - // If condition is false (based on propertyBag), set this target's state to - // "Skipped" since we won't actually build it. - if (!Utilities.EvaluateCondition(this.Condition, this.conditionAttribute, - expander, null, ParserOptions.AllowProperties | ParserOptions.AllowItemLists, - parentEngine.LoggingServices, targetBuildEventContext)) - { - buildState = BuildState.Skipped; - - if (buildContext.NameOfBlockingTarget == null) - { - buildContext.BuildRequest.ResultByTarget[Name] = buildState; - } - - if (!parentEngine.LoggingServices.OnlyLogCriticalEvents) - { - // Expand the expression for the Log. - string expanded = expander.ExpandAllIntoString(this.Condition, this.conditionAttribute); - // By design: Not building dependencies. This is what NAnt does too. - parentEngine.LoggingServices.LogComment(targetBuildEventContext, "TargetSkippedFalseCondition", - this.targetName, this.Condition, expanded); - } - } - else - { - // This target has not been built yet. So build it! - // Change our state to "in progress". TargetParameters will need to be re-calculated if Inputs and Outputs attribute has changed. - buildState = BuildState.InProgress; - List batchableTargetParameters = GetBatchableTargetParameters(); - executionState = new TargetExecutionWrapper(this, taskElementList, batchableTargetParameters, targetElement, expander, targetBuildEventContext); - ContinueBuild(buildContext, null); - } - } - break; - default: - error.VerifyThrow(false, "Build state {0} not handled in Target.Build method", buildState); - break; - } - } - - /// - /// This method is called repeatedly to execute the target in multi-threaded mode. In single - /// threaded mode it is called once and it loops internally until the execution is finished. - /// - /// Context within which the target is being executed - /// Result of last execution (multi-threaded only) - internal void ContinueBuild(ProjectBuildState buildContext, TaskExecutionContext taskExecutionContext) - { - executionState.ContinueBuild(buildContext, taskExecutionContext); - } - - /// - /// Executes a task within a target. This method initializes a task engine for the given task, and then executes the task - /// using the engine. - /// - /// - /// - /// true, if successful - internal bool ExecuteOneTask(XmlElement taskNode, ITaskHost hostObject) - { - string projectFileOfTaskNode = XmlUtilities.GetXmlNodeFile(taskNode, parentProject.FullFileName); - BuildEventContext targetBuildEventContext = new BuildEventContext - ( - ParentProject.ProjectBuildEventContext.NodeId, - this.id, - ParentProject.ProjectBuildEventContext.ProjectContextId, - ParentProject.ProjectBuildEventContext.TaskId - ); - int handleId = parentEngine.EngineCallback.CreateTaskContext(ParentProject, this, null, taskNode, - EngineCallback.inProcNode, targetBuildEventContext); - TaskExecutionModule taskExecutionModule = parentEngine.NodeManager.TaskExecutionModule; - TaskEngine taskEngine = new TaskEngine(taskNode, hostObject, parentProject.FullFileName, projectFileOfTaskNode, parentEngine.LoggingServices, handleId, taskExecutionModule, targetBuildEventContext); - - return taskEngine.ExecuteTask - ( - TaskExecutionMode.ExecuteTaskAndGatherOutputs, - new Lookup(parentProject.evaluatedItemsByName, parentProject.evaluatedProperties, ParentProject.ItemDefinitionLibrary) - ); - } - - /// - /// Indicates that something has changed within the <Target> element, so the project - /// needs to be saved and re-evaluated at next build. - /// - internal void MarkTargetAsDirty - ( - ) - { - - - // This is a change to the contents of the project file. - this.ParentProject?.MarkProjectAsDirty(); - - } - - /// - /// Sets or removes an attribute from the target element. Marks the target dirty after the update - /// - /// - /// - /// XmlAttribute which has been updated - internal XmlAttribute SetOrRemoveTargetAttribute - ( - string attributeName, - string attributeValue - ) - { - // If this Target object is not actually represented by a - // element in the parentProject.file, then do not allow - // the caller to set the condition. - error.VerifyThrowInvalidOperation(this.targetElement != null, "CannotSetCondition"); - - // If this item was imported from another parentProject. we don't allow modifying it. - error.VerifyThrowInvalidOperation(!this.importedFromAnotherProject, "CannotModifyImportedProjects"); - - XmlAttribute updatedAttribute = ProjectXmlUtilities.SetOrRemoveAttribute(targetElement, attributeName, attributeValue); - - // Mark the project dirty after an attribute has been updated - this.MarkTargetAsDirty(); - - return updatedAttribute; - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Adds a task with the specified name to the end of this target. This method - /// does all of the work to manipulate the project's XML content. - /// - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public BuildTask AddNewTask - ( - string taskName - ) - { - error.VerifyThrow(this.taskElementList != null, "Arraylist not initialized!"); - error.VerifyThrowArgumentLength(taskName, nameof(taskName)); - - // Confirm that it's not an imported target. - error.VerifyThrowInvalidOperation(!this.IsImported, "CannotModifyImportedProjects"); - - // Create the XML for the new task node and append it to the very end of the element. - XmlElement newTaskElement = this.targetElement.OwnerDocument.CreateElement(taskName, XMakeAttributes.defaultXmlNamespace); - this.targetElement.AppendChild(newTaskElement); - - // Create a new BuildTask object, and add it to our list. - BuildTask newTask = new BuildTask(newTaskElement, this, false); - this.taskElementList.Add(newTask); - - this.MarkTargetAsDirty(); - - return newTask; - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Removes the specified BuildTask from the target. This method correctly updates - /// the project's XML content, so the task will no longer show up when the project - /// is saved out. - /// - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public void RemoveTask - ( - BuildTask taskElement - ) - { - // Confirm that it's not an imported target. - error.VerifyThrowInvalidOperation(!this.IsImported, "CannotModifyImportedProjects"); - - error.VerifyThrow(this.taskElementList != null, "Arraylist not initialized!"); - error.VerifyThrowArgumentNull(taskElement, nameof(taskElement)); - - // Confirm that the BuildTask belongs to this Target. - error.VerifyThrowInvalidOperation(taskElement.ParentTarget == this, - "IncorrectObjectAssociation", "BuildTask", "Target"); - - // Remove the BuildTask from our list. - this.taskElementList.Remove(taskElement); - - // Remove the task's XML from the project document. - this.targetElement.RemoveChild(taskElement.TaskXmlElement); - - // Dissociate the BuildTask from this target. - taskElement.ParentTarget = null; - - this.MarkTargetAsDirty(); - } - - #endregion - } -} diff --git a/src/Deprecated/Engine/Engine/TargetCollection.cs b/src/Deprecated/Engine/Engine/TargetCollection.cs deleted file mode 100644 index f574b1f7c31..00000000000 --- a/src/Deprecated/Engine/Engine/TargetCollection.cs +++ /dev/null @@ -1,429 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Xml; -using System.Collections; - -using Microsoft.Build.BuildEngine.Shared; - -using error = Microsoft.Build.BuildEngine.Shared.ErrorUtilities; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// This class represents a collection of persisted <Target>'s. Each - /// MSBuild project has exactly one TargetCollection, which includes - /// all the imported Targets as well as the ones in the main project file. - /// - /// - /// [!WARNING] - /// > This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// rgoel - public class TargetCollection : IEnumerable, ICollection - { - #region Member Data - - // This is the hashtable of Targets (indexed by name) contained in this collection. - private Hashtable targetTable = null; - private Project parentProject = null; - - #endregion - - #region Constructors - - /// - /// Creates an instance of this class for the given project. - /// - /// RGoel - /// - internal TargetCollection - ( - Project parentProject - ) - { - error.VerifyThrow(parentProject != null, "Must pass in valid parent project object."); - this.targetTable = new Hashtable(StringComparer.OrdinalIgnoreCase); - this.parentProject = parentProject; - } - - #endregion - - #region Properties - - /// - /// Read-only accessor for parent project object. - /// - /// - /// RGoel - internal Project ParentProject - { - get - { - return this.parentProject; - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Read-only property which returns the number of Targets contained - /// in our collection. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// RGoel - public int Count - { - get - { - error.VerifyThrow(this.targetTable != null, "Hashtable not initialized!"); - - return this.targetTable.Count; - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// This ICollection property tells whether this object is thread-safe. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// RGoel - public bool IsSynchronized - { - get - { - return this.targetTable.IsSynchronized; - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// This ICollection property returns the object to be used to synchronize - /// access to the class. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// RGoel - public object SyncRoot - { - get - { - return this.targetTable.SyncRoot; - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Gets the target with the given name, case-insensitively. - /// Note that this also defines the .BuildItem() accessor automagically. - /// - /// RGoel - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// The target with the given name. - public Target this[string index] - { - get - { - error.VerifyThrow(this.targetTable != null, "Hashtable not initialized!"); - - return (Target)targetTable[index]; - } - } - - #endregion - - #region Methods - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// This ICollection method copies the contents of this collection to an - /// array. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// RGoel - public void CopyTo - ( - Array array, - int index - ) - { - error.VerifyThrow(this.targetTable != null, "Hashtable not initialized!"); - - this.targetTable.Values.CopyTo(array, index); - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// This IEnumerable method returns an IEnumerator object, which allows - /// the caller to enumerate through the Target objects contained in - /// this TargetCollection. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// RGoel - public IEnumerator GetEnumerator - ( - ) - { - error.VerifyThrow(this.targetTable != null, "Hashtable not initialized!"); - - return this.targetTable.Values.GetEnumerator(); - } - - /// - /// Adds a new Target to our collection. This method does nothing - /// to manipulate the project's XML content. - /// If a target with the same name already exists, it is replaced by - /// the new one. - /// - /// target to add - internal void AddOverrideTarget(Target newTarget) - { - error.VerifyThrow(this.targetTable != null, "Hashtable not initialized!"); - - // if a target with this name already exists, override it - // if it doesn't exist, just add it - targetTable[newTarget.Name] = newTarget; - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Adds a new <Target> element to the project file, at the very end. - /// - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// The new Target object. - public Target AddNewTarget - ( - string targetName - ) - { - error.VerifyThrow(this.parentProject != null, "Need parent project."); - - // Create the XML for the new node and append it to the very end of the main project file. - XmlElement projectElement = this.parentProject.ProjectElement; - XmlElement newTargetElement = projectElement.OwnerDocument.CreateElement(XMakeElements.target, XMakeAttributes.defaultXmlNamespace); - newTargetElement.SetAttribute(XMakeAttributes.name, targetName); - projectElement.AppendChild(newTargetElement); - - // Create a new Target object, and add it to our hash table. - Target newTarget = new Target(newTargetElement, this.parentProject, false); - this.targetTable[targetName] = newTarget; - - // The project file has been modified and needs to be saved and re-evaluated. - // Also though, adding/removing a target requires us to re-walk all the XML - // in order to re-compute out the "first logical target" as well as re-compute - // the target overriding rules. - this.parentProject.MarkProjectAsDirtyForReprocessXml(); - - return newTarget; - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Removes a target from the project, and removes the corresponding <Target> element - /// from the project's XML. - /// - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// RGoel - public void RemoveTarget - ( - Target targetToRemove - ) - { - error.VerifyThrowArgumentNull(targetToRemove, nameof(targetToRemove)); - - // Confirm that it's not an imported target. - error.VerifyThrowInvalidOperation(!targetToRemove.IsImported, - "CannotModifyImportedProjects"); - - // Confirm that the target belongs to this project. - error.VerifyThrowInvalidOperation(targetToRemove.ParentProject == this.parentProject, - "IncorrectObjectAssociation", "Target", "Project"); - - // Remove the Xml for the from the . - this.parentProject.ProjectElement.RemoveChild(targetToRemove.TargetElement); - - // Remove the target from our hashtable, if it exists. It might not exist, and that's okay. - // The reason it might not exist is because of target overriding, and the fact that - // our hashtable only stores the *last* target of a given name. - if ((Target)this.targetTable[targetToRemove.Name] == targetToRemove) - { - this.targetTable.Remove(targetToRemove.Name); - } - - // Dissociate the target from the parent project. - targetToRemove.ParentProject = null; - - // The project file has been modified and needs to be saved and re-evaluated. - // Also though, adding/removing a target requires us to re-walk all the XML - // in order to re-compute the "first logical target" as well as re-compute - // the target overriding rules. - this.parentProject.MarkProjectAsDirtyForReprocessXml(); - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Checks if a target with given name already exists - /// - /// name of the target we're looking for - /// true if the target already exists - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public bool Exists - ( - string targetName - ) - { - error.VerifyThrow(this.targetTable != null, "Hashtable not initialized!"); - return targetTable.ContainsKey(targetName); - } - - /// - /// Removes all Targets from our collection. This method does nothing - /// to manipulate the project's XML content. - /// - /// RGoel - internal void Clear - ( - ) - { - error.VerifyThrow(this.targetTable != null, "Hashtable not initialized!"); - - this.targetTable.Clear(); - } - - #endregion - } -} diff --git a/src/Deprecated/Engine/Engine/TargetDependencyAnalyzer.cs b/src/Deprecated/Engine/Engine/TargetDependencyAnalyzer.cs deleted file mode 100644 index 61b57ba2378..00000000000 --- a/src/Deprecated/Engine/Engine/TargetDependencyAnalyzer.cs +++ /dev/null @@ -1,1312 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.IO; -using System.Xml; -using System.Collections; -using System.Collections.Generic; -using System.Diagnostics; -using System.Text.RegularExpressions; -using System.Text; - -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// Enumeration of the results of target dependency analysis. - /// - /// SumedhK - internal enum DependencyAnalysisResult - { - SkipUpToDate, - SkipNoInputs, - SkipNoOutputs, - IncrementalBuild, - FullBuild - } - - /// - /// This class is used for performing dependency analysis on targets to determine if they should be built/rebuilt/skipped. - /// - /// SumedhK - internal sealed class TargetDependencyAnalyzer - { - #region Constructors - - /// - /// Creates an instance of this class for the given target. - /// - /// SumedhK - internal TargetDependencyAnalyzer(string projectDirectory, Target targetToAnalyze, EngineLoggingServices loggingServices, BuildEventContext buildEventContext) - { - ErrorUtilities.VerifyThrow(projectDirectory != null, "Need a project directory."); - ErrorUtilities.VerifyThrow(targetToAnalyze != null, "Need a target to analyze."); - ErrorUtilities.VerifyThrow(targetToAnalyze.TargetElement != null, "Need a target element."); - - this.projectDirectory = projectDirectory; - this.targetToAnalyze = targetToAnalyze; - this.targetInputsAttribute = targetToAnalyze.TargetElement.Attributes[XMakeAttributes.inputs]; - this.targetOutputsAttribute = targetToAnalyze.TargetElement.Attributes[XMakeAttributes.outputs]; - this.loggingService = loggingServices; - this.buildEventContext = buildEventContext; - } - - #endregion - - #region Properties - - /// - /// Gets the target to perform dependency analysis on. - /// - /// SumedhK - /// Target object. - internal Target TargetToAnalyze - { - get - { - return targetToAnalyze; - } - } - - /// - /// Gets the value of the target's "Inputs" attribute. - /// - /// SumedhK - /// Input specification string (can be empty). - private string TargetInputSpecification - { - get - { - if (targetInputSpecification == null) - { - targetInputSpecification = ((targetInputsAttribute != null) ? targetInputsAttribute.Value : String.Empty); - } - - return targetInputSpecification; - } - } - - /// - /// Gets the value of the target's "Outputs" attribute. - /// - /// SumedhK - /// Output specification string (can be empty). - private string TargetOutputSpecification - { - get - { - if (targetOutputSpecification == null) - { - targetOutputSpecification = ((targetOutputsAttribute != null) ? targetOutputsAttribute.Value : String.Empty); - } - - return targetOutputSpecification; - } - } - #endregion - - #region Methods - - /// - /// Compares the target's inputs against its outputs to determine if the target needs to be built/rebuilt/skipped. - /// - /// - /// The collections of changed and up-to-date inputs returned from this method are valid IFF this method decides an - /// incremental build is needed. - /// - /// SumedhK - /// - /// - /// - /// - /// DependencyAnalysisResult.SkipUpToDate, if target is up-to-date; - /// DependencyAnalysisResult.SkipNoInputs, if target has no inputs; - /// DependencyAnalysisResult.SkipNoOutputs, if target has no outputs; - /// DependencyAnalysisResult.IncrementalBuild, if only some target outputs are out-of-date; - /// DependencyAnalysisResult.FullBuild, if target is out-of-date - /// - internal DependencyAnalysisResult PerformDependencyAnalysis - ( - ItemBucket bucket, - out Hashtable changedTargetInputs, - out Hashtable upToDateTargetInputs - ) - { - // Clear any old dependency analysis logging details - dependencyAnalysisDetail.Clear(); - uniqueTargetInputs.Clear(); - uniqueTargetOutputs.Clear(); - - ProjectErrorUtilities.VerifyThrowInvalidProject((TargetOutputSpecification.Length > 0) || (TargetInputSpecification.Length == 0), - this.TargetToAnalyze.TargetElement, "TargetInputsSpecifiedWithoutOutputs", TargetToAnalyze.Name); - - DependencyAnalysisResult result = DependencyAnalysisResult.SkipUpToDate; - - changedTargetInputs = null; - upToDateTargetInputs = null; - - if (TargetOutputSpecification.Length == 0) - { - // if the target has no output specification, we always build it - result = DependencyAnalysisResult.FullBuild; - } - else - { - Hashtable itemVectorsInTargetInputs; - Hashtable itemVectorTransformsInTargetInputs; - Hashtable discreteItemsInTargetInputs; - - Hashtable itemVectorsInTargetOutputs; - Hashtable discreteItemsInTargetOutputs; - ArrayList targetOutputItemSpecs; - - ParseTargetInputOutputSpecifications(bucket, - out itemVectorsInTargetInputs, - out itemVectorTransformsInTargetInputs, - out discreteItemsInTargetInputs, - out itemVectorsInTargetOutputs, - out discreteItemsInTargetOutputs, - out targetOutputItemSpecs); - - ArrayList itemVectorsReferencedInBothTargetInputsAndOutputs; - ArrayList itemVectorsReferencedOnlyInTargetInputs; - ArrayList itemVectorsReferencedOnlyInTargetOutputs = null; - - // if the target has no outputs because the output specification evaluated to empty - if (targetOutputItemSpecs.Count == 0) - { - result = PerformDependencyAnalysisIfNoOutputs(); - } - // if there are no discrete output items... - else if (discreteItemsInTargetOutputs.Count == 0) - { - // try to correlate inputs and outputs by checking: - // 1) which item vectors are referenced by both input and output items - // 2) which item vectors are referenced only by input items - // 3) which item vectors are referenced only by output items - // NOTE: two item vector transforms cannot be correlated, even if they reference the same item vector, because - // depending on the transform expression, there might be no relation between the results of the transforms; as - // a result, input items that are item vector transforms are treated as discrete items - DiffHashtables(itemVectorsInTargetInputs, itemVectorsInTargetOutputs, - out itemVectorsReferencedInBothTargetInputsAndOutputs, - out itemVectorsReferencedOnlyInTargetInputs, - out itemVectorsReferencedOnlyInTargetOutputs); - - // if there are no item vectors only referenced by output items... - // NOTE: we consider output items that reference item vectors not referenced by any input item, as discrete - // items, since we cannot correlate them to any input items - if (itemVectorsReferencedOnlyInTargetOutputs.Count == 0) - { - /* - * At this point, we know the following: - * 1) the target has outputs - * 2) the target has NO discrete outputs - * - * This implies: - * 1) the target only references vectors (incl. transforms) in its outputs - * 2) all vectors referenced in the outputs are also referenced in the inputs - * 3) the referenced vectors are not empty - * - * We can thus conclude: the target MUST have (non-discrete) inputs - * - */ - ErrorUtilities.VerifyThrow(itemVectorsReferencedInBothTargetInputsAndOutputs.Count > 0, "The target must have inputs."); - Debug.Assert(GetItemSpecsFromItemVectors(itemVectorsInTargetInputs).Count > 0, "The target must have inputs."); - - result = PerformDependencyAnalysisIfDiscreteInputs(itemVectorsInTargetInputs, - itemVectorTransformsInTargetInputs, discreteItemsInTargetInputs, itemVectorsReferencedOnlyInTargetInputs, - targetOutputItemSpecs); - - if (result != DependencyAnalysisResult.FullBuild) - { - // once the inputs and outputs have been correlated, we can do a 1-to-1 comparison between each input - // and its corresponding output, to discover which inputs have changed, and which are up-to-date... - result = PerformDependencyAnalysisIfCorrelatedInputsOutputs(itemVectorsInTargetInputs, itemVectorsInTargetOutputs, - itemVectorsReferencedInBothTargetInputsAndOutputs, - out changedTargetInputs, out upToDateTargetInputs); - } - } - } - - // if there are any discrete items in the target outputs, then we have no obvious correlation to the inputs they - // depend on, since any input can contribute to a discrete output, so we compare all inputs against all outputs - // NOTE: output items are considered discrete, if - // 1) they do not reference any item vector - // 2) they reference item vectors that are not referenced by any input item - if ((discreteItemsInTargetOutputs.Count > 0) || - ((itemVectorsReferencedOnlyInTargetOutputs?.Count > 0))) - { - result = PerformDependencyAnalysisIfDiscreteOutputs( - itemVectorsInTargetInputs, itemVectorTransformsInTargetInputs, discreteItemsInTargetInputs, - targetOutputItemSpecs); - } - - if (result == DependencyAnalysisResult.SkipUpToDate) - { - loggingService.LogComment(buildEventContext, MessageImportance.Normal, - "SkipTargetBecauseOutputsUpToDate", - TargetToAnalyze.Name); - - // Log the target inputs & outputs - if (!loggingService.OnlyLogCriticalEvents) - { - string inputs; - string outputs; - // Extract the unique inputs and outputs gatheres during TLDA - ExtractUniqueInputsAndOutputs(out inputs, out outputs); - - if (inputs != null) - { - loggingService.LogComment(buildEventContext, MessageImportance.Low, "SkipTargetUpToDateInputs", inputs); - } - - if (outputs != null) - { - loggingService.LogComment(buildEventContext, MessageImportance.Low, "SkipTargetUpToDateOutputs", outputs); - } - } - } - } - - LogReasonForBuildingTarget(result); - - return result; - } - - /// - /// Does appropriate logging to indicate why this target is being built fully or partially. - /// - /// - private void LogReasonForBuildingTarget(DependencyAnalysisResult result) - { - // Only if we are not logging just critical events should we be logging the details - if (!loggingService.OnlyLogCriticalEvents) - { - if (result == DependencyAnalysisResult.FullBuild && this.dependencyAnalysisDetail.Count > 0) - { - // For the full build decision the are three possible outcomes - loggingService.LogComment(buildEventContext, "BuildTargetCompletely", this.targetToAnalyze.Name); - - foreach (DependencyAnalysisLogDetail logDetail in this.dependencyAnalysisDetail) - { - string reason = GetFullBuildReason(logDetail); - loggingService.LogCommentFromText(buildEventContext, MessageImportance.Low, reason); - } - } - else if (result == DependencyAnalysisResult.IncrementalBuild) - { - // For the partial build decision the are three possible outcomes - loggingService.LogComment(buildEventContext, MessageImportance.Normal, "BuildTargetPartially", this.targetToAnalyze.Name); - foreach (DependencyAnalysisLogDetail logDetail in this.dependencyAnalysisDetail) - { - string reason = GetIncrementalBuildReason(logDetail); - loggingService.LogCommentFromText(buildEventContext, MessageImportance.Low, reason); - } - } - } - } - - /// - /// Returns a string indicating why a full build is occurring. - /// - internal static string GetFullBuildReason(DependencyAnalysisLogDetail logDetail) - { - string reason = null; - - if (logDetail.Reason == OutofdateReason.NewerInput) - { - // One of the inputs was newer than all of the outputs - reason = ResourceUtilities.FormatResourceString("BuildTargetCompletelyInputNewer", logDetail.Input, logDetail.Output); - } - else if (logDetail.Reason == OutofdateReason.MissingOutput) - { - // One of the outputs was missing - reason = ResourceUtilities.FormatResourceString("BuildTargetCompletelyOutputDoesntExist", logDetail.Output); - } - else if (logDetail.Reason == OutofdateReason.MissingInput) - { - // One of the inputs was missing - reason = ResourceUtilities.FormatResourceString("BuildTargetCompletelyInputDoesntExist", logDetail.Input); - } - - return reason; - } - - /// - /// Returns a string indicating why an incremental build is occurring. - /// - private static string GetIncrementalBuildReason(DependencyAnalysisLogDetail logDetail) - { - string reason = null; - - if (logDetail.Reason == OutofdateReason.NewerInput) - { - // One of the inputs was newer than its corresponding output - reason = ResourceUtilities.FormatResourceString("BuildTargetPartiallyInputNewer", logDetail.InputItemName, logDetail.Input, logDetail.Output); - } - else if (logDetail.Reason == OutofdateReason.MissingOutput) - { - // One of the outputs was missing - reason = ResourceUtilities.FormatResourceString("BuildTargetPartiallyOutputDoesntExist", logDetail.OutputItemName, logDetail.Input, logDetail.Output); - } - else if (logDetail.Reason == OutofdateReason.MissingInput) - { - // One of the inputs was missing - reason = ResourceUtilities.FormatResourceString("BuildTargetPartiallyInputDoesntExist", logDetail.InputItemName, logDetail.Input, logDetail.Output); - } - - return reason; - } - - /// - /// Extract only the unique inputs and outputs from all the inputs and outputs gathered - /// during depedency analysis - /// - /// [out] the unique inputs - /// [out] the unique outputs - private void ExtractUniqueInputsAndOutputs(out string inputs, out string outputs) - { - if (this.uniqueTargetInputs.Count > 0) - { - StringBuilder inputsBuilder = new StringBuilder(); - // Each of our inputs needs to be added to the string - foreach (string input in this.uniqueTargetInputs.Keys) - { - inputsBuilder.Append(input); - inputsBuilder.Append(";"); - } - // We don't want the trailing ; so remove it - inputs = inputsBuilder.ToString(0, inputsBuilder.Length - 1); - } - else - { - inputs = String.Empty; - } - - if (this.uniqueTargetOutputs.Count > 0) - { - StringBuilder outputsBuilder = new StringBuilder(); - // Each of our outputs needs to be added to the string - foreach (string output in this.uniqueTargetOutputs.Keys) - { - outputsBuilder.Append(output); - outputsBuilder.Append(";"); - } - // We don't want the trailing ; so remove it - outputs = outputsBuilder.ToString(0, outputsBuilder.Length - 1); - } - else - { - outputs = String.Empty; - } - } - - /// - /// Parses the target's "Inputs" and "Outputs" attributes and gathers up referenced items. - /// - /// - /// - /// - /// - /// - /// - /// - /// SumedhK - private void ParseTargetInputOutputSpecifications - ( - ItemBucket bucket, - out Hashtable itemVectorsInTargetInputs, - out Hashtable itemVectorTransformsInTargetInputs, - out Hashtable discreteItemsInTargetInputs, - out Hashtable itemVectorsInTargetOutputs, - out Hashtable discreteItemsInTargetOutputs, - out ArrayList targetOutputItemSpecs - ) - { - // break down the input/output specifications along the standard separator, after expanding all embedded properties - // and item metadata - Expander propertyAndMetadataExpander = new Expander(bucket.Expander, ExpanderOptions.ExpandPropertiesAndMetadata); - List targetInputs = propertyAndMetadataExpander.ExpandAllIntoStringListLeaveEscaped(TargetInputSpecification, this.targetInputsAttribute); - List targetOutputs = propertyAndMetadataExpander.ExpandAllIntoStringListLeaveEscaped(TargetOutputSpecification, this.targetOutputsAttribute); - - itemVectorTransformsInTargetInputs = new Hashtable(StringComparer.OrdinalIgnoreCase); - - // figure out which of the inputs are: - // 1) item vectors - // 2) item vectors with transforms - // 3) "discrete" items i.e. items that do not reference item vectors - SeparateItemVectorsFromDiscreteItems(this.targetInputsAttribute, targetInputs, bucket, - out itemVectorsInTargetInputs, - itemVectorTransformsInTargetInputs, - out discreteItemsInTargetInputs); - - // figure out which of the outputs are: - // 1) item vectors (with or without transforms) - // 2) "discrete" items i.e. items that do not reference item vectors - SeparateItemVectorsFromDiscreteItems(this.targetOutputsAttribute, targetOutputs, bucket, - out itemVectorsInTargetOutputs, - null /* don't want transforms separated */, - out discreteItemsInTargetOutputs); - - // list out all the output item-specs - targetOutputItemSpecs = GetItemSpecsFromItemVectors(itemVectorsInTargetOutputs); - targetOutputItemSpecs.AddRange(discreteItemsInTargetOutputs.Values); - } - - /// - /// Determines if the target needs to be built/rebuilt/skipped if it has no outputs (because they evaluated to empty). - /// - /// SumedhK - /// Indication of how to build the target. - private DependencyAnalysisResult PerformDependencyAnalysisIfNoOutputs() - { - DependencyAnalysisResult result = DependencyAnalysisResult.SkipNoOutputs; - - // If the target has no inputs declared and the outputs evaluated to empty, do a full build. Remember that somebody - // may specify Outputs="@(blah)", where the item list "blah" is actually produced by some task within this target. So - // at the beginning, when we're trying to do to the dependency analysis, there's nothing in the "blah" list, but after - // the target executes, there will be. - if (TargetInputSpecification.Length == 0) - { - result = DependencyAnalysisResult.FullBuild; - } - // otherwise, don't build the target - else - { - loggingService.LogComment(buildEventContext, MessageImportance.Normal, - "SkipTargetBecauseNoOutputs", TargetToAnalyze.Name); - // detailed reason is low importance to keep log clean - loggingService.LogComment(buildEventContext, MessageImportance.Low, - "SkipTargetBecauseNoOutputsDetail"); - } - - return result; - } - - /// - /// Determines if the target needs to be built/rebuilt/skipped if it has discrete inputs. - /// - /// SumedhK - /// - /// - /// - /// - /// - /// Indication of how to build the target. - private DependencyAnalysisResult PerformDependencyAnalysisIfDiscreteInputs - ( - Hashtable itemVectorsInTargetInputs, - Hashtable itemVectorTransformsInTargetInputs, - Hashtable discreteItemsInTargetInputs, - ArrayList itemVectorsReferencedOnlyInTargetInputs, - ArrayList targetOutputItemSpecs - ) - { - DependencyAnalysisResult result = DependencyAnalysisResult.SkipUpToDate; - - // list out all the discrete input item-specs... - // NOTE: we treat input items that are item vector transforms, as discrete items, since we cannot correlate them to - // any output item - ArrayList discreteTargetInputItemSpecs = GetItemSpecsFromItemVectors(itemVectorTransformsInTargetInputs); - discreteTargetInputItemSpecs.AddRange(discreteItemsInTargetInputs.Values); - - // we treat input items that reference item vectors not referenced by any output item, as discrete items, since we - // cannot correlate them to any output item - foreach (string itemVectorType in itemVectorsReferencedOnlyInTargetInputs) - { - discreteTargetInputItemSpecs.AddRange(GetItemSpecsFromItemVectors(itemVectorsInTargetInputs, itemVectorType)); - } - - // if there are any discrete input items, we can treat them as "meta" inputs, because: - // 1) we have already confirmed there are no discrete output items - // 2) apart from the discrete input items, we can correlate all input items to all output items, since we know they - // both reference the same item vectors - // NOTES: - // 1) a typical example of a "meta" input is when the project file itself is listed as an input -- this forces - // rebuilds when the project file changes, even if no actual inputs have changed - // 2) discrete input items and discrete output items are not treated symmetrically, because it is more likely that - // an uncorrelated input is a "meta" input, than an uncorrelated output is a "meta" output, since outputs can - // typically be built out of more than one set of inputs - if (discreteTargetInputItemSpecs.Count > 0) - { - // if any output item is out-of-date w.r.t. any discrete input item, do a full build - DependencyAnalysisLogDetail dependencyAnalysisDetailEntry; - bool someOutOfDate = IsAnyOutOfDate(out dependencyAnalysisDetailEntry, projectDirectory, discreteTargetInputItemSpecs, targetOutputItemSpecs); - - if (someOutOfDate) - { - dependencyAnalysisDetail.Add(dependencyAnalysisDetailEntry); - result = DependencyAnalysisResult.FullBuild; - } - else - { - RecordUniqueInputsAndOutputs(discreteTargetInputItemSpecs, targetOutputItemSpecs); - } - } - - return result; - } - - /// - /// Determines if the target needs to be built/rebuilt/skipped if its inputs and outputs can be correlated. - /// - /// SumedhK - /// - /// - /// - /// - /// - /// Indication of how to build the target. - private DependencyAnalysisResult PerformDependencyAnalysisIfCorrelatedInputsOutputs - ( - Hashtable itemVectorsInTargetInputs, - Hashtable itemVectorsInTargetOutputs, - ArrayList itemVectorsReferencedInBothTargetInputsAndOutputs, - out Hashtable changedTargetInputs, - out Hashtable upToDateTargetInputs - ) - { - DependencyAnalysisResult result = DependencyAnalysisResult.SkipUpToDate; - - changedTargetInputs = new Hashtable(StringComparer.OrdinalIgnoreCase); - upToDateTargetInputs = new Hashtable(StringComparer.OrdinalIgnoreCase); - - // indicates if an incremental build is really just a full build, because all input items have changed - int numberOfInputItemVectorsWithAllChangedItems = 0; - - foreach (string itemVectorType in itemVectorsReferencedInBothTargetInputsAndOutputs) - { - Hashtable inputItemVectors = (Hashtable)itemVectorsInTargetInputs[itemVectorType]; - Hashtable outputItemVectors = (Hashtable)itemVectorsInTargetOutputs[itemVectorType]; - - // NOTE: recall that transforms have been separated out already - ErrorUtilities.VerifyThrow(inputItemVectors.Count == 1, - "There should only be one item vector of a particular type in the target inputs that can be filtered."); - - // NOTE: this loop only makes one iteration - foreach (BuildItemGroup inputItems in inputItemVectors.Values) - { - if (inputItems.Count > 0) - { - BuildItemGroup changedInputItems = new BuildItemGroup(); - BuildItemGroup upToDateInputItems = new BuildItemGroup(); - - BuildItem[] inputItemsAssumedToBeUpToDate = inputItems.ToArray(); - - foreach (DictionaryEntry outputEntry in outputItemVectors) - { - BuildItemGroup outputItems = (BuildItemGroup)outputEntry.Value; - // Get the metadata name so if it is missing we can print out a nice error message. - string outputItemExpression = (string)outputEntry.Key; - - ErrorUtilities.VerifyThrow(inputItems.Count == outputItems.Count, - "An item vector of a particular type must always contain the same number of items."); - - for (int i = 0; i < inputItemsAssumedToBeUpToDate.Length; i++) - { - // if we haven't already determined that this input item has changed - if (inputItemsAssumedToBeUpToDate[i] != null) - { - // Check to see if the outputItem specification is null or empty, if that is the case we need to error out saying that some metadata - // on one of the items used in the target output is missing. - bool outputEscapedValueIsNullOrEmpty = String.IsNullOrEmpty(outputItems[i].FinalItemSpecEscaped); - ProjectErrorUtilities.VerifyThrowInvalidProject(!outputEscapedValueIsNullOrEmpty, - this.TargetToAnalyze.TargetElement, - "TargetOutputsSpecifiedAreMissing", - inputItemsAssumedToBeUpToDate[i].FinalItemSpecEscaped, - outputItems[i].Name, - outputItemExpression, - TargetToAnalyze.Name); - - // check if it has changed - bool outOfDate = IsOutOfDate(inputItemsAssumedToBeUpToDate[i].FinalItemSpecEscaped, outputItems[i].FinalItemSpecEscaped, inputItemsAssumedToBeUpToDate[i].Name, outputItems[i].Name); - if (outOfDate) - { - changedInputItems.AddItem(inputItemsAssumedToBeUpToDate[i]); - inputItemsAssumedToBeUpToDate[i] = null; - - result = DependencyAnalysisResult.IncrementalBuild; - } - } - } - - if (changedInputItems.Count == inputItems.Count) - { - numberOfInputItemVectorsWithAllChangedItems++; - break; - } - } - - if (changedInputItems.Count < inputItems.Count) - { - foreach (BuildItem item in inputItemsAssumedToBeUpToDate) - { - if (item != null) - { - upToDateInputItems.AddItem(item); - } - } - } - - changedTargetInputs[itemVectorType] = changedInputItems; - upToDateTargetInputs[itemVectorType] = upToDateInputItems; - } - } - } - - ErrorUtilities.VerifyThrow(numberOfInputItemVectorsWithAllChangedItems <= itemVectorsReferencedInBothTargetInputsAndOutputs.Count, - "The number of vectors containing all changed items cannot exceed the number of correlated vectors."); - - // if all correlated input items have changed - if (numberOfInputItemVectorsWithAllChangedItems == itemVectorsReferencedInBothTargetInputsAndOutputs.Count) - { - ErrorUtilities.VerifyThrow(result == DependencyAnalysisResult.IncrementalBuild, - "If inputs have changed, this must be an incremental build."); - - // then the incremental build is really a full build - result = DependencyAnalysisResult.FullBuild; - } - - return result; - } - - /// - /// Determines if the target needs to be built/rebuilt/skipped if it has discrete outputs. - /// - /// SumedhK - /// - /// - /// - /// - /// Indication of how to build the target. - private DependencyAnalysisResult PerformDependencyAnalysisIfDiscreteOutputs - ( - Hashtable itemVectorsInTargetInputs, - Hashtable itemVectorTransformsInTargetInputs, - Hashtable discreteItemsInTargetInputs, - ArrayList targetOutputItemSpecs - ) - { - DependencyAnalysisResult result = DependencyAnalysisResult.SkipUpToDate; - - ArrayList targetInputItemSpecs = GetItemSpecsFromItemVectors(itemVectorsInTargetInputs); - targetInputItemSpecs.AddRange(GetItemSpecsFromItemVectors(itemVectorTransformsInTargetInputs)); - targetInputItemSpecs.AddRange(discreteItemsInTargetInputs.Values); - - // if the target has no inputs specified... - if (targetInputItemSpecs.Count == 0) - { - // if the target did declare inputs, but the specification evaluated to nothing - if (TargetInputSpecification.Length > 0) - { - loggingService.LogComment(buildEventContext, MessageImportance.Normal, - "SkipTargetBecauseNoInputs", TargetToAnalyze.Name); - // detailed reason is low importance to keep log clean - loggingService.LogComment(buildEventContext, MessageImportance.Low, - "SkipTargetBecauseNoInputsDetail"); - - // don't build the target - result = DependencyAnalysisResult.SkipNoInputs; - } - else - { - // There were no inputs specified, so build completely - loggingService.LogComment(buildEventContext, "BuildTargetCompletely", this.targetToAnalyze.Name); - loggingService.LogComment(buildEventContext, "BuildTargetCompletelyNoInputsSpecified"); - - // otherwise, do a full build - result = DependencyAnalysisResult.FullBuild; - } - } - // if any input is newer than any output, do a full build - else - { - DependencyAnalysisLogDetail dependencyAnalysisDetailEntry; - bool someOutOfDate = IsAnyOutOfDate(out dependencyAnalysisDetailEntry, projectDirectory, targetInputItemSpecs, targetOutputItemSpecs); - - if (someOutOfDate) - { - dependencyAnalysisDetail.Add(dependencyAnalysisDetailEntry); - result = DependencyAnalysisResult.FullBuild; - } - else - { - RecordUniqueInputsAndOutputs(targetInputItemSpecs, targetOutputItemSpecs); - } - } - - return result; - } - - /// - /// Separates item vectors from discrete items, and discards duplicates. If requested, item vector transforms are also - /// separated out. The item vectors (and the transforms) are partitioned by type, since there can be more than one item - /// vector of the same type. - /// - /// - /// The item vector collection is a Hashtable of Hashtables, where the top-level Hashtable is indexed by item type, and - /// each "partition" Hashtable is indexed by the item vector itself. - /// - /// SumedhK - /// The XML attribute which we're operating on here. - /// The sole purpose of passing in this parameter is to be able to provide line/column number - /// information in the event there's an error. - /// - /// - /// - /// - /// - private void SeparateItemVectorsFromDiscreteItems - ( - XmlAttribute attributeContainingItems, - List items, - ItemBucket bucket, - out Hashtable itemVectors, - Hashtable itemVectorTransforms, - out Hashtable discreteItems - ) - { - itemVectors = new Hashtable(StringComparer.OrdinalIgnoreCase); - discreteItems = new Hashtable(StringComparer.OrdinalIgnoreCase); - - foreach (string item in items) - { - Match itemVectorMatch; - BuildItemGroup itemVectorContents = bucket.Expander.ExpandSingleItemListExpressionIntoItemsLeaveEscaped(item, attributeContainingItems, out itemVectorMatch); - if (itemVectorContents != null) - { - Hashtable itemVectorCollection; - if ((itemVectorTransforms == null) || - (itemVectorMatch.Groups["TRANSFORM_SPECIFICATION"].Length == 0)) - { - itemVectorCollection = itemVectors; - } - else - { - itemVectorCollection = itemVectorTransforms; - } - - string itemVectorType = itemVectorMatch.Groups["TYPE"].Value; - Hashtable itemVectorCollectionPartition = (Hashtable)itemVectorCollection[itemVectorType]; - - if (itemVectorCollectionPartition == null) - { - itemVectorCollectionPartition = new Hashtable(StringComparer.OrdinalIgnoreCase); - itemVectorCollection[itemVectorType] = itemVectorCollectionPartition; - } - - itemVectorCollectionPartition[item] = itemVectorContents; - - ErrorUtilities.VerifyThrow((itemVectorTransforms == null) || (itemVectorCollection.Equals(itemVectorTransforms)) || (itemVectorCollectionPartition.Count == 1), - "If transforms have been separated out, there should only be one item vector per partition."); - } - else - { - discreteItems[item] = item; - } - } - } - - /// - /// Retrieves the item-specs of all items in the given item vector collection. - /// - /// SumedhK - /// - /// list of item-specs - private static ArrayList GetItemSpecsFromItemVectors(Hashtable itemVectors) - { - ArrayList itemSpecs = new ArrayList(); - - foreach (string itemType in itemVectors.Keys) - { - itemSpecs.AddRange(GetItemSpecsFromItemVectors(itemVectors, itemType)); - } - - return itemSpecs; - } - - /// - /// Retrieves the item-specs of all items of the specified type in the given item vector collection. - /// - /// SumedhK - /// - /// - /// list of item-specs - private static ArrayList GetItemSpecsFromItemVectors(Hashtable itemVectors, string itemType) - { - ArrayList itemSpecs = new ArrayList(); - - Hashtable itemVectorPartition = (Hashtable)itemVectors[itemType]; - - if (itemVectorPartition != null) - { - foreach (BuildItemGroup items in itemVectorPartition.Values) - { - foreach (BuildItem item in items) - { - // The FinalItemSpec can be empty-string in the case of an item transform. See bug - // VSWhidbey 523719. - if (item.FinalItemSpecEscaped.Length > 0) - { - itemSpecs.Add(item.FinalItemSpecEscaped); - } - } - } - } - - return itemSpecs; - } - - /// - /// Finds the differences in the keys between the two given hashtables. - /// - /// SumedhK - /// - /// - /// - /// - /// - private static void DiffHashtables(Hashtable h1, Hashtable h2, out ArrayList commonKeys, out ArrayList uniqueKeysInH1, out ArrayList uniqueKeysInH2) - { - commonKeys = new ArrayList(); - uniqueKeysInH1 = new ArrayList(); - uniqueKeysInH2 = new ArrayList(); - - foreach (object h1Key in h1.Keys) - { - if (h2[h1Key] != null) - { - commonKeys.Add(h1Key); - } - else - { - uniqueKeysInH1.Add(h1Key); - } - } - - foreach (object h2Key in h2.Keys) - { - if (h1[h2Key] == null) - { - uniqueKeysInH2.Add(h2Key); - } - } - } - - /// - /// Compares the set of files/directories designated as "inputs" against the set of files/directories designated as - /// "outputs", and indicates if any "output" file/directory is out-of-date w.r.t. any "input" file/directory. - /// - /// - /// NOTE: Internal for unit test purposes only. - /// - /// danmose - /// - /// - /// true, if any "input" is newer than any "output", or if any input or output does not exist. - internal static bool IsAnyOutOfDate(out DependencyAnalysisLogDetail dependencyAnalysisDetailEntry, string projectDirectory, IList inputs, IList outputs) - { - ErrorUtilities.VerifyThrow((inputs.Count > 0) && (outputs.Count > 0), "Need to specify inputs and outputs."); - - // Algorithm: walk through all the outputs to find the oldest output - // walk through the inputs as far as we need to until we find one that's newer (if any) - - // PERF -- we could change this to ensure that we walk the shortest list first (because we walk that one entirely): - // possibly the outputs list isn't actually the shortest list. However it always is the shortest - // in the cases I've seen, and adding this optimization would make the code hard to read. - - string oldestOutput = EscapingUtilities.UnescapeAll((string)outputs[0]); - - FileInfo oldestOutputInfo; - try - { - string oldestOutputFullPath = Path.Combine(projectDirectory, oldestOutput); - oldestOutputInfo = FileUtilities.GetFileInfoNoThrow(oldestOutputFullPath); - } - catch (Exception e) - { - if (ExceptionHandling.NotExpectedException(e)) - { - throw; - } - // Output does not exist - oldestOutputInfo = null; - } - - if (oldestOutputInfo == null) - { - // First output is missing: we must build the target - string arbitraryInput = EscapingUtilities.UnescapeAll((string)inputs[0]); - dependencyAnalysisDetailEntry = new DependencyAnalysisLogDetail(arbitraryInput, oldestOutput, null, null, OutofdateReason.MissingOutput); - return true; - } - - for (int i = 1; i < outputs.Count; i++) - { - string candidateOutput = EscapingUtilities.UnescapeAll((string)outputs[i]); - - FileInfo candidateOutputInfo; - try - { - string candidateOutputFullPath = Path.Combine(projectDirectory, candidateOutput); - candidateOutputInfo = FileUtilities.GetFileInfoNoThrow(candidateOutputFullPath); - } - catch (Exception e) - { - if (ExceptionHandling.NotExpectedException(e)) - { - throw; - } - // Output does not exist - candidateOutputInfo = null; - } - - if (candidateOutputInfo == null) - { - // An output is missing: we must build the target - string arbitraryInput = EscapingUtilities.UnescapeAll((string)inputs[0]); - dependencyAnalysisDetailEntry = new DependencyAnalysisLogDetail(arbitraryInput, candidateOutput, null, null, OutofdateReason.MissingOutput); - return true; - } - - if (oldestOutputInfo.LastWriteTime > candidateOutputInfo.LastWriteTime) - { - // This output is older than the previous record holder - oldestOutputInfo = candidateOutputInfo; - oldestOutput = candidateOutput; - } - } - - // Now compare the oldest output with each input and break out if we find one newer. - foreach (string input in inputs) - { - string unescapedInput = EscapingUtilities.UnescapeAll(input); - - FileInfo inputInfo = null; - try - { - string unescapedInputFullPath = Path.Combine(projectDirectory, unescapedInput); - inputInfo = FileUtilities.GetFileInfoNoThrow(unescapedInputFullPath); - } - catch (Exception e) - { - if (ExceptionHandling.NotExpectedException(e)) - { - throw; - } - // Output does not exist - inputInfo = null; - } - - if (inputInfo == null) - { - // An input is missing: we must build the target - dependencyAnalysisDetailEntry = new DependencyAnalysisLogDetail(unescapedInput, oldestOutput, null, null, OutofdateReason.MissingInput); - return true; - } - else - { - if (inputInfo.LastWriteTime > oldestOutputInfo.LastWriteTime) - { - // This input is newer than the oldest output: we must build the target - dependencyAnalysisDetailEntry = new DependencyAnalysisLogDetail(unescapedInput, oldestOutput, null, null, OutofdateReason.NewerInput); - return true; - } - } - } - - // All exist and no inputs are newer than any outputs; up to date - dependencyAnalysisDetailEntry = null; - return false; - } - - /// - /// Record the unique input and output files so that the "up to date" message - /// can list them in the log later. - /// - private void RecordUniqueInputsAndOutputs(ArrayList inputs, ArrayList outputs) - { - // Only if we are not logging just critical events should we be gathering full details - if (!loggingService.OnlyLogCriticalEvents) - { - foreach (string input in inputs) - { - if (!this.uniqueTargetInputs.ContainsKey(input)) - { - this.uniqueTargetInputs.Add(input, null); - } - } - foreach (string output in outputs) - { - if (!this.uniqueTargetOutputs.ContainsKey(output)) - { - this.uniqueTargetOutputs.Add(output, null); - } - } - } - } - - /// - /// Compares the file/directory designated as "input" against the file/directory designated as "output", and indicates if - /// the "output" file/directory is out-of-date w.r.t. the "input" file/directory. - /// - /// - /// If the "input" does not exist on disk, we treat its disappearance as a change, and consider the "input" to be newer - /// than the "output", regardless of whether the "output" itself exists. - /// - /// SumedhK - /// - /// - /// - /// - /// true, if "input" is newer than "output" - private bool IsOutOfDate(string input, string output, string inputItemName, string outputItemName) - { - bool inputDoesNotExist; - bool outputDoesNotExist; - input = EscapingUtilities.UnescapeAll(input); - output = EscapingUtilities.UnescapeAll(output); - bool outOfDate = (CompareLastWriteTimes(input, output, out inputDoesNotExist, out outputDoesNotExist) == 1) || inputDoesNotExist; - - // Only if we are not logging just critical events should we be gathering full details - if (!loggingService.OnlyLogCriticalEvents) - { - // Make a not of unique inputs - if (!this.uniqueTargetInputs.ContainsKey(input)) - { - this.uniqueTargetInputs.Add(input, null); - } - - // Make a note of unique outputs - if (!this.uniqueTargetOutputs.ContainsKey(output)) - { - this.uniqueTargetOutputs.Add(output, null); - } - } - - RecordComparisonResults(input, output, inputItemName, outputItemName, inputDoesNotExist, outputDoesNotExist, outOfDate); - - return outOfDate; - } - - /// - /// Add timestamp comparison results to a list, to log them together later. - /// - private void RecordComparisonResults(string input, string output, string inputItemName, string outputItemName, bool inputDoesNotExist, bool outputDoesNotExist, bool outOfDate) - { - // Only if we are not logging just critical events should we be gathering full details - if (!loggingService.OnlyLogCriticalEvents) - { - // Record the details of the out-of-date decision - if (inputDoesNotExist) - { - this.dependencyAnalysisDetail.Add(new DependencyAnalysisLogDetail(input, output, inputItemName, outputItemName, OutofdateReason.MissingInput)); - } - else if (outputDoesNotExist) - { - this.dependencyAnalysisDetail.Add(new DependencyAnalysisLogDetail(input, output, inputItemName, outputItemName, OutofdateReason.MissingOutput)); - } - else if (outOfDate) - { - this.dependencyAnalysisDetail.Add(new DependencyAnalysisLogDetail(input, output, inputItemName, outputItemName, OutofdateReason.NewerInput)); - } - } - } - - /// - /// Compares the last-write times of the given files/directories. - /// - /// - /// Existing files/directories are always considered newer than non-existent ones, and two non-existent files/directories - /// are considered to have the same last-write time. - /// - /// SumedhK - /// - /// - /// [out] indicates if the first file/directory does not exist on disk - /// [out] indicates if the second file/directory does not exist on disk - /// - /// -1 if the first file/directory is older than the second; - /// 0 if the files/directories were both last written to at the same time; - /// +1 if the first file/directory is newer than the second - /// - private int CompareLastWriteTimes(string path1, string path2, out bool path1DoesNotExist, out bool path2DoesNotExist) - { - ErrorUtilities.VerifyThrow(!string.IsNullOrEmpty(path1) && !string.IsNullOrEmpty(path2), - "Need to specify paths to compare."); - - FileInfo path1Info; - try - { - path1 = Path.Combine(projectDirectory, path1); - path1Info = FileUtilities.GetFileInfoNoThrow(path1); - } - catch (Exception e) - { - if (ExceptionHandling.NotExpectedException(e)) - { - throw; - } - path1Info = null; - } - - FileInfo path2Info; - try - { - path2 = Path.Combine(projectDirectory, path2); - path2Info = FileUtilities.GetFileInfoNoThrow(path2); - } - catch (Exception e) - { - if (ExceptionHandling.NotExpectedException(e)) - { - throw; - } - path2Info = null; - } - - path1DoesNotExist = (path1Info == null); - path2DoesNotExist = (path2Info == null); - - if (path1DoesNotExist) - { - if (path2DoesNotExist) - { - // Neither exist - return 0; - } - else - { - // Only path 2 exists - return -1; - } - } - else if (path2DoesNotExist) - { - // Only path 1 exists - return +1; - } - - // Both exist - return DateTime.Compare(path1Info.LastWriteTime, path2Info.LastWriteTime); - } - - #endregion - - // the project directory, all relative paths are - // relative to here - private string projectDirectory; - // the target to analyze - private Target targetToAnalyze; - - // the value of the target's "Inputs" attribute - private string targetInputSpecification; - // the value of the target's "Outputs" attribute - private string targetOutputSpecification; - // The XmlAttribute for the "Inputs" - private XmlAttribute targetInputsAttribute; - // The XmlAttribute for the "Outputs" - private XmlAttribute targetOutputsAttribute; - - // Details of the dependency analysis for logging - private ArrayList dependencyAnalysisDetail = new ArrayList(); - - // The unique target inputs - private Hashtable uniqueTargetInputs = new Hashtable(StringComparer.OrdinalIgnoreCase); - - // The unique target outputs; - private Hashtable uniqueTargetOutputs = new Hashtable(StringComparer.OrdinalIgnoreCase); - - // Engine logging service which to log message to - private EngineLoggingServices loggingService; - - // Event context information where event is raised from - private BuildEventContext buildEventContext; - } - - /// - /// Why TLDA decided this entry was out of date - /// - internal enum OutofdateReason - { - MissingInput, // The input file was missing - MissingOutput, // The output file was missing - NewerInput // The input file was newer - } - - /// - /// A logging detail entry. Describes what TLDA decided about inputs / outputs - /// - internal class DependencyAnalysisLogDetail - { - private OutofdateReason reason; - private string inputItemName; - private string outputItemName; - private string input; - private string output; - - /// - /// The reason that we are logging this entry - /// - internal OutofdateReason Reason - { - get { return reason; } - } - - /// - /// The input item name (can be null) - /// - public string InputItemName - { - get { return inputItemName; } - } - - /// - /// The output item name (can be null) - /// - public string OutputItemName - { - get { return outputItemName; } - } - - /// - /// The input file - /// - public string Input - { - get { return input; } - } - - /// - /// The output file - /// - public string Output - { - get { return output; } - } - - /// - /// Construct a log detail element - /// - /// Input file - /// Output file - /// Input item name (can be null) - /// Output item name (can be null) - /// The reason we are logging - public DependencyAnalysisLogDetail(string input, string output, string inputItemName, string outputItemName, OutofdateReason reason) - { - this.reason = reason; - this.inputItemName = inputItemName; - this.outputItemName = outputItemName; - this.input = input; - this.output = output; - } - } -} diff --git a/src/Deprecated/Engine/Engine/TargetExecutionWrapper.cs b/src/Deprecated/Engine/Engine/TargetExecutionWrapper.cs deleted file mode 100644 index 84728a83d94..00000000000 --- a/src/Deprecated/Engine/Engine/TargetExecutionWrapper.cs +++ /dev/null @@ -1,1085 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Xml; -using System.Diagnostics; // for the debugger display attribute -using System.Collections; -using System.Collections.Generic; - -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class is responsible for executing the target. Target only executs once within a project, - /// so this class comes into existance for the execution and is thrown away once the execution is - /// complete. It wraps all of the data and methods needed to execute a target. The execution - /// is done via state machine with three primary states - BuildingDependencies, RunningTasks, - /// BuildingErrorClause. This states map to the primary actions that are performed during target - /// execution. The execution is blocking in single threaded mode and is iterative in multi-threaded - /// mode. - /// - [DebuggerDisplay("Target (Name = { Name }, State = { inProgressBuildState })")] - internal class TargetExecutionWrapper - { - #region Constructors - internal TargetExecutionWrapper - ( - Target targetClass, - ArrayList taskElementList, - List targetParameters, - XmlElement targetElement, - Expander expander, - BuildEventContext targetBuildEventContext - ) - { - // Initialize the data about the target XML that has been calculated in the target class - this.targetClass = targetClass; - this.parentEngine = targetClass.ParentEngine; - this.parentProject = targetClass.ParentProject; - this.targetElement = targetElement; - this.taskElementList = taskElementList; - this.targetParameters = targetParameters; - this.targetBuildEventContext = targetBuildEventContext; - - // Expand the list of depends on targets - dependsOnTargetNames = expander.ExpandAllIntoStringList(targetClass.DependsOnTargets, targetClass.DependsOnTargetsAttribute); - - // Starting to build the target - inProgressBuildState = InProgressBuildState.StartingBuild; - // No messages have been logged - loggedTargetStart = false; - } - #endregion - - #region Data - // Local cache of data from the target being executed - private Target targetClass; - private Engine parentEngine; - private Project parentProject; - private XmlElement targetElement; - private ArrayList taskElementList; - private List targetParameters; - private ProjectBuildState initiatingBuildContext; - private BuildEventContext targetBuildEventContext; - - // Current state of the execution - private InProgressBuildState inProgressBuildState; - private bool overallSuccess; - // the outputs of the target as BuildItems (if it builds successfully) - private List targetOutputItems; - private List waitingTargets; - - // Names of the dependent targets - private List dependsOnTargetNames; - private int currentDependentTarget; - // Names of the error targets (lazily initialized on error) - private List onErrorTargets; - private int currentErrorTarget; - - // Array of buckets and the index of current bucket - private ArrayList buckets; - private int currentBucket; - - private bool haveRunANonIntrinsicTask = false; - - // Lookup containing project content used to - // initialize the target batches - private Lookup projectContent; - private LookupEntry placeholderForClonedProjectContent; - - // State for execution within a particular bucket - private DependencyAnalysisResult howToBuild; - private Lookup lookupForInference; - private Lookup lookupForExecution; - private string projectFileOfTaskNode; - private int currentTask; - private int skippedNodeCount; - private bool targetBuildSuccessful; - private bool exitBatchDueToError; - private bool loggedTargetStart; - #endregion - - #region Properties - internal ProjectBuildState InitiatingBuildContext - { - get - { - return this.initiatingBuildContext; - } - } - - internal bool BuildingRequiredTargets - { - get - { - return inProgressBuildState == InProgressBuildState.BuildingDependencies || - inProgressBuildState == InProgressBuildState.BuildingErrorClause; - } - } - - #endregion - - #region Methods - internal void ContinueBuild - ( - ProjectBuildState buildContext, TaskExecutionContext taskExecutionContext - ) - { - // Verify that the target is in progress - ErrorUtilities.VerifyThrow(inProgressBuildState != InProgressBuildState.NotInProgress, "Not in progress"); - - bool exitedDueToError = true; - - try - { - // In the single threaded mode we want to avoid looping all the way back to the - // engine because there is no need for to be interruptable to address - // other build requests. Instead we loop inside this function untill the target is - // fully built. - do - { - // Transition the state machine appropriatly - if (inProgressBuildState == InProgressBuildState.RunningTasks) - { - ContinueRunningTasks(buildContext, taskExecutionContext, false); - } - else if (inProgressBuildState == InProgressBuildState.BuildingDependencies) - { - ContinueBuildingDependencies(buildContext); - } - else if (inProgressBuildState == InProgressBuildState.StartingBuild) - { - initiatingBuildContext = buildContext; - inProgressBuildState = InProgressBuildState.BuildingDependencies; - currentDependentTarget = 0; - ExecuteDependentTarget(buildContext); - } - else if (inProgressBuildState == InProgressBuildState.BuildingErrorClause) - { - ContinueBuildingErrorClause(buildContext); - } - - // In the single threaded mode we need to pull up the outputs of the previous - // step - if (parentEngine.Router.SingleThreadedMode && - inProgressBuildState == InProgressBuildState.RunningTasks) - { - taskExecutionContext = parentEngine.GetTaskOutputUpdates(); - } - } while (parentEngine.Router.SingleThreadedMode && inProgressBuildState == InProgressBuildState.RunningTasks); - - // Indicate that we exited successfully - exitedDueToError = false; - } - finally - { - if (exitedDueToError) - { - inProgressBuildState = InProgressBuildState.NotInProgress; - NotifyBuildCompletion(Target.BuildState.CompletedUnsuccessfully, buildContext); - } - } - } - - /// - /// Mark the target data structures and notify waiting targets since the target has completed - /// - internal void NotifyBuildCompletion - ( - Target.BuildState stateOfBuild, - ProjectBuildState errorContext - ) - { - targetClass.UpdateTargetStateOnBuildCompletion(stateOfBuild, targetOutputItems); - - if (initiatingBuildContext.NameOfBlockingTarget == null) - { - initiatingBuildContext.BuildRequest.ResultByTarget[targetClass.Name] = stateOfBuild; - } - - if (!parentEngine.Router.SingleThreadedMode) - { - // Notify targets that have been waiting on the execution - NotifyWaitingTargets(errorContext); - } - } - - #region Methods for building dependencies ( InProgressBuildState.BuildingDependencies ) - - private void ContinueBuildingDependencies(ProjectBuildState buildContext) - { - // Verify that the target is in the right state - ErrorUtilities.VerifyThrow(inProgressBuildState == InProgressBuildState.BuildingDependencies, "Wrong state"); - // Check if all dependent targets have been evaluated - ErrorUtilities.VerifyThrow(currentDependentTarget < dependsOnTargetNames.Count, "No dependent targets left"); - - // Verify that the target we were waiting on has completed building - string nameDependentTarget = dependsOnTargetNames[currentDependentTarget]; - - ErrorUtilities.VerifyThrow( - (parentProject.Targets[nameDependentTarget].TargetBuildState != Target.BuildState.InProgress && - parentProject.Targets[nameDependentTarget].TargetBuildState != Target.BuildState.NotStarted) || - buildContext.CurrentBuildContextState == ProjectBuildState.BuildContextState.ExceptionThrown, - "This target should only be updated once the dependent target is completed"); - - if (buildContext.CurrentBuildContextState == ProjectBuildState.BuildContextState.ExceptionThrown) - { - inProgressBuildState = InProgressBuildState.NotInProgress; - // Call the parent project to update targets waiting on us - NotifyBuildCompletion(Target.BuildState.CompletedUnsuccessfully, buildContext); - return; - } - // If the dependent target failed to build we need to execute the onerrorclause (if there is one) - // or mark this target as failed (if there is not an error clause) - else if (parentProject.Targets[nameDependentTarget].TargetBuildState == Target.BuildState.CompletedUnsuccessfully) - { - // Transition the state machine into building the error clause state - InitializeOnErrorClauseExecution(); - inProgressBuildState = InProgressBuildState.BuildingErrorClause; - ExecuteErrorTarget(buildContext); - return; - } - - // Now that the previous dependent target has been build we need to move to the next dependent target if - // there is one - currentDependentTarget++; - - // Execute the current target or transition to a different state if necessary - ExecuteDependentTarget(buildContext); - } - - private void ExecuteDependentTarget - ( - ProjectBuildState buildContext - ) - { - if (currentDependentTarget < dependsOnTargetNames.Count) - { - // Get the Target object for the dependent target. - string nameDependentTarget = dependsOnTargetNames[currentDependentTarget]; - Target targetToBuild = parentProject.Targets[nameDependentTarget]; - - // If we couldn't find the dependent Target object, we have a problem. - ProjectErrorUtilities.VerifyThrowInvalidProject(targetToBuild != null, targetClass.DependsOnTargetsAttribute, - "TargetDoesNotExist", nameDependentTarget); - - // Update the name of the blocking target - buildContext.AddBlockingTarget(nameDependentTarget); - } - else - { - // We completed building the dependencies so we need to start running the tasks - dependsOnTargetNames = null; - inProgressBuildState = InProgressBuildState.RunningTasks; - ContinueRunningTasks(buildContext, null, true); - } - } - #endregion - - #region Methods for build error targets ( InProgressBuildState.BuildingErrorClause ) - private void ContinueBuildingErrorClause(ProjectBuildState buildContext) - { - // Verify that the target is in the right state - ErrorUtilities.VerifyThrow(inProgressBuildState == InProgressBuildState.BuildingErrorClause, "Wrong state"); - // Check if all dependent targets have been evaluated - ErrorUtilities.VerifyThrow(currentErrorTarget < onErrorTargets.Count, "No error targets left"); - - // Verify that the target we were waiting on has completed building - string nameErrorTarget = onErrorTargets[currentErrorTarget]; - - ErrorUtilities.VerifyThrow( - (parentProject.Targets[nameErrorTarget].TargetBuildState != Target.BuildState.InProgress && - parentProject.Targets[nameErrorTarget].TargetBuildState != Target.BuildState.NotStarted) || - buildContext.CurrentBuildContextState == ProjectBuildState.BuildContextState.ExceptionThrown, - "This target should only be updated once the error target is completed"); - - if (buildContext.CurrentBuildContextState == ProjectBuildState.BuildContextState.ExceptionThrown) - { - inProgressBuildState = InProgressBuildState.NotInProgress; - // Call the parent project to update targets waiting on us - NotifyBuildCompletion(Target.BuildState.CompletedUnsuccessfully, buildContext); - return; - } - - // We don't care if the target has completed successfully, we simply move on to the next one - currentErrorTarget++; - - ExecuteErrorTarget(buildContext); - } - - private void ExecuteErrorTarget - ( - ProjectBuildState buildContext - ) - { - if (onErrorTargets != null && currentErrorTarget < onErrorTargets.Count) - { - // Get the Target object for the dependent target. - string nameErrorTarget = onErrorTargets[currentErrorTarget]; - Target targetToBuild = parentProject.Targets[nameErrorTarget]; - - // If we couldn't find the on error Target object, we have a problem. - ProjectErrorUtilities.VerifyThrowInvalidProject(targetToBuild != null, targetElement, - "TargetDoesNotExist", nameErrorTarget); - - // Update the name of the blocking target - buildContext.AddBlockingTarget(nameErrorTarget); - } - else - { - // We completed building the error targets so this target is now failed and we have no more work to do - onErrorTargets = null; - inProgressBuildState = InProgressBuildState.NotInProgress; - // Call the parent project to update targets waiting on us - NotifyBuildCompletion(Target.BuildState.CompletedUnsuccessfully, null); - } - } - - /// - /// Creates a list of targets to execute for the OnErrorClause - /// - private void InitializeOnErrorClauseExecution() - { - // Give default values; - currentErrorTarget = 0; - onErrorTargets = null; - - // Loop through each of the child nodes of the element. - List childElements = ProjectXmlUtilities.GetValidChildElements(targetElement); - - foreach (XmlElement childElement in childElements) - { - switch (childElement.Name) - { - case XMakeElements.onError: - ProjectXmlUtilities.VerifyThrowProjectNoChildElements(childElement); - - XmlAttribute condition = null; - XmlAttribute executeTargets = null; - - foreach (XmlAttribute onErrorAttribute in childElement.Attributes) - { - switch (onErrorAttribute.Name) - { - case XMakeAttributes.condition: - condition = childElement.Attributes[XMakeAttributes.condition]; - break; - case XMakeAttributes.executeTargets: - executeTargets = childElement.Attributes[XMakeAttributes.executeTargets]; - break; - default: - ProjectXmlUtilities.ThrowProjectInvalidAttribute(onErrorAttribute); - break; - } - } - - ProjectErrorUtilities.VerifyThrowInvalidProject(executeTargets != null, childElement, "MissingRequiredAttribute", XMakeAttributes.executeTargets, XMakeElements.onError); - - Expander expander = new Expander(this.parentProject.evaluatedProperties, this.parentProject.evaluatedItemsByName); - - bool runErrorTargets = true; - if (condition != null) - { - if - ( - !Utilities.EvaluateCondition - ( - condition.InnerText, condition, expander, - null, ParserOptions.AllowProperties | ParserOptions.AllowItemLists, - parentEngine.LoggingServices, targetBuildEventContext - ) - ) - { - runErrorTargets = false; - } - } - - if (runErrorTargets) - { - if (onErrorTargets == null) - { - onErrorTargets = expander.ExpandAllIntoStringList(executeTargets.InnerText, executeTargets); - } - else - { - onErrorTargets.AddRange(expander.ExpandAllIntoStringList(executeTargets.InnerText, executeTargets)); - } - } - break; - - default: - // Ignore - break; - } - } - } - - #endregion - - #region Methods for running tasks ( InProgressBuildState.RunningTasks ) - - private void ContinueRunningTasks - ( - ProjectBuildState buildContext, TaskExecutionContext taskExecutionContext, - bool startingFirstTask - ) - { - bool exitDueToError = true; - try - { - // If this is the first task - initialize for running it - if (startingFirstTask) - { - InitializeForRunningTargetBatches(); - } - - // If run a task then process its outputs - if (currentTask != targetElement.ChildNodes.Count && !startingFirstTask) - { - ProcessTaskOutputs(taskExecutionContext); - } - - // Check if we processed the last node in a batch or terminated the batch due to error - if (currentTask == targetElement.ChildNodes.Count || exitBatchDueToError) - { - FinishRunningSingleTargetBatch(); - - // On failure transition into unsuccessful state - if (!targetBuildSuccessful) - { - overallSuccess = false; - FinishRunningTargetBatches(buildContext); - // Transition the state machine into building the error clause state - InitializeOnErrorClauseExecution(); - inProgressBuildState = InProgressBuildState.BuildingErrorClause; - ExecuteErrorTarget(buildContext); - exitDueToError = false; - return; - } - - //Check if this was the last bucket - if (currentBucket == buckets.Count) - { - FinishRunningTargetBatches(buildContext); - inProgressBuildState = InProgressBuildState.NotInProgress; - // Notify targets that are waiting for the results - NotifyBuildCompletion(Target.BuildState.CompletedSuccessfully, null); - exitDueToError = false; - return; - } - - // Prepare the next bucket - InitializeForRunningSingleTargetBatch(); - } - - // Execute the current task - ExecuteCurrentTask(buildContext); - - exitDueToError = false; - } - catch (InvalidProjectFileException e) - { - // Make sure the Invalid Project error gets logged *before* TargetFinished. Otherwise, - // the log is confusing. - this.parentEngine.LoggingServices.LogInvalidProjectFileError(targetBuildEventContext, e); - throw; - } - finally - { - if (exitDueToError && loggedTargetStart) - { - // Log that the target has failed - parentEngine.LoggingServices.LogTargetFinished( - targetBuildEventContext, - targetClass.Name, - this.parentProject.FullFileName, - targetClass.ProjectFileOfTargetElement, - false); - } - } - } - - private void InitializeForRunningTargetBatches() - { - // Make sure the node has been given to us. - ErrorUtilities.VerifyThrow(targetElement != null, - "Need an XML node representing the element."); - - // Make sure this really is the node. - ProjectXmlUtilities.VerifyThrowElementName(targetElement, XMakeElements.target); - - overallSuccess = true; - - projectContent = new Lookup(parentProject.evaluatedItemsByName, parentProject.evaluatedItems, parentProject.evaluatedProperties, parentProject.ItemDefinitionLibrary); - - // If we need to use the task thread - ie, we encounter a non-intrinsic task - we will need to make sure - // the task thread only sees clones of the project items and properties. We insert a scope to allow us to - // do that later. See comment in InitializeForRunningFirstNonIntrinsicTask() - placeholderForClonedProjectContent = projectContent.EnterScope(); - buckets = BatchingEngine.PrepareBatchingBuckets(targetElement, targetParameters, projectContent); - - currentBucket = 0; - - // Initialize the first bucket - InitializeForRunningSingleTargetBatch(); - } - - private void InitializeForRunningSingleTargetBatch() - { - // Verify that the target is in the right state - ErrorUtilities.VerifyThrow(inProgressBuildState == InProgressBuildState.RunningTasks, "Wrong state"); - // Check if the current task number is valid - ErrorUtilities.VerifyThrow(currentBucket < buckets.Count, "No buckets left"); - howToBuild = DependencyAnalysisResult.FullBuild; - ItemBucket bucket = (ItemBucket)buckets[currentBucket]; - - // For the first batch of a target use the targets original targetID. for each batch after the first one use a uniqueId to identity the target in the batch - if (currentBucket != 0) - { - targetBuildEventContext = new BuildEventContext(targetBuildEventContext.NodeId, parentEngine.GetNextTargetId(), targetBuildEventContext.ProjectContextId, targetBuildEventContext.TaskId); - } - - // Flag the start of the target. - parentEngine.LoggingServices.LogTargetStarted( - targetBuildEventContext, - targetClass.Name, - this.parentProject.FullFileName, - targetClass.ProjectFileOfTargetElement); - loggedTargetStart = true; - - // Figure out how we should build the target - TargetDependencyAnalyzer dependencyAnalyzer = new TargetDependencyAnalyzer(parentProject.ProjectDirectory, targetClass, parentEngine.LoggingServices, targetBuildEventContext); - - Hashtable changedTargetInputs; - Hashtable upToDateTargetInputs; - howToBuild = dependencyAnalyzer.PerformDependencyAnalysis(bucket, out changedTargetInputs, out upToDateTargetInputs); - - targetBuildSuccessful = true; - exitBatchDueToError = false; - - // If we need to build the target - initialize the data structure for - // running the tasks - if ((howToBuild != DependencyAnalysisResult.SkipNoInputs) && - (howToBuild != DependencyAnalysisResult.SkipNoOutputs)) - { - // Within each target batch items are divided into lookup and execution; they must be - // kept separate: enforce this by cloning and entering scope - lookupForInference = bucket.Lookup; - lookupForExecution = bucket.Lookup.Clone(); - - lookupForInference.EnterScope(); - lookupForExecution.EnterScope(); - - // if we're doing an incremental build, we need to effectively run the task twice -- once - // to infer the outputs for up-to-date input items, and once to actually execute the task; - // as a result we need separate sets of item and property collections to track changes - if (howToBuild == DependencyAnalysisResult.IncrementalBuild) - { - // subset the relevant items to those that are up-to-date - foreach (DictionaryEntry upToDateTargetInputsEntry in upToDateTargetInputs) - { - lookupForInference.PopulateWithItems((string)upToDateTargetInputsEntry.Key, (BuildItemGroup)upToDateTargetInputsEntry.Value); - } - - // subset the relevant items to those that have changed - foreach (DictionaryEntry changedTargetInputsEntry in changedTargetInputs) - { - lookupForExecution.PopulateWithItems((string)changedTargetInputsEntry.Key, (BuildItemGroup)changedTargetInputsEntry.Value); - } - } - - projectFileOfTaskNode = XmlUtilities.GetXmlNodeFile(targetElement, parentProject.FullFileName); - - // count the tasks in the target - currentTask = 0; - skippedNodeCount = 0; - } - else - { - currentTask = targetElement.ChildNodes.Count; - } - } - - /// - /// Called before the first non-intrinsic task is run by this object. - /// - private void InitializeForRunningFirstNonIntrinsicTask() - { - // We need the task thread to see cloned project content for two reasons: - // (1) clone items because BuildItemGroups storage is a List, which - // is not safe to read from (task thread) and write to (engine thread) concurrently. - // Project properties are in a virtual property group which stores its properties in a hashtable, however - // (2) we must clone both items and properties so that project items and properties modified by a - // target called by this target are not visible to this target (Whidbey behavior) - // - // So, we populate the empty scope we inserted earlier with clones of the items and properties, and we - // mark it so that lookups truncate their walk at this scope, and don't reach the real items and properties below. - // Later, back on the engine thread, we'll leave this scope and the task changes will go into the project. - Hashtable items = new Hashtable(parentProject.evaluatedItemsByName.Count, StringComparer.OrdinalIgnoreCase); - foreach (DictionaryEntry entry in parentProject.evaluatedItemsByName) - { - BuildItemGroup group = (BuildItemGroup)entry.Value; - BuildItemGroup clonedGroup = group.ShallowClone(); - items.Add(entry.Key, clonedGroup); - } - BuildPropertyGroup properties = parentProject.evaluatedProperties.ShallowClone(); - - placeholderForClonedProjectContent.Items = items; - placeholderForClonedProjectContent.Properties = properties; - placeholderForClonedProjectContent.TruncateLookupsAtThisScope = true; - } - - /// - /// Executes all tasks in the target linearly from beginning to end, for one batch of the target. - /// - private void ExecuteCurrentTask(ProjectBuildState buildContext) - { - // Check if this is an empty target - if (currentTask == targetElement.ChildNodes.Count) - { - // This is an empty target so we should transition into completed state - ContinueRunningTasks(buildContext, null, false); - return; - } - - // Get the current child nodes of the element. - XmlNode targetChildNode = targetElement.ChildNodes[currentTask]; - - // Handle XML comments under the node (just ignore them) and - // also skip OnError tags because they are processed separately and later. - // Also evaluate any intrinsic tasks immediately and continue. - while ((targetChildNode.NodeType == XmlNodeType.Comment) || - (targetChildNode.NodeType == XmlNodeType.Whitespace) || - (targetChildNode.Name == XMakeElements.onError) || - (IntrinsicTask.IsIntrinsicTaskName(targetChildNode.Name))) - { - if (IntrinsicTask.IsIntrinsicTaskName(targetChildNode.Name)) - { - ExecuteIntrinsicTask((XmlElement)targetChildNode); - } - else - { - skippedNodeCount++; - } - - currentTask++; - - // Check if this was the last task in the target - if (currentTask == targetElement.ChildNodes.Count) - { - // Transition into appropriate state - ContinueRunningTasks(buildContext, null, false); - return; - } - - targetChildNode = targetElement.ChildNodes[currentTask]; - } - - // Any child node other than a task element or is not supported. - ProjectXmlUtilities.VerifyThrowProjectXmlElementChild(targetChildNode); - - // Make illegal inside targets, so we can possibly allow it in future. - ProjectErrorUtilities.VerifyThrowInvalidProject(!String.Equals(targetChildNode.Name, XMakeElements.itemDefinitionGroup, StringComparison.Ordinal), - targetElement, "ItemDefinitionGroupNotLegalInsideTarget", targetChildNode.Name, XMakeElements.target); - - ErrorUtilities.VerifyThrow(taskElementList.Count > (currentTask - skippedNodeCount), - "The TaskElementCollection in this target doesn't have the same number of BuildTask objects as the number of actual task elements."); - // Send the task for execution - SubmitNonIntrinsicTask( - (XmlElement)targetChildNode, - ((BuildTask)taskElementList[currentTask - skippedNodeCount]).HostObject, - buildContext); - - return; - } - - private TaskExecutionMode DetermineExecutionMode() - { - TaskExecutionMode executionMode; - if ((howToBuild == DependencyAnalysisResult.SkipUpToDate) || - (howToBuild == DependencyAnalysisResult.IncrementalBuild)) - { - executionMode = TaskExecutionMode.InferOutputsOnly; - } - else - { - executionMode = TaskExecutionMode.ExecuteTaskAndGatherOutputs; - } - - // execute the task using the items that need to be (re)built - if ((howToBuild == DependencyAnalysisResult.FullBuild) || - (howToBuild == DependencyAnalysisResult.IncrementalBuild)) - { - executionMode |= TaskExecutionMode.ExecuteTaskAndGatherOutputs; - } - return executionMode; - } - - /// - /// Create a new build event context for tasks - /// - private BuildEventContext PrepareBuildEventContext(bool setInvalidTaskId) - { - BuildEventContext buildEventContext = new BuildEventContext - ( - targetBuildEventContext.NodeId, - targetBuildEventContext.TargetId, - targetBuildEventContext.ProjectContextId, - setInvalidTaskId ? BuildEventContext.InvalidTaskId : parentEngine.GetNextTaskId() - ); - - return buildEventContext; - } - - private void ExecuteIntrinsicTask(XmlElement taskNode) - { - // Intrinsic tasks should have their messages logged in the context of the target as they will not have task started or finished events so use an invalid taskID - BuildEventContext buildEventContext = PrepareBuildEventContext(true); - TaskExecutionMode executionMode = DetermineExecutionMode(); - - IntrinsicTask task = new IntrinsicTask(taskNode, - parentEngine.LoggingServices, - buildEventContext, - parentProject.ProjectDirectory, - parentProject.ItemDefinitionLibrary); - if ((executionMode & TaskExecutionMode.InferOutputsOnly) != TaskExecutionMode.Invalid) - { - task.ExecuteTask(lookupForInference); - } - if ((executionMode & TaskExecutionMode.ExecuteTaskAndGatherOutputs) != TaskExecutionMode.Invalid) - { - task.ExecuteTask(lookupForExecution); - } - } - - /// - /// Create a TaskExecutionState structure which contains all the information necessary - /// to execute the task and send this information over to the TEM for task execution - /// - internal void SubmitNonIntrinsicTask - ( - XmlElement taskNode, - ITaskHost hostObject, - ProjectBuildState buildContext - ) - { - if (!haveRunANonIntrinsicTask) - { - InitializeForRunningFirstNonIntrinsicTask(); - haveRunANonIntrinsicTask = true; - } - - TaskExecutionMode executionMode = DetermineExecutionMode(); - - // A TaskExecutionMode of ExecuteTaskAndGatherOutputs should have its messages logged in the context of the task and therefore should have a valid taskID - // A TaskExecutionMode of InferOutputs or Invalid should have its messages logged in the context of the target and therefore should have an invalid taskID - BuildEventContext buildEventContext = PrepareBuildEventContext(executionMode == TaskExecutionMode.ExecuteTaskAndGatherOutputs ? false : true); - - // Create the task execution context - int handleId = parentEngine.EngineCallback.CreateTaskContext(parentProject, targetClass, buildContext, - taskNode, EngineCallback.inProcNode, buildEventContext); - - // Create the task execution state - TaskExecutionState taskState = - new TaskExecutionState - ( - executionMode, - lookupForInference, - lookupForExecution, - taskNode, - hostObject, - projectFileOfTaskNode, - parentProject.FullFileName, - parentProject.ProjectDirectory, - handleId, - buildEventContext - ); - - // Send the request for task execution to the node - parentEngine.NodeManager.ExecuteTask(taskState); - } - - private void ProcessTaskOutputs(TaskExecutionContext executionContext) - { - // Get the success or failure - if (targetBuildSuccessful) - { - if (!executionContext.TaskExecutedSuccessfully) - { - targetBuildSuccessful = false; - // Check if the task threw an unhandled exception during its execution - if (executionContext.ThrownException != null) - { - // The stack trace for remote task InvalidProjectFileException can be ignored - // since it is not recorded and the exception will be caught inside the project - // class - if (executionContext.ThrownException is InvalidProjectFileException) - { - throw executionContext.ThrownException; - } - else - { - // The error occurred outside of the user code (it may still be caused - // by bad user input), the build should be terminated. The exception - // will be logged as a fatal build error in engine. The exceptions caused - // by user code are converted into LogFatalTaskError messages by the TaskEngine - RemoteErrorException.Throw(executionContext.ThrownException, - targetBuildEventContext, - "RemoteErrorDuringTaskExecution", - parentProject.FullFileName, - targetClass.Name); - } - } - // We need to disable the execution of the task if it was previously enabled, - // and if were only doing execution we can stop processing at the point the - // error occurred. If the task fails (which implies that ContinueOnError != 'true'), then do - // not execute the remaining tasks because they may depend on the completion - // of this task. - ErrorUtilities.VerifyThrow(howToBuild == DependencyAnalysisResult.FullBuild || - howToBuild == DependencyAnalysisResult.IncrementalBuild, - "We can only see a failure for an execution stage"); - if (howToBuild != DependencyAnalysisResult.FullBuild) - { - howToBuild = DependencyAnalysisResult.SkipUpToDate; - } - else - { - exitBatchDueToError = true; - } - } - } - - currentTask++; - } - - private void FinishRunningSingleTargetBatch - ( - ) - { - if ((howToBuild != DependencyAnalysisResult.SkipNoInputs) && - (howToBuild != DependencyAnalysisResult.SkipNoOutputs)) - { - // publish all output items and properties to the target scope; - // inference and execution are now combined - // roll up the outputs in the right order -- inferred before generated - // NOTE: this order is important because when we infer outputs, we are trying - // to produce the same results as would be produced from a full build; as such - // if we're doing both the infer and execute steps, we want the outputs from - // the execute step to override the outputs of the infer step -- this models - // the full build scenario more correctly than if the steps were reversed - lookupForInference.LeaveScope(); - lookupForExecution.LeaveScope(); - } - - // Flag the completion of the target. - parentEngine.LoggingServices.LogTargetFinished( - targetBuildEventContext, - targetClass.Name, - this.parentProject.FullFileName, - targetClass.ProjectFileOfTargetElement, - overallSuccess && targetBuildSuccessful); - loggedTargetStart = false; - - // Get the next bucket - currentBucket++; - } - - private void FinishRunningTargetBatches(ProjectBuildState buildContext) - { - // first, publish all task outputs to the project level - foreach (ItemBucket bucket in buckets) - { - bucket.Lookup.LeaveScope(); - } - - // and also leave the extra scope we created with the cloned project items - projectContent.LeaveScope(); - - // if all batches of the target build successfully - if (overallSuccess) - { - // then, gather the target outputs - // NOTE: it is possible that the target outputs computed at this point will be different from the target outputs - // used for dependency analysis, but we assume that's what the user intended - GatherTargetOutputs(); - - // Only contexts which are generated from an MSBuild task could need - // the outputs of the target, such contexts have a non-null evaluation - // request - if (buildContext.BuildRequest.OutputsByTarget != null && - buildContext.NameOfBlockingTarget == null) - { - ErrorUtilities.VerifyThrow( - String.Equals(EscapingUtilities.UnescapeAll(buildContext.NameOfTargetInProgress), targetClass.Name, StringComparison.OrdinalIgnoreCase), - "The name of the target in progress is inconsistent with the target being built"); - - ErrorUtilities.VerifyThrow(targetOutputItems != null, - "If the target built successfully, we must have its outputs."); - - buildContext.BuildRequest.OutputsByTarget[targetClass.Name] = targetOutputItems.ToArray(); - } - } - } - - /// - /// Gathers the target's outputs, per its output specification (if any). - /// - /// - /// This method computes the target's outputs using the items currently available in the project; depending on when this - /// method is called, it may compute a different set of outputs -- as a result, we only want to gather the target's - /// outputs once, and cache them until the target's build state is reset. - /// - private void GatherTargetOutputs() - { - // allocate storage for target outputs -- if the target has no outputs this list will remain empty - targetOutputItems = new List(); - - XmlAttribute targetOutputsAttribute = targetElement.Attributes[XMakeAttributes.outputs]; - - // Hack to help the 3.5 engine at least pretend to still be able to build on top of - // the 4.0 targets. In cases where there is no Outputs attribute, just a Returns attribute, - // we can approximate the correct behaviour by making the Returns attribute our "outputs" attribute. - if (targetOutputsAttribute == null) - { - targetOutputsAttribute = targetElement.Attributes[XMakeAttributes.returns]; - } - - if (targetOutputsAttribute != null) - { - // NOTE: we need to gather the outputs in batches, because the output specification may reference item metadata - foreach (ItemBucket bucket in BatchingEngine.PrepareBatchingBuckets(targetElement, targetParameters, new Lookup(parentProject.evaluatedItemsByName, parentProject.evaluatedProperties, parentProject.ItemDefinitionLibrary))) - { - targetOutputItems.AddRange(bucket.Expander.ExpandAllIntoBuildItems(targetOutputsAttribute.Value, targetOutputsAttribute)); - } - } - } - - #endregion - - #region Methods for managing the wait states - - /// - /// Add a build context that should get a result of the target once it is finished - /// - internal void AddWaitingBuildContext(ProjectBuildState buildContext) - { - if (waitingTargets == null) - { - waitingTargets = new List(); - } - parentEngine.Scheduler.NotifyOfBlockedRequest(buildContext.BuildRequest); - waitingTargets.Add(buildContext); - } - - /// - /// Get the list of build contexts currently waiting on the target - /// - internal List GetWaitingBuildContexts() - { - return waitingTargets; - } - - /// - /// Iterate over the contexts waiting for the target - triggering updates for each of them since the target - /// is complete - /// - internal void NotifyWaitingTargets(ProjectBuildState errorContext) - { - // If there was a failure (either unhandled exception or a cycle) the stack will - // not unwind properly (i.e. via ContinueBuild call). Therefore the initiating request - // must be notified the target completed if the error occurred in another context - if (errorContext != null) - { - AddWaitingBuildContext(initiatingBuildContext); - } - - // Notify the target within the same project that are waiting for current target - // These targets are in the process of either building dependencies or error targets - // or part of a sequential build context - while (waitingTargets != null && waitingTargets.Count != 0) - { - //Grab the first context - ProjectBuildState buildContext = waitingTargets[0]; - waitingTargets.RemoveAt(0); - - //Don't report any messages within the context in which the error occurred. That context - //is addressed as the base of the stack - if (buildContext == errorContext || - buildContext.CurrentBuildContextState == ProjectBuildState.BuildContextState.RequestFilled) - { - continue; - } - - parentEngine.Scheduler.NotifyOfUnblockedRequest(buildContext.BuildRequest); - - ErrorUtilities.VerifyThrow( - buildContext.CurrentBuildContextState == ProjectBuildState.BuildContextState.WaitingForTarget || - buildContext == initiatingBuildContext, - "This context should be waiting for a target to be evaluated"); - - if (buildContext.NameOfBlockingTarget == null) - { - ErrorUtilities.VerifyThrow( - String.Equals(EscapingUtilities.UnescapeAll(buildContext.NameOfTargetInProgress), targetClass.Name, StringComparison.OrdinalIgnoreCase), - "The name of the target in progress is inconsistent with the target being built"); - - // This target was part of a sequential request so we need to notify the parent project - // to start building the next target in the sequence - if (Engine.debugMode) - { - Console.WriteLine("Finished " + buildContext.BuildRequest.ProjectFileName + ":" + targetClass.Name + " for node:" + - buildContext.BuildRequest.NodeIndex + " HandleId " + buildContext.BuildRequest.HandleId); - } - } - else - { - // The target on the waiting list must be waiting for this target to complete due to - // a dependent or onerror relationship between targets - ErrorUtilities.VerifyThrow( - String.Equals(buildContext.NameOfBlockingTarget, targetClass.Name, StringComparison.OrdinalIgnoreCase), - "This target should only be updated once the dependent target is completed"); - - if (Engine.debugMode) - { - Console.WriteLine("Finished " + targetClass.Name + " notifying " + EscapingUtilities.UnescapeAll(buildContext.NameOfTargetInProgress)); - } - } - - // Post a dummy context to the queue to cause the target to run in this context - TaskExecutionContext taskExecutionContext = - new TaskExecutionContext(parentProject, null, null, buildContext, - EngineCallback.invalidEngineHandle, EngineCallback.inProcNode, null); - parentEngine.PostTaskOutputUpdates(taskExecutionContext); - } - } - #endregion - #endregion - - #region Enums - internal enum InProgressBuildState - { - // This target is not in the process of building - NotInProgress, - - // The target is being started but no work has been done - StartingBuild, - - // This target is in process of building dependencies - BuildingDependencies, - - // This target is in process of building the error clause - BuildingErrorClause, - - // This target is current running the tasks for each bucket - RunningTasks - } - #endregion - } -} diff --git a/src/Deprecated/Engine/Engine/TaskEngine.cs b/src/Deprecated/Engine/Engine/TaskEngine.cs deleted file mode 100644 index 7d32fb9648c..00000000000 --- a/src/Deprecated/Engine/Engine/TaskEngine.cs +++ /dev/null @@ -1,1637 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Xml; -using System.Text; -using System.Reflection; -using System.Collections; -using System.Collections.Generic; -using System.Diagnostics; -using System.Globalization; - -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// The manner in which a task engine runs its assigned task. - /// - /// - /// This enum is public because it is passed between processes i.e. the engine - /// and the node process. - /// - /// SumedhK - [Flags] - internal enum TaskExecutionMode - { - /// - /// This entry is necessary to use the enum with binary math. It is never used outside - /// intermediate calculations. - /// - Invalid = 0, - /// - /// In this mode, the task engine actually runs the task and retrieves its outputs. - /// - ExecuteTaskAndGatherOutputs = 1, - /// - /// In this mode, the task engine only infers the task's outputs from its <Output> tags. - /// - InferOutputsOnly = 2 - } - - /// - /// This class is used by targets to execute tasks. This class encapsulates the information needed to run a single task once. - /// - /// SumedhK - internal sealed class TaskEngine - { - #region Constructors - - /// - /// Creates an instance of this class for the specified task. - /// - public TaskEngine - ( - XmlElement taskNodeXmlElement, - ITaskHost hostObject, - string projectFileOfTaskNode, - string parentProjectFullFileName, - EngineLoggingServices loggingServices, - int handleId, - TaskExecutionModule parentModule, - BuildEventContext targetBuildEventContext - ) - { - ErrorUtilities.VerifyThrow(taskNodeXmlElement != null, "Need to specify the task node."); - ErrorUtilities.VerifyThrow(projectFileOfTaskNode != null, "Need to specify path of project."); - ErrorUtilities.VerifyThrow(parentProjectFullFileName != null, "Need to specify name of project."); - ErrorUtilities.VerifyThrow(loggingServices != null, "Need to specify the node logger."); - - this.taskNode = taskNodeXmlElement; - this.taskClass = null; - this.hostObject = hostObject; - this.projectFileOfTaskNode = projectFileOfTaskNode; - this.parentProjectFullFileName = parentProjectFullFileName; - this.loggingServices = loggingServices; - this.handleId = handleId; - this.parentModule = parentModule; - this.continueOnError = false; - this.conditionAttribute = taskNode.Attributes[XMakeAttributes.condition]; - this.buildEventContext = targetBuildEventContext; - } - - #endregion - - #region Properties - - /// - /// Gets the string name of the task. - /// - private string TaskName - { - get { return taskNode.Name; } - } - - /// - /// Gets the .NET class that defines the task. - /// - internal LoadedType TaskClass - { - get { return taskClass; } - set { taskClass = value; } - } - - #endregion - - #region Methods - - /// - /// Build up a list of all parameters on the task, including those in any Output tags, - /// in order to find batchable metadata references - /// - private List CreateListOfParameterValues() - { - List taskParameters = new List(taskNode.Attributes.Count); - - foreach (XmlAttribute taskParameter in taskNode.Attributes) - { - ProjectErrorUtilities.VerifyThrowInvalidProject(!XMakeAttributes.IsBadlyCasedSpecialTaskAttribute(taskParameter.Name), taskParameter, - "BadlyCasedSpecialTaskAttribute", taskParameter.Name, TaskName, TaskName); - - taskParameters.Add(taskParameter.Value); - } - - // Add parameters on any output tags - foreach (TaskOutput taskOutputSpecification in GetTaskOutputSpecifications(false /* no warnings */)) - { - if (taskOutputSpecification.TaskParameterAttribute != null) - { - taskParameters.Add(taskOutputSpecification.TaskParameterAttribute.Value); - } - - if (taskOutputSpecification.ItemNameAttribute != null) - { - taskParameters.Add(taskOutputSpecification.ItemNameAttribute.Value); - } - - if (taskOutputSpecification.PropertyNameAttribute != null) - { - taskParameters.Add(taskOutputSpecification.PropertyNameAttribute.Value); - } - - if (taskOutputSpecification.ConditionAttribute != null) - { - taskParameters.Add(taskOutputSpecification.ConditionAttribute.Value); - } - } - - return taskParameters; - } - - /// - /// Given the task XML, this method tries to find the task. It uses the following search order: - /// 1) checks the tasks declared by the project, searching by exact name - /// 2) checks the global task declarations (in *.TASKS in MSbuild bin dir), searching by exact name - /// 3) checks the tasks declared by the project, searching by fuzzy match (missing namespace, etc.) - /// 4) checks the global task declarations (in *.TASKS in MSbuild bin dir), searching by fuzzy match (missing namespace, etc.) - /// - /// The search ordering is meant to reduce the number of assemblies we scan, because loading assemblies can be expensive. - /// The tasks and assemblies declared by the project are scanned first, on the assumption that if the project declared - /// them, they are likely used. - /// - /// - /// This is internal so that BuildTask.Type can call it. - /// - /// true, if task was found - internal bool FindTask() - { - // We may have been called earlier on a previous batch; if so, - // there's no work to do. - if (TaskClass == null) - { - if (!parentModule.GetProjectTasksRegistry(handleId).GetRegisteredTask(TaskName, projectFileOfTaskNode, taskNode, true /* exact match */, loggingServices, buildEventContext, out taskClass)) - { - if (!parentModule.GetDefaultTasksRegistry(handleId).GetRegisteredTask(TaskName, projectFileOfTaskNode, taskNode, true /* exact match */, loggingServices, buildEventContext, out taskClass)) - { - if (!parentModule.GetProjectTasksRegistry(handleId).GetRegisteredTask(TaskName, projectFileOfTaskNode, taskNode, false /* fuzzy match */, loggingServices, buildEventContext, out taskClass)) - { - if (!parentModule.GetDefaultTasksRegistry(handleId).GetRegisteredTask(TaskName, projectFileOfTaskNode, taskNode, false /* fuzzy match */, loggingServices, buildEventContext, out taskClass)) - { - loggingServices.LogError(buildEventContext, CreateBuildEventFileInfoForTask(), - "MissingTaskError", TaskName, parentModule.GetToolsPath(handleId)); - } - } - } - } - } - - return TaskClass != null; - } - - /// - /// Sets up an app domain for the task batch, if necessary - /// - private AppDomain PrepareAppDomain() - { - // If the task assembly is loaded into a separate AppDomain using LoadFrom, then we have a problem - // to solve - when the task class Type is marshalled back into our AppDomain, it's not just transferred - // here. Instead, NDP will try to Load (not LoadFrom!) the task assembly into our AppDomain, and since - // we originally used LoadFrom, it will fail miserably not knowing where to find it. - // We need to temporarily subscribe to the AppDomain.AssemblyResolve event to fix it. - if (resolver == null) - { - resolver = new TaskEngineAssemblyResolver(); - resolver.Initialize(TaskClass.Assembly.AssemblyFile); - resolver.InstallHandler(); - } - - bool hasLoadInSeparateAppDomainAttribute = false; - try - { - hasLoadInSeparateAppDomainAttribute = TaskClass.HasLoadInSeparateAppDomainAttribute(); - } - catch (Exception e) // Catching Exception, but rethrowing unless it's a well-known exception. - { - if (ExceptionHandling.NotExpectedReflectionException(e)) - { - throw; - } - - // Reflection related exception - ProjectErrorUtilities.VerifyThrowInvalidProject(false, taskNode, "TaskInstantiationFailureError", TaskName, TaskClass.Assembly.ToString(), e.Message); - } - - AppDomain taskAppDomain = null; - - if (hasLoadInSeparateAppDomainAttribute) - { - if (!TaskClass.Type.IsMarshalByRef) - { - ProjectErrorUtilities.VerifyThrowInvalidProject(false, taskNode, "TaskNotMarshalByRef", TaskName); - } - else - { - // Our task depend on this name to be precisely that, so if you change it make sure - // you also change the checks in the tasks run in separate AppDomains. Better yet, just don't change it. - - // Make sure we copy the appdomain configuration and send it to the appdomain we create so that if the creator of the current appdomain - // has done the binding redirection in code, that we will get those settings as well. - AppDomainSetup appDomainInfo = new AppDomainSetup(); - - // Get the current app domain setup settings - byte[] currentAppdomainBytes = AppDomain.CurrentDomain.SetupInformation.GetConfigurationBytes(); - - //Apply the appdomain settings to the new appdomain before creating it - appDomainInfo.SetConfigurationBytes(currentAppdomainBytes); - taskAppDomain = AppDomain.CreateDomain("taskAppDomain", null, appDomainInfo); - } - } - - return taskAppDomain; - } - - /// - /// Called to execute a task within a target. This method instantiates the task, sets its parameters, and executes it. - /// - /// true, if successful - internal bool ExecuteTask(TaskExecutionMode howToExecuteTask, Lookup lookup) - { - ErrorUtilities.VerifyThrow(lookup != null, "Need to specify items available to task."); - - bool taskExecutedSuccessfully = false; - EngineProxy engineProxy = null; - - ArrayList buckets = null; - - try - { - engineProxy = new EngineProxy(parentModule, handleId, parentProjectFullFileName, projectFileOfTaskNode, loggingServices, buildEventContext); - List taskParameterValues = CreateListOfParameterValues(); - buckets = BatchingEngine.PrepareBatchingBuckets(taskNode, taskParameterValues, lookup); - - lookupHash = null; - // Only create a hash table if there are more than one bucket as this is the only time a property can be overridden - if (buckets.Count > 1) - { - lookupHash = Utilities.CreateTableIfNecessary((Hashtable)null); - } - - // Loop through each of the batch buckets and execute them one at a time - for (int i = 0; i < buckets.Count; i++) - { - // Execute the batch bucket, pass in which bucket we are executing so that we know when to get a new taskId for the bucket. - taskExecutedSuccessfully = ExecuteBucket(engineProxy, (ItemBucket)buckets[i], i, howToExecuteTask); - if (!taskExecutedSuccessfully) - { - break; - } - } - } - finally - { - // Remove the AssemblyResolve handler in the default AppDomain, we are done with the task. - resolver?.RemoveHandler(); - - engineProxy?.MarkAsInActive(); - - // Now all task batches are done, apply all item adds to the outer - // target batch; we do this even if the task wasn't found (in that case, - // no items or properties will have been added to the scope) - if (buckets != null) - { - foreach (ItemBucket bucket in buckets) - { - bucket.Lookup.LeaveScope(); - } - } - } - - return taskExecutedSuccessfully; - } - - /// - /// Execute a single bucket - /// - /// true if execution succeeded - private bool ExecuteBucket(EngineProxy engineProxy, ItemBucket bucket, int bucketNumber, TaskExecutionMode howToExecuteTask) - { - if ( - (this.conditionAttribute != null) - && - !Utilities.EvaluateCondition(this.conditionAttribute.Value, this.conditionAttribute, - bucket.Expander, null, ParserOptions.AllowAll, loggingServices, buildEventContext) - ) - { - // Condition is false - if (howToExecuteTask == TaskExecutionMode.ExecuteTaskAndGatherOutputs) - { - if (!loggingServices.OnlyLogCriticalEvents) - { - // Expand the expression for the Log. - string expanded = bucket.Expander.ExpandAllIntoString(this.conditionAttribute); - // Whilst we are within the processing of the task, we haven't actually started executing it, so - // our skip task message needs to be in the context of the target. However any errors should be reported - // at the point where the task appears in the project. - BuildEventContext skipTaskContext = new BuildEventContext(buildEventContext.NodeId, buildEventContext.TargetId, buildEventContext.ProjectContextId, BuildEventContext.InvalidTaskId); - loggingServices.LogComment(skipTaskContext, - "TaskSkippedFalseCondition", - TaskName, this.conditionAttribute.Value, expanded); - } - } - - return true; - } - - bool taskExecutedSuccessfully = true; - - // Condition is true - if (howToExecuteTask == TaskExecutionMode.ExecuteTaskAndGatherOutputs) - { - // Now that we know we will need to execute the task, - // Ensure the TaskEngine is initialized with the task class - // This does the work of task discovery, if it - // hasn't already been done. - bool taskClassWasFound = FindTask(); - - if (!taskClassWasFound) - { - // Task wasn't discovered, we cannot continue - return false; - } - - // Now instantiate, initialize, and execute the task - ITask task; - - // If this is the first bucket use the task context originally given to it, for the remaining buckets get a unique id for them - if (bucketNumber != 0) - { - // Ask the parent engine the next Id which should be used for the taskId. - buildEventContext = new BuildEventContext(buildEventContext.NodeId, buildEventContext.TargetId, buildEventContext.ProjectContextId, parentModule.GetNextTaskId()); - - // For each batch the engineProxy needs to have the correct buildEventContext as all messages comming from a task will have the buildEventContext of the EngineProxy. - engineProxy.BuildEventContext = buildEventContext; - } - - loggingServices.LogTaskStarted(buildEventContext, TaskName, parentProjectFullFileName, projectFileOfTaskNode); - - AppDomain taskAppDomain = PrepareAppDomain(); - - bool taskResult = false; - - try - { - task = InstantiateTask(taskAppDomain); - - // If task cannot be instantiated, we consider its declaration/usage to be invalid. - ProjectErrorUtilities.VerifyThrowInvalidProject(task != null, taskNode, "TaskDeclarationOrUsageError", TaskName); - taskExecutedSuccessfully = ExecuteInstantiatedTask(engineProxy, bucket, howToExecuteTask, task, out taskResult); - if (lookupHash != null) - { - List overrideMessages = bucket.Lookup.GetPropertyOverrideMessages(lookupHash); - if (overrideMessages != null) - { - foreach (string s in overrideMessages) - { - loggingServices.LogCommentFromText(buildEventContext, MessageImportance.Low, s); - } - } - } - } - catch (InvalidProjectFileException e) - { - // Make sure the Invalid Project error gets logged *before* TaskFinished. Otherwise, - // the log is confusing. - loggingServices.LogInvalidProjectFileError(buildEventContext, e); - throw; - } - finally - { - // Flag the completion of the task. - loggingServices.LogTaskFinished( - buildEventContext, - TaskName, - parentProjectFullFileName, - projectFileOfTaskNode, - taskResult); - if (taskAppDomain != null) - { - AppDomain.Unload(taskAppDomain); - } - } - } - else - { - Debug.Assert(howToExecuteTask == TaskExecutionMode.InferOutputsOnly); - - ErrorUtilities.VerifyThrow(GatherTaskOutputs(howToExecuteTask, null, bucket), - "The method GatherTaskOutputs() should never fail when inferring task outputs."); - if (lookupHash != null) - { - List overrideMessages = bucket.Lookup.GetPropertyOverrideMessages(lookupHash); - if (overrideMessages != null) - { - foreach (string s in overrideMessages) - { - loggingServices.LogCommentFromText(buildEventContext, MessageImportance.Low, s); - } - } - } - } - - return taskExecutedSuccessfully; - } - - /// - /// Recomputes the task's "ContinueOnError" setting. - /// - /// - /// - private void UpdateContinueOnError(ItemBucket bucket, EngineProxy engineProxy) - { - XmlAttribute continueOnErrorAttribute = taskNode.Attributes[XMakeAttributes.continueOnError]; - - try - { - continueOnError = - ( - // if attribute doesn't exist, default to "false" - (continueOnErrorAttribute != null) - && - // otherwise, convert its value to a boolean - ConversionUtilities.ConvertStringToBool - ( - // expand embedded item vectors after expanding properties and item metadata - bucket.Expander.ExpandAllIntoString(continueOnErrorAttribute) - ) - ); - } - // handle errors in string-->bool conversion - catch (ArgumentException e) - { - ProjectErrorUtilities.VerifyThrowInvalidProject(false, continueOnErrorAttribute, "InvalidContinueOnErrorAttribute", TaskName, e.Message); - } - - // We need to access an internal method of the EngineProxy in order to update the value - // of continueOnError that will be returned to the task when the task queries IBuildEngine for it - engineProxy.UpdateContinueOnError(continueOnError); - } - - /// - /// Tries to instantiate the task object - /// - /// task object, or null if it could not be instantiated - private ITask InstantiateTask(AppDomain taskAppDomain) - { - ITask task = null; - - try - { - // instantiate the task in given domain - if (TaskClass.Assembly.AssemblyFile != null) - { - if (taskAppDomain == null) - { - taskAppDomain = AppDomain.CurrentDomain; - } - - task = (ITask)taskAppDomain.CreateInstanceFromAndUnwrap(TaskClass.Assembly.AssemblyFile, TaskClass.Type.FullName); - - // this will force evaluation of the task class type and try to load the task assembly - Type taskType = task.GetType(); - - // If the types don't match, we have a problem. It means that our AppDomain was able to load - // a task assembly using Load, and loaded a different one. I don't see any other choice than - // to fail here. - if (taskType != TaskClass.Type) - { - loggingServices.LogError(buildEventContext, CreateBuildEventFileInfoForTask(), - "ConflictingTaskAssembly", TaskClass.Assembly.AssemblyFile, taskType.Assembly.Location); - - task = null; - } - } - else - { - if (taskAppDomain == null) - { - // perf improvement for the same appdomain case - we already have the type object - // and don't want to go through reflection to recreate it from the name. - task = (ITask)Activator.CreateInstance(TaskClass.Type); - } - else - { - task = (ITask)taskAppDomain.CreateInstanceAndUnwrap(TaskClass.Type.Assembly.FullName, TaskClass.Type.FullName); - } - } - } - catch (InvalidCastException e) - { - loggingServices.LogError(buildEventContext, CreateBuildEventFileInfoForTask(), - "TaskInstantiationFailureErrorInvalidCast", TaskName, TaskClass.Assembly.ToString(), e.Message); - } - catch (TargetInvocationException e) - { - // Exception thrown by the called code itself - // Log the stack, so the task vendor can fix their code - loggingServices.LogError(buildEventContext, CreateBuildEventFileInfoForTask(), - "TaskInstantiationFailureError", TaskName, TaskClass.Assembly.ToString(), Environment.NewLine + e.InnerException.ToString()); - } - catch (Exception e) // Catching Exception, but rethrowing unless it's a well-known exception. - { - if (ExceptionHandling.NotExpectedReflectionException(e)) - { - throw; - } - - // Reflection related exception - loggingServices.LogError(buildEventContext, CreateBuildEventFileInfoForTask(), - "TaskInstantiationFailureError", TaskName, TaskClass.Assembly.ToString(), e.Message); - } - - return task; - } - - /// - /// Given an instantiated task, this method initializes it, and sets all the task parameters (which are defined as - /// properties of the task class). - /// - /// - /// This method is internal for unit-testing purposes only. - /// - /// true, if successful - internal bool InitializeTask(ITask task, ItemBucket bucket, EngineProxy engineProxy) - { - try - { - task.BuildEngine = engineProxy; - task.HostObject = hostObject; - } - // if a logger has failed, abort immediately - catch (LoggerException) - { - // Polite logger failure - throw; - } - catch (InternalLoggerException) - { - // Logger threw arbitrary exception - throw; - } - // handle any exception thrown by the task during initialization - catch (Exception e) - { - // NOTE: We catch ALL exceptions here, to attempt to completely isolate the Engine - // from failures in the task. Probably we should try to avoid catching truly fatal exceptions, - // e.g., StackOverflowException - - loggingServices.LogFatalTaskError(buildEventContext, - e, - // Display the task's exception stack. - // Log the task line number, whatever the value of ContinueOnError; - // because InitializeTask failure will be a hard error anyway. - CreateBuildEventFileInfoForTask(), - TaskName); - - return false; - } - - bool taskInitialized = InitializeTaskParameters(task, bucket); - - return taskInitialized; - } - - /// - /// Sets all the task parameters, using the provided bucket's lookup. - /// - private bool InitializeTaskParameters(ITask task, ItemBucket bucket) - { - bool taskInitialized = true; - - // Get the properties that exist on this task. We need to gather all of the ones that are marked - // "required" so that we can keep track of whether or not they all get set. - Dictionary setParameters = new Dictionary(StringComparer.OrdinalIgnoreCase); - Dictionary requiredParameters = GetNamesOfPropertiesWithRequiredAttribute(); - - // look through all the attributes of the task element - foreach (XmlAttribute taskAttribute in taskNode.Attributes) - { - // skip the known "special" task attributes - if (!XMakeAttributes.IsSpecialTaskAttribute(taskAttribute.Name)) - { - bool taskParameterSet = false; // Did we actually call the setter on this task parameter? - - bool success = InitializeTaskParameter(task, taskAttribute, requiredParameters.ContainsKey(taskAttribute.Name), bucket, out taskParameterSet); - - if (!success) - { - // stop processing any more attributes - taskInitialized = false; - break; - } - else if (taskParameterSet) - { - // Keep track that we've set a value for this property. Note that this will - // keep track of non-required properties as well, but that's okay. We just - // to check at the end that there are no values in the requiredParameters - // table that aren't also in the setParameters table. - setParameters[taskAttribute.Name] = String.Empty; - } - } - } - - if (taskInitialized) - { - // See if any required properties were not set - foreach (KeyValuePair requiredParameter in requiredParameters) - { - ProjectErrorUtilities.VerifyThrowInvalidProject(setParameters.ContainsKey(requiredParameter.Key), - taskNode, - "RequiredPropertyNotSetError", - TaskName, requiredParameter.Key); - } - } - return taskInitialized; - } - - /// - /// Finds all the task properties that are required. - /// Returns them as keys in a dictionary. - /// - private Dictionary GetNamesOfPropertiesWithRequiredAttribute() - { - Dictionary requiredParameters = null; - - try - { - requiredParameters = TaskClass.GetNamesOfPropertiesWithRequiredAttribute(); - } - catch (Exception e) // Catching Exception, but rethrowing unless it's a well-known exception. - { - if (ExceptionHandling.NotExpectedReflectionException(e)) - { - throw; - } - - // Reflection related exception - loggingServices.LogError(buildEventContext, CreateBuildEventFileInfoForTask(), "AttributeTypeLoadError", TaskName, e.Message); - - ProjectErrorUtilities.VerifyThrowInvalidProject(false, taskNode, "TaskDeclarationOrUsageError", TaskName); - } - - return requiredParameters; - } - - /// - /// Execute a task object for a given bucket. - /// - /// - /// - /// - /// - /// Whether the task returned true from Execute - /// true if task executed successfully (possibly failed but continueOnError=true) - private bool ExecuteInstantiatedTask(EngineProxy engineProxy, ItemBucket bucket, TaskExecutionMode howToExecuteTask, ITask task, out bool taskResult) - { - UpdateContinueOnError(bucket, engineProxy); - - taskResult = false; - bool taskExecutedSuccessfully = true; - - if (!InitializeTask(task, bucket, engineProxy)) - { - // The task cannot be initialized. - ProjectErrorUtilities.VerifyThrowInvalidProject(false, taskNode, "TaskParametersError", TaskName, String.Empty); - } - else - { - bool taskReturned = false; - - try - { - taskResult = task.Execute(); - taskReturned = true; - } - // if a logger has failed, abort immediately - catch (LoggerException) - { - // Polite logger failure - throw; - } - catch (InternalLoggerException) - { - // Logger threw arbitrary exception - throw; - } - // handle any exception thrown by the task during execution - // NOTE: We catch ALL exceptions here, to attempt to completely isolate the Engine - // from failures in the task. Probably we should try to avoid catching truly fatal exceptions, - // e.g., StackOverflowException - catch (Exception e) - { - if (continueOnError) - { - loggingServices.LogTaskWarningFromException(buildEventContext, e, - // Don't try and log the line/column number for this error if - // ContinueOnError=true, because it's too expensive to do so, - // and this error may be fairly common and expected. - new BuildEventFileInfo(projectFileOfTaskNode), TaskName); - - // Log a message explaining why we converted the previous error into a warning. - loggingServices.LogComment(buildEventContext, MessageImportance.Normal, "ErrorConvertedIntoWarning"); - } - else - { - loggingServices.LogFatalTaskError(buildEventContext, e, - CreateBuildEventFileInfoForTask(), - TaskName); - } - } - - // If the task returned attempt to gather its outputs. If gathering outputs fails set the taskResults - // to false - if (taskReturned) - { - taskResult = GatherTaskOutputs(howToExecuteTask, task, bucket) && taskResult; - } - - // If the taskResults are false look at ContinueOnError. If ContinueOnError=false (default) - // mark the taskExecutedSuccessfully=false. Otherwise let the task succeed but log a normal - // pri message that says this task is continuing because ContinueOnError=true - if (!taskResult) - { - if (!continueOnError) - { - taskExecutedSuccessfully = false; - } - else - { - loggingServices.LogComment(buildEventContext, MessageImportance.Normal, - "TaskContinuedDueToContinueOnError", - "ContinueOnError", TaskName, "true"); - } - } - } - - return taskExecutedSuccessfully; - } - - /// - /// Gathers task outputs in two ways: - /// 1) Given an instantiated task that has finished executing, it extracts the outputs using .NET reflection. - /// 2) Otherwise, it parses the task's output specifications and (statically) infers the outputs. - /// - /// - /// - /// - /// true, if successful - private bool GatherTaskOutputs(TaskExecutionMode howToExecuteTask, ITask task, ItemBucket bucket) - { - bool gatheredTaskOutputsSuccessfully = true; - - foreach (TaskOutput taskOutputSpecification in - GetTaskOutputSpecifications(true)) - { - // if the task's outputs are supposed to be gathered - if ( - (taskOutputSpecification.ConditionAttribute == null) - || - Utilities.EvaluateCondition(taskOutputSpecification.ConditionAttribute.Value, - taskOutputSpecification.ConditionAttribute, - bucket.Expander, null, ParserOptions.AllowAll, loggingServices, buildEventContext) - ) - { - ErrorUtilities.VerifyThrow(taskOutputSpecification.TaskParameterAttribute != null, - "Invalid task output specification -- this should have been caught when the XML was parsed."); - ErrorUtilities.VerifyThrow(taskOutputSpecification.TaskParameterAttribute.Value.Length > 0, - "Invalid task output specification -- this should have been caught when the XML was parsed."); - - // expand all embedded properties, item metadata and item vectors in the task parameter name - string taskParameterName = bucket.Expander.ExpandAllIntoString(taskOutputSpecification.TaskParameterAttribute); - - ProjectErrorUtilities.VerifyThrowInvalidProject(taskParameterName.Length > 0, taskOutputSpecification.TaskParameterAttribute, - "InvalidEvaluatedAttributeValue", taskParameterName, taskOutputSpecification.TaskParameterAttribute.Value, XMakeAttributes.taskParameter, XMakeElements.output); - - string itemName = null; - string propertyName = null; - - // check where the outputs are going -- into a vector, or a property? - if (taskOutputSpecification.IsItemVector) - { - ErrorUtilities.VerifyThrow(taskOutputSpecification.ItemNameAttribute != null, - "How can it be an output item if the item name is null? This should have been caught when the XML was parsed."); - - ErrorUtilities.VerifyThrow(taskOutputSpecification.ItemNameAttribute.Value.Length > 0, - "Invalid task output specification -- this should have been caught when the XML was parsed."); - - // expand all embedded properties, item metadata and item vectors in the item type name - itemName = bucket.Expander.ExpandAllIntoString(taskOutputSpecification.ItemNameAttribute); - - ProjectErrorUtilities.VerifyThrowInvalidProject(itemName.Length > 0, taskOutputSpecification.ItemNameAttribute, - "InvalidEvaluatedAttributeValue", itemName, taskOutputSpecification.ItemNameAttribute.Value, XMakeAttributes.itemName, XMakeElements.output); - } - else - { - ErrorUtilities.VerifyThrow(taskOutputSpecification.IsProperty, - "Invalid task output specification -- this should have been caught when the XML was parsed."); - - ErrorUtilities.VerifyThrow(taskOutputSpecification.PropertyNameAttribute != null, - "How can it be an output property if the property name is null? This should have been caught when the XML was parsed."); - - ErrorUtilities.VerifyThrow(taskOutputSpecification.PropertyNameAttribute.Value.Length > 0, - "Invalid task output specification -- this should have been caught when the XML was parsed."); - - // expand all embedded properties, item metadata and item vectors in the property name - propertyName = bucket.Expander.ExpandAllIntoString(taskOutputSpecification.PropertyNameAttribute); - - ProjectErrorUtilities.VerifyThrowInvalidProject(propertyName.Length > 0, taskOutputSpecification.PropertyNameAttribute, - "InvalidEvaluatedAttributeValue", propertyName, taskOutputSpecification.PropertyNameAttribute.Value, XMakeAttributes.propertyName, XMakeElements.output); - } - - // if we're gathering outputs by .NET reflection - if (howToExecuteTask == TaskExecutionMode.ExecuteTaskAndGatherOutputs) - { - gatheredTaskOutputsSuccessfully = GatherGeneratedTaskOutputs(bucket.Lookup, taskOutputSpecification, taskParameterName, itemName, propertyName, task); - } - // if we're inferring outputs based on information in the task and tags - else - { - Debug.Assert(howToExecuteTask == TaskExecutionMode.InferOutputsOnly); - - InferTaskOutputs(bucket.Lookup, taskOutputSpecification, taskParameterName, itemName, propertyName, bucket); - } - } - - if (!gatheredTaskOutputsSuccessfully) - { - break; - } - } - - return gatheredTaskOutputsSuccessfully; - } - - /// - /// Uses the given task output specification to grab the task's outputs using .NET reflection. - /// - /// - /// This method is "internal" for unit-testing purposes only. - /// - /// - /// - /// can be null - /// can be null - /// - /// true, if successful - internal bool GatherGeneratedTaskOutputs - ( - Lookup lookup, - TaskOutput taskOutputSpecification, - string taskParameterName, - string itemName, - string propertyName, - ITask task) - { - ErrorUtilities.VerifyThrow(task != null, "Need instantiated task to retrieve outputs from."); - - bool gatheredGeneratedOutputsSuccessfully = true; - - try - { - PropertyInfo parameter = TaskClass.GetProperty(taskParameterName); - - // flag an error if we find a parameter that has no .NET property equivalent - ProjectErrorUtilities.VerifyThrowInvalidProject(parameter != null, - taskOutputSpecification.TaskParameterAttribute, - "UnexpectedTaskOutputAttribute", taskParameterName, TaskName); - - // output parameters must have their corresponding .NET properties marked with the Output attribute - ProjectErrorUtilities.VerifyThrowInvalidProject(TaskClass.GetNamesOfPropertiesWithOutputAttribute().ContainsKey(taskParameterName), - taskOutputSpecification.TaskParameterAttribute, - "UnmarkedOutputTaskParameter", parameter.Name, TaskName); - - // grab the outputs from the task's designated output parameter (which is a .NET property) - object outputs = parameter.GetValue(task, null); - Type type = parameter.PropertyType; - - // don't use the C# "is" operator as it always returns false if the object is null - if ( - typeof(ITaskItem[]).IsAssignableFrom(type) || /* ITaskItem array or derived type, or */ - typeof(ITaskItem).IsAssignableFrom(type) /* ITaskItem or derived type */ - ) - { - GatherTaskItemOutputs(lookup, taskOutputSpecification, itemName, propertyName, outputs); - } - // don't use the C# "is" operator as it always returns false if the object is null - else if ( - (type.IsArray && type.GetElementType().IsValueType) || /* array of value types, or */ - (type == typeof(string[])) || /* string array, or */ - (type.IsValueType) || /* value type, or */ - (type == typeof(string)) /* string */ - ) - { - GatherArrayStringAndValueOutputs(lookup, taskOutputSpecification, itemName, propertyName, parameter, outputs); - } - else - { - ProjectErrorUtilities.VerifyThrowInvalidProject(false, taskOutputSpecification.TaskParameterAttribute, - "UnsupportedTaskParameterTypeError", parameter.PropertyType, parameter.Name, TaskName); - } - } - // handle invalid TaskItems in task outputs - catch (InvalidOperationException e) - { - loggingServices.LogError(buildEventContext, Utilities.CreateBuildEventFileInfo(taskOutputSpecification.TaskParameterAttribute, projectFileOfTaskNode), - "InvalidTaskItemsInTaskOutputs", TaskName, taskParameterName, e.Message); - - gatheredGeneratedOutputsSuccessfully = false; - } - // handle any exception thrown by the task's getter - catch (TargetInvocationException e) - { - // Exception thrown by the called code itself - // Log the stack, so the task vendor can fix their code - // Log the task line number, whatever the value of ContinueOnError; - // because this will be a hard error anyway. - loggingServices.LogFatalTaskError(buildEventContext, e.InnerException, - CreateBuildEventFileInfoForTask(), - TaskName); - - // We do not recover from a task exception while getting outputs, - // so do not merely set gatheredGeneratedOutputsSuccessfully = false; here - - ProjectErrorUtilities.VerifyThrowInvalidProject(false, taskOutputSpecification.TaskParameterAttribute, - "FailedToRetrieveTaskOutputs", TaskName, taskParameterName, e.InnerException.Message); - } - catch (Exception e) // Catching Exception, but rethrowing unless it's a well-known exception. - { - if (ExceptionHandling.NotExpectedReflectionException(e)) - { - throw; - } - - ProjectErrorUtilities.VerifyThrowInvalidProject(false, taskOutputSpecification.TaskParameterAttribute, - "FailedToRetrieveTaskOutputs", TaskName, taskParameterName, e.Message); - } - - return gatheredGeneratedOutputsSuccessfully; - } - - private void GatherArrayStringAndValueOutputs(Lookup lookup, TaskOutput taskOutputSpecification, string itemName, string propertyName, PropertyInfo parameter, object outputs) - { - // if the task has generated outputs (if it didn't, don't do anything) - if (outputs != null) - { - Array convertibleOutputs = (parameter.PropertyType.IsArray) - ? (Array)outputs - : new object[] { outputs }; - - if (taskOutputSpecification.IsItemVector) - { - ErrorUtilities.VerifyThrow(!string.IsNullOrEmpty(itemName), "Need item type."); - - // to store the outputs as items, use the string representations of the outputs as item-specs - foreach (object output in convertibleOutputs) - { - // if individual outputs in the array are null, ignore them - if (output != null) - { - string stringValueFromTask = (string)Convert.ChangeType(output, typeof(string), CultureInfo.InvariantCulture); - - // attempting to put an empty string into an item is a no-op (bug #444501). - if (stringValueFromTask.Length > 0) - { - lookup.AddNewItem(new BuildItem(itemName, EscapingUtilities.Escape(stringValueFromTask))); - } - } - } - } - else - { - Debug.Assert(taskOutputSpecification.IsProperty); - ErrorUtilities.VerifyThrow(!string.IsNullOrEmpty(propertyName), "Need property name."); - - // to store an object array in a property, join all the string representations of the objects with - // semi-colons to make the property value - StringBuilder joinedOutputs = new StringBuilder(); - - foreach (object output in convertibleOutputs) - { - // if individual outputs in the array are null, ignore them - if (output != null) - { - if (joinedOutputs.Length > 0) - { - joinedOutputs.Append(';'); - } - - string stringValueFromTask = (string)Convert.ChangeType(output, typeof(string), CultureInfo.InvariantCulture); - joinedOutputs.Append(EscapingUtilities.Escape(stringValueFromTask)); - } - } - - lookup.SetProperty(new BuildProperty(propertyName, joinedOutputs.ToString(), PropertyType.OutputProperty)); - } - } - } - - private void GatherTaskItemOutputs(Lookup lookup, TaskOutput taskOutputSpecification, string itemName, string propertyName, object outputs) - { - // if the task has generated outputs (if it didn't, don't do anything) - if (outputs != null) - { - ITaskItem[] taskItemOutputs = (outputs is ITaskItem[]) - ? (ITaskItem[])outputs - : new ITaskItem[] { (ITaskItem)outputs }; - - if (taskOutputSpecification.IsItemVector) - { - ErrorUtilities.VerifyThrow(!string.IsNullOrEmpty(itemName), "Need item type."); - - foreach (ITaskItem output in taskItemOutputs) - { - // if individual items in the array are null, ignore them - if (output != null) - { - lookup.AddNewItem(new BuildItem(itemName, output)); - } - } - } - else - { - Debug.Assert(taskOutputSpecification.IsProperty); - ErrorUtilities.VerifyThrow(!string.IsNullOrEmpty(propertyName), "Need property name."); - - // to store an ITaskItem array in a property, join all the item-specs with semi-colons to make the - // property value, and ignore/discard the attributes on the ITaskItems - StringBuilder joinedOutputs = new StringBuilder(); - - foreach (ITaskItem output in taskItemOutputs) - { - // if individual items in the array are null, ignore them - if (output != null) - { - if (joinedOutputs.Length > 0) - { - joinedOutputs.Append(';'); - } - - joinedOutputs.Append(EscapingUtilities.Escape(output.ItemSpec)); - } - } - - lookup.SetProperty(new BuildProperty(propertyName, joinedOutputs.ToString(), PropertyType.OutputProperty)); - } - } - } - - /// - /// Uses the given task output specification to (statically) infer the task's outputs. - /// - /// - /// - /// can be null - /// can be null - /// - private void InferTaskOutputs - ( - Lookup lookup, - TaskOutput taskOutputSpecification, - string taskParameterName, - string itemName, - string propertyName, - ItemBucket bucket - ) - { - // if the task has a value set for the output parameter, expand all embedded properties and item metadata in it - XmlAttribute taskParameterAttribute = null; - - // Lookup attribute name needs to be case-insensitive - // DevDiv bugs: 33981 - foreach (XmlAttribute taskNodeAttribute in taskNode.Attributes) - { - if (String.Equals(taskNodeAttribute.Name, taskParameterName, StringComparison.OrdinalIgnoreCase)) - { - taskParameterAttribute = taskNodeAttribute; - break; - } - } - - if (taskParameterAttribute != null) - { - if (taskOutputSpecification.IsItemVector) - { - // This is an output item. - ErrorUtilities.VerifyThrow(!string.IsNullOrEmpty(itemName), "Need item type."); - - // Expand only with properties first, so that expressions like Include="@(foo)" will transfer the metadata of the "foo" items as well, not just their item specs. - Expander propertyAndMetadataExpander = new Expander(bucket.Expander, ExpanderOptions.ExpandPropertiesAndMetadata); - List outputItemSpecs = propertyAndMetadataExpander.ExpandAllIntoStringListLeaveEscaped(taskParameterAttribute); - - foreach (string outputItemSpec in outputItemSpecs) - { - BuildItemGroup items = bucket.Expander.ExpandSingleItemListExpressionIntoItemsLeaveEscaped(outputItemSpec, taskParameterAttribute); - - // if the output item-spec is an item vector, get the items in it - if (items != null) - { - foreach (BuildItem item in items) - { - // we want to preserve the attributes on the item - BuildItem clonedItem = item.VirtualClone(); - // but we do need to change the item type - clonedItem.Name = itemName; - - lookup.AddNewItem(clonedItem); - } - } - else - { - // if the output item-spec is not an item vector, accept it as-is - lookup.AddNewItem(new BuildItem(itemName, outputItemSpec)); - } - } - } - else - { - // This is an output property. - Debug.Assert(taskOutputSpecification.IsProperty); - ErrorUtilities.VerifyThrow(!string.IsNullOrEmpty(propertyName), "Need property name."); - - string taskParameterValue = bucket.Expander.ExpandAllIntoString(taskParameterAttribute); - - if (taskParameterValue.Length > 0) - { - lookup.SetProperty(new BuildProperty(propertyName, taskParameterValue, PropertyType.OutputProperty)); - } - } - } - } - - /// - /// Parses the task element for its output specifications, which are declared using <Output> tags. - /// - private List GetTaskOutputSpecifications(bool showWarnings) - { - List taskOutputSpecifications = new List(); - - foreach (XmlNode childNode in taskNode.ChildNodes) - { - ProjectErrorUtilities.VerifyThrowInvalidProject(XMakeElements.IsValidTaskChildNode(childNode), childNode, - "UnrecognizedChildElement", childNode.Name, TaskName); - - if (childNode.Name == XMakeElements.output) - { - TaskOutput taskOutputSpecification = new TaskOutput((XmlElement)childNode); - - // The "ItemName" attribute of the tag is usually just a straight - // string representing the item name. If it contains any "@" signs, the - // project author most likely made a mistake, and so we throw a warning here. - XmlAttribute itemNameAttribute = taskOutputSpecification.ItemNameAttribute; - if (showWarnings && taskOutputSpecification.IsItemVector && - (-1 != itemNameAttribute.Value.IndexOf('@'))) - { - loggingServices.LogWarning(buildEventContext, Utilities.CreateBuildEventFileInfo(itemNameAttribute, - projectFileOfTaskNode), "AtSignInTaskOutputItemName", itemNameAttribute.Value); - } - - // The "PropertyName" attribute of the tag is usually just a straight - // string representing the property name. If it contains any "$" signs, the - // project author most likely made a mistake, and so we throw a warning here. - XmlAttribute propertyNameAttribute = taskOutputSpecification.PropertyNameAttribute; - if (showWarnings && taskOutputSpecification.IsProperty && - (-1 != propertyNameAttribute.Value.IndexOf('$'))) - { - loggingServices.LogWarning(buildEventContext, Utilities.CreateBuildEventFileInfo(propertyNameAttribute, - projectFileOfTaskNode), "DollarSignInTaskOutputPropertyName", propertyNameAttribute.Value); - } - - taskOutputSpecifications.Add(taskOutputSpecification); - } - } - - return taskOutputSpecifications; - } - - /// - /// Given an instantiated task, this helper method sets the specified parameter based on its type. - /// - /// true, if successful - private bool InitializeTaskParameter - ( - ITask task, - XmlAttribute taskParameterAttribute, - bool isRequired, - ItemBucket bucket, - out bool taskParameterSet - ) - { - bool success = false; - taskParameterSet = false; - - try - { - string parameterName = taskParameterAttribute.Name; - string parameterValue = taskParameterAttribute.Value; - - try - { - // check if the task has a .NET property corresponding to the parameter - PropertyInfo parameter = TaskClass.GetProperty(parameterName); - - if (parameter != null) - { - ProjectErrorUtilities.VerifyThrowInvalidProject(parameter.CanWrite, taskParameterAttribute, - "SetAccessorNotAvailableOnTaskParameter", parameterName, TaskName); - - Type parameterType = parameter.PropertyType; - - // try to set the parameter - if (parameterType.IsValueType || - (parameterType == typeof(string)) || - (parameterType == typeof(ITaskItem))) - { - success = InitializeTaskScalarParameter(task, taskParameterAttribute, - parameter, parameterType, parameterValue, bucket, out taskParameterSet); - } - else if ((parameterType.IsArray && parameterType.GetElementType().IsValueType) || - (parameterType == typeof(string[])) || - (parameterType == typeof(ITaskItem[]))) - { - success = InitializeTaskVectorParameter(task, taskParameterAttribute, isRequired, - parameter, parameterType, parameterValue, bucket, out taskParameterSet); - } - else - { - loggingServices.LogError(buildEventContext, Utilities.CreateBuildEventFileInfo(taskParameterAttribute, projectFileOfTaskNode), - "UnsupportedTaskParameterTypeError", parameterType, parameter.Name, TaskName); - } - - if (!success) - { - // flag an error if the parameter could not be set - loggingServices.LogError(buildEventContext, Utilities.CreateBuildEventFileInfo(taskParameterAttribute, projectFileOfTaskNode), - "InvalidTaskAttributeError", parameterName, parameterValue, TaskName); - } - } - else - { - // flag an error if we find a parameter that has no .NET property equivalent - loggingServices.LogError(buildEventContext, Utilities.CreateBuildEventFileInfo(taskParameterAttribute, projectFileOfTaskNode), - "UnexpectedTaskAttribute", parameterName, TaskName); - } - } - catch (AmbiguousMatchException) - { - loggingServices.LogError(buildEventContext, Utilities.CreateBuildEventFileInfo(taskParameterAttribute, projectFileOfTaskNode), - "AmbiguousTaskParameterError", TaskName, parameterName); - } - } - catch (Exception e) // Catching Exception, but rethrowing unless it's a well-known exception. - { - if (ExceptionHandling.NotExpectedReflectionException(e)) - { - throw; - } - - // Reflection related exception - loggingServices.LogError(buildEventContext, CreateBuildEventFileInfoForTask(), "TaskParametersError", TaskName, e.Message); - - success = false; - } - - return success; - } - - /// - /// Given an instantiated task, this helper method sets the specified scalar parameter based on its type. - /// - /// This is "internal" only for the purpose of unit testing. Otherwise, it should be "private". - /// true, if successful - internal bool InitializeTaskScalarParameter - ( - ITask task, - XmlAttribute taskParameterAttribute, - PropertyInfo parameter, - Type parameterType, - string parameterValue, - ItemBucket bucket, - out bool taskParameterSet - ) - { - taskParameterSet = false; - - bool success = false; - - try - { - if (parameterType == typeof(ITaskItem)) - { - // We don't know how many items we're going to end up with, but we'll - // keep adding them to this arraylist as we find them. - List finalTaskItems = bucket.Expander.ExpandAllIntoTaskItems(parameterValue, taskParameterAttribute); - - if (finalTaskItems.Count == 0) - { - success = true; - } - else - { - if (finalTaskItems.Count != 1) - { - // We only allow a single item to be passed into a parameter of ITaskItem. - - // Some of the computation (expansion) here is expensive, so don't make the above - // "if" statement directly part of the first param to VerifyThrowInvalidProject. - ProjectErrorUtilities.VerifyThrowInvalidProject(false, - taskParameterAttribute, - "CannotPassMultipleItemsIntoScalarParameter", bucket.Expander.ExpandAllIntoString(parameterValue, taskParameterAttribute), - parameter.Name, parameterType, TaskName); - } - - success = SetTaskParameter(task, parameter, (ITaskItem)finalTaskItems[0]); - taskParameterSet = true; - } - } - else - { - // Expand out all the metadata, properties, and item vectors in the string. - string expandedParameterValue = bucket.Expander.ExpandAllIntoString(parameterValue, taskParameterAttribute); - - if (expandedParameterValue.Length == 0) - { - success = true; - } - // Convert the string to the appropriate datatype, and set the task's parameter. - else if (parameterType == typeof(bool)) - { - success = SetTaskParameter(task, parameter, ConversionUtilities.ConvertStringToBool(expandedParameterValue)); - taskParameterSet = true; - } - else if (parameterType == typeof(string)) - { - success = SetTaskParameter(task, parameter, expandedParameterValue); - taskParameterSet = true; - } - else - { - success = SetTaskParameter(task, parameter, Convert.ChangeType(expandedParameterValue, parameterType, CultureInfo.InvariantCulture)); - taskParameterSet = true; - } - } - } - // handle invalid type - catch (InvalidCastException) - { - ProjectErrorUtilities.VerifyThrowInvalidProject(false, taskParameterAttribute, - "InvalidTaskParameterValueError", bucket.Expander.ExpandAllIntoString(parameterValue, taskParameterAttribute), parameter.Name, parameterType, TaskName); - } - // handle argument exception (thrown by ConvertStringToBool) - catch (ArgumentException) - { - ProjectErrorUtilities.VerifyThrowInvalidProject(false, taskParameterAttribute, - "InvalidTaskParameterValueError", bucket.Expander.ExpandAllIntoString(parameterValue, taskParameterAttribute), parameter.Name, parameterType, TaskName); - } - // handle bad string representation of a type - catch (FormatException) - { - ProjectErrorUtilities.VerifyThrowInvalidProject(false, taskParameterAttribute, - "InvalidTaskParameterValueError", bucket.Expander.ExpandAllIntoString(parameterValue, taskParameterAttribute), parameter.Name, parameterType, TaskName); - } - // handle overflow when converting string representation of a numerical type - catch (OverflowException) - { - ProjectErrorUtilities.VerifyThrowInvalidProject(false, taskParameterAttribute, - "InvalidTaskParameterValueError", bucket.Expander.ExpandAllIntoString(parameterValue, taskParameterAttribute), parameter.Name, parameterType, TaskName); - } - - return success; - } - - /// - /// Given an instantiated task, this helper method sets the specified vector parameter. Vector parameters can be composed - /// of multiple item vectors. The semicolon is the only separator allowed, and white space around the semicolon is - /// ignored. Any item separator strings are not allowed, and embedded item vectors are not allowed. - /// - /// This method is marked "internal" for unit-testing purposes only -- it should be "private" ideally. - /// - /// If @(CPPFiles) is a vector for the files a.cpp and b.cpp, and @(IDLFiles) is a vector for the files a.idl and b.idl: - /// - /// "@(CPPFiles)" converts to { a.cpp, b.cpp } - /// - /// "@(CPPFiles); c.cpp; @(IDLFiles); c.idl" converts to { a.cpp, b.cpp, c.cpp, a.idl, b.idl, c.idl } - /// - /// "@(CPPFiles,';')" converts to <error> - /// - /// "xxx@(CPPFiles)xxx" converts to <error> - /// - /// true, if successful - internal bool InitializeTaskVectorParameter - ( - ITask task, - XmlAttribute taskParameterAttribute, - bool isRequired, - PropertyInfo parameter, - Type parameterType, - string parameterValue, - ItemBucket bucket, - out bool taskParameterSet - ) - { - ErrorUtilities.VerifyThrow(parameterValue != null, - "Didn't expect null parameterValue in InitializeTaskVectorParameter"); - - taskParameterSet = false; - - bool success = false; - - ArrayList finalTaskInputs = new ArrayList(); - - List finalTaskItems = bucket.Expander.ExpandAllIntoTaskItems(parameterValue, taskParameterAttribute); - - int i = 0; - - try - { - // If the task parameter is not a ITaskItem[], then we need to convert - // all the TaskItem's in our arraylist to the appropriate datatype. - if (parameterType != typeof(ITaskItem[])) - { - // Loop through all the TaskItems in our arraylist, and convert them. - for (i = 0; i < finalTaskItems.Count; i++) - { - if (parameterType == typeof(string[])) - { - finalTaskInputs.Add(finalTaskItems[i].ItemSpec); - } - else if (parameterType == typeof(bool[])) - { - finalTaskInputs.Add(ConversionUtilities.ConvertStringToBool(finalTaskItems[i].ItemSpec)); - } - else - { - finalTaskInputs.Add(Convert.ChangeType(finalTaskItems[i].ItemSpec, - parameterType.GetElementType(), CultureInfo.InvariantCulture)); - } - } - } - else - { - finalTaskInputs.AddRange(finalTaskItems); - } - - // If there were no items, don't change the parameter's value. EXCEPT if it's marked as a required - // parameter, in which case we made an explicit decision to pass in an empty array. This is - // to avoid project authors having to add Conditions on all their tasks to avoid calling them - // when a particular item list is empty. This way, we just call the task with an empty list, - // the task will loop over an empty list, and return quickly. - if ((finalTaskInputs.Count > 0) || isRequired) - { - // Send the array into the task parameter. - success = SetTaskParameter(task, parameter, finalTaskInputs.ToArray(parameterType.GetElementType())); - taskParameterSet = true; - } - else - { - success = true; - } - } - // Handle invalid type. - catch (InvalidCastException) - { - ProjectErrorUtilities.VerifyThrowInvalidProject(false, taskParameterAttribute, - "InvalidTaskParameterValueError", finalTaskItems[i].ItemSpec, parameter.Name, parameterType, TaskName); - } - // Handle argument exception (thrown by ConvertStringToBool) - catch (ArgumentException) - { - ProjectErrorUtilities.VerifyThrowInvalidProject(false, taskParameterAttribute, - "InvalidTaskParameterValueError", finalTaskItems[i].ItemSpec, parameter.Name, parameterType, TaskName); - } - // Handle bad string representation of a type. - catch (FormatException) - { - ProjectErrorUtilities.VerifyThrowInvalidProject(false, taskParameterAttribute, - "InvalidTaskParameterValueError", finalTaskItems[i].ItemSpec, parameter.Name, parameterType, TaskName); - } - // Handle overflow when converting string representation of a numerical type. - catch (OverflowException) - { - ProjectErrorUtilities.VerifyThrowInvalidProject(false, taskParameterAttribute, - "InvalidTaskParameterValueError", finalTaskItems[i].ItemSpec, parameter.Name, parameterType, TaskName); - } - - return success; - } - - /// - /// Given an instantiated task, this helper method sets the specified parameter. - /// - /// true, if successful - private bool SetTaskParameter - ( - ITask task, - PropertyInfo parameter, - object parameterValue - ) - { - bool success = false; - - try - { - parameter.SetValue(task, parameterValue, null); - success = true; - } - // if a logger has failed, abort immediately - catch (LoggerException) - { - // Polite logger failure - throw; - } - catch (InternalLoggerException) - { - // Logger threw arbitrary exception - throw; - } - // handle any exception thrown by the task's setter itself - catch (TargetInvocationException e) - { - // At this point, the interesting stack is the internal exception. - // Log the task line number, whatever the value of ContinueOnError; - // because this will be a hard error anyway. - - // Exception thrown by the called code itself - // Log the stack, so the task vendor can fix their code - loggingServices.LogFatalTaskError(buildEventContext, e.InnerException, - CreateBuildEventFileInfoForTask(), - TaskName); - } - catch (Exception e) // Catching Exception, but rethrowing unless it's a well-known exception. - { - if (ExceptionHandling.NotExpectedReflectionException(e)) - { - throw; - } - - loggingServices.LogFatalTaskError(buildEventContext, e, - CreateBuildEventFileInfoForTask(), - TaskName); - } - - return success; - } - - /// - /// This function correctly computes the line/column number of the task node - /// in the project file (or .TARGETS file) that called it. The XmlNode available - /// to the task engine lacks this information so we call back into the build engine - /// to obtain it. - /// - private BuildEventFileInfo CreateBuildEventFileInfoForTask() - { - int lineNumber; - int columnNumber; - parentModule.GetLineColumnOfXmlNode(handleId, out lineNumber, out columnNumber); - return new BuildEventFileInfo(projectFileOfTaskNode, lineNumber, columnNumber); - } - - #endregion - - #region Member data - - // the XML backing the task - private XmlElement taskNode; - // the .NET class that defines the task - private LoadedType taskClass; - // The optional host object for this task. - private ITaskHost hostObject; - // the logging services provider - private EngineLoggingServices loggingServices; - // the id for the proxy data - private int handleId; - // event contextual information where the event is fired from - private BuildEventContext buildEventContext; - // The node on which this task engine is running. - private TaskExecutionModule parentModule; - // indicates whether to ignore task execution failures - private bool continueOnError; - // the conditional expression that controls task execution - private XmlAttribute conditionAttribute; - // the project file that the task XML was defined in -- this file could be different from the file of this task's parent - // project if the task was defined in an imported project file, or if the task only exists in-memory - private string projectFileOfTaskNode; - // Full name of the project file containing the task - private string parentProjectFullFileName; - // Hash to contain a list of properties from all of the batches - private Hashtable lookupHash = null; - - private TaskEngineAssemblyResolver resolver; - - #endregion - } -} diff --git a/src/Deprecated/Engine/Engine/TaskEngineAssemblyResolver.cs b/src/Deprecated/Engine/Engine/TaskEngineAssemblyResolver.cs deleted file mode 100644 index 47cda57c85a..00000000000 --- a/src/Deprecated/Engine/Engine/TaskEngineAssemblyResolver.cs +++ /dev/null @@ -1,134 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.IO; -using System.Reflection; -using System.Diagnostics; - -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This is a helper class to install an AssemblyResolver event handler in whatever AppDomain this class is created in. - /// - /// lukaszg - internal class TaskEngineAssemblyResolver : MarshalByRefObject - { - /// - /// This public default constructor is needed so that instances of this class can be created by NDP. - /// - /// lukasz - internal TaskEngineAssemblyResolver() - { - // do nothing - } - - /// - /// Initializes the instance. - /// - /// lukaszg - /// - internal void Initialize(string taskAssemblyFileToResolve) - { - this.taskAssemblyFile = taskAssemblyFileToResolve; - } - - /// - /// Installs an AssemblyResolve handler in the current AppDomain. This class can be created in any AppDomain, - /// so it's possible to create an AppDomain, create an instance of this class in it and use this method to install - /// an event handler in that AppDomain. Since the event handler instance is stored internally, this method - /// should only be called once before a corresponding call to RemoveHandler (not that it would make sense to do - /// anything else). - /// - /// lukaszg - internal void InstallHandler() - { - Debug.Assert(eventHandler == null, "The TaskEngineAssemblyResolver.InstallHandler method should only be called once!"); - - eventHandler = new ResolveEventHandler(ResolveAssembly); - AppDomain.CurrentDomain.AssemblyResolve += eventHandler; - } - - /// - /// Removes the event handler. - /// - /// lukaszg - internal void RemoveHandler() - { - if (eventHandler != null) - { - AppDomain.CurrentDomain.AssemblyResolve -= eventHandler; - eventHandler = null; - } - else - { - Debug.Assert(false, "There is no handler to remove."); - } - } - - /// - /// This is an assembly resolution handler necessary for fixing up types instantiated in different - /// AppDomains and loaded with a Assembly.LoadFrom equivalent call. See comments in TaskEngine.ExecuteTask - /// for more details. - /// - /// - /// - /// - /// lukaszg - internal Assembly ResolveAssembly(object sender, ResolveEventArgs args) - { - // Is this our task assembly? - if (taskAssemblyFile != null) - { - if (File.Exists(taskAssemblyFile)) - { - try - { - AssemblyNameExtension taskAssemblyName = new AssemblyNameExtension(AssemblyName.GetAssemblyName(taskAssemblyFile)); - AssemblyNameExtension argAssemblyName = new AssemblyNameExtension(args.Name); - - if (taskAssemblyName.Equals(argAssemblyName)) - { - return Assembly.UnsafeLoadFrom(taskAssemblyFile); - } - } - // any problems with the task assembly? return null. - catch (FileNotFoundException) - { - return null; - } - catch (BadImageFormatException) - { - return null; - } - } - } - - // otherwise, have a nice day. - return null; - } - - /// - /// Overridden to give this class infinite lease time. Otherwise we end up with a limited - /// lease (5 minutes I think) and instances can expire if they take long time processing. - /// - [System.Security.SecurityCritical] - public override object InitializeLifetimeService() - { - // null means infinite lease time - return null; - } - - // path to the task assembly, but only if it's loaded using LoadFrom. If it's loaded with Load, this is null. - private string taskAssemblyFile = null; - - // we have to store the event handler instance in case we have to remove it - private ResolveEventHandler eventHandler = null; - } -} diff --git a/src/Deprecated/Engine/Engine/TaskExecutionContext.cs b/src/Deprecated/Engine/Engine/TaskExecutionContext.cs deleted file mode 100644 index 09c6e9f0b61..00000000000 --- a/src/Deprecated/Engine/Engine/TaskExecutionContext.cs +++ /dev/null @@ -1,177 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Xml; - -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class is used to wrap the context within which the task is executed. This includes the - /// project within which the task is being executed, the target, the task success - /// or failure and task outputs. This class is instantiated inside the engine and is directly - /// accessed outside of the engine domain. It is used for sharing data between the engine domain - /// and the TEM. - /// - internal class TaskExecutionContext : ExecutionContext - { - #region Constructors - /// - /// Default constructor for creation of task execution wrapper - /// - internal TaskExecutionContext - ( - Project parentProject, - Target parentTarget, - XmlElement taskNode, - ProjectBuildState buildContext, - int handleId, - int nodeIndex, - BuildEventContext taskBuildEventContext - ) - : base(handleId, nodeIndex, taskBuildEventContext) - { - this.parentProject = parentProject; - this.parentTarget = parentTarget; - this.taskNode = taskNode; - this.buildContext = buildContext; - this.thrownException = null; - } - #endregion - - #region Properties - - /// - /// Returns true if the task completed successfully - /// - internal bool TaskExecutedSuccessfully - { - get - { - return this.taskExecutedSuccessfully; - } - } - - /// - /// Returns the exception thrown during the task execution. The exception will either be - /// InvalidProjectException or some unexpected exception that occurred in the engine code, - /// because unexpected task exceptions are converted to logged errors. - /// - internal Exception ThrownException - { - get - { - return this.thrownException; - } - } - - /// - /// Project within which this task exists - /// - internal Project ParentProject - { - get - { - return this.parentProject; - } - } - - /// - /// Target within which this task exists - /// - internal Target ParentTarget - { - get - { - return this.parentTarget; - } - } - - /// - /// Project build context within which this task is executing - /// - internal ProjectBuildState BuildContext - { - get - { - return this.buildContext; - } - } - - /// - /// XML node for the task - /// - internal XmlElement TaskNode - { - get - { - return this.taskNode; - } - } - - /// - /// The build request that triggered the execution of this task - /// - internal BuildRequest TriggeringBuildRequest - { - get - { - BuildRequest buildRequest = buildContext.BuildRequest; - ErrorUtilities.VerifyThrow(buildRequest != null, "There must be a non-null build request"); - return buildRequest; - } - } - - #endregion - - #region Methods - /// - /// This method is used to set the outputs of the task once the execution is complete - /// - internal void SetTaskOutputs - ( - bool taskExecutedSuccessfully, - Exception thrownException, - long executionTime - ) - { - this.taskExecutedSuccessfully = taskExecutedSuccessfully; - this.thrownException = thrownException; - this.buildContext.BuildRequest.AddTaskExecutionTime(executionTime); - } - #endregion - - #region Member Data - /// - /// The project within which the target containing the task was run - /// - private Project parentProject; - /// - /// The target withing which the task is contained - /// - private Target parentTarget; - /// - /// The XML node for the task - /// - private XmlElement taskNode; - /// - /// Context within which the task execution was requested - /// - private ProjectBuildState buildContext; - - /// - /// Task outputs - /// - private bool taskExecutedSuccessfully; - private Exception thrownException; - - #endregion - } -} diff --git a/src/Deprecated/Engine/Engine/TaskExecutionModule.cs b/src/Deprecated/Engine/Engine/TaskExecutionModule.cs deleted file mode 100644 index d87825821f6..00000000000 --- a/src/Deprecated/Engine/Engine/TaskExecutionModule.cs +++ /dev/null @@ -1,685 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections; -using System.Collections.Generic; -using System.IO; -using System.Text; -using System.Threading; - -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class is responsible for representing the task execution subsystem to the engine. This - /// class can be instantiated in a different appdomain from the engine and doesn't share - /// any pointers/data with the engine(except for the argument to the functions). - /// - internal class TaskExecutionModule - { - #region Constructors - - /// - /// The TaskExecutionModule is a the external view into a subsystem responsible for executing user - /// tasks. The subsystem consists of TaskWorkerThread, TaskEngine, TaskExecutionState and EngineProxy. - /// The engine thread passes the TaskExecutionState to the TEM which after the task finishes passes the - /// results back via the engineCallback. - /// - internal TaskExecutionModule - ( - EngineCallback engineCallback, - TaskExecutionModuleMode moduleMode, - bool profileExecution - ) - { - this.engineCallback = engineCallback; - this.moduleMode = moduleMode; - // By default start in breadthFirst traversal. This is done to gather enough work at the start of the build to get all the nodes at least working on something. - this.breadthFirstTraversal = true; - this.profileExecution = profileExecution; - this.totalTaskTime = 0; - // Get the node the TEM is running on, this is so the parent engine knows which node is requesting a traversal strategy change. - nodeId = engineCallback.GetParentEngine().NodeId; - - SetBatchRequestSize(); - - // In singleproc mode the task execution module executes tasks on the engine thread. In multi proc mode a new thread is - // created so the TEM can submit tasks to a worker queue which will run the tasks on a new thread. - if (moduleMode != TaskExecutionModuleMode.SingleProcMode) - { - this.isRunningMultipleNodes = true; - this.activeThreadCount = 0; - this.overallThreadCount = 0; - this.threadActiveCountEvent = new ManualResetEvent(false); - this.threadOverallCountEvent = new ManualResetEvent(false); - this.lastTaskActivity = 0; - - // Create a worker thread and make it the active node thread - workerThread = new TaskWorkerThread(this, profileExecution); - workerThread.ActivateThread(); - } - else - { - this.isRunningMultipleNodes = false; - } - } - - /// - /// Sets the requestBatch size based on an environment variable set by the user. - /// - private void SetBatchRequestSize() - { - // The RequestBatchSize is how many buildrequests will be sent to the parent engine at once when the system - // is running in multiproc mode. The idea of only sending a certain ammount of build requests was implemented - // due to the parent engine being flooded with build requests if the tree being built is very broad. - string requestBatchSizeEnvironmentVariable = Environment.GetEnvironmentVariable("MSBUILDREQUESTBATCHSIZE"); - if (!String.IsNullOrEmpty(requestBatchSizeEnvironmentVariable)) - { - if (!int.TryParse(requestBatchSizeEnvironmentVariable, out batchRequestSize) || batchRequestSize < 1) - { - // If an invalid RequestBatchSize is passed in set the batchRequestSize back to the default and log a warning. - batchRequestSize = defaultBatchRequestSize; - BuildEventContext buildEventContext = new BuildEventContext( - nodeId, - BuildEventContext.InvalidTargetId, - BuildEventContext.InvalidProjectContextId, - BuildEventContext.InvalidTaskId - ); - - engineCallback.GetParentEngine().LoggingServices.LogWarning(buildEventContext, new BuildEventFileInfo(/* there is truly no file associated with this warning */ String.Empty), "BatchRequestSizeOutOfRange", requestBatchSizeEnvironmentVariable); - } - } - } - - #endregion - - #region Properties - - /// - /// This property allows a task to query whether or not the system is running in single process mode or multi process mode. - /// Single process mode (IsRunningMultipleNodes = false) is where the engine is initialized with the number of cpus = 1 and the engine is not a child engine. - /// The engine is in multi process mode (IsRunningMultipleNodes = true) when the engine is initialized with a number of cpus > 1 or the engine is a child engine. - /// - internal bool IsRunningMultipleNodes - { - get - { - return isRunningMultipleNodes; - } - } - - /// - /// Specifies the traversal type for IBuildEngine callbacks. If true multiple build requests will be sent - /// to the engine if false the requests will be sent one at a time. - /// - internal bool UseBreadthFirstTraversal - { - get - { - return breadthFirstTraversal; - } - set - { - breadthFirstTraversal = value; - } - } - - /// - /// Returns true if the TEM doesn't have a thread in user code and there are no pending - /// workitems - /// - internal bool IsIdle - { - get - { - return activeThreadCount == 0 && workerThread.WorkItemCount == 0; - } - } - - /// - /// Return total time spent executing the tasks by this TEM. This value is only valid if the TEM is created with - /// profileExecution set to true, otherwise this value will be 0 - /// - internal long TaskExecutionTime - { - get - { - return totalTaskTime; - } - } - - #endregion - #region Method used internally inside the TEM boundary (i.e. not called from the engine) - - /// - /// This method passes the task outputs to the engine, it is virtual for testing purposes to - /// create a mock TEM - /// - internal virtual void PostTaskOutputs - ( - int handleId, - bool taskExecutedSuccessfully, - Exception thrownException, - long executionTime - ) - { - totalTaskTime += executionTime; - engineCallback.PostTaskOutputs(handleId, taskExecutedSuccessfully, thrownException, executionTime); - } - - /// - /// This function implements the callback via the IBuildEngine interface - /// - /// result of call to engine - internal virtual bool BuildProjectFile - ( - int handleId, - string[] projectFileNames, - string[] targetNames, - IDictionary[] globalPropertiesPerProject, - IDictionary[] targetOutputsPerProject, - EngineLoggingServices loggingServices, - string[] toolsVersions, - bool useResultsCache, - bool unloadProjectsOnCompletion, - BuildEventContext taskContext - ) - { - if (projectFileNames.Length == 0) - { - // Nothing to do, just return success - return true; - } - - string currentDir = FileUtilities.GetCurrentDirectoryStaticBuffer(currentDirectoryBuffer); - - if (Engine.debugMode) - { - string targetName = targetNames == null ? "null" : targetNames[0]; - - bool remoteNode = false; - for (int r = 0; r < projectFileNames.Length; r++) - { - string fullProjectName = projectFileNames[r] ?? "null"; - Console.WriteLine("RemoteNode: " + remoteNode + " Project " + fullProjectName + " T:" + targetName + " NodeProdyId# " + handleId + " Time " + DateTime.Now.ToLongTimeString()); - if (globalPropertiesPerProject[r] != null) - { - foreach (DictionaryEntry entry in globalPropertiesPerProject[r]) - { - Console.WriteLine(currentDir + " :GLOBAL " + entry.Key + "=" + entry.Value.ToString()); - } - } - } - } - - BuildRequest[] buildRequests = new BuildRequest[projectFileNames.Length]; - for (int i = 0; i < buildRequests.Length; i++) - { - // We need to get the full path to the project before we call back - // into the engine which has no control over current path - string fullProjectName = projectFileNames[i] != null ? - Path.GetFullPath(projectFileNames[i]) : null; - - buildRequests[i] = new BuildRequest(handleId, fullProjectName, targetNames, globalPropertiesPerProject[i], - toolsVersions[i], i, useResultsCache, unloadProjectsOnCompletion); - ErrorUtilities.VerifyThrow(buildRequests[i].IsGeneratedRequest, "Should not be sending non generated requests from TEM to engine"); - buildRequests[i].ParentBuildEventContext = taskContext; - } - - BuildResult[] buildResultsLocal = new BuildResult[projectFileNames.Length]; - - if (moduleMode == TaskExecutionModuleMode.SingleProcMode) - { - for (int i = 0; i < projectFileNames.Length; i++) - { - // If we are running in a single threaded mode we need to - // re-enter the main build loop on the current thread in order - // to build the requested project, because the main build is below - // us on the stack - engineCallback.PostBuildRequestsToHost(new BuildRequest[] { buildRequests[i] }); - buildResultsLocal[i] = engineCallback.GetParentEngine().EngineBuildLoop(buildRequests[i]); - buildResultsLocal[i].ConvertToTaskItems(); - } - } - else - { - WaitForBuildResults(handleId, buildResultsLocal, buildRequests); - } - - // Store the outputs in the hashtables provided by the caller - bool overallResult = true; - for (int i = 0; i < buildResultsLocal.Length; i++) - { - // Users of the Object Model can pass in null targetOutputs for projects they do not want outputs for - // therefore we need to make sure that there are targetoutputs and the users want the results - if (buildResultsLocal[i] != null) - { - if (buildResultsLocal[i].OutputsByTarget != null && targetOutputsPerProject[i] != null) - { - foreach (DictionaryEntry entry in buildResultsLocal[i].OutputsByTarget) - { - targetOutputsPerProject[i].Add(entry.Key, entry.Value); - } - overallResult = overallResult && buildResultsLocal[i].EvaluationResult; - } - } - else - { - // The calculation was terminated prior to receiving the result - overallResult = false; - } - } - - // We're now returning from an IBuildEngine callback; - // set the current directory back to what the tasks expect - if (Directory.GetCurrentDirectory() != currentDir) - { - Directory.SetCurrentDirectory(currentDir); - } - - if (Engine.debugMode) - { - bool remoteNode = false; - string targetName = targetNames == null ? "null" : targetNames[0]; - Console.WriteLine("RemoteNode: " + remoteNode + " T:" + targetName + " HandleId# " + handleId + " Result " + overallResult); - } - - return overallResult; - } - - /// - /// Once the buildRequests from the EngineCallback have been created they are sent to this method which will - /// post the build requests to the parent engine and then wait on the results to come back. - /// This method uses either a breadthFirst or depthFirst traversal strategy when sending buildRequests to the parent engine. - /// This method will start in breadthFirst traversal. It will continue to use this strategy until one of two events occur: - /// 1. The parent node sents a message indicating the TEM should switch to depthFirst traversal. - /// 2. The number of buildRequests is larger than the batchRequestSize. - /// In both of these cases the system will go from a breadthFirstTraversal to a depthFirst Traversal. In the second case - /// a message will be sent to the parent engine to switch the system to depthFirst traversal as the system is starting to - /// be overloaded with work. - /// In a depth first strategy the buildRequests will be sent to the parent engine one at a time and waiting for results for - /// each buildRequest sent. In a breadthFirst traversal strategy some number of the buildrequests will be sent to the parent engine - /// in a batch of requests. The system will then wait on the results of ALL the build requests sent before continuing - /// to send more build requests. - /// - private void WaitForBuildResults(int handleId, BuildResult[] buildResultsLocal, BuildRequest[] buildRequests) - { - // If the traversal strategy is breadth first and the number of requests is less than the batchRequestSize - // or if there is only 1 build request then send ALL build requests to the parent engine and wait on the results. - if ((breadthFirstTraversal && buildRequests.Length < batchRequestSize) || buildRequests.Length == 1) - { - engineCallback.PostBuildRequestsToHost(buildRequests); - workerThread.WaitForResults(handleId, buildResultsLocal, buildRequests); - } - else - { - int currentRequestIndex = 0; // Which build request is being processed - - // Arrays that will be used to partion the buildRequests array when sending batches of builds requests at a time. - BuildRequest[] wrapperArrayBreadthFirst = new BuildRequest[batchRequestSize]; - BuildResult[] resultsArrayBreadthFirst = new BuildResult[batchRequestSize]; - - // Pre allocate these arrays as they will always be only one element in size. They are assigned to and filled when doing a depth first traversal. - BuildRequest[] wrapperArrayDepthFirst = new BuildRequest[1]; - BuildResult[] resultsArrayDepthFirst = new BuildResult[1]; - - // While there are still requests to send - while (currentRequestIndex < buildRequests.Length) - { - // If there is a breadth first traversal and there are more than batchRequestSize build requests, send the first batchRequestSize, then do the rest depth first - if (breadthFirstTraversal) - { - // Figure out how many requests to send, either the full batch size or only part of a batch - int numberOfRequestsToSend = (buildRequests.Length - currentRequestIndex) < batchRequestSize ? (buildRequests.Length - currentRequestIndex) : batchRequestSize; - - // Initialize the wrapper array to how many requests are going to be sent - if (numberOfRequestsToSend != wrapperArrayBreadthFirst.Length) - { - wrapperArrayBreadthFirst = new BuildRequest[numberOfRequestsToSend]; - resultsArrayBreadthFirst = new BuildResult[numberOfRequestsToSend]; - } - - // Fill the wrapper array with one batch of build requests - for (int i = 0; i < numberOfRequestsToSend; i++) - { - wrapperArrayBreadthFirst[i] = buildRequests[currentRequestIndex + i]; - wrapperArrayBreadthFirst[i].RequestId = i; - resultsArrayBreadthFirst[i] = null; - } - - engineCallback.PostBuildRequestsToHost(wrapperArrayBreadthFirst); - - // Only switch from breadth to depth if there are more thanbatchRequestSize items - if ((buildRequests.Length - currentRequestIndex) > batchRequestSize) - { - engineCallback.PostStatus(nodeId, new NodeStatus(false /* use depth first traversal*/), false /* don't block waiting on the send */); - breadthFirstTraversal = false; - } - - workerThread.WaitForResults(handleId, resultsArrayBreadthFirst, wrapperArrayBreadthFirst); - Array.Copy(resultsArrayBreadthFirst, 0, buildResultsLocal, currentRequestIndex, numberOfRequestsToSend); - currentRequestIndex += numberOfRequestsToSend; - } - - // Proceed with depth first traversal - while ((currentRequestIndex < buildRequests.Length) && !breadthFirstTraversal) - { - wrapperArrayDepthFirst[0] = buildRequests[currentRequestIndex]; - buildRequests[currentRequestIndex].RequestId = 0; - resultsArrayDepthFirst[0] = null; - - engineCallback.PostBuildRequestsToHost(wrapperArrayDepthFirst); - workerThread.WaitForResults(handleId, resultsArrayDepthFirst, wrapperArrayDepthFirst); - //Copy the result from an intermediate array to the full array - buildResultsLocal[currentRequestIndex] = resultsArrayDepthFirst[0]; - //Check if the call failed (null result was returned) - if (buildResultsLocal[currentRequestIndex] == null) - { - return; - } - - //Move to the next request - currentRequestIndex++; - } - } - } - } - - /// - /// Call into the engine to figure out the line and column number of the task XML node in the original - /// project context - /// - internal virtual void GetLineColumnOfXmlNode(int handleId, out int lineNumber, out int columnNumber) - { - engineCallback.GetLineColumnOfXmlNode(handleId, out lineNumber, out columnNumber); - } - - /// - /// Gets the global tasks registry defined by the *.tasks files. - /// - /// Global/default tasks registry. - internal ITaskRegistry GetDefaultTasksRegistry(int handleId) - { - return engineCallback.GetEngineTaskRegistry(handleId); - } - - /// - /// Gets the tasks registry for the given project. - /// - /// Project task registry. - internal ITaskRegistry GetProjectTasksRegistry(int handleId) - { - return engineCallback.GetProjectTaskRegistry(handleId); - } - - /// - /// Gets the path to the tools used for the particular task - /// - internal string GetToolsPath(int handleId) - { - return engineCallback.GetToolsPath(handleId); - } - - internal bool RethrowTaskExceptions() - { - return moduleMode == TaskExecutionModuleMode.SingleProcMode; - } - - #endregion - - #region Methods called from the engine - /// - /// Called to execute a task within a target. This method instantiates the task, sets its parameters, - /// and executes it. - /// - /// - public void ExecuteTask(TaskExecutionState taskState) - { - // Fill out the local fields of the task state - taskState.ParentModule = this; - taskState.LoggingService = engineCallback.GetParentEngine().LoggingServices; - taskState.ProfileExecution = profileExecution; - - // If we running in single proc mode, we should execute this task on the current thread - if (moduleMode == TaskExecutionModuleMode.SingleProcMode) - { - taskState.ExecuteTask(); - } - else - { - // In multiproc mode post the work item to the workerThread queue so it can be executed by the worker thread. - workerThread.PostWorkItem(taskState); - } - } - - /// - /// Uses the parent engine to get the next unique TaskID. - /// - /// - internal int GetNextTaskId() - { - return engineCallback.GetParentEngine().GetNextTaskId(); - } - - /// - /// This method lets the engine provide node with results of an evaluation it was waiting on. - /// - /// - internal void PostBuildResults(BuildResult buildResult) - { - // Do nothing in the single proc mode - if (moduleMode == TaskExecutionModuleMode.SingleProcMode) - { - return; - } - - buildResult.ConvertToTaskItems(); - workerThread.PostBuildResult(buildResult); - } - - /// - /// This function returns the last time TEM was active executing a task - /// - internal long LastTaskActivity() - { - if (moduleMode != TaskExecutionModuleMode.SingleProcMode) - { - if (activeThreadCount == 0 && workerThread.WorkItemCount == 0) - { - return lastTaskActivity; - } - else - { - return DateTime.Now.Ticks; - } - } - return DateTime.Now.Ticks; - } - - internal int[] GetWaitingTaskData(List outstandingRequests) - { - if (moduleMode != TaskExecutionModuleMode.SingleProcMode) - { - return workerThread.GetWaitingTasksData(outstandingRequests); - } - return new int[0]; - } - - internal void Shutdown() - { - if (moduleMode != TaskExecutionModuleMode.SingleProcMode) - { - workerThread.Shutdown(); - - while (overallThreadCount != 0) - { - threadOverallCountEvent.WaitOne(); - threadOverallCountEvent.Reset(); - } - - if (profileExecution) - { - int taskTimeMs = 0; - - if (totalTaskTime != 0) - { - TimeSpan taskTimeSpan = new TimeSpan(totalTaskTime); - taskTimeMs = (int)taskTimeSpan.TotalMilliseconds; - } - Console.WriteLine("Node time spent " + taskTimeMs); - } - } - } - #endregion - - #region Methods used by worker threads - - internal void IncrementOverallThreadCount() - { - Interlocked.Increment(ref overallThreadCount); - } - - internal void DecrementOverallThreadCount() - { - Interlocked.Decrement(ref overallThreadCount); - threadOverallCountEvent.Set(); - } - - internal void DecrementActiveThreadCount() - { - Interlocked.Decrement(ref activeThreadCount); - threadActiveCountEvent.Set(); - } - - internal void WaitForZeroActiveThreadCount() - { - while (Interlocked.CompareExchange(ref activeThreadCount, 1, 0) != 0) - { - threadActiveCountEvent.WaitOne(); - threadActiveCountEvent.Reset(); - } - lastTaskActivity = DateTime.Now.Ticks; - } - - #endregion - - #region Methods used for unittest only - /// - /// ONLY for unit testing - /// - internal TaskExecutionModuleMode GetExecutionModuleMode() - { - // The Execution module mode is used to determine if they system is running under single proc or multiproc for the purposes of creating a new thread - // to execute tasks on. - return moduleMode; - } - - /// - /// ONLY for unit testing - /// - internal TaskWorkerThread GetWorkerThread() - { - return workerThread; - } - #endregion - - #region Member data - /// - /// Callback interface to communicate with the engine - /// - private EngineCallback engineCallback; - - /// - /// The mode in which the TEM is running - /// - private TaskExecutionModuleMode moduleMode; - - /// - /// The class used to execute user tasks. - /// - private TaskWorkerThread workerThread; - - // Data shared between all worker threads within the TEM - /// - /// Total count of worker threads both active and inactive - /// - private int overallThreadCount; - /// - /// Event indicated a decrease in overallThreadCount due to an exit of a thread - /// - private ManualResetEvent threadOverallCountEvent; - /// - /// Count of active thread (i.e. threads in user code). Has to be either 0 or 1 - /// - private int activeThreadCount; - /// - /// Event indicating a decrease in activeThreadCount due to a thread leaving user code - /// - private ManualResetEvent threadActiveCountEvent; - /// - /// Time stamp of last execution of user code. Only valid if activeThreadCount == 0. - /// - private long lastTaskActivity; - /// - /// Specifies the traversal type for callbacks. If true multiple build requests will be sent - /// to the engine if false the requests will be sent one at a time. - /// - private bool breadthFirstTraversal; - /// - /// Specifies if the timing data on task execution should be collected - /// - private bool profileExecution; - /// - /// Total time spent executing task code. Only valid if profileExecution is true. - /// - private long totalTaskTime; - - /// - /// This property allows a task to query whether or not the system is running in single process mode or multi process mode. - /// Single process mode (IsRunningMultipleNodes = false) is where the engine is initialized with the number of cpus = 1 and the engine is not a child engine. - /// The engine is in multi process mode (IsRunningMultipleNodes = true) when the engine is initialized with a number of cpus > 1 or the engine is a child engine. - /// - private bool isRunningMultipleNodes; - - private static StringBuilder currentDirectoryBuffer = new StringBuilder(270); - - /// - /// In a multiproc build this is the maximum number of build requests which will be sent at a time to the parent engine - /// A default of 10 was an arbitrary number but turned out to be a good balance between being too small - /// causing the system to run out of work too quickly and being too big and flooding the system with requests. - /// - private const int defaultBatchRequestSize = 10; - private int batchRequestSize = defaultBatchRequestSize; - - /// - /// The nodeId of the node the TaskExecutionModule is running on - /// - private int nodeId = -1; - - #endregion - - #region Enums - - internal enum TaskExecutionModuleMode - { - /// - /// In this mode the tasks should be executed on the calling thread - /// - SingleProcMode = 0, - /// - /// In this mode the tasks should be executed on a different thread and the execute calls - /// should return immediately. The messages due to the task are not flushed. - /// - MultiProcFullNodeMode = 1, - } - - #endregion - } -} diff --git a/src/Deprecated/Engine/Engine/TaskExecutionState.cs b/src/Deprecated/Engine/Engine/TaskExecutionState.cs deleted file mode 100644 index 80fc3861753..00000000000 --- a/src/Deprecated/Engine/Engine/TaskExecutionState.cs +++ /dev/null @@ -1,267 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.IO; -using System.Text; -using System.Xml; - -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class is a wrapper used to contain the data needed to execute a task. This class - /// is initially instantiated on the engine side by the scheduler and submitted to the node. - /// The node completes the class instantiating by providing the object with node side data. - /// This class is distinct from the task engine in that it (possibly) travels cross process - /// between the engine and the node carrying with it the data needed to instantiate the task - /// engine. The task engine can't subsume this class because the task engine is bound to the - /// node process and can't travel cross process. - /// - internal class TaskExecutionState - { - #region Constructors - /// - /// The constructor obtains the state information and the - /// callback delegate. - /// - internal TaskExecutionState - ( - TaskExecutionMode howToExecuteTask, - Lookup lookupForInference, - Lookup lookupForExecution, - XmlElement taskXmlNode, - ITaskHost hostObject, - string projectFileOfTaskNode, - string parentProjectFullFileName, - string executionDirectory, - int handleId, - BuildEventContext buildEventContext - ) - { - ErrorUtilities.VerifyThrow(taskXmlNode != null, "Must have task node"); - - this.howToExecuteTask = howToExecuteTask; - this.lookupForInference = lookupForInference; - this.lookupForExecution = lookupForExecution; - this.hostObject = hostObject; - this.projectFileOfTaskNode = projectFileOfTaskNode; - this.parentProjectFullFileName = parentProjectFullFileName; - this.executionDirectory = executionDirectory; - this.handleId = handleId; - this.buildEventContext = buildEventContext; - this.taskXmlNode = taskXmlNode; - } - #endregion - - #region Properties - - internal int HandleId - { - get - { - return this.handleId; - } - set - { - this.handleId = value; - } - } - - internal EngineLoggingServices LoggingService - { - get - { - return this.loggingService; - } - set - { - this.loggingService = value; - } - } - - internal TaskExecutionModule ParentModule - { - get - { - return this.parentModule; - } - set - { - this.parentModule = value; - } - } - - internal string ExecutionDirectory - { - get - { - return this.executionDirectory; - } - } - - internal bool ProfileExecution - { - get - { - return this.profileExecution; - } - set - { - this.profileExecution = value; - } - } - - #endregion - - #region Methods - /// - /// The thread procedure executes the tasks and calls callback once it is done - /// - internal virtual void ExecuteTask() - { - bool taskExecutedSuccessfully = true; - - Exception thrownException = null; - bool dontPostOutputs = false; - - if (profileExecution) - { - startTime = DateTime.Now.Ticks; - } - - try - { - TaskEngine taskEngine = new TaskEngine( - taskXmlNode, - hostObject, - projectFileOfTaskNode, - parentProjectFullFileName, - loggingService, - handleId, - parentModule, - buildEventContext); - - // Set the directory to the one appropriate for the task - if (FileUtilities.GetCurrentDirectoryStaticBuffer(currentDirectoryBuffer) != executionDirectory) - { - Directory.SetCurrentDirectory(executionDirectory); - } - // if we're skipping task execution because the target is up-to-date, we - // need to go ahead and infer all the outputs that would have been emitted; - // alternatively, if we're doing an incremental build, we need to infer the - // outputs that would have been produced if all the up-to-date items had - // been built by the task - if ((howToExecuteTask & TaskExecutionMode.InferOutputsOnly) != TaskExecutionMode.Invalid) - { - bool targetInferenceSuccessful = TaskEngineExecuteTask - (taskEngine, - TaskExecutionMode.InferOutputsOnly, - lookupForInference); - - ErrorUtilities.VerifyThrow(targetInferenceSuccessful, "A task engine should never fail to infer its task's up-to-date outputs."); - } - - // execute the task using the items that need to be (re)built - if ((howToExecuteTask & TaskExecutionMode.ExecuteTaskAndGatherOutputs) != TaskExecutionMode.Invalid) - { - taskExecutedSuccessfully = - TaskEngineExecuteTask - (taskEngine, - TaskExecutionMode.ExecuteTaskAndGatherOutputs, - lookupForExecution - ); - } - } - // We want to catch all exceptions and pass them on to the engine - catch (Exception e) - { - thrownException = e; - taskExecutedSuccessfully = false; - - // In single threaded mode the exception can be thrown on the current thread - if (parentModule.RethrowTaskExceptions()) - { - dontPostOutputs = true; - throw; - } - } - finally - { - if (!dontPostOutputs) - { - long executionTime = profileExecution ? DateTime.Now.Ticks - startTime : 0; - // Post the outputs to the engine - parentModule.PostTaskOutputs(handleId, taskExecutedSuccessfully, thrownException, executionTime); - } - } - } - - /// - /// This method is called to adjust the execution time for the task by subtracting the time - /// spent waiting for results - /// - /// - internal void NotifyOfWait(long waitStartTime) - { - // Move the start time forward by the period of the wait - startTime += (DateTime.Now.Ticks - waitStartTime); - } - - #region MethodsNeededForUnitTesting - /// - /// Since we could not derrive from TaskEngine and have no Interface, we need to overide the method in here and - /// replace the calls when testing the class because of the calls to TaskEngine. If at a future time we get a mock task - /// engine, Interface or a non sealed TaskEngine these methods can disappear. - /// - /// - internal virtual bool TaskEngineExecuteTask( - TaskEngine taskEngine, - TaskExecutionMode howTaskShouldBeExecuted, - Lookup lookup - ) - { - return taskEngine.ExecuteTask - ( - howTaskShouldBeExecuted, - lookup - ); - } - #endregion - - #endregion - - #region Fields set by the Engine thread - - private TaskExecutionMode howToExecuteTask; - - private Lookup lookupForInference; - private Lookup lookupForExecution; - - private ITaskHost hostObject; - private string projectFileOfTaskNode; - private string parentProjectFullFileName; - private string executionDirectory; - private int handleId; - private BuildEventContext buildEventContext; - - #endregion - - #region Fields set by the Task thread - - private TaskExecutionModule parentModule; - private EngineLoggingServices loggingService; - private XmlElement taskXmlNode; - private long startTime; - private bool profileExecution; - private static StringBuilder currentDirectoryBuffer = new StringBuilder(270); - - #endregion - } -} diff --git a/src/Deprecated/Engine/Engine/TaskOutput.cs b/src/Deprecated/Engine/Engine/TaskOutput.cs deleted file mode 100644 index e7b23786469..00000000000 --- a/src/Deprecated/Engine/Engine/TaskOutput.cs +++ /dev/null @@ -1,176 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System.Xml; - -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class encapsulates the data needed to specify outputs from a task. - /// - /// SumedhK - internal sealed class TaskOutput - { - /// - /// Default constructor not supported. - /// - /// SumedhK - private TaskOutput() - { - // do nothing - } - - /// - /// This constructor allows all output data to be initialized. - /// - /// SumedhK - /// The XML element for the Output tag. - internal TaskOutput(XmlElement node) - { - ErrorUtilities.VerifyThrow(node != null, "Need the XML for the tag."); - - ProjectXmlUtilities.VerifyThrowProjectNoChildElements(node); - - int requiredData = 0; - string taskName = node.ParentNode.Name; - - foreach (XmlAttribute outputAttribute in node.Attributes) - { - switch (outputAttribute.Name) - { - case XMakeAttributes.taskParameter: - ProjectErrorUtilities.VerifyThrowInvalidProject(outputAttribute.Value.Length > 0, outputAttribute, - "InvalidAttributeValue", outputAttribute.Value, outputAttribute.Name, XMakeElements.output); - ProjectErrorUtilities.VerifyThrowInvalidProject(!XMakeAttributes.IsSpecialTaskAttribute(outputAttribute.Value) && !XMakeAttributes.IsBadlyCasedSpecialTaskAttribute(outputAttribute.Value), outputAttribute, - "BadlyCasedSpecialTaskAttribute", outputAttribute.Value, taskName, taskName); - this.taskParameterAttribute = outputAttribute; - break; - - case XMakeAttributes.itemName: - ProjectErrorUtilities.VerifyThrowInvalidProject(outputAttribute.Value.Length > 0, outputAttribute, - "InvalidAttributeValue", outputAttribute.Value, outputAttribute.Name, XMakeElements.output); - this.itemNameAttribute = outputAttribute; - requiredData++; - break; - - case XMakeAttributes.propertyName: - ProjectErrorUtilities.VerifyThrowInvalidProject(outputAttribute.Value.Length > 0, outputAttribute, - "InvalidAttributeValue", outputAttribute.Value, outputAttribute.Name, XMakeElements.output); - ProjectErrorUtilities.VerifyThrowInvalidProject(!ReservedPropertyNames.IsReservedProperty(outputAttribute.Value), node, - "CannotModifyReservedProperty", outputAttribute.Value); - this.propertyNameAttribute = outputAttribute; - requiredData++; - break; - - case XMakeAttributes.condition: - this.conditionAttribute = outputAttribute; - break; - - default: - ProjectXmlUtilities.ThrowProjectInvalidAttribute(outputAttribute); - break; - } - } - - /* NOTE: - * TaskParameter must be specified - * either ItemName or PropertyName must be specified - * if ItemName is specified, then PropertyName cannot be specified - * if PropertyName is specified, then ItemName cannot be specified - * only Condition is truly optional - */ - ProjectErrorUtilities.VerifyThrowInvalidProject((this.taskParameterAttribute != null) && (requiredData == 1), - node, "InvalidTaskOutputSpecification", taskName); - } - - /// - /// Indicates if the output is an item vector. - /// - /// SumedhK - internal bool IsItemVector - { - get - { - return this.itemNameAttribute != null; - } - } - - /// - /// Indicates if the output is a property. - /// - /// SumedhK - internal bool IsProperty - { - get - { - return this.propertyNameAttribute != null; - } - } - - /// - /// The task parameter bound to this output. - /// - /// SumedhK - internal XmlAttribute TaskParameterAttribute - { - get - { - // This will never return null. The constructor ensures this. - return this.taskParameterAttribute; - } - } - - /// - /// The item type, if the output is an item vector. - /// - /// If PropertyName is already set, this property cannot be set. - /// SumedhK - internal XmlAttribute ItemNameAttribute - { - get - { - return this.itemNameAttribute; - } - } - - /// - /// The property name, if the output is a property. - /// - /// If ItemName is already set, this property cannot be set. - /// SumedhK - internal XmlAttribute PropertyNameAttribute - { - get - { - return this.propertyNameAttribute; - } - } - - /// - /// The condition on the output. - /// - /// SumedhK - internal XmlAttribute ConditionAttribute - { - get - { - return this.conditionAttribute; - } - } - - // the task parameter bound to this output - private XmlAttribute taskParameterAttribute; - // the item type, if the output is an item vector - private XmlAttribute itemNameAttribute; - // the property name, if the output is a property - private XmlAttribute propertyNameAttribute; - // the condition that makes this output usable (can be null) - private XmlAttribute conditionAttribute; - } -} diff --git a/src/Deprecated/Engine/Engine/TaskRegistry.cs b/src/Deprecated/Engine/Engine/TaskRegistry.cs deleted file mode 100644 index 0b8e3b7e7a3..00000000000 --- a/src/Deprecated/Engine/Engine/TaskRegistry.cs +++ /dev/null @@ -1,391 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.IO; -using System.Xml; -using System.Reflection; -using System.Collections; - -using Microsoft.Build.BuildEngine.Shared; -using Microsoft.Build.Framework; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class is used to track tasks used by a project. Tasks are declared in project files with the <UsingTask> tag. - /// Task and assembly names must be specified per .NET guidelines, however, the names do not need to be fully qualified if - /// they provide enough information to locate the tasks they refer to. Assemblies can also be referred to using file paths -- - /// this is useful when it is not possible/desirable to place task assemblies in the GAC, or in the same directory as MSBuild. - /// - /// - /// 1) specifying a task assembly using BOTH its assembly name (strong or weak) AND its file path is not allowed - /// 2) when specifying the assembly name, the file extension (usually ".dll") must NOT be specified - /// 3) when specifying the assembly file, the file extension MUST be specified - /// - /// - /// <UsingTask TaskName="Microsoft.Build.Tasks.Csc" ==> look for the "Csc" task in the - /// AssemblyName="Microsoft.Build.Tasks"/> weakly-named "Microsoft.Build.Tasks" assembly - /// - /// <UsingTask TaskName="t1" ==> look for the "t1" task in the - /// AssemblyName="mytasks, Culture=en, Version=1.0.0.0"/> strongly-named "mytasks" assembly - /// - /// <UsingTask TaskName="foo" ==> look for the "foo" task in the - /// AssemblyFile="$(MyDownloadedTasks)\utiltasks.dll"/> "utiltasks" assembly file - /// - /// <UsingTask TaskName="UtilTasks.Bar" ==> invalid task declaration - /// AssemblyName="utiltasks.dll" - /// AssemblyFile="$(MyDownloadedTasks)\"/> - /// - /// SumedhK - internal sealed class TaskRegistry : ITaskRegistry - { - #region Constructors - /// - /// Default constructor does no work because the tables are initialized lazily when a task is registered - /// - internal TaskRegistry() - { - registeredTasks = null; - } - #endregion - - #region Properties - /// - /// Gets the collection of task declarations created by parsing the <UsingTask> XML. - /// Used for unit tests only. - /// - internal Hashtable AllTaskDeclarations - { - get - { - return registeredTasks; - } - } - #endregion - - #region Methods - /// - /// Removes all entries from the registry. - /// - public void Clear() - { - // The hashtables are lazily allocated if they are needed - if (registeredTasks != null) - { - cachedTaskClassesWithExactMatch.Clear(); - cachedTaskClassesWithFuzzyMatch.Clear(); - registeredTasks.Clear(); - } - } - - /// - /// Given a task name, this method retrieves the task class. If the task has been requested before, it will be found in - /// the class cache; otherwise, <UsingTask> declarations will be used to search the appropriate assemblies. - /// - /// - /// - /// - /// - /// - /// - /// - /// true, if task is found - public bool GetRegisteredTask - ( - string taskName, - string taskProjectFile, - XmlNode taskNode, - bool exactMatchRequired, - EngineLoggingServices loggingServices, - BuildEventContext buildEventContext, - out LoadedType taskClass - ) - { - taskClass = null; - - // If there are no using tags in the project don't bother caching or looking for tasks - if (registeredTasks == null) - { - return false; - } - - Hashtable cachedTaskClasses = exactMatchRequired ? this.cachedTaskClassesWithExactMatch : this.cachedTaskClassesWithFuzzyMatch; - - if (cachedTaskClasses.Contains(taskName)) - { - // Caller has asked us before for this same task name, and for the same value of "bool exactMatchRequired". - // Return whatever the previous result was, even if it was null. Why would the result be different than - // it was before? NOTE: Hash tables CAN have "null" as their value, and this still returns "true" for Contains(...). - taskClass = (LoadedType)cachedTaskClasses[taskName]; - } - else - { - Hashtable registeredTasksFound; - - // look for the given task name in the registry; if not found, gather all registered task names that partially - // match the given name - if (FindRegisteredTasks(taskName, exactMatchRequired, out registeredTasksFound)) - { - foreach (DictionaryEntry registeredTaskFound in registeredTasksFound) - { - string mostSpecificTaskName = (string)registeredTaskFound.Key; - - // if the given task name is longer than the registered task name - if (taskName.Length > ((string)registeredTaskFound.Key).Length) - { - // we will use the longer name to help disambiguate between multiple matches - mostSpecificTaskName = taskName; - } - - if (GetTaskFromAssembly(mostSpecificTaskName, (ArrayList)registeredTaskFound.Value, taskProjectFile, taskNode, loggingServices, buildEventContext, out taskClass)) - { - // Whilst we are within the processing of the task, we haven't actually started executing it, so - // our using task message needs to be in the context of the target. However any errors should be reported - // at the point where the task appears in the project. - BuildEventContext usingTaskContext = new BuildEventContext(buildEventContext.NodeId, buildEventContext.TargetId, buildEventContext.ProjectContextId, BuildEventContext.InvalidTaskId); - loggingServices.LogComment(usingTaskContext, "TaskFound", taskName, taskClass.Assembly.ToString()); - break; - } - } - } - - // Cache the result, even if it is null. We should never again do the work we just did, for this task name. - cachedTaskClasses[taskName] = taskClass; - } - - return taskClass != null; - } - - /// - /// Searches all task declarations for the given task name. If no exact match is found, looks for partial matches. - /// - /// - /// It is possible to get multiple partial matches for a task name that is not fully qualified. - /// NOTE: this method is marked internal for unit testing purposes only. - /// - /// - /// - /// - /// true, if given task name matches one or more task declarations - internal bool FindRegisteredTasks(string taskName, bool exactMatchRequired, out Hashtable registeredTasksFound) - { - registeredTasksFound = new Hashtable(StringComparer.OrdinalIgnoreCase); - ArrayList taskAssemblies = registeredTasks != null ? (ArrayList)registeredTasks[taskName] : null; - - // if we find an exact match - if (taskAssemblies != null) - { - // we're done - registeredTasksFound[taskName] = taskAssemblies; - } - else if (!exactMatchRequired) - { - // look through all task declarations for partial matches - foreach (DictionaryEntry registeredTask in registeredTasks) - { - if (TypeLoader.IsPartialTypeNameMatch(taskName, (string)registeredTask.Key)) - { - registeredTasksFound[registeredTask.Key] = registeredTask.Value; - } - } - } - - return registeredTasksFound.Count > 0; - } - - /// - /// Given a task name and a list of assemblies, this helper method checks if the task exists in any of the assemblies. - /// - /// - /// If the task name is fully qualified, then a match (if any) is unambiguous; otherwise, if there are multiple tasks with - /// the same name in different namespaces/assemblies, the first task found will be returned. - /// - /// - /// - /// - /// - /// - /// - /// - /// true, if task is successfully loaded - private bool GetTaskFromAssembly - ( - string taskName, - ArrayList taskAssemblies, - string taskProjectFile, - XmlNode taskNode, - EngineLoggingServices loggingServices, - BuildEventContext buildEventContext, - out LoadedType taskClass - ) - { - taskClass = null; - - foreach (AssemblyLoadInfo assembly in taskAssemblies) - { - try - { - taskClass = typeLoader.Load(taskName, assembly); - } - catch (TargetInvocationException e) - { - // Exception thrown by the called code itself - // Log the stack, so the task vendor can fix their code - ProjectErrorUtilities.VerifyThrowInvalidProject(false, taskNode, "TaskLoadFailure", taskName, assembly.ToString(), Environment.NewLine + e.InnerException.ToString()); - } - catch (ReflectionTypeLoadException e) - { - // ReflectionTypeLoadException.LoaderExceptions may contain nulls - foreach (Exception exception in e.LoaderExceptions) - { - if (exception != null) - { - loggingServices.LogError(buildEventContext, new BuildEventFileInfo(taskProjectFile), "TaskLoadFailure", taskName, assembly.ToString(), exception.Message); - } - } - - ProjectErrorUtilities.VerifyThrowInvalidProject(false, taskNode, "TaskLoadFailure", taskName, assembly.ToString(), e.Message); - } - catch (Exception e) // Catching Exception, but rethrowing unless it's a well-known exception. - { - if (ExceptionHandling.NotExpectedReflectionException(e)) - { - throw; - } - - ProjectErrorUtilities.VerifyThrowInvalidProject(false, taskNode, "TaskLoadFailure", taskName, assembly.ToString(), e.Message); - } - - if (taskClass != null) - { - return true; - } - } - - return false; - } - - /// - /// Reads the given <UsingTask> tag and saves the task information specified in it. - /// - /// - /// - /// - /// - public void RegisterTask(UsingTask usingTask, Expander expander, EngineLoggingServices loggingServices, BuildEventContext buildEventContext) - { - if ( - // if the tag doesn't have a condition on it - (usingTask.Condition == null) - || - // or if the condition holds - Utilities.EvaluateCondition(usingTask.Condition, usingTask.ConditionAttribute, expander, - null, ParserOptions.AllowProperties | ParserOptions.AllowItemLists, loggingServices, buildEventContext) - ) - { - // Lazily allocate the hashtables if they are needed - if (registeredTasks == null) - { - cachedTaskClassesWithExactMatch = new Hashtable(StringComparer.OrdinalIgnoreCase); - cachedTaskClassesWithFuzzyMatch = new Hashtable(StringComparer.OrdinalIgnoreCase); - registeredTasks = new Hashtable(StringComparer.OrdinalIgnoreCase); - } - - string assemblyName = null; - string assemblyFile = null; - - if (usingTask.AssemblyName != null) - { - // expand out all embedded properties and items in the assembly name - assemblyName = expander.ExpandAllIntoString(usingTask.AssemblyName, usingTask.AssemblyNameAttribute); - - ProjectErrorUtilities.VerifyThrowInvalidProject(assemblyName.Length > 0, - usingTask.AssemblyNameAttribute, "InvalidEvaluatedAttributeValue", assemblyName, usingTask.AssemblyName, XMakeAttributes.assemblyName, XMakeElements.usingTask); - } - else - { - // expand out all embedded properties and items in the assembly file/path - assemblyFile = expander.ExpandAllIntoString(usingTask.AssemblyFile, usingTask.AssemblyFileAttribute); - - ProjectErrorUtilities.VerifyThrowInvalidProject(assemblyFile.Length > 0, - usingTask.AssemblyFileAttribute, "InvalidEvaluatedAttributeValue", assemblyFile, usingTask.AssemblyFile, XMakeAttributes.assemblyFile, XMakeElements.usingTask); - - // figure out the directory of the project in which this node was defined - string projectFile = XmlUtilities.GetXmlNodeFile(usingTask.TaskNameAttribute.OwnerElement, String.Empty); - string projectDir = (projectFile.Length > 0) - ? Path.GetDirectoryName(projectFile) - : String.Empty; - - // ensure the assembly file/path is relative to the project in which this node was defined -- we - // don't want paths from imported projects being interpreted relative to the main project file - try - { - assemblyFile = Path.Combine(projectDir, assemblyFile); - } - catch (ArgumentException ex) - { - // Invalid chars in AssemblyFile path - ProjectErrorUtilities.VerifyThrowInvalidProject(false, usingTask.AssemblyFileAttribute, - "InvalidAttributeValueWithException", assemblyFile, - XMakeAttributes.assemblyFile, XMakeElements.usingTask, ex.Message); - } - } - - AssemblyLoadInfo taskAssembly = new AssemblyLoadInfo(assemblyName, assemblyFile); - - // expand out all embedded properties and items - string taskName = expander.ExpandAllIntoString(usingTask.TaskName, usingTask.TaskNameAttribute); - - ProjectErrorUtilities.VerifyThrowInvalidProject(taskName.Length > 0, - usingTask.TaskNameAttribute, "InvalidEvaluatedAttributeValue", taskName, usingTask.TaskName, XMakeAttributes.taskName, XMakeElements.usingTask); - - // since more than one task can have the same name, we want to keep track of all assemblies that are declared to - // contain tasks with a given name... - ArrayList taskAssemblies = (ArrayList)registeredTasks[taskName]; - - if (taskAssemblies == null) - { - taskAssemblies = new ArrayList(); - registeredTasks[taskName] = taskAssemblies; - } - - taskAssemblies.Add(taskAssembly); - } - } - - /// - /// Checks if the given type is a task class. - /// - /// This method is used as a TypeFilter delegate. - /// SumedhK - /// - /// - /// true, if specified type is a task - private static bool IsTaskClass(Type type, object unused) - { - return type.IsClass && - !type.IsAbstract && - (type.GetInterface("ITask") != null); - } - #endregion - - #region Data - // cache of tasks that have been verified to exist in their respective assemblies - private Hashtable cachedTaskClassesWithExactMatch; - private Hashtable cachedTaskClassesWithFuzzyMatch; - - /// - /// Cache of task declarations i.e. the <UsingTask> tags fed to this registry. - /// - private Hashtable registeredTasks; - - // used for finding tasks when reflecting through assemblies - private readonly TypeLoader typeLoader = new TypeLoader(new TypeFilter(IsTaskClass)); - #endregion - } -} diff --git a/src/Deprecated/Engine/Engine/TaskWorkerThread.cs b/src/Deprecated/Engine/Engine/TaskWorkerThread.cs deleted file mode 100644 index 8c60ecd9468..00000000000 --- a/src/Deprecated/Engine/Engine/TaskWorkerThread.cs +++ /dev/null @@ -1,638 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Threading; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class is a wrapper around a worker thread that executes a task - /// - internal class TaskWorkerThread - { - private enum NodeLoopExecutionMode - { - /// - /// This is a mode of a thread that is not executing a task but is responsible for picking up - /// work items as they arrive to the queue - /// - BaseActiveThread = 0, - /// - /// This is a mode of a thread that was in BaseActiveThread mode and processes a callback via - /// IBuildEngine interface. If a work item arrives while the thread is in this morning it will pass - /// the ownership of the queue to another thread - /// - WaitingActiveThread = 1, - /// - /// This is a mode of a thread that is not watching the work item queue and is waiting for - /// results in order to return back to task execution. - /// - WaitingPassiveThread = 2 - } - - #region Constructors - /// - /// This constructor creates a worker thread which is immediately ready to be activated. Once - /// activated the thread will execute tasks as they appear in the work item queue. Once the - /// thread is blocked from executing tasks it will pass the ownership of the work item queue to another - /// thread - /// - internal TaskWorkerThread(TaskExecutionModule parentModule, bool profileExecution) - { - this.parentModule = parentModule; - - // Initialize the data that only has to be set by the very first thread - // created by the TEM - this.exitTaskThreads = new ManualResetEvent(false); - this.exitTaskThreadsCache = new ExitTaskCache(false); - this.workerThreadQueue = new Queue(); - this.handleIdToWorkerThread = new Hashtable(); - this.workItemQueue = new Queue(); - this.workItemInsertionEvent = new ManualResetEvent(false); - this.waitingTasks = new Hashtable(); - this.profileExecution = profileExecution; - - InitializePerInstanceData(); - } - - /// - /// This constructor is used by the class internally to create new instances when a thread - /// becomes blocked by a user code callback. - /// - private TaskWorkerThread - ( - TaskExecutionModule parentModule, - ManualResetEvent exitTaskThreads, - ExitTaskCache exitTaskThreadsCache, - Queue workerThreadQueue, - Hashtable handleIdToWorkerThread, - Queue workItemQueue, - ManualResetEvent workItemInsertionEvent, - Hashtable waitingTasks, - bool profileExecution - ) - { - this.parentModule = parentModule; - this.exitTaskThreads = exitTaskThreads; - this.exitTaskThreadsCache = exitTaskThreadsCache; - this.workerThreadQueue = workerThreadQueue; - this.handleIdToWorkerThread = handleIdToWorkerThread; - this.workItemQueue = workItemQueue; - this.workItemInsertionEvent = workItemInsertionEvent; - this.waitingTasks = waitingTasks; - this.profileExecution = profileExecution; - - InitializePerInstanceData(); - } - - private void InitializePerInstanceData() - { - // Create events private to this thread - this.activationEvent = new ManualResetEvent(false); - this.localDoneNoticeEvent = new ManualResetEvent(false); - this.threadActive = false; - this.postedBuildResults = new LinkedList(); - this.currentWorkitem = null; - - // Clear out the handles cache - BaseActiveThreadWaitHandles = null; - WaitingActiveThreadWaitHandles = null; - WaitingPassiveThreadWaitHandles = null; - - // Start the thread that will be processing the events - ThreadStart threadState = new ThreadStart(this.MainThreadLoop); - Thread taskThread = new Thread(threadState); - taskThread.Name = "MSBuild Task Worker"; - taskThread.SetApartmentState(ApartmentState.STA); - taskThread.Start(); - } - #endregion - - #region Properties - /// - /// This event is triggered by the node when a done notice is received - /// - internal ManualResetEvent LocalDoneNoticeEvent - { - get - { - return this.localDoneNoticeEvent; - } - } - - internal int WorkItemCount - { - get - { - // UNDONE this access depends on thread safety of workItemQueue.Count - return this.workItemQueue.Count; - } - } - - #endregion - - #region Methods - - /// - /// This a base loop of a worker thread. The worker thread is asleep waiting for either an - /// event indicating that it should shut down or that it should become active and take - /// ownership of the work item queue - /// - private void MainThreadLoop() - { - // Create an array of event to the node thread responds - WaitHandle[] waitHandles = new WaitHandle[2]; - waitHandles[0] = exitTaskThreads; - waitHandles[1] = activationEvent; - - bool continueExecution = true; - - parentModule.IncrementOverallThreadCount(); - - try - { - while (continueExecution) - { - // Wait for the next work item or an exit command - int eventType = WaitHandle.WaitAny(waitHandles); - - if (eventType == 0) - { - // Exit node event - continueExecution = false; - } - else - { - activationEvent.Reset(); - // Start the base loop, this will return once this is no longer the active thread - NodeActionLoop(NodeLoopExecutionMode.BaseActiveThread, EngineCallback.invalidEngineHandle, null); - // Add this thread to the inactive list - lock (workerThreadQueue) - { - workerThreadQueue.Enqueue(this); - } - } - } - } - finally - { - parentModule.DecrementOverallThreadCount(); - } - } - - /// - /// Don't wait on system objects if we don't have to - see if we have work to do. - /// - /// - /// - /// - private bool WaitAnyFast(NodeLoopExecutionMode executionMode, out int index) - { - index = 0; - - if (exitTaskThreadsCache.exitTaskThreads) - { - return true; - } - - if (executionMode == NodeLoopExecutionMode.BaseActiveThread) - { - lock (workItemQueue) - { - if (workItemQueue.Count > 0) - { - index = 1; - return true; - } - } - } - else if (executionMode == NodeLoopExecutionMode.WaitingActiveThread) - { - lock (workItemQueue) - { - if (workItemQueue.Count > 0) - { - index = 1; - return true; - } - } - lock (postedBuildResults) - { - if (postedBuildResults.Count > 0) - { - index = 2; - return true; - } - } - } - else if (executionMode == NodeLoopExecutionMode.WaitingPassiveThread) - { - lock (postedBuildResults) - { - if (postedBuildResults.Count > 0) - { - index = 1; - return true; - } - } - } - else - { - ErrorUtilities.VerifyThrow(false, "Unexpected NodeLoopExecutionMode"); - } - - return false; - } - - /// - /// This function calculates the array of events the thread should wait on depending on its - /// execution mode - /// - /// Current execution mode - /// Array of handles to wait on - private WaitHandle[] GetHandlesArray(NodeLoopExecutionMode executionMode) - { - WaitHandle[] waitHandles = null; - - if (executionMode == NodeLoopExecutionMode.BaseActiveThread) - { - if (BaseActiveThreadWaitHandles == null) - { - BaseActiveThreadWaitHandles = new WaitHandle[2]; - BaseActiveThreadWaitHandles[0] = exitTaskThreads; - BaseActiveThreadWaitHandles[1] = workItemInsertionEvent; - } - waitHandles = BaseActiveThreadWaitHandles; - } - else if (executionMode == NodeLoopExecutionMode.WaitingActiveThread) - { - if (WaitingActiveThreadWaitHandles == null) - { - WaitingActiveThreadWaitHandles = new WaitHandle[3]; - WaitingActiveThreadWaitHandles[0] = exitTaskThreads; - WaitingActiveThreadWaitHandles[1] = workItemInsertionEvent; - WaitingActiveThreadWaitHandles[2] = localDoneNoticeEvent; - } - waitHandles = WaitingActiveThreadWaitHandles; - } - else if (executionMode == NodeLoopExecutionMode.WaitingPassiveThread) - { - if (WaitingPassiveThreadWaitHandles == null) - { - WaitingPassiveThreadWaitHandles = new WaitHandle[2]; - WaitingPassiveThreadWaitHandles[0] = exitTaskThreads; - WaitingPassiveThreadWaitHandles[1] = localDoneNoticeEvent; - } - waitHandles = WaitingPassiveThreadWaitHandles; - } - else - { - ErrorUtilities.VerifyThrow(false, "Unexpected NodeLoopExecutionMode"); - } - - return waitHandles; - } - - /// - /// This is the loop for all active threads. Depending on the current execution mode the thread - /// will listen to different events. There is only one thread at the time that owns the workitem - /// queue and listens for tasks to be executed. There is also only one thread at a time that is - /// execution a task. That thread owns the current directory and the environment block. - /// - private void NodeActionLoop - ( - NodeLoopExecutionMode executionMode, - int handleId, - BuildResult[] buildResults - ) - { - // Create an array of event to the node thread responds - WaitHandle[] waitHandles = GetHandlesArray(executionMode); - - int resultCount = 0; - long entryTime = 0; - - // A thread that is waiting for a done notification is no longer - // actively executing a task so the active cound needs to be decreased - if (executionMode != NodeLoopExecutionMode.BaseActiveThread) - { - parentModule.DecrementActiveThreadCount(); - // If requested measure the time spent waiting for the results - if (profileExecution) - { - entryTime = DateTime.Now.Ticks; - } - } - - bool continueExecution = true; - while (continueExecution) - { - int eventType; - - // Try and avoid the wait on kernel objects if possible. - if (!WaitAnyFast(executionMode, out eventType)) - { - eventType = WaitHandle.WaitAny(waitHandles); - } - - if (Engine.debugMode) - { - Console.WriteLine("TaskWorkerThread: HandleId " + handleId + " waking up due to event type " + eventType); - } - - // Node exit event - all threads need to exit - if (eventType == 0) - { - continueExecution = false; - } - // New work item has appeared in the queue - else if (eventType == 1 && executionMode != NodeLoopExecutionMode.WaitingPassiveThread) - { - ErrorUtilities.VerifyThrow( - executionMode == NodeLoopExecutionMode.WaitingActiveThread || - executionMode == NodeLoopExecutionMode.BaseActiveThread, - "Only active threads should receive work item events"); - - if (executionMode == NodeLoopExecutionMode.BaseActiveThread) - { - // Wait until all there are no other active threads, we - // always transition from 0 to 1 atomically before executing the task - parentModule.WaitForZeroActiveThreadCount(); - - TaskExecutionState taskToExecute = null; - lock (workItemQueue) - { - taskToExecute = workItemQueue.Dequeue(); - // We may get a single event for multiple messages so only reset the event - // if the queue is empty - if (workItemQueue.Count == 0) - { - workItemInsertionEvent.Reset(); - } - } - - // Execute the task either directly or on a child thread - ErrorUtilities.VerifyThrow(taskToExecute != null, "Expected a workitem"); - - handleIdToWorkerThread[taskToExecute.HandleId] = this; - currentWorkitem = taskToExecute; - - // Actually execute the task (never throws - all exceptions are captured) - taskToExecute.ExecuteTask(); - - currentWorkitem = null; - handleIdToWorkerThread.Remove(taskToExecute.HandleId); - - // Indicate that this thread is no longer active - parentModule.DecrementActiveThreadCount(); - } - else - { - // Change the thread execution mode since it will no longer be - // listening to the work item queue - executionMode = NodeLoopExecutionMode.WaitingPassiveThread; - threadActive = false; - waitHandles = GetHandlesArray(executionMode); - - TaskWorkerThread workerThread = null; - lock (workerThreadQueue) - { - if (workerThreadQueue.Count != 0) - { - //Console.WriteLine("REUSING a thread"); - workerThread = workerThreadQueue.Dequeue(); - } - } - if (workerThread == null) - { - //Console.WriteLine("CREATING a thread"); - workerThread = new TaskWorkerThread(parentModule, exitTaskThreads, exitTaskThreadsCache, workerThreadQueue, handleIdToWorkerThread, - workItemQueue, workItemInsertionEvent, waitingTasks, profileExecution); - } - - workerThread.ActivateThread(); - } - } - else if ((eventType == 1 && executionMode == NodeLoopExecutionMode.WaitingPassiveThread) || - (eventType == 2 && executionMode == NodeLoopExecutionMode.WaitingActiveThread)) - { - // There maybe multiple results in the list so we need to loop over it - // and store the results - int originalResultCount = resultCount; - lock (postedBuildResults) - { - LinkedListNode currentNode = postedBuildResults.First; - while (currentNode != null) - { - BuildResult buildResult = currentNode.Value; - ErrorUtilities.VerifyThrow( - buildResult.RequestId < buildResults.Length, - "The request ids should be inside the array"); - buildResults[buildResult.RequestId] = buildResult; - // Increment the result count to indicate that we got another result - resultCount++; - // Go to the next entry in the list (most of the time there will be just one entry) - currentNode = currentNode.Next; - } - postedBuildResults.Clear(); - // Reset the handle now that we done with the events - int handleIndex = executionMode == NodeLoopExecutionMode.WaitingPassiveThread ? 1 : 2; - ((ManualResetEvent)waitHandles[handleIndex]).Reset(); - } - ErrorUtilities.VerifyThrow(originalResultCount < resultCount, "We should have found at least 1 result"); - // If we received results for all the requests we need to exit - if (resultCount == buildResults.Length) - { - continueExecution = false; - } - } - // Check if we need to update the state - if (executionMode == NodeLoopExecutionMode.BaseActiveThread && !threadActive) - { - continueExecution = false; - } - } - - ErrorUtilities.VerifyThrow - (resultCount == 0 || executionMode != NodeLoopExecutionMode.BaseActiveThread, - "The base thread should never return a value"); - - // If a thread exits this loop it is back to actively executing the task, - // so the active thread count has to be increased - if (executionMode != NodeLoopExecutionMode.BaseActiveThread) - { - parentModule.WaitForZeroActiveThreadCount(); - // Sent the time spent waiting for results to the ExecutionState so that the task execution time can be measured correctly - if (profileExecution) - { - this.currentWorkitem.NotifyOfWait(entryTime); - } - } - } - - private TaskWorkerThread GetWorkerThreadForHandleId(int handleId) - { - return (TaskWorkerThread)handleIdToWorkerThread[handleId]; - } - - /// - /// This method is called to cause a thread to become active and take ownership of the workitem - /// queue - /// - internal void ActivateThread() - { - threadActive = true; - activationEvent.Set(); - } - - /// - /// This function is called when the task executes a callback via IBuildEngine interface. A thread - /// that currently owns the workitem queue will continue to own it, unless a work item comes in while - /// it is inside the callback. A thread that enters the callback no longer owns the current directory and - /// environment block, but it will always regain them before returning to the task. - /// - internal void WaitForResults - ( - int handleId, - BuildResult[] buildResults, - BuildRequest[] buildRequests - ) - { - TaskWorkerThread workerThread = GetWorkerThreadForHandleId(handleId); - ErrorUtilities.VerifyThrow(workerThread != null, "Worker thread should be in the table"); - WaitingTaskData taskData = new WaitingTaskData(buildRequests, buildResults); - lock (waitingTasks) - { - waitingTasks.Add(handleId, taskData); - } - workerThread.NodeActionLoop(workerThread.threadActive ? NodeLoopExecutionMode.WaitingActiveThread : - NodeLoopExecutionMode.WaitingPassiveThread, - handleId, buildResults); - lock (waitingTasks) - { - waitingTasks.Remove(handleId); - } - } - - - internal int[] GetWaitingTasksData(List outstandingRequests) - { - int[] waitingTasksArray; - lock (waitingTasks) - { - waitingTasksArray = new int[waitingTasks.Keys.Count]; - int i = 0; - foreach (DictionaryEntry entry in waitingTasks) - { - // Store the node proxy - waitingTasksArray[i] = (int)entry.Key; - // Loop through the build requests and add uncomplete requests to the list - WaitingTaskData taskData = (WaitingTaskData)entry.Value; - List requests = new List(); - for (int j = 0; j < taskData.buildRequests.Length; j++) - { - if (taskData.buildResults[j] == null) - { - requests.Add(taskData.buildRequests[j]); - } - } - outstandingRequests.Add(requests.ToArray()); - // Move to the next output entry - i++; - } - } - return waitingTasksArray; - } - - internal void PostWorkItem(TaskExecutionState workItem) - { - lock (workItemQueue) - { - workItemQueue.Enqueue(workItem); - workItemInsertionEvent.Set(); - } - } - - internal void PostBuildResult(BuildResult buildResult) - { - TaskWorkerThread workerThread = GetWorkerThreadForHandleId(buildResult.HandleId); - - if (workerThread != null) - { - lock (workerThread.postedBuildResults) - { - workerThread.postedBuildResults.AddLast(new LinkedListNode(buildResult)); - workerThread.LocalDoneNoticeEvent.Set(); - } - } - } - - internal void Shutdown() - { - exitTaskThreads.Set(); - exitTaskThreadsCache.exitTaskThreads = true; - } - - #endregion - - #region Data - // Per instance data - private ManualResetEvent activationEvent; - private ManualResetEvent localDoneNoticeEvent; - private bool threadActive; - private LinkedList postedBuildResults; - private TaskExecutionState currentWorkitem; - private bool profileExecution; - - // Private cache arrays of handles - private WaitHandle[] BaseActiveThreadWaitHandles; - private WaitHandle[] WaitingActiveThreadWaitHandles; - private WaitHandle[] WaitingPassiveThreadWaitHandles; - - // Data shared between worked threads for one TEM, this data is initialized by the first - // thread - private ManualResetEvent exitTaskThreads; // Used to signal all threads to exit - private ExitTaskCache exitTaskThreadsCache; // cached value to avoid waiting on the kernel event - private Queue workerThreadQueue; // Queue of idle worker thread ready to be activated - private Hashtable handleIdToWorkerThread; // Table mapping in progress Ids to worker threads - private Queue workItemQueue; // Queue of workitems that need to be executed - private ManualResetEvent workItemInsertionEvent; // Used to signal a new work item - private Hashtable waitingTasks; // Hastable containing information about in progress - // task, used for determining if all threads are blocked - private TaskExecutionModule parentModule; // A pointer to the parent TEM - - #endregion - - #region Private struct - private class WaitingTaskData - { - internal WaitingTaskData(BuildRequest[] buildRequests, BuildResult[] buildResults) - { - this.buildRequests = buildRequests; - this.buildResults = buildResults; - } - - internal BuildRequest[] buildRequests; - internal BuildResult[] buildResults; - } - - private class ExitTaskCache - { - internal ExitTaskCache(bool value) - { - this.exitTaskThreads = value; - } - - internal bool exitTaskThreads; - } - #endregion - } -} diff --git a/src/Deprecated/Engine/Engine/Toolset.cs b/src/Deprecated/Engine/Engine/Toolset.cs deleted file mode 100644 index c996b2936fa..00000000000 --- a/src/Deprecated/Engine/Engine/Toolset.cs +++ /dev/null @@ -1,205 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.IO; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Aggregation of a toolset version (eg. "2.0"), tools path, and optional set of associated properties - /// - /// - /// [!WARNING] - /// > This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public class Toolset - { - // Name of the tools version - private string toolsVersion; - - // The MSBuildBinPath (and ToolsPath) for this tools version - private string toolsPath; - - // Properties - private BuildPropertyGroup properties; - - /// - /// Constructor taking only tools version and a matching tools path - /// - /// Name of the toolset - /// Path to this toolset's tasks and targets - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public Toolset(string toolsVersion, string toolsPath) - : this(toolsVersion, toolsPath, null) - { - } - - /// - /// Constructor that also associates a set of properties with the tools version - /// - /// Name of the toolset - /// Path to this toolset's tasks and targets - /// Properties that should be associated with the Toolset. - /// May be null, in which case an empty property group will be used. - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public Toolset(string toolsVersion, string toolsPath, BuildPropertyGroup buildProperties) - { - ErrorUtilities.VerifyThrowArgumentLength(toolsVersion, nameof(toolsVersion)); - ErrorUtilities.VerifyThrowArgumentLength(toolsPath, nameof(toolsPath)); - - this.toolsVersion = toolsVersion; - this.ToolsPath = toolsPath; - - this.properties = new BuildPropertyGroup(); - if (buildProperties != null) - { - this.properties.ImportProperties(buildProperties); - } - } - - /// - /// Name of this toolset - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public string ToolsVersion - { - get - { - return this.toolsVersion; - } - } - - /// - /// Path to this toolset's tasks and targets. Corresponds to $(MSBuildToolsPath) in a project or targets file. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public string ToolsPath - { - get - { - return this.toolsPath; - } - private set - { - // Strip the trailing backslash if it exists. This way, when somebody - // concatenates does something like "$(MSBuildToolsPath)\CSharp.targets", - // they don't end up with a double-backslash in the middle. (It doesn't - // technically hurt anything, but it doesn't look nice.) - string toolsPathToUse = value; - - if (FileUtilities.EndsWithSlash(toolsPathToUse)) - { - string rootPath = Path.GetPathRoot(Path.GetFullPath(toolsPathToUse)); - - // Only if $(MSBuildBinPath) is *NOT* the root of a drive should we strip trailing slashes - if (!String.Equals(rootPath, toolsPathToUse, StringComparison.OrdinalIgnoreCase)) - { - // Trim off one trailing slash - toolsPathToUse = toolsPathToUse.Substring(0, toolsPathToUse.Length - 1); - } - } - - this.toolsPath = toolsPathToUse; - } - } - - /// - /// Properties associated with the toolset - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public BuildPropertyGroup BuildProperties - { - get - { - return this.properties; - } - } - - /// - /// Make a deep copy of the Toolset - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public Toolset Clone() - { - // Can't use BuildPropertyGroupProxy as it's not a BuildPropertyGroup, - // so do a clone. This shouldn't be a perf issue because we expect toolsets to have - // relatively few properties. - return new Toolset - (toolsVersion, - toolsPath, - properties.Clone(true /* deep clone */)); - } - } -} diff --git a/src/Deprecated/Engine/Engine/ToolsetCollection.cs b/src/Deprecated/Engine/Engine/ToolsetCollection.cs deleted file mode 100644 index 38bfb7b7897..00000000000 --- a/src/Deprecated/Engine/Engine/ToolsetCollection.cs +++ /dev/null @@ -1,382 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections.Generic; - -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Implementation of ICollection<Toolset> that also supports - /// key-based retrieval by passing the string value of the tools version - /// corresponding with the desired Toolset. - /// NOTE: This collection does not support ICollection<Toolset>'s - /// Remove or Clear methods, and calls to these will generate exceptions. - /// - /// - /// [!WARNING] - /// > This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public class ToolsetCollection : ICollection - { - // the parent engine - private Engine parentEngine = null; - - // underlying map keyed off toolsVersion - private Dictionary toolsetMap = null; - - /// - /// Private default Ctor. Other classes should not be constructing - /// instances of this class without providing an Engine object. - /// - private ToolsetCollection() - { - } - - /// - /// Ctor. This is the only Ctor accessible to other classes. - /// Third parties should not be creating instances of this class; - /// instead, they should query an Engine object for one. - /// - /// - internal ToolsetCollection(Engine parentEngine) - { - ErrorUtilities.VerifyThrowArgumentNull(parentEngine, nameof(parentEngine)); - - this.parentEngine = parentEngine; - this.toolsetMap = new Dictionary(StringComparer.OrdinalIgnoreCase); - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// - /// Microsoft.Build.Execution - /// The names of the toolsets stored in this collection. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public IEnumerable ToolsVersions - { - get - { - return toolsetMap.Keys; - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Gets the Toolset with matching toolsVersion. - /// - /// - /// Toolset with matching toolsVersion, or null if none exists. - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public Toolset this[string toolsVersion] - { - get - { - ErrorUtilities.VerifyThrowArgumentLength(toolsVersion, nameof(toolsVersion)); - - if (this.toolsetMap.ContainsKey(toolsVersion)) - { - // Return clone of toolset so caller can't modify properties on it - return this.toolsetMap[toolsVersion].Clone(); - } - - return null; - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Determines whether the collection contains a Toolset with matching - /// tools version. - /// - /// - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public bool Contains(string toolsVersion) - { - return toolsetMap.ContainsKey(toolsVersion); - } - - #region ICollection Implementations - - /// - /// Count of elements in this collection. - /// - public int Count - { - get - { - return toolsetMap.Count; - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Always returns false - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public bool IsReadOnly - { - get - { - return false; - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// - /// Microsoft.Build.Execution - /// Adds the given Toolset to this collection, replacing any previous value - /// with the same tools version. Also notifies the parent Engine of the - /// change. - /// - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public void Add(Toolset item) - { - ErrorUtilities.VerifyThrowArgumentNull(item, nameof(item)); - - if (toolsetMap.ContainsKey(item.ToolsVersion)) - { - // It already exists: replace it with the new toolset - toolsetMap[item.ToolsVersion] = item; - } - else - { - toolsetMap.Add(item.ToolsVersion, item); - } - - // The parent engine needs to handle this as well - parentEngine.AddToolset(item); - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// This method is not supported. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public void Clear() - { - throw new NotSupportedException(); - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Determines whether or not this collection contains the given toolset. - /// - /// - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public bool Contains(Toolset item) - { - return toolsetMap.ContainsValue(item); - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Copies the contents of this collection to the given array, beginning - /// at the given index. - /// - /// - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public void CopyTo(Toolset[] array, int arrayIndex) - { - toolsetMap.Values.CopyTo(array, arrayIndex); - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Generic enumerator for the Toolsets in this collection. - /// - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public IEnumerator GetEnumerator() - { - return this.toolsetMap.Values.GetEnumerator(); - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Non-generic enumerator for the Toolsets in this collection. - /// - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() - { - return GetEnumerator(); - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// - /// Microsoft.Build.Execution - /// This method is not supported. - /// - /// - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public bool Remove(Toolset item) - { - throw new NotSupportedException(); - } - - #endregion - } -} diff --git a/src/Deprecated/Engine/Engine/ToolsetConfigurationReader.cs b/src/Deprecated/Engine/Engine/ToolsetConfigurationReader.cs deleted file mode 100644 index dee78cabbf1..00000000000 --- a/src/Deprecated/Engine/Engine/ToolsetConfigurationReader.cs +++ /dev/null @@ -1,579 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections.Generic; -using System.Configuration; -using error = Microsoft.Build.BuildEngine.Shared.ErrorUtilities; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - internal class ToolsetConfigurationReader : ToolsetReader - { - private ToolsetConfigurationSection configurationSection = null; - private ReadApplicationConfiguration readApplicationConfiguration = null; - private bool configurationReadAttempted = false; - - /// - /// Default constructor - /// - internal ToolsetConfigurationReader() - : this(new ReadApplicationConfiguration(ToolsetConfigurationReader.ReadApplicationConfiguration)) - { - } - - /// - /// Constructor taking a delegate for unit test purposes only - /// - /// - internal ToolsetConfigurationReader(ReadApplicationConfiguration readApplicationConfiguration) - { - error.VerifyThrowArgumentNull(readApplicationConfiguration, nameof(readApplicationConfiguration)); - this.readApplicationConfiguration = readApplicationConfiguration; - } - - /// - /// Returns the list of tools versions - /// - protected override IEnumerable ToolsVersions - { - get - { - if (ConfigurationSection != null) - { - foreach (ToolsetElement toolset in ConfigurationSection.Toolsets) - { - string location = ResourceUtilities.FormatResourceString - ( - "ConfigFileLocation", - toolset.ElementInformation.Source, - toolset.ElementInformation.LineNumber - ); - - if (toolset.toolsVersion?.Length == 0) - { - InvalidToolsetDefinitionException.Throw("InvalidToolsetValueInConfigFileValue", location); - } - - yield return new PropertyDefinition(toolset.toolsVersion, string.Empty, location); - } - } - else - { - yield break; - } - } - } - - /// - /// Returns the default tools version, or null if none was specified - /// - protected override string DefaultToolsVersion - { - get - { - return ConfigurationSection?.Default; - } - } - - /// - /// Provides an enumerator over property definitions for a specified tools version - /// - /// - /// - protected override IEnumerable GetPropertyDefinitions(string toolsVersion) - { - ToolsetElement toolsetElement = ConfigurationSection.Toolsets.GetElement(toolsVersion); - - if (toolsetElement == null) - { - yield break; - } - - foreach (ToolsetElement.PropertyElement propertyElement in toolsetElement.PropertyElements) - { - string location = ResourceUtilities.FormatResourceString - ( - "ConfigFileLocation", - propertyElement.ElementInformation.Source, - propertyElement.ElementInformation.LineNumber - ); - - if (propertyElement.Name?.Length == 0) - { - InvalidToolsetDefinitionException.Throw("InvalidToolsetValueInConfigFileValue", location); - } - - yield return new PropertyDefinition(propertyElement.Name, propertyElement.Value, location); - } - } - - /// - /// Reads the application configuration file. - /// NOTE: this is abstracted into a method to support unit testing GetToolsetDataFromConfiguration(). - /// Unit tests wish to avoid reading (nunit.exe) application configuration file. - /// - private static Configuration ReadApplicationConfiguration() - { - return ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); - } - - /// - /// Lazy getter for the ToolsetConfigurationSection - /// Returns null if the section is not present - /// - private ToolsetConfigurationSection ConfigurationSection - { - get - { - if (configurationSection == null && !configurationReadAttempted) - { - try - { - Configuration configuration = readApplicationConfiguration(); - - // This will be null if the application config file does not have the following section - // definition for the msbuildToolsets section as the first child element. - // - //
- // "; - // Note that the application config file may or may not contain an msbuildToolsets element. - // For example: - // If section definition is present and section is not present, this value is not null - // If section definition is not present and section is also not present, this value is null - // If the section definition is not present and section is present, then this value is null - - if (configuration != null) - { - configurationSection = configuration.GetSection("msbuildToolsets") as ToolsetConfigurationSection; - } - } - // ConfigurationException is obsolete, but we catch it rather than - // ConfigurationErrorsException (which is what we throw below) because it is more - // general and we don't want to miss catching some other derived exception. - catch (ConfigurationException ex) - { - string location = ResourceUtilities.FormatResourceString - ( - "ConfigFileLocation", - ex.Filename, - ex.Line - ); - - InvalidToolsetDefinitionException.Throw(ex, "ConfigFileReadError", location, ex.BareMessage); - } - finally - { - configurationReadAttempted = true; - } - } - - return configurationSection; - } - } - } - - /// - /// This class is used to programmatically read msbuildToolsets section - /// in from the configuration file. An example of application config file: - /// - /// <configuration> - /// <msbuildToolsets default="2.0"> - /// <toolset toolsVersion="2.0"> - /// <property name="MSBuildBinPath" value="D:\windows\Microsoft.NET\Framework\v2.0.x86ret\"/> - /// <property name="SomeOtherProperty" value="SomeOtherPropertyValue"/> - /// </toolset> - /// <toolset toolsVersion="3.5"> - /// <property name="MSBuildBinPath" value="D:\windows\Microsoft.NET\Framework\v3.5.x86ret\"/> - /// </toolset> - /// </msbuildToolsets> - /// </configuration> - /// - /// - /// - /// Internal for unit testing only - /// - internal sealed class ToolsetConfigurationSection : ConfigurationSection - { - /// - /// toolsVersion element collection - /// - [ConfigurationProperty("", IsDefaultCollection = true)] - public ToolsetElementCollection Toolsets - { - get - { - return (ToolsetElementCollection)base[""]; - } - } - - /// - /// default attribute on msbuildToolsets element, specifying the default ToolsVersion - /// - [ConfigurationProperty("default")] - public string Default - { - get - { - // The ConfigurationPropertyAttribute constructor accepts a named parameter "DefaultValue" - // that doesn't seem to work if null is the desired default value. So here we return null - // whenever the base class gives us an empty string. - // Note this means we can't distinguish between the attribute being present but containing - // an empty string for its value and the attribute not being present at all. - string defaultValue = (string)base["default"]; - return String.IsNullOrEmpty(defaultValue) ? null : defaultValue; - } - set - { - base["default"] = value; - } - } - } - - /// - /// Class representing the collection of toolset elements - /// - /// - /// Internal for unit testing only - /// - internal sealed class ToolsetElementCollection : ConfigurationElementCollection - { - /// - /// We use this dictionary to track whether or not we've seen a given - /// toolset definition before, since the .NET configuration classes - /// won't perform this check without respect for case. - /// - private Dictionary previouslySeenToolsVersions = new Dictionary(StringComparer.OrdinalIgnoreCase); - - /// - /// Creates a new element of the collection - /// - /// Created element - protected override ConfigurationElement CreateNewElement() - { - return new ToolsetElement(); - } - - /// - /// overridden so we can track previously seen tools versions - /// - /// - /// - protected override void BaseAdd(int index, ConfigurationElement element) - { - UpdateToolsVersionMap(element); - - base.BaseAdd(index, element); - } - - /// - /// overridden so we can track previously seen tools versions - /// - /// - protected override void BaseAdd(ConfigurationElement element) - { - UpdateToolsVersionMap(element); - - base.BaseAdd(element); - } - - /// - /// Stores the name of the tools version in a case-insensitive map - /// so we can detect if it is specified more than once but with - /// different case - /// - /// - private void UpdateToolsVersionMap(ConfigurationElement element) - { - string toolsVersion = GetElementKey(element).ToString(); - - if (previouslySeenToolsVersions.ContainsKey(toolsVersion)) - { - string message = ResourceUtilities.FormatResourceString("MultipleDefinitionsForSameToolset", toolsVersion); - - throw new ConfigurationErrorsException(message, element.ElementInformation.Source, element.ElementInformation.LineNumber); - } - - previouslySeenToolsVersions.Add(toolsVersion, string.Empty); - } - - /// - /// Returns the key value for the given element - /// - /// element whose key is returned - /// key - protected override object GetElementKey(ConfigurationElement element) - { - return ((ToolsetElement)element).toolsVersion; - } - - /// - /// Throw exception if an element with a duplicate key is added to the collection - /// - protected override bool ThrowOnDuplicate - { - get - { - return false; - } - } - - /// - /// Type of the collection - /// This has to be public as cannot change access modifier when overriding - /// - public override ConfigurationElementCollectionType CollectionType - { - get - { - return ConfigurationElementCollectionType.BasicMap; - } - } - - /// - /// Name of the element - /// - protected override string ElementName - { - get - { - return "toolset"; - } - } - - /// - /// Gets an element with the specified name - /// - /// toolsVersion of the element - /// element - public ToolsetElement GetElement(string toolsVersion) - { - return (ToolsetElement)this.BaseGet(toolsVersion); - } - - /// - /// Gets an element based at the specified position - /// - /// position - /// element - public ToolsetElement GetElement(int index) - { - return (ToolsetElement)this.BaseGet(index); - } - } - - /// - /// Class representing the Toolset element - /// - /// - /// Internal for unit testing only - /// - internal sealed class ToolsetElement : ConfigurationElement - { - /// - /// ToolsVersion attribute of the element - /// - [ConfigurationProperty("toolsVersion", IsKey = true, IsRequired = true)] - public string toolsVersion - { - get - { - return (string)base["toolsVersion"]; - } - set - { - base[nameof(toolsVersion)] = value; - } - } - - /// - /// Property element collection - /// - [ConfigurationProperty("", IsDefaultCollection = true)] - public PropertyElementCollection PropertyElements - { - get - { - return (PropertyElementCollection)base[""]; - } - } - - /// - /// Class representing collection of property elements - /// - internal sealed class PropertyElementCollection : ConfigurationElementCollection - { - /// - /// We use this dictionary to track whether or not we've seen a given - /// property definition before, since the .NET configuration classes - /// won't perform this check without respect for case. - /// - private Dictionary previouslySeenPropertyNames = new Dictionary(StringComparer.OrdinalIgnoreCase); - - /// - /// Creates a new element - /// - /// element - protected override ConfigurationElement CreateNewElement() - { - return new PropertyElement(); - } - - /// - /// overridden so we can track previously seen property names - /// - /// - /// - protected override void BaseAdd(int index, ConfigurationElement element) - { - UpdatePropertyNameMap(element); - - base.BaseAdd(index, element); - } - - /// - /// overridden so we can track previously seen property names - /// - /// - protected override void BaseAdd(ConfigurationElement element) - { - UpdatePropertyNameMap(element); - - base.BaseAdd(element); - } - - /// - /// Stores the name of the tools version in a case-insensitive map - /// so we can detect if it is specified more than once but with - /// different case - /// - /// - private void UpdatePropertyNameMap(ConfigurationElement element) - { - string propertyName = GetElementKey(element).ToString(); - - if (previouslySeenPropertyNames.ContainsKey(propertyName)) - { - string message = ResourceUtilities.FormatResourceString("MultipleDefinitionsForSameProperty", propertyName); - - throw new ConfigurationErrorsException(message, element.ElementInformation.Source, element.ElementInformation.LineNumber); - } - - previouslySeenPropertyNames.Add(propertyName, string.Empty); - } - - /// - /// Gets the key for the element - /// - /// element - /// key - protected override object GetElementKey(ConfigurationElement element) - { - return ((PropertyElement)element).Name; - } - - /// - /// Collection type - /// This has to be public as cannot change access modifier when overriding - /// - public override ConfigurationElementCollectionType CollectionType - { - get - { - return ConfigurationElementCollectionType.BasicMap; - } - } - - /// - /// Throw exception if an element with a duplicate is added - /// - protected override bool ThrowOnDuplicate - { - get - { - return false; - } - } - - /// - /// name of the element - /// - protected override string ElementName - { - get - { - return "property"; - } - } - - /// - /// Gets an element with the specified name - /// - /// name of the element - /// element - public PropertyElement GetElement(string name) - { - return (PropertyElement)this.BaseGet(name); - } - - /// - /// Gets an element at the specified position - /// - /// position - /// element - public PropertyElement GetElement(int index) - { - return (PropertyElement)this.BaseGet(index); - } - } - - /// - /// This class represents property element - /// - internal sealed class PropertyElement : ConfigurationElement - { - /// - /// name attribute - /// - [ConfigurationProperty("name", IsKey = true, IsRequired = true)] - public string Name - { - get - { - return (string)base["name"]; - } - set - { - base["name"] = value; - } - } - - /// - /// value attribute - /// - [ConfigurationProperty("value", IsRequired = true)] - public string Value - { - get - { - return (string)base["value"]; - } - set - { - base["value"] = value; - } - } - } - } - - /// - /// Delegate for unit test purposes only - /// - /// - internal delegate Configuration ReadApplicationConfiguration(); -} diff --git a/src/Deprecated/Engine/Engine/ToolsetReader.cs b/src/Deprecated/Engine/Engine/ToolsetReader.cs deleted file mode 100644 index 14f68b2d47a..00000000000 --- a/src/Deprecated/Engine/Engine/ToolsetReader.cs +++ /dev/null @@ -1,502 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.IO; -using System.Collections.Generic; -using Microsoft.Build.BuildEngine.Shared; -using error = Microsoft.Build.BuildEngine.Shared.ErrorUtilities; - -namespace Microsoft.Build.BuildEngine -{ - internal class PropertyDefinition - { - private string name = null; - private string value = null; - private string source = null; - - public PropertyDefinition(string name, string value, string source) - { - error.VerifyThrowArgumentLength(name, nameof(name)); - error.VerifyThrowArgumentLength(source, nameof(source)); - - // value can be the empty string but not null - error.VerifyThrowArgumentNull(value, nameof(value)); - - this.name = name; - this.value = value; - this.source = source; - } - - /// - /// The name of the property - /// - public string Name - { - get - { - return name; - } - } - - /// - /// The value of the property - /// - public string Value - { - get - { - return value; - } - } - - /// - /// A description of the location where the property was defined, - /// such as a registry key path or a path to a config file and - /// line number. - /// - public string Source - { - get - { - return source; - } - } - } - - internal abstract class ToolsetReader - { - /// - /// Gathers toolset data from both the registry and configuration file, if any - /// - /// - /// - /// - /// - internal static string ReadAllToolsets(ToolsetCollection toolsets, BuildPropertyGroup globalProperties, BuildPropertyGroup initialProperties) - { - return ReadAllToolsets(toolsets, null, null, globalProperties, initialProperties, ToolsetDefinitionLocations.ConfigurationFile | ToolsetDefinitionLocations.Registry); - } - - /// - /// Gathers toolset data from the registry and configuration file, if any: - /// allows you to specify which of the registry and configuration file to - /// read from by providing ToolsetInitialization - /// - /// - /// - /// - /// - /// - internal static string ReadAllToolsets(ToolsetCollection toolsets, BuildPropertyGroup globalProperties, BuildPropertyGroup initialProperties, ToolsetDefinitionLocations locations) - { - return ReadAllToolsets(toolsets, null, null, globalProperties, initialProperties, locations); - } - - /// - /// Gathers toolset data from the registry and configuration file, if any. - /// NOTE: this method is internal for unit testing purposes only. - /// - /// - /// - /// - /// - /// - /// - /// - internal static string ReadAllToolsets(ToolsetCollection toolsets, - ToolsetRegistryReader registryReader, - ToolsetConfigurationReader configurationReader, - BuildPropertyGroup globalProperties, - BuildPropertyGroup initialProperties, - ToolsetDefinitionLocations locations) - { - // The 2.0 .NET Framework installer did not write a ToolsVersion key for itself in the registry. - // The 3.5 installer writes one for 2.0, but 3.5 might not be installed. - // The 4.0 and subsequent installers can't keep writing the 2.0 one, because (a) it causes SxS issues and (b) we - // don't want it unless 2.0 is installed. - // So if the 2.0 framework is actually installed, and we're reading the registry, create a toolset for it. - // The registry and config file can overwrite it. - if ( - ((locations & ToolsetDefinitionLocations.Registry) != 0) && - !toolsets.Contains("2.0") && - FrameworkLocationHelper.PathToDotNetFrameworkV20 != null - ) - { - Toolset synthetic20Toolset = new Toolset("2.0", FrameworkLocationHelper.PathToDotNetFrameworkV20, initialProperties); - toolsets.Add(synthetic20Toolset); - } - - // The ordering here is important because the configuration file should have greater precedence - // than the registry - string defaultToolsVersionFromRegistry = null; - if ((locations & ToolsetDefinitionLocations.Registry) == ToolsetDefinitionLocations.Registry) - { - ToolsetRegistryReader registryReaderToUse = registryReader ?? new ToolsetRegistryReader(); - // We do not accumulate properties when reading them from the registry, because the order - // in which values are returned to us is essentially random: so we disallow one property - // in the registry to refer to another also in the registry - defaultToolsVersionFromRegistry = - registryReaderToUse.ReadToolsets(toolsets, globalProperties, initialProperties, false /* do not accumulate properties */); - } - - string defaultToolsVersionFromConfiguration = null; - if ((locations & ToolsetDefinitionLocations.ConfigurationFile) == ToolsetDefinitionLocations.ConfigurationFile) - { - if (configurationReader == null && ConfigurationFileMayHaveToolsets()) - { - // We haven't been passed in a fake configuration reader by a unit test, - // and it looks like we have a .config file to read, so create a real - // configuration reader - configurationReader = new ToolsetConfigurationReader(); - } - - if (configurationReader != null) - { - ToolsetConfigurationReader configurationReaderToUse = configurationReader ?? new ToolsetConfigurationReader(); - // Accumulation of properties is okay in the config file because it's deterministically ordered - defaultToolsVersionFromConfiguration = - configurationReaderToUse.ReadToolsets(toolsets, globalProperties, initialProperties, true /* accumulate properties */); - } - } - - // We'll use the default from the configuration file if it was specified, otherwise we'll try - // the one from the registry. It's possible (and valid) that neither the configuration file - // nor the registry specify a default, in which case we'll just return null. - string defaultToolsVersion = defaultToolsVersionFromConfiguration ?? defaultToolsVersionFromRegistry; - - // If we got a default version from the registry or config file, and it - // actually exists, fine. - // Otherwise we have to come up with one. - if (defaultToolsVersion == null || !toolsets.Contains(defaultToolsVersion)) - { - // We're going to choose a hard coded default tools version of 2.0. - defaultToolsVersion = Constants.defaultToolsVersion; - - // But don't overwrite any existing tools path for this default we're choosing. - if (!toolsets.Contains(Constants.defaultToolsVersion)) - { - // There's no tools path already for 2.0, so use the path to the v2.0 .NET Framework. - // If an old-fashioned caller sets BinPath property, or passed a BinPath to the constructor, - // that will overwrite what we're setting here. - ErrorUtilities.VerifyThrow(Constants.defaultToolsVersion == "2.0", "Getting 2.0 FX path so default should be 2.0"); - string pathToFramework = FrameworkLocationHelper.PathToDotNetFrameworkV20; - - // We could not find the default toolsversion because it was not installed on the machine. Fallback to the - // one we expect to always be there when running msbuild 4.0. - if (pathToFramework == null) - { - pathToFramework = FrameworkLocationHelper.PathToDotNetFrameworkV40; - defaultToolsVersion = Constants.defaultFallbackToolsVersion; - } - - // Again don't overwrite any existing tools path for this default we're choosing. - if (!toolsets.Contains(defaultToolsVersion)) - { - Toolset defaultToolset = new Toolset(defaultToolsVersion, pathToFramework, initialProperties); - toolsets.Add(defaultToolset); - } - } - } - - return defaultToolsVersion; - } - - /// - /// Creating a ToolsetConfigurationReader, and also reading toolsets from the - /// configuration file, are a little expensive. To try to avoid this cost if it's - /// not necessary, we'll check if the file exists first. If it exists, we'll scan for - /// the string "toolsVersion" to see if it might actually have any tools versions - /// defined in it. - /// - /// True if there may be toolset definitions, otherwise false - private static bool ConfigurationFileMayHaveToolsets() - { - bool result; - - try - { - result = (File.Exists(FileUtilities.CurrentExecutableConfigurationFilePath) - && File.ReadAllText(FileUtilities.CurrentExecutableConfigurationFilePath).Contains("toolsVersion")); - } - catch (Exception e) // Catching Exception, but rethrowing unless it's an IO related exception. - { - if (ExceptionHandling.NotExpectedException(e)) - { - throw; - } - - // There was some problem reading the config file: let the configuration reader - // encounter it - result = true; - } - - return result; - } - - /// - /// Populates the toolset collection passed in with the toolsets read from some location. - /// - /// Internal for unit testing only - /// - /// - /// - /// - /// the default tools version if available, or null otherwise - internal string ReadToolsets(ToolsetCollection toolsets, - BuildPropertyGroup globalProperties, - BuildPropertyGroup initialProperties, - bool accumulateProperties) - { - error.VerifyThrowArgumentNull(toolsets, nameof(toolsets)); - - ReadEachToolset(toolsets, globalProperties, initialProperties, accumulateProperties); - - string defaultToolsVersion = DefaultToolsVersion; - - // We don't check whether the default tools version actually - // corresponds to a toolset definition. That's because our default for - // the indefinite future is 2.0, and 2.0 might not be installed, which is fine. - // If a project tries to use 2.0 (or whatever the default is) in these circumstances - // they'll get a nice error saying that toolset isn't available and listing those that are. - return defaultToolsVersion; - } - - /// - /// Reads all the toolsets and populates the given ToolsetCollection with them - /// - /// - /// - /// - /// - private void ReadEachToolset(ToolsetCollection toolsets, - BuildPropertyGroup globalProperties, - BuildPropertyGroup initialProperties, - bool accumulateProperties) - { - foreach (PropertyDefinition toolsVersion in ToolsVersions) - { - // We clone here because we don't want to interfere with the evaluation - // of subsequent Toolsets; otherwise, properties found during the evaluation - // of this Toolset would be persisted in initialProperties and appear - // to later Toolsets as Global or Environment properties from the Engine. - BuildPropertyGroup initialPropertiesClone = initialProperties.Clone(true /* deep clone */); - Toolset toolset = ReadToolset(toolsVersion, globalProperties, initialPropertiesClone, accumulateProperties); - if (toolset != null) - { - toolsets.Add(toolset); - } - } - } - - /// - /// Reads the settings for a specified tools version - /// - /// - /// - /// - /// - /// - private Toolset ReadToolset(PropertyDefinition toolsVersion, - BuildPropertyGroup globalProperties, - BuildPropertyGroup initialProperties, - bool accumulateProperties) - { - // Initial properties is the set of properties we're going to use to expand property expressions like $(foo) - // in the values we read out of the registry or config file. We'll add to it as we pick up properties (including binpath) - // from the registry or config file, so that properties there can be referenced in values below them. - // After processing all the properties, we don't need initialProperties anymore. - string toolsPath = null; - string binPath = null; - BuildPropertyGroup properties = new BuildPropertyGroup(); - - IEnumerable rawProperties = GetPropertyDefinitions(toolsVersion.Name); - Expander expander = new Expander(initialProperties); - - foreach (PropertyDefinition property in rawProperties) - { - if (String.Equals(property.Name, ReservedPropertyNames.toolsPath, StringComparison.OrdinalIgnoreCase)) - { - toolsPath = ExpandProperty(property, expander); - toolsPath = ExpandRelativePathsRelativeToExeLocation(toolsPath); - - if (accumulateProperties) - { - SetProperty - ( - new PropertyDefinition(ReservedPropertyNames.toolsPath, toolsPath, property.Source), - initialProperties, - globalProperties - ); - } - } - else if (String.Equals(property.Name, ReservedPropertyNames.binPath, StringComparison.OrdinalIgnoreCase)) - { - binPath = ExpandProperty(property, expander); - binPath = ExpandRelativePathsRelativeToExeLocation(binPath); - - if (accumulateProperties) - { - SetProperty - ( - new PropertyDefinition(ReservedPropertyNames.binPath, binPath, property.Source), - initialProperties, - globalProperties - ); - } - } - else if (ReservedPropertyNames.IsReservedProperty(property.Name)) - { - // We don't allow toolsets to define reserved properties - string baseMessage = ResourceUtilities.FormatResourceString("CannotModifyReservedProperty", property.Name); - InvalidToolsetDefinitionException.Throw("InvalidPropertyNameInToolset", property.Name, property.Source, baseMessage); - } - else - { - // It's an arbitrary property - string propertyValue = ExpandProperty(property, expander); - PropertyDefinition expandedProperty = new PropertyDefinition(property.Name, propertyValue, property.Source); - - SetProperty(expandedProperty, properties, globalProperties); - - if (accumulateProperties) - { - SetProperty(expandedProperty, initialProperties, globalProperties); - } - } - - if (accumulateProperties) - { - expander = new Expander(initialProperties); - } - } - - // All tools versions must specify a value for MSBuildToolsPath (or MSBuildBinPath) - if (String.IsNullOrEmpty(toolsPath) && String.IsNullOrEmpty(binPath)) - { - InvalidToolsetDefinitionException.Throw("MSBuildToolsPathIsNotSpecified", toolsVersion.Name, toolsVersion.Source); - } - - // If both MSBuildBinPath and MSBuildToolsPath are present, they must be the same - if (toolsPath != null && binPath != null && !toolsPath.Equals(binPath, StringComparison.OrdinalIgnoreCase)) - { - return null; - } - - Toolset toolset = null; - - try - { - toolset = new Toolset(toolsVersion.Name, toolsPath ?? binPath, properties); - } - catch (ArgumentException e) - { - InvalidToolsetDefinitionException.Throw("ErrorCreatingToolset", toolsVersion.Name, e.Message); - } - - return toolset; - } - - /// - /// Expands the given unexpanded property expression using the properties in the - /// given BuildPropertyGroup. - /// - /// - /// - /// - private string ExpandProperty(PropertyDefinition property, Expander expander) - { - try - { - return expander.ExpandAllIntoStringLeaveEscaped(property.Value, null); - } - catch (InvalidProjectFileException ex) - { - InvalidToolsetDefinitionException.Throw(ex, "ErrorEvaluatingToolsetPropertyExpression", property.Value, property.Source, ex.Message); - } - - return string.Empty; - } - - /// - /// Sets the given property in the given property group. - /// - /// - /// - /// - private void SetProperty(PropertyDefinition property, BuildPropertyGroup propertyGroup, BuildPropertyGroup globalProperties) - { - try - { - // Global properties cannot be overwritten - if (globalProperties[property.Name] == null) - { - propertyGroup.SetProperty(property.Name, property.Value); - } - } - catch (ArgumentException ex) - { - InvalidToolsetDefinitionException.Throw(ex, "InvalidPropertyNameInToolset", property.Name, property.Source, ex.Message); - } - } - - /// - /// Given a path, de-relativizes it using the location of the currently - /// executing .exe as the base directory. For example, the path "..\foo" - /// becomes "c:\windows\microsoft.net\framework\foo" if the current exe is - /// "c:\windows\microsoft.net\framework\v3.5.1234\msbuild.exe". - /// If the path is not relative, it is returned without modification. - /// If the path is invalid, it is returned without modification. - /// - /// - /// - private string ExpandRelativePathsRelativeToExeLocation(string path) - { - try - { - // Trim, because we don't want to do anything with empty values - // (those should cause an error) - string trimmedValue = path.Trim(); - if (trimmedValue.Length > 0 && !Path.IsPathRooted(trimmedValue)) - { - path = Path.GetFullPath( - Path.Combine(FileUtilities.CurrentExecutableDirectory, trimmedValue)); - } - } - catch (Exception e) // Catching Exception, but rethrowing unless it's an IO related exception. - { - if (ExceptionHandling.NotExpectedException(e)) - { - throw; - } - // This means that the path looked relative, but was an invalid path. In this case, we'll - // just not expand it, and carry on - to be consistent with what happens when there's a - // non-relative bin path with invalid characters. The problem will be detected later when - // it's used in a project file. - } - - return path; - } - - /// - /// Returns the list of tools versions - /// - protected abstract IEnumerable ToolsVersions { get; } - - /// - /// Returns the default tools version, or null if none was specified - /// - protected abstract string DefaultToolsVersion { get; } - - /// - /// Provides an enumerator over property definitions for a specified tools version - /// - /// - /// - protected abstract IEnumerable GetPropertyDefinitions(string toolsVersion); - } -} diff --git a/src/Deprecated/Engine/Engine/ToolsetRegistryReader.cs b/src/Deprecated/Engine/Engine/ToolsetRegistryReader.cs deleted file mode 100644 index 1aca18c0ebd..00000000000 --- a/src/Deprecated/Engine/Engine/ToolsetRegistryReader.cs +++ /dev/null @@ -1,176 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System.Collections.Generic; -using error = Microsoft.Build.BuildEngine.Shared.ErrorUtilities; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// Reads registry at the base key and returns a Dictionary keyed on ToolsVersion. - /// Dictionary contains another dictionary of (property name, property value) pairs. - /// If a registry value is not a string, this will throw a InvalidToolsetDefinitionException. - /// An example of how the registry will look (note that the DefaultToolsVersion is per-MSBuild-version) - /// [HKLM]\SOFTWARE\Microsoft - /// msbuild - /// 3.5 - /// @DefaultToolsVersion = 2.0 - /// ToolsVersions - /// 2.0 - /// @MSBuildToolsPath = D:\SomeFolder - /// 3.5 - /// @MSBuildToolsPath = D:\SomeOtherFolder - /// @MSBuildBinPath = D:\SomeOtherFolder - /// @SomePropertyName = PropertyOtherValue - /// - internal class ToolsetRegistryReader : ToolsetReader - { - // Registry location for storing tools version dependent data for msbuild - private const string msbuildRegistryPath = @"SOFTWARE\Microsoft\MSBuild"; - - // Cached registry wrapper at root of the msbuild entries - private RegistryKeyWrapper msbuildRegistryWrapper; - - /// - /// Default constructor - /// - internal ToolsetRegistryReader() - : this(new RegistryKeyWrapper(msbuildRegistryPath)) - { - } - - /// - /// Constructor overload accepting a registry wrapper for unit testing purposes only - /// - /// - internal ToolsetRegistryReader(RegistryKeyWrapper msbuildRegistryWrapper) - { - error.VerifyThrowArgumentNull(msbuildRegistryWrapper, nameof(msbuildRegistryWrapper)); - - this.msbuildRegistryWrapper = msbuildRegistryWrapper; - } - - /// - /// Returns the list of tools versions - /// - protected override IEnumerable ToolsVersions - { - get - { - string[] toolsVersionNames = new string[] { }; - try - { - toolsVersionNames = msbuildRegistryWrapper.OpenSubKey("ToolsVersions").GetSubKeyNames(); - } - catch (RegistryException ex) - { - InvalidToolsetDefinitionException.Throw(ex, "RegistryReadError", ex.Source, ex.Message); - } - - foreach (string toolsVersionName in toolsVersionNames) - { - yield return new PropertyDefinition(toolsVersionName, string.Empty, msbuildRegistryWrapper.Name + "\\ToolsVersions\\" + toolsVersionName); - } - } - } - - /// - /// Returns the default tools version, or null if none was specified - /// - protected override string DefaultToolsVersion - { - get - { - // We expect to find the DefaultToolsVersion value under a registry key named for our - // version, e.g., "3.5" - RegistryKeyWrapper defaultToolsVersionKey = - msbuildRegistryWrapper.OpenSubKey(Constants.AssemblyVersion); - - if (defaultToolsVersionKey != null) - { - return GetValue(defaultToolsVersionKey, "DefaultToolsVersion"); - } - else - { - return null; - } - } - } - - /// - /// Provides an enumerator over property definitions for a specified tools version - /// - /// - /// - protected override IEnumerable GetPropertyDefinitions(string toolsVersion) - { - RegistryKeyWrapper toolsVersionWrapper = null; - - try - { - toolsVersionWrapper = msbuildRegistryWrapper.OpenSubKey("ToolsVersions\\" + toolsVersion); - } - catch (RegistryException ex) - { - InvalidToolsetDefinitionException.Throw(ex, "RegistryReadError", ex.Source, ex.Message); - } - - foreach (string propertyName in toolsVersionWrapper.GetValueNames()) - { - string propertyValue = null; - - if (propertyName?.Length == 0) - { - InvalidToolsetDefinitionException.Throw("PropertyNameInRegistryHasZeroLength", toolsVersionWrapper.Name); - } - - try - { - propertyValue = GetValue(toolsVersionWrapper, propertyName); - } - catch (RegistryException ex) - { - InvalidToolsetDefinitionException.Throw(ex, "RegistryReadError", ex.Source, ex.Message); - } - - yield return new PropertyDefinition(propertyName, propertyValue, toolsVersionWrapper.Name + "@" + propertyName); - } - } - - /// - /// Reads a string value from the specified registry key - /// - /// wrapper around key - /// name of the value - /// string data in the value - private static string GetValue(RegistryKeyWrapper wrapper, string valueName) - { - if (wrapper.Exists()) - { - object result = wrapper.GetValue(valueName); - - // RegistryKey.GetValue returns null if the value is not present - // and String.Empty if the value is present and no data is defined. - // We preserve this distinction, because a string property in the registry with - // no value really has an empty string for a value (which is a valid property value) - // rather than null for a value (which is an invalid property value) - if (result != null) - { - // Must be a value of string type - if (!(result is string)) - { - InvalidToolsetDefinitionException.Throw("NonStringDataInRegistry", wrapper.Name + "@" + valueName); - } - - return result.ToString(); - } - } - - return null; - } - } -} diff --git a/src/Deprecated/Engine/Engine/ToolsetState.cs b/src/Deprecated/Engine/Engine/ToolsetState.cs deleted file mode 100644 index b8e186065bb..00000000000 --- a/src/Deprecated/Engine/Engine/ToolsetState.cs +++ /dev/null @@ -1,342 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.IO; -using System.Xml; - -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - // internal delegates to make unit testing the TaskRegistry support easier - internal delegate string[] GetFiles(string path, string pattern); - internal delegate XmlDocument LoadXmlFromPath(string path); - - /// - /// Encapsulates all the state associated with a tools version. Each ToolsetState - /// aggregates a Toolset, which contains that part of the state that is externally visible. - /// - internal class ToolsetState - { - #region Constructors - /// - /// Internal constructor - /// - /// - /// - internal ToolsetState(Engine engine, Toolset toolset) - : this(engine, - toolset, - new GetFiles(Directory.GetFiles), - new LoadXmlFromPath(ToolsetState.LoadXmlDocumentFromPath) - ) - { - } - - /// - /// Additional constructor to make unit testing the TaskRegistry support easier - /// - /// - /// Internal for unit test purposes only. - /// - /// - /// - /// - /// - internal ToolsetState(Engine engine, - Toolset toolset, - GetFiles getFiles, - LoadXmlFromPath loadXmlFromPath - ) - { - this.parentEngine = engine; - this.loggingServices = engine.LoggingServices; - - ErrorUtilities.VerifyThrowArgumentNull(toolset, nameof(toolset)); - this.toolset = toolset; - - this.getFiles = getFiles; - this.loadXmlFromPath = loadXmlFromPath; - } - - #endregion - - #region Properties - /// - /// Associated Toolset (version name, toolset path, optional associated properties) - /// - internal Toolset Toolset - { - get - { - return this.toolset; - } - } - - /// - /// Tools version for this toolset - /// - internal string ToolsVersion - { - get - { - return this.toolset.ToolsVersion; - } - } - - /// - /// Tools path for this toolset - /// - internal string ToolsPath - { - get - { - return this.toolset.ToolsPath; - } - } - - /// - /// Wrapper for the Toolset property group - /// - internal BuildPropertyGroup BuildProperties - { - get - { - return this.toolset.BuildProperties; - } - } - - #endregion - - #region Methods - - /// - /// Used for validating the project (file) and its imported files against a designated schema. - /// - /// PERF NOTE: this property helps to delay creation of the ProjectSchemaValidationHandler object - /// - internal ProjectSchemaValidationHandler SchemaValidator(BuildEventContext buildEventContext) - { - if (schemaValidator == null) - { - schemaValidator = new ProjectSchemaValidationHandler(buildEventContext, loggingServices, toolset.ToolsPath); - } - - return schemaValidator; - } - - /// - /// Return a task registry stub for the tasks in the *.tasks file for this toolset - /// - /// - /// - internal ITaskRegistry GetTaskRegistry(BuildEventContext buildEventContext) - { - RegisterDefaultTasks(buildEventContext); - return defaultTaskRegistry; - } - - /// - /// Sets the default task registry to the provided value. - /// - /// - internal void SetTaskRegistry(ITaskRegistry taskRegistry) - { - ErrorUtilities.VerifyThrowArgumentNull(taskRegistry, nameof(taskRegistry)); - defaultTasksRegistrationAttempted = true; - defaultTaskRegistry = taskRegistry; - } - - /// - /// Method extracted strictly to make unit testing easier. - /// - /// - /// - private static XmlDocument LoadXmlDocumentFromPath(string path) - { - XmlDocument xmlDocumentFromPath = new XmlDocument(); - xmlDocumentFromPath.Load(path); - return xmlDocumentFromPath; - } - - /// - /// Used to load information about default MSBuild tasks i.e. tasks that do not need to be explicitly declared in projects - /// with the <UsingTask> element. Default task information is read from special files, which are located in the same - /// directory as the MSBuild binaries. - /// - /// - /// 1) a default tasks file needs the <Project> root tag in order to be well-formed - /// 2) the XML declaration tag <?xml ...> is ignored - /// 3) comment tags are always ignored regardless of their placement - /// 4) the rest of the tags are expected to be <UsingTask> tags - /// - private void RegisterDefaultTasks(BuildEventContext buildEventContext) - { - if (!defaultTasksRegistrationAttempted) - { - try - { - this.defaultTaskRegistry = new TaskRegistry(); - - string[] defaultTasksFiles = { }; - - try - { - defaultTasksFiles = getFiles(toolset.ToolsPath, defaultTasksFilePattern); - - if (defaultTasksFiles.Length == 0) - { - loggingServices.LogWarning(buildEventContext, new BuildEventFileInfo(/* this warning truly does not involve any file */ String.Empty), - "DefaultTasksFileLoadFailureWarning", - defaultTasksFilePattern, toolset.ToolsPath, String.Empty); - } - } - // handle security problems when finding the default tasks files - catch (UnauthorizedAccessException e) - { - loggingServices.LogWarning(buildEventContext, new BuildEventFileInfo(/* this warning truly does not involve any file */ String.Empty), - "DefaultTasksFileLoadFailureWarning", - defaultTasksFilePattern, toolset.ToolsPath, e.Message); - } - // handle problems when reading the default tasks files - catch (Exception e) // Catching Exception, but rethrowing unless it's an IO related exception. - { - if (ExceptionHandling.NotExpectedException(e)) - { - throw; - } - - loggingServices.LogWarning(buildEventContext, new BuildEventFileInfo(/* this warning truly does not involve any file */ String.Empty), - "DefaultTasksFileLoadFailureWarning", - defaultTasksFilePattern, toolset.ToolsPath, e.Message); - } - - BuildPropertyGroup propertyBag = null; - - foreach (string defaultTasksFile in defaultTasksFiles) - { - try - { - XmlDocument defaultTasks = loadXmlFromPath(defaultTasksFile); - - // look for the first root tag that is not a comment or an XML declaration -- this should be the tag - // NOTE: the XML parser will guarantee there is only one real root element in the file - // but we need to find it amongst the other types of XmlNode at the root. - foreach (XmlNode topLevelNode in defaultTasks.ChildNodes) - { - if (XmlUtilities.IsXmlRootElement(topLevelNode)) - { - ProjectErrorUtilities.VerifyThrowInvalidProject(topLevelNode.LocalName == XMakeElements.project, - topLevelNode, "UnrecognizedElement", topLevelNode.Name); - - ProjectErrorUtilities.VerifyThrowInvalidProject((topLevelNode.Prefix.Length == 0) && (String.Equals(topLevelNode.NamespaceURI, XMakeAttributes.defaultXmlNamespace, StringComparison.OrdinalIgnoreCase)), - topLevelNode, "ProjectMustBeInMSBuildXmlNamespace", XMakeAttributes.defaultXmlNamespace); - - // the tag can only the XML namespace -- no other attributes - foreach (XmlAttribute projectAttribute in topLevelNode.Attributes) - { - ProjectXmlUtilities.VerifyThrowProjectInvalidAttribute(projectAttribute.Name == XMakeAttributes.xmlns, projectAttribute); - } - - // look at all the child tags of the root tag we found - foreach (XmlNode usingTaskNode in topLevelNode.ChildNodes) - { - if (usingTaskNode.NodeType != XmlNodeType.Comment) - { - ProjectErrorUtilities.VerifyThrowInvalidProject(usingTaskNode.Name == XMakeElements.usingTask, - usingTaskNode, "UnrecognizedElement", usingTaskNode.Name); - - // Initialize the property bag if it hasn't been already. - if (propertyBag == null) - { - // Set the value of the MSBuildBinPath/ToolsPath properties. - BuildPropertyGroup reservedPropertyBag = new BuildPropertyGroup(); - - reservedPropertyBag.SetProperty( - new BuildProperty(ReservedPropertyNames.binPath, EscapingUtilities.Escape(toolset.ToolsPath), - PropertyType.ReservedProperty)); - - reservedPropertyBag.SetProperty( - new BuildProperty(ReservedPropertyNames.toolsPath, EscapingUtilities.Escape(toolset.ToolsPath), - PropertyType.ReservedProperty)); - - // Also set MSBuildAssemblyVersion so that the tasks file can tell between v4 and v12 MSBuild - reservedPropertyBag.SetProperty( - new BuildProperty(ReservedPropertyNames.assemblyVersion, Constants.AssemblyVersion, - PropertyType.ReservedProperty)); - - propertyBag = new BuildPropertyGroup(); - propertyBag.ImportInitialProperties(parentEngine.EnvironmentProperties, reservedPropertyBag, BuildProperties, parentEngine.GlobalProperties); - } - - defaultTaskRegistry.RegisterTask(new UsingTask((XmlElement)usingTaskNode, true), new Expander(propertyBag), loggingServices, buildEventContext); - } - } - - break; - } - } - } - // handle security problems when loading the default tasks file - catch (UnauthorizedAccessException e) - { - loggingServices.LogError(buildEventContext, new BuildEventFileInfo(defaultTasksFile), "DefaultTasksFileFailure", e.Message); - break; - } - // handle problems when loading the default tasks file - catch (IOException e) - { - loggingServices.LogError(buildEventContext, new BuildEventFileInfo(defaultTasksFile), "DefaultTasksFileFailure", e.Message); - break; - } - // handle XML errors in the default tasks file - catch (XmlException e) - { - ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(false, new BuildEventFileInfo(e), - "DefaultTasksFileFailure", e.Message); - } - } - } - finally - { - defaultTasksRegistrationAttempted = true; - } - } - } - #endregion - - #region Data - // The parent Engine object used for logging - private Engine parentEngine; - - // Logging service for posting messages - private EngineLoggingServices loggingServices; - - // The settings for this toolset (version name, path, and properties) - private Toolset toolset; - - // these files list all default tasks and task assemblies that do not need to be explicitly declared by projects - private const string defaultTasksFilePattern = "*.tasks"; - - // indicates if the default tasks file has already been scanned - private bool defaultTasksRegistrationAttempted = false; - - // holds all the default tasks we know about and the assemblies they exist in - private ITaskRegistry defaultTaskRegistry = null; - - // used for validating the project (file) and its imported files against a designated schema - private ProjectSchemaValidationHandler schemaValidator; - - // private delegates to make unit testing the TaskRegistry support easier - private GetFiles getFiles = null; - private LoadXmlFromPath loadXmlFromPath = null; - - #endregion - } -} diff --git a/src/Deprecated/Engine/Engine/UsingTask.cs b/src/Deprecated/Engine/Engine/UsingTask.cs deleted file mode 100644 index 7fe49860a72..00000000000 --- a/src/Deprecated/Engine/Engine/UsingTask.cs +++ /dev/null @@ -1,331 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Xml; - -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// This class represents a single UsingTask element in a project file - /// - /// - /// [!WARNING] - /// > This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// LukaszG - public class UsingTask - { - #region Properties - - private bool importedFromAnotherProject; - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Returns true if this UsingTask was imported from another project - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// LukaszG - public bool IsImported - { - get { return this.importedFromAnotherProject; } - } - - private XmlAttribute taskNameAttribute = null; - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// The task name - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// LukaszG - public string TaskName - { - get { return this.taskNameAttribute?.Value; } - } - - /// - /// Internal accessor for the task name XML attribute - /// - internal XmlAttribute TaskNameAttribute - { - get { return this.taskNameAttribute; } - } - - private XmlAttribute assemblyNameAttribute = null; - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// The name of the assembly containing the task - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// LukaszG - public string AssemblyName - { - get { return this.assemblyNameAttribute?.Value; } - } - - /// - /// Internal accessor for the assembly name XML attribute - /// - internal XmlAttribute AssemblyNameAttribute - { - get { return this.assemblyNameAttribute; } - } - - private XmlAttribute assemblyFileAttribute = null; - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// The assembly file containing the task - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// LukaszG - public string AssemblyFile - { - get { return this.assemblyFileAttribute?.Value; } - } - - /// - /// Internal accessor for the assembly file XML attribute - /// - internal XmlAttribute AssemblyFileAttribute - { - get { return this.assemblyFileAttribute; } - } - - private XmlAttribute conditionAttribute = null; - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// The condition string for this UsingTask - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// LukaszG - public string Condition - { - get { return this.conditionAttribute?.Value; } - } - - /// - /// Internal accessor for the condition XML attribute - /// - internal XmlAttribute ConditionAttribute - { - get { return this.conditionAttribute; } - } - - #endregion - - #region Constructors - - /// - /// Creates a new UsingTask object - /// - /// - /// - /// LukaszG - internal UsingTask(XmlElement usingTaskNode, bool isImported) - { - this.importedFromAnotherProject = isImported; - - // make sure this really is a tag - ErrorUtilities.VerifyThrow(usingTaskNode.Name == XMakeElements.usingTask, - "Expected <{0}> element; received <{1}> element.", XMakeElements.usingTask, usingTaskNode.Name); - - bool illegalChildElementFound = false; - XmlElement illegalChildElement = null; - - foreach (XmlElement childElement in usingTaskNode.ChildNodes) - { - switch (childElement.Name) - { - case XMakeElements.usingTaskBody: - // ignore - break; - case XMakeElements.usingTaskParameter: - // ignore - break; - case XMakeElements.usingTaskParameterGroup: - // ignore - break; - default: - illegalChildElementFound = true; - illegalChildElement = childElement; - break; - } - - if (illegalChildElementFound) - { - break; - } - } - - // UsingTask has no valid child elements in 3.5 syntax, but in 4.0 syntax it does. - // So ignore any valid 4.0 child elements and try to load the project as usual, but - // still error out if something we don't expect is found. - if (illegalChildElementFound) - { - ProjectXmlUtilities.ThrowProjectInvalidChildElement(illegalChildElement); - } - - foreach (XmlAttribute usingTaskAttribute in usingTaskNode.Attributes) - { - switch (usingTaskAttribute.Name) - { - // get the task name - case XMakeAttributes.taskName: - taskNameAttribute = usingTaskAttribute; - break; - - // get the assembly name or the assembly file/path, whichever is specified... - case XMakeAttributes.assemblyName: - assemblyNameAttribute = usingTaskAttribute; - break; - - case XMakeAttributes.assemblyFile: - assemblyFileAttribute = usingTaskAttribute; - break; - - // ignore any RequiredRuntime XML attribute - // (we'll make this actually do something when we run on a CLR other than v2.0) - case XMakeAttributes.requiredRuntime: - // Do nothing - break; - - // get the condition, if any - case XMakeAttributes.condition: - conditionAttribute = usingTaskAttribute; - break; - - // This is only recognized by the new OM: - // Just ignore it - case XMakeAttributes.requiredPlatform: - // Do nothing - break; - - // This is only recognized by the new OM: - // Just ignore it - case XMakeAttributes.taskFactory: - // Do nothing - break; - - // This is only recognized by the new OM: - // Just ignore it - case XMakeAttributes.runtime: - // Do nothing - break; - - // This is only recognized by the new OM: - // Just ignore it - case XMakeAttributes.architecture: - // Do nothing - break; - - default: - ProjectXmlUtilities.ThrowProjectInvalidAttribute(usingTaskAttribute); - break; - } - } - - ProjectErrorUtilities.VerifyThrowInvalidProject(taskNameAttribute != null, - usingTaskNode, "MissingRequiredAttribute", XMakeAttributes.taskName, XMakeElements.usingTask); - ProjectErrorUtilities.VerifyThrowInvalidProject(taskNameAttribute.Value.Length > 0, - taskNameAttribute, "InvalidAttributeValue", taskNameAttribute.Value, XMakeAttributes.taskName, XMakeElements.usingTask); - - ProjectErrorUtilities.VerifyThrowInvalidProject((assemblyNameAttribute != null) || (assemblyFileAttribute != null), - usingTaskNode, "UsingTaskAssemblySpecification", XMakeElements.usingTask, XMakeAttributes.assemblyName, XMakeAttributes.assemblyFile); - ProjectErrorUtilities.VerifyThrowInvalidProject((assemblyNameAttribute == null) || (assemblyFileAttribute == null), - usingTaskNode, "UsingTaskAssemblySpecification", XMakeElements.usingTask, XMakeAttributes.assemblyName, XMakeAttributes.assemblyFile); - - ProjectErrorUtilities.VerifyThrowInvalidProject((assemblyNameAttribute == null) || (assemblyNameAttribute.Value.Length > 0), - assemblyNameAttribute, "InvalidAttributeValue", String.Empty, XMakeAttributes.assemblyName, XMakeElements.usingTask); - ProjectErrorUtilities.VerifyThrowInvalidProject((assemblyFileAttribute == null) || (assemblyFileAttribute.Value.Length > 0), - assemblyFileAttribute, "InvalidAttributeValue", String.Empty, XMakeAttributes.assemblyFile, XMakeElements.usingTask); - } - - #endregion - } -} diff --git a/src/Deprecated/Engine/Engine/UsingTaskCollection.cs b/src/Deprecated/Engine/Engine/UsingTaskCollection.cs deleted file mode 100644 index 90e3cfd0e0f..00000000000 --- a/src/Deprecated/Engine/Engine/UsingTaskCollection.cs +++ /dev/null @@ -1,267 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections; - -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// This class represents a collection of all UsingTask elements in a given project file. - /// - /// - /// [!WARNING] - /// > This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// LukaszG - public class UsingTaskCollection : IEnumerable, ICollection - { - #region Properties - - private ArrayList usingTasks; - - #endregion - - #region Constructors - - /// - /// Constructor exposed to the outside world - /// - /// LukaszG - internal UsingTaskCollection() - { - this.usingTasks = new ArrayList(); - } - - #endregion - - #region IEnumerable Members - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// IEnumerable member method for returning the enumerator - /// - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// LukaszG - public IEnumerator GetEnumerator() - { - ErrorUtilities.VerifyThrow(this.usingTasks != null, "UsingTaskCollection's ArrayList not initialized!"); - return this.usingTasks.GetEnumerator(); - } - - #endregion - - #region ICollection Members - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// ICollection member method for copying the contents of this collection into an array - /// - /// - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// LukaszG - public void CopyTo(Array array, int index) - { - ErrorUtilities.VerifyThrow(this.usingTasks != null, "UsingTaskCollection's ArrayList not initialized!"); - this.usingTasks.CopyTo(array, index); - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// - /// Microsoft.Build.Execution - /// ICollection member property for returning the number of items in this collection - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// LukaszG - public int Count - { - get - { - ErrorUtilities.VerifyThrow(this.usingTasks != null, "UsingTaskCollection's ArrayList not initialized!"); - return this.usingTasks.Count; - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// ICollection member property for determining whether this collection is thread-safe - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// LukaszG - public bool IsSynchronized - { - get - { - ErrorUtilities.VerifyThrow(this.usingTasks != null, "UsingTaskCollection's ArrayList not initialized!"); - return this.usingTasks.IsSynchronized; - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// ICollection member property for returning this collection's synchronization object - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// LukaszG - public object SyncRoot - { - get - { - ErrorUtilities.VerifyThrow(this.usingTasks != null, "UsingTaskCollection's ArrayList not initialized!"); - return this.usingTasks.SyncRoot; - } - } - - #endregion - - #region Members - - /// - /// Removes all UsingTasks from this collection. Does not alter the parent project's XML. - /// - /// LukaszG - internal void Clear() - { - ErrorUtilities.VerifyThrow(this.usingTasks != null, "UsingTaskCollection's ArrayList not initialized!"); - this.usingTasks.Clear(); - } - - /// - /// Adds a new UsingTask to this collection. Does not alter the parent project's XML. - /// - /// - /// LukaszG - internal void Add(UsingTask usingTask) - { - ErrorUtilities.VerifyThrow(this.usingTasks != null, "UsingTaskCollection's ArrayList not initialized!"); - this.usingTasks.Add(usingTask); - } - - /// - /// Gets the UsingTask object with the given index - /// - /// - /// - /// LukaszG - internal UsingTask this[int index] - { - get - { - ErrorUtilities.VerifyThrow(this.usingTasks != null, "UsingTaskCollection's ArrayList not initialized!"); - return (UsingTask)this.usingTasks[index]; - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Copy the contents of this collection into a strongly typed array - /// - /// - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// LukaszG - public void CopyTo(UsingTask[] array, int index) - { - ErrorUtilities.VerifyThrow(this.usingTasks != null, "UsingTaskCollection's ArrayList not initialized!"); - this.usingTasks.CopyTo(array, index); - } - - #endregion - } -} diff --git a/src/Deprecated/Engine/Engine/Utilities.cs b/src/Deprecated/Engine/Engine/Utilities.cs deleted file mode 100644 index 051e2f92fd9..00000000000 --- a/src/Deprecated/Engine/Engine/Utilities.cs +++ /dev/null @@ -1,623 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Xml; -using System.Collections; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Text.RegularExpressions; - -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// This class contains utility methods for the MSBuild engine. - /// - /// - /// [!WARNING] - /// > This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// RGoel - public static class Utilities - { - private static readonly Regex singlePropertyRegex = new Regex(@"^\$\(([^\$\(\)]*)\)$"); - - /// - /// Update our table which keeps track of all the properties that are referenced - /// inside of a condition and the string values that they are being tested against. - /// So, for example, if the condition was " '$(Configuration)' == 'Debug' ", we - /// would get passed in leftValue="$(Configuration)" and rightValueExpanded="Debug". - /// This call would add the string "Debug" to the list of possible values for the - /// "Configuration" property. - /// - /// This method also handles the case when two or more properties are being - /// concatenated together with a vertical bar, as in ' - /// $(Configuration)|$(Platform)' == 'Debug|x86' - /// - /// - /// - /// - /// rgoel - internal static void UpdateConditionedPropertiesTable - ( - Hashtable conditionedPropertiesTable, // Hash table containing a StringCollection - // of possible values, keyed by property name. - - string leftValue, // The raw value on the left side of the operator - - string rightValueExpanded // The fully expanded value on the right side - // of the operator. - ) - { - if ((conditionedPropertiesTable != null) && (rightValueExpanded.Length > 0)) - { - // The left side should be exactly "$(propertyname)" or "$(propertyname1)|$(propertyname2)" - // or "$(propertyname1)|$(propertyname2)|$(propertyname3)", etc. Anything else, - // and we don't touch the table. - - // Split up the leftValue into pieces based on the vertical bar character. - string[] leftValuePieces = leftValue.Split(new char[] { '|' }); - - // Loop through each of the pieces. - for (int i = 0; i < leftValuePieces.Length; i++) - { - Match singlePropertyMatch = singlePropertyRegex.Match(leftValuePieces[i]); - - if (singlePropertyMatch.Success) - { - // Find the first vertical bar on the right-hand-side expression. - int indexOfVerticalBar = rightValueExpanded.IndexOf('|'); - string rightValueExpandedPiece; - - // If there was no vertical bar, then just use the remainder of the right-hand-side - // expression as the value of the property, and terminate the loop after this iteration. - // Also, if we're on the last segment of the left-hand-side, then use the remainder - // of the right-hand-side expression as the value of the property. - if ((indexOfVerticalBar == -1) || (i == (leftValuePieces.Length - 1))) - { - rightValueExpandedPiece = rightValueExpanded; - i = leftValuePieces.Length; - } - else - { - // If we found a vertical bar, then the portion before the vertical bar is the - // property value which we will store in our table. Then remove that portion - // from the original string so that the next iteration of the loop can easily search - // for the first vertical bar again. - rightValueExpandedPiece = rightValueExpanded.Substring(0, indexOfVerticalBar); - rightValueExpanded = rightValueExpanded.Substring(indexOfVerticalBar + 1); - } - - // Capture the property name out of the regular expression. - string propertyName = singlePropertyMatch.Groups[1].ToString(); - - // Get the string collection for this property name, if one already exists. - StringCollection conditionedPropertyValues = - (StringCollection)conditionedPropertiesTable[propertyName]; - - // If this property is not already represented in the table, add a new entry - // for it. - if (conditionedPropertyValues == null) - { - conditionedPropertyValues = new StringCollection(); - conditionedPropertiesTable[propertyName] = conditionedPropertyValues; - } - - // If the "rightValueExpanded" is not already in the string collection - // for this property name, add it now. - if (!conditionedPropertyValues.Contains(rightValueExpandedPiece)) - { - conditionedPropertyValues.Add(rightValueExpandedPiece); - } - } - } - } - } - - /* - * Method: GatherReferencedPropertyNames - * Owner: DavidLe - * - * Find and record all of the properties that are referenced in the given - * condition. - * - * FUTURE: it is unfortunate that we have to completely parse+evaluate the expression - */ - internal static void GatherReferencedPropertyNames - ( - string condition, // Can be null - XmlAttribute conditionAttribute, // XML attribute on which the condition is evaluated - Expander expander, // The set of properties to use for expansion - Hashtable conditionedPropertiesTable // Can be null - ) - { - EvaluateCondition(condition, conditionAttribute, expander, conditionedPropertiesTable, ParserOptions.AllowProperties | ParserOptions.AllowItemLists, null, null); - } - - // An array of hashtables with cached expression trees for all the combinations of condition strings - // and parser options - private static volatile Hashtable[] cachedExpressionTrees = new Hashtable[8 /* == ParserOptions.AllowAll*/] - { - new Hashtable(StringComparer.OrdinalIgnoreCase), new Hashtable(StringComparer.OrdinalIgnoreCase), - new Hashtable(StringComparer.OrdinalIgnoreCase), new Hashtable(StringComparer.OrdinalIgnoreCase), - new Hashtable(StringComparer.OrdinalIgnoreCase), new Hashtable(StringComparer.OrdinalIgnoreCase), - new Hashtable(StringComparer.OrdinalIgnoreCase), new Hashtable(StringComparer.OrdinalIgnoreCase) - }; - - /// - /// Evaluates a string representing a condition from a "condition" attribute. - /// If the condition is a malformed string, it throws an InvalidProjectFileException. - /// This method uses cached expression trees to avoid generating them from scratch every time it's called. - /// This method is thread safe and is called from engine and task execution module threads - /// - /// Can be null - /// XML attribute on which the condition is evaluated - /// All the data available for expanding embedded properties, metadata, and items - /// - /// true, if the expression evaluates to true, otherwise false - internal static bool EvaluateCondition - ( - string condition, - XmlAttribute conditionAttribute, - Expander expander, - ParserOptions itemListOptions, - Project parentProject - ) - { - return EvaluateCondition(condition, - conditionAttribute, - expander, - parentProject.ConditionedProperties, - itemListOptions, - parentProject.ParentEngine.LoggingServices, - parentProject.ProjectBuildEventContext); - } - - /// - /// Evaluates a string representing a condition from a "condition" attribute. - /// If the condition is a malformed string, it throws an InvalidProjectFileException. - /// This method uses cached expression trees to avoid generating them from scratch every time it's called. - /// This method is thread safe and is called from engine and task execution module threads - /// - /// Can be null - /// XML attribute on which the condition is evaluated - /// All the data available for expanding embedded properties, metadata, and items - /// - /// Can be null - /// contains contextual information for logging events - /// true, if the expression evaluates to true, otherwise false - internal static bool EvaluateCondition - ( - string condition, - XmlAttribute conditionAttribute, - Expander expander, - ParserOptions itemListOptions, - EngineLoggingServices loggingServices, - BuildEventContext buildEventContext - ) - { - return EvaluateCondition(condition, - conditionAttribute, - expander, - null, - itemListOptions, - loggingServices, - buildEventContext); - } - - /// - /// Evaluates a string representing a condition from a "condition" attribute. - /// If the condition is a malformed string, it throws an InvalidProjectFileException. - /// This method uses cached expression trees to avoid generating them from scratch every time it's called. - /// This method is thread safe and is called from engine and task execution module threads - /// - /// Can be null - /// XML attribute on which the condition is evaluated - /// All the data available for expanding embedded properties, metadata, and items - /// Can be null - /// - /// Can be null - /// contains contextual information for logging events - /// true, if the expression evaluates to true, otherwise false - internal static bool EvaluateCondition - ( - string condition, - XmlAttribute conditionAttribute, - Expander expander, - Hashtable conditionedPropertiesTable, - ParserOptions itemListOptions, - EngineLoggingServices loggingServices, - BuildEventContext buildEventContext - ) - { - ErrorUtilities.VerifyThrow((conditionAttribute != null) || (string.IsNullOrEmpty(condition)), - "If condition is non-empty, you must provide the XML node representing the condition."); - - // An empty condition is equivalent to a "true" condition. - if (string.IsNullOrEmpty(condition)) - { - return true; - } - - Hashtable cachedExpressionTreesForCurrentOptions = cachedExpressionTrees[(int)itemListOptions]; - - // Try and see if we have an expression tree for this condition already - GenericExpressionNode parsedExpression = (GenericExpressionNode)cachedExpressionTreesForCurrentOptions[condition]; - - if (parsedExpression == null) - { - Parser conditionParser = new Parser(); - - #region REMOVE_COMPAT_WARNING - conditionParser.LoggingServices = loggingServices; - conditionParser.LogBuildEventContext = buildEventContext; - #endregion - - parsedExpression = conditionParser.Parse(condition, conditionAttribute, itemListOptions); - - // It's possible two threads will add a different tree to the same entry in the hashtable, - // but it should be rare and it's not a problem - the previous entry will be thrown away. - // We could ensure no dupes with double check locking but it's not really necessary here. - // Also, we don't want to lock on every read. - lock (cachedExpressionTreesForCurrentOptions) - { - cachedExpressionTreesForCurrentOptions[condition] = parsedExpression; - } - } - - ConditionEvaluationState state = new ConditionEvaluationState(conditionAttribute, expander, conditionedPropertiesTable, condition); - bool result; - - // We are evaluating this expression now and it can cache some state for the duration, - // so we don't want multiple threads working on the same expression - lock (parsedExpression) - { - result = parsedExpression.Evaluate(state); - parsedExpression.ResetState(); - } - - return result; - } - - /// - /// Sets the inner XML/text of the given XML node, escaping as necessary. - /// - /// SumedhK - /// - /// Can be empty string, but not null. - internal static void SetXmlNodeInnerContents(XmlNode node, string s) - { - ErrorUtilities.VerifyThrow(s != null, "Need value to set."); - - if (s.IndexOf('<') != -1) - { - // If the value looks like it probably contains XML markup ... - try - { - // Attempt to store it verbatim as XML. - node.InnerXml = s; - return; - } - catch (XmlException) - { - // But that may fail, in the event that "s" is not really well-formed - // XML. Eat the exception and fall through below ... - } - } - - // The value does not contain valid XML markup. Store it as text, so it gets - // escaped properly. - node.InnerText = s; - } - - /// - /// Extracts the inner XML/text of the given XML node, unescaping as necessary. - /// - /// SumedhK - /// - /// Inner XML/text of specified node. - internal static string GetXmlNodeInnerContents(XmlNode node) - { - // XmlNode.InnerXml gives back a string that consists of the set of characters - // in between the opening and closing elements of the XML node, without doing any - // unescaping. Any "strange" character sequences (like "" will remain - // exactly so and will not be translated or interpreted. The only modification that - // .InnerXml will do is that it will normalize any Xml contained within. This means - // normalizing whitespace between XML attributes and quote characters that surround XML - // attributes. If PreserveWhitespace is false, then it will also normalize whitespace - // between elements. - // - // XmlNode.InnerText strips out any Xml contained within, and then unescapes the rest - // of the text. So if the remaining text contains certain character sequences such as - // "&" or "", these will be translated into their equivalent representations. - // - // It's hard to explain, but much easier to demonstrate with examples: - // - // Original XML XmlNode.InnerText XmlNode.InnerXml - // =========================== ============================== ====================================== - // - // whatever - // - // 123456 123456 123456 - // - // 123456 123456 123456 - // - // 123456 123456 123456 - // - // 123&456 123&456 123&456 - - // So the trick for MSBuild when interpreting a property value is to know which one to - // use ... InnerXml or InnerText. There are two basic scenarios we care about. - // - // 1.) The first scenario is that the user is trying to create a property whose - // contents are actually XML. That is to say that the contents may be written - // to a XML file, or may be passed in as a string to XmlDocument.LoadXml. - // In this case, we would want to use XmlNode.InnerXml, because we DO NOT want - // character sequences to be unescaped. If we did unescape them, then whatever - // XML parser tried to read in the stream as XML later on would totally barf. - // - // 2.) The second scenario is the the user is trying to create a property that - // is just intended to be treated as a string. That string may be very large - // and could contain all sorts of whitespace, carriage returns, special characters, - // etc. But in the end, it's just a big string. In this case, whatever - // task is actually processing this string ... it's not going to know anything - // about character sequences such as & and <. These character sequences - // are specific to XML markup. So, here we want to use XmlNode.InnerText so that - // the character sequences get unescaped into their actual character before - // the string is passed to the task (or wherever else the property is used). - // Of course, if the string value of the property needs to contain characters - // like <, >, &, etc., then the user must XML escape these characters otherwise - // the XML parser reading the project file will croak. Or if the user doesn't - // want to escape every instance of these characters, he can surround the whole - // thing with a CDATA tag. Again, if he does this, we don't want the task to - // receive the C, D, A, T, A as part of the string ... this should be stripped off. - // Again, using XmlNode.InnerText takes care of this. - // - // 2b.) A variation of the second scenario is that the user is trying to create a property - // that is just intended to be a string, but wants to comment out part of the string. - // For example, it's a semicolon separated list that's going ultimately to end up in a list. - // eg. (DDB #56841) - // - // - // - // ndp\fx\src\VSIP\FrameWork; - // ndp\fx\src\xmlTools; - // ddsuites\src\vs\xmlTools; - // - // - // In this case, we want to treat the string as text, so that we don't retrieve the comment. - // We only want to retrieve the comment if there's some other XML in there. The - // mere presence of an XML comment shouldn't make us think the value is XML. - // - // Given these two scenarios, how do we know whether the user intended to treat - // a property value as XML or text? We use a simple heuristic which is that if - // XmlNode.InnerXml contains any "<" characters, then there pretty much has to be - // XML in there, so we'll just use XmlNode.InnerXml. If there are no "<" characters that aren't merely comments, - // then we assume it's to be treated as text and we use XmlNode.InnerText. Also, if - // it looks like the whole thing is one big CDATA block, then we also use XmlNode.InnerText. - - // XmlNode.InnerXml is much more expensive than InnerText. Don't use it for trivial cases. - // (single child node with a trivial value or no child nodes) - if (!node.HasChildNodes) - { - return string.Empty; - } - - if (node.ChildNodes.Count == 1 && (node.FirstChild.NodeType == XmlNodeType.Text || node.FirstChild.NodeType == XmlNodeType.CDATA)) - { - return node.InnerText; - } - - string innerXml = node.InnerXml; - - // If there is no markup under the XML node (detected by the presence - // of a '<' sign - int firstLessThan = innerXml.IndexOf('<'); - if (firstLessThan == -1) - { - // return the inner text so it gets properly unescaped - return node.InnerText; - } - - bool containsNoTagsOtherThanComments = ContainsNoTagsOtherThanComments(innerXml, firstLessThan); - - // ... or if the only XML is comments, - if (containsNoTagsOtherThanComments) - { - // return the inner text so the comments are stripped - // (this is how one might comment out part of a list in a property value) - return node.InnerText; - } - - // ...or it looks like the whole thing is a big CDATA tag ... - bool startsWithCData = (innerXml.IndexOf(" - /// Figure out whether there are any XML tags, other than comment tags, - /// in the string. - /// - /// - /// We know the string coming in is a valid XML fragment. (The project loaded after all.) - /// So for example we can ignore an open comment tag without a matching closing comment tag. - /// - private static bool ContainsNoTagsOtherThanComments(string innerXml, int firstLessThan) - { - bool insideComment = false; - for (int i = firstLessThan; i < innerXml.Length; i++) - { - if (!insideComment) - { - // XML comments start with exactly "" - if (i < innerXml.Length - 2 - && innerXml[i] == '-' - && innerXml[i + 1] == '-' - && innerXml[i + 2] == '>') - { - // Found the end of a comment - insideComment = false; - i += 2; - continue; - } - } - } - - // Didn't find any tags, except possibly comments - return true; - } - - // used to find the xmlns attribute - private static readonly Regex xmlnsPattern = new Regex("xmlns=\"[^\"]*\"\\s*"); - - /// - /// Removes the xmlns attribute from an XML string. - /// - /// SumedhK - /// XML string to process. - /// The modified XML string. - internal static string RemoveXmlNamespace(string xml) - { - return xmlnsPattern.Replace(xml, String.Empty); - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Escapes given string, that is replaces special characters with escape sequences that allow MSBuild hosts - /// to treat MSBuild-interpreted characters literally (';' becomes "%3b" and so on). - /// - /// string to escape - /// escaped string - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public static string Escape(string unescapedExpression) - { - return EscapingUtilities.Escape(unescapedExpression); - } - - /// - /// Instantiates a new BuildEventFileInfo object using an XML node (presumably from the project - /// file). The reason this isn't just another constructor on BuildEventFileInfo is because - /// BuildEventFileInfo.cs gets compiled into multiple assemblies (Engine and Conversion, at least), - /// and not all of those assemblies have the code for XmlUtilities. - /// - /// - /// - /// - /// RGoel - internal static BuildEventFileInfo CreateBuildEventFileInfo(XmlNode xmlNode, string defaultFile) - { - ErrorUtilities.VerifyThrow(xmlNode != null, "Need Xml node."); - - // Get the file path out of the Xml node. - int line = 0; - int column = 0; - string file = XmlUtilities.GetXmlNodeFile(xmlNode, String.Empty); - - if (file.Length == 0) - { - file = defaultFile; - } - else - { - // Compute the line number and column number of the XML node. - XmlSearcher.GetLineColumnByNode(xmlNode, out line, out column); - } - - return new BuildEventFileInfo(file, line, column); - } - - - /// - /// Helper useful for lazy table creation - /// - internal static Hashtable CreateTableIfNecessary(Hashtable table) - { - if (table == null) - { - return new Hashtable(StringComparer.OrdinalIgnoreCase); - } - - return table; - } - - /// - /// Helper useful for lazy table creation - /// - internal static Dictionary CreateTableIfNecessary(Dictionary table) - { - if (table == null) - { - return new Dictionary(StringComparer.OrdinalIgnoreCase); - } - - return table; - } - } -} diff --git a/src/Deprecated/Engine/Engine/XmlSearcher.cs b/src/Deprecated/Engine/Engine/XmlSearcher.cs deleted file mode 100644 index ec51217b82f..00000000000 --- a/src/Deprecated/Engine/Engine/XmlSearcher.cs +++ /dev/null @@ -1,336 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.IO; -using System.Xml; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class has static methods to determine line numbers and column numbers for given - /// XML nodes. - /// - /// RGoel - internal static class XmlSearcher - { - /// - /// Given an XmlNode belonging to a document that lives on disk, this method determines - /// the line/column number of that node in the document. It does this by re-reading the - /// document from disk and searching for the given node. - /// - /// Any XmlElement or XmlAttribute node (preferably in a document that still exists on disk). - /// (out) The line number where the specified node begins. - /// (out) The column number where the specified node begins. - /// true if found, false otherwise. Should not throw any exceptions. - /// RGoel - internal static bool GetLineColumnByNode - ( - XmlNode xmlNodeToFind, - out int foundLineNumber, - out int foundColumnNumber - ) - { - // Initialize the output parameters. - foundLineNumber = 0; - foundColumnNumber = 0; - - if (xmlNodeToFind == null) - { - return false; - } - - // Get the filename where this XML node came from. Make sure it still - // exists on disk. If not, there's nothing we can do. Sorry. - string fileName = XmlUtilities.GetXmlNodeFile(xmlNodeToFind, String.Empty); - if ((fileName.Length == 0) || (!File.Exists(fileName))) - { - return false; - } - - // Next, we need to compute the "element number" and "attribute number" of - // the given XmlNode in its original container document. Element number is - // simply a 1-based number identifying a particular XML element starting from - // the beginning of the document, ignoring depth. As you're walking the tree, - // visiting each node in order, and recursing deeper whenever possible, the Nth - // element you visit has element number N. Attribute number is simply the - // 1-based index of the attribute within the given Xml element. An attribute - // number of zero indicates that we're not searching for a particular attribute, - // and all we care about is the element as a whole. - int elementNumber; - int attributeNumber; - if (!GetElementAndAttributeNumber(xmlNodeToFind, out elementNumber, out attributeNumber)) - { - return false; - } - - // Now that we know what element/attribute number we're searching for, find - // it in the Xml document on disk, and grab the line/column number. - return GetLineColumnByNodeNumber(fileName, elementNumber, attributeNumber, - out foundLineNumber, out foundColumnNumber); - } - - /// - /// Determines the element number and attribute number of a given XmlAttribute node, - /// or just the element number for a given XmlElement node. - /// - /// Any XmlElement or XmlAttribute within an XmlDocument. - /// (out) The element number of the given node. - /// (out) If the given node was an XmlAttribute node, then the attribute number of that node, otherwise zero. - /// true if found, false otherwise. Should not throw any exceptions. - /// RGoel - internal static bool GetElementAndAttributeNumber - ( - XmlNode xmlNodeToFind, - out int elementNumber, - out int attributeNumber - ) - { - ErrorUtilities.VerifyThrow(xmlNodeToFind != null, "No Xml node!"); - - // Initialize output parameters. - elementNumber = 0; - attributeNumber = 0; - - XmlNode elementToFind; - - // First determine the XmlNode in the main hierarchy to search for. If the passed-in - // node is already an XmlElement or Text node, then we already have the node - // that we're searching for. But if the passed-in node is an XmlAttribute, then - // we want to search for the XmlElement that contains that attribute. - // If the node is any other type, try the parent node. It's a better line number than no line number. - if ((xmlNodeToFind.NodeType != XmlNodeType.Element) && - (xmlNodeToFind.NodeType != XmlNodeType.Text) && - (xmlNodeToFind.NodeType != XmlNodeType.Attribute)) - { - if (xmlNodeToFind.ParentNode != null) - { - xmlNodeToFind = xmlNodeToFind.ParentNode; - } - } - - if ((xmlNodeToFind.NodeType == XmlNodeType.Element) || (xmlNodeToFind.NodeType == XmlNodeType.Text)) - { - elementToFind = xmlNodeToFind; - } - else if (xmlNodeToFind.NodeType == XmlNodeType.Attribute) - { - elementToFind = ((XmlAttribute)xmlNodeToFind).OwnerElement; - ErrorUtilities.VerifyThrow(elementToFind != null, "How can an xml attribute not have a parent?"); - } - else - { - // We don't support searching for anything other than XmlAttribute, XmlElement, or text node. - return false; - } - - // Figure out the element number for this particular XML element, by iteratively - // visiting every single node in the XmlDocument in sequence. Start with the - // root node which is the XmlDocument node. - XmlNode xmlNode = xmlNodeToFind.OwnerDocument; - while (true) - { - // If the current node is an XmlElement or text node, bump up our variable which tracks the - // number of XmlElements visited so far. - if ((xmlNode.NodeType == XmlNodeType.Element) || (xmlNode.NodeType == XmlNodeType.Text)) - { - elementNumber++; - - // If the current XmlElement node is actually the one the caller wanted - // us to search for, then we've found the element number. Yippee. - if (xmlNode == elementToFind) - { - break; - } - } - - // The rest of this is all about moving to the next node in the tree. - if (xmlNode.HasChildNodes) - { - // If the current node has any children, then the next node to visit - // is the first child. - xmlNode = xmlNode.FirstChild; - } - else - { - // Current node has no children. So we basically want its next - // sibling. Unless of course it has no more siblings, in which - // case we want its parent's next sibling. Unless of course its - // parent doesn't have any more siblings, in which case we want - // its parent's parent's sibling. Etc, etc. - while ((xmlNode != null) && (xmlNode.NextSibling == null)) - { - xmlNode = xmlNode.ParentNode; - } - - if (xmlNode == null) - { - // Oops, we reached the end of the document, so bail. - break; - } - else - { - xmlNode = xmlNode.NextSibling; - } - } - } - - if (xmlNode == null) - { - // We visited every XmlElement in the document without finding the - // specific XmlElement we were supposed to. Oh well, too bad. - elementNumber = 0; - return false; - } - - // If we were originally asked to actually find an XmlAttribute within - // an XmlElement, now comes Part 2. We've already found the correct - // element, so now we just need to iterate through the attributes within - // the element in order until we find the desired one. - if (xmlNodeToFind.NodeType == XmlNodeType.Attribute) - { - bool foundAttribute = false; - - XmlAttribute xmlAttributeToFind = xmlNodeToFind as XmlAttribute; - foreach (XmlAttribute xmlAttribute in ((XmlElement)elementToFind).Attributes) - { - attributeNumber++; - - if (xmlAttribute == xmlAttributeToFind) - { - foundAttribute = true; - break; - } - } - - if (!foundAttribute) - { - return false; - } - } - - return true; - } - - /// - /// Read through the entire XML of a given project file, searching for the element/attribute - /// specified by element number and attribute number. Return the line number and column - /// number where it was found. - /// - /// Path to project file on disk. - /// Which Xml element to search for. - /// - /// Which Xml attribute within the above Xml element to search for. Pass in zero - /// if you are searching for the Element as a whole and not a particular attribute. - /// - /// (out) The line number where the given element/attribute begins. - /// The column number where the given element/attribute begins. - /// true if found, false otherwise. Should not throw any exceptions. - /// RGoel - internal static bool GetLineColumnByNodeNumber - ( - string projectFile, - int xmlElementNumberToSearchFor, - int xmlAttributeNumberToSearchFor, - out int foundLineNumber, - out int foundColumnNumber - ) - { - ErrorUtilities.VerifyThrow(xmlElementNumberToSearchFor != 0, "No element to search for!"); - ErrorUtilities.VerifyThrow(!string.IsNullOrEmpty(projectFile), "No project file!"); - - // Initialize output parameters. - foundLineNumber = 0; - foundColumnNumber = 0; - - try - { - // We're going to need to re-read the file from disk in order to find - // the line/column number of the specified node. - using (XmlTextReader reader = new XmlTextReader(projectFile)) - { - reader.DtdProcessing = DtdProcessing.Ignore; - int currentXmlElementNumber = 0; - - // While we haven't reached the end of the file, and we haven't found the - // specified node ... - while (reader.Read() && (foundColumnNumber == 0) && (foundLineNumber == 0)) - { - // Read to the next node. If it is an XML element or Xml text node, then ... - if ((reader.NodeType == XmlNodeType.Element) || (reader.NodeType == XmlNodeType.Text)) - { - // Bump up our current XML element count. - currentXmlElementNumber++; - - // Check to see if this XML element is the one we've been searching for, - // based on if the numbers match. - if (currentXmlElementNumber == xmlElementNumberToSearchFor) - { - // We've found the desired XML element. If the caller didn't care - // for a particular attribute, then we're done. Return the current - // position of the XmlTextReader. - if (0 == xmlAttributeNumberToSearchFor) - { - foundLineNumber = reader.LineNumber; - foundColumnNumber = reader.LinePosition; - - if (reader.NodeType == XmlNodeType.Element) - { - // Do a minus-one here, because the XmlTextReader points us at the first - // letter of the tag name, whereas we would prefer to point at the opening - // left-angle-bracket. (Whitespace between the left-angle-bracket and - // the tag name is not allowed in XML, so this is safe.) - foundColumnNumber--; - } - } - else if (reader.MoveToFirstAttribute()) - { - // Caller wants a particular attribute within the element, - // and the element does have 1 or more attributes. So let's - // try to find the right one. - int currentXmlAttributeNumber = 0; - - // Loop through all the XML attributes on the current element. - do - { - // Bump the current attribute number and check to see if this - // is the one. - currentXmlAttributeNumber++; - - if (currentXmlAttributeNumber == xmlAttributeNumberToSearchFor) - { - // We found the desired attribute. Return the current - // position of the XmlTextReader. - foundLineNumber = reader.LineNumber; - foundColumnNumber = reader.LinePosition; - } - - } while (reader.MoveToNextAttribute() && (foundColumnNumber == 0) && (foundLineNumber == 0)); - } - } - } - } - } - } - catch (XmlException) - { - // Eat the exception. If anything fails, we simply don't surface the line/column number. - } - catch (IOException) - { - // Eat the exception. If anything fails, we simply don't surface the line/column number. - } - catch (UnauthorizedAccessException) - { - // Eat the exception. If anything fails, we simply don't surface the line/column number. - } - - return (foundColumnNumber != 0) && (foundLineNumber != 0); - } - } -} diff --git a/src/Deprecated/Engine/Errors/InternalLoggerException.cs b/src/Deprecated/Engine/Errors/InternalLoggerException.cs deleted file mode 100644 index 086aa26a7a5..00000000000 --- a/src/Deprecated/Engine/Errors/InternalLoggerException.cs +++ /dev/null @@ -1,282 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Runtime.Serialization; -using System.Security.Permissions; - -using Microsoft.Build.BuildEngine.Shared; -using Microsoft.Build.Framework; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// This exception is used to wrap an unhandled exception from a logger. This exception aborts the build, and it can only be - /// thrown by the MSBuild engine. - /// - /// - /// [!WARNING] - /// > This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// SumedhK - // WARNING: marking a type [Serializable] without implementing ISerializable imposes a serialization contract -- it is a - // promise to never change the type's fields i.e. the type is immutable; adding new fields in the next version of the type - // without following certain special FX guidelines, can break both forward and backward compatibility - [Serializable] - public sealed class InternalLoggerException : Exception - { - #region Unusable constructors - - /// - /// Default constructor. - /// - /// - /// This constructor only exists to satisfy .NET coding guidelines. Use the rich constructor instead. - /// - /// SumedhK - /// - public InternalLoggerException() - { - ErrorUtilities.VerifyThrowInvalidOperation(false, "InternalLoggerExceptionOnlyThrownByEngine"); - } - - /// - /// Creates an instance of this exception using the specified error message. - /// - /// - /// This constructor only exists to satisfy .NET coding guidelines. Use the rich constructor instead. - /// - /// SumedhK - /// - /// - public InternalLoggerException(string message) - : base(message) - { - ErrorUtilities.VerifyThrowInvalidOperation(false, "InternalLoggerExceptionOnlyThrownByEngine"); - } - - /// - /// Creates an instance of this exception using the specified error message and inner exception. - /// - /// - /// This constructor only exists to satisfy .NET coding guidelines. Use the rich constructor instead. - /// - /// SumedhK - /// - /// - /// - public InternalLoggerException(string message, Exception innerException) - : base(message, innerException) - { - ErrorUtilities.VerifyThrowInvalidOperation(false, "InternalLoggerExceptionOnlyThrownByEngine"); - } - - #endregion - - /// - /// Creates an instance of this exception using rich error information. - /// Internal for unit testing - /// - /// This is the only usable constructor. - /// SumedhK - /// - /// - /// Can be null. - /// - /// - internal InternalLoggerException - ( - string message, - Exception innerException, - BuildEventArgs e, - string errorCode, - string helpKeyword, - bool initializationException - ) - : base(message, innerException) - { - ErrorUtilities.VerifyThrow(!string.IsNullOrEmpty(message), "Need error message."); - ErrorUtilities.VerifyThrow(innerException != null || initializationException, "Need the logger exception."); - ErrorUtilities.VerifyThrow(!string.IsNullOrEmpty(errorCode), "Must specify the error message code."); - ErrorUtilities.VerifyThrow(!string.IsNullOrEmpty(helpKeyword), "Must specify the help keyword for the IDE."); - - this.e = e; - this.errorCode = errorCode; - this.helpKeyword = helpKeyword; - this.initializationException = initializationException; - } - - #region Serialization (update when adding new class members) - - /// - /// Protected constructor used for (de)serialization. - /// If we ever add new members to this class, we'll need to update this. - /// - /// - /// - private InternalLoggerException(SerializationInfo info, StreamingContext context) - : base(info, context) - { - this.e = (BuildEventArgs)info.GetValue("e", typeof(BuildEventArgs)); - this.errorCode = info.GetString("errorCode"); - this.helpKeyword = info.GetString("helpKeyword"); - this.initializationException = info.GetBoolean("initializationException"); - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// - /// Microsoft.Build.Execution - /// ISerializable method which we must override since Exception implements this interface - /// If we ever add new members to this class, we'll need to update this. - /// - /// - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - [SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)] - public override void GetObjectData(SerializationInfo info, StreamingContext context) - { - base.GetObjectData(info, context); - - info.AddValue("e", e); - info.AddValue("errorCode", errorCode); - info.AddValue("helpKeyword", helpKeyword); - info.AddValue("initializationException", initializationException); - } - - /// - /// Provide default values for optional members - /// - [OnDeserializing] // Will happen before the object is deserialized - private void SetDefaultsBeforeSerialization(StreamingContext sc) - { - initializationException = false; - } - - /// - /// Dont actually have anything to do in the method, but the method is required when implementing an optional field - /// - [OnDeserialized] - private void SetValueAfterDeserialization(StreamingContext sx) - { - // Have nothing to do - } - #endregion - - #region Properties - - /// - /// Gets the details of the build event (if any) that was being logged. - /// - /// SumedhK - /// The build event args, or null. - public BuildEventArgs BuildEventArgs - { - get - { - return e; - } - } - - /// - /// Gets the error code associated with this exception's message (not the inner exception). - /// - /// SumedhK - /// The error code string. - public string ErrorCode - { - get - { - return errorCode; - } - } - - /// - /// Gets the F1-help keyword associated with this error, for the host IDE. - /// - /// SumedhK - /// The keyword string. - public string HelpKeyword - { - get - { - return helpKeyword; - } - } - - /// - /// True if the exception occurred during logger initialization - /// - public bool InitializationException - { - get - { - return initializationException; - } - } - - #endregion - - /// - /// Throws an instance of this exception using rich error information. - /// - /// - /// Can be null. - /// - /// - internal static void Throw - ( - Exception innerException, - BuildEventArgs e, - string messageResourceName, - bool initializationException, - params string[] messageArgs - ) - { - ErrorUtilities.VerifyThrow(messageResourceName != null, "Need error message."); - - string errorCode; - string helpKeyword; - string message = ResourceUtilities.FormatResourceString(out errorCode, out helpKeyword, messageResourceName, messageArgs); - - throw new InternalLoggerException(message, innerException, e, errorCode, helpKeyword, initializationException); - } - - // the event that was being logged when a logger failed (can be null) - private BuildEventArgs e; - // the error code for this exception's message (not the inner exception) - private string errorCode; - // the F1-help keyword for the host IDE - private string helpKeyword; - - // This flag is set to indicate that the exception occurred during logger initialization - [OptionalField(VersionAdded = 2)] - private bool initializationException; - } -} diff --git a/src/Deprecated/Engine/Errors/InvalidProjectFileException.cs b/src/Deprecated/Engine/Errors/InvalidProjectFileException.cs deleted file mode 100644 index 4e1e59b8e07..00000000000 --- a/src/Deprecated/Engine/Errors/InvalidProjectFileException.cs +++ /dev/null @@ -1,625 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Xml; -using System.Runtime.Serialization; -using System.Security.Permissions; - -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// This exception is thrown whenever there is a problem with the user's XML project file. The problem might be semantic or - /// syntactical. The latter would be of a type typically caught by XSD validation (if it was performed by the project writer). - /// - /// - /// [!WARNING] - /// > This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// RGoel - // WARNING: marking a type [Serializable] without implementing ISerializable imposes a serialization contract -- it is a - // promise to never change the type's fields i.e. the type is immutable; adding new fields in the next version of the type - // without following certain special FX guidelines, can break both forward and backward compatibility - - [Serializable] - public sealed class InvalidProjectFileException : Exception - { - #region Basic constructors - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Default constructor. - /// - /// - /// This constructor only exists to satisfy .NET coding guidelines. Use a rich constructor whenever possible. - /// - /// RGoel - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public InvalidProjectFileException() - : base() - { - // do nothing - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// - /// Microsoft.Build.Execution - /// Creates an instance of this exception using the specified error message. - /// - /// - /// This constructor only exists to satisfy .NET coding guidelines. Use a rich constructor whenever possible. - /// - /// SumedhK - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public InvalidProjectFileException(string message) - : base(message) - { - // do nothing - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// - /// Microsoft.Build.Execution - /// Creates an instance of this exception using the specified error message and inner exception. - /// - /// SumedhK - /// - /// This constructor only exists to satisfy .NET coding guidelines. Use a rich constructor whenever possible. - /// - /// - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public InvalidProjectFileException(string message, Exception innerException) - : base(message, innerException) - { - // do nothing - } - - #endregion - - #region Serialization (update when adding new class members) - - /// - /// Protected constructor used for (de)serialization. - /// If we ever add new members to this class, we'll need to update this. - /// - /// - /// - private InvalidProjectFileException(SerializationInfo info, StreamingContext context) - : base(info, context) - { - this.projectFile = info.GetString("projectFile"); - this.lineNumber = info.GetInt32("lineNumber"); - this.columnNumber = info.GetInt32("columnNumber"); - this.endLineNumber = info.GetInt32("endLineNumber"); - this.endColumnNumber = info.GetInt32("endColumnNumber"); - this.errorSubcategory = info.GetString("errorSubcategory"); - this.errorCode = info.GetString("errorCode"); - this.helpKeyword = info.GetString("helpKeyword"); - this.hasBeenLogged = info.GetBoolean("hasBeenLogged"); - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// ISerializable method which we must override since Exception implements this interface - /// If we ever add new members to this class, we'll need to update this. - /// - /// - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - [SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)] - public override void GetObjectData(SerializationInfo info, StreamingContext context) - { - base.GetObjectData(info, context); - - info.AddValue("projectFile", projectFile); - info.AddValue("lineNumber", lineNumber); - info.AddValue("columnNumber", columnNumber); - info.AddValue("endLineNumber", endLineNumber); - info.AddValue("endColumnNumber", endColumnNumber); - info.AddValue("errorSubcategory", errorSubcategory); - info.AddValue("errorCode", errorCode); - info.AddValue("helpKeyword", helpKeyword); - info.AddValue("hasBeenLogged", hasBeenLogged); - } - - #endregion - - #region Rich constructors - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Creates an instance of this exception using rich error information. - /// - /// This constructor is preferred over the basic constructors. - /// RGoel, SumedhK - /// The XML node where the error is (can be null). - /// Error message for exception. - /// Error sub-category that describes the error (can be null). - /// The error code (can be null). - /// The F1-help keyword for the host IDE (can be null). - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public InvalidProjectFileException - ( - XmlNode xmlNode, - string message, - string errorSubcategory, - string errorCode, - string helpKeyword - ) : - base(message) - { - ErrorUtilities.VerifyThrowArgumentLength(message, nameof(message)); - - if (xmlNode != null) - { - this.projectFile = XmlUtilities.GetXmlNodeFile(xmlNode, String.Empty /* no project file if XML is purely in-memory */); - XmlSearcher.GetLineColumnByNode(xmlNode, out this.lineNumber, out this.columnNumber); - } - - this.errorSubcategory = errorSubcategory; - this.errorCode = errorCode; - this.helpKeyword = helpKeyword; - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Creates an instance of this exception using rich error information. - /// - /// This constructor is preferred over the basic constructors. - /// SumedhK - /// The invalid project file (can be empty string). - /// The invalid line number in the project (set to zero if not available). - /// The invalid column number in the project (set to zero if not available). - /// The end of a range of invalid lines in the project (set to zero if not available). - /// The end of a range of invalid columns in the project (set to zero if not available). - /// Error message for exception. - /// Error sub-category that describes the error (can be null). - /// The error code (can be null). - /// The F1-help keyword for the host IDE (can be null). - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public InvalidProjectFileException - ( - string projectFile, - int lineNumber, - int columnNumber, - int endLineNumber, - int endColumnNumber, - string message, - string errorSubcategory, - string errorCode, - string helpKeyword - ) : - base(message) - { - ErrorUtilities.VerifyThrowArgumentNull(projectFile, nameof(projectFile)); - ErrorUtilities.VerifyThrowArgumentLength(message, nameof(message)); - - this.projectFile = projectFile; - this.lineNumber = lineNumber; - this.columnNumber = columnNumber; - this.endLineNumber = endLineNumber; - this.endColumnNumber = endColumnNumber; - this.errorSubcategory = errorSubcategory; - this.errorCode = errorCode; - this.helpKeyword = helpKeyword; - } - - #endregion - - #region Properties - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Gets the exception message including the affected project file (if any). - /// - /// SumedhK - /// The complete message string. - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public override string Message - { - get - { - return base.Message + ((ProjectFile != null) - ? (" " + ProjectFile) - : null); - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Gets the exception message not including the project file. - /// - /// SumedhK - /// The error message string only. - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public string BaseMessage - { - get - { - return base.Message; - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Gets the project file (if any) associated with this exception. - /// - /// SumedhK - /// Project filename/path string, or null. - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public string ProjectFile - { - get - { - return projectFile; - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// - /// Microsoft.Build.Execution - /// Gets the invalid line number (if any) in the project. - /// - /// SumedhK - /// The invalid line number, or zero. - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public int LineNumber - { - get - { - return lineNumber; - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Gets the invalid column number (if any) in the project. - /// - /// SumedhK - /// The invalid column number, or zero. - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public int ColumnNumber - { - get - { - return columnNumber; - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Gets the last line number (if any) of a range of invalid lines in the project. - /// - /// SumedhK - /// The last invalid line number, or zero. - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public int EndLineNumber - { - get - { - return endLineNumber; - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// - /// Microsoft.Build.Execution - /// Gets the last column number (if any) of a range of invalid columns in the project. - /// - /// SumedhK - /// The last invalid column number, or zero. - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public int EndColumnNumber - { - get - { - return endColumnNumber; - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Gets the error sub-category (if any) that describes the type of this error. - /// - /// SumedhK - /// The sub-category string, or null. - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public string ErrorSubcategory - { - get - { - return errorSubcategory; - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// - /// Microsoft.Build.Execution - /// Gets the error code (if any) associated with the exception message. - /// - /// SumedhK - /// Error code string, or null. - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public string ErrorCode - { - get - { - return errorCode; - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// - /// Microsoft.Build.Execution - /// Gets the F1-help keyword (if any) associated with this error, for the host IDE. - /// - /// SumedhK - /// The keyword string, or null. - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public string HelpKeyword - { - get - { - return helpKeyword; - } - } - - /// - /// Whether the exception has already been logged. Allows the exception to be logged at the - /// most appropriate location, but continue to be propagated. - /// - internal bool HasBeenLogged - { - get - { - return this.hasBeenLogged; - } - set - { - this.hasBeenLogged = value; - } - } - - #endregion - - // the project file that caused this exception - private string projectFile; - // the invalid line number in the project - private int lineNumber; - // the invalid column number in the project - private int columnNumber; - // the end of a range of invalid lines in the project - private int endLineNumber; - // the end of a range of invalid columns in the project - private int endColumnNumber; - // the error sub-category that describes the type of this error - private string errorSubcategory; - // the error code for the exception message - private string errorCode; - // the F1-help keyword for the host IDE - private string helpKeyword; - // Has this errors been sent to the loggers? - private bool hasBeenLogged = false; - } -} diff --git a/src/Deprecated/Engine/Errors/InvalidToolsetDefinitionException.cs b/src/Deprecated/Engine/Errors/InvalidToolsetDefinitionException.cs deleted file mode 100644 index 4d9aaa39cb4..00000000000 --- a/src/Deprecated/Engine/Errors/InvalidToolsetDefinitionException.cs +++ /dev/null @@ -1,287 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; - -using Microsoft.Build.BuildEngine.Shared; -using System.Runtime.Serialization; -using System.Security.Permissions; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Exception subclass that ToolsetReaders should throw. - /// - /// - /// [!WARNING] - /// > This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - [Serializable] - public class InvalidToolsetDefinitionException : Exception - { - /// - /// The MSBuild error code corresponding with this exception. - /// - private string errorCode = null; - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// - /// Microsoft.Build.Execution - /// Basic constructor. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public InvalidToolsetDefinitionException() - : base() - { - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// - /// Microsoft.Build.Execution - /// Basic constructor. - /// - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public InvalidToolsetDefinitionException(string message) - : base(message) - { - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// - /// Microsoft.Build.Execution - /// Basic constructor. - /// - /// - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public InvalidToolsetDefinitionException(string message, Exception innerException) - : base(message, innerException) - { - } - - /// - /// Basic constructor. - /// - /// - /// - protected InvalidToolsetDefinitionException(SerializationInfo info, StreamingContext context) - : base(info, context) - { - ErrorUtilities.VerifyThrowArgumentNull(info, nameof(info)); - - this.errorCode = info.GetString("errorCode"); - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// - /// Microsoft.Build.Execution - /// Constructor that takes an MSBuild error code - /// - /// - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public InvalidToolsetDefinitionException(string message, string errorCode) - : base(message) - { - this.errorCode = errorCode; - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Constructor that takes an MSBuild error code - /// - /// - /// - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public InvalidToolsetDefinitionException(string message, string errorCode, Exception innerException) - : base(message, innerException) - { - this.errorCode = errorCode; - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// - /// Microsoft.Build.Execution - /// ISerializable method which we must override since Exception implements this interface - /// If we ever add new members to this class, we'll need to update this. - /// - /// - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - [SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)] - public override void GetObjectData(SerializationInfo info, StreamingContext context) - { - ErrorUtilities.VerifyThrowArgumentNull(info, nameof(info)); - - base.GetObjectData(info, context); - - info.AddValue("errorCode", errorCode); - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// The MSBuild error code corresponding with this exception, or - /// null if none was specified. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public string ErrorCode - { - get - { - return errorCode; - } - } - - #region Static Throw Helpers - - /// - /// Throws an InvalidToolsetDefinitionException. - /// - /// PERF WARNING: calling a method that takes a variable number of arguments - /// is expensive, because memory is allocated for the array of arguments -- do - /// not call this method repeatedly in performance-critical scenarios - /// - /// - /// - internal static void Throw - ( - string resourceName, - params object[] args - ) - { - Throw(null, resourceName, args); - } - - /// - /// Throws an InvalidToolsetDefinitionException including a specified inner exception, - /// which may be interesting to hosts. - /// - /// PERF WARNING: calling a method that takes a variable number of arguments - /// is expensive, because memory is allocated for the array of arguments -- do - /// not call this method repeatedly in performance-critical scenarios - /// - /// - /// - internal static void Throw - ( - Exception innerException, - string resourceName, - params object[] args - ) - { -#if DEBUG - ResourceUtilities.VerifyResourceStringExists(resourceName); -#endif - string errorCode; - string helpKeyword; - string message = ResourceUtilities.FormatResourceString(out errorCode, out helpKeyword, resourceName, args); - - throw new InvalidToolsetDefinitionException(message, errorCode, innerException); - } - - #endregion - } -} diff --git a/src/Deprecated/Engine/Errors/RegistryException.cs b/src/Deprecated/Engine/Errors/RegistryException.cs deleted file mode 100644 index c849de9712e..00000000000 --- a/src/Deprecated/Engine/Errors/RegistryException.cs +++ /dev/null @@ -1,80 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Runtime.Serialization; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// Generic exception used to wrap exceptions thrown during Registry access. - /// - [Serializable] - internal class RegistryException : Exception - { - /// - /// Basic constructor. - /// - public RegistryException() - : base() - { - } - - /// - /// Basic constructor. - /// - /// - public RegistryException(string message) - : base(message) - { - } - - /// - /// Basic constructor. - /// - /// - /// - public RegistryException(string message, Exception innerException) - : base(message, innerException) - { - } - - /// - /// Constructor that takes a string description of the registry - /// key or value causing the error. - /// - /// - /// - public RegistryException(string message, string source) - : base(message) - { - base.Source = source; - } - - /// - /// Since this class implements Iserializable this constructor is required to be implemented. - /// - protected RegistryException(SerializationInfo info, StreamingContext context) : base(info, context) - { - // We don't have any reason at the moment to do any custom serizlization or deserialization, this methods was added - // to conform to the implementation of the standard constructors for ISerializable classes - } - - /// - /// Constructor that takes a string description of the registry - /// key or value causing the error. - /// - /// - /// - /// - public RegistryException(string message, string source, Exception innerException) - : base(message, innerException) - { - base.Source = source; - } - } -} diff --git a/src/Deprecated/Engine/Errors/RemoteErrorException.cs b/src/Deprecated/Engine/Errors/RemoteErrorException.cs deleted file mode 100644 index 0a4462e055f..00000000000 --- a/src/Deprecated/Engine/Errors/RemoteErrorException.cs +++ /dev/null @@ -1,120 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Runtime.Serialization; -using System.Security.Permissions; - -using Microsoft.Build.BuildEngine.Shared; -using Microsoft.Build.Framework; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// This class is used to wrap exceptions that occur on a different node - /// - /// - /// [!WARNING] - /// > This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - [Serializable] - public sealed class RemoteErrorException : Exception - { - internal RemoteErrorException(string message, Exception innerException, BuildEventContext buildEventContext) - : base(message, innerException) - { - ErrorUtilities.VerifyThrow(!string.IsNullOrEmpty(message), "Need error message."); - ErrorUtilities.VerifyThrow(innerException != null, "Need the logger exception."); - - this.buildEventContext = buildEventContext; - } - - #region Serialization (update when adding new class members) - - /// - /// Protected constructor used for (de)serialization. - /// If we ever add new members to this class, we'll need to update this. - /// - /// - /// - private RemoteErrorException(SerializationInfo info, StreamingContext context) - : base(info, context) - { - this.buildEventContext = (BuildEventContext)info.GetValue("buildEventContext", typeof(BuildEventContext)); - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// ISerializable method which we must override since Exception implements this interface - /// If we ever add new members to this class, we'll need to update this. - /// - /// - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - [SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)] - public override void GetObjectData(SerializationInfo info, StreamingContext context) - { - base.GetObjectData(info, context); - - info.AddValue("buildEventContext", buildEventContext); - } - - #endregion - - #region Properties - /// - /// Gets the event context in which the remote exception occurred - /// - internal BuildEventContext BuildEventContext - { - get - { - return buildEventContext; - } - } - #endregion - - #region Methods - internal static void Throw(Exception innerException, BuildEventContext buildEventContext, string messageResourceName, params string[] messageArgs) - { - ErrorUtilities.VerifyThrow(messageResourceName != null, "Need error message."); - - string message = ResourceUtilities.FormatResourceString(messageResourceName, messageArgs); - - throw new RemoteErrorException(message, innerException, buildEventContext); - } - #endregion - - #region Data - private BuildEventContext buildEventContext; - #endregion - } -} diff --git a/src/Deprecated/Engine/Evaluation.txt b/src/Deprecated/Engine/Evaluation.txt deleted file mode 100644 index 28cc77f0aa0..00000000000 --- a/src/Deprecated/Engine/Evaluation.txt +++ /dev/null @@ -1,116 +0,0 @@ -This table lists all the places in a project file where properties, item lists -and item attributes (meta-data) can (and cannot) be referenced. - -Key: - yes == is possible and we should allow it - no == is not possible by design - disallow == is possible but we don't want to allow it - ----------------------------------------------------------------------------------------------------------------- - Properties Items Attributes Suite ----------------------------------------------------------------------------------------------------------------- -Project - - DefaultTargets yes (env-vars & command-line) no no Evaluation - -PropertyGroup - - Condition yes (all in scope) no no Evaluation - - - - Condition yes (all in scope) no no Evaluation - - [Value] yes (all in scope) no no Evaluation - -ItemGroup - - Condition yes yes (all in scope) no Evaluation - - - - Include yes yes (all in scope) no Evaluation - - Exclude yes yes (all in scope) no Evaluation - - Condition yes yes (all in scope) no Evaluation - - - - Condition yes yes (all in scope) no Evaluation - - [Value] yes yes (all in scope) no Evaluation - -Import - - Project yes (all in scope) no no Evaluation - - Condition yes (all in scope) no no Evaluation - -Error - - Condition yes yes no - - Text yes yes no - -Warning - - Condition yes yes no - - Text yes yes no - -Message - - Condition yes yes no - - Text yes yes no - -UsingTask - - AssemblyName yes yes no Evaluation - - AssemblyFile yes yes no Evaluation - - TaskName yes yes no Evaluation - - Condition yes yes no Evaluation - -Target - - Name disallow disallow no Evaluation - - DependsOnTargets yes yes no Evaluation - - Inputs yes yes yes - - Outputs yes yes yes - - Condition yes yes no Evaluation - -OnError - - Condition yes yes no - - ExecuteTargets yes yes no - - - - Condition yes yes yes - - ContinueOnError yes yes yes Evaluation - - [Parameter] yes yes yes - -Output - - TaskParameter yes yes yes Evaluation - - ItemName yes yes yes Evaluation - - PropertyName yes yes yes Evaluation - - Condition yes yes yes Evaluation - -ProjectExtensions - - [Inner XML] disallow disallow no diff --git a/src/Deprecated/Engine/Introspector/Introspector.cs b/src/Deprecated/Engine/Introspector/Introspector.cs deleted file mode 100644 index 7eab8986e55..00000000000 --- a/src/Deprecated/Engine/Introspector/Introspector.cs +++ /dev/null @@ -1,375 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections.Generic; - -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine.Shared; -using System.Threading; - -namespace Microsoft.Build.BuildEngine -{ - internal class Introspector - { - #region Constructors - internal Introspector(Engine parentEngine, ProjectManager projectManager, NodeManager nodeManager) - { - this.parentEngine = parentEngine; - this.projectManager = projectManager; - this.nodeManager = nodeManager; - this.ignoreTimeout = 0; - } - #endregion - - #region Methods - /// - /// This method is called when the parent engine doesn't see activity for a preset time period to - /// determine if the whole system is making forward progress. In order to that, status is collected - /// from every node in the system. If no node is making forward progress then the graph of all the - /// inprogress targets is analyzed for cycles. If a cycle is found the appropriate node is instructed - /// to break it. If no cause for deadlock can be determined the system is shutdown. - /// - /// New inactivity timeout - internal int DetectDeadlock(int queueCounts, long lastLoopActivity, int currentTimeout) - { - // Don't try to detect deadlock in single threaded mode or on a child node - if (parentEngine.Router.ChildMode || parentEngine.Router.SingleThreadedMode) - { - return Timeout.Infinite; - } - - // Calculate time since last loop activity - TimeSpan timeSinceLastLoopActivity = - new TimeSpan(DateTime.Now.Ticks - lastLoopActivity); - - // If there are items in the queue waiting to be processed or there was loop activity - // not so long ago - continue - if (queueCounts > 0 || timeSinceLastLoopActivity.TotalMilliseconds < currentTimeout) - { - return currentTimeout; - } - - if (nodeManager.TaskExecutionModule == null) - { - return currentTimeout; - } - - // Calculate the time since the last task activity - TimeSpan timeSinceLastTEMActivity = - new TimeSpan(DateTime.Now.Ticks - nodeManager.TaskExecutionModule.LastTaskActivity()); - - // If there was not task activity for the whole time period - check with individual nodes - // to see if there was activity there - if (timeSinceLastTEMActivity.TotalMilliseconds < currentTimeout) - { - // Increase the timeout since tasks are taking a long time - return calculateNewLoopTimeout(currentTimeout); - } - - // Check if we are waiting on an outcome of an operation - if ((ignoreTimeout - DateTime.Now.Ticks) > 0) - { - return currentTimeout; - } - - long requestStartTime = DateTime.Now.Ticks; - NodeStatus[] nodeStatus = nodeManager.RequestStatusForNodes(nodeStatusReplyTimeout); - long requestDurationTime = DateTime.Now.Ticks - requestStartTime; - - for (int i = 0; i < nodeStatus.Length; i++) - { - if (nodeStatus[i] == null) - { - // A node failed to respond to the request for status. The only option is to shutdown - // the build and error out - LogOrDumpError("FailedToReceiveChildStatus", i + 1, nodeStatusReplyTimeout); - - SystemShutdown(); - return currentTimeout; - } - else if (nodeStatus[i].HasExited) - { - // A node has exited prematurely. The only option is to shutdown - LogOrDumpError("ChildExitedPrematurely", i + 1); - - SystemShutdown(); - return currentTimeout; - } - else if (nodeStatus[i].IsActive) - { - // Calculate the time since last node activity - TimeSpan timeSinceLastNodeTaskActivity = new TimeSpan(nodeStatus[i].TimeSinceLastTaskActivity); - TimeSpan timeSinceLastNodeLoopActivity = new TimeSpan(nodeStatus[i].TimeSinceLastLoopActivity); - - // Check if there was activity on the node within the timeout - if (nodeStatus[i].QueueDepth > 0 || - timeSinceLastNodeTaskActivity.TotalMilliseconds < currentTimeout || - timeSinceLastNodeLoopActivity.TotalMilliseconds < currentTimeout) - { - // If the time out has been exceeded while one of the nodes was - // active lets increase the timeout - return calculateNewLoopTimeout(currentTimeout); - } - } - else if (nodeStatus[i].IsLaunchInProgress) - { - // If there is a node in process of being launched, only the NodeProvider - // knows how long that should take so the decision to error out can - // only be made by the node provider. - return currentTimeout; - } - } - - // There was no detected activity within the system for the whole time period. Check - // if there is a cycle in the in progress targets - TargetCycleDetector cycleDetector = new TargetCycleDetector(parentEngine.LoggingServices, parentEngine.EngineCallback); - AddTargetStatesToCycleDetector(nodeStatus, cycleDetector); - NodeStatus localStatus = parentEngine.RequestStatus(0); - cycleDetector.AddTargetsToGraph(localStatus.StateOfInProgressTargets); - - - if (cycleDetector.FindCycles()) - { - if (Engine.debugMode) - { - Console.WriteLine("Breaking cycle between " + cycleDetector.CycleEdgeChild.TargetId.name + " and " + - cycleDetector.CycleEdgeParent.TargetId.name); - } - // A cycle has been detected - it needs to be broken for the build to continue - nodeManager.PostCycleNotification(cycleDetector.CycleEdgeChild.TargetId.nodeId, - cycleDetector.CycleEdgeChild, - cycleDetector.CycleEdgeParent); - // Use the amount of time it took us to receive the NodeStatus and buffer it a little because node status is sent via a faster code path - ignoreTimeout = DateTime.Now.Ticks + requestDurationTime + (cycleBreakTimeout * TimeSpan.TicksPerMillisecond); - return currentTimeout; - } - - // The system doesn't appear to be making progress. Switch to a largest sampling interval. - if (currentTimeout != maxLoopTimeout) - { - return maxLoopTimeout; - } - - // Should make at least two observations before assuming that no forward progress is being made - if (previousStatus == null || previousLocalStatus == null || nodeStatus.Length != previousStatus.Length) - { - previousStatus = nodeStatus; - previousLocalStatus = localStatus; - return currentTimeout; - } - - // There was some activity between previous and current status checks on the local node - if (localStatus.LastLoopActivity != previousLocalStatus.LastLoopActivity || - localStatus.LastTaskActivity != previousLocalStatus.LastTaskActivity) - { - previousStatus = nodeStatus; - previousLocalStatus = localStatus; - return currentTimeout; - } - - for (int i = 0; i < nodeStatus.Length; i++) - { - // There was some activity between previous and current status checks on the child node - if (nodeStatus[i].LastTaskActivity != previousStatus[i].LastTaskActivity || - nodeStatus[i].LastLoopActivity != previousStatus[i].LastLoopActivity) - { - previousStatus = nodeStatus; - previousLocalStatus = localStatus; - return currentTimeout; - } - } - - // The system is not making forward progress for an unknown reason. The - // only recourse to is to collect as much data as possible and shutdown with - // an error message - // UNDONE - using logging and resource string to output the state dump - - GatherNodeInformationForShutdown(nodeStatus, localStatus); - SystemShutdown(); - return currentTimeout; - } - - /// - /// Logs an error, or if the loggers are not available, writes it to the console - /// - private void LogOrDumpError(string resourceName, params object[] args) - { - if (parentEngine.LoggingServices != null) - { - parentEngine.LoggingServices.LogError(BuildEventContext.Invalid, new BuildEventFileInfo(String.Empty) /* no project file */, resourceName, args); - } - else - { - // Can't log it -- we can only log to the console instead - string message = ResourceUtilities.FormatResourceString(resourceName, args); - Console.WriteLine(message); - } - } - - /// - /// Adds a set of nodeStatus's to the cycle graph - /// - private void AddTargetStatesToCycleDetector(NodeStatus[] nodeStatus, TargetCycleDetector cycleDetector) - { - for (int i = 0; i < nodeStatus.Length; i++) - { - cycleDetector.AddTargetsToGraph(nodeStatus[i].StateOfInProgressTargets); - } - } - - /// - /// The system is not making forward progress for an unknown reason. The - /// only recourse to is to collect as much data as possible and shutdown with - /// an error message - /// - private void GatherNodeInformationForShutdown(NodeStatus[] nodeStatus, NodeStatus localStatus) - { - for (int i = 0; i < nodeStatus.Length; i++) - { - TimeSpan timeSinceLastNodeTaskActivity = new TimeSpan(nodeStatus[i].TimeSinceLastTaskActivity); - TimeSpan timeSinceLastNodeLoopActivity = new TimeSpan(nodeStatus[i].TimeSinceLastLoopActivity); - - Console.WriteLine("Status: " + i + " Task Activity " + timeSinceLastNodeTaskActivity.TotalMilliseconds + - " Loop Activity " + timeSinceLastNodeLoopActivity.TotalMilliseconds + " Queue depth " + - nodeStatus[i].QueueDepth); - for (int j = 0; j < nodeStatus[i].StateOfInProgressTargets.Length; j++) - { - Console.WriteLine(nodeStatus[i].StateOfInProgressTargets[j].ProjectName + ":" + nodeStatus[i].StateOfInProgressTargets[j].TargetId.name); - } - } - - Console.WriteLine("Status: LocalNode Task Activity " + localStatus.TimeSinceLastTaskActivity + - " Loop Activity " + localStatus.TimeSinceLastLoopActivity + " Queue depth " + - localStatus.QueueDepth); - - for (int j = 0; j < localStatus.StateOfInProgressTargets.Length; j++) - { - Console.WriteLine(localStatus.StateOfInProgressTargets[j].ProjectName + ":" + localStatus.StateOfInProgressTargets[j].TargetId.name); - } - - parentEngine.Scheduler.DumpState(); - } - - /// - /// This method is called to shutdown the system in case of fatal error - /// - internal void SystemShutdown() - { - ErrorUtilities.LaunchMsBuildDebuggerOnFatalError(); - nodeManager.ShutdownNodes(Node.NodeShutdownLevel.ErrorShutdown); - } - - - /// - /// This function is called to break the link between two targets that creates a cycle. The link could be - /// due to depends/onerror relationship between parent and child. In that case both parent and child are - /// on the same node and within the same project. Or the link could be formed by an IBuildEngine callback - /// (made such by tasks such as MSBuild or CallTarget) in which case there maybe multiple requests forming - /// same link between parent and child. Also in that case parent and child maybe on different nodes and/or in - /// different projects. In either case the break is forced by finding the correct builds states and causing - /// them to fail. - /// - internal void BreakCycle(TargetInProgessState child, TargetInProgessState parent) - { - ErrorUtilities.VerifyThrow(child.TargetId.nodeId == parentEngine.NodeId, - "Expect the child target to be on the node"); - - Project parentProject = projectManager.GetProject(child.TargetId.projectId); - - ErrorUtilities.VerifyThrow(parentProject != null, - "Expect the parent project to be on the node"); - - Target childTarget = parentProject.Targets[child.TargetId.name]; - - List parentStates = FindConnectingContexts(child, parent, childTarget, childTarget.ExecutionState.GetWaitingBuildContexts(), - childTarget.ExecutionState.InitiatingBuildContext); - - ErrorUtilities.VerifyThrow(parentStates.Count > 0, "Must find at least one matching context"); - - for (int i = 0; i < parentStates.Count; i++) - { - parentStates[i].CurrentBuildContextState = ProjectBuildState.BuildContextState.CycleDetected; - TaskExecutionContext taskExecutionContext = - new TaskExecutionContext(parentProject, childTarget, null, parentStates[i], EngineCallback.invalidEngineHandle, - EngineCallback.inProcNode, null); - - parentEngine.PostTaskOutputUpdates(taskExecutionContext); - } - } - - /// - /// Find all the build contexts that connects child to parent. The only time multiple contexts are possible - /// is if the connection is formed by an IBuildEngine callback which requests the same target in the - /// same project to be build in parallel multiple times. - /// - internal List FindConnectingContexts - ( - TargetInProgessState child, - TargetInProgessState parent, - Target childTarget, - List waitingStates, - ProjectBuildState initiatingBuildContext - ) - { - List connectingContexts = new List(); - - // Since the there is a cycle formed at the child there must be at least two requests - // since the edge between the parent and the child is a backward edge - ErrorUtilities.VerifyThrow(waitingStates != null, "There must be a at least two requests at the child"); - - - for (int i = 0; i < waitingStates.Count; i++) - { - if (child.CheckBuildContextForParentMatch(parentEngine.EngineCallback, parent.TargetId, childTarget, waitingStates[i])) - { - connectingContexts.Add(waitingStates[i]); - } - } - - - if (child.CheckBuildContextForParentMatch(parentEngine.EngineCallback, parent.TargetId, childTarget, initiatingBuildContext)) - { - connectingContexts.Add(initiatingBuildContext); - } - - return connectingContexts; - } - - /// - /// Increase the inactivity time out - /// - /// current inactivity timeout - /// new inactivity timeout - private int calculateNewLoopTimeout(int currentTimeout) - { - if (currentTimeout < maxLoopTimeout) - { - currentTimeout = 2 * currentTimeout; - } - - return currentTimeout; - } - - #endregion - - #region Data - private Engine parentEngine; - private ProjectManager projectManager; - private NodeManager nodeManager; - private NodeStatus[] previousStatus; - private NodeStatus previousLocalStatus; - private long ignoreTimeout; - - internal const int initialLoopTimeout = 1000; // Start with a 1 sec of inactivity delay before asking for status - internal const int cycleBreakTimeout = 5000; // Allow 5 seconds for the cycle break to reach the child node - internal const int maxLoopTimeout = 50000; // Allow at most 50 sec of inactivity before asking for status - internal const int nodeStatusReplyTimeout = 300000; // Give the node 5 minutes to reply to a status request - - #endregion - } -} diff --git a/src/Deprecated/Engine/Introspector/NodeStatus.cs b/src/Deprecated/Engine/Introspector/NodeStatus.cs deleted file mode 100644 index 1adb906c8ff..00000000000 --- a/src/Deprecated/Engine/Introspector/NodeStatus.cs +++ /dev/null @@ -1,338 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.IO; -using System.Runtime.Serialization.Formatters.Binary; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class is a container for node status - /// - internal class NodeStatus - { - #region Constructors - - /// - /// Default constructor creating a NodeStatus - /// - internal NodeStatus - ( - int requestId, - bool isActive, - int queueDepth, - long lastTaskActivityTimeStamp, - long lastEngineActivityTimeStamp, - bool isLaunchInProgress - ) - { - this.requestId = requestId; - this.isActive = isActive; - this.queueDepth = queueDepth; - this.lastTaskActivityTimeStamp = lastTaskActivityTimeStamp; - this.lastEngineActivityTimeStamp = lastEngineActivityTimeStamp; - this.isLaunchInProgress = isLaunchInProgress; - this.unhandledException = null; - - this.statusTimeStamp = DateTime.Now.Ticks; - } - - /// - /// Create a node status describing an unhandled error - /// - internal NodeStatus - ( - Exception unhandledException - ) - { - this.requestId = UnrequestedStatus; - this.isActive = true; - this.isLaunchInProgress = false; - this.unhandledException = unhandledException; - - this.statusTimeStamp = DateTime.Now.Ticks; - } - - /// - /// Create a node status indicating that breadth first traversal should be used - /// - internal NodeStatus - ( - bool useBreadthFirstTraversal - ) - { - this.requestId = UnrequestedStatus; - this.isActive = true; - this.isLaunchInProgress = false; - this.unhandledException = null; - this.traversalType = useBreadthFirstTraversal; - } - - /// - /// Create a node status indicating that node process has exited - /// - internal NodeStatus - ( - int requestId - ) - { - this.requestId = requestId; - this.isActive = true; - this.isLaunchInProgress = false; - this.unhandledException = null; - this.hasExited = true; - } - #endregion - - #region Properties - - /// - /// The time period for which the node has been idle when the status report was filled out - /// - internal long TimeSinceLastTaskActivity - { - get - { - return statusTimeStamp - lastTaskActivityTimeStamp; - } - } - - - /// - /// The time period for which the node has been idle when the status report was filled out - /// - internal long TimeSinceLastLoopActivity - { - get - { - return statusTimeStamp - lastEngineActivityTimeStamp; - } - } - - /// - /// The time stamp at which the node was last active - /// - internal long LastTaskActivity - { - get - { - return lastTaskActivityTimeStamp; - } - } - - /// - /// The time stamp at which there was activity in the node's build loop - /// - internal long LastLoopActivity - { - get - { - return lastEngineActivityTimeStamp; - } - } - - /// - /// True if the node is active (i.e. has been launched and can accept commands) - /// - internal bool IsActive - { - get - { - return this.isActive; - } - } - - /// - /// True if the node process is no longer alive - /// - internal bool HasExited - { - get - { - return this.hasExited; - } - } - - /// - /// The token of the request to which this is a response (-1 if status is unrequested) - /// - internal int RequestId - { - get - { - return this.requestId; - } - } - - /// - /// The number of requests that need to be processed - /// - internal int QueueDepth - { - get - { - return this.queueDepth; - } - } - - /// - /// The state of the targets which are in progress on the node - /// - internal TargetInProgessState[] StateOfInProgressTargets - { - get - { - return this.stateOfInProgressTargets; - } - set - { - this.stateOfInProgressTargets = value; - } - } - - /// - /// True if the node is in the process of being launched, but is not yet active - /// - internal bool IsLaunchInProgress - { - get - { - return isLaunchInProgress; - } - } - - /// - /// Returns the exception that occurred on the node - /// - internal Exception UnhandledException - { - get - { - return unhandledException; - } - } - - internal bool TraversalType - { - get - { - return traversalType; - } - } - #endregion - - #region Data - private long statusTimeStamp; // the timestamp indicating when this status structure was filled out - private int requestId; // the token of the request to which this is a response (-1 if status is unrequested) - private bool isActive; // is the node active - private bool isLaunchInProgress; // is the node in the process of being launched - private int queueDepth; // the number of build request in the node's queue - private long lastTaskActivityTimeStamp; // the time stamp of the last task activity - private long lastEngineActivityTimeStamp; // the time stamp of the last engine activity - private TargetInProgessState[] stateOfInProgressTargets; - private Exception unhandledException; // unhandled exception - private bool traversalType; // if true use breadth first traversal - private bool hasExited; // if true the node process is no longer alive - private static BinaryFormatter formatter = new BinaryFormatter(); - internal const int UnrequestedStatus = -1; // used to indicate that the node is generating status without request - #endregion - - #region CustomSerializationToStream - internal void WriteToStream(BinaryWriter writer) - { - writer.Write(traversalType); - writer.Write((Int64)statusTimeStamp); - writer.Write((Int32)requestId); - writer.Write(isActive); - writer.Write(isLaunchInProgress); - writer.Write((Int32)queueDepth); - writer.Write((Int64)lastTaskActivityTimeStamp); - writer.Write((Int64)lastEngineActivityTimeStamp); - - if (stateOfInProgressTargets == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - writer.Write((Int32)stateOfInProgressTargets.Length); - for (int i = 0; i < stateOfInProgressTargets.Length; i++) - { - if (stateOfInProgressTargets[i] == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - stateOfInProgressTargets[i].WriteToStream(writer); - } - } - } - - if (unhandledException == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - formatter.Serialize(writer.BaseStream, unhandledException); - } - } - - internal static NodeStatus CreateFromStream(BinaryReader reader) - { - NodeStatus status = new NodeStatus(null); - status.traversalType = reader.ReadBoolean(); - status.statusTimeStamp = reader.ReadInt64(); - status.requestId = reader.ReadInt32(); - status.isActive = reader.ReadBoolean(); - status.isLaunchInProgress = reader.ReadBoolean(); - status.queueDepth = reader.ReadInt32(); - status.lastTaskActivityTimeStamp = reader.ReadInt64(); - status.lastEngineActivityTimeStamp = reader.ReadInt64(); - - if (reader.ReadByte() == 0) - { - status.stateOfInProgressTargets = null; - } - else - { - int numberOfInProgressTargets = reader.ReadInt32(); - status.stateOfInProgressTargets = new TargetInProgessState[numberOfInProgressTargets]; - for (int i = 0; i < numberOfInProgressTargets; i++) - { - if (reader.ReadByte() == 0) - { - status.stateOfInProgressTargets[i] = null; - } - else - { - TargetInProgessState state = new TargetInProgessState(); - state.CreateFromStream(reader); - status.stateOfInProgressTargets[i] = state; - } - } - } - - if (reader.ReadByte() == 0) - { - status.unhandledException = null; - } - else - { - // codeql[cs/dangerous-binary-deserialization] BinaryFormatter is still present due to the skip-release deprecation requirement of Visual Studio. Removal has been scheduled for Oct 2024 in conjunction with VS 17.3 branching. - status.unhandledException = (Exception)formatter.Deserialize(reader.BaseStream); - } - return status; - } - #endregion - } -} diff --git a/src/Deprecated/Engine/Introspector/TargetCycleDetector.cs b/src/Deprecated/Engine/Introspector/TargetCycleDetector.cs deleted file mode 100644 index ab7cf76f593..00000000000 --- a/src/Deprecated/Engine/Introspector/TargetCycleDetector.cs +++ /dev/null @@ -1,420 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Diagnostics; // for debugger display attribute - -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class is used to construct and analyze the graph of inprogress targets in order to find - /// cycles inside the graph. To find cycles a post order traversal is used to assign a post order - /// traversal to each node. Back edges indicate cycles in the graph and they can indentified by - /// a link from lower index node to a higher index node. - /// - /// The graph arrives in pieces from individual nodes and needs to be stiched together by identifying - /// the parent and child for each cross node link. To do that it is necessary to match up parent - /// build request for a child with and outstanding request from the parent (see LinkCrossNodeBuildRequests) - /// - internal class TargetCycleDetector - { - #region Constructors - internal TargetCycleDetector(EngineLoggingServices engineLoggingService, EngineCallback engineCallback) - { - this.engineLoggingService = engineLoggingService; - this.engineCallback = engineCallback; - - dependencyGraph = new Hashtable(); - outstandingExternalRequests = new Hashtable(); - cycleParent = null; - cycleChild = null; - } - #endregion - - #region Properties - internal TargetInProgessState CycleEdgeParent - { - get - { - return this.cycleParent; - } - } - - internal TargetInProgessState CycleEdgeChild - { - get - { - return this.cycleChild; - } - } - #endregion - - #region Methods - - /// - /// Add a information about an array of inprogress targets to the graph - /// - internal void AddTargetsToGraph(TargetInProgessState[] inprogressTargets) - { - if (inprogressTargets != null) - { - for (int i = 0; i < inprogressTargets.Length; i++) - { - if (inprogressTargets[i] != null) - { - AddTargetToGraph(inprogressTargets[i]); - } - } - } - } - - /// - /// Add a information about a given inprogress target to the graph - /// - private void AddTargetToGraph(TargetInProgessState inProgressTarget) - { - // Check if the target is already in the graph in which - // case reuse the current object - GraphNode targetNode = (GraphNode)dependencyGraph[inProgressTarget.TargetId]; - if (targetNode == null) - { - targetNode = new GraphNode(inProgressTarget); - dependencyGraph.Add(inProgressTarget.TargetId, targetNode); - } - else - { - ErrorUtilities.VerifyThrow(targetNode.targetState == null, "Target should only be added once"); - targetNode.targetState = inProgressTarget; - } - - // For each parent target - add parent links creating parent targets if necessary - foreach (TargetInProgessState.TargetIdWrapper parentTarget in inProgressTarget.ParentTargets) - { - GraphNode parentNode = (GraphNode)dependencyGraph[parentTarget]; - if (parentNode == null) - { - parentNode = new GraphNode(null); - dependencyGraph.Add(parentTarget, parentNode); - } - parentNode.children.Add(targetNode); - } - - // For all outgoing requests add them to the list of outstanding requests for the system - if (inProgressTarget.OutstandingBuildRequests != null) - { - // Since the nodeIndex is not serialized it is necessary to restore it after the request - // travels across the wire - for (int i = 0; i < inProgressTarget.OutstandingBuildRequests.Length; i++) - { - inProgressTarget.OutstandingBuildRequests[i].NodeIndex = inProgressTarget.TargetId.nodeId; - } - outstandingExternalRequests.Add(inProgressTarget.TargetId, inProgressTarget.OutstandingBuildRequests); - } - - // If the target has no parents mark it as root (such targets are created due to host requests) - if (inProgressTarget.RequestedByHost) - { - targetNode.isRoot = true; - } - } - - /// - /// Analyze the graph and try to find cycles. Returns true if a cycle is found. - /// - internal bool FindCycles() - { - // Add the edges for the cross node connections - LinkCrossNodeBuildRequests(); - - // Perform post-order traversal of the forest of directed graphs - traversalCount = 0; - - // First try to perform the traversal from the roots (i.e nodes that are due to host requests) - foreach (GraphNode node in dependencyGraph.Values) - { - if (node.isRoot && node.traversalIndex == GraphNode.InvalidIndex) - { - BreadthFirstTraversal(node); - } - } - // Verify that all nodes have been reached - foreach (GraphNode node in dependencyGraph.Values) - { - if (node.traversalIndex == GraphNode.InvalidIndex) - { - BreadthFirstTraversal(node); - } - } - - // Check every edge for being a back edge - foreach (GraphNode node in dependencyGraph.Values) - { - // Check the edges from the current node to its children - FindBackEdges(node); - - // Stop looking as soon as the first cycle is found - if (cycleParent != null) - { - break; - } - } - - return cycleParent != null; - } - - /// - /// For each target that has a cross node build request waiting for it to complete, iterate - /// over the list of outstanding requests and find the matching out going request. Once - /// the matching request is found - link the parent and child targets. - /// - private void LinkCrossNodeBuildRequests() - { - foreach (GraphNode node in dependencyGraph.Values) - { - TargetInProgessState.TargetIdWrapper[] parentsForBuildRequests = - new TargetInProgessState.TargetIdWrapper[node.targetState.ParentBuildRequests.Count]; - - for (int j = 0; j < node.targetState.ParentBuildRequests.Count; j++) - { - BuildRequest buildRequest = node.targetState.ParentBuildRequests[j]; - int nodeIndex = buildRequest.NodeIndex; - int handleId = buildRequest.HandleId; - int requestId = buildRequest.RequestId; - bool foundParent = false; - - // Skip requests that originated from the host - if (handleId == EngineCallback.invalidEngineHandle) - { - node.isRoot = true; - continue; - } - - // If the request being analyzed came from one of the child nodes, its incoming external request's - // handleId will point at a routing context on the parent engine. If the outgoing request - // orginated from another child the two requests (outgoing and incoming) point at different - // routing contexts. In that case it is necessary to unwind the incoming request to the routing - // context of the outgoing request. If outgoing request originated from the parent node - - // there will be only one routing request. - if (node.targetState.TargetId.nodeId != 0) - { - ExecutionContext executionContext = engineCallback.GetExecutionContextFromHandleId(buildRequest.HandleId); - RequestRoutingContext routingContext = executionContext as RequestRoutingContext; - if (routingContext != null && routingContext.ParentHandleId != EngineCallback.invalidEngineHandle) - { - ExecutionContext nextExecutionContext = engineCallback.GetExecutionContextFromHandleId(routingContext.ParentHandleId); - - if (nextExecutionContext is RequestRoutingContext) - { - nodeIndex = nextExecutionContext.NodeIndex; - handleId = routingContext.ParentHandleId; - requestId = routingContext.ParentRequestId; - } - } - else - { - // Skip requests that originated from the host - node.isRoot = true; - continue; - } - } - - // Iterate over all outstanding requests until a match is found - foreach (DictionaryEntry entry in outstandingExternalRequests) - { - BuildRequest[] externalRequests = (BuildRequest[])entry.Value; - for (int i = 0; i < externalRequests.Length && !foundParent; i++) - { - if (handleId == externalRequests[i].HandleId && - requestId == externalRequests[i].RequestId && - nodeIndex == externalRequests[i].NodeIndex) - { - // Verify that the project name is the same - ErrorUtilities.VerifyThrow( - String.Equals(buildRequest.ProjectFileName, externalRequests[i].ProjectFileName, StringComparison.OrdinalIgnoreCase), - "The two requests should have the same project name"); - - // Link the two graph nodes together - GraphNode parentNode = (GraphNode)dependencyGraph[entry.Key]; - parentNode.children.Add(node); - - parentsForBuildRequests[j] = parentNode.targetState.TargetId; - - foundParent = true; - } - } - - if (foundParent) - { - break; - } - } - } - node.targetState.ParentTargetsForBuildRequests = parentsForBuildRequests; - } - } - - /// - /// Breadth first traversal over the DAG, assigning post order indecies to each node in the graph. This - /// function should be called at least once for each tree in the forest in order to assign - /// indecies to every node in the graph - /// - private void BreadthFirstTraversal(GraphNode node) - { - ErrorUtilities.VerifyThrow(node.traversalIndex == GraphNode.InvalidIndex, - "Should only consider each node once"); - - node.traversalIndex = GraphNode.InProgressIndex; - - for (int i = 0; i < node.children.Count; i++) - { - if (node.children[i].traversalIndex == GraphNode.InvalidIndex) - { - BreadthFirstTraversal(node.children[i]); - } - } - - node.traversalIndex = traversalCount; - traversalCount++; - } - - /// - /// Check for back edges from the given node to its children - /// - private void FindBackEdges(GraphNode node) - { - ErrorUtilities.VerifyThrow(node.traversalIndex != GraphNode.InvalidIndex, - "Each node should have a valid traversal index"); - - for (int i = 0; i < node.children.Count; i++) - { - // Check for a back edge - if (node.children[i].traversalIndex > node.traversalIndex) - { - cycleParent = node.targetState; - cycleChild = node.children[i].targetState; - DumpCycleSequence(node.children[i], node); - break; - } - // Check for an edge from the node to itself - if (node.children[i].targetState.TargetId == node.targetState.TargetId) - { - cycleParent = node.targetState; - cycleChild = node.targetState; - break; - } - } - } - - private void DumpCycleSequence(GraphNode parent, GraphNode child) - { - foreach (GraphNode node in dependencyGraph.Values) - { - node.traversalIndex = GraphNode.InvalidIndex; - } - BuildEventContext buildEventContext = - new BuildEventContext(child.targetState.TargetId.nodeId, - child.targetState.TargetId.id, - BuildEventContext.InvalidProjectContextId, - BuildEventContext.InvalidTaskId - ); - DumpCycleSequenceOutput(parent, child, buildEventContext); - } - - private bool DumpCycleSequenceOutput(GraphNode parent, GraphNode child, BuildEventContext buildEventContext) - { - if (parent == child) - { - engineLoggingService.LogComment(buildEventContext, "cycleTraceTitle"); - engineLoggingService.LogComment - (buildEventContext, "cycleTraceLine", parent.targetState.TargetId.name, parent.targetState.ProjectName); - return true; - } - - if (parent.traversalIndex == GraphNode.InProgressIndex) - { - return false; - } - - parent.traversalIndex = GraphNode.InProgressIndex; - - for (int i = 0; i < parent.children.Count; i++) - { - if (DumpCycleSequenceOutput(parent.children[i], child, buildEventContext)) - { - engineLoggingService.LogComment - (buildEventContext, "cycleTraceLine", parent.targetState.TargetId.name, parent.targetState.ProjectName); - return true; - } - } - - return false; - } - - #endregion - - #region Data - /// - /// The table of all targets in the dependency graph, indexed by TargetNameStructure which - /// contains Target name, Project Id, Node Id which uniquely identifies every target in the system - /// - private Hashtable dependencyGraph; - /// - /// List of all outstanding cross node build requests - /// - private Hashtable outstandingExternalRequests; - /// - /// The index used for the breadth first traversal - /// - private int traversalCount; - /// - /// The TargetNameStructure for the parent of the edge creating the cycle - /// - private TargetInProgessState cycleParent; - /// - /// The TargetNameStructure for the parent of the edge creating the cycle - /// - private TargetInProgessState cycleChild; - /// - /// Logging service for outputing the loop trace - /// - private EngineLoggingServices engineLoggingService; - /// - /// Engine callback which is to walk the inprogress execution contexts - /// - private EngineCallback engineCallback; - #endregion - - [DebuggerDisplay("Node (Name = { targetState.TargetId.name }, Project = { targetState.TargetId.projectId }), Node = { targetState.TargetId.nodeId })")] - private class GraphNode - { - #region Constructors - internal GraphNode(TargetInProgessState targetState) - { - this.targetState = targetState; - this.children = new List(); - this.traversalIndex = InvalidIndex; - this.isRoot = false; - } - #endregion - - #region Data - internal TargetInProgessState targetState; - internal List children; - internal bool isRoot; - internal int traversalIndex; - - internal const int InvalidIndex = -1; - internal const int InProgressIndex = -2; - #endregion - } - } -} diff --git a/src/Deprecated/Engine/Introspector/TargetInProgressState.cs b/src/Deprecated/Engine/Introspector/TargetInProgressState.cs deleted file mode 100644 index c3f7438d0a8..00000000000 --- a/src/Deprecated/Engine/Introspector/TargetInProgressState.cs +++ /dev/null @@ -1,650 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections.Generic; -using System.IO; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class is used to construct and contain the state of an inprogress targets. The primary data - /// includes build requests blocked until this target completes and build requests that must complete - /// before this target can make forward process. - /// - internal class TargetInProgessState - { - #region Constructors - - internal TargetInProgessState() - { - } - - internal TargetInProgessState - ( - EngineCallback engineCallback, - Target target, - List waitingBuildStates, - ProjectBuildState initiatingRequest, - BuildRequest[] outstandingBuildRequests, - string projectName - ) - { - this.targetId = new TargetIdWrapper(target); - this.outstandingBuildRequests = outstandingBuildRequests; - // For each waiting build context try to find the parent target - this.parentBuildRequests = new List(); - this.parentTargets = new List(); - this.projectName = projectName; - - // Process the waiting contexts if there are any - if (waitingBuildStates != null) - { - for (int i = 0; i < waitingBuildStates.Count; i++) - { - ProcessBuildContext(engineCallback, waitingBuildStates[i], target); - } - } - // Process the initiating context - ProcessBuildContext(engineCallback, initiatingRequest, target); - } - - /// - /// Figure out the parent target or the parent build request for the given context - /// - private void ProcessBuildContext(EngineCallback engineCallback, ProjectBuildState buildContext, Target target) - { - BuildRequest parentRequest; - TargetIdWrapper parentName = FindParentTarget(engineCallback, buildContext, target, out parentRequest); - - if (parentName != null) - { - parentTargets.Add(parentName); - } - if (parentRequest != null) - { - parentBuildRequests.Add(parentRequest); - } - } - #endregion - - #region Properties - - /// - /// Unique identifier for the target - /// - internal TargetIdWrapper TargetId - { - get - { - return this.targetId; - } - } - - /// - /// List of unique identifiers for the targets that are blocked until the current - /// target completes - /// - internal List ParentTargets - { - get - { - return this.parentTargets; - } - } - - /// - /// List of build requests that are blocked until the current - /// target completes - /// - internal List ParentBuildRequests - { - get - { - return this.parentBuildRequests; - } - } - - /// - /// Array of build requests that must complete before the current - /// target can make forward process - internal BuildRequest[] OutstandingBuildRequests - { - get - { - return this.outstandingBuildRequests; - } - } - - /// - /// An array of unique identifiers for the targets that generated the build requests (parentBuildRequests) - /// that are blocked until the current target completes. This array can only be calculated given - /// the target information for all the nodes in the system. - /// - internal TargetIdWrapper[] ParentTargetsForBuildRequests - { - get - { - return this.parentTargetsForBuildRequests; - } - set - { - this.parentTargetsForBuildRequests = value; - } - } - - /// - /// True if the target was requested by the host. The value is only valid for targets on the - /// parent node. - /// - internal bool RequestedByHost - { - get - { - if (targetId.nodeId == 0) - { - return requestedByHost; - } - return false; - } - } - - /// - /// Name of the project containing the target (only used for logging) - /// - internal string ProjectName - { - get - { - return projectName; - } - } - #endregion - - #region Methods - - /// - /// Given a build state try to find the parent target that caused this build state to - /// come into being either via dependent, on error relationship or via IBuildEngine call - /// - internal TargetIdWrapper FindParentTarget - ( - EngineCallback engineCallback, - ProjectBuildState buildContext, - Target target, - out BuildRequest parentRequest - ) - { - // We need to find the parent target - parentRequest = null; - - // Skip build states that have already been filled - if (buildContext.CurrentBuildContextState == ProjectBuildState.BuildContextState.RequestFilled) - { - return null; - } - - // Check if the target was called due to a onerror or depends on call - if (buildContext.ContainsBlockingTarget(target.Name)) - { - // Figure out the record for the parent target - Project containingProject = target.ParentProject; - Target parentTarget = containingProject.Targets[buildContext.GetParentTarget(target.Name)]; - return new TargetIdWrapper(parentTarget); - } - else - { - // The build context must have formed due to IBuildEngine call - ErrorUtilities.VerifyThrow( - String.Equals(EscapingUtilities.UnescapeAll(buildContext.NameOfTargetInProgress), target.Name, StringComparison.OrdinalIgnoreCase), - "The target should be the in progress target for the context"); - // This target is called due to IBuildEngine or host request - return FindParentTargetForBuildRequest(engineCallback, buildContext.BuildRequest, out parentRequest); - } - } - - /// - /// Given a build request try to find the target that caused it to come into being - /// - private TargetIdWrapper FindParentTargetForBuildRequest - ( - EngineCallback engineCallback, - BuildRequest triggeringBuildRequest, - out BuildRequest parentTriggeringRequest - ) - { - parentTriggeringRequest = null; - - // If request is non-external and generated due to IBuildEngine call try - // to find the target that caused the IBuildEngine call - if (triggeringBuildRequest.IsGeneratedRequest && !triggeringBuildRequest.IsExternalRequest) - { - ExecutionContext executionContext = - engineCallback.GetExecutionContextFromHandleId(triggeringBuildRequest.HandleId); - - // If the parent context is not a routing context than we can - // get the parent target from it - if (executionContext is TaskExecutionContext) - { - return new TargetIdWrapper(((TaskExecutionContext)executionContext).ParentTarget); - } - // If the parent context if a routing context the parent target is not available - // on the current node, so store the request instead - else - { - parentTriggeringRequest = triggeringBuildRequest; - } - } - // If the request is external to the node - store the request since the parent target - // is not available - else if (triggeringBuildRequest.IsExternalRequest) - { - parentTriggeringRequest = triggeringBuildRequest; - } - else - { - requestedByHost = true; - } - - return null; - } - - /// - /// This function checks if the given ProjectBuildState is caused by a given parent target (via - /// a dependency, onerror or IBuildEngine relationship) - /// - internal bool CheckBuildContextForParentMatch - ( - EngineCallback engineCallback, - TargetIdWrapper parentId, - Target target, - ProjectBuildState projectBuildState - ) - { - BuildRequest parentRequest; - TargetInProgessState.TargetIdWrapper parentName = - FindParentTarget(engineCallback, projectBuildState, target, out parentRequest); - - if (parentName?.Equals(parentId) == true) - { - return true; - } - - if (parentRequest != null) - { - for (int j = 0; j < parentBuildRequests.Count; j++) - { - if (parentRequest.HandleId == parentBuildRequests[j].HandleId && - parentRequest.RequestId == parentBuildRequests[j].RequestId) - { - if (parentTargetsForBuildRequests[j].Equals(parentId)) - { - return true; - } - else - { - return false; - } - } - } - } - return false; - } - - #endregion - - #region Data - - // Unique identifier for the target - private TargetIdWrapper targetId; - - // List of targets waiting on the current target - private List parentTargets; - - // List of build requests waiting on the current target - private List parentBuildRequests; - - // List of the build requests the target is waiting on - private BuildRequest[] outstandingBuildRequests; - - // Mapping between list of build requests waiting on the current target and targets - // from which these build reuquests originated - private TargetIdWrapper[] parentTargetsForBuildRequests; - - // Name of the project containing the target (only used for logging) - private string projectName; - - // Set to true if the target had a been requested by host (direct requests from host only occur on - // parent node) - private bool requestedByHost; - #endregion - - #region CustomSerializationToStream - internal void WriteToStream(BinaryWriter writer) - { - #region TargetId - if (targetId == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - targetId.WriteToStream(writer); - } - #endregion - #region ParentTargets - if (parentTargets == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - writer.Write((Int32)parentTargets.Count); - foreach (TargetIdWrapper target in parentTargets) - { - if (target == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - target.WriteToStream(writer); - } - } - } - #endregion - #region ParentBuildRequests - if (parentBuildRequests == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - writer.Write((Int32)parentBuildRequests.Count); - foreach (BuildRequest request in parentBuildRequests) - { - if (request == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - request.WriteToStream(writer); - } - } - } - #endregion - #region OutstandingBuildRequests - if (outstandingBuildRequests == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - writer.Write((Int32)outstandingBuildRequests.Length); - for (int i = 0; i < outstandingBuildRequests.Length; i++) - { - if (outstandingBuildRequests[i] == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - outstandingBuildRequests[i].WriteToStream(writer); - } - } - } - #endregion - #region ParentTargetsForBuildRequests - if (parentTargetsForBuildRequests == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - writer.Write((Int32)parentTargetsForBuildRequests.Length); - for (int i = 0; i < parentTargetsForBuildRequests.Length; i++) - { - if (parentTargetsForBuildRequests[i] == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - parentTargetsForBuildRequests[i].WriteToStream(writer); - } - } - } - #endregion - #region ProjectName - if (projectName == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - writer.Write(projectName); - } - #endregion - } - - internal void CreateFromStream(BinaryReader reader) - { - #region TargetId - if (reader.ReadByte() == 0) - { - targetId = null; - } - else - { - targetId = new TargetIdWrapper(); - targetId.CreateFromStream(reader); - } - #endregion - #region ParentTargets - if (reader.ReadByte() == 0) - { - parentTargets = null; - } - else - { - int numberOfTargets = reader.ReadInt32(); - parentTargets = new List(numberOfTargets); - for (int i = 0; i < numberOfTargets; i++) - { - if (reader.ReadByte() == 0) - { - parentTargets.Add(null); - } - else - { - TargetIdWrapper wrapper = new TargetIdWrapper(); - wrapper.CreateFromStream(reader); - parentTargets.Add(wrapper); - } - } - } - #endregion - #region ParentBuildRequests - if (reader.ReadByte() == 0) - { - parentBuildRequests = null; - } - else - { - int numberOfRequests = reader.ReadInt32(); - parentBuildRequests = new List(numberOfRequests); - for (int i = 0; i < numberOfRequests; i++) - { - if (reader.ReadByte() == 0) - { - parentBuildRequests.Add(null); - } - else - { - parentBuildRequests.Add(BuildRequest.CreateFromStream(reader)); - } - } - } - #endregion - #region OutstandingBuildRequests - if (reader.ReadByte() == 0) - { - outstandingBuildRequests = null; - } - else - { - int numberOfBuildRequests = reader.ReadInt32(); - outstandingBuildRequests = new BuildRequest[numberOfBuildRequests]; - for (int i = 0; i < numberOfBuildRequests; i++) - { - if (reader.ReadByte() == 0) - { - outstandingBuildRequests[i] = null; - } - else - { - outstandingBuildRequests[i] = BuildRequest.CreateFromStream(reader); - } - } - } - #endregion - #region ParentTargetsForBuildRequests - if (reader.ReadByte() == 0) - { - parentTargetsForBuildRequests = null; - } - else - { - int numberOfTargetsForBuildRequests = reader.ReadInt32(); - parentTargetsForBuildRequests = new TargetIdWrapper[numberOfTargetsForBuildRequests]; - for (int i = 0; i < numberOfTargetsForBuildRequests; i++) - { - if (reader.ReadByte() == 0) - { - parentTargetsForBuildRequests[i] = null; - } - else - { - TargetIdWrapper wrapper = new TargetIdWrapper(); - wrapper.CreateFromStream(reader); - parentTargetsForBuildRequests[i] = wrapper; - } - } - } - #endregion - #region ProjectName - if (reader.ReadByte() == 0) - { - projectName = null; - } - else - { - projectName = reader.ReadString(); - } - #endregion - } - #endregion - - /// - /// A class that contains information to uniquely identify a target - /// - internal class TargetIdWrapper - { - internal TargetIdWrapper() - { - } - - internal TargetIdWrapper(Target target) - { - this.name = target.Name; - this.projectId = target.ParentProject.Id; - this.nodeId = target.ParentEngine.NodeId; - this.id = target.Id; - } - - /// - /// Override the equals operator to give valuetype comparison semantics - /// - public override bool Equals(object obj) - { - TargetIdWrapper other = obj as TargetIdWrapper; - if (other != null) - { - if (other.projectId == projectId && other.nodeId == nodeId && - (String.Equals(other.name, name, StringComparison.OrdinalIgnoreCase))) - { - return true; - } - return false; - } - - return base.Equals(obj); - } - - public override int GetHashCode() - { - return projectId; - } - - // Target name - internal string name; - // Id for the parent project - internal int projectId; - // Id for the node where the target exists - internal int nodeId; - // Target Id - internal int id; - - #region CustomSerializationToStream - internal void WriteToStream(BinaryWriter writer) - { - if (name == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - writer.Write(name); - } - - writer.Write((Int32)projectId); - writer.Write((Int32)nodeId); - writer.Write((Int32)id); - } - - internal void CreateFromStream(BinaryReader reader) - { - if (reader.ReadByte() == 0) - { - name = null; - } - else - { - name = reader.ReadString(); - } - - projectId = reader.ReadInt32(); - nodeId = reader.ReadInt32(); - id = reader.ReadInt32(); - } - #endregion - } - } -} diff --git a/src/Deprecated/Engine/Items/BuildItem.cs b/src/Deprecated/Engine/Items/BuildItem.cs deleted file mode 100644 index 8076c0ba31d..00000000000 --- a/src/Deprecated/Engine/Items/BuildItem.cs +++ /dev/null @@ -1,2331 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Xml; -using System.Diagnostics; -using System.Collections; -using System.Collections.Generic; -using System.IO; - - -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// This class represents a single item of the project. An item is usually a file on disk, with a type associated with it, and - /// its own item-specific attributes. The list of items is initially specified via XML tags in the project file, although a - /// single item tag can represent multiple items through the use of standard wilcards * and ?. Also, tasks can add new items - /// of various types to the project's item list -- these items don't have any XML representation. - /// - /// - /// [!WARNING] - /// > This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// RGoel - [DebuggerDisplay("BuildItem (Name = { Name }, Include = { Include }, FinalItemSpec = { FinalItemSpec }, Condition = { Condition } )")] - public class BuildItem - { - #region Member Data - - // Whether the item is part of the project "manifest" - ie, in the project outside of a target. - // Note that items specified inside of targets may have backing XML, but aren't considered persisted. - private bool isPartOfProjectManifest; - - // Object holding the backing Xml, if any - // For virtual items (i.e., those generated by tasks), this is null. - private BuildItemGroupChildXml xml; - - // This is the "type" of the item, for example, "CPPFile". This has nothing to - // do with the file extension or anything else related to the OS. - // Each project author can define his own item types, which are - // just a way of bucketing similar items together. - private string name; - - /// - /// The library to consult for possible default metadata values when the - /// item itself does not have a value for requested metadata. - /// May be null, if this item is not associated with a particular project. - /// - private ItemDefinitionLibrary itemDefinitionLibrary; - - // This is the "Include" value of a virtual item. This - // may contain wildcards. - // For persisted (non-virtual) items, the include is gotten from - // the backing xml; there is no point storing a copy here, and this - // remains null. - private string include = null; - - // In the project file, the user can put arbitrary meta-data on the item tag. These meta-data are termed "custom item - // attributes" (NOT to be confused with XML attributes on the item element). For a persisted BuildItem object, these meta-data - // are stored as child nodes of the "itemElement", and are also cached in this hash table (to allow case-insensitive - // lookup). For a virtual BuildItem object, the meta-data are only stored in this hash table. - // NOTE: for a persisted item, it is possible for the same custom attribute to appear multiple times under an item - // element -- we allow this, but follow a "last one wins" policy - private CopyOnWriteHashtable unevaluatedCustomMetadata = null; - private CopyOnWriteHashtable evaluatedCustomMetadata = null; - - // Private copies of the above metadata tables, kept if the metadata has been modified during the build; - // we can revert to them later to go back to the pre-build state - private CopyOnWriteHashtable unevaluatedCustomMetadataBackup; - private CopyOnWriteHashtable evaluatedCustomMetadataBackup; - - // If this item is persisted in the project file, then we need to - // store a reference to the parent . This makes it easier - // to remove an item from a project through the object model. - private BuildItemGroup parentPersistedItemGroup = null; - - // When an item in a project file gets evaluated, it may evaluate to - // several different items. For example, in the project file, - // really evaluates to 3 separate - // items: a, b, and c. - // For each of these 3 evaluated items, the parent item is the original - // item tag that came from the project file. When one of these - // "child" items is modified/deleted/etc. through the object model, we - // need a pointer to the parent item in order to modify it accordingly. - private BuildItem parentPersistedItem = null; - - // When an item in a project file gets evaluated, it may evaluate to - // several different items. This is the list of child items that - // a real item tag in the project file evaluated to. - private BuildItemGroup childItems = null; - - // this is the Include attribute with all embedded properties expanded, but with wildcards intact - private string evaluatedItemSpecEscaped; - - // This is the final evaluated item specification, and is only valid - // if you are looking at an item returned from Project.EvaluatedItems. - // If the "Include" attribute was something simple that represented a - // single file, like "foo.cs", then this finalItemSpec would also be - // "foo.cs". However, in the case of wildcards, the "Include" attribute - // might say "*.cs", whereas this finalItemSpec would be one single item - // such as "foo.cs". - private string finalItemSpecEscaped = String.Empty; - - // this table is used to cache the results of path manipulations performed on the (evaluated/final) item-spec if the - // item-spec is a true file-spec i.e. it contains file or directory path information - // NOTE: modifications to the item-spec are typically needed for item vector transforms, but the modifiers are also - // exposed as pre-defined/reserved attributes on the item - private Hashtable itemSpecModifiers; - - // the portion of the directory of the final item-spec that was generated by a recursive wildcard - private string recursivePortionOfFinalItemSpecDirectory = null; - - // If this is a persisted item element, this boolean tells us whether - // it came from the main project file or an imported project file. - private bool importedFromAnotherProject = false; - - #endregion - - #region CustomSerializationToStream - internal void WriteToStream(BinaryWriter writer) - { - writer.Write(importedFromAnotherProject); - #region RecursivePortionOfFinalItemSpecDirectory - if (recursivePortionOfFinalItemSpecDirectory == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - writer.Write(recursivePortionOfFinalItemSpecDirectory); - } - #endregion - #region FinalItemSpecEscaped - if (finalItemSpecEscaped == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - writer.Write(finalItemSpecEscaped); - } - #endregion - #region Name - if (name == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - writer.Write(name); - } - #endregion - #region Include - string includeValue = this.include; - if (IsBackedByXml) - { - includeValue = xml.Include; - } - if (includeValue == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - writer.Write(includeValue); - } - #endregion - #region EvaluatedItemSpecEscaped - if (evaluatedItemSpecEscaped == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - writer.Write(evaluatedItemSpecEscaped); - } - #endregion - #region UnevaluatedCustomMetaData - IDictionary metadata = GetAllCustomUnevaluatedMetadata(); - if (metadata == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - writer.Write((Int32)metadata.Count); - foreach (string key in metadata.Keys) - { - writer.Write(key); - if (metadata[key] == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - writer.Write((string)metadata[key]); - } - } - } - #endregion - #region EvaluatedCustomMetaData - metadata = GetAllCustomEvaluatedMetadata(); - if (metadata == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - writer.Write((Int32)metadata.Count); - foreach (string key in metadata.Keys) - { - writer.Write(key); - if (metadata[key] == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - writer.Write((string)metadata[key]); - } - } - } - #endregion - #region ItemSpecModifiers - if (itemSpecModifiers == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - writer.Write((Int32)itemSpecModifiers.Count); - foreach (string key in itemSpecModifiers.Keys) - { - writer.Write(key); - if (itemSpecModifiers[key] == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - writer.Write((string)itemSpecModifiers[key]); - } - } - } - #endregion - } - - internal void CreateFromStream(BinaryReader reader) - { - importedFromAnotherProject = reader.ReadBoolean(); - #region RecursivePortionOfFinalItemSpecDirectory - if (reader.ReadByte() == 0) - { - recursivePortionOfFinalItemSpecDirectory = null; - } - else - { - recursivePortionOfFinalItemSpecDirectory = reader.ReadString(); - } - #endregion - #region FinalItemSpecEscaped - if (reader.ReadByte() == 0) - { - finalItemSpecEscaped = null; - } - else - { - finalItemSpecEscaped = reader.ReadString(); - } - #endregion - #region Name - if (reader.ReadByte() == 0) - { - name = null; - } - else - { - name = reader.ReadString(); - } - #endregion - #region VitrualIncludeAttribute - if (reader.ReadByte() == 0) - { - include = null; - } - else - { - include = reader.ReadString(); - } - #endregion - #region EvaluatedItemSpecEscaped - if (reader.ReadByte() == 0) - { - evaluatedItemSpecEscaped = null; - } - else - { - evaluatedItemSpecEscaped = reader.ReadString(); - } - #endregion - #region UnevaluatedCustomMetadata - if (reader.ReadByte() == 0) - { - unevaluatedCustomMetadata = null; - } - else - { - int numberUnevaluatedItems = reader.ReadInt32(); - unevaluatedCustomMetadata = new CopyOnWriteHashtable(numberUnevaluatedItems, StringComparer.OrdinalIgnoreCase); - for (int i = 0; i < numberUnevaluatedItems; i++) - { - string key = reader.ReadString(); - string value = null; - if (reader.ReadByte() != 0) - { - value = reader.ReadString(); - } - unevaluatedCustomMetadata.Add(key, value); - } - } - #endregion - #region EvaluatedCustomMetadata - if (reader.ReadByte() == 0) - { - evaluatedCustomMetadata = null; - } - else - { - int numberevaluatedCustomMetadata = reader.ReadInt32(); - evaluatedCustomMetadata = new CopyOnWriteHashtable(numberevaluatedCustomMetadata, StringComparer.OrdinalIgnoreCase); - for (int i = 0; i < numberevaluatedCustomMetadata; i++) - { - string key = reader.ReadString(); - string value = null; - if (reader.ReadByte() != 0) - { - value = reader.ReadString(); - } - evaluatedCustomMetadata.Add(key, value); - } - } - #endregion - #region ItemSpecModifiers - if (reader.ReadByte() == 0) - { - itemSpecModifiers = null; - } - else - { - int numberItemSpecModifiers = reader.ReadInt32(); - itemSpecModifiers = new Hashtable(numberItemSpecModifiers); - for (int i = 0; i < numberItemSpecModifiers; i++) - { - string key = reader.ReadString(); - string value = null; - if (reader.ReadByte() != 0) - { - value = reader.ReadString(); - } - itemSpecModifiers.Add(key, value); - } - } - #endregion - } - #endregion - - #region Constructors - - /// - /// Creates a new item with an XML element backing it. Use this to add a new persisted item to the project file. - /// - /// can be null - /// can be null - internal BuildItem(XmlDocument ownerDocument, string name, string include, ItemDefinitionLibrary itemDefinitionLibrary) - : this(ownerDocument, name, include, true /* create custom metadata cache */, itemDefinitionLibrary) - { - } - - /// - /// Creates either a new item with an XML element backing it, or a virtual - /// item. To conserve memory, this constructor does not allocate storage - /// for custom metadata, unless told to do so. - /// - /// - /// PERF WARNING: Allocating memory for the custom metadata cache is expensive - /// when a build generates a large number of items. - /// - /// can be null - /// can be null - private BuildItem(XmlDocument ownerDocument, string name, string include, bool createCustomMetadataCache, ItemDefinitionLibrary itemDefinitionLibrary) - { - BuildItemHelper(ownerDocument, name, include, createCustomMetadataCache, itemDefinitionLibrary); - } - - /// - /// Common code for constructors. If an ownerDocument is passed in, it's a persisted element. - /// - /// can be null - /// can only be null if ownerDocument is null - private void BuildItemHelper(XmlDocument ownerDocument, string itemName, string itemInclude, bool createCustomMetadataCache, ItemDefinitionLibrary itemDefinitionLibraryToUse) - { - // Only check for null. It's legal to make BuildItems with empty - // item specs -- this is to be consistent with how we shipped TaskItem. - // See #567058. - ErrorUtilities.VerifyThrowArgumentNull(itemInclude, nameof(itemInclude)); - - // Validate that the item name doesn't contain any illegal characters. - if (itemName != null) - { - XmlUtilities.VerifyThrowValidElementName(itemName); - ErrorUtilities.VerifyThrowInvalidOperation(XMakeElements.IllegalItemPropertyNames[itemName] == null, "CannotModifyReservedItem", itemName); - } - - // If no owner document was passed in, then it's not going to have an - // XML element backing it. - if (ownerDocument == null) - { - this.include = itemInclude; - this.isPartOfProjectManifest = false; - } - else - { - ErrorUtilities.VerifyThrowArgumentLength(itemName, "itemType"); - MustHaveItemDefinitionLibrary(itemDefinitionLibraryToUse); - - // The caller has given us an owner document, so we're going to create a - // new item element associated with that document. The new item element - // doesn't actually get added to the XML document automatically. - this.xml = new BuildItemGroupChildXml(ownerDocument, itemName, itemInclude); - this.isPartOfProjectManifest = true; - } - - if (createCustomMetadataCache) - { - // PERF NOTE: only create cache if told to do so, because creating - // this cache for a large number of items is expensive - InitializeCustomMetadataCache(); - } - - this.name = itemName; - - // The evaluated and final item specs start off initialized to the "Include" attribute. - this.evaluatedItemSpecEscaped = itemInclude; - this.finalItemSpecEscaped = itemInclude; - - this.importedFromAnotherProject = false; - this.itemDefinitionLibrary = itemDefinitionLibraryToUse; - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// This constructor creates a new virtual (non-persisted) item with the - /// specified type and include. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public BuildItem(string itemName, string itemInclude) : - this(null /* no XML */, itemName, itemInclude, null /* no item definition library */) - { - } - - /// - /// This constructor initializes a persisted item from an existing item - /// element which exists either in the main project file or one of the - /// imported files. - /// - internal BuildItem(XmlElement itemElement, bool importedFromAnotherProject, ItemDefinitionLibrary itemDefinitionLibrary) - : this(itemElement, importedFromAnotherProject, true /* part of project manifest */, itemDefinitionLibrary) - { - } - - /// - /// This constructor initializes an item from an item element. - /// It is part of the project manifest or not as specified. - /// - internal BuildItem(XmlElement itemElement, bool importedFromAnotherProject, bool isPartOfProjectManifest, ItemDefinitionLibrary itemDefinitionLibrary) - { - MustHaveItemDefinitionLibrary(itemDefinitionLibrary); - - InitializeFromItemElement(itemElement); - this.importedFromAnotherProject = importedFromAnotherProject; - this.isPartOfProjectManifest = isPartOfProjectManifest; - this.itemDefinitionLibrary = itemDefinitionLibrary; - - ProjectErrorUtilities.VerifyThrowInvalidProject(XMakeElements.IllegalItemPropertyNames[name] == null, ItemElement, "CannotModifyReservedItem", name); - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// This constructor creates a new virtual (non-persisted) item based - /// on a ITaskItem object that was emitted by a task. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public BuildItem(string itemName, ITaskItem taskItem) - { - ErrorUtilities.VerifyThrowArgumentNull(taskItem, nameof(taskItem)); - - string itemInclude = EscapingUtilities.Escape(taskItem.ItemSpec); - - BuildItemHelper - ( - null /* this is a virtual item with no backing XML */, - itemName, - itemInclude, - false, /* PERF NOTE: don't waste time creating a new custom metadata cache, - * because we're going to clone the given task item's custom metadata */ - null /* no definition library */ - ); - - IDictionary rawSourceTable = taskItem.CloneCustomMetadata(); - - // Go through and escape the metadata as necessary. - string[] keys = new string[rawSourceTable.Count]; - rawSourceTable.Keys.CopyTo(keys, 0); - foreach (string singleMetadataName in keys) - { - string singleMetadataValue = (string)rawSourceTable[singleMetadataName]; - rawSourceTable[singleMetadataName] = EscapingUtilities.Escape(singleMetadataValue); - } - - this.unevaluatedCustomMetadata = new CopyOnWriteHashtable(rawSourceTable, StringComparer.OrdinalIgnoreCase); - this.evaluatedCustomMetadata = new CopyOnWriteHashtable(rawSourceTable, StringComparer.OrdinalIgnoreCase); - this.isPartOfProjectManifest = false; - } - - #endregion - - #region Properties - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// This returns a boolean telling you whether this particular item - /// was imported from another project, or whether it was defined - /// in the main project. For virtual items which have no - /// persistence, this is false. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public bool IsImported - { - get { return importedFromAnotherProject; } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Accessor for the item's "type" string. Note that changing the "Type" - /// of an BuildItem requires the whole project to be re-evalauted. This is because - /// items are frequently stored in hash tables based on their item types, - /// so changing an item type would mess up the tables. In the current - /// implementation the caller who changes the item type is responsible - /// for calling Project.MarkAsDirty(). - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public string Name - { - get - { - ErrorUtilities.VerifyThrow(name != null, "Get Name: Item has not been initialized."); - return this.name; - } - - set - { - ErrorUtilities.VerifyThrow(name != null, "Set Name: Item has not been initialized."); - ErrorUtilities.VerifyThrowArgumentLength(value, "Name"); - XmlUtilities.VerifyThrowValidElementName(value); - MustNotBeImported(); - ErrorUtilities.VerifyThrowInvalidOperation(XMakeElements.IllegalItemPropertyNames[value] == null, "CannotModifyReservedItem", value); - - SplitChildItemIfNecessary(); - this.name = value; - - if (IsBackedByXml) - { - xml.Name = value; - - // Because we actually have a new XML element representing this item now, we - // have to update our parent items and child items. Most other modifications - // to an item don't require this, because they are simply modifying the XML - // element. But here, because the item type is the XML element name, we actually - // had to create a new XML element with the new item type. This was done by the - // RenameXmlElement method, called above. - if (this.ParentPersistedItem != null) - { - ParentPersistedItem.UpdateBackingXml(this.xml); - } - - if (this.childItems != null) - { - foreach (BuildItem childItem in this.childItems) - { - childItem.UpdateBackingXml(this.xml); - } - } - } - - MarkItemAsDirty(); - } - } - - /// - /// The backing library of default metadata values, if any. - /// Projects need to update this with their own library, - /// when an item is added to them. - /// - internal ItemDefinitionLibrary ItemDefinitionLibrary - { - get { return itemDefinitionLibrary; } - set { itemDefinitionLibrary = value; } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Accessor for the item's "include" string. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// RGoel - public string Include - { - get - { - if (IsBackedByXml) - { - return xml.Include; - } - else if (include != null) - { - return include; - } - else - { - ErrorUtilities.ThrowInternalError("Item has not been initialized."); - return null; - } - } - - set - { - ErrorUtilities.VerifyThrowArgument(value != null, "NullIncludeNotAllowed", XMakeAttributes.include); - MustNotBeImported(); - - if (IsBackedByXml) - { - // If this is an evaluated item that originated from the project file, and the original - // item is declared using a wildcard that still matches the new item spec ... - if ((ParentPersistedItem?.NewItemSpecMatchesExistingWildcard(value) == true)) - { - // Don't need to touch the project file since the original wildcard still matches - // the new item spec. But it still should be reevaluated the next time around. - MarkItemAsDirtyForReevaluation(); - } - else - { - SplitChildItemIfNecessary(); - xml.Include = value; - MarkItemAsDirty(); - } - } - else if (this.include != null) - { - this.include = value; - MarkItemAsDirty(); - } - else - { - ErrorUtilities.VerifyThrow(false, "Item has not been initialized."); - } - - // The evaluated and final item specs start off initialized to the "Include" attribute. - this.evaluatedItemSpecEscaped = value; - this.finalItemSpecEscaped = value; - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Gets the names of metadata on the item -- also includes the pre-defined/reserved item-spec modifiers. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// SumedhK, JomoF - /// Collection of name strings. - public ICollection MetadataNames - { - get - { - // Add all the custom metadata. - List list = GetAllCustomMetadataNames(); - - // Add all the built-in metadata. - list.AddRange(FileUtilities.ItemSpecModifiers.All); - - return list; - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Gets the number of metadata set on the item. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// SumedhK - /// Count of metadata. - public int MetadataCount - { - get - { - return GetCustomMetadataCount() + FileUtilities.ItemSpecModifiers.All.Length; - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Gets the names of metadata on the item -- also includes the pre-defined/reserved item-spec modifiers. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// SumedhK, JomoF - /// Collection of name strings. - public ICollection CustomMetadataNames - { - get - { - // All the custom metadata. - return GetAllCustomMetadataNames(); - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Gets the number of metadata set on the item. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// SumedhK - /// Count of metadata. - public int CustomMetadataCount - { - get - { - return GetCustomMetadataCount(); - } - } - - /// - /// Read-only accessor for accessing the XML attribute for "Include". Callers should - /// never try and modify this. Go through this.Include to change the include spec. - /// - internal XmlAttribute IncludeAttribute - { - get { return IsBackedByXml ? xml.IncludeAttribute : null; } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Accessor for the item's "exclude" string. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// RGoel - public string Exclude - { - get { return IsBackedByXml ? xml.Exclude : String.Empty; } - - set - { - // We don't support having an "Exclude" for virtual items. Only persisted items can have an "Exclude". - ErrorUtilities.VerifyThrowInvalidOperation(IsBackedByXml, "CannotSetExcludeOnVirtualItem", XMakeAttributes.exclude); - - MustNotBeImported(); - ErrorUtilities.VerifyThrowInvalidOperation(this.ParentPersistedItem == null, "CannotSetExcludeOnEvaluatedItem", XMakeAttributes.exclude); - - xml.Exclude = value; - MarkItemAsDirty(); - } - } - - /// - /// Read-only accessor for accessing the XML attribute for "Exclude". Callers should - /// never try and modify this. Go through this.Exclude to change the exclude spec. - /// - /// RGoel - internal XmlAttribute ExcludeAttribute - { - get { return IsBackedByXml ? xml.ExcludeAttribute : null; } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Accessor for the item's "condition". - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// RGoel - public string Condition - { - get { return IsBackedByXml ? xml.Condition : String.Empty; } - - set - { - // If this BuildItem object is not actually represented by an - // XML element in the project file, then do not allow - // the caller to set the condition. - ErrorUtilities.VerifyThrowInvalidOperation(IsBackedByXml, "CannotSetCondition"); - - MustNotBeImported(); - - SplitChildItemIfNecessary(); - - xml.Condition = value; - MarkItemAsDirty(); - } - } - - /// - /// Read-only accessor for accessing the XML attribute for "Condition". Callers should - /// never try and modify this. Go through this.Condition to change the condition. - /// - /// RGoel - internal XmlAttribute ConditionAttribute - { - get { return IsBackedByXml ? xml.ConditionAttribute : null; } - } - - /// - /// Gets the XmlElement representing this item. - /// - /// RGoel - /// The item XmlElement, or null if item is virtual. - internal XmlElement ItemElement - { - get { return IsBackedByXml ? xml.Element : null; } - } - - /// - /// Accessor for the final evaluated item specification. This is read-only. - /// - /// RGoel - internal string FinalItemSpecEscaped - { - get { return finalItemSpecEscaped; } - } - - /// - /// Returns the unescaped final value of the item. - /// - /// RGoel - public string FinalItemSpec - { - get { return EscapingUtilities.UnescapeAll(FinalItemSpecEscaped); } - } - - /// - /// Read-only accessor for the piece of the item's Include that resulted in - /// this item, with properties expanded. - /// - internal string EvaluatedItemSpec - { - get { return evaluatedItemSpecEscaped; } - } - - /// - /// If this item is persisted in the project file, then we need to - /// store a reference to the parent <ItemGroup>. This makes it easier - /// to remove an item from a project through the object model. - /// - /// RGoel - internal BuildItemGroup ParentPersistedItemGroup - { - get { return parentPersistedItemGroup; } - - set - { - ErrorUtilities.VerifyThrow(((value == null) && (this.parentPersistedItemGroup != null)) || ((value != null) && (this.parentPersistedItemGroup == null)), - "Either new parent cannot be assigned because we already have a parent, or old parent cannot be removed because none exists."); - - this.parentPersistedItemGroup = value; - } - } - - /// - /// When an item in a project file gets evaluated, it may evaluate to - /// several different items. For example, in the project file, - /// <Blah Include="a;b;c"/> really evaluates to 3 separate - /// items: a, b, and c. - /// For one of these 3 evaluated items, the parent item is the original - /// item tag that came from the project file. When one of these - /// "child" items is modified/deleted/etc. through the object model, we - /// need a pointer to the parent item in order to modify it accordingly. - /// - /// rgoel - internal BuildItem ParentPersistedItem - { - get { return parentPersistedItem; } - - set - { - ErrorUtilities.VerifyThrow(((value == null) && (this.parentPersistedItem != null)) || ((value != null) && (this.parentPersistedItem == null)), - "Either new parent cannot be assigned because we already have a parent, or old parent cannot be removed because none exists."); - - this.parentPersistedItem = value; - } - } - - /// - /// When an item in a project file gets evaluated, it may evaluate to - /// several different items. This is the list of child items that - /// a real item tag in the project file evaluated to. - /// - /// RGoel - internal BuildItemGroup ChildItems - { - get - { - if (this.childItems == null) - { - this.childItems = new BuildItemGroup(); - } - - return this.childItems; - } - } - - internal bool IsUninitializedItem - { - get { return this.name == null; } - } - - /// - /// Whether this item is part of the project "manifest", ie., it is defined in XML - /// outside of a target. - /// - internal bool IsPartOfProjectManifest - { - get { return isPartOfProjectManifest; } - } - - /// - /// Whether this item has backing XML - /// - internal bool IsBackedByXml - { - get { return xml != null; } - } - - /// - /// Whether the metadata lists have been backed up - /// - internal bool IsBackedUp - { - get { return unevaluatedCustomMetadataBackup != null; } - } - - #endregion - - #region Methods - - /// - /// Get the collection of custom metadata. This does not include built-in metadata. - /// - /// - /// RECOMMENDED GUIDELINES FOR METHOD IMPLEMENTATIONS: - /// 1) this method should return a clone of the metadata - /// 2) writing to this dictionary should not be reflected in the underlying item. - /// - internal IDictionary CloneCustomMetadata() - { - IDictionary result = (IDictionary)this.evaluatedCustomMetadata.Clone(); - return MergeDefaultMetadata(result); - } - - /// - /// Initializes the cache for storing custom attributes (meta-data). - /// - private void InitializeCustomMetadataCache() - { - this.unevaluatedCustomMetadata = new CopyOnWriteHashtable(StringComparer.OrdinalIgnoreCase); - this.evaluatedCustomMetadata = new CopyOnWriteHashtable(StringComparer.OrdinalIgnoreCase); - } - - /// - /// Initializes a persisted item from an existing item element which exists either in the main project file or in one of - /// the imported files. - /// - /// - private void InitializeFromItemElement(XmlElement element) - { - this.xml = new BuildItemGroupChildXml(element, ChildType.BuildItemAdd); - - this.name = xml.Name; - this.itemSpecModifiers = null; - this.recursivePortionOfFinalItemSpecDirectory = null; - - this.evaluatedItemSpecEscaped = xml.Include; - this.finalItemSpecEscaped = xml.Include; - - InitializeCustomMetadataCache(); - } - - /// - /// Allows the project to save the value of the item's Include attribute after expanding all embedded properties. - /// - /// Can be null. - internal void SetEvaluatedItemSpecEscaped(string evaluatedItemSpecValueEscaped) - { - this.evaluatedItemSpecEscaped = evaluatedItemSpecValueEscaped; - } - - /// - /// This allows the engine to set the final item spec for this item, after - /// it has been evaluated. A fair question is ... why doesn't the BuildItem - /// object itself have an internal Evaluate() method which allows it - /// to evaluate itself and set its own finalItemSpec. The answer is - /// simply that the BuildItem doesn't have nearly enough information to be - /// able to do this. An BuildItem can only be evaluated in the context of the - /// larger project. - /// - internal void SetFinalItemSpecEscaped - ( - string finalItemSpecValueEscaped - ) - { - this.finalItemSpecEscaped = finalItemSpecValueEscaped; - this.itemSpecModifiers = null; - this.recursivePortionOfFinalItemSpecDirectory = null; - } - - /// - /// This method extracts from the final item-spec the portion of its directory that matches the recursive wildcard - /// specification (if any) given in the original item-spec i.e. in the "Include" attribute. - /// - /// For the path: - /// - /// subdir1\**\debug\*.txt - /// - /// Recursive portion: - /// - /// bin\debug\ - /// - /// - /// recursively matched portion of item directory - internal string ExtractRecursivePortionOfFinalItemSpecDirectory() - { - if (recursivePortionOfFinalItemSpecDirectory == null) - { - recursivePortionOfFinalItemSpecDirectory = String.Empty; - - // The RecursiveDir may have come from a TaskCreated item. - // In this case, use that instead of deriving it. - if (this.unevaluatedCustomMetadata[FileUtilities.ItemSpecModifiers.RecursiveDir] != null) - { - recursivePortionOfFinalItemSpecDirectory = (string)this.unevaluatedCustomMetadata[FileUtilities.ItemSpecModifiers.RecursiveDir]; - } - else - { - // only do this for items whose evaluated Include value is available -- virtual items do not have an Include - // attribute, so it's usually impossible to compute the recursive path (unless the virtual item is a clone of an - // item that has backing XML) - if (evaluatedItemSpecEscaped != null) - { - // Now we are comparing values that are "canonically escaped" by us -- the "FinalItemSpecEscaped", which comes from matching against the file system - // with values that may be escaped somewhat, or not at all -- the "evaluatedItemSpecEscaped", which comes from the literal Include in the XML. - // Anything escaped in that literal Include in the XML should be treated as literal. For example "%28" in the XML should match "(" in the file system. - // To compare like with like, unescape both first. - FileMatcher.Result match = FileMatcher.FileMatch(EscapingUtilities.UnescapeAll(evaluatedItemSpecEscaped), EscapingUtilities.UnescapeAll(FinalItemSpecEscaped)); - - // even if the evaluated Include value is a legal file spec, it may not match the final item-spec for various - // reasons e.g. Include is a semi-colon separated list, or it is an unsupported //server/share pattern, etc. - if (match.isLegalFileSpec && match.isMatch) - { - recursivePortionOfFinalItemSpecDirectory = match.wildcardDirectoryPart; - } - } - } - } - - return recursivePortionOfFinalItemSpecDirectory; - } - - /// - /// Evaluates the item and returns a virtual group containing any resulting items. - /// This allows an item to be evaluated without it belonging to an item group. - /// - internal BuildItemGroup Evaluate(Expander expander, - string baseDirectory, - bool expandMetadata, - ParserOptions parserOptions, - EngineLoggingServices loggingServices, - BuildEventContext buildEventContext) - { - BuildItemGroup result = new BuildItemGroup(); - bool itemCondition = Utilities.EvaluateCondition(Condition, - ConditionAttribute, - expander, - parserOptions, - loggingServices, - buildEventContext); - if (!itemCondition) - { - return result; - } - - EvaluateAllItemMetadata(expander, parserOptions, loggingServices, buildEventContext); - BuildItemGroup items = BuildItemGroup.ExpandItemIntoItems(baseDirectory, this, expander, expandMetadata); - - for (int i = 0; i < items.Count; i++) - { - BuildItem newItem = CreateClonedParentedItem(items[i], this); - result.AddExistingItem(newItem); - } - - return result; - } - - /// - /// Create a clone of the parent item with all the information from the child item. - /// - /// - /// FUTURE: It is unclear what this Whidbey code is for -- the callers already have a child item don't they? - /// Can this be eliminated to avoid excess cloning? - /// - internal static BuildItem CreateClonedParentedItem(BuildItem childItem, BuildItem parentItem) - { - BuildItem newItem = parentItem.Clone(); - newItem.SetEvaluatedItemSpecEscaped(childItem.EvaluatedItemSpec); - newItem.SetFinalItemSpecEscaped(childItem.FinalItemSpecEscaped); - - // If this item was defined based on another item, grab that other - // item's attributes. - newItem.CloneVirtualMetadata(); - newItem.ImportVirtualMetadataFrom(childItem); - - // BUT if this item itself has attributes declared in the project file, - // then these should clearly win. - newItem.ImportVirtualMetadataFrom(parentItem); - - // Set up the parent/child relationship. The "parent" is the actual item - // tag as declared in the project file. The "child" is the item that - // it evaluated to. For example, a parent - // may evaluate to many children , b.cs, c.cs, etc. - newItem.ParentPersistedItem = parentItem; - return newItem; - } - - /// - /// Populate the lists of evaluated and unevaluated metadata with all metadata that have true conditions. - /// - /// - /// FUTURE: Currently this isn't done when the item is constructed; so for example HasMetadata will always return - /// false until EvaluatedAllItemMetadata is explicitly called. The reason for this is that Metadata are - /// not first class objects, they are merely string pairs produced by running over the child XML with a particular expander. - /// When Metadata are first class objects this method can be changed to merely evaluate them, - /// just as BuildItemGroup.Evaluate does for BuildItem, then methods like HasMetadata behave more sanely. Of course this - /// could be a breaking change. - /// - internal void EvaluateAllItemMetadata - ( - Expander expander, - ParserOptions parserOptions, - EngineLoggingServices loggingServices, - BuildEventContext buildEventContext - ) - { - ErrorUtilities.VerifyThrow(expander != null, "Null expander passed in."); - - // Cache all custom attributes on the item. For a persisted item, this will walk the item's child nodes, and - // cache the custom attributes using a "last one wins" policy. For a virtual item, this method does nothing. - - // We only evaluate metadata by reading XML - if (IsBackedByXml) - { - ErrorUtilities.VerifyThrow((this.evaluatedCustomMetadata != null) && (this.unevaluatedCustomMetadata != null), - "Item is not initialized properly."); - - // We're evaluating from scratch, so clear out any old cached attributes. - this.evaluatedCustomMetadata.Clear(); - this.unevaluatedCustomMetadata.Clear(); - - // Let the expander know about our own item type, so it can - // expand unqualified metadata expressions - SpecificItemDefinitionLibrary specificItemDefinitionLibrary = new SpecificItemDefinitionLibrary(name, itemDefinitionLibrary); - expander = new Expander(expander, specificItemDefinitionLibrary); - - List metadataElements = xml.GetChildren(); - - // look at all the item's child nodes - foreach (XmlElement metadataElement in metadataElements) - { - // confirm that the child node is not conditionally disabled - bool condition = true; - XmlAttribute conditionAttribute = ProjectXmlUtilities.GetConditionAttribute(metadataElement, true /*no other attributes allowed*/); - - if (conditionAttribute != null) - { - condition = Utilities.EvaluateCondition(conditionAttribute.Value, - conditionAttribute, expander, null, parserOptions, - loggingServices, buildEventContext); - } - - if (condition) - { - // cache its value, both the evaluated and unevaluated. - string unevaluatedMetadataValue = Utilities.GetXmlNodeInnerContents(metadataElement); - unevaluatedCustomMetadata[metadataElement.Name] = unevaluatedMetadataValue; - string evaluatedMetadataValue = expander.ExpandAllIntoStringLeaveEscaped(unevaluatedMetadataValue, metadataElement); - evaluatedCustomMetadata[metadataElement.Name] = evaluatedMetadataValue; - - // Add this metadata to the running table we're using, so that one piece of metadata can refer to another one above - expander.SetMetadataInMetadataTable(name, metadataElement.Name, evaluatedMetadataValue); - } - } - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Indicates if the given metadata is set on the item. - /// - /// BuildItem-spec modifiers are treated as metadata. - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public bool HasMetadata(string metadataName) - { - ErrorUtilities.VerifyThrowArgumentLength(metadataName, nameof(metadataName)); - ErrorUtilities.VerifyThrow(this.unevaluatedCustomMetadata != null, "Item not initialized properly. unevaluatedCustomAttributes is null."); -#if DEBUG - // The hashtable of metadata (this.unevaluatedCustomMetadata) should never contain - // values for those reserved metadata that the engine provides (Filename, RelativeDir, - // Extension, etc.). The one exception is that the hashtable is allowed to contain - // a value for "RecursiveDir" because that one is extra special ... tasks are allowed - // to set that one, because it's the only way for tasks (CreateItem) to provide that value. - // Hence the need to call FileUtilities.IsDerivableItemSpecModifider. - ErrorUtilities.VerifyThrow(!unevaluatedCustomMetadata.ContainsKey(metadataName) || !FileUtilities.IsDerivableItemSpecModifier(metadataName), - "Item-spec modifiers are reserved attributes and cannot be redefined -- this should have been caught when the item was initialized."); -#endif - - if (FileUtilities.IsItemSpecModifier(metadataName)) - { - return true; - } - - if (unevaluatedCustomMetadata.ContainsKey(metadataName)) - { - return true; - } - - if (GetDefaultMetadataValue(metadataName) != null) - { - return true; - } - - return false; - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Retrieves an arbitrary unevaluated metadata value from the item element. These are pieces of metadata that the project author has - /// placed on the item element that have no meaning to MSBuild. They are just arbitrary metadata that travel around with - /// the BuildItem wherever it goes. - /// - /// The name of the metadata to retrieve. - /// The value of the requested metadata. - /// Thrown when the requested metadata is not applicable to the item. - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public string GetMetadata(string metadataName) - { - string metadataValue; - if (FileUtilities.IsItemSpecModifier(metadataName)) - { - // BUGBUG VSWhidbey 377466. If this method is being called directly by an OM - // consumer, then he is in control of the current working directory. This - // means that if he requests the "FullPath" attribute, we will likely compute - // it incorrectly (and furthermore cache the incorrect value for later use - // during the build). What we need to do is make sure to set the current working - // directory to the directory of the project file before attempting to compute - // things like "FullPath" or "RootDir". - metadataValue = GetItemSpecModifier(metadataName); - } - else - { - ErrorUtilities.VerifyThrow(this.unevaluatedCustomMetadata != null, "Item not initialized properly. unevaluatedCustomMetadata is null."); - - metadataValue = (string)this.unevaluatedCustomMetadata[metadataName]; - } - - // If we don't have an explicit value for this metadata then try to find a default value - if (metadataValue == null) - { - metadataValue = GetDefaultMetadataValue(metadataName); - } - - return metadataValue ?? String.Empty; - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Retrieves an arbitrary metadata from the item element, expands any property and item references within it, and - /// unescapes it. - /// - /// Custom attributes on virtual items are not evaluated. - /// The name of the attribute to retrieve. - /// The evaluated value of the requested attribute. - /// Thrown when the requested attribute is not applicable to the item. - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public string GetEvaluatedMetadata(string metadataName) - { - return EscapingUtilities.UnescapeAll(this.GetEvaluatedMetadataEscaped(metadataName)); - } - - /// - /// Retrieves an arbitrary metadata from the item element, expands any property and item references within it. - /// - /// Custom attributes on virtual items are not evaluated. - /// The name of the attribute to retrieve. - /// The evaluated value of the requested attribute. - /// Thrown when the requested attribute is not applicable to the item. - internal string GetEvaluatedMetadataEscaped(string metadataName) - { - string metadataValue; - if (FileUtilities.IsItemSpecModifier(metadataName)) - { - // BUGBUG VSWhidbey 377466. If this method is being called directly by an OM - // consumer, then he is in control of the current working directory. This - // means that if he requests the "FullPath" attribute, we will likely compute - // it incorrectly (and furthermore cache the incorrect value for later use - // during the build). What we need to do is make sure to set the current working - // directory to the directory of the project file before attempting to compute - // things like "FullPath" or "RootDir". - metadataValue = GetItemSpecModifier(metadataName); - } - else - { - ErrorUtilities.VerifyThrow(this.evaluatedCustomMetadata != null, "Item not initialized properly. evaluatedCustomMetadata is null."); - - metadataValue = (string)this.evaluatedCustomMetadata[metadataName]; - } - - // If we don't have an explicit value for this metadata then try to find a default value - if (metadataValue == null) - { - metadataValue = GetDefaultMetadataValue(metadataName); - } - - return metadataValue ?? String.Empty; - } - - /// - /// Retrieves all user-defined/custom attribute names. - /// - internal List GetAllCustomMetadataNames() - { - ErrorUtilities.VerifyThrow(this.unevaluatedCustomMetadata != null, "Item not initialized properly. unevaluatedCustomMetadata is null."); - - List names = new List(GetCustomMetadataCount()); - - foreach (string name in unevaluatedCustomMetadata.Keys) - { - names.Add(name); - } - - if (itemDefinitionLibrary != null) - { - ICollection defaultedNames = itemDefinitionLibrary.GetDefaultedMetadataNames(name); - if (defaultedNames != null) - { - names.AddRange(defaultedNames); - } - } - - return names; - } - - /// - /// Indicates how many custom attributes are set on this item. - /// - /// - /// This method does NOT count the pre-defined/reserved item-spec modifiers because they are NOT "custom" attributes. - /// - internal int GetCustomMetadataCount() - { - ErrorUtilities.VerifyThrow(this.unevaluatedCustomMetadata != null, "Item not initialized properly. unevaluatedCustomMetadata is null."); - - int count = unevaluatedCustomMetadata.Count; - - if (itemDefinitionLibrary != null) - { - count += itemDefinitionLibrary.GetDefaultedMetadataCount(name); - } - - return count; - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Copies all custom attributes to given item. - /// - /// BuildItem to copy custom attributes to - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public void CopyCustomMetadataTo(BuildItem destinationItem) - { - ErrorUtilities.VerifyThrowArgumentNull(destinationItem, nameof(destinationItem)); - - if (IsBackedByXml) - { - List children = xml.GetChildren(); - - foreach (XmlElement child in children) - { - destinationItem.SetMetadata(child.Name, child.InnerXml); - } - } - else - { - ErrorUtilities.VerifyThrow(this.evaluatedCustomMetadata != null, "Item not initialized properly."); - - foreach (DictionaryEntry customAttributeEntry in this.evaluatedCustomMetadata) - { - destinationItem.SetMetadata((string)customAttributeEntry.Key, (string)customAttributeEntry.Value); - } - } - } - - /// - /// Clones the hashtables which cache the values of all the custom metadata on this item. - /// Callers should do this when they know that they have a shallow clone of another item, - /// and they want to modify the attributes on this item without touching the original item. - /// - /// RGoel - internal void CloneVirtualMetadata() - { - this.evaluatedCustomMetadata = (CopyOnWriteHashtable)this.evaluatedCustomMetadata.Clone(); - this.unevaluatedCustomMetadata = (CopyOnWriteHashtable)this.unevaluatedCustomMetadata.Clone(); - } - - /// - /// Without altering the backing XML of this item, copy custom metadata from the given item. - /// - /// - internal void ImportVirtualMetadataFrom(BuildItem itemToCopyFrom) - { - foreach (DictionaryEntry customAttributeEntry in itemToCopyFrom.evaluatedCustomMetadata) - { - this.evaluatedCustomMetadata[customAttributeEntry.Key] = customAttributeEntry.Value; - } - - foreach (DictionaryEntry customAttributeEntry in itemToCopyFrom.unevaluatedCustomMetadata) - { - this.unevaluatedCustomMetadata[customAttributeEntry.Key] = customAttributeEntry.Value; - } - - Dictionary itemDefinitionMetadata = null; - - if (!String.Equals(itemToCopyFrom.Name, this.Name, StringComparison.OrdinalIgnoreCase) && - itemDefinitionLibrary.IsEvaluated) - { - // copy item definition metadata over as "real" metadata - itemDefinitionMetadata = itemDefinitionLibrary.GetDefaultedMetadata(itemToCopyFrom.Name); - } - - if (itemDefinitionMetadata != null) - { - foreach (KeyValuePair itemDefinitionMetadatum in itemDefinitionMetadata) - { - this.evaluatedCustomMetadata[itemDefinitionMetadatum.Key] = itemDefinitionMetadatum.Value; - } - } - } - - /// - /// Retrieves all user-defined/custom metadata after expanding any property references they might contain. - /// NOTE: Merges them into any default metadata -- so if there are any default metadata, this may return considerably - /// more than just the metadata specifically on this item. - /// - /// - /// This method does NOT return the pre-defined/reserved item-spec modifiers because they are NOT "custom" metadata - /// - internal IDictionary GetAllCustomEvaluatedMetadata() - { - ErrorUtilities.VerifyThrow(this.evaluatedCustomMetadata != null, "Item not initialized properly. evaluatedCustomMetadata is null."); - - IDictionary result = MergeDefaultMetadata(evaluatedCustomMetadata); - - return result; - } - - /// - /// Retrieves all user-defined/custom metadata in unevaluated form. - /// NOTE: Merges them into any default metadata -- so if there are any default metadata, this may return considerably - /// more than just the metadata specifically on this item. - /// - private IDictionary GetAllCustomUnevaluatedMetadata() - { - ErrorUtilities.VerifyThrow(this.unevaluatedCustomMetadata != null, "Item not initialized properly. unevaluatedCustomMetadata is null."); - - IDictionary result = MergeDefaultMetadata(unevaluatedCustomMetadata); - - return result; - } - - /// - /// Returns a dictionary containing any default metadata, with the provided set of metadata - /// overlaid on those defaults. - /// - private IDictionary MergeDefaultMetadata(IDictionary customMetadata) - { - IDictionary result = customMetadata; - - if (itemDefinitionLibrary != null) - { - IDictionary defaultedMetadata = itemDefinitionLibrary.GetDefaultedMetadata(name); - - if (defaultedMetadata != null) - { - // If we have any defaulted metadata, return a dictionary containing both specific and defaulted - // metadata, with the specific metadata winning if there's a conflict. - result = new CopyOnWriteHashtable(defaultedMetadata, StringComparer.OrdinalIgnoreCase); - - foreach (DictionaryEntry metadata in customMetadata) - { - result[metadata.Key] = metadata.Value; - } - } - } - - return result; - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Sets custom metadata on this item, with the option of treating the metadata value - /// literally, meaning that special sharacters will be escaped. - /// Does not backup metadata before making changes. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public void SetMetadata(string metadataName, string metadataValue, bool treatMetadataValueAsLiteral) - { - SetMetadata(metadataName, treatMetadataValueAsLiteral ? EscapingUtilities.Escape(metadataValue) : metadataValue); - } - - private void VerifyForMetadataSet(string metadataName, string metadataValue) - { - ErrorUtilities.VerifyThrowArgument(!FileUtilities.IsDerivableItemSpecModifier(metadataName), - "Shared.CannotChangeItemSpecModifiers", metadataName); - - ErrorUtilities.VerifyThrowArgumentLength(metadataName, nameof(metadataName)); - ErrorUtilities.VerifyThrowArgumentNull(metadataValue, nameof(metadataValue)); - - // Make sure the metadata doesn't use any special characters in the name. - XmlUtilities.VerifyThrowValidElementName(metadataName); - - ErrorUtilities.VerifyThrowInvalidOperation(XMakeElements.IllegalItemPropertyNames[metadataName] == null, - "CannotModifyReservedItemMetadata", metadataName); - - ErrorUtilities.VerifyThrow((this.unevaluatedCustomMetadata != null) && (this.evaluatedCustomMetadata != null), - "Item not initialized properly."); - } - - /// - /// Updates only the metadata tables, not the backing XML. Keep a backup so that the changes - /// can be reverted. - /// - internal void SetVirtualMetadata(string metadataName, string metadataValue) - { - VerifyForMetadataSet(metadataName, metadataValue); - - if (IsPartOfProjectManifest) - { - BackupPersistedMetadata(); - } - - unevaluatedCustomMetadata[metadataName] = metadataValue; - evaluatedCustomMetadata[metadataName] = metadataValue; - } - - private void BackupPersistedMetadata() - { - if (!IsBackedUp) - { - unevaluatedCustomMetadataBackup = (CopyOnWriteHashtable)unevaluatedCustomMetadata.Clone(); - evaluatedCustomMetadataBackup = (CopyOnWriteHashtable)evaluatedCustomMetadata.Clone(); - } - } - - /// - /// If the metadata tables were backed up, revert them to the originals and - /// throw out the backups. - /// - internal void RevertToPersistedMetadata() - { - if (IsBackedUp) - { - unevaluatedCustomMetadata = unevaluatedCustomMetadataBackup; - evaluatedCustomMetadata = evaluatedCustomMetadataBackup; - unevaluatedCustomMetadataBackup = null; - evaluatedCustomMetadataBackup = null; - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Sets an arbitrary metadata on the item element. These are metadata that the project author has placed on the item - /// element that have no meaning to MSBuild. They are just arbitrary metadata that travel around with the BuildItem. - /// Does not backup metadata before making changes. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public void SetMetadata(string metadataName, string metadataValue) - { - MustNotBeImported(); - VerifyForMetadataSet(metadataName, metadataValue); - - // this will let us make sure the project item has actually changed before marking it dirty - bool dirtyItem = false; - - if (IsPartOfProjectManifest) - { - SplitChildItemIfNecessary(); - - dirtyItem = xml.SetChildValue(metadataName, metadataValue); - } - - // update the custom metadata cache - this.unevaluatedCustomMetadata[metadataName] = metadataValue; - this.evaluatedCustomMetadata[metadataName] = metadataValue; - - if (dirtyItem && IsPartOfProjectManifest) - { - // mark the item as dirty, one of the pieces of metadata (or the overall list) has changed; - // this will mark the parent project as dirty - MarkItemAsDirty(); - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// - /// Microsoft.Build.Execution - /// Removes the specified metadata on the item. - /// - /// Removal of well-known metadata is not allowed. - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public void RemoveMetadata(string metadataName) - { - ErrorUtilities.VerifyThrowArgument(!FileUtilities.IsItemSpecModifier(metadataName), "Shared.CannotChangeItemSpecModifiers", metadataName); - MustNotBeImported(); - ErrorUtilities.VerifyThrow((this.unevaluatedCustomMetadata != null) && (this.evaluatedCustomMetadata != null), "Item not initialized properly."); - - if (IsBackedByXml) - { - SplitChildItemIfNecessary(); - - xml.RemoveChildrenByName(metadataName); - } - - // update the custom attribute cache - this.unevaluatedCustomMetadata.Remove(metadataName); - this.evaluatedCustomMetadata.Remove(metadataName); - - MarkItemAsDirty(); - } - - /// - /// Returns any default value that this item knows about for the named metadata. - /// If none is known, returns null. - /// - private string GetDefaultMetadataValue(string metadataName) - { - string metadataValue = null; - - if (name != null && itemDefinitionLibrary != null) - { - metadataValue = itemDefinitionLibrary.GetDefaultMetadataValue(name, metadataName); - } - - return metadataValue; - } - - /// - /// Performs path manipulations on the (evaluated/final) item-spec as directed. - /// - /// The modifier to apply to the item-spec, such as RootDir or Filename. - /// The modified item-spec. - /// Thrown when the item-spec is not a path. - private string GetItemSpecModifier(string modifier) - { - string modifiedItemSpec = - FileUtilities.GetItemSpecModifier(Project.PerThreadProjectDirectory, FinalItemSpecEscaped, modifier, ref itemSpecModifiers); - - if (modifiedItemSpec.Length == 0) - { - if (String.Equals(modifier, FileUtilities.ItemSpecModifiers.RecursiveDir, StringComparison.OrdinalIgnoreCase)) - { - modifiedItemSpec = ExtractRecursivePortionOfFinalItemSpecDirectory(); - - ErrorUtilities.VerifyThrow(itemSpecModifiers != null, - "The FileUtilities.GetItemSpecModifier() method should have created the cache for the \"{0}\" modifier.", - FileUtilities.ItemSpecModifiers.RecursiveDir); - - itemSpecModifiers[modifier] = modifiedItemSpec; - } - } - - return modifiedItemSpec; - } - - /// - /// Determines if the new item spec that the user is trying to add to the project - /// already matches an existing wildcarded item declared in the project. We only - /// consider it a "match" in very specific circumstances... if there's anything - /// weird or not-mainline about the new item spec or the existing item, we fail - /// the match in order to "play it safe". - /// - internal bool NewItemSpecMatchesExistingWildcard(string newItemSpec) - { - Project parentProject = GetParentProject(); - ErrorUtilities.VerifyThrow(parentProject != null, "This method should only get called on persisted items."); - BuildPropertyGroup evaluatedProperties = parentProject.evaluatedProperties; - - if ( - // The original item spec should have had at least one "*" or "?" in it. - FileMatcher.HasWildcards(this.Include) && - - // The original item should not have a Condition. - (this.Condition.Length == 0) && - - // The original item should not have an Exclude. - (this.Exclude.Length == 0) && - - // The new item spec should NOT have any wildcards. - !FileMatcher.HasWildcards(newItemSpec) - ) - { - Expander propertyExpander = new Expander(evaluatedProperties); - string newItemSpecExpandedEscaped = propertyExpander.ExpandAllIntoStringLeaveEscaped(newItemSpec, null); - // New item spec should not have any unescaped semicolons ... this can really mess us up. - if (-1 == newItemSpecExpandedEscaped.IndexOf(';')) - { - // Expand any properties in the new item spec that the user gave us. - string newItemSpecExpandedUnescaped = EscapingUtilities.UnescapeAll(newItemSpecExpandedEscaped); - - // Loop over each piece separated by semicolons. - List itemIncludePieces = propertyExpander.ExpandAllIntoStringListLeaveEscaped(this.Include, this.IncludeAttribute); - foreach (string itemIncludePiece in itemIncludePieces) - { - bool containsEscapedWildcards = EscapingUtilities.ContainsEscapedWildcards(itemIncludePiece); - bool containsRealWildcards = FileMatcher.HasWildcards(itemIncludePiece); - - // If this is the piece that has the wildcards ... - if (containsRealWildcards && !containsEscapedWildcards) - { - string itemIncludePieceContainingWildcardUnescaped = EscapingUtilities.UnescapeAll(itemIncludePiece); - - FileMatcher.Result match = FileMatcher.FileMatch(itemIncludePieceContainingWildcardUnescaped, newItemSpecExpandedUnescaped); - - if (match.isLegalFileSpec && match.isMatch) - { - // The wildcard in the original item spec will match the new item that - // user is trying to add. - return true; - } - } - } - } - } - - return false; - } - - /// - /// Gets the parent project of this item, if there is one. - /// - private Project GetParentProject() - { - BuildItemGroup parentItemGroup; - - // If this is a child item, then it's really the parent persisted item (the thing that's - // actually in the project file) that has a pointer to the parent BuildItemGroup. - if (this.ParentPersistedItem != null) - { - parentItemGroup = this.ParentPersistedItem.ParentPersistedItemGroup; - ErrorUtilities.VerifyThrow(parentItemGroup != null, "Inconsistency -- is this item persisted or not?"); - } - else - { - parentItemGroup = this.ParentPersistedItemGroup; - } - - if (parentItemGroup != null) - { - ErrorUtilities.VerifyThrowNoAssert(parentItemGroup.ParentProject != null, "Persisted BuildItemGroup doesn't have parent project."); - return parentItemGroup.ParentProject; - } - else - { - return null; - } - } - - /// - /// Marks the parent project as dirty. - /// - private void MarkItemAsDirty() - { - Project parentProject = GetParentProject(); - parentProject?.MarkProjectAsDirty(); - } - - /// - /// Marks the parent project as dirty for re-evaluation only. This means that the actual contents - /// of the project file XML haven't changed. - /// - private void MarkItemAsDirtyForReevaluation() - { - Project parentProject = GetParentProject(); - parentProject?.MarkProjectAsDirtyForReevaluation(); - } - - /// - /// Verifies this is not an imported item. - /// - private void MustNotBeImported() - { - ErrorUtilities.VerifyThrowInvalidOperation(!importedFromAnotherProject, "CannotModifyImportedProjects"); - } - - /// - /// Verifies that an item definition library is supplied. - /// This is for internal error checking only. - /// - private void MustHaveItemDefinitionLibrary(ItemDefinitionLibrary library) - { - ErrorUtilities.VerifyThrow(library != null, "Item definition library required when item is owned by project"); - } - - /// - /// Sometimes an item in the project file is declared such that it actually evaluates - /// to multiple items (we call these "child" items). Examples include the use of - /// wildcards, as well as semicolon-separated lists of item specs. When one of the - /// child items is modified through the object model, in order to reflect that - /// change in the project file, we have to split up the original item tag into - /// multiple item tags. This method, when called on one of the parent items, - /// accomplishes exactly that. - /// - private void SplitItem() - { - if (!IsPartOfProjectManifest) - { - // There's no point splitting an item if it's not an item outside of a target; - // a modification to such an item is thrown away at the end of the build, so we'll - // never persist it - return; - } - - ErrorUtilities.VerifyThrow(ParentPersistedItemGroup != null, "No parent BuildItemGroup for item to be removed."); - - if (this.ChildItems.Count > 1) - { - foreach (BuildItem childItem in this.ChildItems) - { - ErrorUtilities.VerifyThrow(childItem.IsBackedByXml, "Must be backed by XML"); - - childItem.ParentPersistedItem = null; - - BuildItem newItem = ParentPersistedItemGroup.AddNewItem(childItem.Name, childItem.FinalItemSpecEscaped); - - if (childItem.Condition.Length > 0) - { - newItem.Condition = childItem.Condition; - } - - // Copy all the metadata from the original item tag. - foreach (XmlNode customMetadata in childItem.ItemElement) - { - newItem.ItemElement.AppendChild(customMetadata.Clone()); - } - - childItem.InitializeFromItemElement(newItem.ItemElement); - - childItem.ParentPersistedItem = newItem; - - newItem.ChildItems.AddItem(childItem); - } - - ParentPersistedItemGroup.RemoveItem(this); - } - } - - /// - /// Sometimes an item in the project file is declared such that it actually evaluates - /// to multiple items (we call these "child" items). Examples include the use of - /// wildcards, as well as semicolon-separated lists of item specs. When one of the - /// child items is modified through the object model, in order to reflect that - /// change in the project file, we have to split up the original item tag into - /// multiple item tags. This method, when called on one of the child items, - /// accomplishes exactly that. - /// - /// rgoel - internal void SplitChildItemIfNecessary() - { - this.ParentPersistedItem?.SplitItem(); - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// This creates a shallow clone of the BuildItem. If this is an xml-backed item, - /// then the clone references the same XML element as the original, meaning - /// that modifications to the clone will affect the original. - /// - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// rgoel - public BuildItem Clone() - { - BuildItem clonedItem; - - if (IsBackedByXml) - { - clonedItem = new BuildItem(xml.Element, this.importedFromAnotherProject, this.itemDefinitionLibrary); - clonedItem.SetEvaluatedItemSpecEscaped(this.evaluatedItemSpecEscaped); - clonedItem.SetFinalItemSpecEscaped(this.FinalItemSpecEscaped); - clonedItem.itemSpecModifiers = this.itemSpecModifiers; - clonedItem.recursivePortionOfFinalItemSpecDirectory = this.recursivePortionOfFinalItemSpecDirectory; - clonedItem.evaluatedCustomMetadata = this.evaluatedCustomMetadata; - clonedItem.unevaluatedCustomMetadata = this.unevaluatedCustomMetadata; - clonedItem.isPartOfProjectManifest = this.isPartOfProjectManifest; - clonedItem.itemDefinitionLibrary = this.itemDefinitionLibrary; - } - else - { - clonedItem = VirtualClone(); - } - - // Do not set the ParentPersistedItemGroup on the cloned item, because it isn't really - // part of the item group. - - return clonedItem; - } - - /// - /// Updates the build item xml backing store with the passed in xml backing store. - /// - internal void UpdateBackingXml(BuildItemGroupChildXml backingXml) - { - xml = backingXml; - this.name = xml.Name; - } - - internal BuildItem VirtualClone() - { - return VirtualClone(false /* do not remove references */); - } - - /// - /// Clones the item to a virtual item i.e. an item with no backing XML. - /// If removeReferences is specified, removes all references which hold on to Projects (or other heavyweight objects) - /// in order to minimize the transitive size of the clone. - /// - /// - /// This method differs from Clone() in that it always produces a virtual item, even when given an item with backing XML. - /// Decoupling an item from its XML allows modifications to the clone without affecting the original item. - /// - internal BuildItem VirtualClone(bool removeReferences) - { - ItemDefinitionLibrary definitionLibraryToClone = this.itemDefinitionLibrary; - - if (removeReferences) - { - definitionLibraryToClone = null; - } - - BuildItem virtualClone = - new BuildItem - ( - null /* this is a virtual item with no backing XML */, - name, Include, - false, /* PERF NOTE: don't waste time creating a new custom metadata - * cache, because we're going to clone the current item's cache */ - definitionLibraryToClone - ); - - virtualClone.SetEvaluatedItemSpecEscaped(evaluatedItemSpecEscaped); - virtualClone.SetFinalItemSpecEscaped(FinalItemSpecEscaped); - - // NOTE: itemSpecModifiers don't need to be deep-cloned because they are tied to the finalItemSpec -- when the - // finalItemSpec changes, they will get reset - virtualClone.itemSpecModifiers = itemSpecModifiers; - virtualClone.recursivePortionOfFinalItemSpecDirectory = recursivePortionOfFinalItemSpecDirectory; - - ErrorUtilities.VerifyThrow(unevaluatedCustomMetadata != null && evaluatedCustomMetadata != null, "Item is not initialized properly."); - - if (removeReferences) - { - // The ItemDefinition is going to be cleared to remove a link between a project instance and the Item when it is in the cache of targetOutputs. - // We need to merge the ItemDefinition metadata onto the builditemto preserve the metadata on the buildItem when the ItemDefinition - // is cleared and the item is placed in the cache. - virtualClone.unevaluatedCustomMetadata = (CopyOnWriteHashtable)GetAllCustomUnevaluatedMetadata(); - virtualClone.evaluatedCustomMetadata = (CopyOnWriteHashtable)GetAllCustomEvaluatedMetadata(); - } - else - { - // Cloning is cheap for CopyOnWriteHashtable so just always do it. - virtualClone.unevaluatedCustomMetadata = (CopyOnWriteHashtable)this.unevaluatedCustomMetadata.Clone(); - virtualClone.evaluatedCustomMetadata = (CopyOnWriteHashtable)this.evaluatedCustomMetadata.Clone(); - } - - return virtualClone; - } - - /// - /// Convert the given array of BuildItems into ITaskItems (BuildItem names are lost) - /// - /// - /// - internal static ITaskItem[] ConvertBuildItemArrayToTaskItems(BuildItem[] originalItems) - { - if (originalItems == null) - { - return null; - } - - ITaskItem[] convertedItems = new TaskItem[originalItems.Length]; - - for (int i = 0; i < originalItems.Length; i++) - { - if (originalItems[i].IsUninitializedItem) - { - convertedItems[i] = new TaskItem(originalItems[i].FinalItemSpecEscaped); - foreach (DictionaryEntry metadata in originalItems[i].GetAllCustomEvaluatedMetadata()) - { - convertedItems[i].SetMetadata((string)metadata.Key, EscapingUtilities.UnescapeAll((string)metadata.Value)); - } - } - else - { - convertedItems[i] = new TaskItem(originalItems[i]); - } - } - - return convertedItems; - } - - /// - /// Convert the given array of ITaskItems into nameless BuildItems - /// - /// - /// - internal static BuildItem[] ConvertTaskItemArrayToBuildItems(ITaskItem[] originalItems) - { - if (originalItems == null) - { - return null; - } - - BuildItem[] convertedItems = new BuildItem[originalItems.Length]; - - for (int i = 0; i < originalItems.Length; i++) - { - convertedItems[i] = new BuildItem(null, originalItems[i]); - } - - return convertedItems; - } - - #endregion - - } -} diff --git a/src/Deprecated/Engine/Items/BuildItemGroup.cs b/src/Deprecated/Engine/Items/BuildItemGroup.cs deleted file mode 100644 index b1540013640..00000000000 --- a/src/Deprecated/Engine/Items/BuildItemGroup.cs +++ /dev/null @@ -1,1172 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Xml; -using System.Collections; -using System.Collections.Generic; -using System.Diagnostics; - -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// This class represents a collection of items. It may be represented - /// physically by an <ItemGroup> element persisted in the project file, - /// or it may just be a virtual BuildItemGroup (e.g., the evaluated items). - /// - /// - /// [!WARNING] - /// > This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - [DebuggerDisplay("BuildItemGroup (Count = { Count }, Condition = { Condition })")] - public class BuildItemGroup : IItemPropertyGrouping, IEnumerable - { - #region Member Data - - // Object holding the backing Xml, if any - private BuildItemGroupXml xml; - - // Whether there is backing Xml - // Can't use (xml==null) because it is consulted during construction of the backing Xml - // Can't use (parentProject!=null) because Clone() sets it to null, but expects to create a persisted group... - private bool isPersisted = false; - - // If this is a persisted , this boolean tells us whether - // it came from the main project file, or an imported project file. - private bool importedFromAnotherProject = false; - - // These are the loose Items beneath this BuildItemGroup. This is - // valid for both persisted and virtual ItemGroups. - private List items; - - // If we are ever asked to back up our persisted items, we put the list - // in here, so we can restore them later. - private List persistedItemBackup; - - // Collection propertygroup belongs to. - private GroupingCollection parentCollection = null; - - // If this is a persisted BuildItemGroup, it has a parent Project object. - private Project parentProject = null; - - #endregion - - #region Constructors - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Default constructor, which initializes a virtual (non-persisted) BuildItemGroup. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public BuildItemGroup() - { - this.items = new List(); - } - - /// - /// This constructor initializes the BuildItemGroup from an <ItemGroup> element - /// in the project file. It might come from the main project file or an - /// imported project file. - /// - internal BuildItemGroup(XmlElement itemGroupElement, bool importedFromAnotherProject, Project parentProject) - : this() - { - this.isPersisted = true; - this.xml = new BuildItemGroupXml(itemGroupElement); - this.importedFromAnotherProject = importedFromAnotherProject; - this.parentProject = parentProject; - - List children = xml.GetChildren(); - EnsureCapacity(children.Count); - for (int i = 0; i < children.Count; i++) - { - AddExistingItem(new BuildItem(children[i], importedFromAnotherProject, parentProject.ItemDefinitionLibrary)); - } - } - - /// - /// Constructor, which creates a new <ItemGroup> element in the XML document - /// specified. - /// - internal BuildItemGroup(XmlDocument ownerDocument, bool importedFromAnotherProject, Project parentProject) - : this() - { - this.isPersisted = true; - this.xml = new BuildItemGroupXml(ownerDocument); - this.importedFromAnotherProject = importedFromAnotherProject; - this.parentProject = parentProject; - } - - #endregion - - #region Properties - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// This returns a boolean telling you whether this particular item - /// group was imported from another project, or whether it was defined - /// in the main project. For virtual item groups which have no - /// persistence, this is false. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public bool IsImported - { - get { return importedFromAnotherProject; } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Accessor for the condition on the item group. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public string Condition - { - get - { - return IsPersisted ? xml.Condition : String.Empty; - } - - set - { - MustBePersisted("CannotSetCondition"); - MustNotBeImported(); - xml.Condition = value; - MarkItemGroupAsDirty(); - } - } - - /// - /// Accessor for the XmlElement representing this item. This is internal - /// to MSBuild, and is read-only. - /// - internal XmlElement ItemGroupElement - { - get { return xml.Element; } - } - - /// - /// Accessor for the parent Project object. - /// - internal Project ParentProject - { - get { return this.parentProject; } - } - - /// - /// Setter for parent project field that makes explicit that's it's only for clearing it. - /// - internal void ClearParentProject() - { - parentProject = null; - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Number of items in this group. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public int Count - { - get { return items.Count; } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Gets the item at the specified index. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public BuildItem this[int index] - { - get { return items[index]; } - } - - /// - /// Gets the actual list of items contained - /// in this group. - /// - internal List Items - { - get { return items; } - } - - /// - /// Accessor for the ParentCollection that the BuildPropertyGroup belongs to - /// - internal GroupingCollection ParentCollection - { - get { return parentCollection; } - set { parentCollection = value; } - } - - /// - /// Accessor for the parent XML element - /// - internal XmlElement ParentElement - { - get { return xml.ParentElement; } - } - #endregion - - #region Methods - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Copies the items in this group into a new array. - /// NOTE: the copies are NOT clones i.e. only the references are copied - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public BuildItem[] ToArray() - { - return items.ToArray(); - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// This IEnumerable method returns an IEnumerator object, which allows - /// the caller to enumerate through the BuildItem objects contained in - /// this BuildItemGroup. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public IEnumerator GetEnumerator() - { - return items.GetEnumerator(); - } - - /// - /// Import a bunch of items from another BuildItemGroup. This is an O(n) operation. - /// - internal void ImportItems(BuildItemGroup itemsToImport) - { - ErrorUtilities.VerifyThrow(itemsToImport != null, "Null BuildItemGroup passed in."); - ErrorUtilities.VerifyThrow(itemsToImport != this, "Can't import into self."); - - EnsureCapacity(this.Count + itemsToImport.Count); // PERF: important to pre-size - - // Loop through all the Items in the given BuildItemGroup, and add them to - // our own BuildItemGroup. - foreach (BuildItem itemToImport in itemsToImport) - { - AddItem(itemToImport); - } - } - - /// - /// Remove a bunch of items. This is an O(n) operation. - /// - internal void RemoveItems(BuildItemGroup itemsToRemove) - { - ErrorUtilities.VerifyThrow(itemsToRemove != null, "Null BuildItemGroup passed in."); - ErrorUtilities.VerifyThrow(itemsToRemove != this, "Can't remove self."); - - foreach (BuildItem itemToRemove in itemsToRemove) - { - RemoveItem(itemToRemove); - } - } - - internal void RemoveItemsWithBackup(BuildItemGroup itemsToRemove) - { - ErrorUtilities.VerifyThrow(itemsToRemove != null, "Null BuildItemGroup passed in."); - ErrorUtilities.VerifyThrow(itemsToRemove != this, "Can't remove self."); - - foreach (BuildItem itemToRemove in itemsToRemove) - { - RemoveItemWithBackup(itemToRemove); - } - } - - /// - /// Applies each of the item modifications in order. - /// Items are replaced with a virtual clone before they are modified. - /// If an item does not exist in this group, the modification is skipped. - /// If any modifications conflict, these modifications win. - /// Returns the cloned item made, or null if it does not exist in this group. - /// - internal BuildItem ModifyItemAfterCloningUsingVirtualMetadata(BuildItem item, Dictionary metadata) - { - int index = items.IndexOf(item); - if (index > -1) - { - BuildItem clone = items[index].VirtualClone(); - items[index] = clone; - - foreach (KeyValuePair pair in metadata) - { - clone.SetVirtualMetadata(pair.Key, pair.Value); - } - - return clone; - } - - return null; - } - - /// - /// Applies each of the item modifications in order. - /// Items are NOT cloned. - /// Metadata is set as virtual metadata, so it is reset by Project.ResetBuildStatus(). - /// If an item does not exist in this group, the modification is skipped. - /// If any modifications conflict, these modifications win. - /// - internal void ModifyItemsUsingVirtualMetadata(Dictionary> modifies) - { - foreach (KeyValuePair> modify in modifies) - { - int index = items.IndexOf(modify.Key); - if (index > -1) - { - foreach (KeyValuePair pair in modify.Value) - { - items[index].SetVirtualMetadata(pair.Key, pair.Value); - } - } - } - } - - /// - /// Pre-allocates space in the item list. - /// PERF: Call this first before adding a known quantity of items to a group, to avoid - /// repeated expansions of the backing list. - /// - internal void EnsureCapacity(int capacity) - { - // Don't reduce capacity here; that's a list copy, too - if (capacity > items.Capacity) - { - items.Capacity = capacity; - } - } - - /// - /// Adds an existing BuildItem to the list of items, does not attempt to add - /// backing Xml for the item. - /// - internal void AddExistingItem(BuildItem itemToAdd) - { - AddExistingItemAt(items.Count, itemToAdd); - } - - /// - /// Adds an existing BuildItem to the list of items at the specified index. - /// Does not attempt to add backing Xml for the item. - /// - internal void AddExistingItemAt(int index, BuildItem itemToAdd) - { - ErrorUtilities.VerifyThrow(items != null, "BuildItemGroup has not been initialized."); - ErrorUtilities.VerifyThrow(index <= items.Count, "Index out of range"); - - items.Insert(index, itemToAdd); - - if (parentProject != null) - { - itemToAdd.ItemDefinitionLibrary = parentProject.ItemDefinitionLibrary; - } - - // If this BuildItemGroup is a persisted , then we need the - // items to have a reference back to their parent BuildItemGroup. This - // makes it *much* easier to delete items through the object model. - if (IsPersisted) - { - itemToAdd.ParentPersistedItemGroup = this; - } - MarkItemGroupAsDirty(); - } - - /// - /// Adds an BuildItem to this BuildItemGroup. If this is a persisted BuildItemGroup, then - /// this method also inserts the BuildItem's XML into the appropriate location - /// in the XML document. For persisted ItemGroups, the behavior is that - /// it tries to insert the new BuildItem such that it is "near" other items of the - /// same type. ("Near" is defined as just after the last existing item - /// of the same type, or at the end if none is found.) - /// - internal void AddItem(BuildItem itemToAdd) - { - MustBeInitialized(); - - // If we are a persisted , add the item element as a new child. - if (IsPersisted) - { - MustNotBeImported(); - - // Make sure the item to be added has an XML element backing it, - // and that its XML belongs to the same XML document as our BuildItemGroup. - ErrorUtilities.VerifyThrow(itemToAdd.IsBackedByXml, "Item does not have an XML element"); - ErrorUtilities.VerifyThrow(itemToAdd.ItemElement.OwnerDocument == xml.OwnerDocument, "Cannot add an Item with a different XML owner document."); - - // Generally, the desired behavior is to keep items of the same Type physically - // contiguous within the BuildItemGroup. (It's just easier to read that way.) So we - // scan through the existing items in our BuildItemGroup, and try to find the spot where - // the new item would fit in alphabetically. This is nice because it helps - // source code control scenarios where multiple clients are adding items to - // the same list. By putting them in alphabetical order, there's less of a - // chance of merge conflicts. - int insertionIndex = items.Count; - for (int i = 0; i < items.Count; i++) - { - if (String.Equals(itemToAdd.Name, items[i].Name, StringComparison.OrdinalIgnoreCase)) - { - insertionIndex = i + 1; - - if (0 > String.Compare(itemToAdd.Include, items[i].Include, StringComparison.OrdinalIgnoreCase)) - { - insertionIndex = i; - break; - } - } - } - - // If there is at least one item in this group, then insert this new item - // at the correct location based on our simple scan for similar item types. - if (items.Count > 0) - { - if (insertionIndex == items.Count) - { - XmlElement itemElementToInsertAfter = items[items.Count - 1].ItemElement; - xml.InsertAfter((XmlElement)itemElementToInsertAfter.ParentNode, itemToAdd.ItemElement, itemElementToInsertAfter); - } - else - { - XmlElement itemElementToInsertBefore = items[insertionIndex].ItemElement; - xml.InsertBefore((XmlElement)itemElementToInsertBefore.ParentNode, itemToAdd.ItemElement, itemElementToInsertBefore); - } - - AddExistingItemAt(insertionIndex, itemToAdd); - } - else - { - // This BuildItemGroup is currently empty. - // add the new BuildItem as a child of the tag. - xml.AppendChild(itemToAdd.ItemElement); - - // Add the item to the end of our list. - AddExistingItem(itemToAdd); - } - } - else - { - // Add the item to the end of our list. - AddExistingItem(itemToAdd); - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Creates a new BuildItem defined by the given "Type" and "Include", and - /// adds it to the end of this BuildItemGroup. - /// If the group is persisted, the item is persisted; otherwise it is virtual - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public BuildItem AddNewItem(string itemName, string itemInclude) - { - BuildItem newItem; - - if (IsPersisted) - { - // We are a persisted , so create a new persisted item object. - newItem = new BuildItem(xml.OwnerDocument, itemName, itemInclude, parentProject.ItemDefinitionLibrary); - } - else - { - // Create a new virtual BuildItem. - newItem = new BuildItem(itemName, itemInclude); - } - - AddItem(newItem); - return newItem; - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Adds a new item to the ItemGroup, optional treating the item Include as literal so that - /// any special characters will be escaped before persisting it. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public BuildItem AddNewItem(string itemName, string itemInclude, bool treatItemIncludeAsLiteral) - { - return AddNewItem(itemName, treatItemIncludeAsLiteral ? EscapingUtilities.Escape(itemInclude) : itemInclude); - } - - /// - /// Removes the given BuildItem from this BuildItemGroup. - /// If the item is part of the project manifest (ie, it's declared outside of a target) then - /// makes a backup of persisted items so that later the item group can be reverted to that backup, - /// reversing this change. - /// - internal void RemoveItemWithBackup(BuildItem itemToRemove) - { - MustBeInitialized(); - - if (itemToRemove.IsPartOfProjectManifest) - { - // We're about to remove an item that's part of the project manifest; - // this must be reverted when we reset the project, so make sure we've got a backup - BackupPersistedItems(); - } - - // Don't remove the XML node, or mark the itemgroup as dirty; this is - // strictly an operation on temporary items, because we'll be un-backing up the - // persisted items at the end of the build - - items.Remove(itemToRemove); - } - - /// - /// Removes the given BuildItem from this BuildItemGroup. - /// If item is not in this group, does nothing. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public void RemoveItem(BuildItem itemToRemove) - { - MustBeInitialized(); - RemoveItemElement(itemToRemove); - items.Remove(itemToRemove); - MarkItemGroupAsDirty(); - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Removes the item at the specified index. - /// - /// If index is out of bounds - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public void RemoveItemAt(int index) - { - MustBeInitialized(); - BuildItem item = items[index]; - RemoveItemElement(item); - items.RemoveAt(index); - MarkItemGroupAsDirty(); - } - - /// - /// If this is a persisted group, removes the XML element corresponding to the given item. - /// If this is not a persisted group, does nothing. - /// - private void RemoveItemElement(BuildItem item) - { - if (IsPersisted) - { - MustNotBeImported(); - MustHaveThisParentElement(item); - MustHaveThisParentGroup(item); - xml.Element.RemoveChild(item.ItemElement); - item.ParentPersistedItemGroup = null; - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Clones the BuildItemGroup. A shallow clone here is one that references - /// the same BuildItem objects as the original, whereas a deep clone actually - /// clones the BuildItem objects as well. If this is a persisted BuildItemGroup, - /// only deep clones are allowed, because you can't have the same XML - /// element belonging to two parents. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public BuildItemGroup Clone(bool deepClone) - { - BuildItemGroup clone; - - if (IsPersisted) - { - // Only deep clones are permitted when dealing with a persisted . - // This is because a shallow clone would attempt to add the same item - // elements to two different parent elements, and this is - // not allowed. - ErrorUtilities.VerifyThrowInvalidOperation(deepClone, "ShallowCloneNotAllowed"); - - // Do not set the ParentProject on the cloned BuildItemGroup, because it isn't really - // part of the project. - clone = new BuildItemGroup(xml.OwnerDocument, importedFromAnotherProject, null); - clone.Condition = Condition; - } - else - { - clone = new BuildItemGroup(); - } - - // Loop through every BuildItem in our collection, and add those same Items - // to the cloned collection. - - clone.EnsureCapacity(this.Count); // PERF: important to pre-size - - foreach (BuildItem item in this) - { - // If the caller requested a deep clone, then clone the BuildItem object, - // and add the new BuildItem to the new BuildItemGroup. Otherwise, just add - // a reference to the existing BuildItem object to the new BuildItemGroup. - clone.AddItem(deepClone ? item.Clone() : item); - } - - return clone; - } - - /// - /// Does a shallow clone, creating a new group with pointers to the same items as the old group. - /// - internal BuildItemGroup ShallowClone() - { - return Clone(false /* shallow */); - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Removes all Items from this BuildItemGroup, and also deletes the Condition - /// and Name. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public void Clear() - { - MustBeInitialized(); - - if (IsPersisted) - { - MustNotBeImported(); - - foreach (BuildItem itemToRemove in items) - { - XmlElement itemElement = itemToRemove.ItemElement; - MustHaveThisParentElement(itemToRemove); - - itemElement.ParentNode.RemoveChild(itemElement); - itemToRemove.ParentPersistedItemGroup = null; - } - - xml.Condition = null; - } - - items.Clear(); - MarkItemGroupAsDirty(); - } - - /// - /// Removes all virtual (intermediate) items from this BuildItemGroup. This - /// is used to reset the state of the build back to the initial state, - /// when we only knew about the items that were actually declared in the - /// project XML. - /// - /// RGoel - internal void RemoveAllIntermediateItems() - { - MustBeInitialized(); - MustBeVirtual("InvalidInPersistedItemGroup"); - - if (IsBackedUp) - { - // Revert removes of persisted items - items = persistedItemBackup; - persistedItemBackup = null; - } - else - { - // Delete all virtual (those without XML backing) items. - List itemsToKeep = new List(items.Count); - for (int i = 0; i < items.Count; i++) - { - if (items[i].IsPartOfProjectManifest) - { - itemsToKeep.Add(items[i]); - } - } - items = itemsToKeep; - } - - // Revert changes to persisted items' metadata - for (int i = 0; i < items.Count; i++) - { - items[i].RevertToPersistedMetadata(); - } - - MarkItemGroupAsDirty(); - } - - /// - /// Marks the parent project as dirty. - /// - private void MarkItemGroupAsDirty() - { - parentProject?.MarkProjectAsDirty(); - } - - /// - /// Create a secret backup list of our persisted items only. - /// Then, we can revert back to this later when we're done with the build, - /// and we want to remove any virtual items and revert any removes of - /// persisted items. - /// - internal void BackupPersistedItems() - { - if (!IsBackedUp) - { - persistedItemBackup = new List(); - - foreach (BuildItem item in items) - { - if (item.IsPartOfProjectManifest) - { - BuildItem itemClone = item.Clone(); - persistedItemBackup.Add(itemClone); - } - } - } - } - - /// - /// Call this method to verify that this item group is a well-formed - /// virtual item group. - /// - private void MustBeVirtual(string errorResourceName) - { - ErrorUtilities.VerifyThrowInvalidOperation(!IsPersisted, errorResourceName); - } - - /// - /// Returns whether this is a persisted group. - /// - internal bool IsPersisted - { - get { return isPersisted; } - } - - /// - /// Returns whether the persisted items have been backed up for later - /// recovery. - /// - internal bool IsBackedUp - { - get { return persistedItemBackup != null; } - } - - /// - /// Verifies this is a persisted group. - /// - private void MustBePersisted(string errorResourceName) - { - ErrorUtilities.VerifyThrowInvalidOperation(IsPersisted, errorResourceName); - } - - /// - /// Verifies this is not an imported item group. - /// - private void MustNotBeImported() - { - ErrorUtilities.VerifyThrowInvalidOperation(!importedFromAnotherProject, "CannotModifyImportedProjects"); - } - - /// - /// Verifies that the list of items has been created. - /// - private void MustBeInitialized() - { - ErrorUtilities.VerifyThrow(this.items != null, "BuildItemGroup has not been initialized."); - } - - /// - /// Verifies that the item's parent element is indeed this item group's element. - /// - private void MustHaveThisParentElement(BuildItem item) - { - ErrorUtilities.VerifyThrowInvalidOperation(item?.ItemElement?.ParentNode == xml.Element, "ItemDoesNotBelongToItemGroup"); - } - - /// - /// Verifies the parent item group is indeed this item group. - /// - /// - private void MustHaveThisParentGroup(BuildItem item) - { - ErrorUtilities.VerifyThrow(item.ParentPersistedItemGroup == this, "This item doesn't belong to this itemgroup"); - } - - /// - /// Evaluates an item group that's *outside* of a Target. - /// Metadata is not allowed on conditions, and we against the parent project. - /// - internal void Evaluate - ( - BuildPropertyGroup existingProperties, - Hashtable existingItemsByName, - bool collectItemsIgnoringCondition, - bool collectItemsRespectingCondition, - ProcessingPass pass - ) - { - ErrorUtilities.VerifyThrow(pass == ProcessingPass.Pass2, "Pass should be Pass2 for ItemGroups."); - ErrorUtilities.VerifyThrow(collectItemsIgnoringCondition || collectItemsRespectingCondition, "collectItemsIgnoringCondition and collectItemsRespectingCondition can't both be false."); - - Expander expander = new Expander(existingProperties, existingItemsByName, ExpanderOptions.ExpandAll); - - bool itemGroupCondition = Utilities.EvaluateCondition(Condition, - IsPersisted ? xml.ConditionAttribute : null, - expander, - ParserOptions.AllowPropertiesAndItemLists, - parentProject); - - if (!itemGroupCondition && !collectItemsIgnoringCondition) - { - // Neither list needs updating - return; - } - - foreach (BuildItem currentItem in this) - { - bool itemCondition = Utilities.EvaluateCondition(currentItem.Condition, - currentItem.ConditionAttribute, - expander, - ParserOptions.AllowPropertiesAndItemLists, - parentProject); - - if (!itemCondition && !collectItemsIgnoringCondition) - { - // Neither list needs updating - continue; - } - - if (collectItemsIgnoringCondition) - { - // Since we're re-evaluating the project, clear out the previous list of child items - // for each persisted item tag. - currentItem.ChildItems.Clear(); - } - - currentItem.EvaluateAllItemMetadata(expander, ParserOptions.AllowPropertiesAndItemLists, parentProject.ParentEngine.LoggingServices, parentProject.ProjectBuildEventContext); - BuildItemGroup items = BuildItemGroup.ExpandItemIntoItems(parentProject.ProjectDirectory, currentItem, expander, false /* do not expand metadata */); - - foreach (BuildItem item in items) - { - BuildItem newItem = BuildItem.CreateClonedParentedItem(item, currentItem); - - if (itemGroupCondition && itemCondition && collectItemsRespectingCondition) - { - parentProject.AddToItemListByName(newItem); - } - - if (collectItemsIgnoringCondition) - { - parentProject.AddToItemListByNameIgnoringCondition(newItem); - - // Set up the other half of the parent/child relationship. - newItem.ParentPersistedItem.ChildItems.AddItem(newItem); - } - } - } - } - - /// - /// Processes the "include" list and the "exclude" list for an item element, and returns - /// the resultant virtual group of items. Ignores any condition on the item. - /// - /// Where relative paths should be evaluated from - /// The "mother" item that's being expanded - /// Expander to evaluated items and properties - /// Whether metadata expressions should be expanded, or left as literals - internal static BuildItemGroup ExpandItemIntoItems - ( - string baseDirectory, - BuildItem originalItem, - Expander expander, - bool expandMetadata - ) - { - ErrorUtilities.VerifyThrow(originalItem != null, "Can't add a null item to project."); - ErrorUtilities.VerifyThrow(expander != null, "expander can't be null."); - - // Take the entire string specified in the "Include" attribute, and split - // it up by semi-colons. Then loop over the individual pieces. - // Expand only with properties first, so that expressions like Include="@(foo)" will transfer the metadata of the "foo" items as well, not just their item specs. - List itemIncludePieces = (new Expander(expander, ExpanderOptions.ExpandProperties).ExpandAllIntoStringListLeaveEscaped(originalItem.Include, originalItem.IncludeAttribute)); - BuildItemGroup itemsToInclude = new BuildItemGroup(); - for (int i = 0; i < itemIncludePieces.Count; i++) - { - BuildItemGroup itemizedGroup = expander.ExpandSingleItemListExpressionIntoItemsLeaveEscaped(itemIncludePieces[i], originalItem.IncludeAttribute); - if (itemizedGroup == null) - { - // The expression did not represent a single @(...) item list reference. - if (expandMetadata) - { - // We're inside a target: metadata expressions like %(foo) are legal, so expand them now - itemIncludePieces[i] = expander.ExpandMetadataLeaveEscaped(itemIncludePieces[i]); - } - // Now it's a string constant, possibly with wildcards. - // Take each individual path or file expression, and expand any - // wildcards. Then loop through each file returned. - if (itemIncludePieces[i].Length > 0) - { - string[] includeFileList = EngineFileUtilities.GetFileListEscaped(baseDirectory, itemIncludePieces[i]); - for (int j = 0; j < includeFileList.Length; j++) - { - BuildItem newItem = itemsToInclude.AddNewItem(originalItem.Name, originalItem.Include); - newItem.SetEvaluatedItemSpecEscaped(itemIncludePieces[i]); // comes from XML include --- "arbitrarily escaped" - newItem.SetFinalItemSpecEscaped(includeFileList[j]); // comes from file system matcher -- "canonically escaped" - } - } - } - else - { - itemsToInclude.ImportItems(itemizedGroup); - } - } - - List matchingItems = FindItemsMatchingSpecification(itemsToInclude, originalItem.Exclude, originalItem.ExcludeAttribute, expander, baseDirectory); - - if (matchingItems != null) - { - foreach (BuildItem item in matchingItems) - { - itemsToInclude.RemoveItem(item); - } - } - - return itemsToInclude; - } - - /// - /// Returns a list of all items in the provided item group whose itemspecs match the specification, after it is split and any wildcards are expanded. - /// If not items match, returns null. - /// - internal static List FindItemsMatchingSpecification(BuildItemGroup items, string specification, XmlAttribute attribute, Expander expander, string baseDirectory) - { - if (items.Count == 0 || specification.Length == 0) - { - return null; - } - - // This is a hashtable whose key is the filename for the individual items - // in the Exclude list, after wildcard expansion. The value in the hash table - // is just an empty string. - Hashtable specificationsToFind = new Hashtable(StringComparer.OrdinalIgnoreCase); - - // Split by semicolons - List specificationPieces = expander.ExpandAllIntoStringListLeaveEscaped(specification, attribute); - - foreach (string piece in specificationPieces) - { - // Take each individual path or file expression, and expand any - // wildcards. Then loop through each file returned, and add it - // to our hashtable. - - // Don't unescape wildcards just yet - if there were any escaped, the caller wants to treat them - // as literals. Everything else is safe to unescape at this point, since we're only matching - // against the file system. - string[] fileList = EngineFileUtilities.GetFileListEscaped(baseDirectory, piece); - - foreach (string file in fileList) - { - // Now unescape everything, because this is the end of the road for this filename. - // We're just going to compare it to the unescaped include path to filter out the - // file excludes. - specificationsToFind[EscapingUtilities.UnescapeAll(file)] = String.Empty; - } - } - - if (specificationsToFind.Count == 0) - { - return null; - } - - // Now loop through our list and filter out any that match a - // filename in the remove list. - List itemsRemoved = new List(); - - foreach (BuildItem item in items) - { - // Even if the case for the excluded files is different, they - // will still get excluded, as expected. However, if the excluded path - // references the same file in a different way, such as by relative - // path instead of absolute path, we will not realize that they refer - // to the same file, and thus we will not exclude it. - if (specificationsToFind.ContainsKey(item.FinalItemSpec)) - { - itemsRemoved.Add(item); - } - } - - return itemsRemoved; - } - - #endregion - } -} diff --git a/src/Deprecated/Engine/Items/BuildItemGroupCollection.cs b/src/Deprecated/Engine/Items/BuildItemGroupCollection.cs deleted file mode 100644 index 696f6b448ab..00000000000 --- a/src/Deprecated/Engine/Items/BuildItemGroupCollection.cs +++ /dev/null @@ -1,306 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections; - -using error = Microsoft.Build.BuildEngine.Shared.ErrorUtilities; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// This class represents a collection of persisted <ItemGroup>'s. Each - /// MSBuild project has exactly one BuildItemGroupCollection, which includes - /// all the imported ItemGroups as well as the ones in the main project file. - /// - /// The implementation of this class is that it's basically a Facade. It just - /// calls into the GroupingCollection within the Project to do it's work. It - /// doesn't maintain any BuildPropertyGroup state on its own. - /// - /// - /// [!WARNING] - /// > This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// DavidLe - public class BuildItemGroupCollection : IEnumerable, ICollection - { - #region Member Data - - private GroupingCollection groupingCollection; - #endregion - - #region Constructors - - /// - /// Private default constructor. This object can't be instantiated by - /// OM consumers. - /// - /// DavidLe, RGoel - private BuildItemGroupCollection - ( - ) - { - } - - /// - /// Constructor that takes the GroupingCollection that this sits over. - /// - /// - /// - /// DavidLe - /// - internal BuildItemGroupCollection - ( - GroupingCollection groupingCollection - ) - { - error.VerifyThrow(groupingCollection != null, "GroupingCollection is null!"); - - this.groupingCollection = groupingCollection; - } - #endregion - - #region Properties - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Read-only property which returns the number of ItemGroups contained - /// in our collection. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// DavidLe - public int Count - { - get - { - return this.groupingCollection.ItemGroupCount; - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// This ICollection property tells whether this object is thread-safe. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// DavidLe - public bool IsSynchronized - { - get - { - return this.groupingCollection.IsSynchronized; - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// This ICollection property returns the object to be used to synchronize - /// access to the class. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// DavidLe - public object SyncRoot - { - get - { - return this.groupingCollection.SyncRoot; - } - } - - /// - /// This looks through all the local item groups (those in the main - /// project file, as opposed to any imported project files). It returns - /// the last one that comes before any imported item groups. This - /// is the heuristic we use to determine where to add new item groups - /// into the project file. - /// - /// DavidLe - internal BuildItemGroup LastLocalItemGroup - { - get - { - BuildItemGroup lastLocalItemGroup = null; - - foreach (BuildItemGroup itemGroup in this.groupingCollection.ItemGroupsTopLevel) - { - if (itemGroup.IsImported) - { - // As soon as we hit an imported BuildItemGroup, we want to - // completely bail out. The goal of this function is - // to return the last itemGroup that is *before* any - // imported itemGroups. - break; - } - else - { - lastLocalItemGroup = itemGroup; - } - } - - return lastLocalItemGroup; - } - } - - #endregion - - #region Methods - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// This ICollection method copies the contents of this collection to an - /// array. - /// - /// DavidLe - /// - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public void CopyTo - ( - Array array, - int index - ) - { - this.groupingCollection.ItemCopyTo(array, index); - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// This IEnumerable method returns an IEnumerator object, which allows - /// the caller to enumerate through the BuildItemGroup objects contained in - /// this BuildItemGroupCollection. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// DavidLe - public IEnumerator GetEnumerator - ( - ) - { - return this.groupingCollection.GetItemEnumerator(); - } - - /// - /// Adds a new BuildItemGroup to our collection, at the specified insertion - /// point. This method does nothing to manipulate the project's XML content. - /// - /// DavidLe - /// - /// - internal void InsertAfter - ( - BuildItemGroup newItemGroup, - BuildItemGroup insertionPoint - ) - { - this.groupingCollection.InsertAfter(newItemGroup, insertionPoint); - } - - /// - /// Adds a new BuildItemGroup as the last element of our collection. - /// This method does nothing to manipulate the project's XML content. - /// - /// DavidLe - /// - internal void InsertAtEnd - ( - BuildItemGroup newItemGroup - ) - { - this.groupingCollection.InsertAtEnd(newItemGroup); - } - - /// - /// Removes a BuildItemGroup from our collection. This method does nothing - /// to manipulate the project's XML content. - /// - /// DavidLe - /// - internal void RemoveItemGroup - ( - BuildItemGroup itemGroup - ) - { - this.groupingCollection.RemoveItemGroup(itemGroup); - } - - #endregion - } -} diff --git a/src/Deprecated/Engine/Items/BuildItemGroupProxy.cs b/src/Deprecated/Engine/Items/BuildItemGroupProxy.cs deleted file mode 100644 index a97cd96962d..00000000000 --- a/src/Deprecated/Engine/Items/BuildItemGroupProxy.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System.Collections; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// An enumerable wrapper for a hashtable-by-name of BuildItemGroups that allows read-only - /// access to the items. - /// - /// - /// This class is designed to be passed to loggers. - /// The expense of copying items is only incurred if and when - /// a logger chooses to enumerate over it. - /// - /// danmose - internal class BuildItemGroupProxy : IEnumerable - { - // Item group that this proxies - private BuildItemGroup backingItemGroup; - - private BuildItemGroupProxy() - { - // Do nothing - } - - /// - /// Constructor - /// - /// Item group this class should proxy - public BuildItemGroupProxy(BuildItemGroup itemGroup) - { - this.backingItemGroup = itemGroup; - } - - /// - /// Returns an enumerator that provides copies of the items - /// in the backing item group. - /// - /// - public IEnumerator GetEnumerator() - { - foreach (BuildItem item in backingItemGroup) - { - yield return new DictionaryEntry(item.Name, new TaskItem(item)); - } - } - } -} diff --git a/src/Deprecated/Engine/Items/ItemDefinitionLibrary.cs b/src/Deprecated/Engine/Items/ItemDefinitionLibrary.cs deleted file mode 100644 index 345e22ce67d..00000000000 --- a/src/Deprecated/Engine/Items/ItemDefinitionLibrary.cs +++ /dev/null @@ -1,355 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections.Generic; -using System.Xml; -using Microsoft.Build.BuildEngine.Shared; -using MetadataDictionary = System.Collections.Generic.Dictionary; -using ItemDefinitionsDictionary = System.Collections.Generic.Dictionary>; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// A library of default metadata values by item type. - /// Projects each have exactly one of these. - /// BuildItems consult the appropriate library to check - /// for default metadata values when they do not have an - /// explicit value set. - /// - internal class ItemDefinitionLibrary - { - #region Fields - - private Project parentProject; - private List itemDefinitions; - private ItemDefinitionsDictionary itemDefinitionsDictionary; - private bool evaluated; - - #endregion - - #region Constructors - - /// - /// Creates a new item definition library. - /// The project is required only to give error context. - /// - internal ItemDefinitionLibrary(Project parentProject) - { - this.parentProject = parentProject; - this.itemDefinitions = new List(); - this.itemDefinitionsDictionary = new ItemDefinitionsDictionary(StringComparer.OrdinalIgnoreCase); - } - - #endregion - - #region Properties - - internal bool IsEvaluated - { - get { return evaluated; } - } - - #endregion - - #region Methods - - /// - /// Create a BuildItemDefinitionGroupXml element and add it to the end of our ordered list. - /// - /// If element does not represent a valid ItemDefinitionGroup element - internal void Add(XmlElement element) - { - BuildItemDefinitionGroupXml itemDefinitionGroupXml = new BuildItemDefinitionGroupXml(element, parentProject); - itemDefinitions.Add(itemDefinitionGroupXml); - - evaluated = false; - } - - /// - /// Go through each <BuildItemDefinition> element in order, evaluating it using the - /// supplied properties and any previously evaluated definitions, to build up a complete - /// library of item types and their default metadata values. - /// - internal void Evaluate(BuildPropertyGroup evaluatedProperties) - { - // Clear out previous data first - itemDefinitionsDictionary.Clear(); - - foreach (BuildItemDefinitionGroupXml itemDefinitionGroupXml in itemDefinitions) - { - itemDefinitionGroupXml.Evaluate(evaluatedProperties, itemDefinitionsDictionary); - } - - evaluated = true; - } - - /// - /// Returns any default metadata value for the specified item type and metadata name. - /// If no default exists, returns null. - /// - internal string GetDefaultMetadataValue(string itemType, string metadataName) - { - MustBeEvaluated(); - - string value = null; - - MetadataDictionary metadataDictionary; - if (itemDefinitionsDictionary.TryGetValue(itemType, out metadataDictionary)) - { - metadataDictionary.TryGetValue(metadataName, out value); - } - - return value; - } - - /// - /// Count of default metadata for the specified item type - /// - internal int GetDefaultedMetadataCount(string itemType) - { - MustBeEvaluated(); - - MetadataDictionary metadataDictionary; - if (itemDefinitionsDictionary.TryGetValue(itemType, out metadataDictionary)) - { - return metadataDictionary.Count; - } - - return 0; - } - - /// - /// Names of metadata that have defaults for the specified item type. - /// Null if there are none. - /// - internal ICollection GetDefaultedMetadataNames(string itemType) - { - MustBeEvaluated(); - - MetadataDictionary metadataDictionary = GetDefaultedMetadata(itemType); - if (metadataDictionary != null) - { - return metadataDictionary.Keys; - } - - return null; - } - - /// - /// All default metadata names and values for the specified item type. - /// Null if there are none. - /// - internal MetadataDictionary GetDefaultedMetadata(string itemType) - { - MustBeEvaluated(); - - MetadataDictionary metadataDictionary; - if (itemDefinitionsDictionary.TryGetValue(itemType, out metadataDictionary)) - { - return metadataDictionary; - } - - return null; - } - - /// - /// Verify this library has already been evaluated - /// - private void MustBeEvaluated() - { - ErrorUtilities.VerifyThrowNoAssert(evaluated, "Must be evaluated to query"); - } - - #endregion - - /// - /// Encapsulates an <ItemDefinitionGroup> tag. - /// - /// - /// Only used by ItemDefinitionLibrary -- private and nested inside it as no other class should know about this. - /// Since at present this has no OM or editing support, and is not passed around, - /// there are currently no separate classes for the child tags, and no separate BuildItemDefinitionGroup class. - /// They can be broken out in future if necessary. - /// - private class BuildItemDefinitionGroupXml - { - #region Fields - - private XmlElement element; - private Project parentProject; - private XmlAttribute conditionAttribute; - private string condition; - - #endregion - - #region Constructors - - /// - /// Read in and validate an <ItemDefinitionGroup> element and all its children. - /// This is currently only called from ItemDefinitionLibrary. Projects don't know about it. - /// - internal BuildItemDefinitionGroupXml(XmlElement element, Project parentProject) - { - ProjectXmlUtilities.VerifyThrowElementName(element, XMakeElements.itemDefinitionGroup); - ProjectXmlUtilities.VerifyThrowProjectValidNamespace(element); - - this.element = element; - this.parentProject = parentProject; - this.conditionAttribute = ProjectXmlUtilities.GetConditionAttribute(element, /* sole attribute */ true); - this.condition = ProjectXmlUtilities.GetAttributeValue(conditionAttribute); - - // Currently, don't bother validating the children until evaluation time - } - - #endregion - - #region Public Methods - - /// - /// Given the properties and dictionary of previously encountered item definitions, evaluates - /// this group of item definitions and adds to the dictionary as necessary. - /// - /// If the item definitions are incorrectly defined - internal void Evaluate(BuildPropertyGroup properties, ItemDefinitionsDictionary itemDefinitionsDictionary) - { - Expander expander = new Expander(properties); - - if (!Utilities.EvaluateCondition(condition, conditionAttribute, expander, ParserOptions.AllowProperties, parentProject)) - { - return; - } - - List childElements = ProjectXmlUtilities.GetValidChildElements(element); - - foreach (XmlElement child in childElements) - { - EvaluateItemDefinitionElement(child, properties, itemDefinitionsDictionary); - } - } - - /// - /// Given the properties and dictionary of previously encountered item definitions, evaluates - /// this specific item definition element and adds to the dictionary as necessary. - /// - /// If the item definition is incorrectly defined - private void EvaluateItemDefinitionElement(XmlElement itemDefinitionElement, BuildPropertyGroup properties, ItemDefinitionsDictionary itemDefinitionsDictionary) - { - ProjectXmlUtilities.VerifyThrowProjectValidNameAndNamespace(itemDefinitionElement); - - XmlAttribute conditionAttribute = ProjectXmlUtilities.GetConditionAttribute(itemDefinitionElement, /* sole attribute */ true); - string condition = ProjectXmlUtilities.GetAttributeValue(conditionAttribute); - string itemType = itemDefinitionElement.Name; - - MetadataDictionary metadataDictionary; - itemDefinitionsDictionary.TryGetValue(itemType, out metadataDictionary); - - Expander expander = new Expander(properties, itemType, metadataDictionary); - - if (!Utilities.EvaluateCondition(condition, conditionAttribute, expander, ParserOptions.AllowPropertiesAndItemMetadata, parentProject)) - { - return; - } - - List childElements = ProjectXmlUtilities.GetValidChildElements(itemDefinitionElement); - - foreach (XmlElement child in childElements) - { - EvaluateItemDefinitionChildElement(child, properties, itemDefinitionsDictionary); - } - } - - /// - /// Given the properties and dictionary of previously encountered item definitions, evaluates - /// this specific item definition child element and adds to the dictionary as necessary. - /// - /// If the item definition is incorrectly defined - private void EvaluateItemDefinitionChildElement(XmlElement itemDefinitionChildElement, BuildPropertyGroup properties, ItemDefinitionsDictionary itemDefinitionsDictionary) - { - ProjectXmlUtilities.VerifyThrowProjectValidNameAndNamespace(itemDefinitionChildElement); - ProjectErrorUtilities.VerifyThrowInvalidProject(!FileUtilities.IsItemSpecModifier(itemDefinitionChildElement.Name), itemDefinitionChildElement, "ItemSpecModifierCannotBeCustomMetadata", itemDefinitionChildElement.Name); - ProjectErrorUtilities.VerifyThrowInvalidProject(XMakeElements.IllegalItemPropertyNames[itemDefinitionChildElement.Name] == null, itemDefinitionChildElement, "CannotModifyReservedItemMetadata", itemDefinitionChildElement.Name); - - XmlAttribute conditionAttribute = ProjectXmlUtilities.GetConditionAttribute(itemDefinitionChildElement, /* sole attribute */ true); - string condition = ProjectXmlUtilities.GetAttributeValue(conditionAttribute); - string itemType = itemDefinitionChildElement.ParentNode.Name; - - MetadataDictionary metadataDictionary; - itemDefinitionsDictionary.TryGetValue(itemType, out metadataDictionary); - - Expander expander = new Expander(properties, itemType, metadataDictionary); - - if (!Utilities.EvaluateCondition(condition, conditionAttribute, expander, ParserOptions.AllowPropertiesAndItemMetadata, parentProject)) - { - return; - } - - string unevaluatedMetadataValue = Utilities.GetXmlNodeInnerContents(itemDefinitionChildElement); - - bool containsItemVector = ItemExpander.ExpressionContainsItemVector(unevaluatedMetadataValue); - - // We don't allow expressions like @(foo) in the value, as no items exist at this point. - ProjectErrorUtilities.VerifyThrowInvalidProject(!containsItemVector, itemDefinitionChildElement, "MetadataDefinitionCannotContainItemVectorExpression", unevaluatedMetadataValue, itemDefinitionChildElement.Name); - - string evaluatedMetadataValue = expander.ExpandAllIntoStringLeaveEscaped(unevaluatedMetadataValue, itemDefinitionChildElement); - - if (metadataDictionary == null) - { - metadataDictionary = new MetadataDictionary(StringComparer.OrdinalIgnoreCase); - itemDefinitionsDictionary.Add(itemType, metadataDictionary); - } - - // We only store the evaluated value; build items store the unevaluated value as well, but apparently only to - // gather recursive portions (its re-evaluation always goes back to the XML). - // Overwrite any existing default value for this particular metadata - metadataDictionary[itemDefinitionChildElement.Name] = evaluatedMetadataValue; - } - - #endregion - } - } - - #region Related Types - - /// - /// A limited read-only wrapper around an item definition library, - /// specific to a particular item type. - /// - internal class SpecificItemDefinitionLibrary - { - private string itemType; - private ItemDefinitionLibrary itemDefinitionLibrary; - - /// - /// Constructor - /// - internal SpecificItemDefinitionLibrary(string itemType, ItemDefinitionLibrary itemDefinitionLibrary) - { - this.itemType = itemType; - this.itemDefinitionLibrary = itemDefinitionLibrary; - } - - /// - /// Returns the item type for which this library is specific. - /// - internal string ItemType - { - get { return itemType; } - } - - /// - /// Get the default if any for the specified metadata name. - /// Returns null if there is none. - /// - internal string GetDefaultMetadataValue(string metadataName) - { - return itemDefinitionLibrary.GetDefaultMetadataValue(itemType, metadataName); - } - } - - #endregion -} diff --git a/src/Deprecated/Engine/Items/ItemExpander.cs b/src/Deprecated/Engine/Items/ItemExpander.cs deleted file mode 100644 index 0a07bfe84cd..00000000000 --- a/src/Deprecated/Engine/Items/ItemExpander.cs +++ /dev/null @@ -1,411 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Xml; -using System.Text.RegularExpressions; -using System.Text; - -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class is used by the regular expression search/replace function to replace item references of the form - /// @(itemtype->transform, separator) with the correct string. - /// - /// RGoel, SumedhK - internal class ItemExpander - { - #region Regular expressions for item vectors - - /************************************************************************************************************************** - * WARNING: The regular expressions below MUST be kept in sync with the expressions in the ProjectWriter class -- if the - * description of an item vector changes, the expressions must be updated in both places. - *************************************************************************************************************************/ - - // the leading characters that indicate the start of an item vector - internal const string itemVectorPrefix = "@("; - - // complete description of an item vector, including the optional transform expression and separator specification - private const string itemVectorSpecification = - @"@\(\s* - (?" + ProjectWriter.itemTypeOrMetadataNameSpecification + @") - (?\s*->\s*'(?[^']*)')? - (?\s*,\s*'(?[^']*)')? - \s*\)"; - - // description of an item vector, including the optional transform expression, but not the separator specification - private const string itemVectorWithoutSeparatorSpecification = - @"@\(\s* - (?" + ProjectWriter.itemTypeOrMetadataNameSpecification + @") - (?\s*->\s*'(?[^']*)')? - \s*\)"; - - // regular expression used to match item vectors, including those embedded in strings - internal static readonly Regex itemVectorPattern = new Regex(itemVectorSpecification, RegexOptions.IgnorePatternWhitespace | RegexOptions.ExplicitCapture); - - // regular expression used to match a list of item vectors that have no separator specification -- the item vectors - // themselves may be optionally separated by semi-colons, or they might be all jammed together - internal static readonly Regex listOfItemVectorsWithoutSeparatorsPattern = - new Regex(@"^\s*(;\s*)*(" + - itemVectorWithoutSeparatorSpecification + - @"\s*(;\s*)*)+$", - RegexOptions.IgnorePatternWhitespace | RegexOptions.ExplicitCapture); - - // the leading characters that indicate the start of an item metadata reference - internal const string itemMetadataPrefix = "%("; - - // complete description of an item metadata reference, including the optional qualifying item type - private const string itemMetadataSpecification = - @"%\(\s* - (?(?" + ProjectWriter.itemTypeOrMetadataNameSpecification + @")\s*\.\s*)? - (?" + ProjectWriter.itemTypeOrMetadataNameSpecification + @") - \s*\)"; - - // regular expression used to match item metadata references embedded in strings - internal static readonly Regex itemMetadataPattern = new Regex(itemMetadataSpecification, RegexOptions.IgnorePatternWhitespace | RegexOptions.ExplicitCapture); - - // description of an item vector with a transform, split into two halves along the transform expression - private const string itemVectorWithTransformLHS = @"@\(\s*" + ProjectWriter.itemTypeOrMetadataNameSpecification + @"\s*->\s*'[^']*"; - private const string itemVectorWithTransformRHS = @"[^']*'(\s*,\s*'[^']*')?\s*\)"; - - // PERF WARNING: this Regex is complex and tends to run slowly - // regular expression used to match item metadata references outside of item vector transforms - internal static readonly Regex nonTransformItemMetadataPattern = - new Regex(@"((?<=" + itemVectorWithTransformLHS + @")" + itemMetadataSpecification + @"(?!" + itemVectorWithTransformRHS + @")) | - ((? - /// Constructor, which captures the hashtable of items to use when expanding the item reference. - /// - private ItemExpander - ( - XmlNode parentNode, - ReadOnlyLookup readOnlyLookup - ) - { - this.parentNode = parentNode; - this.readOnlyLookup = readOnlyLookup; - } - - #endregion - - #region Methods - - /// - /// Expands all item vectors embedded in the given string. - /// - /// SumedhK - /// - /// - /// - /// Given string, with embedded item vectors expanded. - internal static string ExpandEmbeddedItemVectors(string s, XmlNode parentNode, ReadOnlyLookup readOnlyLookup) - { - // Before we do the expensive RegEx stuff, at least make sure there's - // an @ sign in the expression somewhere. If not, skip all the hard work. - if (s.IndexOf('@') != -1) - { - ItemExpander itemExpander = new ItemExpander(parentNode, readOnlyLookup); - - return itemVectorPattern.Replace(s, new MatchEvaluator(itemExpander.ExpandItemVector)); - } - else - { - return s; - } - } - - /// - /// Attempts to extract the items in the given item vector. Item vectors embedded in strings, and item vectors with - /// separator specifications are considered invalid, because it is not clear if those item vectors are meant to be lists - /// or strings -- if the latter, the ExpandEmbeddedItemVectors() method should be used instead. - /// - /// SumedhK;RGoel - /// - /// - /// - /// a virtual BuildItemGroup containing the items resulting from the expression, or null if the expression was invalid. - internal static BuildItemGroup ItemizeItemVector - ( - string itemVectorExpression, - XmlNode parentNode, - ReadOnlyLookup readOnlyLookup - ) - { - Match throwAwayMatch; - return ItemExpander.ItemizeItemVector(itemVectorExpression, parentNode, readOnlyLookup, out throwAwayMatch); - } - - /// - /// Attempts to extract the items in the given item vector expression. Item vectors embedded in strings, - /// and item vectors with separator specifications are considered invalid, because it is not clear - /// if those item vectors are meant to be lists or strings -- if the latter, the ExpandEmbeddedItemVectors() - /// method should be used instead. - /// - /// - /// - /// - /// - /// a virtual BuildItemGroup containing the items resulting from the expression, or null if the expression was invalid. - /// SumedhK;RGoel - internal static BuildItemGroup ItemizeItemVector - ( - string itemVectorExpression, - XmlNode parentNode, - ReadOnlyLookup readOnlyLookup, - out Match itemVectorMatch - ) - { - BuildItemGroup items = null; - - itemVectorMatch = GetItemVectorMatches(itemVectorExpression); - - if (itemVectorMatch?.Success == true) - { - // The method above reports a match if there are any - // valid @(itemlist) references in the given expression. - // If the passed-in expression contains exactly one item list reference, - // with nothing else concatenated to the beginning or end, then proceed - // with itemizing it, otherwise error. - ProjectErrorUtilities.VerifyThrowInvalidProject(itemVectorMatch.Value == itemVectorExpression, - parentNode, "EmbeddedItemVectorCannotBeItemized", itemVectorExpression); - - ItemExpander itemExpander = new ItemExpander(parentNode, readOnlyLookup); - - // If the reference contains a separator, we need to flatten the list into a scalar and then create - // an item group with a single item. This is necessary for VSWhidbey 525917 - basically we need this - // to be able to convert item lists with user specified separators into properties. - if (itemVectorMatch.Groups["SEPARATOR_SPECIFICATION"].Length > 0) - { - string expandedItemVector = itemExpander.ExpandItemVector(itemVectorMatch); - - string itemType = itemVectorMatch.Groups["TYPE"].Value; - items = new BuildItemGroup(); - - if (expandedItemVector.Length > 0) - { - items.AddNewItem(itemType, expandedItemVector); - } - } - else - { - items = itemExpander.ItemizeItemVector(itemVectorMatch); - } - - ErrorUtilities.VerifyThrow(items != null, "ItemizeItemVector shouldn't give us null."); - } - - return items; - } - - /// - /// Returns true if the expression contains an item vector pattern, else returns false. - /// - internal static bool ExpressionContainsItemVector(string expression) - { - Match itemVectorMatch = GetItemVectorMatches(expression); - - if (itemVectorMatch?.Success == true) - { - return true; - } - - return false; - } - - /// - /// Returns matches to an item expression pattern in the expression. - /// - private static Match GetItemVectorMatches(string expression) - { - Match itemVectorMatch = null; - - // Before we do the expensive RegEx stuff, at least make sure there's - // an @ sign in the expression somewhere. If not, skip all the hard work. - if (expression.IndexOf('@') != -1) - { - itemVectorMatch = itemVectorPattern.Match(expression); - } - - return itemVectorMatch; - } - - /// - /// Extracts the items in the given item vector. - /// - /// SumedhK - /// - /// The contents of the item vector (with transforms applied). - private BuildItemGroup ItemizeItemVector(Match itemVector) - { - ErrorUtilities.VerifyThrow(itemVector.Success, "Need a valid item vector."); - - string itemType = itemVector.Groups["TYPE"].Value; - string transform = (itemVector.Groups["TRANSFORM_SPECIFICATION"].Length > 0) - ? itemVector.Groups["TRANSFORM"].Value - : null; - - BuildItemGroup items = null; - if (readOnlyLookup != null) - { - items = readOnlyLookup.GetItems(itemType); - } - - if (items == null) - { - items = new BuildItemGroup(); - } - else - { - items = items.Clone(transform != null /* deep clone on transforms because we're actually creating new items */); - } - - if (transform != null) - { - foreach (BuildItem item in items) - { - itemUnderTransformation = item; - item.SetFinalItemSpecEscaped(itemMetadataPattern.Replace(transform, new MatchEvaluator(ExpandItemMetadata))); - } - } - - return items; - } - - /// - /// Expands a single item vector. - /// - /// Item vectors are composed of a name, a transform, and a separator i.e. - /// - /// @(<name>->'<transform>','<separator>') - /// - /// If a separator is not specified it defaults to a semi-colon. The transform expression is also optional, but if - /// specified, it allows each item in the vector to have its item-spec converted to a different form. The transform - /// expression can reference any custom metadata defined on the item, as well as the pre-defined item-spec modifiers. - /// - /// NOTE: - /// 1) white space between <name>, <transform> and <separator> is ignored - /// i.e. @(<name>, '<separator>') is valid - /// 2) the separator is not restricted to be a single character, it can be a string - /// 3) the separator can be an empty string i.e. @(<name>,'') - /// 4) specifying an empty transform is NOT the same as specifying no transform -- the former will reduce all item-specs - /// to empty strings - /// - /// This is the MatchEvaluator delegate passed to Regex.Replace(). - /// - /// if @(files) is a vector for the files a.txt and b.txt, then: - /// - /// "my list: @(files)" expands to "my list: a.txt;b.txt" - /// - /// "my list: @(files,' ')" expands to "my list: a.txt b.txt" - /// - /// "my list: @(files, '')" expands to "my list: a.txtb.txt" - /// - /// "my list: @(files, '; ')" expands to "my list: a.txt; b.txt" - /// - /// "my list: @(files->'%(Filename)')" expands to "my list: a;b" - /// - /// "my list: @(files -> 'temp\%(Filename).xml', ' ') expands to "my list: temp\a.xml temp\b.xml" - /// - /// "my list: @(files->'') expands to "my list: ;" - /// - /// SumedhK - /// - /// (out) true if the referenced item does not exist - /// expanded item vector - private string ExpandItemVector(Match itemVector) - { - ErrorUtilities.VerifyThrow(itemVector.Success, "Need a valid item vector."); - - string separator = (itemVector.Groups["SEPARATOR_SPECIFICATION"].Length != 0) - ? itemVector.Groups["SEPARATOR"].Value - : ";"; - - BuildItemGroup items = ItemizeItemVector(itemVector); - - if (items.Count > 0) - { - StringBuilder expandedItemVector = new StringBuilder(); - - for (int i = 0; i < items.Count; i++) - { - expandedItemVector.Append(items[i].FinalItemSpecEscaped); - - if (i < (items.Count - 1)) - { - expandedItemVector.Append(separator); - } - } - - return expandedItemVector.ToString(); - } - else - { - return String.Empty; - } - } - - /// - /// Retrieves the value of the given metadata for the item currently being transformed. - /// - /// This method is a MatchEvaluator delegate passed to Regex.Replace(). - /// SumedhK - /// - /// item metadata value - private string ExpandItemMetadata(Match itemMetadataMatch) - { - ErrorUtilities.VerifyThrow(itemUnderTransformation != null, "Need item to get metadata value from."); - - string itemMetadataName = itemMetadataMatch.Groups["NAME"].Value; - - ProjectErrorUtilities.VerifyThrowInvalidProject(itemMetadataMatch.Groups["ITEM_SPECIFICATION"].Length == 0, - parentNode, "QualifiedMetadataInTransformNotAllowed", itemMetadataMatch.Value, itemMetadataName); - - string itemMetadataValue = null; - - try - { - itemMetadataValue = itemUnderTransformation.GetEvaluatedMetadataEscaped(itemMetadataName); - } - catch (InvalidOperationException e) - { - ProjectErrorUtilities.VerifyThrowInvalidProject(false, parentNode, - "CannotEvaluateItemMetadata", itemMetadataName, e.Message); - } - - return itemMetadataValue; - } - - #endregion - } -} diff --git a/src/Deprecated/Engine/Items/TaskItem.cs b/src/Deprecated/Engine/Items/TaskItem.cs deleted file mode 100644 index 4284f44b84f..00000000000 --- a/src/Deprecated/Engine/Items/TaskItem.cs +++ /dev/null @@ -1,279 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections; -using System.Security; - -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class wraps a project item, and provides a "view" on the item's BuildItem class that is suitable to expose to tasks. - /// - /// SumedhK - internal sealed class TaskItem : MarshalByRefObject, ITaskItem - { - /// - /// Private default constructor disallows parameterless instantiation. - /// - /// SumedhK - private TaskItem() - { - // do nothing - } - - /// - /// Creates an instance of this class given the item-spec. - /// - /// SumedhK - /// - internal TaskItem(string itemSpec) - { - ErrorUtilities.VerifyThrow(itemSpec != null, "Need to specify item-spec."); - - item = new BuildItem(null, itemSpec); - } - - /// - /// Creates an instance of this class given the backing item. - /// - /// SumedhK - /// - internal TaskItem(BuildItem item) - { - ErrorUtilities.VerifyThrow(item != null, "Need to specify backing item."); - - this.item = item.VirtualClone(); - } - - /// - /// Gets or sets the item-spec for the item. - /// - /// SumedhK - /// Item-spec string. - public string ItemSpec - { - get - { - return item.FinalItemSpec; - } - - set - { - ErrorUtilities.VerifyThrowArgumentNull(value, "ItemSpec"); - item.SetFinalItemSpecEscaped(EscapingUtilities.Escape(value)); - } - } - - /// - /// Gets the names of metadata on the item -- also includes the pre-defined/reserved item-spec modifiers. - /// - /// SumedhK, JomoF - /// Collection of name strings. - public ICollection MetadataNames - { - get - { - // Add all the custom metadata. - return item.MetadataNames; - } - } - - /// - /// Gets the number of metadata set on the item. - /// - /// SumedhK - /// Count of metadata. - public int MetadataCount - { - get - { - return item.MetadataCount; - } - } - - /// - /// Gets the names of custom metadata on the item - /// - /// Collection of name strings. - public ICollection CustomMetadataNames - { - get - { - // All the custom metadata. - return item.CustomMetadataNames; - } - } - - /// - /// Gets the number of custom metadata set on the item. - /// - /// Count of metadata. - public int CustomMetadataCount - { - get - { - return item.CustomMetadataCount; - } - } - - /// - /// Looks up the value of the given custom metadata. - /// - /// SumedhK - /// - /// value of metadata - public string GetMetadata(string metadataName) - { - ErrorUtilities.VerifyThrowArgumentNull(metadataName, nameof(metadataName)); - - // Return the unescaped data to the task. - return item.GetEvaluatedMetadata(metadataName); - } - - /// - /// Sets the value of the specified custom metadata. - /// - /// SumedhK - /// - /// - public void SetMetadata(string metadataName, string metadataValue) - { - ErrorUtilities.VerifyThrowArgumentLength(metadataName, nameof(metadataName)); - ErrorUtilities.VerifyThrowArgumentNull(metadataValue, nameof(metadataValue)); - - item.SetMetadata(metadataName, EscapingUtilities.Escape(metadataValue)); - } - - /// - /// Removes the specified custom metadata. - /// - /// SumedhK - /// - public void RemoveMetadata(string metadataName) - { - ErrorUtilities.VerifyThrowArgumentNull(metadataName, nameof(metadataName)); - - item.RemoveMetadata(metadataName); - } - - /// - /// Copy the metadata (but not the ItemSpec or other built-in metadata) to destinationItem. If a particular metadata - /// already exists on the destination item, then it is not overwritten -- the original value wins. - /// - /// JomoF - /// - public void CopyMetadataTo - ( - ITaskItem destinationItem - ) - { - ErrorUtilities.VerifyThrowArgumentNull(destinationItem, nameof(destinationItem)); - - // Intentionally not _computed_ properties. These are slow and don't really - // apply anyway. - foreach (DictionaryEntry entry in item.GetAllCustomEvaluatedMetadata()) - { - string key = (string)entry.Key; - - string destinationValue = destinationItem.GetMetadata(key); - - if (string.IsNullOrEmpty(destinationValue)) - { - destinationItem.SetMetadata(key, EscapingUtilities.UnescapeAll((string)entry.Value)); - } - } - - // also copy the original item-spec under a "magic" metadata -- this is useful for tasks that forward metadata - // between items, and need to know the source item where the metadata came from - string originalItemSpec = destinationItem.GetMetadata("OriginalItemSpec"); - - if (string.IsNullOrEmpty(originalItemSpec)) - { - destinationItem.SetMetadata("OriginalItemSpec", ItemSpec); - } - } - - /// - /// Get the collection of metadata. This does not include built-in metadata. - /// - /// - /// RECOMMENDED GUIDELINES FOR METHOD IMPLEMENTATIONS: - /// 1) this method should return a clone of the metadata - /// 2) writing to this dictionary should not be reflected in the underlying item. - /// - /// JomoF - public IDictionary CloneCustomMetadata() - { - IDictionary backingItemMetadata = item.CloneCustomMetadata(); - - // Go through and escape the metadata as necessary. - string[] keys = new string[backingItemMetadata.Count]; - backingItemMetadata.Keys.CopyTo(keys, 0); - foreach (string singleMetadataName in keys) - { - string singleMetadataValue = (string)backingItemMetadata[singleMetadataName]; - - bool unescapingWasNecessary; - string singleMetadataValueUnescaped = EscapingUtilities.UnescapeAll(singleMetadataValue, out unescapingWasNecessary); - - // It's very important for perf not to touch this IDictionary unless we really need to. Touching - // it in any way causes it to get cloned (in the implementation of CopyOnWriteHashtable). - if (unescapingWasNecessary) - { - backingItemMetadata[singleMetadataName] = singleMetadataValueUnescaped; - } - } - - return backingItemMetadata; - } - - /// - /// Produce a string representation. - /// - /// JomoF - public override string ToString() - { - return ItemSpec; - } - - /// - /// Overriden to give this class infinite lease time. Otherwise we end up with a limited - /// lease (5 minutes I think) and instances can expire if they take long time processing. - /// - [SecurityCritical] - public override object InitializeLifetimeService() - { - // null means infinite lease time - return null; - } - - // the backing item - internal BuildItem item; - - #region Operators - - /// - /// This allows an explicit typecast from a "TaskItem" to a "string", returning the ItemSpec for this item. - /// - /// RGoel - /// The item to operate on. - /// The item-spec of the item. - public static explicit operator string - ( - TaskItem taskItemToCast - ) - { - return taskItemToCast.ItemSpec; - } - - #endregion - } -} diff --git a/src/Deprecated/Engine/ItemsAndProperties/ExpressionShredder.cs b/src/Deprecated/Engine/ItemsAndProperties/ExpressionShredder.cs deleted file mode 100644 index 6122f522356..00000000000 --- a/src/Deprecated/Engine/ItemsAndProperties/ExpressionShredder.cs +++ /dev/null @@ -1,465 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections; -using Microsoft.Build.BuildEngine.Shared; -using System.Collections.Generic; - -namespace Microsoft.Build.BuildEngine -{ - internal static class ExpressionShredder - { - /// - /// Splits an expression into fragments at semi-colons, except where the - /// semi-colons are in a macro or separator expression. - /// Fragments are trimmed and empty fragments discarded. - /// - /// - /// These complex cases prevent us from doing a simple split on ';': - /// (1) Macro expression: @(foo->'xxx;xxx') - /// (2) Separator expression: @(foo, 'xxx;xxx') - /// (3) Combination: @(foo->'xxx;xxx', 'xxx;xxx') - /// We must not split on semicolons in macro or separator expressions like these. - /// - /// List expression to split - /// danmose - /// Array of non-empty strings from split list. - internal static List SplitSemiColonSeparatedList(string expression) - { - List splitList = new List(); - int segmentStart = 0; - bool insideItemList = false; - bool insideQuotedPart = false; - string segment; - - // Walk along the string, keeping track of whether we are in an item list expression. - // If we hit a semi-colon or the end of the string and we aren't in an item list, - // add the segment to the list. - for (int current = 0; current < expression.Length; current++) - { - switch (expression[current]) - { - case ';': - if (!insideItemList) - { - // End of segment, so add it to the list - segment = expression.Substring(segmentStart, current - segmentStart).Trim(); - if (segment.Length > 0) - { - splitList.Add(segment); - } - // Move past this semicolon - segmentStart = current + 1; - } - break; - case '@': - // An '@' immediately followed by a '(' is the start of an item list - if (expression.Length > current + 1 && expression[current + 1] == '(') - { - // Start of item expression - insideItemList = true; - } - break; - case ')': - if (insideItemList && !insideQuotedPart) - { - // End of item expression - insideItemList = false; - } - break; - case '\'': - if (insideItemList) - { - // Start or end of quoted expression in item expression - insideQuotedPart = !insideQuotedPart; - } - break; - } - } - - // Reached the end of the string: what's left is another segment - segment = expression.Substring(segmentStart, expression.Length - segmentStart).Trim(); - if (segment.Length > 0) - { - splitList.Add(segment); - } - - return splitList; - } - - /// - /// Given a list of expressions that may contain item list expressions, - /// returns a pair of tables of all item names found, as K=Name, V=String.Empty; - /// and all metadata not in transforms, as K=Metadata key, V=MetadataReference, - /// where metadata key is like "itemname.metadataname" or "metadataname". - /// PERF: Tables are null if there are no entries, because this is quite a common case. - /// - internal static ItemsAndMetadataPair GetReferencedItemNamesAndMetadata(List expressions) - { - ItemsAndMetadataPair pair = new ItemsAndMetadataPair(null, null); - - foreach (string expression in expressions) - { - GetReferencedItemNamesAndMetadata(expression, 0, expression.Length, ref pair, ShredderOptions.All); - } - - return pair; - } - - /// - /// Returns true if there is a metadata expression (outside of a transform) in the expression. - /// - internal static bool ContainsMetadataExpressionOutsideTransform(string expression) - { - ItemsAndMetadataPair pair = new ItemsAndMetadataPair(null, null); - - GetReferencedItemNamesAndMetadata(expression, 0, expression.Length, ref pair, ShredderOptions.MetadataOutsideTransforms); - - bool result = (pair.Metadata?.Count > 0); - - return result; - } - - /// - /// Given a subexpression, finds referenced item names and inserts them into the table - /// as K=Name, V=String.Empty. - /// - /// - /// We can ignore any semicolons in the expression, since we're not itemizing it. - /// - private static void GetReferencedItemNamesAndMetadata(string expression, int start, int end, ref ItemsAndMetadataPair pair, ShredderOptions whatToShredFor) - { - for (int i = start; i < end; i++) - { - int restartPoint; - - if (Sink(expression, ref i, end, '@', '(')) - { - // Start of a possible item list expression - - // Store the index to backtrack to if this doesn't turn out to be a well - // formed metadata expression. (Subtract one for the increment when we loop around.) - restartPoint = i - 1; - - SinkWhitespace(expression, ref i); - - int startOfName = i; - - if (!SinkValidName(expression, ref i, end)) - { - i = restartPoint; - continue; - } - - // '-' is a legitimate char in an item name, but we should match '->' as an arrow - // in '@(foo->'x')' rather than as the last char of the item name. - // The old regex accomplished this by being "greedy" - if (end > i && expression[i - 1] == '-' && expression[i] == '>') - { - i--; - } - - // Grab the name, but continue to verify it's a well-formed expression - // before we store it. - string name = expression.Substring(startOfName, i - startOfName); - - SinkWhitespace(expression, ref i); - - // If there's an '->' eat it and the subsequent quoted expression - if (Sink(expression, ref i, end, '-', '>')) - { - SinkWhitespace(expression, ref i); - - if (!SinkSingleQuotedExpression(expression, ref i, end)) - { - i = restartPoint; - continue; - } - } - - SinkWhitespace(expression, ref i); - - // If there's a ',', eat it and the subsequent quoted expression - if (Sink(expression, ref i, ',')) - { - SinkWhitespace(expression, ref i); - - if (!Sink(expression, ref i, '\'')) - { - i = restartPoint; - continue; - } - - int closingQuote = expression.IndexOf('\'', i); - if (closingQuote == -1) - { - i = restartPoint; - continue; - } - - // Look for metadata in the separator expression - // e.g., @(foo, '%(bar)') contains batchable metadata 'bar' - GetReferencedItemNamesAndMetadata(expression, i, closingQuote, ref pair, ShredderOptions.MetadataOutsideTransforms); - - i = closingQuote + 1; - } - - SinkWhitespace(expression, ref i); - - if (!Sink(expression, ref i, ')')) - { - i = restartPoint; - continue; - } - - // If we've got this far, we know the item expression was - // well formed, so make sure the name's in the table - if ((whatToShredFor & ShredderOptions.ItemTypes) != 0) - { - pair.Items = Utilities.CreateTableIfNecessary(pair.Items); - pair.Items[name] = String.Empty; - } - - i--; - - continue; - } - - if (Sink(expression, ref i, end, '%', '(')) - { - // Start of a possible metadata expression - - // Store the index to backtrack to if this doesn't turn out to be a well - // formed metadata expression. (Subtract one for the increment when we loop around.) - restartPoint = i - 1; - - SinkWhitespace(expression, ref i); - - int startOfText = i; - - if (!SinkValidName(expression, ref i, end)) - { - i = restartPoint; - continue; - } - - // Grab this, but we don't know if it's an item or metadata name yet - string firstPart = expression.Substring(startOfText, i - startOfText); - string itemName = null; - string metadataName; - string qualifiedMetadataName; - - SinkWhitespace(expression, ref i); - - bool qualified = Sink(expression, ref i, '.'); - - if (qualified) - { - SinkWhitespace(expression, ref i); - - startOfText = i; - - if (!SinkValidName(expression, ref i, end)) - { - i = restartPoint; - continue; - } - - itemName = firstPart; - metadataName = expression.Substring(startOfText, i - startOfText); - qualifiedMetadataName = itemName + "." + metadataName; - } - else - { - metadataName = firstPart; - qualifiedMetadataName = metadataName; - } - - SinkWhitespace(expression, ref i); - - if (!Sink(expression, ref i, ')')) - { - i = restartPoint; - continue; - } - - if ((whatToShredFor & ShredderOptions.MetadataOutsideTransforms) != 0) - { - pair.Metadata = Utilities.CreateTableIfNecessary(pair.Metadata); - pair.Metadata[qualifiedMetadataName] = new MetadataReference(itemName, metadataName); - } - - i--; - } - } - } - - /// - /// Returns true if a single quoted subexpression begins at the specified index - /// and ends before the specified end index. - /// Leaves index one past the end of the second quote. - /// - private static bool SinkSingleQuotedExpression(string expression, ref int i, int end) - { - if (!Sink(expression, ref i, '\'')) - { - return false; - } - - while (i < end && expression[i] != '\'') - { - i++; - } - - i++; - - if (end <= i) - { - return false; - } - - return true; - } - - /// - /// Returns true if a valid name begins at the specified index. - /// Leaves index one past the end of the name. - /// - private static bool SinkValidName(string expression, ref int i, int end) - { - if (end <= i || !XmlUtilities.IsValidInitialElementNameCharacter(expression[i])) - { - return false; - } - - i++; - - while (end > i && XmlUtilities.IsValidSubsequentElementNameCharacter(expression[i])) - { - i++; - } - - return true; - } - - /// - /// Returns true if the character at the specified index - /// is the specified char. - /// Leaves index one past the character. - /// - private static bool Sink(string expression, ref int i, char c) - { - if (i < expression.Length && expression[i] == c) - { - i++; - return true; - } - - return false; - } - - /// - /// Returns true if the next two characters at the specified index - /// are the specified sequence. - /// Leaves index one past the second character. - /// - private static bool Sink(string expression, ref int i, int end, char c1, char c2) - { - if (i < end - 1 && expression[i] == c1 && expression[i + 1] == c2) - { - i += 2; - return true; - } - - return false; - } - /// - /// Moves past all whitespace starting at the specified index. - /// Returns the next index, possibly the string length. - /// - /// - /// Char.IsWhitespace() is not identical in behavior to regex's \s character class, - /// but it's extremely close, and it's what we use in conditional expressions. - /// - private static void SinkWhitespace(string expression, ref int i) - { - while (i < expression.Length && Char.IsWhiteSpace(expression[i])) - { - i++; - } - } - } - - # region Related Types - - /// - /// What the shredder should be looking for. - /// - [Flags] - internal enum ShredderOptions - { - Invalid = 0x0, - ItemTypes = 0x1, - MetadataOutsideTransforms = 0x2, - All = ItemTypes | MetadataOutsideTransforms - } - - /// - /// Wrapper of two tables for a convenient method return value. - /// - internal struct ItemsAndMetadataPair - { - private Hashtable items; - private Dictionary metadata; - - internal ItemsAndMetadataPair(Hashtable items, Dictionary metadata) - { - this.items = items; - this.metadata = metadata; - } - - internal Hashtable Items - { - readonly get { return items; } - set { items = value; } - } - - internal Dictionary Metadata - { - readonly get { return metadata; } - set { metadata = value; } - } - } - - // This struct represents a reference to a piece of item metadata. For example, - // %(EmbeddedResource.Culture) or %(Culture) in the project file. In this case, - // "EmbeddedResource" is the item name, and "Culture" is the metadata name. - // The item name is optional. - internal struct MetadataReference - { - /// - /// Constructor - /// - /// can be null - /// - internal MetadataReference - ( - string itemName, - string metadataName - ) - { - this.itemName = itemName; - this.metadataName = metadataName; - } - - internal string itemName; // Could be null if the %(...) is not qualified with an item name. - internal string metadataName; - } - - #endregion -} diff --git a/src/Deprecated/Engine/ItemsAndProperties/Lookup.cs b/src/Deprecated/Engine/ItemsAndProperties/Lookup.cs deleted file mode 100644 index 5d3c0c41de2..00000000000 --- a/src/Deprecated/Engine/ItemsAndProperties/Lookup.cs +++ /dev/null @@ -1,1222 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections; -using System.Collections.Generic; -using Microsoft.Build.BuildEngine.Shared; -using System.Threading; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// Contains a list of item and property collections, optimized to allow - /// - very fast "cloning" - /// - quick lookups - /// - scoping down of item subsets in nested scopes (useful for batches) - /// - isolation of adds, removes, modifies, and property sets inside nested scopes - /// - /// When retrieving the item group for an item type, each table is consulted in turn, - /// starting with the primary table (the "top" or "innermost" table), until a table is found that has an entry for that type. - /// When an entry is found, it is returned without looking deeper. - /// This makes it possible to let callers see only a subset of items without affecting or cloning the original item groups, - /// by populating a scope with item groups that are empty or contain subsets of items in lower scopes. - /// - /// Instances of this class can be cloned with Clone() to share between batches. - /// - /// When EnterScope() is called, a fresh primary table is inserted, and all adds and removes will be invisible to - /// any clones made before the scope was entered and anyone who has access to item groups in lower tables. - /// - /// When LeaveScope() is called, the primary tables are merged into the secondary tables, and the primary tables are discarded. - /// This makes the adds and removes in the primary tables visible to clones made during the previous scope. - /// - /// Scopes can be populated (before Adds, Removes, and Lookups) using PopulateWithItem(). This reduces the set of items of a particular - /// type that are visible in a scope, because lookups of items of this type will stop at this level and see the subset, rather than the - /// larger set in a scope below. - /// - /// Items can be added or removed by calling AddNewItem() and RemoveItem(). Only the primary level is modified. - /// When items are added or removed they enter into a primary table exclusively for adds or removes, instead of the main primary table. - /// This allows the adds and removes to be applied to the scope below on LeaveScope(). Even when LeaveScope() is called, the adds and removes - /// stay in their separate add and remove tables: if they were applied to a main table, they could truncate the downward traversal performed by lookups - /// and hide items in a lower main table. Only on the final call of LeaveScope() can all adds and removes be applied to the outermost table, i.e., the project. - /// - /// Much the same applies to properties. - /// - /// For sensible semantics, only the current primary scope can be modified at any point. - /// - /// - /// THREAD SAFETY: - /// - BuildItemGroups are currently unsafe for concurrent reading and writing (they have a List field). So a Lookup cannot be read and written to - /// concurrently. - /// - To avoid this problem, the lookup can be populated with a clone of an item group, and lookup can be Truncate()'d at the level of that clone - /// until control of the lookup goes back to the safe thread. - /// - /// FUTURE: - /// - We could eliminate all the code performing resetting of project build state (currently implemented using special tables for Output properties and - /// backups of persisted item groups and metadata before modification) by using a Lookup, entering scope at the start of a build, - /// then when build state needs to be reset, throwing away the Lookup (rather than leaving scope). - /// - internal class Lookup - { - #region Fields - - /// - /// Ordered list of entries used for lookup. - /// Each entry contains multiple tables: - /// - the main item table (populated with subsets of lists, in order to create batches) - /// - the add table (items that have been added during execution) - /// - the remove table (items that have been removed during execution) - /// - the modify table (item metadata modifications) - /// - the main property table (populated with properties that are visible in this scope) - /// - the property set table (changes made to properties) - /// All have to be consulted to find the items and properties available in the current scope. - /// We have to keep them separate, because the adds and removes etc need to be applied to the table - /// below when we leave a scope. - /// - private LinkedList lookupEntries = new LinkedList(); - - /// - /// Projects store their items in a hashtable of item groups by name (which we handle in our lookup table) - /// but also in a single item group. When we leave scope the last time, we have to update this item group as - /// well. This is only used when we leave scope the last time. - /// - private BuildItemGroup projectItems; - - /// - /// When we are asked for all the items of a certain type using the GetItems() method, we may have to handle items - /// that have been modified earlier with ModifyItems(). These pending modifications can't be applied immediately to - /// the item because that would affect other batches. Instead we clone the item, apply the modification, and hand that over. - /// The problem is that later we might get asked to remove or modify that item. We want to make sure that we record that as - /// a remove or modify of the real item, not the clone we handed over. So we keep a lookup of (clone, original) to consult. - /// The "beautiful" alternative to this would probably involve giving items the concept of a pending change, but this works - /// for what we need it to do right now. - /// - private Dictionary cloneTable; - - /// - /// Read-only wrapper around this lookup. - /// - private ReadOnlyLookup readOnlyLookup; - - /// - /// Library of default metadata to apply to items added to this lookup. - /// - private ItemDefinitionLibrary itemDefinitionLibrary; - - #endregion - - #region Constructors - - internal Lookup(Hashtable itemsByName, BuildPropertyGroup properties, ItemDefinitionLibrary itemDefinitionLibrary) - : this(itemsByName, new BuildItemGroup(), properties, itemDefinitionLibrary) - { } - - internal Lookup(Hashtable itemsByName, BuildItemGroup projectItems, BuildPropertyGroup properties, ItemDefinitionLibrary itemDefinitionLibrary) - { - ErrorUtilities.VerifyThrow(itemDefinitionLibrary != null, "Expect library"); - - this.projectItems = projectItems; - this.itemDefinitionLibrary = itemDefinitionLibrary; - LookupEntry entry = new LookupEntry(itemsByName, properties); - lookupEntries.AddFirst(entry); - } - - /// - /// Copy constructor (called via Clone() - clearer semantics) - /// - private Lookup(Lookup that) - { - // Add the same tables from the original - foreach (LookupEntry entry in that.lookupEntries) - { - this.lookupEntries.AddLast(entry); - } - this.projectItems = that.projectItems; - this.itemDefinitionLibrary = that.itemDefinitionLibrary; - - // Clones need to share an (item)clone table; the batching engine asks for items from the lookup, - // then populates buckets with them, which have clone lookups. - this.cloneTable = that.cloneTable; - } - - #endregion - - #region Properties - - /// - /// Returns a read-only wrapper around this lookup - /// - internal ReadOnlyLookup ReadOnlyLookup - { - get - { - if (readOnlyLookup == null) - { - readOnlyLookup = new ReadOnlyLookup(this); - } - return readOnlyLookup; - } - } - - // Convenience private properties - // "Primary" is the "top" or "innermost" scope - // "Secondary" is the next from the top. - private Hashtable PrimaryTable - { - get { return lookupEntries.First.Value.Items; } - set { lookupEntries.First.Value.Items = value; } - } - - private Hashtable PrimaryAddTable - { - get { return lookupEntries.First.Value.Adds; } - set { lookupEntries.First.Value.Adds = value; } - } - - private Hashtable PrimaryRemoveTable - { - get { return lookupEntries.First.Value.Removes; } - set { lookupEntries.First.Value.Removes = value; } - } - - private Dictionary>> PrimaryModifyTable - { - get { return lookupEntries.First.Value.Modifies; } - set { lookupEntries.First.Value.Modifies = value; } - } - - private BuildPropertyGroup PrimaryPropertySets - { - get { return lookupEntries.First.Value.PropertySets; } - set { lookupEntries.First.Value.PropertySets = value; } - } - - private Hashtable SecondaryTable - { - get { return lookupEntries.First.Next.Value.Items; } - set { lookupEntries.First.Next.Value.Items = value; } - } - - private Hashtable SecondaryAddTable - { - get { return lookupEntries.First.Next.Value.Adds; } - set { lookupEntries.First.Next.Value.Adds = value; } - } - - private Hashtable SecondaryRemoveTable - { - get { return lookupEntries.First.Next.Value.Removes; } - set { lookupEntries.First.Next.Value.Removes = value; } - } - - private Dictionary>> SecondaryModifyTable - { - get { return lookupEntries.First.Next.Value.Modifies; } - set { lookupEntries.First.Next.Value.Modifies = value; } - } - - private BuildPropertyGroup SecondaryProperties - { - get { return lookupEntries.First.Next.Value.Properties; } - set { lookupEntries.First.Next.Value.Properties = value; } - } - - private BuildPropertyGroup SecondaryPropertySets - { - get { return lookupEntries.First.Next.Value.PropertySets; } - set { lookupEntries.First.Next.Value.PropertySets = value; } - } - - #endregion - - #region Internal Methods - - /// - /// Compares the primary property sets of the passed in lookups to determine if there are properties which are shared between - /// the lookups. We find these shared property names because this indicates that the current Lookup is overriding the property value of another Lookup - /// When an override is detected a messages is generated to inform the users that the property is being changed between batches - /// - /// array or error messages to log - internal List GetPropertyOverrideMessages(Hashtable lookupHash) - { - List errorMessages = null; - // For each batch lookup list we need to compare the property items to see if they have already been set - if (PrimaryPropertySets != null) - { - foreach (BuildProperty property in PrimaryPropertySets) - { - string propertyName = property.Name; - // If the hash contains the property name, output a messages that displays the previous property value and the new property value - if (lookupHash.ContainsKey(propertyName)) - { - if (errorMessages == null) - { - errorMessages = new List(); - } - errorMessages.Add(ResourceUtilities.FormatResourceString("PropertyOutputOverridden", propertyName, lookupHash[propertyName], property.FinalValueEscaped)); - } - - // Set the value of the hash to the new property value - lookupHash[propertyName] = property.FinalValueEscaped; - } - } - - return errorMessages; - } - - /// - /// Clones this object, to create another one with its own list, but the same contents. - /// Then the clone can enter scope and have its own fresh primary list without affecting the other object. - /// - internal Lookup Clone() - { - return new Lookup(this); - } - - /// - /// Push the tables down and add a fresh new primary entry at the top. - /// Returns the new scope. In general, callers should not use this returned scope. - /// - internal LookupEntry EnterScope() - { - // We don't create the tables unless we need them - LookupEntry entry = new LookupEntry(null, null); - lookupEntries.AddFirst(entry); - return entry; - } - - /// - /// Moves all tables up one: the tertiary table becomes the secondary table, and so on. The primary - /// and secondary table are merged. This has the effect of "applying" the adds applied to the primary - /// table into the secondary table. - /// - internal void LeaveScope() - { - MustBeOwningThread(); - ErrorUtilities.VerifyThrowNoAssert(lookupEntries.Count >= 2, "Too many calls to Leave()."); - - // Our lookup works by stopping the first time it finds an item group of the appropriate type. - // So we can't apply an add directly into the table below because that could create a new group - // of that type, which would cause the next lookup to stop there and miss any existing items in a table below. - // Instead we keep adds stored separately until we're leaving the very last scope. Until then - // we only move adds down into the next add table below, and when we lookup we consider both tables. - // Same applies to removes. - if (lookupEntries.Count == 2) - { - MergeScopeIntoLastScope(); - } - else - { - MergeScopeIntoNotLastScope(); - } - - // Let go of our pointer into the clone table; we assume we won't need it after leaving scope and want to save memory. - // This is an assumption on IntrinsicTask, that it won't ask to remove or modify a clone in a higher scope than it was handed out in. - // We mustn't call cloneTable.Clear() because other clones of this lookup may still be using it. When the last lookup clone leaves scope, - // the table will be collected. - cloneTable = null; - - // Move all tables up one, discarding the primary tables - lookupEntries.RemoveFirst(); - } - - /// - /// Leaving an arbitrary scope, just merging all the adds, removes, modifies, and sets into the scope below. - /// - private void MergeScopeIntoNotLastScope() - { - // Move all the adds down - if (PrimaryAddTable != null) - { - if (SecondaryAddTable == null) - { - SecondaryAddTable = PrimaryAddTable; - } - else - { - foreach (DictionaryEntry entry in PrimaryAddTable) - { - ImportItemsIntoTable(SecondaryAddTable, (string)entry.Key, (BuildItemGroup)entry.Value); - } - } - } - - // Move all the removes down - if (PrimaryRemoveTable != null) - { - if (SecondaryRemoveTable == null) - { - SecondaryRemoveTable = PrimaryRemoveTable; - } - else - { - foreach (DictionaryEntry entry in PrimaryRemoveTable) - { - ImportItemsIntoTable(SecondaryRemoveTable, (string)entry.Key, (BuildItemGroup)entry.Value); - } - } - } - - // Move all the modifies down - if (PrimaryModifyTable != null) - { - if (SecondaryModifyTable == null) - { - SecondaryModifyTable = PrimaryModifyTable; - } - else - { - foreach (KeyValuePair>> entry in PrimaryModifyTable) - { - Dictionary> modifiesOfType; - if (SecondaryModifyTable.TryGetValue(entry.Key, out modifiesOfType)) - { - // There are already modifies of this type: add to the existing table - foreach (KeyValuePair> modify in entry.Value) - { - MergeModificationsIntoModificationTable(modifiesOfType, modify, ModifyMergeType.SecondWins); - } - } - else - { - SecondaryModifyTable.Add(entry.Key, entry.Value); - } - } - } - } - - // Move all the sets down - if (PrimaryPropertySets != null) - { - if (SecondaryPropertySets == null) - { - SecondaryPropertySets = PrimaryPropertySets; - } - else - { - SecondaryPropertySets.ImportProperties(PrimaryPropertySets); - } - } - } - - /// - /// Merge the current scope down into the base scope. This means applying the adds, removes, modifies, and sets - /// directly into the item and property tables in this scope. - /// - private void MergeScopeIntoLastScope() - { - // End of the line for this object: we are done with add tables, and we want to expose our - // adds to the world - if (PrimaryAddTable != null) - { - foreach (DictionaryEntry entry in PrimaryAddTable) - { - SecondaryTable = Utilities.CreateTableIfNecessary(SecondaryTable); - ImportItemsIntoTable(SecondaryTable, (string)entry.Key, (BuildItemGroup)entry.Value); - projectItems.ImportItems((BuildItemGroup)entry.Value); - } - } - - if (PrimaryRemoveTable != null) - { - foreach (DictionaryEntry entry in PrimaryRemoveTable) - { - SecondaryTable = Utilities.CreateTableIfNecessary(SecondaryTable); - RemoveItemsFromTableWithBackup(SecondaryTable, (string)entry.Key, (BuildItemGroup)entry.Value); - projectItems.RemoveItemsWithBackup((BuildItemGroup)entry.Value); - } - } - - if (PrimaryModifyTable != null) - { - foreach (KeyValuePair>> entry in PrimaryModifyTable) - { - SecondaryTable = Utilities.CreateTableIfNecessary(SecondaryTable); - ApplyModificationsToTable(SecondaryTable, entry.Key, entry.Value); - // Don't have to touch projectItems -- it contains the same set of items - } - } - - if (PrimaryPropertySets != null) - { - SecondaryProperties = CreatePropertyGroupIfNecessary(SecondaryProperties); - - // At present, this automatically does a backup of any - // original persisted property because we're using Output properties. - SecondaryProperties.ImportProperties(PrimaryPropertySets); - } - } - - /// - /// Gets the effective property for the current scope. - /// If no match is found, returns null. - /// Caller must not modify the property returned. - /// - internal BuildProperty GetProperty(string name) - { - // Walk down the tables and stop when the first - // property with this name is found - foreach (LookupEntry entry in lookupEntries) - { - if (entry.PropertySets != null) - { - BuildProperty property = entry.PropertySets[name]; - if (property != null) - { - return property; - } - } - - if (entry.Properties != null) - { - BuildProperty property = entry.Properties[name]; - if (property != null) - { - return property; - } - } - - if (entry.TruncateLookupsAtThisScope) - { - break; - } - } - - return null; - } - - /// - /// Gets the items of the specified type that are visible in the current scope. - /// If no match is found, returns null. - /// Caller must not modify the group returned. - /// - internal BuildItemGroup GetItems(string name) - { - // The visible items consist of the adds (accumulated as we go down) - // plus the first set of regular items we encounter - // minus any removes - BuildItemGroup allAdds = null; - BuildItemGroup allRemoves = null; - Dictionary> allModifies = null; - BuildItemGroup groupFound = null; - - foreach (LookupEntry entry in lookupEntries) - { - // Accumulate adds while we look downwards - if (entry.Adds != null) - { - BuildItemGroup adds = (BuildItemGroup)entry.Adds[name]; - if (adds != null) - { - allAdds = CreateItemGroupIfNecessary(allAdds); - allAdds.ImportItems(adds); - } - } - - // Accumulate removes while we look downwards - if (entry.Removes != null) - { - BuildItemGroup removes = (BuildItemGroup)entry.Removes[name]; - if (removes != null) - { - allRemoves = CreateItemGroupIfNecessary(allRemoves); - allRemoves.ImportItems(removes); - } - } - - // Accumulate modifications as we look downwards - if (entry.Modifies != null) - { - Dictionary> modifies; - if (entry.Modifies.TryGetValue(name, out modifies)) - { - if (allModifies == null) - { - allModifies = new Dictionary>(); - } - - // We already have some modifies for this type - foreach (KeyValuePair> modify in modifies) - { - // If earlier scopes modify the same metadata on the same item, - // they have priority - MergeModificationsIntoModificationTable(allModifies, modify, ModifyMergeType.FirstWins); - } - } - } - - if (entry.Items != null) - { - groupFound = (BuildItemGroup)entry.Items[name]; - if (groupFound != null) - { - // Found a group: we go no further - break; - } - } - - if (entry.TruncateLookupsAtThisScope) - { - break; - } - } - - if ((allAdds == null || allAdds.Count == 0) && - (allRemoves == null || allRemoves.Count == 0) && - (allModifies == null || allModifies.Count == 0)) - { - // We can just hand out this group verbatim - - // that avoids any importing - if (groupFound == null) - { - groupFound = new BuildItemGroup(); - } - - return groupFound; - } - - // We have adds and/or removes and/or modifies to incorporate. - // We can't modify the group, because that might - // be visible to other batches; we have to create - // a new one. - BuildItemGroup result = new BuildItemGroup(); - - if (groupFound != null) - { - result.ImportItems(groupFound); - } - // Removes are processed after adds; this means when we remove there's no need to concern ourselves - // with the case where the item being removed is in an add table somewhere. The converse case is not possible - // using a project file: a project file cannot create an item that was already removed, it can only create - // a unique new item. - if (allAdds != null) - { - result.ImportItems(allAdds); - } - - if (allRemoves != null) - { - result.RemoveItems(allRemoves); - } - - // Modifies can be processed last; if a modified item was removed, the modify will be ignored - if (allModifies != null) - { - ApplyModifies(result, allModifies); - } - - return result; - } - - /// - /// Populates with an item group. This is done before the item lookup is used in this scope. - /// Assumes all the items in the group have the same, provided, type. - /// Assumes there is no item group of this type in the primary table already. - /// - internal void PopulateWithItems(string name, BuildItemGroup group) - { - MustBeOwningThread(); - - PrimaryTable = Utilities.CreateTableIfNecessary(PrimaryTable); - BuildItemGroup existing = (BuildItemGroup)PrimaryTable[name]; - ErrorUtilities.VerifyThrow(existing == null, "Cannot add an itemgroup of this type."); - PrimaryTable[name] = group; - } - - /// - /// Populates with an item. This is done before the item lookup is used in this scope. - /// There may or may not already be a group for it. - /// - internal void PopulateWithItem(BuildItem item) - { - MustBeOwningThread(); - - PrimaryTable = Utilities.CreateTableIfNecessary(PrimaryTable); - ImportItemIntoTable(PrimaryTable, item); - } - - /// - /// Apply a property to this scope. - /// - internal void SetProperty(BuildProperty property) - { - MustBeOwningThread(); - - // At present resetting of build state is done by marking properties as output properties; - // until resetting is also done using scopes, we can expect that all new properties will be output properties, - // so they can be reset. - ErrorUtilities.VerifyThrow(property.Type == PropertyType.OutputProperty, "Expected output property"); - - // Setting in outer scope could be easily implemented, but our code does not do it at present - MustNotBeOuterScope(); - - // Put in the set table - PrimaryPropertySets = CreatePropertyGroupIfNecessary(PrimaryPropertySets); - PrimaryPropertySets.SetProperty(property); - } - - /// - /// Implements a true add, an item that has been created in a batch. - /// - internal void AddNewItems(BuildItemGroup group) - { - MustBeOwningThread(); - - // Adding to outer scope could be easily implemented, but our code does not do it at present - MustNotBeOuterScope(); - -#if DEBUG - foreach (BuildItem item in group) - { - MustNotBeInAnyTables(item); - } -#endif - - if (group.Count == 0) - { - return; - } - - foreach (BuildItem item in group) - { - // We only expect to add virtual items during the build - ErrorUtilities.VerifyThrow(!item.IsPartOfProjectManifest, "Cannot dynamically add manifest items"); - item.ItemDefinitionLibrary = this.itemDefinitionLibrary; - } - - // Put them in the add table - PrimaryAddTable = Utilities.CreateTableIfNecessary(PrimaryAddTable); - ImportItemsIntoTable(PrimaryAddTable, group[0].Name, group); - } - - /// - /// Implements a true add, an item that has been created in a batch. - /// - internal void AddNewItem(BuildItem item) - { - MustBeOwningThread(); - // We only expect to add virtual items during the build - ErrorUtilities.VerifyThrow(!item.IsPartOfProjectManifest, "Cannot dynamically add manifest items"); - - // Adding to outer scope could be easily implemented, but our code does not do it at present - MustNotBeOuterScope(); - -#if DEBUG - // This item must not be in any table already; a project cannot create an item - // that already exists - MustNotBeInAnyTables(item); -#endif - item.ItemDefinitionLibrary = this.itemDefinitionLibrary; - - // Put in the add table - PrimaryAddTable = Utilities.CreateTableIfNecessary(PrimaryAddTable); - ImportItemIntoTable(PrimaryAddTable, item); - } - - /// - /// Remove a bunch of items from this scope - /// - internal void RemoveItems(List items) - { - MustBeOwningThread(); - - foreach (BuildItem item in items) - { - RemoveItem(item); - } - } - - /// - /// Remove an item from this scope - /// - internal void RemoveItem(BuildItem item) - { - MustBeOwningThread(); - - // Removing from outer scope could be easily implemented, but our code does not do it at present - MustNotBeOuterScope(); - - item = RetrieveOriginalFromCloneTable(item); - - // Put in the remove table - PrimaryRemoveTable = Utilities.CreateTableIfNecessary(PrimaryRemoveTable); - ImportItemIntoTable(PrimaryRemoveTable, item); - - // No need to remove this item from the primary add table if it's - // already there -- we always apply removes after adds, so that add - // will be reversed anyway. - } - - /// - /// Modifies items in this scope with the same set of metadata modifications. - /// Assumes all the items in the group have the same, provided, type. - /// - internal void ModifyItems(string name, BuildItemGroup group, Dictionary metadataChanges) - { - MustBeOwningThread(); - - // Modifying in outer scope could be easily implemented, but our code does not do it at present - MustNotBeOuterScope(); - -#if DEBUG - // This item should not already be in any remove table; there is no way a project can - // modify items that were already removed - // Obviously, do this only in debug, as it's a slow check for bugs. - LinkedListNode node = lookupEntries.First; - while (node != null) - { - LookupEntry entry = node.Value; - foreach (BuildItem item in group) - { - BuildItem actualItem = RetrieveOriginalFromCloneTable(item); - MustNotBeInTable(entry.Removes, actualItem); - } - node = node.Next; - } -#endif - - if (metadataChanges.Count == 0) - { - return; - } - - // Put in the modify table - - // We don't need to check whether the item is in the add table vs. the main table; either - // way the modification will be applied. - PrimaryModifyTable = CreateTableIfNecessary(PrimaryModifyTable); - Dictionary> modifiesOfType; - if (!PrimaryModifyTable.TryGetValue(name, out modifiesOfType)) - { - modifiesOfType = new Dictionary>(); - PrimaryModifyTable[name] = modifiesOfType; - } - - foreach (BuildItem item in group) - { - // If we're asked to modify a clone we handed out, record it as a modify of the original - // instead - BuildItem actualItem = RetrieveOriginalFromCloneTable(item); - KeyValuePair> modify = new KeyValuePair>(actualItem, metadataChanges); - MergeModificationsIntoModificationTable(modifiesOfType, modify, ModifyMergeType.SecondWins); - } - } - - #endregion - - #region Private Methods - - /// - /// Apply modifies to a temporary result group. - /// Items to be modified are virtual-cloned so the original isn't changed. - /// - private void ApplyModifies(BuildItemGroup result, Dictionary> allModifies) - { - // Clone, because we're modifying actual items, and this would otherwise be visible to other batches, - // and would be "published" even if a target fails. - // FUTURE - don't need to clone here for non intrinsic tasks, but at present, they don't do modifies - - // Store the clone, in case we're asked to modify or remove it later (we will record it against the real item) - if (cloneTable == null) - { - cloneTable = new Dictionary(); - } - - foreach (KeyValuePair> modify in allModifies) - { - BuildItem clone = result.ModifyItemAfterCloningUsingVirtualMetadata(modify.Key, modify.Value); - - // This will be null if the item wasn't in the result group, ie, it had been removed after being modified - if (clone != null) - { -#if DEBUG - ErrorUtilities.VerifyThrow(!cloneTable.ContainsKey(clone), "Should be new, not already in table!"); -#endif - cloneTable[clone] = modify.Key; - } - } - } - - /// - /// Look up the "real" item by using its clone, and return the real item. - /// See for explanation of the clone table. - /// - private BuildItem RetrieveOriginalFromCloneTable(BuildItem item) - { - BuildItem original; - if (cloneTable != null) - { - if (cloneTable.TryGetValue(item, out original)) - { - item = original; - } - } - - return item; - } - - /// - /// Puts items from the group into the table. - /// Assumes all the items in the group have the same, provided, type. - /// There may or may not already be a group for it. - /// - private void ImportItemsIntoTable(Hashtable table, string name, BuildItemGroup group) - { - BuildItemGroup existing = (BuildItemGroup)table[name]; - if (existing == null) - { - table[name] = group; - } - else - { - existing.ImportItems(group); - } - } - - /// - /// Removes items from the group from the table. - /// Assumes all the items in the group have the same, provided, type. - /// - private void RemoveItemsFromTableWithBackup(Hashtable table, string name, BuildItemGroup group) - { - BuildItemGroup existing = (BuildItemGroup)table[name]; - existing?.RemoveItemsWithBackup(group); - } - - /// - /// Applies a list of modifications to the appropriate BuildItemGroup in a main table. - /// If any modifications conflict, these modifications win. - /// - private void ApplyModificationsToTable(Hashtable table, string name, Dictionary> modify) - { - BuildItemGroup existing = (BuildItemGroup)table[name]; - existing?.ModifyItemsUsingVirtualMetadata(modify); - } - - /// - /// When merging metadata, we can deal with a conflict two different ways: - /// FirstWins = any previous metadata with the name takes precedence - /// SecondWins = the new metadata with the name takes precedence - /// - private enum ModifyMergeType - { - FirstWins = 1, - SecondWins = 2 - } - - /// - /// Applies a modification to an item in a table of modifications. - /// If the item already exists in the table, merges in the modifications; if there is a conflict - /// the mergeType indicates which should win. - /// - private void MergeModificationsIntoModificationTable(Dictionary> modifiesOfType, - KeyValuePair> modify, - ModifyMergeType mergeType) - { - Dictionary existingMetadataChanges; - if (modifiesOfType.TryGetValue(modify.Key, out existingMetadataChanges)) - { - // There's already modifications for this item; merge with those - foreach (KeyValuePair metadataChange in modify.Value) - { - if (mergeType == ModifyMergeType.SecondWins) - { - existingMetadataChanges[metadataChange.Key] = metadataChange.Value; - } - else - { - // Any existing value wins - if (!existingMetadataChanges.ContainsKey(metadataChange.Key)) - { - existingMetadataChanges[metadataChange.Key] = metadataChange.Value; - } - } - } - } - else - { - modifiesOfType.Add(modify.Key, modify.Value); - } - } - - /// - /// Puts the item into the table. - /// - private void ImportItemIntoTable(Hashtable table, BuildItem item) - { - BuildItemGroup existing = (BuildItemGroup)table[item.Name]; - if (existing == null) - { - existing = new BuildItemGroup(); - table.Add(item.Name, existing); - } - existing.AddItem(item); - } - - /// - /// Helper useful since we only create tables if they're needed - /// - private Dictionary>> CreateTableIfNecessary(Dictionary>> table) - { - if (table == null) - { - return new Dictionary>>(StringComparer.OrdinalIgnoreCase); - } - - return table; - } - - /// - /// Helper useful since we only create groups if they're needed - /// - private BuildPropertyGroup CreatePropertyGroupIfNecessary(BuildPropertyGroup properties) - { - if (properties == null) - { - return new BuildPropertyGroup(); - } - - return properties; - } - - /// - /// Helper useful since we only create groups if they're needed - /// - private BuildItemGroup CreateItemGroupIfNecessary(BuildItemGroup items) - { - if (items == null) - { - return new BuildItemGroup(); - } - - return items; - } - -#if DEBUG - /// - /// Verify item is not in the table - /// - private void MustNotBeInTable(Hashtable table, BuildItem item) - { - BuildItemGroup group = new BuildItemGroup(); - group.AddItem(item); - MustNotBeInTable(table, item.Name, group); - } - - /// - /// Verify item is not in the modify table - /// - private void MustNotBeInTable(Dictionary>> table, BuildItem item) - { - if (table?.ContainsKey(item.Name) == true) - { - Dictionary> tableOfItemsOfSameType = table[item.Name]; - if (tableOfItemsOfSameType != null) - { - ErrorUtilities.VerifyThrowNoAssert(!tableOfItemsOfSameType.ContainsKey(item), "Item should not be in table"); - } - } - } - - /// - /// Verify items in the group are not in the table - /// Assumes all items in the group have the same, specified, type - /// - private void MustNotBeInTable(Hashtable table, string name, BuildItemGroup group) - { - if (table?.ContainsKey(name) == true) - { - BuildItemGroup existing = (BuildItemGroup)table[name]; - if (existing != null) - { - foreach (BuildItem item in group) - { - ErrorUtilities.VerifyThrowNoAssert(!existing.Items.Contains(item), "Item should not be in table"); - } - } - } - } - - /// - /// Verify item is not in any table in any scope - /// - private void MustNotBeInAnyTables(BuildItem item) - { - // This item should not already be in any table; there is no way a project can - // create items that already existed - // Obviously, do this only in debug, as it's a slow check for bugs. - LinkedListNode node = lookupEntries.First; - while (node != null) - { - LookupEntry entry = node.Value; - MustNotBeInTable(entry.Adds, item); - MustNotBeInTable(entry.Removes, item); - MustNotBeInTable(entry.Modifies, item); - node = node.Next; - } - } - -#endif - - /// - /// Verify the thread that created the scope is the one modifying it. - /// - private void MustBeOwningThread() - { - int threadIdThatEnteredCurrentScope = lookupEntries.First.Value.ThreadIdThatEnteredScope; - ErrorUtilities.VerifyThrowNoAssert(threadIdThatEnteredCurrentScope == Thread.CurrentThread.ManagedThreadId, "Only the thread that entered a scope may modify or leave it"); - } - - /// - /// Add/remove/modify/set directly on an outer scope would need to be handled separately - it would apply - /// directly to the main tables. Our code isn't expected to do this. - /// - private void MustNotBeOuterScope() - { - ErrorUtilities.VerifyThrowNoAssert(lookupEntries.Count > 1, "Operation in outer scope not supported"); - } - - #endregion - } - - #region Related Types - - /// - /// Read-only wrapper around a lookup. - /// Passed to Expander and ItemExpander, which only need to - /// use a lookup in a read-only fashion, thus increasing - /// encapsulation of the data in the Lookup. - /// - internal class ReadOnlyLookup - { - private Lookup lookup; - - internal ReadOnlyLookup(Lookup lookup) - { - this.lookup = lookup; - } - - internal ReadOnlyLookup(Hashtable items, BuildPropertyGroup properties) - { - // Lookup only needs ItemDefinitionLibrary to mark new items with it. - // Since we're a read-only lookup, we don't need a real one. - this.lookup = new Lookup(items, properties, new ItemDefinitionLibrary(null)); - } - - internal BuildItemGroup GetItems(string name) - { - return lookup.GetItems(name); - } - - internal BuildProperty GetProperty(string name) - { - return lookup.GetProperty(name); - } - } - - /// - /// Represents an entry in the lookup list. - /// Class rather than a struct so that it can be modified in the list. - /// - internal class LookupEntry - { - // This is a table of K=type, V=BuildItemGroup - // The type is dictated by the storage in the project (and by thread safety) - private Hashtable items; - private Hashtable adds; - private Hashtable removes; - // Table of K=type, V= { table of K=item, V=table of { K=metadata name, V=metadata value }} - private Dictionary>> modifies; - private BuildPropertyGroup properties; - private BuildPropertyGroup propertySets; - private int threadIdThatEnteredScope; - private bool truncateLookupsAtThisScope; - - internal LookupEntry(Hashtable items, BuildPropertyGroup properties) - { - this.items = items; - this.adds = null; - this.removes = null; - this.modifies = null; - this.properties = properties; - this.propertySets = null; - this.threadIdThatEnteredScope = Thread.CurrentThread.ManagedThreadId; - this.truncateLookupsAtThisScope = false; - } - - /// - /// The main table, populated with items that - /// are initially visible in this scope. Does not - /// include adds or removes unless it's the table in - /// the outermost scope. - /// - internal Hashtable Items - { - get { return items; } - set { items = value; } - } - /// - /// Adds made in this scope or above. - /// - internal Hashtable Adds - { - get { return adds; } - set { adds = value; } - } - /// - /// Removes made in this scope or above. - /// - internal Hashtable Removes - { - get { return removes; } - set { removes = value; } - } - /// - /// Modifications made in this scope or above. - /// - internal Dictionary>> Modifies - { - get { return modifies; } - set { modifies = value; } - } - /// - /// The main property table, populated with properties - /// that are initially visible in this scope. Does not - /// include sets unless it's the table in the outermost scope. - /// - internal BuildPropertyGroup Properties - { - get { return properties; } - set { properties = value; } - } - /// - /// Properties set in this scope or above. - /// - internal BuildPropertyGroup PropertySets - { - get { return propertySets; } - set { propertySets = value; } - } - /// - /// ID of thread owning this scope - /// - internal int ThreadIdThatEnteredScope - { - get { return threadIdThatEnteredScope; } - } - /// - /// Whether to stop lookups going beyond this scope downwards - /// - internal bool TruncateLookupsAtThisScope - { - get { return truncateLookupsAtThisScope; } - set { truncateLookupsAtThisScope = value; } - } - } - #endregion - -} diff --git a/src/Deprecated/Engine/LocalProvider/LocalCallDescriptor.cs b/src/Deprecated/Engine/LocalProvider/LocalCallDescriptor.cs deleted file mode 100644 index 166dcb66054..00000000000 --- a/src/Deprecated/Engine/LocalProvider/LocalCallDescriptor.cs +++ /dev/null @@ -1,1597 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections; -using System.Threading; -using System.IO; -using System.Runtime.Serialization.Formatters.Binary; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This call is used to contain, serialize and deserialize arguments for call - /// made via INodeProvider and IEngineCallback interfaces. To make calls via these - /// interfaces asyncronous the parameters are queued up for a IO thread which - /// reads/writes the shared memory buffer to transfer these parameters cross - /// process. - /// - internal abstract class LocalCallDescriptor - { - #region Constructors - internal LocalCallDescriptor() - { - } - - internal LocalCallDescriptor(LocalCallType callType) - { - this.callType = callType; - this.callNumber = Interlocked.Increment(ref lastUsedCallNumber); - } - #endregion - - // For testing - #region Properties - internal int CallNumber - { - get - { - return this.callNumber; - } - } - internal LocalCallType CallType - { - get - { - return this.callType; - } - } - internal virtual bool NeedsReply - { - get - { - return false; - } - } - internal virtual bool IsReply - { - get - { - return false; - } - } - #endregion - - #region Methods - /// - /// Appropriate action to take if this event is received on the parent process - /// - internal virtual void HostAction(IEngineCallback engineCallback, LocalNodeProvider nodeProvider, int nodeId) - { - ErrorUtilities.VerifyThrow(false, "This description doesn't support this operation"); - } - - /// - /// Appropriate action to take if this event is received on the child process - /// - internal virtual void NodeAction(Node node, LocalNode localNode) - { - ErrorUtilities.VerifyThrow(false, "This description doesn't support this operation"); - } - - /// - /// This method constructs a reply to the node if appropriate - /// - /// The call descriptor to be sent back to the node - internal virtual LocalReplyCallDescriptor ReplyFromHostAction() - { - ErrorUtilities.VerifyThrow(false, "This description doesn't support this operation"); - return null; - } - - internal virtual object GetReplyData() - { - ErrorUtilities.VerifyThrow(false, "This description doesn't support this operation"); - return null; - } - #endregion - - #region Data - private int callNumber; - protected LocalCallType callType; - // A counter used to provide unique Id's to all calls, is not serialized as it is static - private static int lastUsedCallNumber = 0; - #endregion - - #region CustomSerializationToStream - internal virtual void WriteToStream(BinaryWriter writer) - { - writer.Write((byte)callType); - writer.Write((Int32)callNumber); - } - - internal virtual void CreateFromStream(BinaryReader reader) - { - callType = (LocalCallType)reader.ReadByte(); - callNumber = reader.ReadInt32(); - } - #endregion - } - - #region Wrapper for LocalReplyCallDescriptor - internal class LocalReplyCallDescriptor : LocalCallDescriptor - { - #region Constructors - internal LocalReplyCallDescriptor() - { - //Do Nothing - } - - internal LocalReplyCallDescriptor(int requestingCallNumber, object replyData) - : base(LocalCallType.GenericSingleObjectReply) - { - this.requestingCallNumber = requestingCallNumber; - this.replyData = replyData; - } - #endregion - - #region Properties - internal override bool IsReply - { - get - { - return true; - } - } - - internal virtual int RequestingCallNumber - { - get - { - return requestingCallNumber; - } - } - - internal object ReplyData - { - get - { - return replyData; - } - } - #endregion - - #region Methods - internal override void NodeAction(Node node, LocalNode localNode) - { - // No node action here, we do our thing in GetReplyData - } - - internal override object GetReplyData() - { - return this.replyData; - } - #endregion - - #region Data - private int requestingCallNumber; - private object replyData; - private static BinaryFormatter formatter = new BinaryFormatter(); - #endregion - - #region CustomSerializationToStream - internal override void WriteToStream(BinaryWriter writer) - { - base.WriteToStream(writer); - writer.Write((Int32)requestingCallNumber); - if (replyData == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - - if (replyData is CacheEntry[]) - { - writer.Write((byte)0); - CacheEntry[] cacheArray = (CacheEntry[])replyData; - writer.Write((Int32)cacheArray.Length); - for (int i = 0; i < cacheArray.Length; i++) - { - if (cacheArray[i] == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - CacheEntryCustomSerializer.WriteToStream(cacheArray[i], writer); - } - } - } - else - { - writer.Write((byte)1); - formatter.Serialize(writer.BaseStream, replyData); - } - } - } - - internal override void CreateFromStream(BinaryReader reader) - { - base.CreateFromStream(reader); - requestingCallNumber = reader.ReadInt32(); - - if (reader.ReadByte() == 0) - { - replyData = null; - } - else - { - if (reader.ReadByte() == 0) - { - int numberOfEntries = reader.ReadInt32(); - CacheEntry[] cacheArray = new CacheEntry[numberOfEntries]; - - for (int i = 0; i < numberOfEntries; i++) - { - if (reader.ReadByte() == 0) - { - cacheArray[i] = null; - } - else - { - cacheArray[i] = CacheEntryCustomSerializer.CreateFromStream(reader); - } - } - replyData = cacheArray; - } - else - { - // codeql[cs/dangerous-binary-deserialization] BinaryFormatter is still present due to the skip-release deprecation requirement of Visual Studio. Removal has been scheduled for Oct 2024 in conjunction with VS 17.3 branching. - replyData = formatter.Deserialize(reader.BaseStream); - } - } - } - #endregion - } - #endregion - - #region Wrapper for PostBuildRequests - internal class LocalCallDescriptorForPostBuildRequests : LocalCallDescriptor - { - #region Constructors - internal LocalCallDescriptorForPostBuildRequests() - { - } - - internal LocalCallDescriptorForPostBuildRequests(BuildRequest[] buildRequests) - : base(LocalCallType.PostBuildRequests) - { - this.buildRequests = buildRequests; - } - - internal LocalCallDescriptorForPostBuildRequests(BuildRequest buildRequest) - : base(LocalCallType.PostBuildRequests) - { - this.buildRequests = new BuildRequest[1]; - this.buildRequests[0] = buildRequest; - } - - #endregion - - #region Methods - internal override void HostAction(IEngineCallback engineCallback, LocalNodeProvider nodeProvider, int nodeId) - { - engineCallback.PostBuildRequestsToHost(buildRequests); - } - - /// - /// Appropriate action to take if this event is received on the child process - /// - internal override void NodeAction(Node node, LocalNode localNode) - { - for (int i = 0; i < buildRequests.Length; i++) - { - node.PostBuildRequest(buildRequests[i]); - } - } - #endregion - - #region Data - private BuildRequest[] buildRequests; - #endregion - - // For testing - #region Properties - internal BuildRequest[] BuildRequests - { - get - { - return buildRequests; - } - } - #endregion - - #region CustomSerializationToStream - internal override void WriteToStream(BinaryWriter writer) - { - ErrorUtilities.VerifyThrow(buildRequests != null, "buildRequests should not be null"); - base.WriteToStream(writer); - writer.Write(buildRequests.Length); - foreach (BuildRequest request in buildRequests) - { - request.WriteToStream(writer); - } - } - - internal override void CreateFromStream(BinaryReader reader) - { - base.CreateFromStream(reader); - int numberOfBuildRequests = reader.ReadInt32(); - buildRequests = new BuildRequest[numberOfBuildRequests]; - for (int i = 0; i < numberOfBuildRequests; i++) - { - buildRequests[i] = BuildRequest.CreateFromStream(reader); - } - } - #endregion - } - #endregion - - #region Wrapper for PostBuildResult - internal class LocalCallDescriptorForPostBuildResult : LocalCallDescriptor - { - #region Constructors - - internal LocalCallDescriptorForPostBuildResult() - { - } - - internal LocalCallDescriptorForPostBuildResult(BuildResult buildResult) - : base(LocalCallType.PostBuildResult) - { - this.buildResult = buildResult; - } - - #endregion - - #region Methods - internal override void HostAction(IEngineCallback engineCallback, LocalNodeProvider nodeProvider, int nodeId) - { - engineCallback.PostBuildResultToHost(buildResult); - } - - /// - /// Appropriate action to take if this event is received on the child process - /// - internal override void NodeAction(Node node, LocalNode localNode) - { - node.PostBuildResult(buildResult); - } - #endregion - - #region Data - private BuildResult buildResult; - #endregion - - // For testing - #region Properties - internal BuildResult ResultOfBuild - { - get - { - return buildResult; - } - } - #endregion - - #region CustomSerializationToStream - internal override void WriteToStream(BinaryWriter writer) - { - ErrorUtilities.VerifyThrow(buildResult != null, "buildResult should not be null"); - base.WriteToStream(writer); - buildResult.WriteToStream(writer); - } - - internal override void CreateFromStream(BinaryReader reader) - { - base.CreateFromStream(reader); - buildResult = BuildResult.CreateFromStream(reader); - } - #endregion - } - #endregion - - #region Wrapper for PostLoggingMessagesToHost - internal class LocalCallDescriptorForPostLoggingMessagesToHost : LocalCallDescriptor - { - #region Constructors - internal LocalCallDescriptorForPostLoggingMessagesToHost() - { - } - - internal LocalCallDescriptorForPostLoggingMessagesToHost(NodeLoggingEvent[] buildEvents) - : base(LocalCallType.PostLoggingMessagesToHost) - { - this.buildEvents = buildEvents; - } - #endregion - - #region Methods - internal override void HostAction(IEngineCallback engineCallback, LocalNodeProvider nodeProvider, int nodeId) - { - engineCallback.PostLoggingMessagesToHost(nodeId, buildEvents); - } - #endregion - - #region Data - private NodeLoggingEvent[] buildEvents; - #endregion - - // For testing - #region Properties - internal NodeLoggingEvent[] BuildEvents - { - get - { - return buildEvents; - } - } - #endregion - - #region CustomSerializationToStream - internal void WriteToStream(BinaryWriter writer, Hashtable loggingTypeCache) - { - ErrorUtilities.VerifyThrow(buildEvents != null, "buildRequests should not be null"); - base.WriteToStream(writer); - - writer.Write((Int32)buildEvents.Length); - foreach (NodeLoggingEvent nodeEvent in buildEvents) - { - if (nodeEvent.GetType() == typeof(NodeLoggingEvent)) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - } - nodeEvent.WriteToStream(writer, loggingTypeCache); - } - } - - internal void CreateFromStream(BinaryReader reader, Hashtable loggingTypeCache) - { - base.CreateFromStream(reader); - - int numberOfNodeEvents = reader.ReadInt32(); - buildEvents = new NodeLoggingEvent[numberOfNodeEvents]; - - for (int i = 0; i < numberOfNodeEvents; i++) - { - NodeLoggingEvent e; - if (reader.ReadByte() == 0) - { - e = new NodeLoggingEvent(); - } - else - { - e = new NodeLoggingEventWithLoggerId(); - } - e.CreateFromStream(reader, loggingTypeCache); - buildEvents[i] = e; - } - } - #endregion - - } - #endregion - - #region Wrapper for UpdateNodeSettings - internal class LocalCallDescriptorForUpdateNodeSettings : LocalCallDescriptor - { - #region Constructors - internal LocalCallDescriptorForUpdateNodeSettings() - { - } - - internal LocalCallDescriptorForUpdateNodeSettings - ( - bool enableLogOnlyCriticalEvents, - bool enableCentralizedLogging, - bool useBreadthFirstTraversal - ) - : base(LocalCallType.UpdateNodeSettings) - { - this.logOnlyCriticalEvents = enableLogOnlyCriticalEvents; - this.centralizedLogging = enableCentralizedLogging; - this.useBreadthFirstTraversal = useBreadthFirstTraversal; - } - #endregion - - #region Methods - /// - /// UNDONE - need to verified after logging spec - /// - internal override void NodeAction(Node node, LocalNode localNode) - { - ErrorUtilities.VerifyThrowArgumentNull(node, "node is null"); - node.UpdateNodeSettings(logOnlyCriticalEvents, centralizedLogging, useBreadthFirstTraversal); - } - #endregion - - #region Data - private bool logOnlyCriticalEvents; - private bool centralizedLogging; - private bool useBreadthFirstTraversal; - #endregion - - // For testing - #region Properties - internal bool LogOnlyCriticalEvents - { - get - { - return logOnlyCriticalEvents; - } - } - - internal bool CentralizedLogging - { - get - { - return centralizedLogging; - } - } - - internal bool UseBreadthFirstTraversal - { - get - { - return useBreadthFirstTraversal; - } - } - #endregion - - #region CustomSerializationToStream - internal override void WriteToStream(BinaryWriter writer) - { - base.WriteToStream(writer); - writer.Write(logOnlyCriticalEvents); - writer.Write(centralizedLogging); - writer.Write(useBreadthFirstTraversal); - } - - internal override void CreateFromStream(BinaryReader reader) - { - base.CreateFromStream(reader); - logOnlyCriticalEvents = reader.ReadBoolean(); - centralizedLogging = reader.ReadBoolean(); - useBreadthFirstTraversal = reader.ReadBoolean(); - } - #endregion - - } - #endregion - - #region Wrapper for ShutdownNode - internal class LocalCallDescriptorForShutdownNode : LocalCallDescriptor - { - #region Constructors - internal LocalCallDescriptorForShutdownNode() - { - } - - internal LocalCallDescriptorForShutdownNode(Node.NodeShutdownLevel shutdownLevel, bool exitProcess) - : base(LocalCallType.ShutdownNode) - { - this.exitProcess = exitProcess; - this.shutdownLevel = shutdownLevel; - } - #endregion - - #region Methods - internal override void NodeAction(Node node, LocalNode localNode) - { - localNode.ShutdownNode(shutdownLevel, exitProcess, false); - } - #endregion - - #region Data - private bool exitProcess; - private Node.NodeShutdownLevel shutdownLevel; - #endregion - - // For testing - #region Properties - internal bool ExitProcess - { - get - { - return exitProcess; - } - } - - internal Node.NodeShutdownLevel ShutdownLevel - { - get - { - return shutdownLevel; - } - } - #endregion - - #region CustomSerializationToStream - internal override void WriteToStream(BinaryWriter writer) - { - base.WriteToStream(writer); - writer.Write(exitProcess); - writer.Write((Int32)shutdownLevel); - } - - internal override void CreateFromStream(BinaryReader reader) - { - base.CreateFromStream(reader); - exitProcess = reader.ReadBoolean(); - shutdownLevel = (Node.NodeShutdownLevel)reader.ReadInt32(); - } - #endregion - } - #endregion - - #region Wrapper for ShutdownComplete - internal class LocalCallDescriptorForShutdownComplete : LocalCallDescriptor - { - #region Constructors - internal LocalCallDescriptorForShutdownComplete() - { - } - - internal LocalCallDescriptorForShutdownComplete(Node.NodeShutdownLevel shutdownLevel, int totalTaskTime) - : base(LocalCallType.ShutdownComplete) - { - this.shutdownLevel = shutdownLevel; - this.totalTaskTime = totalTaskTime; - } - #endregion - - #region Methods - internal override void HostAction(IEngineCallback engineCallback, LocalNodeProvider nodeProvider, int nodeId) - { - nodeProvider.RecordNodeResponse(nodeId, shutdownLevel, totalTaskTime); - } - #endregion - - #region Data - private Node.NodeShutdownLevel shutdownLevel; - private int totalTaskTime; - #endregion - - // For testing - #region Properties - internal Node.NodeShutdownLevel ShutdownLevel - { - get - { - return shutdownLevel; - } - } - #endregion - - - #region CustomSerializationToStream - internal override void WriteToStream(BinaryWriter writer) - { - base.WriteToStream(writer); - writer.Write((Int32)shutdownLevel); - writer.Write((Int32)totalTaskTime); - } - - internal override void CreateFromStream(BinaryReader reader) - { - base.CreateFromStream(reader); - shutdownLevel = (Node.NodeShutdownLevel)reader.ReadInt32(); - totalTaskTime = reader.ReadInt32(); - } - #endregion - } - #endregion - - #region Wrapper for InitializeNode - /// - /// This class wraps a call to initialize a local node by passing it a new environment and an - /// nodeid so that it can instantiate a node class. - /// - internal class LocalCallDescriptorForInitializeNode : LocalCallDescriptor - { - #region Constructors - internal LocalCallDescriptorForInitializeNode() - { - } - - internal LocalCallDescriptorForInitializeNode - ( - Hashtable environmentVariablesToSend, - LoggerDescription[] nodeLoggers, - int nodeId, - BuildPropertyGroup parentGlobalProperties, - ToolsetDefinitionLocations toolsetSearchLocations, - int parentProcessId, - string parentStartupDirectory - ) - : base(LocalCallType.InitializeNode) - { - this.environmentVariables = environmentVariablesToSend; - this.parentGlobalProperties = parentGlobalProperties; - this.toolsetSearchLocations = toolsetSearchLocations; - this.nodeLoggers = nodeLoggers; - this.nodeId = nodeId; - this.parentProcessId = parentProcessId; - this.parentStartupDirectory = parentStartupDirectory; - } - #endregion - - #region Methods - internal override void NodeAction(Node node, LocalNode localNode) - { - localNode.Activate(environmentVariables, nodeLoggers, nodeId, parentGlobalProperties, - toolsetSearchLocations, parentProcessId, parentStartupDirectory); - } - #endregion - - #region Data - private Hashtable environmentVariables; - private LoggerDescription[] nodeLoggers; - private int nodeId; - private BuildPropertyGroup parentGlobalProperties; - private ToolsetDefinitionLocations toolsetSearchLocations; - private int parentProcessId; - private string parentStartupDirectory; - #endregion - - // For testing - #region Properties - internal Hashtable EnvironmentVariables - { - get - { - return environmentVariables; - } - } - internal LoggerDescription[] NodeLoggers - { - get - { - return nodeLoggers; - } - } - internal int NodeId - { - get - { - return nodeId; - } - } - internal BuildPropertyGroup ParentGlobalProperties - { - get - { - return parentGlobalProperties; - } - } - internal ToolsetDefinitionLocations ToolsetSearchLocations - { - get - { - return toolsetSearchLocations; - } - } - internal int ParentProcessId - { - get - { - return parentProcessId; - } - } - #endregion - - #region CustomSerializationToStream - internal override void WriteToStream(BinaryWriter writer) - { - base.WriteToStream(writer); - #region EnvironmentVariables - writer.Write((Int32)environmentVariables.Count); - foreach (string key in environmentVariables.Keys) - { - writer.Write(key); - writer.Write((string)environmentVariables[key]); - } - #endregion - #region NodeLoggers - if (nodeLoggers == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - writer.Write((Int32)nodeLoggers.Length); - for (int i = 0; i < nodeLoggers.Length; i++) - { - nodeLoggers[i].WriteToStream(writer); - } - } - #endregion - writer.Write((Int32)nodeId); - writer.Write((Int32)parentProcessId); - #region ParentGlobalProperties - if (parentGlobalProperties == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - parentGlobalProperties.WriteToStream(writer); - } - #endregion - writer.Write((byte)toolsetSearchLocations); - writer.Write(parentStartupDirectory); - } - - internal override void CreateFromStream(BinaryReader reader) - { - base.CreateFromStream(reader); - #region EnvironmentVariables - int numberOfVariables = reader.ReadInt32(); - environmentVariables = new Hashtable(numberOfVariables); - for (int i = 0; i < numberOfVariables; i++) - { - string key = reader.ReadString(); - string variable = reader.ReadString(); - environmentVariables.Add(key, variable); - } - #endregion - #region NodeLoggers - if (reader.ReadByte() == 0) - { - nodeLoggers = null; - } - else - { - int numberOfLoggers = reader.ReadInt32(); - nodeLoggers = new LoggerDescription[numberOfLoggers]; - for (int i = 0; i < numberOfLoggers; i++) - { - LoggerDescription logger = new LoggerDescription(); - logger.CreateFromStream(reader); - nodeLoggers[i] = logger; - } - } - #endregion - nodeId = reader.ReadInt32(); - parentProcessId = reader.ReadInt32(); - #region ParentGlobalProperties - if (reader.ReadByte() == 0) - { - parentGlobalProperties = null; - } - else - { - parentGlobalProperties = new BuildPropertyGroup(); - parentGlobalProperties.CreateFromStream(reader); - } - #endregion - toolsetSearchLocations = (ToolsetDefinitionLocations)reader.ReadByte(); - parentStartupDirectory = (string)reader.ReadString(); - } - #endregion - } - #endregion - - #region Wrapper for InitializationComplete - internal class LocalCallDescriptorForInitializationComplete : LocalCallDescriptor - { - #region Constructors - internal LocalCallDescriptorForInitializationComplete() - { - } - - internal LocalCallDescriptorForInitializationComplete(int processId) - : base(LocalCallType.InitializationComplete) - { - this.processId = processId; - } - #endregion - - #region Methods - internal override void HostAction(IEngineCallback engineCallback, LocalNodeProvider nodeProvider, int nodeId) - { - nodeProvider.SetNodeProcessId(processId, nodeId); - } - #endregion - - #region Data - private int processId = 0; - #endregion - - //For Testing - #region Properties - internal int ProcessId - { - get - { - return processId; - } - } - #endregion - - #region CustomSerializationToStream - internal override void WriteToStream(BinaryWriter writer) - { - base.WriteToStream(writer); - writer.Write((Int32)processId); - } - - internal override void CreateFromStream(BinaryReader reader) - { - base.CreateFromStream(reader); - processId = reader.ReadInt32(); - } - #endregion - } - #endregion - - #region Wrapper for RequestStatus - internal class LocalCallDescriptorForRequestStatus : LocalCallDescriptor - { - #region Constructors - internal LocalCallDescriptorForRequestStatus() - { - } - - internal LocalCallDescriptorForRequestStatus(int requestId) - : base(LocalCallType.RequestStatus) - { - this.requestId = requestId; - } - #endregion - - #region Methods - internal override void NodeAction(Node node, LocalNode localNode) - { - node.RequestStatus(requestId); - } - #endregion - - #region Data - private int requestId = 0; - #endregion - - // For testing - #region Properties - internal int RequestId - { - get - { - return requestId; - } - } - #endregion - - #region CustomSerializationToStream - internal override void WriteToStream(BinaryWriter writer) - { - base.WriteToStream(writer); - writer.Write((Int32)requestId); - } - - internal override void CreateFromStream(BinaryReader reader) - { - base.CreateFromStream(reader); - requestId = reader.ReadInt32(); - } - #endregion - } - #endregion - - #region Wrapper for PostStatus - internal class LocalCallDescriptorForPostStatus : LocalCallDescriptor - { - #region Constructors - internal LocalCallDescriptorForPostStatus() - { - } - - internal LocalCallDescriptorForPostStatus(NodeStatus nodeStatus) - : base(LocalCallType.PostStatus) - { - this.nodeStatus = nodeStatus; - } - #endregion - - #region Methods - internal override void HostAction(IEngineCallback engineCallback, LocalNodeProvider nodeProvider, int nodeId) - { - engineCallback.PostStatus(nodeId, nodeStatus, false); - } - #endregion - - #region Data - private NodeStatus nodeStatus; - #endregion - - // For testing - #region Properties - internal NodeStatus StatusOfNode - { - get - { - return nodeStatus; - } - } - #endregion - - #region CustomSerializationToStream - internal override void WriteToStream(BinaryWriter writer) - { - base.WriteToStream(writer); - if (nodeStatus == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - nodeStatus.WriteToStream(writer); - } - } - - internal override void CreateFromStream(BinaryReader reader) - { - base.CreateFromStream(reader); - if (reader.ReadByte() == 0) - { - nodeStatus = null; - } - else - { - nodeStatus = NodeStatus.CreateFromStream(reader); - } - } - #endregion - } - #endregion - - #region Wrapper for PostIntrospectorCommand - internal class LocalCallDescriptorForPostIntrospectorCommand : LocalCallDescriptor - { - #region Constructors - internal LocalCallDescriptorForPostIntrospectorCommand(TargetInProgessState child, TargetInProgessState parent) - : base(LocalCallType.PostIntrospectorCommand) - { - this.child = child; - this.parent = parent; - } - #endregion - - #region Methods - internal override void NodeAction(Node node, LocalNode localNode) - { - node.Introspector.BreakCycle(child, parent); - } - #endregion - - #region Data - private TargetInProgessState child; - private TargetInProgessState parent; - #endregion - - #region CustomSerializationToStream - internal override void WriteToStream(BinaryWriter writer) - { - base.WriteToStream(writer); - child.WriteToStream(writer); - parent.WriteToStream(writer); - } - - internal override void CreateFromStream(BinaryReader reader) - { - base.CreateFromStream(reader); - child = new TargetInProgessState(); - child.CreateFromStream(reader); - parent = new TargetInProgessState(); - parent.CreateFromStream(reader); - } - #endregion - } - #endregion - - #region Wrapper for PostCacheEntriesToHost - internal class LocalCallDescriptorForPostingCacheEntriesToHost : LocalCallDescriptor - { - #region Constructors - internal LocalCallDescriptorForPostingCacheEntriesToHost() - { - } - - internal LocalCallDescriptorForPostingCacheEntriesToHost(CacheEntry[] entries, string scopeName, BuildPropertyGroup scopeProperties, string scopeToolsVersion, CacheContentType cacheContentType) - : base(LocalCallType.PostCacheEntriesToHost) - { - this.entries = entries; - this.scopeName = scopeName; - this.scopeProperties = scopeProperties; - this.scopeToolsVersion = scopeToolsVersion; - this.cacheContentType = cacheContentType; - this.exception = null; - } - #endregion - - // For testing - #region Properties - internal override bool NeedsReply - { - get - { - return true; - } - } - - internal CacheEntry[] Entries - { - get - { - return entries; - } - } - internal string ScopeName - { - get - { - return scopeName; - } - } - internal CacheContentType ContentType - { - get - { - return cacheContentType; - } - } - internal BuildPropertyGroup ScopeProperties - { - get - { - return scopeProperties; - } - } - internal string ScopeToolsVersion - { - get - { - return scopeToolsVersion; - } - } - #endregion - - #region Methods - internal override void HostAction(IEngineCallback engineCallback, LocalNodeProvider nodeProvider, int nodeId) - { - exception = engineCallback.PostCacheEntriesToHost(nodeId, this.entries, this.scopeName, this.scopeProperties, this.scopeToolsVersion, this.cacheContentType); - } - - internal override LocalReplyCallDescriptor ReplyFromHostAction() - { - return new LocalReplyCallDescriptor(this.CallNumber, this.exception); - } - #endregion - - #region Data - private CacheEntry[] entries; - private string scopeName; - private string scopeToolsVersion; - private BuildPropertyGroup scopeProperties; - private CacheContentType cacheContentType; - private Exception exception; - #endregion - - #region CustomSerializationToStream - internal override void WriteToStream(BinaryWriter writer) - { - base.WriteToStream(writer); - #region Entries - if (entries == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - writer.Write((Int32)entries.Length); - for (int i = 0; i < entries.Length; i++) - { - CacheEntryCustomSerializer.WriteToStream(entries[i], writer); - } - } - #endregion - #region ScopeName - if (scopeName == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - writer.Write(scopeName); - } - #endregion - #region ScopeProperties - if (scopeProperties == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - scopeProperties.WriteToStream(writer); - } - #endregion - #region ScopeToolsVersion - if (scopeToolsVersion == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - writer.Write(scopeToolsVersion); - } - #endregion - writer.Write((byte)cacheContentType); - } - - internal override void CreateFromStream(BinaryReader reader) - { - base.CreateFromStream(reader); - #region Entries - if (reader.ReadByte() == 0) - { - entries = null; - } - else - { - int numberOfEntries = reader.ReadInt32(); - entries = new CacheEntry[numberOfEntries]; - for (int i = 0; i < entries.Length; i++) - { - entries[i] = CacheEntryCustomSerializer.CreateFromStream(reader); - } - } - #endregion - #region ScopeName - if (reader.ReadByte() == 0) - { - scopeName = null; - } - else - { - scopeName = reader.ReadString(); - } - #endregion - #region ScopeProperties - if (reader.ReadByte() == 0) - { - scopeProperties = null; - } - else - { - scopeProperties = new BuildPropertyGroup(); - scopeProperties.CreateFromStream(reader); - } - #endregion - #region ScopeToolsVersion - if (reader.ReadByte() == 0) - { - scopeToolsVersion = null; - } - else - { - scopeToolsVersion = reader.ReadString(); - } - #endregion - cacheContentType = (CacheContentType)reader.ReadByte(); - } - #endregion - } - #endregion - - #region Wrapper for GetCacheEntriesFromHost - internal class LocalCallDescriptorForGettingCacheEntriesFromHost : LocalCallDescriptor - { - #region Constructors - internal LocalCallDescriptorForGettingCacheEntriesFromHost() - { - } - - internal LocalCallDescriptorForGettingCacheEntriesFromHost(string[] names, string scopeName, BuildPropertyGroup scopeProperties, string scopeToolsVersion, CacheContentType cacheContentType) - : base(LocalCallType.GetCacheEntriesFromHost) - { - this.names = names; - this.scopeName = scopeName; - this.scopeProperties = scopeProperties; - this.scopeToolsVersion = scopeToolsVersion; - this.cacheContentType = cacheContentType; - } - #endregion - - // For testing - #region Properties - internal override bool NeedsReply - { - get - { - return true; - } - } - internal string[] Names - { - get - { - return names; - } - } - internal string ScopeName - { - get - { - return scopeName; - } - } - - internal BuildPropertyGroup ScopeProperties - { - get - { - return scopeProperties; - } - } - - internal CacheContentType ContentType - { - get - { - return cacheContentType; - } - } - - internal string ScopeToolsVersion - { - get - { - return scopeToolsVersion; - } - } - - #endregion - - #region Methods - internal override void HostAction(IEngineCallback engineCallback, LocalNodeProvider nodeProvider, int nodeId) - { - entries = engineCallback.GetCachedEntriesFromHost(nodeId, this.names, this.scopeName, this.scopeProperties, this.scopeToolsVersion, this.cacheContentType); - } - - internal override LocalReplyCallDescriptor ReplyFromHostAction() - { - return new LocalReplyCallDescriptor(this.CallNumber, this.entries); - } - #endregion - - #region Data - private string[] names; - private string scopeName; - private string scopeToolsVersion; - private BuildPropertyGroup scopeProperties; - private CacheContentType cacheContentType; - // The actual reply value is only serialized in the reply call descriptor, no need to serialize it here. - private CacheEntry[] entries; - #endregion - - #region CustomSerializationToStream - internal override void WriteToStream(BinaryWriter writer) - { - base.WriteToStream(writer); - #region Names - if (names == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - writer.Write((Int32)names.Length); - for (int i = 0; i < names.Length; i++) - { - if (names[i] == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - writer.Write(names[i]); - } - } - } - #endregion - #region ScopeName - if (scopeName == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - writer.Write(scopeName); - } - #endregion - #region ScopeProperties - if (scopeProperties == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - scopeProperties.WriteToStream(writer); - } - #endregion - #region ScopeToolsVersion - if (scopeToolsVersion == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - writer.Write(scopeToolsVersion); - } - #endregion - writer.Write((byte)cacheContentType); - } - internal override void CreateFromStream(BinaryReader reader) - { - base.CreateFromStream(reader); - #region Names - if (reader.ReadByte() == 0) - { - names = null; - } - else - { - int numberOfEntries = reader.ReadInt32(); - names = new string[numberOfEntries]; - for (int i = 0; i < names.Length; i++) - { - if (reader.ReadByte() != 0) - { - names[i] = reader.ReadString(); - } - else - { - names[i] = null; - } - } - } - #endregion - #region ScopeName - if (reader.ReadByte() == 0) - { - scopeName = null; - } - else - { - scopeName = reader.ReadString(); - } - #endregion - #region ScopeProperties - if (reader.ReadByte() == 0) - { - scopeProperties = null; - } - else - { - scopeProperties = new BuildPropertyGroup(); - scopeProperties.CreateFromStream(reader); - } - #endregion - #region ScopeToolsVersion - if (reader.ReadByte() == 0) - { - scopeToolsVersion = null; - } - else - { - scopeToolsVersion = reader.ReadString(); - } - #endregion - cacheContentType = (CacheContentType)reader.ReadByte(); - } - #endregion - - } - #endregion - - #region Enums - - /// - /// This enum describes the call types used in the local node provider - /// - internal enum LocalCallType - { - /// - /// This call type corresponds to an array of build requests - /// - PostBuildRequests = 0, - /// - /// This call type corresponds to a single build result - /// - PostBuildResult = 1, - /// - /// This call type corresponds to an array of messages - /// from which messages originated - /// - PostLoggingMessagesToHost = 2, - /// - /// Call type to update the settings one the node - /// - UpdateNodeSettings = 3, - /// - /// Call type for request status from the node - /// - RequestStatus = 4, - /// - /// Call type for request status from the node - /// - PostStatus = 5, - /// - /// Call type for initializing the node - /// - InitializeNode = 6, - /// - /// Call type for the node to indicate that it has initialized successfully - /// - InitializationComplete = 7, - /// - /// Call type for shutting down the node - /// - ShutdownNode = 8, - /// - /// Call type for the node to indicate that it has shutdown - /// - ShutdownComplete = 9, - /// - /// Call type to post an introspector command - /// - PostIntrospectorCommand = 10, - /// - /// This call type corresponds to a single string send from parent to child - /// - GenericSingleObjectReply = 11, - /// - /// Call type for posting cache entries to a node - /// - PostCacheEntriesToHost = 12, - /// - /// Call type for retrieving cache entries from a node - /// - GetCacheEntriesFromHost = 13 - } - #endregion -} diff --git a/src/Deprecated/Engine/LocalProvider/LocalNode.cs b/src/Deprecated/Engine/LocalProvider/LocalNode.cs deleted file mode 100644 index e484ce02acd..00000000000 --- a/src/Deprecated/Engine/LocalProvider/LocalNode.cs +++ /dev/null @@ -1,682 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections; -using System.Diagnostics; -using System.IO; -using System.Security.AccessControl; -using System.Threading; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// This class hosts a node class in the child process. It uses shared memory to communicate - /// with the local node provider. - /// Wraps a Node. - /// - /// - /// [!WARNING] - /// > This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public class LocalNode - { - #region Static Constructors - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Hook up an unhandled exception handler, in case our error handling paths are leaky - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - static LocalNode() - { - AppDomain currentDomain = AppDomain.CurrentDomain; - currentDomain.UnhandledException += UnhandledExceptionHandler; - } - #endregion - - #region Static Methods - - /// - /// Dump any unhandled exceptions to a file so they can be diagnosed - /// - private static void UnhandledExceptionHandler(object sender, UnhandledExceptionEventArgs e) - { - Exception ex = (Exception)e.ExceptionObject; - DumpExceptionToFile(ex); - } - - /// - /// Dump the exception information to a file - /// - internal static void DumpExceptionToFile(Exception ex) - { - // Lock as multiple threads may throw simultaneously - lock (dumpFileLocker) - { - if (dumpFileName == null) - { - Guid guid = Guid.NewGuid(); - string tempPath = Path.GetTempPath(); - - // For some reason we get Watson buckets because GetTempPath gives us a folder here that doesn't exist. - // Either because %TMP% is misdefined, or because they deleted the temp folder during the build. - if (!Directory.Exists(tempPath)) - { - // If this throws, no sense catching it, we can't log it now, and we're here - // because we're a child node with no console to log to, so die - Directory.CreateDirectory(tempPath); - } - - dumpFileName = Path.Combine(tempPath, "MSBuild_" + guid.ToString()); - - using (StreamWriter writer = new StreamWriter(dumpFileName, true /*append*/)) - { - writer.WriteLine("UNHANDLED EXCEPTIONS FROM CHILD NODE:"); - writer.WriteLine("==================="); - } - } - - using (StreamWriter writer = new StreamWriter(dumpFileName, true /*append*/)) - { - writer.WriteLine(DateTime.Now.ToLongTimeString()); - writer.WriteLine(ex.ToString()); - writer.WriteLine("==================="); - } - } - } - - #endregion - - #region Constructors - - /// - /// Creates an instance of this class. - /// - internal LocalNode(int nodeNumberIn) - { - this.nodeNumber = nodeNumberIn; - - engineCallback = new LocalNodeCallback(communicationThreadExitEvent, this); - } - - #endregion - - #region Communication Methods - - /// - /// This method causes the reader and writer threads to start and create the shared memory structures - /// - private void StartCommunicationThreads() - { - // The writer thread should be created before the - // reader thread because some LocalCallDescriptors - // assume the shared memory for the writer thread - // has already been created. The method will both - // instantiate the shared memory for the writer - // thread and also start the writer thread itself. - // We will verifyThrow in the method if the - // sharedMemory was not created correctly. - engineCallback.StartWriterThread(nodeNumber); - - // Create the shared memory buffer - this.sharedMemory = - new SharedMemory - ( - // Generate the name for the shared memory region - LocalNodeProviderGlobalNames.NodeInputMemoryName(nodeNumber), - SharedMemoryType.ReadOnly, - // Reuse an existing shared memory region as it should have already - // been created by the parent node side - true - ); - - ErrorUtilities.VerifyThrow(this.sharedMemory.IsUsable, - "Failed to create shared memory for local node input."); - - // Start the thread that will be processing the calls from the parent engine - ThreadStart threadState = new ThreadStart(this.SharedMemoryReaderThread); - readerThread = new Thread(threadState); - readerThread.Name = "MSBuild Child<-Parent Reader"; - readerThread.Start(); - } - - /// - /// This method causes the reader and writer threads to exit and dispose of the shared memory structures - /// - private void StopCommunicationThreads() - { - communicationThreadExitEvent.Set(); - - // Wait for communication threads to exit - Thread writerThread = engineCallback.GetWriterThread(); - // The threads may not exist if the child has timed out before the parent has told the node - // to start up its communication threads. This can happen if the node is started with /nodemode:x - // and no parent is running, or if the parent node has spawned a new process and then crashed - // before establishing communication with the child node. - writerThread?.Join(); - - readerThread?.Join(); - - // Make sure the exit event is not set - communicationThreadExitEvent.Reset(); - } - - #endregion - - #region Startup Methods - - /// - /// Create global events necessary for handshaking with the parent - /// - /// - /// True if events created successfully and false otherwise - private static bool CreateGlobalEvents(int nodeNumber) - { - bool createdNew; - if (NativeMethods.IsUserAdministrator()) - { - EventWaitHandleSecurity mSec = new EventWaitHandleSecurity(); - - // Add a rule that grants the access only to admins and systems - mSec.SetSecurityDescriptorSddlForm(NativeMethods.ADMINONLYSDDL); - - // Create an initiation event to allow the parent side to prove to the child that we have the same level of privilege as it does. - // this is done by having the parent set this event which means it needs to have administrative permissions to do so. - globalInitiateActivationEvent = new EventWaitHandle(false, EventResetMode.ManualReset, LocalNodeProviderGlobalNames.NodeInitiateActivationEventName(nodeNumber), out createdNew, mSec); - } - else - { - // Create an initiation event to allow the parent side to prove to the child that we have the same level of privilege as it does. - // this is done by having the parent set this event which means it has atleast the same permissions as the child process - globalInitiateActivationEvent = new EventWaitHandle(false, EventResetMode.ManualReset, LocalNodeProviderGlobalNames.NodeInitiateActivationEventName(nodeNumber), out createdNew); - } - - // This process must be the creator of the event to prevent squating by a lower privilaged attacker - if (!createdNew) - { - return false; - } - - // Informs the parent process that the child process has been created. - globalNodeActive = new EventWaitHandle(false, EventResetMode.ManualReset, LocalNodeProviderGlobalNames.NodeActiveEventName(nodeNumber)); - globalNodeActive.Set(); - - // Indicate to the parent process, this node is currently is ready to start to recieve requests - globalNodeInUse = new EventWaitHandle(false, EventResetMode.ManualReset, LocalNodeProviderGlobalNames.NodeInUseEventName(nodeNumber)); - - // Used by the parent process to inform the child process to shutdown due to the child process - // not recieving the initialization command. - globalNodeErrorShutdown = new EventWaitHandle(false, EventResetMode.ManualReset, LocalNodeProviderGlobalNames.NodeErrorShutdownEventName(nodeNumber)); - - // Inform the parent process the node has started its communication threads. - globalNodeActivate = new EventWaitHandle(false, EventResetMode.ManualReset, LocalNodeProviderGlobalNames.NodeActivedEventName(nodeNumber)); - - return true; - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// This function starts local node when process is launched and shuts it down on time out - /// Called by msbuild.exe. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - [System.Diagnostics.CodeAnalysis.SuppressMessage("Reliability", "CA2000:Dispose objects before losing scope", Justification = "Agreed not to touch entries from Deprecated folder")] - public static void StartLocalNodeServer(int nodeNumber) - { - // Create global events necessary for handshaking with the parent - if (!CreateGlobalEvents(nodeNumber)) - { - return; - } - - LocalNode localNode = new LocalNode(nodeNumber); - - WaitHandle[] waitHandles = new WaitHandle[4]; - waitHandles[0] = shutdownEvent; - waitHandles[1] = globalNodeErrorShutdown; - waitHandles[2] = inUseEvent; - waitHandles[3] = globalInitiateActivationEvent; - - // This is necessary to make build.exe finish promptly. Dont remove. - if (!Engine.debugMode) - { - // Create null streams for the current input/output/error streams - Console.SetOut(new StreamWriter(Stream.Null)); - Console.SetError(new StreamWriter(Stream.Null)); - Console.SetIn(new StreamReader(Stream.Null)); - } - - bool continueRunning = true; - - while (continueRunning) - { - int eventType = WaitHandle.WaitAny(waitHandles, inactivityTimeout, false); - - if (eventType == 0 || eventType == 1 || eventType == WaitHandle.WaitTimeout) - { - continueRunning = false; - localNode.ShutdownNode(eventType != 1 ? - Node.NodeShutdownLevel.PoliteShutdown : - Node.NodeShutdownLevel.ErrorShutdown, true, true); - } - else if (eventType == 2) - { - // reset the event as we do not want it to go into this state again when we are done with this if statement. - inUseEvent.Reset(); - // The parent knows at this point the child process has been launched - globalNodeActivate.Reset(); - // Set the global inuse event so other parent processes know this node is now initialized - globalNodeInUse.Set(); - // Make a copy of the parents handle to protect ourselves in case the parent dies, - // this is to prevent a parent from reserving a node another parent is trying to use. - globalNodeReserveHandle = - new EventWaitHandle(false, EventResetMode.ManualReset, LocalNodeProviderGlobalNames.NodeReserveEventName(nodeNumber)); - WaitHandle[] waitHandlesActive = new WaitHandle[3]; - waitHandlesActive[0] = shutdownEvent; - waitHandlesActive[1] = globalNodeErrorShutdown; - waitHandlesActive[2] = notInUseEvent; - - eventType = WaitHandle.WaitTimeout; - while (eventType == WaitHandle.WaitTimeout && continueRunning) - { - eventType = WaitHandle.WaitAny(waitHandlesActive, parentCheckInterval, false); - - if (eventType == 0 || /* nice shutdown due to shutdownEvent */ - eventType == 1 || /* error shutdown due to globalNodeErrorShutdown */ - (eventType == WaitHandle.WaitTimeout && !localNode.IsParentProcessAlive())) - { - continueRunning = false; - // If the exit is not triggered by running of shutdown method - if (eventType != 0) - { - localNode.ShutdownNode(Node.NodeShutdownLevel.ErrorShutdown, true, true); - } - } - else if (eventType == 2) - { - // Trigger a collection before the node goes idle to insure that - // the memory is released to the system as soon as possible - GC.Collect(); - // Change the current directory to a safe one so that the directory - // last used by the build can be safely deleted. We must have read - // access to the safe directory so use SystemDirectory for this purpose. - Directory.SetCurrentDirectory(Environment.SystemDirectory); - notInUseEvent.Reset(); - globalNodeInUse.Reset(); - } - } - - ErrorUtilities.VerifyThrow(localNode.node == null, - "Expected either node to be null or continueRunning to be false."); - - // Stop the communication threads and release the shared memory object so that the next parent can create it - localNode.StopCommunicationThreads(); - // Close the local copy of the reservation handle (this allows another parent to reserve - // the node) - globalNodeReserveHandle.Close(); - globalNodeReserveHandle = null; - } - else if (eventType == 3) - { - globalInitiateActivationEvent.Reset(); - localNode.StartCommunicationThreads(); - globalNodeActivate.Set(); - } - } - // Stop the communication threads and release the shared memory object so that the next parent can create it - localNode.StopCommunicationThreads(); - - globalNodeActive.Close(); - globalNodeInUse.Close(); - } - - #endregion - - #region Methods - - /// - /// This method is run in its own thread, it is responsible for reading messages sent from the parent process - /// through the shared memory region. - /// - private void SharedMemoryReaderThread() - { - // Create an array of event to the node thread responds - WaitHandle[] waitHandles = new WaitHandle[2]; - waitHandles[0] = communicationThreadExitEvent; - waitHandles[1] = sharedMemory.ReadFlag; - - bool continueExecution = true; - - try - { - while (continueExecution) - { - // Wait for the next work item or an exit command - int eventType = WaitHandle.WaitAny(waitHandles); - - if (eventType == 0) - { - // Exit node event - continueExecution = false; - } - else - { - // Read the list of LocalCallDescriptors from sharedMemory, - // this will be null if a large object is being read from shared - // memory and will continue to be null until the large object has - // been completly sent. - IList localCallDescriptorList = sharedMemory.Read(); - - if (localCallDescriptorList != null) - { - foreach (LocalCallDescriptor callDescriptor in localCallDescriptorList) - { - // Execute the command method which relates to running on a child node - callDescriptor.NodeAction(node, this); - - if ((callDescriptor.IsReply) && (callDescriptor is LocalReplyCallDescriptor)) - { - // Process the reply from the parent so it can be looked in a hashtable based - // on the call descriptor who requested the reply. - engineCallback.PostReplyFromParent((LocalReplyCallDescriptor)callDescriptor); - } - } - } - } - } - } - catch (Exception e) - { - // Will rethrow the exception if necessary - ReportFatalCommunicationError(e); - } - - // Dispose of the shared memory buffer - if (sharedMemory != null) - { - sharedMemory.Dispose(); - sharedMemory = null; - } - } - - /// - /// This method will shutdown the node being hosted by the child process and notify the parent process if requested, - /// - /// What kind of shutdown is causing the child node to shutdown - /// should the child process exit as part of the shutdown process - /// Indicates if the parent process should be notified the child node is being shutdown - internal void ShutdownNode(Node.NodeShutdownLevel shutdownLevel, bool exitProcess, bool noParentNotification) - { - if (node != null) - { - try - { - node.ShutdownNode(shutdownLevel); - - if (!noParentNotification) - { - // Write the last event out directly - LocalCallDescriptorForShutdownComplete callDescriptor = - - new LocalCallDescriptorForShutdownComplete(shutdownLevel, node.TotalTaskTime); - // Post the message indicating that the shutdown is complete - engineCallback.PostMessageToParent(callDescriptor, true); - } - } - catch (Exception e) - { - if (shutdownLevel != Node.NodeShutdownLevel.ErrorShutdown) - { - ReportNonFatalCommunicationError(e); - } - } - } - - // If the shutdownLevel is not a build complete message, then this means there was a politeshutdown or an error shutdown, null the node out - // as either it is no longer needed due to the node goign idle or there was a error and it is now in a bad state. - if (shutdownLevel != Node.NodeShutdownLevel.BuildCompleteSuccess && - shutdownLevel != Node.NodeShutdownLevel.BuildCompleteFailure) - { - node = null; - notInUseEvent.Set(); - } - - if (exitProcess) - { - // Even if we completed a build, if we are goign to exit the process we need to null out the node and set the notInUseEvent, this is - // accomplished by calling this method again with the ErrorShutdown handle - if (shutdownLevel == Node.NodeShutdownLevel.BuildCompleteSuccess || shutdownLevel == Node.NodeShutdownLevel.BuildCompleteFailure) - { - ShutdownNode(Node.NodeShutdownLevel.ErrorShutdown, false, true); - } - // Signal all the communication threads to exit - shutdownEvent.Set(); - } - } - - /// - /// This methods activates the local node - /// - internal void Activate - ( - Hashtable environmentVariables, - LoggerDescription[] nodeLoggers, - int nodeId, - BuildPropertyGroup parentGlobalProperties, - ToolsetDefinitionLocations toolsetSearchLocations, - int parentId, - string parentStartupDirectory - ) - { - ErrorUtilities.VerifyThrow(node == null, "Expected node to be null on activation."); - - this.parentProcessId = parentId; - - engineCallback.Reset(); - - inUseEvent.Set(); - - // Clear the environment so that we dont have extra variables laying around, this - // may be a performance hog but needs to be done - IDictionary variableDictionary = Environment.GetEnvironmentVariables(); - foreach (string variableName in variableDictionary.Keys) - { - Environment.SetEnvironmentVariable(variableName, null); - } - - foreach (string key in environmentVariables.Keys) - { - Environment.SetEnvironmentVariable(key, (string)environmentVariables[key]); - } - - // Host the msbuild engine and system - node = new Node(nodeId, nodeLoggers, engineCallback, parentGlobalProperties, toolsetSearchLocations, parentStartupDirectory); - - // Write the initialization complete event out directly - LocalCallDescriptorForInitializationComplete callDescriptor = - new LocalCallDescriptorForInitializationComplete(Process.GetCurrentProcess().Id); - - // Post the message indicating that the initialization is complete - engineCallback.PostMessageToParent(callDescriptor, true); - } - - /// - /// This method checks is the parent process has not exited - /// - /// True if the parent process is still alive - private bool IsParentProcessAlive() - { - bool isParentAlive = true; - try - { - // Check if the parent is still there - if (Process.GetProcessById(parentProcessId).HasExited) - { - isParentAlive = false; - } - } - catch (ArgumentException) - { - isParentAlive = false; - } - - if (!isParentAlive) - { - // No logging's going to reach the parent at this point: - // indicate on the console what's going on - string message = ResourceUtilities.FormatResourceString("ParentProcessUnexpectedlyDied", node.NodeId); - Console.WriteLine(message); - } - - return isParentAlive; - } - - /// - /// Any error occuring in the shared memory transport is considered to be fatal - /// - /// - /// Re-throws exception passed in - internal void ReportFatalCommunicationError(Exception originalException) - { - try - { - DumpExceptionToFile(originalException); - } - finally - { - node?.ReportFatalCommunicationError(originalException, null); - } - } - - /// - /// This function is used to report exceptions which don't indicate breakdown - /// of communication with the parent - /// - /// - internal void ReportNonFatalCommunicationError(Exception originalException) - { - if (node != null) - { - try - { - DumpExceptionToFile(originalException); - } - finally - { - node.ReportUnhandledError(originalException); - } - } - else - { - // Since there is no node object report rethrow the exception - ReportFatalCommunicationError(originalException); - } - } - - #endregion - #region Properties - internal static string DumpFileName - { - get - { - return dumpFileName; - } - } - #endregion - - #region Member data - - private Node node; - private SharedMemory sharedMemory; - private LocalNodeCallback engineCallback; - private int parentProcessId; - private int nodeNumber; - private Thread readerThread; - private static object dumpFileLocker = new Object(); - - // Public named events - // If this event is set the node host process is currently running - private static EventWaitHandle globalNodeActive; - // If this event is set the node is currently running a build - private static EventWaitHandle globalNodeInUse; - // If this event exists the node is reserved for use by a particular parent engine - // the node keeps a handle to this event during builds to prevent it from being used - // by another parent engine if the original dies - private static EventWaitHandle globalNodeReserveHandle; - // If this event is set the node will immediatelly exit. The event is used by the - // parent engine to cause the node to exit if communication is lost. - private static EventWaitHandle globalNodeErrorShutdown; - // This event is used to cause the child to create the shared memory structures to start communication - // with the parent - private static EventWaitHandle globalInitiateActivationEvent; - // This event is used to indicate to the parent that shared memory buffers have been created and are ready for - // use - private static EventWaitHandle globalNodeActivate; - // Private local events - private static ManualResetEvent communicationThreadExitEvent = new ManualResetEvent(false); - private static ManualResetEvent shutdownEvent = new ManualResetEvent(false); - private static ManualResetEvent notInUseEvent = new ManualResetEvent(false); - - /// - /// Indicates the node is now in use. This means the node has recieved an activate command with initialization - /// data from the parent procss - /// - private static ManualResetEvent inUseEvent = new ManualResetEvent(false); - - /// - /// Randomly generated file name for all exceptions thrown by this node that need to be dumped to a file. - /// (There may be more than one exception, if they occur on different threads.) - /// - private static string dumpFileName = null; - - // Timeouts && Constants - private const int inactivityTimeout = 60 * 1000; // 60 seconds of inactivity to exit - private const int parentCheckInterval = 5 * 1000; // Check if the parent process is there every 5 seconds - - #endregion - - } -} - diff --git a/src/Deprecated/Engine/LocalProvider/LocalNodeCallback.cs b/src/Deprecated/Engine/LocalProvider/LocalNodeCallback.cs deleted file mode 100644 index 3860eca2c77..00000000000 --- a/src/Deprecated/Engine/LocalProvider/LocalNodeCallback.cs +++ /dev/null @@ -1,358 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections; -using System.Threading; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class is an implementation of IEngineCallback which is used on the child nodes to receive calls from - /// the child to the parent. - /// - internal class LocalNodeCallback : IEngineCallback - { - /// - /// All the necessary data required for a reply to a call - /// - internal class ReplyData - { - // The call descriptor for the actual reply - internal LocalReplyCallDescriptor reply; - - // wait event on which the requesting thread waits and which should be set by the replying thread - internal ManualResetEvent waitEvent; - } - - #region Constructors - - /// - /// This class is an implementation of IEngineCallback which is used on the child nodes - /// - internal LocalNodeCallback(ManualResetEvent exitCommunicationThreads, LocalNode localNode) - { - this.localNode = localNode; - this.exitCommunicationThreads = exitCommunicationThreads; - - this.nodeCommandQueue = new DualQueue(); - this.nodeHiPriCommandQueue = new DualQueue(); - - // Initalize the reply infrastructur - this.repliesFromParent = new Hashtable(); - } - - internal void StartWriterThread(int nodeNumber) - { - this.writerThreadHasExited = false; - - this.sharedMemory = - new SharedMemory - ( - LocalNodeProviderGlobalNames.NodeOutputMemoryName(nodeNumber), - SharedMemoryType.WriteOnly, - true - ); - - ErrorUtilities.VerifyThrow(this.sharedMemory.IsUsable, - "Failed to create shared memory for engine callback."); - - // Start the thread that will be processing the calls to the parent engine - ThreadStart threadState = new ThreadStart(this.SharedMemoryWriterThread); - writerThread = new Thread(threadState); - writerThread.Name = "MSBuild Child->Parent Writer"; - writerThread.Start(); - } - - #endregion - - #region Methods - - /// - /// This method is used to post calls to the parent engine by the Localnode class - /// - internal void PostMessageToParent(LocalCallDescriptor callDescriptor, bool waitForCompletion) - { - nodeCommandQueue.Enqueue(callDescriptor); - - try - { - if (waitForCompletion) - { - // We should not be on the running on the callback writer thread - ErrorUtilities.VerifyThrow(Thread.CurrentThread != writerThread, "Should never call this function from the writer thread"); - - // We need to block until the event we posted has been processed, but if the writer thread - // exit due to an error the shared memory is no longer valid so there is no way to send the message - while (!writerThreadHasExited && nodeCommandQueue.Count > 0) - { - nodeCommandQueue.QueueEmptyEvent.WaitOne(1000, false); - - // Check if the communication threads are supposed to exit - if (exitCommunicationThreads.WaitOne(0, false)) - { - break; - } - } - } - } - catch (Exception e) - { - // Clear the current queue since something in the queue has caused a problem - nodeCommandQueue.Clear(); - // Try to send the exception back to the parent - localNode.ReportNonFatalCommunicationError(e); - } - } - - /// - /// This method is used to post replies from the parent engine by the Localnode class - /// - internal void PostReplyFromParent(LocalReplyCallDescriptor reply) - { - int requestingCallNumber = reply.RequestingCallNumber; - - lock (repliesFromParent) - { - ReplyData replyData = (ReplyData)repliesFromParent[requestingCallNumber]; - ErrorUtilities.VerifyThrow(replyData?.waitEvent != null, - "We must have an event for this call at this point"); - - replyData.reply = reply; - replyData.waitEvent.Set(); - } - } - - /// - /// This method is reset the state of shared memory when the node is reused for a different - /// build - /// - internal void Reset() - { - // Make sure there nothing left over in the command queues - nodeCommandQueue.Clear(); - nodeHiPriCommandQueue.Clear(); - - sharedMemory.Reset(); - ErrorUtilities.VerifyThrow(nodeCommandQueue.Count == 0, "Expect all event to be flushed"); - } - - internal Thread GetWriterThread() - { - return writerThread; - } - - /// - /// This method is used to write to shared memory - /// - private void SharedMemoryWriterThread() - { - // Create an array of event to the node thread responds - WaitHandle[] waitHandles = new WaitHandle[3]; - waitHandles[0] = exitCommunicationThreads; - waitHandles[1] = nodeCommandQueue.QueueReadyEvent; - waitHandles[2] = nodeHiPriCommandQueue.QueueReadyEvent; - - bool continueExecution = true; - - try - { - while (continueExecution) - { - // Wait for the next work item or an exit command - int eventType = WaitHandle.WaitAny(waitHandles); - - if (eventType == 0) - { - // Exit node event - continueExecution = false; - } - else - { - sharedMemory.Write(nodeCommandQueue, nodeHiPriCommandQueue, true); - } - } - } - catch (Exception e) - { - // Will rethrow the exception if necessary - localNode.ReportFatalCommunicationError(e); - } - finally - { - writerThreadHasExited = true; - } - - // Dispose of the shared memory buffer - if (sharedMemory != null) - { - sharedMemory.Dispose(); - sharedMemory = null; - } - } - - #region IEngineCallback implementation - /// - /// This method is called by the node to post build - /// requests into a queue in the parent engine - /// - public void PostBuildRequestsToHost(BuildRequest[] buildRequests) - { - LocalCallDescriptorForPostBuildRequests callDescriptor = - new LocalCallDescriptorForPostBuildRequests(buildRequests); - nodeCommandQueue.Enqueue(callDescriptor); - } - - /// - /// This method is used by the child node to post results of a build request back to the - /// parent node. The parent node then decides if need to re-route the results to another node - /// that requested the evaluation or if it will consume the result locally - /// - public void PostBuildResultToHost(BuildResult buildResult) - { - LocalCallDescriptorForPostBuildResult callDescriptor = - new LocalCallDescriptorForPostBuildResult(buildResult); - nodeCommandQueue.Enqueue(callDescriptor); - } - - /// - /// Submit the logging message to the engine queue. - /// - public void PostLoggingMessagesToHost(int nodeProviderId, NodeLoggingEvent[] nodeLoggingEventArray) - { - LocalCallDescriptorForPostLoggingMessagesToHost callDescriptor = - new LocalCallDescriptorForPostLoggingMessagesToHost(nodeLoggingEventArray); - nodeCommandQueue.Enqueue(callDescriptor); - } - - /// - /// Given a non-void call descriptor, calls it and retrieves the return value. - /// - /// - /// - private object GetReplyForCallDescriptor(LocalCallDescriptor callDescriptor) - { - // ReplyFromParentArrived is a TLS field, so initialize it if it's empty - if (replyFromParentArrived == null) - { - replyFromParentArrived = new ManualResetEvent(false); - } - - replyFromParentArrived.Reset(); - int requestingCallNumber = callDescriptor.CallNumber; - - ReplyData replyData = new ReplyData(); - replyData.waitEvent = replyFromParentArrived; - - // Register our wait event for the call id - lock (repliesFromParent) - { - repliesFromParent[requestingCallNumber] = replyData; - } - - nodeCommandQueue.Enqueue(callDescriptor); - - replyFromParentArrived.WaitOne(); - - LocalCallDescriptor reply = null; - - // Unregister the wait event - lock (repliesFromParent) - { - // Get the reply - reply = replyData.reply; - ErrorUtilities.VerifyThrow(reply != null, "We must have a reply if the wait event was set"); - - repliesFromParent.Remove(requestingCallNumber); - } - - return reply.GetReplyData(); - } - - /// - /// This method retrieves the cache entries from the master cache - /// - /// - /// - /// - /// - /// - public CacheEntry[] GetCachedEntriesFromHost(int nodeId, string[] names, string scopeName, BuildPropertyGroup scopeProperties, string scopeToolsVersion, CacheContentType cacheContentType) - { - LocalCallDescriptorForGettingCacheEntriesFromHost callDescriptor = - new LocalCallDescriptorForGettingCacheEntriesFromHost(names, scopeName, scopeProperties, scopeToolsVersion, cacheContentType); - - return (CacheEntry[])GetReplyForCallDescriptor(callDescriptor); - } - - /// - /// Send the cache entries to the parent engine - /// - /// - /// - /// - /// - public Exception PostCacheEntriesToHost(int nodeId, CacheEntry[] entries, string scopeName, BuildPropertyGroup scopeProperties, string scopeToolsVersion, CacheContentType cacheContentType) - { - LocalCallDescriptorForPostingCacheEntriesToHost callDescriptor = - new LocalCallDescriptorForPostingCacheEntriesToHost(entries, scopeName, scopeProperties, scopeToolsVersion, cacheContentType); - - return (Exception)GetReplyForCallDescriptor(callDescriptor); - } - - /// - /// This method is called to post the status of the node. Because status is used - /// to report errors and to respond to inactivity notices, we use a separate queue - /// to deliver status event to the shared memory. Otherwise status maybe be delayed - /// if it is stuck behind a large number of other events. We also wait for the status - /// to be sent before returning. - /// - public void PostStatus(int nodeId, NodeStatus nodeStatus, bool blockUntilSent) - { - // We should not be on the running on the callback writer thread - ErrorUtilities.VerifyThrow(Thread.CurrentThread != writerThread, "Should never call this function from the writer thread"); - - LocalCallDescriptorForPostStatus callDescriptor = - new LocalCallDescriptorForPostStatus(nodeStatus); - nodeHiPriCommandQueue.Enqueue(callDescriptor); - - // We need to block until the event we posted has been processed, but if the writer thread - // exit due to an error the shared memory is no longer valid so there is no way to send the message - while (blockUntilSent && !writerThreadHasExited && nodeHiPriCommandQueue.Count > 0) - { - nodeHiPriCommandQueue.QueueEmptyEvent.WaitOne(1000, false); - - // Check if the communication threads are supposed to exit - if (exitCommunicationThreads.WaitOne(0, false)) - { - break; - } - } - } - - #endregion - - #endregion - - #region Data - private LocalNode localNode; - private DualQueue nodeCommandQueue; - private DualQueue nodeHiPriCommandQueue; - private SharedMemory sharedMemory; - private ManualResetEvent exitCommunicationThreads; - private bool writerThreadHasExited; - private Thread writerThread; - - [ThreadStatic] - private static ManualResetEvent replyFromParentArrived; - - // K: call id; V: ReplyData class with the wait event and reply call descriptor - private Hashtable repliesFromParent; - #endregion - } -} diff --git a/src/Deprecated/Engine/LocalProvider/LocalNodeInfo.cs b/src/Deprecated/Engine/LocalProvider/LocalNodeInfo.cs deleted file mode 100644 index 53fefa323c9..00000000000 --- a/src/Deprecated/Engine/LocalProvider/LocalNodeInfo.cs +++ /dev/null @@ -1,261 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System.Collections.Generic; -using System.Threading; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This contains information and data for each node. This class organizes the data so that - /// LocalNodeProvider can be simplified. - /// - internal class LocalNodeInfo - { - #region Constructors - internal LocalNodeInfo(int availableNodeNumberHint) - { - this.nodeState = LocalNodeProvider.NodeState.NotLaunched; - this.targetList = new LinkedList(); - this.nodeCommandQueue = new DualQueue(); - this.nodeHiPriCommandQueue = new DualQueue(); - this.nodeReserveHandle = null; - this.communicationFailed = false; - this.processId = unInitializedProcessId; - - // Figure out the next available node number - ReserveNextAvailableNodeNumber(availableNodeNumberHint); - } - #endregion - - #region Properties - - internal SharedMemory SharedMemoryToNode - { - get - { - return this.sharedMemoryToNode; - } - set - { - this.sharedMemoryToNode = value; - } - } - - internal SharedMemory SharedMemoryFromNode - { - get - { - return this.sharedMemoryFromNode; - } - set - { - this.sharedMemoryFromNode = value; - } - } - - internal DualQueue NodeCommandQueue - { - get - { - return this.nodeCommandQueue; - } - } - - internal DualQueue NodeHiPriCommandQueue - { - get - { - return this.nodeHiPriCommandQueue; - } - } - - - internal LinkedList TargetList - { - get - { - return this.targetList; - } - set - { - this.targetList = value; - } - } - - internal LocalNodeProvider.NodeState NodeState - { - get - { - return this.nodeState; - } - set - { - this.nodeState = value; - } - } - - internal int NodeNumber - { - get - { - return this.nodeNumber; - } - } - - internal int NodeId - { - get - { - return this.nodeId; - } - set - { - this.nodeId = value; - } - } - - internal int ProcessId - { - get - { - return this.processId; - } - set - { - this.processId = value; - } - } - - internal bool CommunicationFailed - { - get - { - return this.communicationFailed; - } - set - { - this.communicationFailed = value; - } - } - - public bool ShutdownResponseReceived - { - get - { - return shutdownResponseReceived; - } - set - { - shutdownResponseReceived = value; - } - } - #endregion - - #region Methods - - /// - /// This method creates the shared memory buffers for communicating with the node - /// - /// Was the shared memory created and is useable - internal bool CreateSharedMemoryBuffers() - { - this.sharedMemoryToNode = - new SharedMemory - ( - LocalNodeProviderGlobalNames.NodeInputMemoryName(this.nodeNumber), - SharedMemoryType.WriteOnly, - false - ); - - if (!this.sharedMemoryToNode.IsUsable) - { - return false; - } - - - this.sharedMemoryFromNode = - new SharedMemory - ( - LocalNodeProviderGlobalNames.NodeOutputMemoryName(this.nodeNumber), - SharedMemoryType.ReadOnly, - false - ); - - if (!this.sharedMemoryFromNode.IsUsable) - { - return false; - } - - return true; - } - - internal void ReleaseNode() - { - if (nodeReserveHandle != null) - { - nodeReserveHandle.Close(); - processId = invalidProcessId; - nodeReserveHandle = null; - } - } - /// - /// This function attempts to find out a node number for which - /// the event named Node_x_ProviderMutex doesn't exist. The existance - /// of the event indicates that some other node provider is using the node. - /// - private void ReserveNextAvailableNodeNumber(int currentNodeNumber) - { - while (nodeReserveHandle == null) - { - bool createdNew; - nodeReserveHandle = - new EventWaitHandle(false, EventResetMode.ManualReset, LocalNodeProviderGlobalNames.NodeReserveEventName(currentNodeNumber), out createdNew); - if (!createdNew) - { - nodeReserveHandle.Close(); - nodeReserveHandle = null; - currentNodeNumber++; - } - else - { - nodeNumber = currentNodeNumber; - // Create the shared memory resources - if (!CreateSharedMemoryBuffers()) - { - nodeReserveHandle.Close(); - nodeReserveHandle = null; - currentNodeNumber++; - } - } - } - } - - #endregion - - #region Data - private SharedMemory sharedMemoryToNode; - private SharedMemory sharedMemoryFromNode; - private DualQueue nodeCommandQueue; - private DualQueue nodeHiPriCommandQueue; - private EventWaitHandle nodeReserveHandle; - private bool communicationFailed; - - private LinkedList targetList; - private LocalNodeProvider.NodeState nodeState; - private int nodeNumber; - private int nodeId; - private int processId; - private bool shutdownResponseReceived; - - internal const int invalidProcessId = -1; - internal const int unInitializedProcessId = -2; - - #endregion - - } -} diff --git a/src/Deprecated/Engine/LocalProvider/LocalNodeProvider.cs b/src/Deprecated/Engine/LocalProvider/LocalNodeProvider.cs deleted file mode 100644 index 9d72e9c81e1..00000000000 --- a/src/Deprecated/Engine/LocalProvider/LocalNodeProvider.cs +++ /dev/null @@ -1,1049 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Diagnostics; -using System.Threading; -using System.Globalization; -using System.IO; -using Microsoft.Build.BuildEngine.Shared; -using System.Runtime.InteropServices; - -namespace Microsoft.Build.BuildEngine -{ - internal class LocalNodeProvider : INodeProvider - { - #region Methods implementing INodeProvider - public void Initialize - ( - string configuration, - IEngineCallback parentEngineCallback, - BuildPropertyGroup parentGlobalPropertyGroup, - ToolsetDefinitionLocations toolSetSearchLocations, - string startupDirectory - ) - { - // Get from the environment how long we should wait in seconds for shutdown to complete - string shutdownTimeoutFromEnvironment = Environment.GetEnvironmentVariable("MSBUILDNODESHUTDOWNTIMEOUT"); - int result; - if (int.TryParse(shutdownTimeoutFromEnvironment, out result) && result >= 0) - { - shutdownTimeout = result; - } - - this.cpuCount = 1; - - if (configuration != null) - { - // Split out the parameter sets based on ; - string[] parameters = configuration.Split(parameterDelimiters); - // Go through each of the parameter name value pairs and split them appart - for (int param = 0; param < parameters.Length; param++) - { - if (parameters[param].Length > 0) - { - string[] parameterComponents = parameters[param].Split(valueDelimiters); - // If there is a name and value associated with the parameter, apply the paramter to the provider - if (parameterComponents.Length == 2) - { - ApplyParameter(parameterComponents[0], parameterComponents[1]); - } - else // Only the parameter name is known, this could be for a boolean parameter - { - ApplyParameter(parameters[param], null); - } - } - } - } - - /* If we dont get a path passed in as a parameter, we can only assume that our path - is in the current appdomain basedirectory, this is the base directory - that the assembly resolver uses to probe for assemblies - */ - if (string.IsNullOrEmpty(this.locationOfMSBuildExe)) - { - this.locationOfMSBuildExe = AppDomain.CurrentDomain.BaseDirectory; - } - if ((cpuCount - 1) <= 0) - { - return; - } - - this.exitCommunicationThreads = new ManualResetEvent(false); - - this.activeNodeCount = 0; - this.responseCountChangeEvent = new ManualResetEvent(false); - - this.nodeStateLock = new object(); - this.nodesToLaunch = new Queue(); - this.nodeLoggers = new List(); - - nodeData = new LocalNodeInfo[cpuCount - 1]; - - // Initialize the internal state indicating that no nodes have been launched - int lastUsedNodeNumber = 0; - for (int i = 0; i < nodeData.Length; i++) - { - nodeData[i] = new LocalNodeInfo(lastUsedNodeNumber); - lastUsedNodeNumber = nodeData[i].NodeNumber + 1; - } - - // Set up the callback - this.engineCallback = parentEngineCallback; - this.parentGlobalProperties = parentGlobalPropertyGroup; - this.toolsetSearchLocations = toolSetSearchLocations; - this.startupDirectory = startupDirectory; - - // Default node settings - centralizedLogging = false; - onlyLogCriticalEvents = false; - useBreadthFirstTraversal = true; - shuttingDown = false; - - // Start the thread that will be processing the calls from the parent engine - ThreadStart threadState = new ThreadStart(this.SharedMemoryWriterThread); - Thread taskThread = new Thread(threadState); - taskThread.Name = "MSBuild Parent->Child Writer"; - taskThread.Start(); - threadState = new ThreadStart(this.SharedMemoryReaderThread); - taskThread = new Thread(threadState); - taskThread.Name = "MSBuild Parent<-Child Reader"; - taskThread.Start(); - } - - /// - /// Apply a parameter. - /// - public void ApplyParameter(string parameterName, string parameterValue) - { - ErrorUtilities.VerifyThrowArgumentNull(parameterName, nameof(parameterName)); - - if (String.Equals(parameterName, "MAXCPUCOUNT", StringComparison.OrdinalIgnoreCase)) - { - try - { - this.cpuCount = Convert.ToInt32(parameterValue, CultureInfo.InvariantCulture); - } - catch (FormatException) - { - // - } - catch (OverflowException) - { - // - } - } - else if (String.Equals(parameterName, "MSBUILDLOCATION", StringComparison.OrdinalIgnoreCase)) - { - this.locationOfMSBuildExe = parameterValue; - } - else if (String.Equals(parameterName, "NODEREUSE", StringComparison.OrdinalIgnoreCase)) - { - try - { - // There does not seem to be a localizable function for this - if (bool.Parse(parameterValue)) - { - this.enableNodeReuse = true; - } - else - { - this.enableNodeReuse = false; - } - } - catch (FormatException) - { - // - } - catch (ArgumentNullException) - { - // - } - } - } - - public INodeDescription[] QueryNodeDescriptions() - { - return new INodeDescription[cpuCount - 1]; - } - - public void AssignNodeIdentifiers(int[] nodeIds) - { - if ((cpuCount - 1) <= 0) - { - return; - } - - ErrorUtilities.VerifyThrow(nodeIds.Length == nodeData.Length, "Expected an ID for each node"); - - for (int i = 0; i < nodeIds.Length; i++) - { - nodeData[i].NodeId = nodeIds[i]; - } - } - - public void RegisterNodeLogger(LoggerDescription loggerDescription) - { - ErrorUtilities.VerifyThrow(nodeLoggers != null, "Must call Initialize first"); - ErrorUtilities.VerifyThrow(loggerDescription != null, "Logger description should be non-null"); - - if (!nodeLoggers.Contains(loggerDescription)) - { - nodeLoggers.Add(loggerDescription); - } - } - - public void RequestNodeStatus(int nodeIndex, int requestId) - { - ErrorUtilities.VerifyThrow(nodeLoggers != null, "Must call Initialize first"); - ErrorUtilities.VerifyThrow(nodeIndex < nodeData.Length && nodeIndex >= 0, "Node index must be within array boundaries"); - - // If the node has not been launched we need to create a reply - // on its behalf - if (nodeData[nodeIndex].NodeState != NodeState.Launched) - { - NodeStatus nodeStatus = new NodeStatus(requestId, false, 0, 0, 0, nodeData[nodeIndex].NodeState == NodeState.LaunchInProgress); - engineCallback.PostStatus(nodeData[nodeIndex].NodeId, nodeStatus, false); - } - else if (!IsNodeProcessAliveOrUninitialized(nodeIndex)) - { - NodeStatus nodeStatus = new NodeStatus(requestId); // Indicate that the node has exited - engineCallback.PostStatus(nodeData[nodeIndex].NodeId, nodeStatus, false); - } - else - { - // Send the request to the node - LocalCallDescriptorForRequestStatus callDescriptor = - new LocalCallDescriptorForRequestStatus(requestId); - nodeData[nodeIndex].NodeCommandQueue.Enqueue(callDescriptor); - } - } - - public void PostBuildRequestToNode(int nodeIndex, BuildRequest buildRequest) - { - ErrorUtilities.VerifyThrow(nodeIndex < nodeData.Length && nodeIndex >= 0, "Node index must be within array boundaries"); - - if (nodeData[nodeIndex].NodeState != NodeState.Launched) - { - // Note that we have to check the node status again inside the mutex. This - // ensures that that after flipping the status to launched inside the mutex - // there will be no more writes to the queue of targets waiting to be sent - lock (nodeStateLock) - { - // Check if we didn't initialize this node - if (nodeData[nodeIndex].NodeState != NodeState.Launched && !shuttingDown) - { - // Check if launch is in progress - if (nodeData[nodeIndex].NodeState == NodeState.NotLaunched) - { - nodeData[nodeIndex].NodeState = NodeState.LaunchInProgress; - lock (nodesToLaunch) - { - nodesToLaunch.Enqueue(nodeIndex); - } - ThreadStart threadState = new ThreadStart(this.LaunchNodeAndPostBuildRequest); - Thread taskThread = new Thread(threadState); - taskThread.Name = "MSBuild Node Launcher"; - taskThread.Start(); - } - nodeData[nodeIndex].TargetList.AddFirst(new LinkedListNode(buildRequest)); - } - else - { - LocalCallDescriptorForPostBuildRequests callDescriptor = - new LocalCallDescriptorForPostBuildRequests(buildRequest); - nodeData[nodeIndex].NodeCommandQueue.Enqueue(callDescriptor); - } - } - } - else - { - LocalCallDescriptorForPostBuildRequests callDescriptor = - new LocalCallDescriptorForPostBuildRequests(buildRequest); - nodeData[nodeIndex].NodeCommandQueue.Enqueue(callDescriptor); - } - } - - public void PostBuildResultToNode(int nodeIndex, BuildResult buildResult) - { - ErrorUtilities.VerifyThrow(nodeIndex < nodeData.Length && nodeIndex >= 0, "Node index must be within array boundaries"); - ErrorUtilities.VerifyThrow(nodeData[nodeIndex].NodeState == NodeState.Launched, "Node must be launched before result can be posted"); - - LocalCallDescriptorForPostBuildResult callDescriptor = - new LocalCallDescriptorForPostBuildResult(buildResult); - nodeData[nodeIndex].NodeCommandQueue.Enqueue(callDescriptor); - } - - /// - /// Shutdown the nodes which are being tracked and managed by this localNodeProvider. - /// - public void ShutdownNodes(Node.NodeShutdownLevel nodeShutdownLevel) - { - // Indicate that nodes should no longer be launched - shuttingDown = true; - - // Send out shutdown requests to all active launched nodes - responseCount = activeNodeCount; - SendShutdownRequests(nodeShutdownLevel); - - DateTime startTime = DateTime.Now; - - // Wait for all nodes to shutdown - bool timeoutExpired = false; - - // Loop until we are ready to shutdown. We are ready to shutdown when - // all nodes either have sent their shutdown completed response or they are dead. - // Secondly, we will exit the loop if our shudtownTimeout has expired - TimeSpan shutdownTimeoutSpan = new TimeSpan(0, 0, shutdownTimeout); - while (!ReadyToShutdown() && !timeoutExpired) - { - responseCountChangeEvent.WaitOne(shutdownResponseTimeout, false); - responseCountChangeEvent.Reset(); - - // Timeout when the loop has been executing for more than shutdownTimeout seconds. - timeoutExpired = DateTime.Now.Subtract(startTime) >= shutdownTimeoutSpan; - } - - if (timeoutExpired) - { - foreach (LocalNodeInfo nodeInfo in nodeData) - { - //Terminate all of the nodes which have valid processId's but for which we - // have not recieved a shutdown response - if (nodeInfo.ProcessId > 0 && !nodeInfo.ShutdownResponseReceived) - { - TerminateChildNode(nodeInfo.ProcessId); - } - } - } - - // Reset the shutdown response received properties incase the nodes are going - // to be used for another build on the same engine. - foreach (LocalNodeInfo nodeInfo in nodeData) - { - nodeInfo.ShutdownResponseReceived = false; - } - - // If all nodes are exiting - exit the communication threads - if (nodeShutdownLevel != Node.NodeShutdownLevel.BuildCompleteSuccess && - nodeShutdownLevel != Node.NodeShutdownLevel.BuildCompleteFailure) - { - exitCommunicationThreads.Set(); - } - - shuttingDown = false; - } - - /// - /// Determine when the child node has either responsed with a shutdown complete event or the node has died - /// - internal bool ReadyToShutdown() - { - for (int i = 0; i < nodeData.Length; i++) - { - LocalNodeInfo nodeInfo = nodeData[i]; - // Determine if the node is alive or dead, this check will set the processId to invalid if - // the process is dead - IsNodeProcessAliveOrUninitialized(i); - // If any node is still alive and we have not recieved a shutdown response say we are not ready to shutdown - if (nodeInfo.ProcessId > 0 && !nodeInfo.ShutdownResponseReceived) - { - return false; - } - } - return true; - } - /// - /// TEMPORARY - /// - public void UpdateSettings - ( - bool enableCentralizedLogging, - bool enableOnlyLogCriticalEvents, - bool useBreadthFirstTraversalSetting - ) - { - this.centralizedLogging = enableCentralizedLogging; - this.onlyLogCriticalEvents = enableOnlyLogCriticalEvents; - this.useBreadthFirstTraversal = useBreadthFirstTraversalSetting; - - for (int i = 0; i < nodeData.Length; i++) - { - if (nodeData[i].NodeState == NodeState.Launched) - { - UpdateSettings(i); - } - } - } - - private void UpdateSettings(int nodeIndex) - { - // Send the updated settings once the node has initialized - LocalCallDescriptorForUpdateNodeSettings callDescriptor = - new LocalCallDescriptorForUpdateNodeSettings(onlyLogCriticalEvents, centralizedLogging, useBreadthFirstTraversal); - nodeData[nodeIndex].NodeCommandQueue.Enqueue(callDescriptor); - } - - public void PostIntrospectorCommand(int nodeIndex, TargetInProgessState child, TargetInProgessState parent) - { - // Send the updated settings once the node has initialized - LocalCallDescriptorForPostIntrospectorCommand callDescriptor = - new LocalCallDescriptorForPostIntrospectorCommand(child, parent); - nodeData[nodeIndex].NodeCommandQueue.Enqueue(callDescriptor); - } - - #endregion - - #region Private methods - - /// - /// Send shutdown message to the launched child nodes. - /// - private void SendShutdownRequests(Node.NodeShutdownLevel nodeShutdownLevel) - { - for (int i = 0; i < nodeData.Length; i++) - { - // If there is a node launch in progress wait for it complete or fail - // before shutting down the node - while (nodeData[i].NodeState == NodeState.LaunchInProgress && !nodeData[i].CommunicationFailed) - { - Thread.Sleep(500); - } - - if (nodeData[i].NodeState == NodeState.Launched) - { - if (!nodeData[i].CommunicationFailed) - { - bool exitProcess = !enableNodeReuse; - // If we are shutting down due to a BuildComplete then dont kill the nodes as this method will be called again in the engine shutdown method - if (nodeShutdownLevel == Node.NodeShutdownLevel.BuildCompleteSuccess || nodeShutdownLevel == Node.NodeShutdownLevel.BuildCompleteFailure) - { - exitProcess = false; - } - // Signal to the node to shutdown - LocalCallDescriptorForShutdownNode callDescriptor = - new LocalCallDescriptorForShutdownNode(nodeShutdownLevel, exitProcess); - nodeData[i].NodeCommandQueue.Enqueue(callDescriptor); - } - else - { - TerminateChildNode(nodeData[i].ProcessId); - } - - if (nodeShutdownLevel != Node.NodeShutdownLevel.BuildCompleteSuccess && - nodeShutdownLevel != Node.NodeShutdownLevel.BuildCompleteFailure) - { - nodeData[i].NodeState = NodeState.NotLaunched; - } - } - } - } - - /// - /// Kill the child process directly if we can't communicate with it - /// - private void TerminateChildNode(int processId) - { - try - { - if (!Process.GetProcessById(processId).HasExited) - { - Process.GetProcessById(processId).Kill(); - } - } - catch (ArgumentException) - { - // The exception indicates that the child process is no longer running - } - catch (System.ComponentModel.Win32Exception) - { - // The exception indicates that the child process is no longer running or - // the parent cannot access the child process information due to insufficent security permissions - } - } - - /// - /// Returns true if the process for the given node was started and has not exited - /// - private bool IsNodeProcessAliveOrUninitialized(int nodeId) - { - // If it's alive but not being communicated with anymore, that counts as not alive - if (nodeData[nodeId].CommunicationFailed) - { - return false; - } - - try - { - bool isUninitialized = nodeData[nodeId].ProcessId == LocalNodeInfo.unInitializedProcessId; - - if (isUninitialized) - { - return true; - } - - bool isInvalidProcessId = nodeData[nodeId].ProcessId == LocalNodeInfo.invalidProcessId; - - if (!isInvalidProcessId && !Process.GetProcessById(nodeData[nodeId].ProcessId).HasExited) - { - return true; - } - } - catch (ArgumentException) - { - // Process already exited - - } - - nodeData[nodeId].ProcessId = LocalNodeInfo.invalidProcessId; - nodeData[nodeId].CommunicationFailed = true; - - return false; - } - - private void DecreaseActiveNodeCount(int nodeId) - { - int i = 0; - for (; i < nodeData.Length; i++) - { - if (nodeData[i].NodeId == nodeId) - { - nodeData[i].ReleaseNode(); - Interlocked.Decrement(ref activeNodeCount); - break; - } - } - ErrorUtilities.VerifyThrow(i < nodeData.Length, "Expected to find a node to decrement count"); - } - - /// - /// This function is used to increment the count of active nodes - /// - private void IncreaseActiveNodeCount() - { - Interlocked.Increment(ref activeNodeCount); - } - - /// - /// This function is used to decrement the count of active nodes - /// - internal void RecordNodeResponse(int nodeId, Node.NodeShutdownLevel shutdownLevel, int totalTaskTime) - { - // If the node is shutting down - decrease the count of active nodes - if (shutdownLevel == Node.NodeShutdownLevel.ErrorShutdown || - shutdownLevel == Node.NodeShutdownLevel.PoliteShutdown) - { - DecreaseActiveNodeCount(nodeId); - } - - //Console.WriteLine("Node " + nodeId + " Task Time " + totalTaskTime); - - int i = 0; - for (; i < nodeData.Length; i++) - { - if (nodeData[i].NodeId == nodeId) - { - nodeData[i].ShutdownResponseReceived = true; - Interlocked.Decrement(ref responseCount); - responseCountChangeEvent.Set(); - break; - } - } - ErrorUtilities.VerifyThrow(i < nodeData.Length, "Expected to find a node to decrement count"); - } - - /// - /// This function is used by the node to set its own processId after it has been initialized - /// - internal void SetNodeProcessId(int processId, int nodeId) - { - for (int i = 0; i < nodeData.Length; i++) - { - if (nodeData[i].NodeId == nodeId) - { - nodeData[i].ProcessId = processId; - break; - } - } - } - - /// - /// This function will start a node and send requests to it - /// - private void LaunchNodeAndPostBuildRequest() - { - int nodeIndex = 0; - - // Find out what node to launch - lock (nodesToLaunch) - { - nodeIndex = nodesToLaunch.Dequeue(); - } - - // If the provider is shutting down - don't launch the node - if (shuttingDown) - { - nodeData[nodeIndex].NodeState = NodeState.NotLaunched; - return; - } - - try - { - // Either launch node or connect to an already running node - InitializeNode(nodeIndex); - - if (!nodeData[nodeIndex].CommunicationFailed) - { - // Change the state of the node to launched - lock (nodeStateLock) - { - nodeData[nodeIndex].NodeState = NodeState.Launched; - } - - // Send all the requests to the node. Note that the requests may end up in - // mixed order with the request currently being posted. - LinkedListNode current = nodeData[nodeIndex].TargetList.First; - BuildRequest[] buildRequests = new BuildRequest[nodeData[nodeIndex].TargetList.Count]; - int i = 0; - while (current != null) - { - buildRequests[i] = current.Value; - i++; - - current = current.Next; - } - LocalCallDescriptorForPostBuildRequests callDescriptor = - new LocalCallDescriptorForPostBuildRequests(buildRequests); - nodeData[nodeIndex].NodeCommandQueue.Enqueue(callDescriptor); - - nodeData[nodeIndex].TargetList = null; - } - else - { - // Allow the engine to decide how to proceed since the node failed to launch - string message = ResourceUtilities.FormatResourceString("NodeProviderFailure"); - ReportNodeCommunicationFailure(nodeIndex, new Exception(message), false); - } - } - catch (Exception e) - { - // Allow the engine to deal with the exception - ReportNodeCommunicationFailure(nodeIndex, e, false); - } - } - - /// - /// This function establishes communication with a node given an index. If a node - /// is not running it is launched. - /// - private void InitializeNode(int nodeIndex) - { - bool nodeConnected = false; - int restartCount = 0; - - try - { - IncreaseActiveNodeCount(); - - while (!nodeConnected && restartCount < maximumNodeRestartCount) - { - if (!checkIfNodeActive(nodeData[nodeIndex].NodeNumber)) - { - // Attempt to launch a new node process - LaunchNode(nodeIndex); - // If we could not launch the node there is no reason to continue - if (nodeData[nodeIndex].CommunicationFailed) - { - break; - } - } - - if (checkIfNodeActive(nodeData[nodeIndex].NodeNumber)) - { - nodeData[nodeIndex].SharedMemoryToNode.Reset(); - nodeData[nodeIndex].SharedMemoryFromNode.Reset(); - - // Activate the initiation event to prove to the child that we have the same level of privilege as it does. This operation will not fail because each privilege level creates - // events in different namespaces - EventWaitHandle nodeInitiateActivationEvent = new EventWaitHandle(false, EventResetMode.ManualReset, LocalNodeProviderGlobalNames.NodeInitiateActivationEventName(nodeData[nodeIndex].NodeNumber)); - nodeInitiateActivationEvent.Set(); - nodeInitiateActivationEvent.Close(); - - // Wait for node to indicate that it is activated - EventWaitHandle nodeActivatedEvent = new EventWaitHandle(false, EventResetMode.ManualReset, LocalNodeProviderGlobalNames.NodeActivedEventName(nodeData[nodeIndex].NodeNumber)); - nodeActivatedEvent.WaitOne(initializationTimeout, false); - nodeActivatedEvent.Close(); - - // Looked in Environment.cs the IDictionary is a HashTable - IDictionary variableDictionary = Environment.GetEnvironmentVariables(); - Hashtable environmentVariablesTable = new Hashtable(variableDictionary); - - LocalCallDescriptorForInitializeNode callDescriptorInit = - new LocalCallDescriptorForInitializeNode(environmentVariablesTable, nodeLoggers.ToArray(), nodeData[nodeIndex].NodeId, parentGlobalProperties, toolsetSearchLocations, Process.GetCurrentProcess().Id, startupDirectory); - nodeData[nodeIndex].NodeCommandQueue.Enqueue(callDescriptorInit); - - EventWaitHandle nodeInUseEvent = new EventWaitHandle(false, EventResetMode.ManualReset, LocalNodeProviderGlobalNames.NodeInUseEventName(nodeData[nodeIndex].NodeNumber)); - - // Wait for node to indicate that it is ready. The node may time out and exit, between - // when we check that it is active and before the initialization messages reaches it. - // In that rare case we have to restart the node. - if (nodeInUseEvent.WaitOne(initializationTimeout, false)) - { - UpdateSettings(nodeIndex); - nodeConnected = true; - } - nodeInUseEvent.Close(); - - // If the node is still active and has not replied to the initialization message it must - // be in bad state - try to get that node to exit - if (!nodeConnected && checkIfNodeActive(nodeData[nodeIndex].NodeNumber)) - { - EventWaitHandle nodeShutdownEvent = new EventWaitHandle(false, EventResetMode.ManualReset, LocalNodeProviderGlobalNames.NodeErrorShutdownEventName(nodeData[nodeIndex].NodeNumber)); - nodeShutdownEvent.Set(); - nodeShutdownEvent.Close(); - - restartCount = maximumNodeRestartCount; - } - - restartCount++; - } - } - } - finally - { - // Make sure to decrement the active node count if the communication has failed - if (!nodeConnected) - { - DecreaseActiveNodeCount(nodeData[nodeIndex].NodeId); - nodeData[nodeIndex].CommunicationFailed = true; - } - } - } - - /// - /// This function attempts to find out if there is currently a node running - /// for a given index. The node is running if the global mutex with a - /// "Node_" + nodeId + "_ActiveReady" as a name was created - /// - private static bool checkIfNodeActive(int nodeNumber) - { - bool nodeIsActive = false; - EventWaitHandle nodeActiveHandle = null; - try - { - nodeActiveHandle = EventWaitHandle.OpenExisting(LocalNodeProviderGlobalNames.NodeActiveEventName(nodeNumber)); - nodeIsActive = true; - } - catch (WaitHandleCannotBeOpenedException) - { - // Assume that the node is not running - } - finally - { - nodeActiveHandle?.Close(); - } - - return nodeIsActive; - } - - /// - /// This function launches a new node given a node index - /// - private void LaunchNode(int nodeIndex) - { - EventWaitHandle nodeReadyEvent = null; - - string msbuildLocation = Path.Combine(locationOfMSBuildExe, "MSBuild.exe"); - ErrorUtilities.VerifyThrow(File.Exists(msbuildLocation), "Msbuild.exe cannot be found at: " + msbuildLocation); - - bool exitedDueToError = true; - try - { - NativeMethods.STARTUPINFO startInfo = new NativeMethods.STARTUPINFO(); - startInfo.cb = Marshal.SizeOf(startInfo); - uint dwCreationFlags = NativeMethods.NORMAL_PRIORITY_CLASS; - if (!Engine.debugMode) - { - startInfo.hStdError = NativeMethods.InvalidHandle; - startInfo.hStdInput = NativeMethods.InvalidHandle; - startInfo.hStdOutput = NativeMethods.InvalidHandle; - startInfo.dwFlags = NativeMethods.STARTF_USESTDHANDLES; - dwCreationFlags |= NativeMethods.CREATE_NO_WINDOW; - } - - NativeMethods.SECURITY_ATTRIBUTES pSec = new NativeMethods.SECURITY_ATTRIBUTES(); - NativeMethods.SECURITY_ATTRIBUTES tSec = new NativeMethods.SECURITY_ATTRIBUTES(); - pSec.nLength = Marshal.SizeOf(pSec); - tSec.nLength = Marshal.SizeOf(tSec); - - NativeMethods.PROCESS_INFORMATION pInfo = new NativeMethods.PROCESS_INFORMATION(); - - string appName = msbuildLocation; - // Repeat the executable name as the first token of the command line because the command line - // parser logic expects it and will otherwise skip the first argument - string cmdLine = msbuildLocation + " /nologo /oldom /nodemode:" + nodeData[nodeIndex].NodeNumber; - NativeMethods.CreateProcess(appName, cmdLine, - ref pSec, ref tSec, - false, dwCreationFlags, - NativeMethods.NullPtr, null, ref startInfo, out pInfo); - - nodeReadyEvent = new EventWaitHandle(false, EventResetMode.ManualReset, LocalNodeProviderGlobalNames.NodeActiveEventName(nodeData[nodeIndex].NodeNumber)); - - // Wait until the node is ready to process the requests - if (nodeReadyEvent.WaitOne(launchTimeout, false)) - { - exitedDueToError = false; - } - } - finally - { - // Dispose before losing scope - nodeReadyEvent?.Close(); - - if (exitedDueToError) - { - nodeData[nodeIndex].CommunicationFailed = true; - } - } - } - - /// - /// Report communication failure and update internal state - /// - private void ReportNodeCommunicationFailure - ( - int nodeIndex, - Exception innerException, - bool decreaseActiveNodeCount - ) - { - // Indicate that communication with a particular node has failed - if (nodeIndex >= 0 && nodeIndex < nodeData.Length) - { - if (decreaseActiveNodeCount && !nodeData[nodeIndex].CommunicationFailed) - { - DecreaseActiveNodeCount(nodeData[nodeIndex].NodeId); - } - - nodeData[nodeIndex].CommunicationFailed = true; - } - - string message = ResourceUtilities.FormatResourceString("NodeProviderFailure"); - RemoteErrorException wrappedException = new RemoteErrorException(message, innerException, null); - NodeStatus nodeStatus = new NodeStatus(wrappedException); - - if (nodeIndex < 0 || nodeIndex >= nodeData.Length) - { - // Bogus node index came out of the wait handle, perhaps due to memory pressure - // We can't really do anything except re-throw so this problem can be diagnosed. - throw wrappedException; - } - - engineCallback.PostStatus(nodeData[nodeIndex].NodeId, nodeStatus, false); - } - - /// - /// This thread writes out the messages to the shared memory, where the LocalNode class - /// reads it. - /// - private void SharedMemoryWriterThread() - { - // Create an array of event to the node thread responds - WaitHandle[] waitHandles = new WaitHandle[1 + nodeData.Length]; - waitHandles[0] = exitCommunicationThreads; - for (int i = 0; i < nodeData.Length; i++) - { - waitHandles[i + 1] = nodeData[i].NodeCommandQueue.QueueReadyEvent; - } - - bool continueExecution = true; - - while (continueExecution) - { - int nodeIndex = -1; - try - { - // Wait for the next work item or an exit command - int eventType = WaitHandle.WaitAny(waitHandles); - - if (eventType == 0) - { - // Exit node event - continueExecution = false; - } - else - { - nodeIndex = eventType - 1; - nodeData[nodeIndex].SharedMemoryToNode.Write(nodeData[nodeIndex].NodeCommandQueue, nodeData[nodeIndex].NodeHiPriCommandQueue, false); - } - } - catch (Exception e) - { - // Ignore the queue of commands to the node that failed - if (nodeIndex >= 0 && nodeIndex < nodeData.Length) - { - waitHandles[1 + nodeIndex] = new ManualResetEvent(false); - } - ReportNodeCommunicationFailure(nodeIndex, e, true); - } - } - - for (int i = 0; i < nodeData.Length; i++) - { - // Dispose of the shared memory buffer - if (nodeData[i].SharedMemoryToNode != null) - { - nodeData[i].SharedMemoryToNode.Dispose(); - nodeData[i].SharedMemoryToNode = null; - } - } - } - - /// - /// This thread is responsible for reading messages from the nodes. The messages are posted - /// to the shared memory by the LocalNodeCallback - /// - private void SharedMemoryReaderThread() - { - // Create an array of event to the node thread responds - WaitHandle[] waitHandles = new WaitHandle[1 + nodeData.Length]; - waitHandles[0] = exitCommunicationThreads; - for (int i = 0; i < nodeData.Length; i++) - { - waitHandles[i + 1] = nodeData[i].SharedMemoryFromNode.ReadFlag; - } - - bool continueExecution = true; - - while (continueExecution) - { - int nodeIndex = -1; - try - { - // Wait for the next work item or an exit command - int eventType = WaitHandle.WaitAny(waitHandles); - - if (eventType == 0) - { - // Exit node event - continueExecution = false; - } - else - { - nodeIndex = eventType - 1; - IList localCallDescriptorList = nodeData[nodeIndex].SharedMemoryFromNode.Read(); - - if (localCallDescriptorList != null) - { - foreach (LocalCallDescriptor callDescriptor in localCallDescriptorList) - { - // Act as requested by the call - callDescriptor.HostAction(engineCallback, this, nodeData[nodeIndex].NodeId); - // Check if there is a reply to this call - if (callDescriptor.NeedsReply) - { - nodeData[nodeIndex].NodeCommandQueue.Enqueue(callDescriptor.ReplyFromHostAction()); - } - } - } - } - } - catch (Exception e) - { - ReportNodeCommunicationFailure(nodeIndex, e, true); - // Ignore the events reported from that node from now on - if (nodeIndex >= 0 && nodeIndex < nodeData.Length) - { - waitHandles[1 + nodeIndex] = new ManualResetEvent(false); - } - } - } - - // Dispose of shared memory when done - for (int i = 0; i < nodeData.Length; i++) - { - // Dispose of the shared memory buffer - if (nodeData[i].SharedMemoryFromNode != null) - { - nodeData[i].SharedMemoryFromNode.Dispose(); - nodeData[i].SharedMemoryFromNode = null; - } - } - } - - #endregion - - #region Data - private IEngineCallback engineCallback; - private ManualResetEvent exitCommunicationThreads; - - private ManualResetEvent responseCountChangeEvent; - private int activeNodeCount; - private int responseCount; - - private int cpuCount; - - private object nodeStateLock; - private Queue nodesToLaunch; - - private bool centralizedLogging; - - private bool onlyLogCriticalEvents; - - private bool useBreadthFirstTraversal; - - private bool enableNodeReuse = true; - - // True after shut down has been called, this flag prevents launching of new nodes after shutdown has been called - private bool shuttingDown; - - private List nodeLoggers; - - private string locationOfMSBuildExe = null; - - private BuildPropertyGroup parentGlobalProperties; - private ToolsetDefinitionLocations toolsetSearchLocations; - private string startupDirectory; - - private static readonly char[] parameterDelimiters = { ';' }; - private static readonly char[] valueDelimiters = { '=' }; - - private LocalNodeInfo[] nodeData; - - // Timeouts and contants - private const int initializationTimeout = 10 * 1000; // 10 seconds to process the init message - private const int launchTimeout = 60 * 1000; // 60 seconds to launch the process - private const int maximumNodeRestartCount = 2; // try twice to connect to the node - private const int shutdownResponseTimeout = 1000; // every second check if the children are still alive - private static int shutdownTimeout = 30; // Wait for 30 seconds for all nodes to shutdown. - #endregion - - #region Local enums - internal enum NodeState - { - /// - /// This node has not been launched - /// - NotLaunched = 0, - /// - /// This node is in progress of being launched - /// - LaunchInProgress = 1, - /// - /// This node is launched - /// - Launched = 2, - /// - /// This node has been shutdown - /// - Shutdown = 3 - } - #endregion - } -} diff --git a/src/Deprecated/Engine/LocalProvider/LocalNodeProviderGlobalNames.cs b/src/Deprecated/Engine/LocalProvider/LocalNodeProviderGlobalNames.cs deleted file mode 100644 index fd704d3f171..00000000000 --- a/src/Deprecated/Engine/LocalProvider/LocalNodeProviderGlobalNames.cs +++ /dev/null @@ -1,170 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System.Reflection; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class is shared between LocalNode and LocalNodeProvider and contains all the global name generation logic - /// - internal static class LocalNodeProviderGlobalNames - { - #region Methods - - #region Names used for startup and shutdown communication between node and the node provider - /// - /// If this event is set the node host process is currently running - /// - /// - /// - internal static string NodeActiveEventName(int nodeNumber) - { - if (nodePostfix == null) - { - InitializeGlobalNamePostFixValues(); - } - return "Node_" + nodeNumber + "_ActiveReady_" + nodePostfix; - } - - /// - /// If this event is set the node is currently running a build - /// - /// - /// - internal static string NodeInUseEventName(int nodeNumber) - { - if (nodePostfix == null) - { - InitializeGlobalNamePostFixValues(); - } - return "Node_" + nodeNumber + "_InUse_" + nodePostfix; - } - - /// - /// If this event is set the node will immediatelly exit. The event is used by the - /// parent engine to cause the node to exit if communication is lost. - /// - /// - /// - internal static string NodeErrorShutdownEventName(int nodeNumber) - { - if (nodePostfix == null) - { - InitializeGlobalNamePostFixValues(); - } - return "Node_" + nodeNumber + "_ErrorShutdown_" + nodePostfix; - } - - /// - /// If this event exists the node is reserved for use by a particular parent engine - /// the node keeps a handle to this event during builds to prevent it from being used - /// by another parent engine if the original dies - /// - /// - /// - internal static string NodeReserveEventName(int nodeNumber) - { - if (nodePostfix == null) - { - InitializeGlobalNamePostFixValues(); - } - return "Node_" + nodeNumber + "_ProviderMutex_" + nodePostfix; - } - - /// - /// This event is used to signal to the node to create its shared memory buffers. It is used - /// to prevent squating attacks by ensuring the both end points (child and parent) have - /// same privilege levels - /// - /// - /// - internal static string NodeInitiateActivationEventName(int nodeNumber) - { - if (nodePostfix == null) - { - InitializeGlobalNamePostFixValues(); - } - return "Node_" + nodeNumber + "_InitiateActivation_" + nodePostfix; - } - - /// - /// - /// - /// - /// - internal static string NodeActivedEventName(int nodeNumber) - { - if (nodePostfix == null) - { - InitializeGlobalNamePostFixValues(); - } - return "Node_" + nodeNumber + "_Activated_" + nodePostfix; - } - - #endregion - - #region Names used for shared memory communication - /// - /// The name of the shared memory from the parent to the node - /// - /// - /// - internal static string NodeInputMemoryName(int nodeNumber) - { - if (nodePostfix == null) - { - InitializeGlobalNamePostFixValues(); - } - return "Node_" + nodeNumber + "_In_SharedMemory_" + nodePostfix; - } - - /// - /// The name of the shared memory from the node to the parent - /// - /// - /// - internal static string NodeOutputMemoryName(int nodeNumber) - { - if (nodePostfix == null) - { - InitializeGlobalNamePostFixValues(); - } - return "Node_" + nodeNumber + "_Out_SharedMemory_" + nodePostfix; - } - - #endregion - - /// - /// Use reflection to figure out the version of Microsoft.Build.Engine.dll - /// - private static void InitializeGlobalNamePostFixValues() - { - AssemblyName name = new AssemblyName(Assembly.GetExecutingAssembly().FullName); - string engineVersion = name.Version.ToString(); - string accountTypePostfix; - if (NativeMethods.IsUserAdministrator()) - { - accountTypePostfix = "Admin"; - } - else - { - accountTypePostfix = "NotAdmin"; - } - // As per the msdn docs for WindowsIdentity.Name Property The logon name is in the form DOMAIN\USERNAME. so replace the \ so it is not confused as a path - string usernamePostFix = System.Security.Principal.WindowsIdentity.GetCurrent().Name.Replace("\\", "_"); - - nodePostfix = engineVersion + accountTypePostfix + usernamePostFix; - } - - #endregion - - #region Data - private static string nodePostfix = null; - #endregion - } -} diff --git a/src/Deprecated/Engine/LocalProvider/NativeMethods.cs b/src/Deprecated/Engine/LocalProvider/NativeMethods.cs deleted file mode 100644 index 42a02af1012..00000000000 --- a/src/Deprecated/Engine/LocalProvider/NativeMethods.cs +++ /dev/null @@ -1,223 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using Microsoft.Win32.SafeHandles; -using System.Runtime.InteropServices; - -namespace Microsoft.Build.BuildEngine -{ - internal static class NativeMethods - { - internal static readonly IntPtr NullPtr = IntPtr.Zero; - internal static readonly IntPtr InvalidHandle = new IntPtr(-1); - - internal const uint PAGE_READWRITE = 0x04; - internal const uint FILE_MAP_ALL_ACCESS = 0x000F0000 | - 0x0001 | - 0x0002 | - 0x0004 | - 0x0008 | - 0x0010; - internal const uint NORMAL_PRIORITY_CLASS = 0x0020; - internal const uint CREATE_NO_WINDOW = 0x08000000; - internal const Int32 STARTF_USESTDHANDLES = 0x00000100; - internal const uint PAGE_SIZE = 4096; - internal const int SECURITY_DESCRIPTOR_REVISION = 1; - internal const int ERROR_SUCCESS = 0; - - internal const string ADMINONLYSDDL = "D:" + //Discretionary ACL - "(A;OICI;GA;;;BA)" + //Allow full control to administrators - "(A;OICI;GA;;;SY)"; //Allow full control to System - - [DllImport("advapi32.dll", SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - internal static extern bool CheckTokenMembership - ( - IntPtr TokenHandle, - IntPtr SidToCheck, - [Out, MarshalAs(UnmanagedType.Bool)] - out bool IsMember - ); - - [DllImport("advapi32.dll", SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - internal static extern bool AllocateAndInitializeSid - ( - IntPtr siaNtAuthority, - byte nSubAuthorityCount, - int dwSubAuthority0, int dwSubAuthority1, - int dwSubAuthority2, int dwSubAuthority3, - int dwSubAuthority4, int dwSubAuthority5, - int dwSubAuthority6, int dwSubAuthority7, - out IntPtr pSid - ); - - [DllImport("kernel32.dll", SetLastError = true)] - internal static extern IntPtr LocalFree(IntPtr hMem); - - [DllImport("advapi32.dll", SetLastError = true)] - internal static extern IntPtr FreeSid(IntPtr pSid); - - /// - /// Checks to see if the process is running as administrator or not - /// - /// - internal static bool IsUserAdministrator() - { - int SECURITY_BUILTIN_DOMAIN_RID = 0x00000020; - int DOMAIN_ALIAS_RID_ADMINS = 0x00000220; - IntPtr pNtAuthority = Marshal.AllocHGlobal(6); - Marshal.WriteInt32(pNtAuthority, 0, 0); - Marshal.WriteByte(pNtAuthority, 4, 0); - Marshal.WriteByte(pNtAuthority, 5, 5); - IntPtr psidRidGroup; - bool bRet = AllocateAndInitializeSid(pNtAuthority, 2, SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, out psidRidGroup); - try - { - if (bRet) - { - if (!CheckTokenMembership(NullPtr, psidRidGroup, out bRet)) - { - bRet = false; - } - } - } - finally - { - FreeSid(psidRidGroup); - } - - return bRet; - } - - [DllImport("advapi32.dll", SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - internal static extern bool InitializeSecurityDescriptor(IntPtr pSecurityDescriptor, int dwRevision); - - [DllImport("advapi32.dll", SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - internal static extern bool SetSecurityDescriptorDacl - ( - IntPtr pSecurityDescriptor, - [In, MarshalAs(UnmanagedType.Bool)] - bool bDaclPresent, - IntPtr pDacl, - [In, MarshalAs(UnmanagedType.Bool)] - bool bDaclDefaulted - ); - - [DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern SafeFileHandle CreateFileMapping - ( - IntPtr hFile, - IntPtr lpFileMappingAttributes, - uint flProtect, - uint dwMaximumSizeHigh, - uint dwMaximumSizeLow, - string lpName - ); - - [DllImport("kernel32.dll", SetLastError = true)] - internal static extern IntPtr MapViewOfFile - ( - SafeFileHandle handle, - uint dwDesiredAccess, - uint dwFileOffsetHigh, - uint dwFileOffsetLow, - IntPtr dwNumberOfBytesToMap // use IntPtr here because the size will need to change based on processor architecture (32 vs 64bit) - ); - - - [DllImport("kernel32.dll", SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - internal static extern bool UnmapViewOfFile - ( - IntPtr lpBaseAddress - ); - - [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] - [return: MarshalAs(UnmanagedType.Bool)] - internal static extern bool CreateProcess - ( - string lpApplicationName, - string lpCommandLine, - ref SECURITY_ATTRIBUTES lpProcessAttributes, - ref SECURITY_ATTRIBUTES lpThreadAttributes, - [In, MarshalAs(UnmanagedType.Bool)] - bool bInheritHandles, - uint dwCreationFlags, - IntPtr lpEnvironment, - string lpCurrentDirectory, - [In] ref STARTUPINFO lpStartupInfo, - out PROCESS_INFORMATION lpProcessInformation - ); - - [DllImport("advapi32", CharSet = CharSet.Unicode, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - internal static extern bool ConvertStringSecurityDescriptorToSecurityDescriptor - ( - string StringSecurityDescriptor, - uint SDRevision, - ref IntPtr SecurityDescriptor, - ref uint SecurityDescriptorSize - ); - - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] - internal struct STARTUPINFO - { - internal Int32 cb; - internal string lpReserved; - internal string lpDesktop; - internal string lpTitle; - internal Int32 dwX; - internal Int32 dwY; - internal Int32 dwXSize; - internal Int32 dwYSize; - internal Int32 dwXCountChars; - internal Int32 dwYCountChars; - internal Int32 dwFillAttribute; - internal Int32 dwFlags; - internal Int16 wShowWindow; - internal Int16 cbReserved2; - internal IntPtr lpReserved2; - internal IntPtr hStdInput; - internal IntPtr hStdOutput; - internal IntPtr hStdError; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SECURITY_DESCRIPTOR - { - public byte Revision; - public byte Sbz1; - public short Control; - public int Owner; // void* - public int Group; // void* - public int Sacl; // ACL* - public int Dacl; // ACL* - } - - [StructLayout(LayoutKind.Sequential)] - internal struct PROCESS_INFORMATION - { - private IntPtr hProcess; - private IntPtr hThread; - private int dwProcessId; - private int dwThreadId; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SECURITY_ATTRIBUTES - { - public int nLength; - public IntPtr lpSecurityDescriptor; - public int bInheritHandle; - } - } -} - diff --git a/src/Deprecated/Engine/LocalProvider/SharedMemory.cs b/src/Deprecated/Engine/LocalProvider/SharedMemory.cs deleted file mode 100644 index a6ed3b99142..00000000000 --- a/src/Deprecated/Engine/LocalProvider/SharedMemory.cs +++ /dev/null @@ -1,972 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.IO; -using System.Collections; -using System.Diagnostics; -using System.Runtime.Serialization.Formatters.Binary; -using System.Runtime.InteropServices; -using System.Threading; - -using Microsoft.Win32.SafeHandles; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - internal enum SharedMemoryType - { - ReadOnly, - WriteOnly - } - - /// - /// The shared memory is used to transmit serialized LocalCallDescriptors. - /// These local call descriptors encapsulate commands and data that needs - /// to be communicated between the parent and child objects. This enumeration - /// is used by the shared memory to mark what kind of LocalCallDescriptor - /// object is in the shared memory so it can be correctly deserialized. - /// This marker is placed at the front of object in the shared memory. - /// Enumeration of LocalCallDescriptor Types - /// - internal enum ObjectType - { - // Has the object been serialized using .net serialization (binary formatter) - NetSerialization = 1, - // Used to mark that the next int read represents how many bytes are in the - // large object which is about to be sent - FrameMarker = 2, - // Mark the end of the batch in sharedMemory. - EndMarker = 3, - // Below are the enumeration values are for messages / commands which are - // passed between the child and the parent processes - PostBuildRequests = 4, - PostBuildResult = 5, - PostLoggingMessagesToHost = 6, - UpdateNodeSettings = 7, - RequestStatus = 8, - PostStatus = 9, - InitializeNode = 10, - InitializationComplete = 11, - ShutdownNode = 12, - ShutdownComplete = 13, - PostIntrospectorCommand = 14, - GenericSingleObjectReply = 15, - PostCacheEntriesToHost = 16, - GetCacheEntriesFromHost = 17 - } - - /// - /// This class is responsible for providing a communication channel between - /// a child process and a parent process. Each process (child or parent) will - /// have two SharedMemory class instances, one for reading and one for writing. - /// For example, a parent will have one shared memory class to "read" data - /// sent from the child and one "write" shared The shared memory communicates - /// through named shared memory regions. - /// - internal class SharedMemory : IDisposable - { - #region Construction - - private SharedMemory() - { - } - - /// - /// Constructor - /// - /// - /// The name the shared memory will be given, this is combination of node, - /// username, admin status, and some other ones, - /// see LocalNodeProviderGlobalNames.NodeInputMemoryName for greater detail. - /// - /// - /// This type determines which lock and stream needs to be instantiated - /// within the shared memory class. For example, - /// read only means, only create a memory stream, - /// a read lock and a backing byte array and a binary reader. A write - /// only type means, create a memory stream, write lock and a binary writer. - /// This type however does not set the type of the memory mapped section, - /// the memory mapped section itself is created - /// with READWRITE access. - /// - /// - /// The shared memory is given a parameter to determine whether or not to - /// reuse an existing mapped memory secion. When the node is first created - /// this is false, however when the shared memory threads are created this - /// is true. We do this because we create the shared memory when the node - /// is created, at this point the there should be no shared memory with the - /// same name. However when we create the reader and writer threads - /// (which happens on node reuse) we want to reuse the memory. - /// - internal SharedMemory(string name, SharedMemoryType type, bool allowExistingMapping) - { - this.type = type; - - InitializeMemoryMapping(name, allowExistingMapping); - - writeBytesRemaining = 0; - readBytesRemaining = 0; - readBytesTotal = 0; - largeObjectsQueue = null; - - // Has the shared memory been properly created and is ready to use - if (IsUsable) - { - // Setup the structures for either a read only or write only stream - InitializeStreams(type); - try - { - // This could fail if two different administrator accounts try and - // access each others nodes as events and semaphores are protected - // against cross account access - InitializeSynchronization(); - } - catch (System.UnauthorizedAccessException) - { - if (writeStream != null) - { - // Closes binary writer and the underlying stream - binaryWriter.Close(); - } - - if (readStream != null) - { - // Closes binary reader and the underlying stream - binaryReader.Close(); - } - - NativeMethods.UnmapViewOfFile(pageFileView); - pageFileMapping.Dispose(); - } - } - } - - /// - /// Creates the shared memory region and map a view to it. - /// - private void InitializeMemoryMapping(string memoryMapName, bool allowExistingMapping) - { - // Null means use the default security permissions - IntPtr pointerToSecurityAttributes = NativeMethods.NullPtr; - IntPtr pSDNative = IntPtr.Zero; - try - { - // Check to see if the user is an administrator, this is done to prevent non - // administrator processes from accessing the shared memory. On a vista machine - // the check does not differentiate beween the application being elevated to have - // administrator rights or the application being started with administrator rights. - // If the user is an administator create a new set of securityAttributes which make - // the shared memory only accessable to administrators. - if (NativeMethods.IsUserAdministrator()) - { - NativeMethods.SECURITY_ATTRIBUTES saAttr = new NativeMethods.SECURITY_ATTRIBUTES(); - uint pSDLength = 0; - if (!NativeMethods.ConvertStringSecurityDescriptorToSecurityDescriptor(NativeMethods.ADMINONLYSDDL, NativeMethods.SECURITY_DESCRIPTOR_REVISION, ref pSDNative, ref pSDLength)) - { - throw new System.ComponentModel.Win32Exception(); - } - - saAttr.bInheritHandle = 0; - saAttr.nLength = Marshal.SizeOf(typeof(NativeMethods.SECURITY_ATTRIBUTES)); - saAttr.lpSecurityDescriptor = pSDNative; - pointerToSecurityAttributes = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(NativeMethods.SECURITY_ATTRIBUTES))); - Marshal.StructureToPtr(saAttr, pointerToSecurityAttributes, true); - } - - // The file mapping has either the default (current user) security permissions or - // permissions restricted to only administrator users depending on the check above. - // If pointerToSecurityAttributes is null the default permissions are used. - this.pageFileMapping = - NativeMethods.CreateFileMapping - ( - NativeMethods.InvalidHandle, - pointerToSecurityAttributes, - NativeMethods.PAGE_READWRITE, - 0, - size + 4, - memoryMapName - ); - - // If only new mappings are allowed and the current one has been created by somebody else - // delete the mapping. Note that we would like to compare the GetLastError value against - // ERROR_ALREADY_EXISTS but CLR sometimes overwrites the last error so to be safe we'll - // not reuse the node for any unsuccessful value. - if (!allowExistingMapping && Marshal.GetLastWin32Error() != NativeMethods.ERROR_SUCCESS) - { - if (!pageFileMapping.IsInvalid && !pageFileMapping.IsClosed) - { - NativeMethods.UnmapViewOfFile(pageFileView); - pageFileMapping.Close(); - } - } - } - finally - { - NativeMethods.LocalFree(pointerToSecurityAttributes); - NativeMethods.LocalFree(pSDNative); - } - - if (!this.pageFileMapping.IsInvalid && !pageFileMapping.IsClosed) - { - // Maps a view of a file mapping into the address space of the calling process so that we can use the - // view to read and write to the shared memory region. - this.pageFileView = - NativeMethods.MapViewOfFile - ( - this.pageFileMapping, - NativeMethods.FILE_MAP_ALL_ACCESS, // Give the map read, write, and copy access - 0, // Start mapped view at high order offset 0 - 0, // Start mapped view at low order offset 0 - // The size of the shared memory plus some extra space for an int - // to write the number of bytes written - (IntPtr)(size + 4) - ); - - // Check to see if the file view has been created on the fileMapping. - if (this.pageFileView == NativeMethods.NullPtr) - { - // Make the shared memory not usable. - this.pageFileMapping.Close(); - } - else - { - this.name = memoryMapName; - } - } - } - - /// - /// Initialize the MemoryStreams which will be used to contain the serialized data from the LocalCallDescriptors. - /// - private void InitializeStreams(SharedMemoryType streamType) - { - // Initialize the .net binary formatter in case we need to use .net serialization. - this.binaryFormatter = new BinaryFormatter(); - this.loggingTypeCache = new Hashtable(); - - if (streamType == SharedMemoryType.ReadOnly) - { - this.readBuffer = new byte[size]; - this.readStream = new MemoryStream(this.readBuffer); - this.binaryReader = new BinaryReader(this.readStream); - readLock = new object(); - } - else if (streamType == SharedMemoryType.WriteOnly) - { - this.writeStream = new MemoryStream(); - writeLock = new object(); - this.binaryWriter = new BinaryWriter(this.writeStream); - } - else - { - ErrorUtilities.VerifyThrow(false, "Unknown shared memory type."); - } - } - - /// - /// Initialize the synchronization variables which will be used to communicate the status of the shared memory between processes. - /// - private void InitializeSynchronization() - { - this.unreadBatchCounter = new Semaphore(0, size, this.name + "UnreadBatchCounter"); - this.fullFlag = new EventWaitHandle(false, EventResetMode.ManualReset, this.name + "FullFlag"); - this.notFullFlag = new EventWaitHandle(true, EventResetMode.ManualReset, this.name + "NotFullFlag"); - this.readActionCounter = new Semaphore(0, size + /* for full-flag */ 1, this.name + "ReadActionCounter"); - // Make sure the count of unread batches is 0 - while (NumberOfUnreadBatches > 0) - { - DecrementUnreadBatchCounter(); - } - } - - #endregion - - #region Disposal - - protected virtual void Dispose(bool disposing) - { - if (!disposed) - { - if (IsUsable) - { - NativeMethods.UnmapViewOfFile(pageFileView); - pageFileMapping.Dispose(); - - unreadBatchCounter.Close(); - fullFlag.Close(); - notFullFlag.Close(); - readActionCounter.Close(); - } - - if (writeStream != null) - { - // Closes binary writer and the underlying stream - binaryWriter.Close(); - } - - if (readStream != null) - { - // Closes binary reader and the underlying stream - binaryReader.Close(); - } - - // Set the sentinel. - disposed = true; - - // Suppress finalization of this disposed instance. - if (disposing) - { - GC.SuppressFinalize(this); - } - } - } - - public void Dispose() - { - Dispose(true); - } - - ~SharedMemory() - { - Dispose(); - } - - #endregion - - #region Properties - /// - /// Indicates the shared memory region been created and initialized properly. - /// - internal bool IsUsable - { - get - { - return !pageFileMapping.IsInvalid && - !pageFileMapping.IsClosed && - (pageFileView != NativeMethods.NullPtr); - } - } - - /// - /// Returns the readActionCounter as a WaitHandle. This WaitHandle is used - /// to notify the SharedMemory reader threads that there is something ready - /// in the shared memory to be read. The ReadFlag will remain set as long as - /// the number of times the shared memory has been read is less than the - /// number of times writer thread has written to the shared memory. - /// - internal WaitHandle ReadFlag - { - get - { - return readActionCounter; - } - } - - /// - /// Indicates when the SharedMemory is full - /// - private bool IsFull - { - get - { - // If the flag is set true is returned - // A timeout of 0 means the WaitOne will time out - // instantly and return false if the flag is not set. - return fullFlag.WaitOne(0, false); - } - } - /// - /// The NumberOfUnreadBatches is the number of "batches" written to shared - /// memory which have not been read yet by the ReaderThread. A batch - /// contains one or more serialized objects. - /// - private int NumberOfUnreadBatches - { - get - { - // Relese the semaphore, this will return the number of times the - // semaphore was entered into. This value reflects the count before - // the release is taken into account. - int numberOfUnreadBatches = unreadBatchCounter.Release(); - // Decrement the semaphore to offset the increment used to get the count. - unreadBatchCounter.WaitOne(); - - return numberOfUnreadBatches; - } - } - - #endregion - - #region Methods - - /// - /// The shared memory is now full, set the correct synchronization variables to - /// inform the reader thread of this situation. - /// - private void MarkAsFull() - { - fullFlag.Set(); - notFullFlag.Reset(); - readActionCounter.Release(); - } - - /// - /// The shared memory is no longer full. Set the correct synchronization variables - /// to inform the writer thread of this situation. - /// - private void MarkAsNotFull() - { - fullFlag.Reset(); - notFullFlag.Set(); - } - - /// - /// A batch is now in the shared memory and is ready to be read by the reader thread. - /// - private void IncrementUnreadBatchCounter() - { - // Release increments a semaphore - // http://msdn2.microsoft.com/en-us/library/system.threading.semaphore.aspx - unreadBatchCounter.Release(); - readActionCounter.Release(); - } - - /// - /// A batch has just been read out of shared memory. - /// - private void DecrementUnreadBatchCounter() - { - // WaitOne decrements the semaphore - unreadBatchCounter.WaitOne(); - } - - /// - /// This function write out a set of objects into the shared buffer. - /// In normal operation all the objects in the queue are serialized into - /// the buffer followed by an end marker class. If the buffer is not big - /// enough to contain a single object the object is broken into - /// multiple buffers as follows - first a frame marker is sent containing - /// the size of the serialized object + size of end marker. The reader makes - /// sure upon receiving the frame marker that its buffer is large enough - /// to contain the object about to be sent. After the frame marker the object - /// is sent as a series of buffers until all of it is written out. - /// - /// Queue of objects to be sent (mostly logging messages) - /// Queue of high priority objects (these are commands and statuses) - /// If true the function will block until both queues are empty - internal void Write(DualQueue objectsToWrite, DualQueue objectsToWriteHiPriority, bool blockUntilDone) - { - Debug.Assert(type == SharedMemoryType.WriteOnly, "Should only be calling Write from a writeonly shared memory object"); - - lock (writeLock) - { - // Loop as long as there are objects availiable and room in the shared memory. - // If blockUntilDone is set continue to loop until all of the objects in both queues are sent. - while ((objectsToWrite.Count > 0 || objectsToWriteHiPriority.Count > 0) && - ((blockUntilDone && notFullFlag.WaitOne()) || !IsFull)) - { - bool isFull = false; - long writeStartPosition = writeStream.Position; - bool writeEndMarker = false; - - // Put as many LocalCallDescriptor objects as possible into the shared memory - while (!isFull && (objectsToWrite.Count > 0 || objectsToWriteHiPriority.Count > 0)) - { - long writeResetPosition = writeStream.Position; - - DualQueue currentQueue = objectsToWriteHiPriority.Count > 0 ? objectsToWriteHiPriority : objectsToWrite; - - // writeBytesRemaining == 0 is when we are currently not sending a multi part object through - // the shared memory - if (writeBytesRemaining == 0) - { - // Serialize the object to the memory stream - SerializeCallDescriptorToStream(currentQueue); - - // If the size of the serialized object plus the end marker fits within the shared memory - // dequeue the object as it is going to be sent. - if ((writeStream.Position + sizeof(byte)) <= size) - { - currentQueue.Dequeue(); - writeEndMarker = true; - } - else - { - // The serialized object plus the end marker is larger than the shared memory buffer - // Check if it necessary break down the object into multiple buffers - // If the memoryStream was empty before trying to serialize the object - // create a frame marker with the size of the object and send through the shared memory - if (writeResetPosition == 0) - { - // We don't want to switch from low priority to high priority queue in the middle of sending a large object - // so we make a record of which queue contains the large object - largeObjectsQueue = currentQueue; - // Calculate the total number of bytes that needs to be sent - writeBytesRemaining = (int)(writeStream.Position + sizeof(byte)); - // Send a frame marker out to the reader containing the size of the object - writeStream.Position = 0; - - // Write the frameMarkerId byte and then the amount of bytes for the large object - writeStream.WriteByte((byte)ObjectType.FrameMarker); - binaryWriter.Write((Int32)writeBytesRemaining); - writeEndMarker = true; - } - else - { - // Some items were placed in the shared Memory buffer, erase the last one which was too large - // and say the buffer is full so it can be sent - writeStream.Position = writeResetPosition; - } - isFull = true; - } - } - else - { - if (writeStream.Position == 0) - { - // Serialize the object which will be split across multiple buffers - SerializeCallDescriptorToStream(largeObjectsQueue); - writeStream.WriteByte((byte)ObjectType.EndMarker); - } - break; - } - } - - // If a multi-buffer object is being sent and the large object is still larger or equal to the shard memory buffer - send the next chunk of the object - if (writeBytesRemaining != 0 && writeStream.Position >= size) - { - // Set write Length to an entire buffer length or just the remaining portion - int writeLength = writeBytesRemaining > size ? size : writeBytesRemaining; - - //Write the length of the buffer to the memory file - Marshal.WriteInt32((IntPtr)pageFileView, (int)writeLength); - Marshal.Copy - ( - writeStream.GetBuffer(), // Source Buffer - (int)(writeStream.Position - writeBytesRemaining), // Start index - (IntPtr)((int)pageFileView + 4), //Destination (+4 because of the int written to the memory file with the write length) - (int)writeLength // Length of bytes to write - ); - - writeBytesRemaining -= writeLength; - IncrementUnreadBatchCounter(); - - // Once the object is fully sent - remove it from the queue - if (writeBytesRemaining == 0) - { - largeObjectsQueue.Dequeue(); - } - - isFull = true; - } - - if (writeEndMarker) - { - writeStream.WriteByte((byte)ObjectType.EndMarker); - // Need to verify the WriteInt32 and ReadInt32 are always atomic operations - //writeSizeMutex.WaitOne(); - // Write the size of the buffer to send to the memory stream - Marshal.WriteInt32((IntPtr)pageFileView, (int)writeStream.Position); - //writeSizeMutex.ReleaseMutex(); - - Marshal.Copy - ( - writeStream.GetBuffer(), // Buffer - (int)writeStartPosition, // Start Position - (IntPtr)((int)pageFileView + writeStartPosition + 4), // Destination + 4 for the int indicating the size of the data to be copied to the memory file - (int)(writeStream.Position - writeStartPosition) // Length of data to copy to memory file - ); - - IncrementUnreadBatchCounter(); - } - - if (isFull) - { - MarkAsFull(); - writeStream.SetLength(0); - } - } - } - } - - /// - /// Serialize the first object in the queue to the a memory stream which will be copied into shared memory. - /// The write stream which is being written to is not the shared memory itself, it is a memory stream from which - /// bytes will be copied and placed in the shared memory in the write method. - /// - private void SerializeCallDescriptorToStream(DualQueue objectsToWrite) - { - // Get the object by peeking at the queue rather than dequeueing the object. This is done - // because we only want to dequeue the object when it has completely been put in shared memory. - // This may be done right away if the object is small enough to fit in the shared memory or - // may happen after a the object is sent as a number of smaller chunks. - object objectToWrite = objectsToWrite.Peek(); - Debug.Assert(objectToWrite != null, "Expect to get a non-null object from the queue"); - if (objectToWrite is LocalCallDescriptorForPostBuildResult) - { - writeStream.WriteByte((byte)ObjectType.PostBuildResult); - ((LocalCallDescriptorForPostBuildResult)objectToWrite).WriteToStream(binaryWriter); - } - else if (objectToWrite is LocalCallDescriptorForPostBuildRequests) - { - writeStream.WriteByte((byte)ObjectType.PostBuildRequests); - ((LocalCallDescriptorForPostBuildRequests)objectToWrite).WriteToStream(binaryWriter); - } - else if (objectToWrite is LocalCallDescriptorForPostLoggingMessagesToHost) - { - writeStream.WriteByte((byte)ObjectType.PostLoggingMessagesToHost); - ((LocalCallDescriptorForPostLoggingMessagesToHost)objectToWrite).WriteToStream(binaryWriter, loggingTypeCache); - } - else if (objectToWrite is LocalCallDescriptorForInitializeNode) - { - writeStream.WriteByte((byte)ObjectType.InitializeNode); - ((LocalCallDescriptorForInitializeNode)objectToWrite).WriteToStream(binaryWriter); - } - else if (objectToWrite is LocalCallDescriptorForInitializationComplete) - { - writeStream.WriteByte((byte)ObjectType.InitializationComplete); - ((LocalCallDescriptorForInitializationComplete)objectToWrite).WriteToStream(binaryWriter); - } - else if (objectToWrite is LocalCallDescriptorForUpdateNodeSettings) - { - writeStream.WriteByte((byte)ObjectType.UpdateNodeSettings); - ((LocalCallDescriptorForUpdateNodeSettings)objectToWrite).WriteToStream(binaryWriter); - } - else if (objectToWrite is LocalCallDescriptorForRequestStatus) - { - writeStream.WriteByte((byte)ObjectType.RequestStatus); - ((LocalCallDescriptorForRequestStatus)objectToWrite).WriteToStream(binaryWriter); - } - else if (objectToWrite is LocalCallDescriptorForPostingCacheEntriesToHost) - { - writeStream.WriteByte((byte)ObjectType.PostCacheEntriesToHost); - ((LocalCallDescriptorForPostingCacheEntriesToHost)objectToWrite).WriteToStream(binaryWriter); - } - else if (objectToWrite is LocalCallDescriptorForGettingCacheEntriesFromHost) - { - writeStream.WriteByte((byte)ObjectType.GetCacheEntriesFromHost); - ((LocalCallDescriptorForGettingCacheEntriesFromHost)objectToWrite).WriteToStream(binaryWriter); - } - else if (objectToWrite is LocalCallDescriptorForShutdownComplete) - { - writeStream.WriteByte((byte)ObjectType.ShutdownComplete); - ((LocalCallDescriptorForShutdownComplete)objectToWrite).WriteToStream(binaryWriter); - } - else if (objectToWrite is LocalCallDescriptorForShutdownNode) - { - writeStream.WriteByte((byte)ObjectType.ShutdownNode); - ((LocalCallDescriptorForShutdownNode)objectToWrite).WriteToStream(binaryWriter); - } - else if (objectToWrite is LocalCallDescriptorForPostIntrospectorCommand) - { - writeStream.WriteByte((byte)ObjectType.PostIntrospectorCommand); - ((LocalCallDescriptorForPostIntrospectorCommand)objectToWrite).WriteToStream(binaryWriter); - } - else if (objectToWrite is LocalReplyCallDescriptor) - { - writeStream.WriteByte((byte)ObjectType.GenericSingleObjectReply); - ((LocalReplyCallDescriptor)objectToWrite).WriteToStream(binaryWriter); - } - else if (objectToWrite is LocalCallDescriptorForPostStatus) - { - writeStream.WriteByte((byte)ObjectType.PostStatus); - ((LocalCallDescriptorForPostStatus)objectToWrite).WriteToStream(binaryWriter); - } - else - { - // If the object is not one of the well known local descriptors, use .net Serialization to serialize the object - writeStream.WriteByte((byte)ObjectType.NetSerialization); - binaryFormatter.Serialize(writeStream, objectToWrite); - } - } - - /// - /// This function reads data from the shared memory buffer and returns a list - /// of deserialized LocalCallDescriptors or null. The method will return null - /// if the object being sent accross is a multi buffer object. Read needs to - /// be called multiple times until the entire large object has been recived. - /// Once this has happened the large object is deserialized and returned in - /// the Ilist. Read is used by the shared memory reader threads in the LocalNode - /// (child end) and the LocalNodeProvider(ParentEnd) to read LocalCallDescriptors - /// from the shared memory. Read is called from loops in the SharedMemoryReaderThread - /// - internal IList Read() - { - ErrorUtilities.VerifyThrow(type == SharedMemoryType.ReadOnly, "Should only be calling Read from a readonly shared memory object"); - ArrayList objectsRead = null; - lock (readLock) - { - if (NumberOfUnreadBatches > 0) - { - // The read stream is a memory stream where data read from the shared memory section - // will be copied to. From this memory stream LocalCallDescriptors are deserialized. - // Stream position may not be 0 if we are reading a multipart object - int readStartPosition = (int)readStream.Position; - - // Read the first int from the memory file. This indicates the number of bytes written to - // shared memory by the write method. - int endWritePosition = Marshal.ReadInt32((IntPtr)((int)pageFileView)); - - // Copy the bytes written into the shared memory section into the readStream memory stream. - Marshal.Copy - ( - (IntPtr)((int)pageFileView + 4 + readStream.Position), // Source - readBuffer, //Destination - (int)(readStream.Position + (readBytesTotal - readBytesRemaining)), // Start Index - (int)(endWritePosition - readStream.Position) //Length of data - ); - - // If a multi buffer object is being read - decrement the bytes remaining - if (readBytesRemaining != 0) - { - readBytesRemaining -= endWritePosition; - } - - // If a multi buffer object is not being read (or just completed) - try - // deserializing the data from the buffer into a set of objects - if (readBytesRemaining == 0) - { - objectsRead = new ArrayList(); - - int objectId; - // Deserialize the object in the read stream to a LocalCallDescriptor. The objectId - // is the "ObjectType" which was written to the head of the object when written to the memory stream. - // It describes which kind of object was serialized - object objectRead = DeserializeFromStream(out objectId); - - // Check if the writer wants to sent a multi-buffer object, by checking - // if the top object is a frame marker. - if (readStartPosition == 0) - { - if ((int)ObjectType.FrameMarker == objectId) - { - int frameSizeInPages = (int)((((int)objectRead) + NativeMethods.PAGE_SIZE) - / NativeMethods.PAGE_SIZE); - - // Read the end marker off the stream - objectId = binaryReader.ReadByte(); - - // Allocate a bigger readStream buffer to contain the large object which will be sent if necessary - if (readBuffer.Length < frameSizeInPages * NativeMethods.PAGE_SIZE) - { - // Close the binary reader and the underlying stream before recreating a larger buffer - binaryReader.Close(); - - this.readBuffer = new byte[frameSizeInPages * NativeMethods.PAGE_SIZE]; - this.readStream = new MemoryStream(this.readBuffer); - this.readStream.Position = 0; - - // ReCreate the reader on the new stream - binaryReader = new BinaryReader(readStream); - } - - readBytesRemaining = (int)objectRead; - readBytesTotal = (int)objectRead; - } - else - { - readBytesTotal = 0; - } - } - - // Deserialized the objects in the read stream and add them into the arrayList as long as - // we did not encounter a frameMarker which says a large object is next or the end marker - // which marks the end of the batch. - while (((int)ObjectType.EndMarker != objectId) && ((int)ObjectType.FrameMarker != objectId)) - { - objectsRead.Add(objectRead); - objectRead = DeserializeFromStream(out objectId); - } - } - - DecrementUnreadBatchCounter(); - } - else - { - MarkAsNotFull(); - readStream.Position = 0; - } - } - - return objectsRead; - } - - /// - /// This method first reads the objectId as an int from the stream, - /// this int should be found in the "ObjectType" enumeration. This - /// objectId informs the method what kind of object should be - /// deserialized and returned from the method. The objectId is an - /// output parameter. This parameter is also returned so it can be - /// used in the read and write methods to determine if - /// a frame or end marker was found. - /// - private object DeserializeFromStream(out int objectId) - { - object objectRead = null; - objectId = readStream.ReadByte(); - switch ((ObjectType)objectId) - { - case ObjectType.NetSerialization: - // codeql[cs/dangerous-binary-deserialization] BinaryFormatter is still present due to the skip-release deprecation requirement of Visual Studio. Removal has been scheduled for Oct 2024 in conjunction with VS 17.3 branching. - objectRead = binaryFormatter.Deserialize(readStream); - break; - case ObjectType.FrameMarker: - objectRead = binaryReader.ReadInt32(); - break; - case ObjectType.PostBuildResult: - objectRead = new LocalCallDescriptorForPostBuildResult(); - ((LocalCallDescriptorForPostBuildResult)objectRead).CreateFromStream(binaryReader); - break; - case ObjectType.PostBuildRequests: - objectRead = new LocalCallDescriptorForPostBuildRequests(); - ((LocalCallDescriptorForPostBuildRequests)objectRead).CreateFromStream(binaryReader); - break; - case ObjectType.PostLoggingMessagesToHost: - objectRead = new LocalCallDescriptorForPostLoggingMessagesToHost(); - ((LocalCallDescriptorForPostLoggingMessagesToHost)objectRead).CreateFromStream(binaryReader, loggingTypeCache); - break; - case ObjectType.InitializeNode: - objectRead = new LocalCallDescriptorForInitializeNode(); - ((LocalCallDescriptorForInitializeNode)objectRead).CreateFromStream(binaryReader); - break; - case ObjectType.InitializationComplete: - objectRead = new LocalCallDescriptorForInitializationComplete(); - ((LocalCallDescriptorForInitializationComplete)objectRead).CreateFromStream(binaryReader); - break; - case ObjectType.UpdateNodeSettings: - objectRead = new LocalCallDescriptorForUpdateNodeSettings(); - ((LocalCallDescriptorForUpdateNodeSettings)objectRead).CreateFromStream(binaryReader); - break; - case ObjectType.RequestStatus: - objectRead = new LocalCallDescriptorForRequestStatus(); - ((LocalCallDescriptorForRequestStatus)objectRead).CreateFromStream(binaryReader); - break; - case ObjectType.PostCacheEntriesToHost: - objectRead = new LocalCallDescriptorForPostingCacheEntriesToHost(); - ((LocalCallDescriptorForPostingCacheEntriesToHost)objectRead).CreateFromStream(binaryReader); - break; - case ObjectType.GetCacheEntriesFromHost: - objectRead = new LocalCallDescriptorForGettingCacheEntriesFromHost(); - ((LocalCallDescriptorForGettingCacheEntriesFromHost)objectRead).CreateFromStream(binaryReader); - break; - case ObjectType.ShutdownComplete: - objectRead = new LocalCallDescriptorForShutdownComplete(); - ((LocalCallDescriptorForShutdownComplete)objectRead).CreateFromStream(binaryReader); - break; - case ObjectType.ShutdownNode: - objectRead = new LocalCallDescriptorForShutdownNode(); - ((LocalCallDescriptorForShutdownNode)objectRead).CreateFromStream(binaryReader); - break; - case ObjectType.PostIntrospectorCommand: - objectRead = new LocalCallDescriptorForPostIntrospectorCommand(null, null); - ((LocalCallDescriptorForPostIntrospectorCommand)objectRead).CreateFromStream(binaryReader); - break; - case ObjectType.GenericSingleObjectReply: - objectRead = new LocalReplyCallDescriptor(); - ((LocalReplyCallDescriptor)objectRead).CreateFromStream(binaryReader); - break; - case ObjectType.PostStatus: - objectRead = new LocalCallDescriptorForPostStatus(); - ((LocalCallDescriptorForPostStatus)objectRead).CreateFromStream(binaryReader); - break; - case ObjectType.EndMarker: - return null; - default: - ErrorUtilities.VerifyThrow(false, "Should not be here, ObjectId:" + objectId + "Next:" + readStream.ReadByte()); - break; - } - return objectRead; - } - - /// - /// Reset the state of the shared memory, this is called when the node is - /// initialized for the first time or when the node is activated due to node reuse. - /// - internal void Reset() - { - if (readStream != null) - { - readStream.Position = 0; - } - if (writeStream != null) - { - writeStream.SetLength(0); - Marshal.WriteInt32((IntPtr)pageFileView, (int)writeStream.Position); - } - largeObjectsQueue = null; - } - - #endregion - - #region Member data - - private const int size = 100 * 1024; - private string name; - private SafeFileHandle pageFileMapping; - private IntPtr pageFileView; - - private BinaryFormatter binaryFormatter; - - // Binary reader and writer used to read and write from the memory streams used to contain the deserialized LocalCallDescriptors before and after they are copied - // to and from the shared memory region. - private BinaryWriter binaryWriter; - private BinaryReader binaryReader; - - /// - /// Memory stream to contain the deserialized objects before they are sent accross the shared memory region - /// - private MemoryStream writeStream; - - // Backing byte array of the readStream - private byte[] readBuffer; - private MemoryStream readStream; - - // The count on a semaphore is decremented each time a thread enters the semaphore, - // and incremented when a thread releases the semaphore. - // When the count is zero, subsequent requests block until other threads release the semaphore. - // A semaphore is considered siginaled when the count > 1 and not siginaled when the count is 0. - - // unreadBatchCounter is used to track how many batches are remaining to be read from shared memory. - private Semaphore unreadBatchCounter; - - //Used to inform the shared memory reader threads the writer thread has written something in shared memory to read. - //The semaphore is incremented when the shared memory is full and when there is an unreadBatch availiable to be read or the shared memory is full. - //The semaphore is decremented when the shared memory reader thread is about to read from the shared memory. - private Semaphore readActionCounter; - - // Whether or not the shared memory is full - private EventWaitHandle fullFlag; - private EventWaitHandle notFullFlag; - - private object writeLock; - private object readLock; - - // How many bytes remain to be written for the large object to be fully written to shared memory - private int writeBytesRemaining; - // How many bytes remain to be read for the large object to be fully read to shared memory - private int readBytesRemaining; - // How many bytes is the large object in size - private int readBytesTotal; - - // Have we disposed this object yet; - private bool disposed; - - // Is the memory read only or write only - private SharedMemoryType type; - - // Because we are using reflection to get the writeToStream and readFromStream methods from the classes in the framework assembly we found - // we were spending a lot of time reflecting for these methods. The loggingTypeCache, caches the methodInfo for the classes and then look them - // up when serializing or deserializing the objects. - private Hashtable loggingTypeCache; - - // Keep a pointer to the queue which contains the large object which is being deserialized. We do this because we want to make sure - // after the object is properly sent we dequeue off the correct queue. - private DualQueue largeObjectsQueue; - #endregion - } -} diff --git a/src/Deprecated/Engine/Logging/BaseConsoleLogger.cs b/src/Deprecated/Engine/Logging/BaseConsoleLogger.cs deleted file mode 100644 index e95d131901a..00000000000 --- a/src/Deprecated/Engine/Logging/BaseConsoleLogger.cs +++ /dev/null @@ -1,1138 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Text; -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine.Shared; -using System.Collections; -using System.Globalization; -using System.IO; - -namespace Microsoft.Build.BuildEngine -{ - #region Delegates - internal delegate void WriteLinePrettyFromResourceDelegate(int indentLevel, string resourceString, params object[] args); - #endregion - - internal abstract class BaseConsoleLogger : INodeLogger - { - #region Properties - /// - /// Gets or sets the level of detail to show in the event log. - /// - /// Verbosity level. - public LoggerVerbosity Verbosity - { - get - { - return verbosity; - } - - set - { - verbosity = value; - } - } - - /// - /// The console logger takes a single parameter to suppress the output of the errors - /// and warnings summary at the end of a build. - /// - /// null - public string Parameters - { - get - { - return loggerParameters; - } - - set - { - loggerParameters = value; - } - } - - /// - /// Suppresses the display of project headers. Project headers are - /// displayed by default unless this property is set. - /// - /// This is only needed by the IDE logger. - internal bool SkipProjectStartedText - { - get - { - return skipProjectStartedText; - } - - set - { - skipProjectStartedText = value; - } - } - - /// - /// Suppresses the display of error and warnings summary. - /// - internal bool ShowSummary - { - get - { - return showSummary ?? false; - } - - set - { - showSummary = value; - } - } - - /// - /// Provide access to the write hander delegate so that it can be redirected - /// if necessary (e.g. to a file) - /// - protected WriteHandler WriteHandler - { - get - { - return write; - } - - set - { - write = value; - } - } - #endregion - - /// - /// Parses out the logger parameters from the Parameters string. - /// - public void ParseParameters() - { - if (loggerParameters != null) - { - string[] parameterComponents = loggerParameters.Split(parameterDelimiters); - for (int param = 0; param < parameterComponents.Length; param++) - { - if (parameterComponents[param].Length > 0) - { - string[] parameterAndValue = parameterComponents[param].Split(parameterValueSplitCharacter); - - if (parameterAndValue.Length > 1) - { - ApplyParameter(parameterAndValue[0], parameterAndValue[1]); - } - else - { - ApplyParameter(parameterAndValue[0], null); - } - } - } - } - } - - /// - /// An implementation of IComparer useful for comparing the keys - /// on DictionaryEntry's - /// - /// Uses CurrentCulture for display purposes - internal class DictionaryEntryKeyComparer : IComparer - { - public int Compare(Object a, Object b) - { - return String.Compare( - (string)(((DictionaryEntry)a).Key), - (string)(((DictionaryEntry)b).Key), - true /*case insensitive*/, CultureInfo.CurrentCulture); - } - } - - /// - /// An implementation of IComparer useful for comparing the ItemSpecs - /// on ITaskItem's - /// - /// Uses CurrentCulture for display purposes - internal class ITaskItemItemSpecComparer : IComparer - { - public int Compare(Object a, Object b) - { - return String.Compare( - (string)(((ITaskItem)a).ItemSpec), - (string)(((ITaskItem)b).ItemSpec), - true /*case insensitive*/, CultureInfo.CurrentCulture); - } - } - - /// - /// Indents the given string by the specified number of spaces. - /// - /// String to indent. - /// Depth to indent. - internal string IndentString(string s, int indent) - { - // It's possible the event has a null message - if (s == null) - { - s = String.Empty; - } - - // This will never return an empty array. The returned array will always - // have at least one non-null element, even if "s" is totally empty. - String[] subStrings = SplitStringOnNewLines(s); - - StringBuilder result = new StringBuilder( - (subStrings.Length * indent) + - (subStrings.Length * Environment.NewLine.Length) + - s.Length); - - for (int i = 0; i < subStrings.Length; i++) - { - result.Append(' ', indent).Append(subStrings[i]); - result.AppendLine(); - } - - return result.ToString(); - } - - /// - /// Splits strings on 'newLines' with tollerance for Everett and Dogfood builds. - /// - /// String to split. - internal static string[] SplitStringOnNewLines(string s) - { - string[] subStrings = s.Split(newLines, StringSplitOptions.None); - return subStrings; - } - - /// - /// Writes a newline to the log. - /// - internal void WriteNewLine() - { - write(Environment.NewLine); - } - - /// - /// Writes a line from a resource string to the log, using the default indentation. - /// - /// - /// - internal void WriteLinePrettyFromResource(string resourceString, params object[] args) - { - int indentLevel = IsVerbosityAtLeast(LoggerVerbosity.Normal) ? this.currentIndentLevel : 0; - WriteLinePrettyFromResource(indentLevel, resourceString, args); - } - - /// - /// Writes a line from a resource string to the log, using the specified indentation. - /// - internal void WriteLinePrettyFromResource(int indentLevel, string resourceString, params object[] args) - { - string formattedString = ResourceUtilities.FormatResourceString(resourceString, args); - WriteLinePretty(indentLevel, formattedString); - } - - /// - /// Writes to the log, using the default indentation. Does not - /// terminate with a newline. - /// - internal void WritePretty(string formattedString) - { - int indentLevel = IsVerbosityAtLeast(LoggerVerbosity.Normal) ? this.currentIndentLevel : 0; - WritePretty(indentLevel, formattedString); - } - - /// - /// If requested, display a performance summary at the end of the build. This - /// shows how much time (and # hits) were spent inside of each project, target, - /// and task. - /// - internal void ShowPerfSummary() - { - // Show project performance summary. - if (projectPerformanceCounters != null) - { - setColor(ConsoleColor.Green); - WriteNewLine(); - WriteLinePrettyFromResource("ProjectPerformanceSummary"); - - setColor(ConsoleColor.Gray); - DisplayCounters(projectPerformanceCounters); - } - - // Show target performance summary. - if (targetPerformanceCounters != null) - { - setColor(ConsoleColor.Green); - WriteNewLine(); - WriteLinePrettyFromResource("TargetPerformanceSummary"); - - setColor(ConsoleColor.Gray); - DisplayCounters(targetPerformanceCounters); - } - - // Show task performance summary. - if (taskPerformanceCounters != null) - { - setColor(ConsoleColor.Green); - WriteNewLine(); - WriteLinePrettyFromResource("TaskPerformanceSummary"); - - setColor(ConsoleColor.Gray); - DisplayCounters(taskPerformanceCounters); - } - - resetColor(); - } - - /// - /// Writes to the log, using the specified indentation. Does not - /// terminate with a newline. - /// - internal void WritePretty(int indentLevel, string formattedString) - { - StringBuilder result = new StringBuilder(); - result.Append(' ', indentLevel * tabWidth).Append(formattedString); - write(result.ToString()); - } - - /// - /// Writes a line to the log, using the default indentation. - /// - /// - internal void WriteLinePretty(string formattedString) - { - int indentLevel = IsVerbosityAtLeast(LoggerVerbosity.Normal) ? this.currentIndentLevel : 0; - WriteLinePretty(indentLevel, formattedString); - } - - /// - /// Writes a line to the log, using the specified indentation. - /// - internal void WriteLinePretty(int indentLevel, string formattedString) - { - indentLevel = indentLevel > 0 ? indentLevel : 0; - write(IndentString(formattedString, indentLevel * tabWidth)); - } - - /// - /// Check to see what kind of device we are outputting the log to, is it a character device, a file, or something else - /// this can be used by loggers to modify their outputs based on the device they are writing to - /// - internal void IsRunningWithCharacterFileType() - { - // Get the std out handle - IntPtr stdHandle = Microsoft.Build.BuildEngine.Shared.NativeMethods.GetStdHandle(Microsoft.Build.BuildEngine.Shared.NativeMethods.STD_OUTPUT_HANDLE); - - if (stdHandle != Microsoft.Build.BuildEngine.NativeMethods.InvalidHandle) - { - uint fileType = Microsoft.Build.BuildEngine.Shared.NativeMethods.GetFileType(stdHandle); - - // The std out is a char type(LPT or Console) - runningWithCharacterFileType = fileType == Microsoft.Build.BuildEngine.Shared.NativeMethods.FILE_TYPE_CHAR; - } - else - { - runningWithCharacterFileType = false; - } - } - - /// - /// Determines whether the current verbosity setting is at least the value - /// passed in. - /// - internal bool IsVerbosityAtLeast(LoggerVerbosity checkVerbosity) - { - return this.verbosity >= checkVerbosity; - } - - /// - /// Sets foreground color to color specified - /// - internal static void SetColor(ConsoleColor c) - { - Console.ForegroundColor = - TransformColor(c, Console.BackgroundColor); - } - - /// - /// Changes the foreground color to black if the foreground is the - /// same as the background. Changes the foreground to white if the - /// background is black. - /// - /// foreground color for black - /// current background - internal static ConsoleColor TransformColor(ConsoleColor foreground, - ConsoleColor background) - { - ConsoleColor result = foreground; //typically do nothing ... - - if (foreground == background) - { - if (background != ConsoleColor.Black) - { - result = ConsoleColor.Black; - } - else - { - result = ConsoleColor.Gray; - } - } - - return result; - } - - /// - /// Does nothing, meets the ColorSetter delegate type - /// - /// foreground color (is ignored) - internal static void DontSetColor(ConsoleColor c) - { - // do nothing... - } - - /// - /// Does nothing, meets the ColorResetter delegate type - /// - internal static void DontResetColor() - { - // do nothing... - } - - internal void InitializeConsoleMethods(LoggerVerbosity logverbosity, WriteHandler logwriter, ColorSetter colorSet, ColorResetter colorReset) - { - this.verbosity = logverbosity; - this.write = logwriter; - IsRunningWithCharacterFileType(); - // This is a workaround, because the Console class provides no way to check that a color - // can actually be set or not. Color cannot be set if the console has been redirected - // in certain ways (e.g. how BUILD.EXE does it) - bool canSetColor = true; - - try - { - ConsoleColor c = Console.BackgroundColor; - } - catch (IOException) - { - // If the attempt to set a color fails with an IO exception then it is - // likely that the console has been redirected in a way that cannot - // cope with color (e.g. BUILD.EXE) so don't try to do color again. - canSetColor = false; - } - - if ((colorSet != null) && canSetColor) - { - this.setColor = colorSet; - } - else - { - this.setColor = new ColorSetter(DontSetColor); - } - - if ((colorReset != null) && canSetColor) - { - this.resetColor = colorReset; - } - else - { - this.resetColor = new ColorResetter(DontResetColor); - } - } - - /// - /// Writes out the list of property names and their values. - /// This could be done at any time during the build to show the latest - /// property values, using the cached reference to the list from the - /// appropriate ProjectStarted event. - /// - /// List of properties - internal void WriteProperties(ArrayList properties) - { - if (Verbosity == LoggerVerbosity.Diagnostic && showItemAndPropertyList) - { - if (properties.Count == 0) - { - return; - } - - OutputProperties(properties); - // Add a blank line - WriteNewLine(); - } - } - - /// - /// Generate an arraylist which contains the properties referenced - /// by the properties enumerable object - /// - internal ArrayList ExtractPropertyList(IEnumerable properties) - { - // Gather a sorted list of all the properties. - ArrayList list = new ArrayList(); - foreach (DictionaryEntry prop in properties) - { - list.Add(prop); - } - list.Sort(new DictionaryEntryKeyComparer()); - return list; - } - - internal virtual void OutputProperties(ArrayList list) - { - // Write the banner - setColor(ConsoleColor.Green); - WriteLinePretty(currentIndentLevel, ResourceUtilities.FormatResourceString("PropertyListHeader")); - // Write each property name and its value, one per line - foreach (DictionaryEntry prop in list) - { - setColor(ConsoleColor.Gray); - WritePretty(String.Format(CultureInfo.CurrentCulture, "{0,-30} = ", prop.Key)); - setColor(ConsoleColor.DarkGray); - WriteLinePretty((string)(prop.Value)); - } - resetColor(); - } - - /// - /// Writes out the list of item specs and their metadata. - /// This could be done at any time during the build to show the latest - /// items, using the cached reference to the list from the - /// appropriate ProjectStarted event. - /// - /// List of items - internal void WriteItems(SortedList itemTypes) - { - if (Verbosity == LoggerVerbosity.Diagnostic && showItemAndPropertyList) - { - if (itemTypes.Count == 0) - { - return; - } - - // Write the banner - setColor(ConsoleColor.Green); - WriteLinePretty(currentIndentLevel, ResourceUtilities.FormatResourceString("ItemListHeader")); - - // Write each item type and its itemspec, one per line - foreach (DictionaryEntry entry in itemTypes) - { - string itemType = (string)entry.Key; - ArrayList itemTypeList = (ArrayList)entry.Value; - - if (itemTypeList.Count == 0) - { - continue; - } - - // Sort the list by itemSpec - itemTypeList.Sort(new ITaskItemItemSpecComparer()); - OutputItems(itemType, itemTypeList); - } - - // Add a blank line - WriteNewLine(); - } - } - - /// - /// Extract the Items from the enumerable object and return a sorted list containing these items - /// - internal SortedList ExtractItemList(IEnumerable items) - { - // The "items" list is a flat list of itemtype-ITaskItem pairs. - // We would like to organize the ITaskItems into groups by itemtype. - - // Use a SortedList instead of an ArrayList (because we need to lookup fast) - // and instead of a Hashtable (because we need to sort it) - SortedList itemTypes = new SortedList(CaseInsensitiveComparer.Default); - foreach (DictionaryEntry item in items) - { - // Create a new list for this itemtype, if we haven't already - if (itemTypes[(string)item.Key] == null) - { - itemTypes[(string)item.Key] = new ArrayList(); - } - - // Add the item to the list for its itemtype - ArrayList itemsOfAType = (ArrayList)itemTypes[(string)item.Key]; - itemsOfAType.Add(item.Value); - } - - return itemTypes; - } - - internal virtual void OutputItems(string itemType, ArrayList itemTypeList) - { - // Write each item, one per line - bool haveWrittenItemType = false; - setColor(ConsoleColor.DarkGray); - foreach (ITaskItem item in itemTypeList) - { - if (!haveWrittenItemType) - { - setColor(ConsoleColor.Gray); - WriteLinePretty(itemType); - haveWrittenItemType = true; - setColor(ConsoleColor.DarkGray); - } - WriteLinePretty(" " /* indent slightly*/ + item.ItemSpec); - - // We could log the metadata for the item here. We choose not to do that, because - // at present there is no way to get only the "custom" meta-data, so the output - // would be cluttered with the "built-in" meta-data. - } - resetColor(); - } - - /// - /// Returns a performance counter for a given scope (either task name or target name) - /// from the given table. - /// - /// Task name or target name. - /// Table that has tasks or targets. - /// - internal static PerformanceCounter GetPerformanceCounter(string scopeName, ref Hashtable table) - { - // Lazily construct the performance counter table. - if (table == null) - { - table = new Hashtable(StringComparer.OrdinalIgnoreCase); - } - - PerformanceCounter counter = (PerformanceCounter)table[scopeName]; - - // And lazily construct the performance counter itself. - if (counter == null) - { - counter = new PerformanceCounter(scopeName); - table[scopeName] = counter; - } - - return counter; - } - - /// - /// Display the timings for each counter in the hashtable - /// - /// - internal void DisplayCounters(Hashtable counters) - { - ArrayList perfCounters = new ArrayList(counters.Values.Count); - perfCounters.AddRange(counters.Values); - - perfCounters.Sort(PerformanceCounter.DescendingByElapsedTimeComparer); - - bool reentrantCounterExists = false; - - WriteLinePrettyFromResourceDelegate lineWriter = new WriteLinePrettyFromResourceDelegate(WriteLinePrettyFromResource); - - foreach (PerformanceCounter counter in perfCounters) - { - if (counter.ReenteredScope) - { - reentrantCounterExists = true; - } - - counter.PrintCounterMessage(lineWriter, setColor, resetColor); - } - - if (reentrantCounterExists) - { - // display an explanation of why there was no value displayed - WriteLinePrettyFromResource(4, "PerformanceReentrancyNote"); - } - } - - /// - /// Records performance information consumed by a task or target. - /// - internal class PerformanceCounter - { - protected string scopeName = String.Empty; - protected int calls = 0; - protected TimeSpan elapsedTime = new TimeSpan(0); - protected bool inScope = false; - protected DateTime scopeStartTime; - protected bool reenteredScope = false; - - /// - /// Construct. - /// - /// - internal PerformanceCounter(string scopeName) - { - this.scopeName = scopeName; - } - - /// - /// Name of the scope. - /// - internal string ScopeName - { - get { return scopeName; } - } - - /// - /// Total number of calls so far. - /// - internal int Calls - { - get { return calls; } - } - - /// - /// Total accumalated time so far. - /// - internal TimeSpan ElapsedTime - { - get { return elapsedTime; } - } - - /// - /// Whether or not this scope was reentered. Timing information is not recorded in these cases. - /// - internal bool ReenteredScope - { - get { return reenteredScope; } - } - - /// - /// Whether or not this task or target is executing right now. - /// - internal bool InScope - { - get { return inScope; } - set - { - if (!reenteredScope) - { - if (InScope && !value) - { - // Edge meaning scope is finishing. - inScope = false; - - elapsedTime += (System.DateTime.Now - scopeStartTime); - } - else if (!InScope && value) - { - // Edge meaning scope is starting. - inScope = true; - - ++calls; - scopeStartTime = System.DateTime.Now; - } - else - { - // Should only happen when a scope is reentrant. - // We don't track these numbers. - reenteredScope = true; - } - } - } - } - - internal virtual void PrintCounterMessage(WriteLinePrettyFromResourceDelegate WriteLinePrettyFromResource, ColorSetter setColor, ColorResetter resetColor) - { - string time; - if (!reenteredScope) - { - // round: submillisecond values are not meaningful - time = String.Format(CultureInfo.CurrentCulture, - "{0,5}", Math.Round(elapsedTime.TotalMilliseconds, 0)); - } - else - { - // no value available; instead display an asterisk - time = " *"; - } - - WriteLinePrettyFromResource - ( - 2, - "PerformanceLine", - time, - String.Format(CultureInfo.CurrentCulture, - "{0,-40}" /* pad to 40 align left */, scopeName), - String.Format(CultureInfo.CurrentCulture, - "{0,3}", calls) - ); - } - - /// - /// Returns an IComparer that will put erformance counters - /// in descending order by elapsed time. - /// - internal static IComparer DescendingByElapsedTimeComparer - { - get { return new DescendingByElapsedTime(); } - } - - /// - /// Private IComparer class for sorting performance counters - /// in descending order by elapsed time. - /// - internal class DescendingByElapsedTime : IComparer - { - /// - /// Compare two PerformanceCounters. - /// - /// - /// - /// - public int Compare(object o1, object o2) - { - PerformanceCounter p1 = (PerformanceCounter)o1; - PerformanceCounter p2 = (PerformanceCounter)o2; - - // don't compare reentrant counters, time is incorrect - // and we want to sort them first - if (!p1.reenteredScope && !p2.reenteredScope) - { - return TimeSpan.Compare(p1.ElapsedTime, p2.ElapsedTime); - } - else if (p1.Equals(p2)) - { - return 0; - } - else if (p1.reenteredScope) - { - // p1 was reentrant; sort first - return -1; - } - else - { - // p2 was reentrant; sort first - return 1; - } - } - } - } - - #region eventHandlers - - public virtual void Shutdown() - { - // do nothing - } - - internal abstract void ResetConsoleLoggerState(); - - public virtual void Initialize(IEventSource eventSource, int nodeCount) - { - numberOfProcessors = nodeCount; - Initialize(eventSource); - } - - /// - /// Signs up the console logger for all build events. - /// - /// Available events. - public virtual void Initialize(IEventSource eventSource) - { - ParseParameters(); - - // Always show perf summary for diagnostic verbosity. - if (IsVerbosityAtLeast(LoggerVerbosity.Diagnostic)) - { - this.showPerfSummary = true; - } - - // If not specifically instructed otherwise, show a summary in normal - // and higher verbosities. - if (showSummary == null && IsVerbosityAtLeast(LoggerVerbosity.Normal)) - { - this.showSummary = true; - } - - if (showOnlyWarnings || showOnlyErrors) - { - this.showSummary = false; - this.showPerfSummary = false; - } - - // Put this after reading the parameters, since it may want to initialize something - // specially based on some parameter value. For example, choose whether to have a summary, based - // on the verbosity. - ResetConsoleLoggerState(); - - // Event source is allowed to be null; this allows the logger to be wrapped by a class that wishes - // to call its event handlers directly. The VS HostLogger does this. - if (eventSource != null) - { - eventSource.BuildStarted += - BuildStartedHandler; - eventSource.BuildFinished += - BuildFinishedHandler; - eventSource.ProjectStarted += - ProjectStartedHandler; - eventSource.ProjectFinished += - ProjectFinishedHandler; - eventSource.TargetStarted += - TargetStartedHandler; - eventSource.TargetFinished += - TargetFinishedHandler; - eventSource.TaskStarted += - TaskStartedHandler; - eventSource.TaskFinished += - TaskFinishedHandler; - - eventSource.ErrorRaised += - ErrorHandler; - eventSource.WarningRaised += - WarningHandler; - eventSource.MessageRaised += - MessageHandler; - - eventSource.CustomEventRaised += - CustomEventHandler; - } - } - - /// - /// Apply a logger parameter. - /// parameterValue may be null, if there is no parameter value. - /// - internal virtual bool ApplyParameter(string parameterName, string parameterValue) - { - ErrorUtilities.VerifyThrowArgumentNull(parameterName, nameof(parameterName)); - - switch (parameterName.ToUpperInvariant()) - { - case "PERFORMANCESUMMARY": - showPerfSummary = true; - return true; - case "NOSUMMARY": - showSummary = false; - return true; - case "SUMMARY": - showSummary = true; - return true; - case "NOITEMANDPROPERTYLIST": - showItemAndPropertyList = false; - return true; - case "WARNINGSONLY": - showOnlyWarnings = true; - return true; - case "ERRORSONLY": - showOnlyErrors = true; - return true; - case "V": - case "VERBOSITY": - { - switch (parameterValue.ToUpperInvariant()) - { - case "Q": - case "QUIET": - verbosity = LoggerVerbosity.Quiet; - return true; - case "M": - case "MINIMAL": - verbosity = LoggerVerbosity.Minimal; - return true; - case "N": - case "NORMAL": - verbosity = LoggerVerbosity.Normal; - return true; - case "D": - case "DETAILED": - verbosity = LoggerVerbosity.Detailed; - return true; - case "DIAG": - case "DIAGNOSTIC": - verbosity = LoggerVerbosity.Diagnostic; - return true; - default: - string errorCode; - string helpKeyword; - string message = ResourceUtilities.FormatResourceString(out errorCode, out helpKeyword, "InvalidVerbosity", parameterValue); - throw new LoggerException(message, null, errorCode, helpKeyword); - } - } - } - - return false; - } - - public abstract void BuildStartedHandler(object sender, BuildStartedEventArgs e); - - public abstract void BuildFinishedHandler(object sender, BuildFinishedEventArgs e); - - public abstract void ProjectStartedHandler(object sender, ProjectStartedEventArgs e); - - public abstract void ProjectFinishedHandler(object sender, ProjectFinishedEventArgs e); - - public abstract void TargetStartedHandler(object sender, TargetStartedEventArgs e); - - public abstract void TargetFinishedHandler(object sender, TargetFinishedEventArgs e); - - public abstract void TaskStartedHandler(object sender, TaskStartedEventArgs e); - - public abstract void TaskFinishedHandler(object sender, TaskFinishedEventArgs e); - - public abstract void ErrorHandler(object sender, BuildErrorEventArgs e); - - public abstract void WarningHandler(object sender, BuildWarningEventArgs e); - - public abstract void MessageHandler(object sender, BuildMessageEventArgs e); - - public abstract void CustomEventHandler(object sender, CustomBuildEventArgs e); - - #endregion - - #region Internal member data - - /// - /// Controls the amount of text displayed by the logger - /// - /// t-jeffv, sumedhk - internal LoggerVerbosity verbosity = LoggerVerbosity.Normal; - - /// - /// Time the build started - /// - /// t-jeffv, sumedhk - internal DateTime buildStarted; - - /// - /// Delegate used to write text - /// - /// t-jeffv, sumedhk - internal WriteHandler write = null; - - /// - /// Delegate used to change text color. - /// - /// t-jeffv, sumedhk - internal ColorSetter setColor = null; - - /// - /// Delegate used to reset text color - /// - /// t-jeffv, sumedhk - internal ColorResetter resetColor = null; - - /// - /// Indicates if project header should not be displayed. - /// - internal bool skipProjectStartedText = false; - - /// - /// Number of spaces that each level of indentation is worth - /// - /// t-jeffv, sumedhk - internal const int tabWidth = 2; - - /// - /// Keeps track of the current indentation level. - /// - /// RGoel - internal int currentIndentLevel = 0; - - /// - /// The kinds of newline breaks we expect. - /// - /// Currently we're not supporting "\r". - internal static readonly string[] newLines = { "\r\n", "\n" }; - - /// - /// Visual separator for projects. Line length was picked arbitrarily. - /// - /// t-jeffv, sumedhk - internal const string projectSeparatorLine = - "__________________________________________________"; - - /// - /// Console logger parameters. - /// - internal string loggerParameters = null; - - /// - /// Console logger parameters delimiters. - /// - internal static readonly char[] parameterDelimiters = { ';' }; - - /// - /// Console logger parameter value split character. - /// - private static readonly char[] parameterValueSplitCharacter = { '=' }; - - /// - /// Console logger should show error and warning summary at the end of build? - /// If null, user has made no indication. - /// - private bool? showSummary; - - /// - /// When true, accumulate performance numbers. - /// - internal bool showPerfSummary = false; - - /// - /// When true, show the list of item and property values at the start of each project - /// - internal bool showItemAndPropertyList = true; - - /// - /// When true, suppresses all messages except for warnings. (And possibly errors, if showOnlyErrors is true.) - /// - protected bool showOnlyWarnings; - - /// - /// When true, suppresses all messages except for errors. (And possibly warnings, if showOnlyWarnings is true.) - /// - protected bool showOnlyErrors; - - internal bool ignoreLoggerErrors = true; - - internal bool runningWithCharacterFileType = false; - - #region Per-build Members - internal int numberOfProcessors = 1; - /// - /// Number of errors encountered in this build - /// - /// t-jeffv, sumedhk - internal int errorCount = 0; - - /// - /// Number of warnings encountered in this build - /// - /// t-jeffv, sumedhk - internal int warningCount = 0; - - /// - /// A list of the errors that have occurred during this build. - /// - internal ArrayList errorList; - - /// - /// A list of the warnings that have occurred during this build. - /// - internal ArrayList warningList; - - /// - /// Accumulated project performance information. - /// - internal Hashtable projectPerformanceCounters; - - /// - /// Accumulated target performance information. - /// - internal Hashtable targetPerformanceCounters; - - /// - /// Accumulated task performance information. - /// - internal Hashtable taskPerformanceCounters; - - #endregion - - #endregion - } -} diff --git a/src/Deprecated/Engine/Logging/ConsoleLogger.cs b/src/Deprecated/Engine/Logging/ConsoleLogger.cs deleted file mode 100644 index c0e71d36c65..00000000000 --- a/src/Deprecated/Engine/Logging/ConsoleLogger.cs +++ /dev/null @@ -1,860 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; - -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - #region Delegates - - /// - /// Delegate to use for writing a string to some location like - /// the console window or the IDE build window. - /// - /// - public delegate void WriteHandler(string message); - - /// - /// Type of delegate used to set console color. - /// - /// Text color - public delegate void ColorSetter(ConsoleColor color); - - /// - /// Type of delegate used to reset console color. - /// - public delegate void ColorResetter(); - - #endregion - - /// - /// This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// This class implements the default logger that outputs event data - /// to the console (stdout). - /// It is a facade: it creates, wraps and delegates to a kind of BaseConsoleLogger, - /// either SerialConsoleLogger or ParallelConsoleLogger. - /// - /// - /// [!WARNING] - /// > This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// This class is not thread safe. - public class ConsoleLogger : INodeLogger - { - private BaseConsoleLogger consoleLogger; - private int numberOfProcessors = 1; - private LoggerVerbosity verbosity; - private WriteHandler write; - private ColorSetter colorSet; - private ColorResetter colorReset; - private string parameters; - private bool skipProjectStartedText = false; - private bool? showSummary; - - #region Constructors - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// - /// Microsoft.Build.Execution - /// Default constructor. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public ConsoleLogger() - : this(LoggerVerbosity.Normal) - { - // do nothing - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Create a logger instance with a specific verbosity. This logs to - /// the default console. - /// - /// Verbosity level. - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public ConsoleLogger(LoggerVerbosity verbosity) - : - this - ( - verbosity, - new WriteHandler(Console.Out.Write), - new ColorSetter(SetColor), - new ColorResetter(Console.ResetColor) - ) - { - // do nothing - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Initializes the logger, with alternate output handlers. - /// - /// - /// - /// - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public ConsoleLogger - ( - LoggerVerbosity verbosity, - WriteHandler write, - ColorSetter colorSet, - ColorResetter colorReset - ) - { - ErrorUtilities.VerifyThrowArgumentNull(write, nameof(write)); - this.verbosity = verbosity; - this.write = write; - this.colorSet = colorSet; - this.colorReset = colorReset; - } - - /// - /// This is called by every event handler for compat reasons -- see DDB #136924 - /// However it will skip after the first call - /// - private void InitializeBaseConsoleLogger() - { - if (consoleLogger == null) - { - bool useMPLogger = false; - if (!string.IsNullOrEmpty(parameters)) - { - string[] parameterComponents = parameters.Split(BaseConsoleLogger.parameterDelimiters); - for (int param = 0; param < parameterComponents.Length; param++) - { - if (parameterComponents[param].Length > 0) - { - if (String.Equals(parameterComponents[param], "ENABLEMPLOGGING", StringComparison.OrdinalIgnoreCase)) - { - useMPLogger = true; - } - if (String.Equals(parameterComponents[param], "DISABLEMPLOGGING", StringComparison.OrdinalIgnoreCase)) - { - useMPLogger = false; - } - } - } - } - - if (numberOfProcessors == 1 && !useMPLogger) - { - consoleLogger = new SerialConsoleLogger(verbosity, write, colorSet, colorReset); - } - else - { - consoleLogger = new ParallelConsoleLogger(verbosity, write, colorSet, colorReset); - } - - if (!string.IsNullOrEmpty(parameters)) - { - consoleLogger.Parameters = parameters; - parameters = null; - } - - if (showSummary != null) - { - consoleLogger.ShowSummary = (bool)showSummary; - } - - consoleLogger.SkipProjectStartedText = skipProjectStartedText; - } - } - - #endregion - - #region Properties - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// - /// Microsoft.Build.Execution - /// Gets or sets the level of detail to show in the event log. - /// - /// Verbosity level. - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public LoggerVerbosity Verbosity - { - get - { - return consoleLogger == null ? verbosity : consoleLogger.Verbosity; - } - - set - { - if (consoleLogger == null) - { - verbosity = value; - } - else - { - consoleLogger.Verbosity = value; - } - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// - /// Microsoft.Build.Execution - /// The console logger takes a single parameter to suppress the output of the errors - /// and warnings summary at the end of a build. - /// - /// null - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public string Parameters - { - get - { - return consoleLogger == null ? parameters : consoleLogger.Parameters; - } - - set - { - if (consoleLogger == null) - { - parameters = value; - } - else - { - consoleLogger.Parameters = value; - } - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Suppresses the display of project headers. Project headers are - /// displayed by default unless this property is set. - /// - /// This is only needed by the IDE logger. - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public bool SkipProjectStartedText - { - get - { - return consoleLogger == null ? skipProjectStartedText : consoleLogger.SkipProjectStartedText; - } - - set - { - if (consoleLogger == null) - { - skipProjectStartedText = value; - } - else - { - consoleLogger.SkipProjectStartedText = value; - } - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// - /// Microsoft.Build.Execution - /// Suppresses the display of error and warnings summary. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public bool ShowSummary - { - get - { - return (consoleLogger == null ? showSummary : consoleLogger.ShowSummary) ?? false; - } - - set - { - if (consoleLogger == null) - { - showSummary = value; - } - else - { - consoleLogger.ShowSummary = value; - } - } - } - - /// - /// Provide access to the write hander delegate so that it can be redirected - /// if necessary (e.g. to a file) - /// - protected WriteHandler WriteHandler - { - get - { - return consoleLogger == null ? write : consoleLogger.write; - } - - set - { - if (consoleLogger == null) - { - write = value; - } - else - { - consoleLogger.write = value; - } - } - } - - #endregion - - #region Methods - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// - /// Microsoft.Build.Execution - /// Apply a parameter. - /// NOTE: This method was public by accident in Whidbey, so it cannot be made internal now. It has - /// no good reason for being public. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public void ApplyParameter(string parameterName, string parameterValue) - { - ErrorUtilities.VerifyThrowInvalidOperation(consoleLogger != null, "MustCallInitializeBeforeApplyParameter"); - consoleLogger.ApplyParameter(parameterName, parameterValue); - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Signs up the console logger for all build events. - /// - /// Available events. - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public virtual void Initialize(IEventSource eventSource) - { - InitializeBaseConsoleLogger(); - consoleLogger.Initialize(eventSource); - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public virtual void Initialize(IEventSource eventSource, int nodeCount) - { - this.numberOfProcessors = nodeCount; - InitializeBaseConsoleLogger(); - consoleLogger.Initialize(eventSource, nodeCount); - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// The console logger does not need to release any resources. - /// This method does nothing. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public virtual void Shutdown() - { - consoleLogger?.Shutdown(); - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Handler for build started events - /// - /// sender (should be null) - /// event arguments - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public void BuildStartedHandler(object sender, BuildStartedEventArgs e) - { - InitializeBaseConsoleLogger(); // for compat: see DDB#136924 - - consoleLogger.BuildStartedHandler(sender, e); - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Handler for build finished events - /// - /// sender (should be null) - /// event arguments - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public void BuildFinishedHandler(object sender, BuildFinishedEventArgs e) - { - InitializeBaseConsoleLogger(); // for compat: see DDB#136924 - - consoleLogger.BuildFinishedHandler(sender, e); - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Handler for project started events - /// - /// sender (should be null) - /// event arguments - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public void ProjectStartedHandler(object sender, ProjectStartedEventArgs e) - { - InitializeBaseConsoleLogger(); // for compat: see DDB#136924 - - consoleLogger.ProjectStartedHandler(sender, e); - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Handler for project finished events - /// - /// sender (should be null) - /// event arguments - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public void ProjectFinishedHandler(object sender, ProjectFinishedEventArgs e) - { - InitializeBaseConsoleLogger(); // for compat: see DDB#136924 - - consoleLogger.ProjectFinishedHandler(sender, e); - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Handler for target started events - /// - /// sender (should be null) - /// event arguments - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public void TargetStartedHandler(object sender, TargetStartedEventArgs e) - { - InitializeBaseConsoleLogger(); // for compat: see DDB#136924 - - consoleLogger.TargetStartedHandler(sender, e); - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Handler for target finished events - /// - /// sender (should be null) - /// event arguments - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public void TargetFinishedHandler(object sender, TargetFinishedEventArgs e) - { - InitializeBaseConsoleLogger(); // for compat: see DDB#136924 - - consoleLogger.TargetFinishedHandler(sender, e); - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Handler for task started events - /// - /// sender (should be null) - /// event arguments - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public void TaskStartedHandler(object sender, TaskStartedEventArgs e) - { - InitializeBaseConsoleLogger(); // for compat: see DDB#136924 - - consoleLogger.TaskStartedHandler(sender, e); - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Handler for task finished events - /// - /// sender (should be null) - /// event arguments - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public void TaskFinishedHandler(object sender, TaskFinishedEventArgs e) - { - InitializeBaseConsoleLogger(); // for compat: see DDB#136924 - - consoleLogger.TaskFinishedHandler(sender, e); - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Prints an error event - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public void ErrorHandler(object sender, BuildErrorEventArgs e) - { - InitializeBaseConsoleLogger(); // for compat: see DDB#136924 - - consoleLogger.ErrorHandler(sender, e); - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Prints a warning event - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public void WarningHandler(object sender, BuildWarningEventArgs e) - { - InitializeBaseConsoleLogger(); // for compat: see DDB#136924 - - consoleLogger.WarningHandler(sender, e); - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Prints a message event - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public void MessageHandler(object sender, BuildMessageEventArgs e) - { - InitializeBaseConsoleLogger(); // for compat: see DDB#136924 - - consoleLogger.MessageHandler(sender, e); - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// - /// Microsoft.Build.Execution - /// Prints a custom event - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public void CustomEventHandler(object sender, CustomBuildEventArgs e) - { - InitializeBaseConsoleLogger(); // for compat: see DDB#136924 - - consoleLogger.CustomEventHandler(sender, e); - } - - /// - /// Sets foreground color to color specified - /// - /// foreground color - internal static void SetColor(ConsoleColor c) - { - Console.ForegroundColor = - TransformColor(c, Console.BackgroundColor); - } - - /// - /// Changes the foreground color to black if the foreground is the - /// same as the background. Changes the foreground to white if the - /// background is black. - /// - /// foreground color for black - /// current background - private static ConsoleColor TransformColor(ConsoleColor foreground, - ConsoleColor background) - { - ConsoleColor result = foreground; //typically do nothing ... - - if (foreground == background) - { - if (background != ConsoleColor.Black) - { - result = ConsoleColor.Black; - } - else - { - result = ConsoleColor.Gray; - } - } - - return result; - } - - #endregion - } -} diff --git a/src/Deprecated/Engine/Logging/DistributedLoggers/ConfigurableForwardingLogger.cs b/src/Deprecated/Engine/Logging/DistributedLoggers/ConfigurableForwardingLogger.cs deleted file mode 100644 index 4ea5d77dfe2..00000000000 --- a/src/Deprecated/Engine/Logging/DistributedLoggers/ConfigurableForwardingLogger.cs +++ /dev/null @@ -1,677 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections.Generic; - -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Logger that forwards events to a central logger (e.g ConsoleLogger) - /// residing on the parent node. - /// - /// - /// [!WARNING] - /// > This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public class ConfigurableForwardingLogger : IForwardingLogger - { - #region Constructors - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Default constructor. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public ConfigurableForwardingLogger() - { - InitializeForwardingTable(); - } - #endregion - - #region Properties - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Gets or sets the level of detail to show in the event log. - /// - /// Verbosity level. - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public LoggerVerbosity Verbosity - { - get { return verbosity; } - set { verbosity = value; } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// The console logger takes a single parameter to suppress the output of the errors - /// and warnings summary at the end of a build. - /// - /// null - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public string Parameters - { - get { return loggerParameters; } - set { loggerParameters = value; } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// This property is set by the build engine to allow a node loggers to forward messages to the - /// central logger - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public IEventRedirector BuildEventRedirector - { - get { return this.buildEventRedirector; } - set { this.buildEventRedirector = value; } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public int NodeId - { - get { return nodeId; } - set { nodeId = value; } - } - #endregion - - #region Methods - - /// - /// Initialize the Forwarding Table with the default values - /// - private void InitializeForwardingTable() - { - forwardingTable = new Dictionary(15, StringComparer.OrdinalIgnoreCase); - forwardingTable[BuildStartedEventDescription] = 0; - forwardingTable[BuildFinishedEventDescription] = 0; - forwardingTable[ProjectStartedEventDescription] = 0; - forwardingTable[ProjectFinishedEventDescription] = 0; - forwardingTable[TargetStartedEventDescription] = 0; - forwardingTable[TargetFinishedEventDescription] = 0; - forwardingTable[TaskStartedEventDescription] = 0; - forwardingTable[TaskFinishedEventDescription] = 0; - forwardingTable[ErrorEventDescription] = 0; - forwardingTable[WarningEventDescription] = 0; - forwardingTable[HighMessageEventDescription] = 0; - forwardingTable[NormalMessageEventDescription] = 0; - forwardingTable[LowMessageEventDescription] = 0; - forwardingTable[CustomEventDescription] = 0; - forwardingTable[CommandLineDescription] = 0; - forwardingSetFromParameters = false; - } - - /// - /// Parses out the logger parameters from the Parameters string. - /// - private void ParseParameters() - { - if (loggerParameters != null) - { - string[] parameterComponents = loggerParameters.Split(parameterDelimiters); - for (int param = 0; param < parameterComponents.Length; param++) - { - if (parameterComponents[param].Length > 0) - { - ApplyParameter(parameterComponents[param]); - } - } - // Setting events to forward on the commandline will override the verbosity and other switches such as - // showPerfSummand and ShowSummary - if (forwardingSetFromParameters) - { - this.showPerfSummary = false; - this.showSummary = true; - } - } - } - - /// - /// Logger parameters can be used to enable and disable specific event types. - /// Otherwise, the verbosity is used to choose which events to forward. - /// - private void ApplyParameter(string parameterName) - { - ErrorUtilities.VerifyThrowArgumentNull(parameterName, nameof(parameterName)); - - if (forwardingTable.ContainsKey(parameterName)) - { - forwardingSetFromParameters = true; - forwardingTable[parameterName] = 1; - } - - // If any of the following parameters are set, we will make sure we forward the events - // necessary for the central logger to emit the requested information - if (String.Equals(parameterName, PerformanceSummaryDescription, StringComparison.OrdinalIgnoreCase)) - { - this.showPerfSummary = true; - } - else if (String.Equals(parameterName, NoSummaryDescription, StringComparison.OrdinalIgnoreCase)) - { - this.showSummary = false; - } - else if (String.Equals(parameterName, ShowCommandLineDescription, StringComparison.OrdinalIgnoreCase)) - { - showCommandLine = true; - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Signs up the console logger for all build events. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public virtual void Initialize(IEventSource eventSource) - { - ErrorUtilities.VerifyThrowArgumentNull(eventSource, nameof(eventSource)); - - ParseParameters(); - - ResetLoggerState(); - - if (!forwardingSetFromParameters) - { - SetForwardingBasedOnVerbosity(); - } - - eventSource.BuildStarted += BuildStartedHandler; - eventSource.BuildFinished += BuildFinishedHandler; - eventSource.ProjectStarted += ProjectStartedHandler; - eventSource.ProjectFinished += ProjectFinishedHandler; - eventSource.TargetStarted += TargetStartedHandler; - eventSource.TargetFinished += TargetFinishedHandler; - eventSource.TaskStarted += TaskStartedHandler; - eventSource.TaskFinished += TaskFinishedHandler; - eventSource.ErrorRaised += ErrorHandler; - eventSource.WarningRaised += WarningHandler; - eventSource.MessageRaised += MessageHandler; - eventSource.CustomEventRaised += CustomEventHandler; - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Signs up the console logger for all build events. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public void Initialize(IEventSource eventSource, int nodeCount) - { - Initialize(eventSource); - } - - private void SetForwardingBasedOnVerbosity() - { - forwardingTable[BuildStartedEventDescription] = 0; - forwardingTable[BuildFinishedEventDescription] = 0; - - if (IsVerbosityAtLeast(LoggerVerbosity.Quiet)) - { - forwardingTable[ErrorEventDescription] = 1; - forwardingTable[WarningEventDescription] = 1; - } - - if (IsVerbosityAtLeast(LoggerVerbosity.Minimal)) - { - forwardingTable[HighMessageEventDescription] = 1; - } - - if (IsVerbosityAtLeast(LoggerVerbosity.Normal)) - { - forwardingTable[NormalMessageEventDescription] = 1; - forwardingTable[ProjectStartedEventDescription] = 1; - forwardingTable[ProjectFinishedEventDescription] = 1; - forwardingTable[TargetStartedEventDescription] = 1; - forwardingTable[TargetFinishedEventDescription] = 1; - } - - if (IsVerbosityAtLeast(LoggerVerbosity.Detailed)) - { - forwardingTable[TargetStartedEventDescription] = 1; - forwardingTable[TargetFinishedEventDescription] = 1; - forwardingTable[TaskStartedEventDescription] = 1; - forwardingTable[TaskFinishedEventDescription] = 1; - forwardingTable[LowMessageEventDescription] = 1; - forwardingTable[CommandLineDescription] = 1; - } - - if (IsVerbosityAtLeast(LoggerVerbosity.Diagnostic)) - { - forwardingTable[CustomEventDescription] = 1; - } - - if (showSummary) - { - forwardingTable[ErrorEventDescription] = 1; - forwardingTable[WarningEventDescription] = 1; - } - - if (this.showPerfSummary) - { - forwardingTable[TargetStartedEventDescription] = 1; - forwardingTable[TargetFinishedEventDescription] = 1; - forwardingTable[TaskStartedEventDescription] = 1; - forwardingTable[TaskFinishedEventDescription] = 1; - forwardingTable[TargetStartedEventDescription] = 1; - forwardingTable[TargetFinishedEventDescription] = 1; - forwardingTable[ProjectStartedEventDescription] = 1; - forwardingTable[ProjectFinishedEventDescription] = 1; - } - - if (this.showCommandLine) - { - forwardingTable[CommandLineDescription] = 1; - } - } - - /// - /// Reset the states of per-build member variables. - /// Used when a build is finished, but the logger might be needed for the next build. - /// - private void ResetLoggerState() - { - // No state needs resetting - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// - /// Microsoft.Build.Execution - /// Called when Engine is done with this logger - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public virtual void Shutdown() - { - // Nothing to do - } - - /// - /// Handler for build started events - /// - /// sender (should be null) - /// event arguments - private void BuildStartedHandler(object sender, BuildStartedEventArgs e) - { - // This is false by default - if (forwardingTable[BuildStartedEventDescription] == 1) - { - ForwardToCentralLogger(e); - } - } - - /// - /// Handler for build finished events - /// - /// sender (should be null) - /// event arguments - private void BuildFinishedHandler(object sender, BuildFinishedEventArgs e) - { - // This is false by default - if (forwardingTable[BuildFinishedEventDescription] == 1) - { - ForwardToCentralLogger(e); - } - ResetLoggerState(); - } - - /// - /// Handler for project started events - /// - /// sender (should be null) - /// event arguments - private void ProjectStartedHandler(object sender, ProjectStartedEventArgs e) - { - if (forwardingTable[ProjectStartedEventDescription] == 1) - { - ForwardToCentralLogger(e); - } - } - - /// - /// Handler for project finished events - /// - /// sender (should be null) - /// event arguments - private void ProjectFinishedHandler(object sender, ProjectFinishedEventArgs e) - { - if (forwardingTable[ProjectFinishedEventDescription] == 1) - { - ForwardToCentralLogger(e); - } - } - - /// - /// Handler for target started events - /// - /// sender (should be null) - /// event arguments - private void TargetStartedHandler(object sender, TargetStartedEventArgs e) - { - if (forwardingTable[TargetStartedEventDescription] == 1) - { - ForwardToCentralLogger(e); - } - } - - /// - /// Handler for target finished events - /// - /// sender (should be null) - /// event arguments - private void TargetFinishedHandler(object sender, TargetFinishedEventArgs e) - { - if (forwardingTable[TargetFinishedEventDescription] == 1) - { - ForwardToCentralLogger(e); - } - } - - /// - /// Handler for task started events - /// - /// sender (should be null) - /// event arguments - private void TaskStartedHandler(object sender, TaskStartedEventArgs e) - { - if (forwardingTable[TaskStartedEventDescription] == 1) - { - ForwardToCentralLogger(e); - } - } - - /// - /// Handler for task finished events - /// - /// sender (should be null) - /// event arguments - private void TaskFinishedHandler(object sender, TaskFinishedEventArgs e) - { - if (forwardingTable[TaskFinishedEventDescription] == 1) - { - ForwardToCentralLogger(e); - } - } - - /// - /// Prints an error event - /// - private void ErrorHandler(object sender, BuildErrorEventArgs e) - { - if (forwardingTable[ErrorEventDescription] == 1) - { - ForwardToCentralLogger(e); - } - } - - /// - /// Prints a warning event - /// - private void WarningHandler(object sender, BuildWarningEventArgs e) - { - if (forwardingTable[WarningEventDescription] == 1) - { - ForwardToCentralLogger(e); - } - } - - /// - /// Prints a message event - /// - private void MessageHandler(object sender, BuildMessageEventArgs e) - { - bool forwardEvent = false; - - if (forwardingTable[LowMessageEventDescription] == 1 && e.Importance == MessageImportance.Low) - { - forwardEvent = true; - } - else if (forwardingTable[NormalMessageEventDescription] == 1 && e.Importance == MessageImportance.Normal) - { - forwardEvent = true; - } - else if (forwardingTable[HighMessageEventDescription] == 1 && e.Importance == MessageImportance.High) - { - forwardEvent = true; - } - else if (forwardingTable[CommandLineDescription] == 1 && e is TaskCommandLineEventArgs) - { - forwardEvent = true; - } - - if (forwardEvent) - { - ForwardToCentralLogger(e); - } - } - - /// - /// Prints a custom event - /// - private void CustomEventHandler(object sender, CustomBuildEventArgs e) - { - if (forwardingTable[CustomEventDescription] == 1) - { - ForwardToCentralLogger(e); - } - } - - protected virtual void ForwardToCentralLogger(BuildEventArgs e) - { - buildEventRedirector.ForwardEvent(e); - } - - /// - /// Determines whether the current verbosity setting is at least the value - /// passed in. - /// - private bool IsVerbosityAtLeast(LoggerVerbosity checkVerbosity) - { - return this.verbosity >= checkVerbosity; - } - #endregion - - #region Private member data - - /// - /// Controls the amount of text displayed by the logger - /// - private LoggerVerbosity verbosity = LoggerVerbosity.Normal; - - /// - /// Console logger parameters. - /// - private string loggerParameters = null; - - /// - /// Console logger parameters delimiters. - /// - private static readonly char[] parameterDelimiters = { ';' }; - - /// - /// Strings that users of this logger can pass in to enable specific events or logger output. - /// Also used as keys into our dictionary. - /// - private const string BuildStartedEventDescription = "BUILDSTARTEDEVENT"; - private const string BuildFinishedEventDescription = "BUILDFINISHEDEVENT"; - private const string ProjectStartedEventDescription = "PROJECTSTARTEDEVENT"; - private const string ProjectFinishedEventDescription = "PROJECTFINISHEDEVENT"; - private const string TargetStartedEventDescription = "TARGETSTARTEDEVENT"; - private const string TargetFinishedEventDescription = "TARGETFINISHEDEVENT"; - private const string TaskStartedEventDescription = "TASKSTARTEDEVENT"; - private const string TaskFinishedEventDescription = "TASKFINISHEDEVENT"; - private const string ErrorEventDescription = "ERROREVENT"; - private const string WarningEventDescription = "WARNINGEVENT"; - private const string HighMessageEventDescription = "HIGHMESSAGEEVENT"; - private const string NormalMessageEventDescription = "NORMALMESSAGEEVENT"; - private const string LowMessageEventDescription = "LOWMESSAGEEVENT"; - private const string CustomEventDescription = "CUSTOMEVENT"; - private const string CommandLineDescription = "COMMANDLINE"; - private const string PerformanceSummaryDescription = "PERFORMANCESUMMARY"; - private const string NoSummaryDescription = "NOSUMMARY"; - private const string ShowCommandLineDescription = "SHOWCOMMANDLINE"; - - #region Per-build Members - - /// - /// A table indicating if a particular event type should be forwarded - /// The value is type int rather than bool to avoid the problem of JITting generics. - /// Dictionary is already compiled into mscorlib. - /// - private Dictionary forwardingTable; - - /// - /// A pointer to the central logger - /// - private IEventRedirector buildEventRedirector; - - /// - /// Indicates if the events to forward are being set by the parameters sent to the logger - /// if this is false the events to forward are based on verbosity else verbosity settings will be ignored - /// - private bool forwardingSetFromParameters; - - /// - /// Console logger should show error and warning summary at the end of build? - /// - private bool showSummary = true; - - /// - /// When true, accumulate performance numbers. - /// - private bool showPerfSummary = false; - - /// - /// When true the commandline message is sent - /// - private bool showCommandLine = false; - - /// - /// Id of the node the logger is attached to - /// - private int nodeId; - - #endregion - #endregion - - } -} diff --git a/src/Deprecated/Engine/Logging/DistributedLoggers/DistributedFileLogger.cs b/src/Deprecated/Engine/Logging/DistributedLoggers/DistributedFileLogger.cs deleted file mode 100644 index bebbfb9ceee..00000000000 --- a/src/Deprecated/Engine/Logging/DistributedLoggers/DistributedFileLogger.cs +++ /dev/null @@ -1,359 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.IO; - -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// This class will create a text file which will contain the build log for that node - /// - /// - /// [!WARNING] - /// > This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public class DistributedFileLogger : IForwardingLogger - { - #region Constructors - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Default constructor. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public DistributedFileLogger() - : base() - { - } - #endregion - - #region Methods - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public void Initialize(IEventSource eventSource, int nodeCount) - { - Initialize(eventSource); - } - - /// - /// Parses out the logger parameters from the Parameters string. - /// - private void ParseFileLoggerParameters() - { - if (this.Parameters != null) - { - string[] parameterComponents = this.Parameters.Split(fileLoggerParameterDelimiters); - for (int param = 0; param < parameterComponents.Length; param++) - { - if (parameterComponents[param].Length > 0) - { - string[] parameterAndValue = parameterComponents[param].Split(fileLoggerParameterValueSplitCharacter); - - if (parameterAndValue.Length > 1) - { - ApplyFileLoggerParameter(parameterAndValue[0], parameterAndValue[1]); - } - else - { - ApplyFileLoggerParameter(parameterAndValue[0], null); - } - } - } - } - } - - /// - /// Apply a parameter - /// - private void ApplyFileLoggerParameter(string parameterName, string parameterValue) - { - if (String.Equals("LOGFILE", parameterName, StringComparison.OrdinalIgnoreCase)) - { - if (string.IsNullOrEmpty(parameterValue)) - { - string message = ResourceUtilities.FormatResourceString("InvalidFileLoggerFile", string.Empty, ResourceUtilities.FormatResourceString("logfilePathNullOrEmpty")); - throw new LoggerException(message); - } - - // Set log file to the right half of the parameter string and then remove it as it is going to be replaced in Initialize - this.logFile = parameterValue; - int indexOfParameter = parameters.IndexOf(parameterName + fileLoggerParameterValueSplitCharacter[0] + parameterValue, 0, StringComparison.OrdinalIgnoreCase); - int length = ((string)(parameterName + fileLoggerParameterValueSplitCharacter[0] + parameterValue)).Length; - // Check to see if the next char is a ; if so remove that as well - if ((indexOfParameter + length) < parameters.Length && parameters[indexOfParameter + length] == ';') - { - length++; - } - parameters = parameters.Remove(indexOfParameter, length); - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public void Initialize(IEventSource eventSource) - { - ErrorUtilities.VerifyThrowArgumentNull(eventSource, nameof(eventSource)); - ParseFileLoggerParameters(); - string fileName = logFile; - try - { - // Create a new file logger and pass it some parameters to make the build log very detailed - nodeFileLogger = new FileLogger(); - string extension = Path.GetExtension(logFile); - // If there is no extension add a default of .log to it - if (String.IsNullOrEmpty(extension)) - { - logFile += ".log"; - extension = ".log"; - } - // Log 0-based node id's, where 0 is the parent. This is a little unnatural for the reader, - // but avoids confusion by being consistent with the Engine and any error messages it may produce. - fileName = logFile.Replace(extension, nodeId + extension); - nodeFileLogger.Verbosity = LoggerVerbosity.Detailed; - nodeFileLogger.Parameters = "ShowEventId;ShowCommandLine;logfile=" + fileName + ";" + parameters; - } - catch (ArgumentException e) // Catching Exception, but rethrowing unless it's a well-known exception. - { - nodeFileLogger?.Shutdown(); - - string errorCode; - string helpKeyword; - string message = ResourceUtilities.FormatResourceString(out errorCode, out helpKeyword, "InvalidFileLoggerFile", fileName, e.Message); - throw new LoggerException(message, e, errorCode, helpKeyword); - } - - // Say we are operating on 2 processors so we can get the multiproc output - nodeFileLogger.Initialize(eventSource, 2); - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public void Shutdown() - { - nodeFileLogger?.Shutdown(); - } - #endregion - - #region Properties - - // Need to access this for testing purposes - internal FileLogger InternalFilelogger - { - get - { - return nodeFileLogger; - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public IEventRedirector BuildEventRedirector - { - get - { - return buildEventRedirector; - } - set - { - buildEventRedirector = value; - } - } - - // Node Id of the node which the forwarding logger is attached to - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public int NodeId - { - get - { - return nodeId; - } - set - { - nodeId = value; - } - } - - // The verbosity for now is set at detailed - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public LoggerVerbosity Verbosity - { - get - { - ErrorUtilities.VerifyThrow(false, "Should not be getting verbosity from distributed file logger"); - return LoggerVerbosity.Detailed; - } - set - { - // Dont really care about verbosity at this point, but dont want to throw exception as it is set for all distributed loggers - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public string Parameters - { - get - { - return parameters; - } - set - { - parameters = value; - } - } - - #endregion - - #region Data - // The file logger which will do the actual logging of the node's build output - private FileLogger nodeFileLogger; - // Reference for the central logger - private IEventRedirector buildEventRedirector; - - // The Id of the node the forwardingLogger is attached to - private int nodeId; - - // Directory to place the log files, by default this will be in the current directory when the node is created - private string logFile = "msbuild.log"; - - // Logger parameters - private string parameters; - // File logger parameters delimiters. - private static readonly char[] fileLoggerParameterDelimiters = { ';' }; - // File logger parameter value split character. - private static readonly char[] fileLoggerParameterValueSplitCharacter = { '=' }; - #endregion - } -} diff --git a/src/Deprecated/Engine/Logging/FileLogger.cs b/src/Deprecated/Engine/Logging/FileLogger.cs deleted file mode 100644 index 4ec8236fa53..00000000000 --- a/src/Deprecated/Engine/Logging/FileLogger.cs +++ /dev/null @@ -1,324 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Text; -using System.IO; - -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// A specialization of the ConsoleLogger that logs to a file instead of the console. - /// The output in terms of what is written and how it looks is identical. For example you can - /// log verbosely to a file using the FileLogger while simultaneously logging only high priority events - /// to the console using a ConsoleLogger. - /// - /// - /// [!WARNING] - /// > This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// It's unfortunate that this is derived from ConsoleLogger, which is itself a facade; it makes things more - /// complex -- for example, there is parameter parsing in this class, plus in BaseConsoleLogger. However we have - /// to derive FileLogger from ConsoleLogger because it shipped that way in Whidbey. - /// - public class FileLogger : ConsoleLogger - { - #region Constructors - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Default constructor. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// KieranMo - public FileLogger() : base(LoggerVerbosity.Normal) - { - this.WriteHandler = new WriteHandler(Write); - } - - #endregion - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// - /// Microsoft.Build.Execution - /// Signs up the console file logger for all build events. - /// This is the backward-compatible overload. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// Available events. - public override void Initialize(IEventSource eventSource) - { - ErrorUtilities.VerifyThrowArgumentNull(eventSource, nameof(eventSource)); - eventSource.BuildFinished += FileLoggerBuildFinished; - InitializeFileLogger(eventSource, 1); - } - - private void FileLoggerBuildFinished(object sender, BuildFinishedEventArgs e) - { - fileWriter?.Flush(); - } - - /// - /// Creates new file for logging - /// - private void InitializeFileLogger(IEventSource eventSource, int nodeCount) - { - // Prepend the default setting of "forcenoalign": no alignment is needed as we're - // writing to a file - string parameters = Parameters; - if (parameters != null) - { - Parameters = "FORCENOALIGN;" + parameters; - } - else - { - Parameters = "FORCENOALIGN;"; - } - - this.ParseFileLoggerParameters(); - - // Finally, ask the base console logger class to initialize. It may - // want to make decisions based on our verbosity, so we do this last. - base.Initialize(eventSource, nodeCount); - - try - { - fileWriter = new StreamWriter(logFileName, append, encoding); - - // We set AutoFlush = true because some tasks generate Unhandled Exceptions - // on foreign threads and MSBuild does not properly Shutdown in this case. - // With AutoFlush set, we try to log everything we can in case Shutdown is - // not called. Hopefully in the future the MSBuild Engine will properly - // handle this case. See VSWhidbey 586850 for more information. - fileWriter.AutoFlush = true; - } - catch (Exception e) // Catching Exception, but rethrowing unless it's a well-known exception. - { - if (ExceptionHandling.NotExpectedException(e)) - { - throw; - } - - string errorCode; - string helpKeyword; - string message = ResourceUtilities.FormatResourceString(out errorCode, out helpKeyword, "InvalidFileLoggerFile", logFileName, e.Message); - fileWriter?.Close(); - throw new LoggerException(message, e.InnerException, errorCode, helpKeyword); - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// - /// Microsoft.Build.Execution - /// Multiproc aware initialization - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public override void Initialize(IEventSource eventSource, int nodeCount) - { - InitializeFileLogger(eventSource, nodeCount); - } - - /// - /// The handler for the write delegate of the console logger we are deriving from. - /// - /// The text to write to the log - private void Write(string text) - { - try - { - fileWriter.Write(text); - } - catch (Exception ex) // Catching Exception, but rethrowing unless it's a well-known exception. - { - if (ExceptionHandling.NotExpectedException(ex)) - { - throw; - } - - string errorCode; - string helpKeyword; - string message = ResourceUtilities.FormatResourceString(out errorCode, out helpKeyword, "InvalidFileLoggerFile", logFileName, ex.Message); - fileWriter?.Close(); - throw new LoggerException(message, ex.InnerException, errorCode, helpKeyword); - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Shutdown method implementation of ILogger - we need to flush and close our logfile. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public override void Shutdown() - { - fileWriter?.Close(); - } - - /// - /// Parses out the logger parameters from the Parameters string. - /// - private void ParseFileLoggerParameters() - { - if (this.Parameters != null) - { - string[] parameterComponents = this.Parameters.Split(fileLoggerParameterDelimiters); - for (int param = 0; param < parameterComponents.Length; param++) - { - if (parameterComponents[param].Length > 0) - { - string[] parameterAndValue = parameterComponents[param].Split(fileLoggerParameterValueSplitCharacter); - - if (parameterAndValue.Length > 1) - { - ApplyFileLoggerParameter(parameterAndValue[0], parameterAndValue[1]); - } - else - { - ApplyFileLoggerParameter(parameterAndValue[0], null); - } - } - } - } - } - - /// - /// Apply a parameter parsed by the file logger. - /// - private void ApplyFileLoggerParameter(string parameterName, string parameterValue) - { - switch (parameterName.ToUpperInvariant()) - { - case "LOGFILE": - this.logFileName = parameterValue; - break; - case "APPEND": - this.append = true; - break; - case "ENCODING": - try - { - this.encoding = Encoding.GetEncoding(parameterValue); - } - catch (ArgumentException ex) - { - // Can't change strings at this point, so for now we are using the exception string - // verbatim, and supplying a error code directly. - // This should move into the .resx later. - throw new LoggerException(ex.Message, ex.InnerException, "MSB4128", null); - } - break; - default: - // We will not error for unrecognized parameters, since someone may wish to - // extend this class and call this base method before theirs. - break; - } - } - - #region Private member data - - /// - /// logFileName is the name of the log file that we will generate - /// the default value is msbuild.log - /// - /// KieranMo - private string logFileName = "msbuild.log"; - - /// - /// fileWriter is the stream that has been opened on our log file. - /// - /// KieranMo - private StreamWriter fileWriter = null; - - /// - /// Whether the logger should append to any existing file. - /// Default is to overwrite. - /// - /// danmose - private bool append = false; - - /// - /// Encoding for the output. Defaults to ANSI. - /// - /// danmose - private Encoding encoding = Encoding.Default; - - /// - /// File logger parameters delimiters. - /// - private static readonly char[] fileLoggerParameterDelimiters = { ';' }; - - /// - /// File logger parameter value split character. - /// - private static readonly char[] fileLoggerParameterValueSplitCharacter = { '=' }; - - #endregion - } -} diff --git a/src/Deprecated/Engine/Logging/LogFormatter.cs b/src/Deprecated/Engine/Logging/LogFormatter.cs deleted file mode 100644 index dfa7ff4a349..00000000000 --- a/src/Deprecated/Engine/Logging/LogFormatter.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Globalization; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// Utility helper functions for formatting logger output. - /// - /// JomoF - internal static class LogFormatter - { - /// - /// Formats the timestamp in the log as Hours:Minutes:Seconds.Milliseconds - /// - internal static string FormatLogTimeStamp(DateTime timeStamp) - { - // From http://msdn2.microsoft.com/en-us/library/8kb3ddd4.aspx - // Custom DateTime Format Strings - // - // HH Represents the hour as a number from 00 through 23, that is, - // the hour as represented by a zero-based 24-hour clock that counts the hours since midnight. - // A single-digit hour is formatted with a leading zero. - // - // mm Represents the minute as a number from 00 through 59. The minute represents whole minutes - // passed since the last hour. A single-digit minute is formatted with a leading zero. - // - // ss Represents the seconds as a number from 00 through 59. The second represents whole seconds passed - // since the last minute. A single-digit second is formatted with a leading zero. - // - // fff Represents the three most significant digits of the seconds fraction. Trailing zeros are displayed. - // Since milliseconds are 1 / 1000 of a second we need to display 3 digits. - - return timeStamp.ToString("HH:mm:ss.fff", CultureInfo.CurrentCulture); - } - - /// - /// Formats a timespan for logger output. - /// - /// JomoF - /// - /// String representation of time-span. - internal static string FormatTimeSpan(TimeSpan t) - { - string rawTime = t.ToString(); // Timespan is a value type and can't be null. - int rawTimeLength = rawTime.Length; - int prettyLength = System.Math.Min(11, rawTimeLength); - return t.ToString().Substring(0, prettyLength); - } - } -} diff --git a/src/Deprecated/Engine/Logging/LoggerDescription.cs b/src/Deprecated/Engine/Logging/LoggerDescription.cs deleted file mode 100644 index e0ed4cba6cd..00000000000 --- a/src/Deprecated/Engine/Logging/LoggerDescription.cs +++ /dev/null @@ -1,419 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Reflection; -using System.IO; - -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// This class is used to contain information about a logger as a collection of values that - /// can be used to instantiate the logger and can be serialized to be passed between different - /// processes. - /// - /// - /// [!WARNING] - /// > This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public class LoggerDescription - { - #region Constructor - - internal LoggerDescription() - { - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Creates a logger description from given data - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public LoggerDescription - ( - string loggerClassName, - string loggerAssemblyName, - string loggerAssemblyFile, - string loggerSwitchParameters, - LoggerVerbosity verbosity - ) - { - this.loggerClassName = loggerClassName; - this.loggerAssembly = new AssemblyLoadInfo(loggerAssemblyName, loggerAssemblyFile); - this.loggerSwitchParameters = loggerSwitchParameters; - this.verbosity = verbosity; - } - - #endregion - - #region Properties - - /// - /// This property exposes the logger id which identifies each distributed logger uniquiely - /// - internal int LoggerId - { - get - { - return this.loggerId; - } - set - { - this.loggerId = value; - } - } - - /// - /// This property generates the logger name by appending together the class name and assembly name - /// - internal string Name - { - get - { - if (!string.IsNullOrEmpty(this.loggerClassName) && - !string.IsNullOrEmpty(this.loggerAssembly.AssemblyFile)) - { - return this.loggerClassName + ":" + this.loggerAssembly.AssemblyFile; - } - else if (!string.IsNullOrEmpty(this.loggerClassName)) - { - return this.loggerClassName; - } - else - { - return this.loggerAssembly.AssemblyFile; - } - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// - /// Microsoft.Build.Execution - /// Returns the string of logger parameters, null if there are none - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public string LoggerSwitchParameters - { - get - { - return loggerSwitchParameters; - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Return the verbosity for this logger (from command line all loggers get same verbosity) - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public LoggerVerbosity Verbosity - { - get - { - return this.verbosity; - } - } - - #endregion - - #region Methods - - /// - /// Create an IForwardingLogger out of the data in this description. This method may throw a variety of - /// reflection exceptions if the data is invalid. It is the resposibility of the caller to handle these - /// exceptions if desired. - /// - /// - internal IForwardingLogger CreateForwardingLogger() - { - return (IForwardingLogger)CreateLogger(true); - } - - /// - /// Create an ILogger out of the data in this description. This method may throw a variety of - /// reflection exceptions if the data is invalid. It is the resposibility of the caller to handle these - /// exceptions if desired. - /// - /// - internal ILogger CreateLogger() - { - return CreateLogger(false); - } - - /// - /// Loads a logger from its assembly, instantiates it, and handles errors. - /// - /// Instantiated logger. - private ILogger CreateLogger(bool forwardingLogger) - { - ILogger logger = null; - - try - { - if (forwardingLogger) - { - // load the logger from its assembly - LoadedType loggerClass = (new TypeLoader(forwardingLoggerClassFilter)).Load(loggerClassName, loggerAssembly); - - if (loggerClass != null) - { - // instantiate the logger - logger = (IForwardingLogger)Activator.CreateInstance(loggerClass.Type); - } - } - else - { - // load the logger from its assembly - LoadedType loggerClass = (new TypeLoader(loggerClassFilter)).Load(loggerClassName, loggerAssembly); - - if (loggerClass != null) - { - // instantiate the logger - logger = (ILogger)Activator.CreateInstance(loggerClass.Type); - } - } - } - catch (TargetInvocationException e) - { - // At this point, the interesting stack is the internal exception; - // the outer exception is System.Reflection stuff that says nothing - // about the nature of the logger failure. - Exception innerException = e.InnerException; - - if (innerException is LoggerException) - { - // Logger failed politely during construction. In order to preserve - // the stack trace at which the error occurred we wrap the original - // exception instead of throwing. - LoggerException l = ((LoggerException)innerException); - throw new LoggerException(l.Message, innerException, l.ErrorCode, l.HelpKeyword); - } - else - { - throw; - } - } - - return logger; - } - - /// - /// Used for finding loggers when reflecting through assemblies. - /// - private static readonly TypeFilter forwardingLoggerClassFilter = new TypeFilter(IsForwardingLoggerClass); - - /// - /// Used for finding loggers when reflecting through assemblies. - /// - private static readonly TypeFilter loggerClassFilter = new TypeFilter(IsLoggerClass); - - /// - /// Checks if the given type is a logger class. - /// - /// This method is used as a TypeFilter delegate. - /// true, if specified type is a logger - private static bool IsForwardingLoggerClass(Type type, object unused) - { - return type.IsClass && - !type.IsAbstract && - (type.GetInterface("IForwardingLogger") != null); - } - - /// - /// Checks if the given type is a logger class. - /// - /// This method is used as a TypeFilter delegate. - /// true, if specified type is a logger - private static bool IsLoggerClass(Type type, object unused) - { - return type.IsClass && - !type.IsAbstract && - (type.GetInterface("ILogger") != null); - } - - /// - /// Converts the path to the logger assembly to a full path - /// - internal void ConvertPathsToFullPaths() - { - if (loggerAssembly.AssemblyFile != null) - { - loggerAssembly = - new AssemblyLoadInfo(loggerAssembly.AssemblyName, Path.GetFullPath(loggerAssembly.AssemblyFile)); - } - } - - #endregion - - #region Data - private string loggerClassName; - private string loggerSwitchParameters; - private AssemblyLoadInfo loggerAssembly; - private LoggerVerbosity verbosity; - private int loggerId; - #endregion - - #region CustomSerializationToStream - internal void WriteToStream(BinaryWriter writer) - { - #region LoggerClassName - if (loggerClassName == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - writer.Write(loggerClassName); - } - #endregion - #region LoggerSwitchParameters - if (loggerSwitchParameters == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - writer.Write(loggerSwitchParameters); - } - #endregion - #region LoggerAssembly - if (loggerAssembly == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - if (loggerAssembly.AssemblyFile == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - writer.Write(loggerAssembly.AssemblyFile); - } - - if (loggerAssembly.AssemblyName == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - writer.Write(loggerAssembly.AssemblyName); - } - } - #endregion - writer.Write((Int32)verbosity); - writer.Write((Int32)loggerId); - } - - internal void CreateFromStream(BinaryReader reader) - { - #region LoggerClassName - if (reader.ReadByte() == 0) - { - loggerClassName = null; - } - else - { - loggerClassName = reader.ReadString(); - } - #endregion - #region LoggerSwitchParameters - if (reader.ReadByte() == 0) - { - loggerSwitchParameters = null; - } - else - { - loggerSwitchParameters = reader.ReadString(); - } - #endregion - #region LoggerAssembly - if (reader.ReadByte() == 0) - { - loggerAssembly = null; - } - else - { - string assemblyName = null; - string assemblyFile = null; - - if (reader.ReadByte() != 0) - { - assemblyFile = reader.ReadString(); - } - - if (reader.ReadByte() != 0) - { - assemblyName = reader.ReadString(); - } - - loggerAssembly = new AssemblyLoadInfo(assemblyName, assemblyFile); - } - #endregion - verbosity = (LoggerVerbosity)reader.ReadInt32(); - loggerId = reader.ReadInt32(); - } - #endregion - } -} diff --git a/src/Deprecated/Engine/Logging/NullCentralLogger.cs b/src/Deprecated/Engine/Logging/NullCentralLogger.cs deleted file mode 100644 index d2652a40c13..00000000000 --- a/src/Deprecated/Engine/Logging/NullCentralLogger.cs +++ /dev/null @@ -1,75 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class will throw an exception when it recieves any event except for the build started or build finished event - /// this logger is good to use if a distributed logger is attached but does not want to forward any events - /// - internal class NullCentralLogger : INodeLogger - { - #region Data - private string parameters; - private LoggerVerbosity verbosity; - #endregion - - #region Properties - public LoggerVerbosity Verbosity - { - get - { - return verbosity; - } - set - { - verbosity = value; - } - } - - public string Parameters - { - get - { - return parameters; - } - set - { - parameters = value; - } - } - #endregion - - #region Methods - public void Initialize(IEventSource eventSource, int nodeCount) - { - eventSource.AnyEventRaised += AnyEventRaisedHandler; - } - - public void AnyEventRaisedHandler(object sender, BuildEventArgs e) - { - if (!(e is BuildStartedEventArgs) && !(e is BuildFinishedEventArgs)) - { - ErrorUtilities.VerifyThrowInvalidOperation(false, "Should not recieve any events other than build started or finished"); - } - } - - public void Initialize(IEventSource eventSource) - { - Initialize(eventSource, 1); - } - - public void Shutdown() - { - // do nothing - } - #endregion - } -} diff --git a/src/Deprecated/Engine/Logging/ParallelLogger/ParallelConsoleLogger.cs b/src/Deprecated/Engine/Logging/ParallelLogger/ParallelConsoleLogger.cs deleted file mode 100644 index ecf3dc192b4..00000000000 --- a/src/Deprecated/Engine/Logging/ParallelLogger/ParallelConsoleLogger.cs +++ /dev/null @@ -1,1628 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Text; -using System.Collections; -using System.Diagnostics; -using System.Globalization; -using System.Collections.Generic; - -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class implements the default logger that outputs event data - /// to the console (stdout). - /// - /// This class is not thread safe. - internal class ParallelConsoleLogger : BaseConsoleLogger - { - #region Constructors - - /// - /// Default constructor. - /// - public ParallelConsoleLogger() - : this(LoggerVerbosity.Normal) - { - // do nothing - } - - /// - /// Create a logger instance with a specific verbosity. This logs to - /// the default console. - /// - public ParallelConsoleLogger(LoggerVerbosity verbosity) - : - this - ( - verbosity, - new WriteHandler(Console.Out.Write), - new ColorSetter(SetColor), - new ColorResetter(Console.ResetColor) - ) - { - // do nothing - } - - /// - /// Initializes the logger, with alternate output handlers. - /// - public ParallelConsoleLogger - ( - LoggerVerbosity verbosity, - WriteHandler write, - ColorSetter colorSet, - ColorResetter colorReset - ) - { - InitializeConsoleMethods(verbosity, write, colorSet, colorReset); - deferredMessages = new Dictionary>(compareContextNodeId); - buildEventManager = new BuildEventManager(); - } - - /// - /// Check to see if the console is going to a char output such as a console,printer or com port, or if it going to a file - /// - private void CheckIfOutputSupportsAlignment() - { - alignMessages = false; - bufferWidth = -1; - - // If forceNoAlign is set there is no point getting the console width as there will be no aligning of the text - if (!forceNoAlign) - { - if (runningWithCharacterFileType) - { - // Get the size of the console buffer so messages can be formatted to the console width - bufferWidth = Console.BufferWidth; - alignMessages = true; - } - else - { - alignMessages = false; - } - } - } - - #endregion - - #region Methods - - /// - /// Allows the logger to take action based on a parameter passed on when initializing the logger - /// - internal override bool ApplyParameter(string parameterName, string parameterValue) - { - if (base.ApplyParameter(parameterName, parameterValue)) - { - return true; - } - if (String.Equals(parameterName, "SHOWCOMMANDLINE", StringComparison.OrdinalIgnoreCase)) - { - showCommandline = true; - return true; - } - else if (String.Equals(parameterName, "SHOWTIMESTAMP", StringComparison.OrdinalIgnoreCase)) - { - showTimeStamp = true; - return true; - } - else if (String.Equals(parameterName, "SHOWEVENTID", StringComparison.OrdinalIgnoreCase)) - { - showEventId = true; - return true; - } - else if (String.Equals(parameterName, "FORCENOALIGN", StringComparison.OrdinalIgnoreCase)) - { - forceNoAlign = true; - alignMessages = false; - return true; - } - return false; - } - - public override void Initialize(IEventSource eventSource) - { - // If the logger is being used in singleproc do not show EventId after each message unless it is set as part of a console parameter - if (numberOfProcessors == 1) - { - showEventId = false; - } - - // Parameters are parsed in Initialize - base.Initialize(eventSource); - CheckIfOutputSupportsAlignment(); - } - - /// - /// Keep track of the last event displayed so target names can be displayed at the correct time - /// - private void ShownBuildEventContext(BuildEventContext e) - { - lastDisplayedBuildEventContext = e; - } - - /// - /// Reset the states of per-build member variables - /// VSW#516376 - /// - internal override void ResetConsoleLoggerState() - { - if (ShowSummary) - { - errorList = new ArrayList(); - warningList = new ArrayList(); - } - else - { - errorList = null; - warningList = null; - } - - errorCount = 0; - warningCount = 0; - projectPerformanceCounters = null; - targetPerformanceCounters = null; - taskPerformanceCounters = null; - hasBuildStarted = false; - - // Reset the two data structures created when the logger was created - buildEventManager = new BuildEventManager(); - deferredMessages = new Dictionary>(compareContextNodeId); - prefixWidth = 0; - lastDisplayedBuildEventContext = null; - } - - /// - /// Handler for build started events - /// - /// sender (should be null) - /// event arguments - public override void BuildStartedHandler(object sender, BuildStartedEventArgs e) - { - buildStarted = e.Timestamp; - hasBuildStarted = true; - - if (showOnlyErrors || showOnlyWarnings) - { - return; - } - - if (IsVerbosityAtLeast(LoggerVerbosity.Normal)) - { - WriteLinePrettyFromResource("BuildStartedWithTime", e.Timestamp); - } - } - - /// - /// Handler for build finished events - /// - /// sender (should be null) - /// event arguments - public override void BuildFinishedHandler(object sender, BuildFinishedEventArgs e) - { - if (!showOnlyErrors && !showOnlyWarnings) - { - // If for some reason we have deferred messages at the end of the build they should be displayed - // so that the reason why they are still buffered can be determined - if (deferredMessages.Count > 0) - { - if (IsVerbosityAtLeast(LoggerVerbosity.Detailed)) - { - // Print out all of the deferred messages - WriteLinePrettyFromResource("DeferredMessages"); - foreach (List messageList in deferredMessages.Values) - { - foreach (BuildMessageEventArgs message in messageList) - { - PrintMessage(message, false); - } - } - } - else if (IsVerbosityAtLeast(LoggerVerbosity.Normal)) - { - // In normal vervosity we do not want to print out the deferred messages but we do want - // to let the users know that there were deferred messages to be seen - WriteLinePrettyFromResource("DeferredMessagesAvailiable"); - } - } - - // Show the performance summary iff the verbosity is diagnostic or the user specifically asked for it - // with a logger parameter. - if (this.showPerfSummary) - { - ShowPerfSummary(); - } - - // if verbosity is normal, detailed or diagnostic - if (IsVerbosityAtLeast(LoggerVerbosity.Normal)) - { - if (e.Succeeded) - { - setColor(ConsoleColor.Green); - } - - // Write the "Build Finished" event. - WriteNewLine(); - WriteLinePretty(e.Message); - resetColor(); - } - - // The decision whether or not to show a summary at this verbosity - // was made during initalization. We just do what we're told. - if (ShowSummary) - { - // We can't display a nice nested summary unless we're at Normal or above, - // since we need to have gotten TargetStarted events, which aren't forwarded otherwise. - if (IsVerbosityAtLeast(LoggerVerbosity.Normal)) - { - ShowNestedErrorWarningSummary(); - - // Emit text like: - // 1 Warning(s) - // 0 Error(s) - // Don't color the line if it's zero. (Per Whidbey behavior.) - if (warningCount > 0) - { - setColor(ConsoleColor.Yellow); - } - WriteLinePrettyFromResource(2, "WarningCount", warningCount); - resetColor(); - - if (errorCount > 0) - { - setColor(ConsoleColor.Red); - } - WriteLinePrettyFromResource(2, "ErrorCount", errorCount); - resetColor(); - } - else - { - ShowFlatErrorWarningSummary(); - } - } - - // if verbosity is normal, detailed or diagnostic - if (IsVerbosityAtLeast(LoggerVerbosity.Normal)) - { - // The time elapsed is the difference between when the BuildStartedEventArg - // was created and when the BuildFinishedEventArg was created - string timeElapsed = LogFormatter.FormatTimeSpan(e.Timestamp - buildStarted); - - WriteNewLine(); - WriteLinePrettyFromResource("TimeElapsed", timeElapsed); - } - } - - ResetConsoleLoggerState(); - CheckIfOutputSupportsAlignment(); - } - - /// - /// At the end of the build, repeats the errors and warnings that occurred - /// during the build, and displays the error count and warning count. - /// Does this in a "flat" style, without context. - /// - private void ShowFlatErrorWarningSummary() - { - if (warningList.Count == 0 && errorList.Count == 0) - { - return; - } - - // If we're showing only warnings and/or errors, don't summarize. - // This is the buildc.err case. There's no point summarizing since we'd just - // repeat the entire log content again. - if (showOnlyErrors || showOnlyWarnings) - { - return; - } - - // Make some effort to distinguish this summary from the output above, since otherwise - // it's not clear in lower verbosities - WriteNewLine(); - - if (warningList.Count > 0) - { - setColor(ConsoleColor.Yellow); - foreach (BuildWarningEventArgs warning in warningList) - { - WriteMessageAligned(EventArgsFormatting.FormatEventMessage(warning, runningWithCharacterFileType), true); - } - } - - if (errorList.Count > 0) - { - setColor(ConsoleColor.Red); - foreach (BuildErrorEventArgs error in errorList) - { - WriteMessageAligned(EventArgsFormatting.FormatEventMessage(error, runningWithCharacterFileType), true); - } - } - - resetColor(); - } - - /// - /// At the end of the build, repeats the errors and warnings that occurred - /// during the build, and displays the error count and warning count. - /// Does this in a "nested" style. - /// - private void ShowNestedErrorWarningSummary() - { - if (warningList.Count == 0 && errorList.Count == 0) - { - return; - } - - // If we're showing only warnings and/or errors, don't summarize. - // This is the buildc.err case. There's no point summarizing since we'd just - // repeat the entire log content again. - if (showOnlyErrors || showOnlyWarnings) - { - return; - } - - if (warningCount > 0) - { - setColor(ConsoleColor.Yellow); - ShowErrorWarningSummary(warningList); - } - - if (errorCount > 0) - { - setColor(ConsoleColor.Red); - ShowErrorWarningSummary(errorList); - } - - resetColor(); - } - - private void ShowErrorWarningSummary(ArrayList listToProcess) where T : BuildEventArgs - { - // Group the build warning event args based on the entry point and the target in which the warning occurred - Dictionary> groupByProjectEntryPoint = new Dictionary>(); - - // Loop through each of the warnings and put them into the correct buckets - for (int listCount = 0; listCount < listToProcess.Count; listCount++) - { - T errorWarningEventArgs = (T)listToProcess[listCount]; - - // Target event may be null for a couple of reasons: - // 1) If the event was from a project load, or engine - // 2) If the flushing of the event queue for each request and result is turned off - // as this could cause errors and warnings to be seen by the logger after the target finished event - // which would cause the error or warning to have no matching target started event as they are removed - // when a target finished event is logged. - // 3) On NORMAL verbosity if the error or warning occurres in a project load then the error or warning and the target started event will be forwarded to - // different forwarding loggers which cannot communicate to each other, meaning there will be no matching target started event logged - // as the forwarding logger did not know to forward the target started event - string targetName = null; - TargetStartedEventMinimumFields targetEvent = buildEventManager.GetTargetStartedEvent(errorWarningEventArgs.BuildEventContext); - - if (targetEvent != null) - { - targetName = targetEvent.TargetName; - } - - // Create a new key from the error event context and the target where the error happened - ErrorWarningSummaryDictionaryKey key = new ErrorWarningSummaryDictionaryKey(errorWarningEventArgs.BuildEventContext, targetName); - - // Check to see if there is a bucket for the warning - if (!groupByProjectEntryPoint.ContainsKey(key)) - { - // If there is no bucket create a new one which contains a list of all the errors which - // happened for a given buildEventContext / target - List errorWarningEventListByTarget = new List(); - groupByProjectEntryPoint.Add(key, errorWarningEventListByTarget); - } - - // Add the error event to the correct bucket - groupByProjectEntryPoint[key].Add(errorWarningEventArgs); - } - - BuildEventContext previousEntryPoint = null; - string previousTarget = null; - // Loop through each of the bucket and print out the stack trace information for the errors - foreach (KeyValuePair> valuePair in groupByProjectEntryPoint) - { - //If the project entrypoint where the error occurred is the same as the previous message do not print the - // stack trace again - if (previousEntryPoint != valuePair.Key.EntryPointContext) - { - WriteNewLine(); - foreach (string s in buildEventManager.ProjectCallStackFromProject(valuePair.Key.EntryPointContext)) - { - WriteMessageAligned(s, false); - } - previousEntryPoint = valuePair.Key.EntryPointContext; - } - - //If the target where the error occurred is the same as the previous message do not print the location - // where the error occurred again - if (!String.Equals(previousTarget, valuePair.Key.TargetName, StringComparison.OrdinalIgnoreCase)) - { - //If no targetName was specified then do not show the target where the error occurred - if (!string.IsNullOrEmpty(valuePair.Key.TargetName)) - { - WriteMessageAligned(ResourceUtilities.FormatResourceString("ErrorWarningInTarget", valuePair.Key.TargetName), false); - } - previousTarget = valuePair.Key.TargetName; - } - - // Print out all of the errors under the ProjectEntryPoint / target - foreach (T errorWarningEvent in valuePair.Value) - { - if (errorWarningEvent is BuildErrorEventArgs) - { - WriteMessageAligned(" " + EventArgsFormatting.FormatEventMessage(errorWarningEvent as BuildErrorEventArgs, runningWithCharacterFileType), false); - } - else if (errorWarningEvent is BuildWarningEventArgs) - { - WriteMessageAligned(" " + EventArgsFormatting.FormatEventMessage(errorWarningEvent as BuildWarningEventArgs, runningWithCharacterFileType), false); - } - } - WriteNewLine(); - } - } - - /// - /// Handler for project started events - /// - /// sender (should be null) - /// event arguments - public override void ProjectStartedHandler(object sender, ProjectStartedEventArgs e) - { - ErrorUtilities.VerifyThrowArgumentNull(e.BuildEventContext, "BuildEventContext"); - ErrorUtilities.VerifyThrowArgumentNull(e.ParentProjectBuildEventContext, "ParentProjectBuildEventContext"); - - // Add the project to the BuildManager so we can use the start information later in the build process - buildEventManager.AddProjectStartedEvent(e); - - if (this.showPerfSummary) - { - // Create a new project performance counter for this project - MPPerformanceCounter counter = GetPerformanceCounter(e.ProjectFile, ref projectPerformanceCounters); - counter.AddEventStarted(e.TargetNames, e.BuildEventContext, e.Timestamp, compareContextNodeId); - } - - // If there were deferred messages then we should show them now, this will cause the project started event to be shown properly - if (deferredMessages.ContainsKey(e.BuildEventContext)) - { - if (!showOnlyErrors && !showOnlyWarnings) - { - foreach (BuildMessageEventArgs message in deferredMessages[e.BuildEventContext]) - { - // This will display the project started event before the messages is shown - this.MessageHandler(sender, message); - } - } - deferredMessages.Remove(e.BuildEventContext); - } - - //If we are in diagnostic and are going to show items, show the project started event - // along with the items. The project started event will only be shown if it has not been shown before - if (Verbosity == LoggerVerbosity.Diagnostic && showItemAndPropertyList) - { - //Show the deferredProjectStartedEvent - if (!showOnlyErrors && !showOnlyWarnings) - { - DisplayDeferredProjectStartedEvent(e.BuildEventContext); - } - if (e.Properties != null) - { - WriteProperties(e, e.Properties); - } - - if (e.Items != null) - { - WriteItems(e, e.Items); - } - } - } - - /// - /// Handler for project finished events - /// - /// sender (should be null) - /// event arguments - public override void ProjectFinishedHandler(object sender, ProjectFinishedEventArgs e) - { - ErrorUtilities.VerifyThrowArgumentNull(e.BuildEventContext, "BuildEventContext"); - - - //Get the project started event so we can use its information to properly display a project finished event - ProjectStartedEventMinimumFields startedEvent = buildEventManager.GetProjectStartedEvent(e.BuildEventContext); - ErrorUtilities.VerifyThrow(startedEvent != null, "Started event should not be null in the finished event handler"); - - if (this.showPerfSummary) - { - // Stop the performance counter which was created in the project started event handler - MPPerformanceCounter counter = GetPerformanceCounter(e.ProjectFile, ref projectPerformanceCounters); - counter.AddEventFinished(startedEvent.TargetNames, e.BuildEventContext, e.Timestamp); - } - - if (IsVerbosityAtLeast(LoggerVerbosity.Normal)) - { - // Only want to show the project finished event if a project started event has been shown - if (startedEvent.ShowProjectFinishedEvent) - { - lastProjectFullKey = GetFullProjectKey(e.BuildEventContext); - - if (!showOnlyErrors && !showOnlyWarnings) - { - WriteLinePrefix(e.BuildEventContext, e.Timestamp, false); - setColor(ConsoleColor.Cyan); - - // In the project finished message the targets which were built and the project which was built - // should be shown - string targets = startedEvent.TargetNames; - string projectName = startedEvent.ProjectFile ?? string.Empty; - - // Show which targets were built as part of this project - if (string.IsNullOrEmpty(targets)) - { - if (e.Succeeded) - { - WriteMessageAligned(ResourceUtilities.FormatResourceString("ProjectFinishedPrefixWithDefaultTargetsMultiProc", projectName), true); - } - else - { - WriteMessageAligned(ResourceUtilities.FormatResourceString("ProjectFinishedPrefixWithDefaultTargetsMultiProcFailed", projectName), true); - } - } - else - { - if (e.Succeeded) - { - WriteMessageAligned(ResourceUtilities.FormatResourceString("ProjectFinishedPrefixWithTargetNamesMultiProc", projectName, targets), true); - } - else - { - WriteMessageAligned(ResourceUtilities.FormatResourceString("ProjectFinishedPrefixWithTargetNamesMultiProcFailed", projectName, targets), true); - } - } - - // In single proc only make a space between the project done event and the next line, this - // is to increase the readability on the single proc log when there are a number of done events - // or a mix of done events and project started events. Also only do this on the console and not any log file. - if (numberOfProcessors == 1 && runningWithCharacterFileType) - { - WriteNewLine(); - } - } - - ShownBuildEventContext(e.BuildEventContext); - resetColor(); - } - } - // We are done with the project started event if the project has finished building, remove its reference - buildEventManager.RemoveProjectStartedEvent(e.BuildEventContext); - } - - /// - /// Writes out the list of property names and their values. - /// This could be done at any time during the build to show the latest - /// property values, using the cached reference to the list from the - /// appropriate ProjectStarted event. - /// - /// List of properties - internal void WriteProperties(BuildEventArgs e, IEnumerable properties) - { - if (showOnlyErrors || showOnlyWarnings) - { - return; - } - - ArrayList propertyList = ExtractPropertyList(properties); - - // if there are no properties to display return out of the method and dont print out anything related to displaying - // the properties, this includes the multiproc prefix information or the Initial properties header - if (propertyList.Count == 0) - { - return; - } - - WriteLinePrefix(e.BuildEventContext, e.Timestamp, false); - WriteProperties(propertyList); - ShownBuildEventContext(e.BuildEventContext); - } - - internal override void OutputProperties(ArrayList list) - { - // Write the banner - setColor(ConsoleColor.Green); - WriteMessageAligned(ResourceUtilities.FormatResourceString("PropertyListHeader"), true); - // Write each property name and its value, one per line - foreach (DictionaryEntry prop in list) - { - setColor(ConsoleColor.Gray); - string propertyString = String.Format(CultureInfo.CurrentCulture, "{0} = {1}", prop.Key, (string)(prop.Value)); - WriteMessageAligned(propertyString, false); - } - resetColor(); - } - /// - /// Writes out the list of item specs and their metadata. - /// This could be done at any time during the build to show the latest - /// items, using the cached reference to the list from the - /// appropriate ProjectStarted event. - /// - /// List of items - internal void WriteItems(BuildEventArgs e, IEnumerable items) - { - if (showOnlyErrors || showOnlyWarnings) - { - return; - } - - SortedList itemList = ExtractItemList(items); - - // if there are no Items to display return out of the method and dont print out anything related to displaying - // the items, this includes the multiproc prefix information or the Initial items header - if (itemList.Count == 0) - { - return; - } - WriteLinePrefix(e.BuildEventContext, e.Timestamp, false); - WriteItems(itemList); - ShownBuildEventContext(e.BuildEventContext); - } - - internal override void OutputItems(string itemType, ArrayList itemTypeList) - { - // Write each item, one per line - bool haveWrittenItemType = false; - foreach (ITaskItem item in itemTypeList) - { - string itemString = null; - if (!haveWrittenItemType) - { - itemString = itemType; - setColor(ConsoleColor.DarkGray); - WriteMessageAligned(itemType, false); - haveWrittenItemType = true; - } - setColor(ConsoleColor.Gray); - - // Indent the text by two tab lengths - StringBuilder result = new StringBuilder(); - result.Append(' ', 2 * tabWidth).Append(item.ItemSpec); - WriteMessageAligned(result.ToString(), false); - } - resetColor(); - } - /// - /// Handler for target started events - /// - /// sender (should be null) - /// event arguments - public override void TargetStartedHandler(object sender, TargetStartedEventArgs e) - { - ErrorUtilities.VerifyThrowArgumentNull(e.BuildEventContext, "BuildEventContext"); - - // Add the target started information to the buildEventManager so its information can be used - // later in the build - buildEventManager.AddTargetStartedEvent(e); - - if (this.showPerfSummary) - { - // Create a new performance counter for this target - MPPerformanceCounter counter = GetPerformanceCounter(e.TargetName, ref targetPerformanceCounters); - counter.AddEventStarted(null, e.BuildEventContext, e.Timestamp, compareContextNodeIdTargetId); - } - } - - /// - /// Handler for target finished events - /// - /// sender (should be null) - /// event arguments - public override void TargetFinishedHandler(object sender, TargetFinishedEventArgs e) - { - ErrorUtilities.VerifyThrowArgumentNull(e.BuildEventContext, "BuildEventContext"); - - if (this.showPerfSummary) - { - // Stop the performance counter started in the targetStartedEventHandler - MPPerformanceCounter counter = GetPerformanceCounter(e.TargetName, ref targetPerformanceCounters); - counter.AddEventFinished(null, e.BuildEventContext, e.Timestamp); - } - - if (IsVerbosityAtLeast(LoggerVerbosity.Detailed)) - { - // Get the target started event so we can determine whether or not to show the targetFinishedEvent - // as we only want to show target finished events if a target started event has been shown - TargetStartedEventMinimumFields startedEvent = buildEventManager.GetTargetStartedEvent(e.BuildEventContext); - ErrorUtilities.VerifyThrow(startedEvent != null, "Started event should not be null in the finished event handler"); - if (startedEvent.ShowTargetFinishedEvent) - { - if (!showOnlyErrors && !showOnlyWarnings) - { - lastProjectFullKey = GetFullProjectKey(e.BuildEventContext); - WriteLinePrefix(e.BuildEventContext, e.Timestamp, false); - setColor(ConsoleColor.Cyan); - if (IsVerbosityAtLeast(LoggerVerbosity.Diagnostic) || showEventId) - { - WriteMessageAligned(ResourceUtilities.FormatResourceString("TargetMessageWithId", e.Message, e.BuildEventContext.TargetId), true); - } - else - { - WriteMessageAligned(e.Message, true); - } - resetColor(); - } - ShownBuildEventContext(e.BuildEventContext); - } - } - - //We no longer need this target started event, it can be removed - buildEventManager.RemoveTargetStartedEvent(e.BuildEventContext); - } - - /// - /// Handler for task started events - /// - /// sender (should be null) - /// event arguments - public override void TaskStartedHandler(object sender, TaskStartedEventArgs e) - { - ErrorUtilities.VerifyThrowArgumentNull(e.BuildEventContext, "BuildEventContext"); - - // if verbosity is detailed or diagnostic - - if (IsVerbosityAtLeast(LoggerVerbosity.Detailed)) - { - DisplayDeferredStartedEvents(e.BuildEventContext); - - if (!showOnlyErrors && !showOnlyWarnings) - { - bool prefixAlreadyWritten = WriteTargetMessagePrefix(e, e.BuildEventContext, e.Timestamp); - setColor(ConsoleColor.DarkCyan); - if (IsVerbosityAtLeast(LoggerVerbosity.Diagnostic) || showEventId) - { - WriteMessageAligned(ResourceUtilities.FormatResourceString("TaskMessageWithId", e.Message, e.BuildEventContext.TaskId), prefixAlreadyWritten); - } - else - { - WriteMessageAligned(e.Message, prefixAlreadyWritten); - } - resetColor(); - } - - ShownBuildEventContext(e.BuildEventContext); - } - - if (this.showPerfSummary) - { - // Create a new performance counter for this task - MPPerformanceCounter counter = GetPerformanceCounter(e.TaskName, ref taskPerformanceCounters); - counter.AddEventStarted(null, e.BuildEventContext, e.Timestamp, null); - } - } - - /// - /// Handler for task finished events - /// - /// sender (should be null) - /// event arguments - public override void TaskFinishedHandler(object sender, TaskFinishedEventArgs e) - { - ErrorUtilities.VerifyThrowArgumentNull(e.BuildEventContext, "BuildEventContext"); - if (this.showPerfSummary) - { - // Stop the task performance counter which was started in the task started event - MPPerformanceCounter counter = GetPerformanceCounter(e.TaskName, ref taskPerformanceCounters); - counter.AddEventFinished(null, e.BuildEventContext, e.Timestamp); - } - - // if verbosity is detailed or diagnostic - if (IsVerbosityAtLeast(LoggerVerbosity.Detailed)) - { - if (!showOnlyErrors && !showOnlyWarnings) - { - bool prefixAlreadyWritten = WriteTargetMessagePrefix(e, e.BuildEventContext, e.Timestamp); - setColor(ConsoleColor.DarkCyan); - if (IsVerbosityAtLeast(LoggerVerbosity.Diagnostic) || showEventId) - { - WriteMessageAligned(ResourceUtilities.FormatResourceString("TaskMessageWithId", e.Message, e.BuildEventContext.TaskId), prefixAlreadyWritten); - } - else - { - WriteMessageAligned(e.Message, prefixAlreadyWritten); - } - resetColor(); - } - ShownBuildEventContext(e.BuildEventContext); - } - } - - /// - /// Prints an error event - /// - public override void ErrorHandler(object sender, BuildErrorEventArgs e) - { - ErrorUtilities.VerifyThrowArgumentNull(e.BuildEventContext, "BuildEventContext"); - // Keep track of the number of error events raisd - errorCount++; - - // If there is an error we need to walk up the call stack and make sure that - // the project started events back to the root project know an error has occurred - // and are not removed when they finish - buildEventManager.SetErrorWarningFlagOnCallStack(e.BuildEventContext); - - TargetStartedEventMinimumFields targetStartedEvent = buildEventManager.GetTargetStartedEvent(e.BuildEventContext); - // Can be null if the error occurred outside of a target, or the error occurres before the targetStartedEvent - if (targetStartedEvent != null) - { - targetStartedEvent.ErrorInTarget = true; - } - - DisplayDeferredStartedEvents(e.BuildEventContext); - - // Display only if showOnlyWarnings is false; - // unless showOnlyErrors is true, which trumps it. - if (!showOnlyWarnings || showOnlyErrors) - { - if (IsVerbosityAtLeast(LoggerVerbosity.Normal)) - { - WriteLinePrefix(e.BuildEventContext, e.Timestamp, false); - } - - setColor(ConsoleColor.Red); - WriteMessageAligned(EventArgsFormatting.FormatEventMessage(e, runningWithCharacterFileType), true); - ShownBuildEventContext(e.BuildEventContext); - if (ShowSummary) - { - if (!errorList.Contains(e)) - { - errorList.Add(e); - } - } - resetColor(); - } - } - - /// - /// Prints a warning event - /// - public override void WarningHandler(object sender, BuildWarningEventArgs e) - { - ErrorUtilities.VerifyThrowArgumentNull(e.BuildEventContext, "BuildEventContext"); - // Keep track of the number of warning events raised during the build - warningCount++; - - // If there is a warning we need to walk up the call stack and make sure that - // the project started events back to the root project know a warning has ocured - // and are not removed when they finish - buildEventManager.SetErrorWarningFlagOnCallStack(e.BuildEventContext); - TargetStartedEventMinimumFields targetStartedEvent = buildEventManager.GetTargetStartedEvent(e.BuildEventContext); - - // Can be null if the error occurred outside of a target, or the error occurres before the targetStartedEvent - if (targetStartedEvent != null) - { - targetStartedEvent.ErrorInTarget = true; - } - - DisplayDeferredStartedEvents(e.BuildEventContext); - - // Display only if showOnlyErrors is false; - // unless showOnlyWarnings is true, which trumps it. - if (!showOnlyErrors || showOnlyWarnings) - { - if (IsVerbosityAtLeast(LoggerVerbosity.Normal)) - { - WriteLinePrefix(e.BuildEventContext, e.Timestamp, false); - } - - setColor(ConsoleColor.Yellow); - WriteMessageAligned(EventArgsFormatting.FormatEventMessage(e, runningWithCharacterFileType), true); - } - - ShownBuildEventContext(e.BuildEventContext); - - if (ShowSummary) - { - if (!warningList.Contains(e)) - { - warningList.Add(e); - } - } - resetColor(); - } - - /// - /// Prints a message event - /// - public override void MessageHandler(object sender, BuildMessageEventArgs e) - { - if (showOnlyErrors || showOnlyWarnings) - { - return; - } - - ErrorUtilities.VerifyThrowArgumentNull(e.BuildEventContext, "BuildEventContext"); - bool print = false; - bool lightenText = false; - - if (e is TaskCommandLineEventArgs) - { - if (!showCommandline && verbosity < LoggerVerbosity.Detailed) - { - return; - } - print = true; - } - else - { - switch (e.Importance) - { - case MessageImportance.High: - print = IsVerbosityAtLeast(LoggerVerbosity.Minimal); - break; - case MessageImportance.Normal: - print = IsVerbosityAtLeast(LoggerVerbosity.Normal); - lightenText = true; - break; - case MessageImportance.Low: - print = IsVerbosityAtLeast(LoggerVerbosity.Detailed); - lightenText = true; - break; - default: - ErrorUtilities.VerifyThrow(false, "Impossible"); - break; - } - } - - if (print) - { - // If the event has a valid Project contextId but the project started event has not been fired, the message needs to be - // buffered until the project started event is fired - if ( - hasBuildStarted - && e.BuildEventContext.ProjectContextId != BuildEventContext.InvalidProjectContextId - && buildEventManager.GetProjectStartedEvent(e.BuildEventContext) == null - && IsVerbosityAtLeast(LoggerVerbosity.Normal) - ) - { - List messageList; - if (deferredMessages.ContainsKey(e.BuildEventContext)) - { - messageList = deferredMessages[e.BuildEventContext]; - } - else - { - messageList = new List(); - deferredMessages.Add(e.BuildEventContext, messageList); - } - messageList.Add(e); - return; - } - - DisplayDeferredStartedEvents(e.BuildEventContext); - - // Print the message event out to the console - PrintMessage(e, lightenText); - ShownBuildEventContext(e.BuildEventContext); - } - } - - private void DisplayDeferredStartedEvents(BuildEventContext e) - { - if (showOnlyErrors || showOnlyWarnings) - { - return; - } - - // Display any project started events which were deferred until a visible - // message from their project is displayed - if (IsVerbosityAtLeast(LoggerVerbosity.Normal)) - { - DisplayDeferredProjectStartedEvent(e); - } - - // Display any target started events which were deferred until a visible - // message from their target is displayed - if (IsVerbosityAtLeast(LoggerVerbosity.Detailed)) - { - DisplayDeferredTargetStartedEvent(e); - } - } - - /// - /// Prints out a message event to the console - /// - private void PrintMessage(BuildMessageEventArgs e, bool lightenText) - { - string nonNullMessage = e.Message ?? String.Empty; - int prefixAdjustment = 0; - - if (e.BuildEventContext.TaskId != BuildEventContext.InvalidTaskId) - { - prefixAdjustment = 2; - } - - if (lightenText) - { - setColor(ConsoleColor.DarkGray); - } - - PrintTargetNamePerMessage(e, lightenText); - - // On diagnostic or if showEventId is set the task message should also display the taskId to assist debugging - if ((IsVerbosityAtLeast(LoggerVerbosity.Diagnostic) || showEventId) && e.BuildEventContext.TaskId != BuildEventContext.InvalidTaskId) - { - bool prefixAlreadyWritten = WriteTargetMessagePrefix(e, e.BuildEventContext, e.Timestamp); - WriteMessageAligned(ResourceUtilities.FormatResourceString("TaskMessageWithId", nonNullMessage, e.BuildEventContext.TaskId), prefixAlreadyWritten, prefixAdjustment); - } - else - { - //A time stamp may be shown on verbosities lower than diagnostic - if (showTimeStamp || IsVerbosityAtLeast(LoggerVerbosity.Detailed)) - { - bool prefixAlreadyWritten = WriteTargetMessagePrefix(e, e.BuildEventContext, e.Timestamp); - WriteMessageAligned(nonNullMessage, prefixAlreadyWritten, prefixAdjustment); - } - else - { - WriteMessageAligned(nonNullMessage, false, prefixAdjustment); - } - } - - if (lightenText) - { - resetColor(); - } - } - - private void PrintTargetNamePerMessage(BuildMessageEventArgs e, bool lightenText) - { - // Event Context of the current message - BuildEventContext currentBuildEventContext = e.BuildEventContext; - - // Should the target name be written before the message - bool writeTargetName = false; - string targetName = string.Empty; - - // Does the context (Project, Node, Context, Target, NOT task) of the previous event match the current message - bool contextAreEqual = compareContextNodeIdTargetId.Equals(currentBuildEventContext, lastDisplayedBuildEventContext ?? null); - - TargetStartedEventMinimumFields targetStartedEvent = null; - // If the previous event does not have the same target context information, the target name needs to be printed to the console - // to give the message some more contextual information - if (!contextAreEqual) - { - targetStartedEvent = buildEventManager.GetTargetStartedEvent(currentBuildEventContext); - // Some messages such as engine messages will not have a target started event, in their case, dont print the targetName - if (targetStartedEvent != null) - { - targetName = targetStartedEvent.TargetName; - writeTargetName = true; - } - } - else - { - writeTargetName = false; - } - - if (writeTargetName) - { - bool prefixAlreadyWritten = WriteTargetMessagePrefix(e, targetStartedEvent.ProjectBuildEventContext, targetStartedEvent.TimeStamp); - - setColor(ConsoleColor.Cyan); - if (IsVerbosityAtLeast(LoggerVerbosity.Diagnostic) || showEventId) - { - WriteMessageAligned(ResourceUtilities.FormatResourceString("TargetMessageWithId", targetName, e.BuildEventContext.TargetId), prefixAlreadyWritten); - } - else - { - WriteMessageAligned(targetName + ":", prefixAlreadyWritten); - } - - if (lightenText) - { - setColor(ConsoleColor.DarkGray); - } - else - { - resetColor(); - } - } - } - - private bool WriteTargetMessagePrefix(BuildEventArgs e, BuildEventContext context, DateTime timeStamp) - { - bool prefixAlreadyWritten = true; - ProjectFullKey currentProjectFullKey = GetFullProjectKey(e.BuildEventContext); - if (!lastProjectFullKey.Equals(currentProjectFullKey)) - { - // Write the prefix information about the target for the message - WriteLinePrefix(context, timeStamp, false); - lastProjectFullKey = currentProjectFullKey; - } - else - { - prefixAlreadyWritten = false; - } - return prefixAlreadyWritten; - } - - /// - /// Writes a message to the console, aligned and formatted to fit within the console width - /// - /// Message to be formatted to fit on the console - /// Has the prefix(timestamp or key been written) - private void WriteMessageAligned(string message, bool prefixAlreadyWritten) - { - WriteMessageAligned(message, prefixAlreadyWritten, 0); - } - - /// - /// Writes a message to the console, aligned and formatted to fit within the console width - /// - /// Message to be formatted to fit on the console - /// Has the prefix(timestamp or key been written) - private void WriteMessageAligned(string message, bool prefixAlreadyWritten, int prefixAdjustment) - { - // This method may require the splitting of lines inorder to format them to the console, this must be an atomic operation - lock (lockObject) - { - int adjustedPrefixWidth = prefixWidth + prefixAdjustment; - - // The string may contain new lines, treat each new line as a different string to format and send to the console - string[] nonNullMessages = SplitStringOnNewLines(message); - for (int i = 0; i < nonNullMessages.Length; i++) - { - string nonNullMessage = nonNullMessages[i]; - // Take into account the new line char which will be added to the end or each reformatted string - int bufferWidthMinusNewLine = bufferWidth - 1; - - // If the buffer is larger then the prefix information (timestamp and key) then reformat the messages. - // If there is not enough room just print the message out and let the console do the formatting - bool bufferIsLargerThanPrefix = bufferWidthMinusNewLine > adjustedPrefixWidth; - bool messageAndPrefixTooLargeForBuffer = (nonNullMessage.Length + adjustedPrefixWidth) > bufferWidthMinusNewLine; - if (bufferIsLargerThanPrefix && messageAndPrefixTooLargeForBuffer && alignMessages) - { - // Our message may have embedded tab characters, so expand those to their space - // equivalent so that wrapping works as expected. - nonNullMessage = nonNullMessage.Replace("\t", consoleTab); - - // If the message and the prefix are too large for one line in the console, split the string to fit - int index = 0; - int messageLength = nonNullMessage.Length; - int amountToCopy = 0; - // Loop until all the string has been sent to the console - while (index < messageLength) - { - // Calculate how many chars will fit on the console buffer - amountToCopy = (messageLength - index) < (bufferWidthMinusNewLine - adjustedPrefixWidth) ? (messageLength - index) : (bufferWidthMinusNewLine - adjustedPrefixWidth); - WriteBasedOnPrefix(nonNullMessage.Substring(index, amountToCopy), prefixAlreadyWritten && index == 0 && i == 0, adjustedPrefixWidth); - index += amountToCopy; - } - } - else - { - //there is not enough room just print the message out and let the console do the formatting - WriteBasedOnPrefix(nonNullMessage, prefixAlreadyWritten, adjustedPrefixWidth); - } - } - } - } - - /// - /// Write message takinginto account whether or not the prefix (timestamp and key) have already been written on the line - /// - /// - /// - private void WriteBasedOnPrefix(string nonNullMessage, bool prefixAlreadyWritten, int adjustedPrefixWidth) - { - if (prefixAlreadyWritten) - { - write(nonNullMessage); - WriteNewLine(); - } - else - { - // No prefix info has been written, indent the line to the proper location - write(IndentString(nonNullMessage, adjustedPrefixWidth)); - } - } - - /// - /// Will display the target started event which was deferred until the first visible message for the target is ready to be displayed - /// - private void DisplayDeferredTargetStartedEvent(BuildEventContext e) - { - if (showOnlyErrors || showOnlyWarnings) - { - return; - } - - // Get the deferred target started event - TargetStartedEventMinimumFields targetStartedEvent = buildEventManager.GetTargetStartedEvent(e); - - //Make sure we have not shown the event before - if (targetStartedEvent?.ShowTargetFinishedEvent == false) - { - //Since the target started event has been shows, the target finished event should also be shown - targetStartedEvent.ShowTargetFinishedEvent = true; - - // If there are any other started events waiting and we are the first message, show them - DisplayDeferredStartedEvents(targetStartedEvent.ProjectBuildEventContext); - - WriteLinePrefix(targetStartedEvent.ProjectBuildEventContext, targetStartedEvent.TimeStamp, false); - - setColor(ConsoleColor.Cyan); - - ProjectStartedEventMinimumFields startedEvent = buildEventManager.GetProjectStartedEvent(e); - ErrorUtilities.VerifyThrow(startedEvent != null, "Project Started should not be null in deferred target started"); - string currentProjectFile = startedEvent.ProjectFile ?? string.Empty; - - string targetName; - if (IsVerbosityAtLeast(LoggerVerbosity.Diagnostic) || showEventId) - { - targetName = ResourceUtilities.FormatResourceString("TargetMessageWithId", targetStartedEvent.TargetName, targetStartedEvent.ProjectBuildEventContext.TargetId); - } - else - { - targetName = targetStartedEvent.TargetName; - } - - if (IsVerbosityAtLeast(LoggerVerbosity.Detailed)) - { - WriteMessageAligned(ResourceUtilities.FormatResourceString("TargetStartedFromFileInProject", targetName, targetStartedEvent.TargetFile, currentProjectFile), true); - } - else - { - WriteMessageAligned(ResourceUtilities.FormatResourceString("TargetStartedPrefixInProject", targetName, currentProjectFile), true); - } - - resetColor(); - ShownBuildEventContext(e); - } - } - - /// - /// Will display the project started event which was deferred until the first visible message for the project is ready to be displayed - /// - private void DisplayDeferredProjectStartedEvent(BuildEventContext e) - { - if (showOnlyErrors || showOnlyWarnings) - { - return; - } - - if (!SkipProjectStartedText) - { - // Get the project started event which matched the passed in event context - ProjectStartedEventMinimumFields projectStartedEvent = buildEventManager.GetProjectStartedEvent(e); - - // Make sure the project started event has not been show yet - if (projectStartedEvent?.ShowProjectFinishedEvent == false) - { - projectStartedEvent.ShowProjectFinishedEvent = true; - - ProjectStartedEventMinimumFields parentStartedEvent = projectStartedEvent.ParentProjectStartedEvent; - if (parentStartedEvent != null) - { - //Make sure that if there are any events deferred on this event to show them first - DisplayDeferredStartedEvents(parentStartedEvent.ProjectBuildEventContext); - } - - string current = projectStartedEvent.ProjectFile ?? string.Empty; - string previous = parentStartedEvent?.ProjectFile; - string targetNames = projectStartedEvent.TargetNames; - - // Log 0-based node id's, where 0 is the parent. This is a little unnatural for the reader, - // but avoids confusion by being consistent with the Engine and any error messages it may produce. - int currentProjectNodeId = (projectStartedEvent.ProjectBuildEventContext.NodeId); - if (previous == null) - { - WriteLinePrefix(projectStartedEvent.FullProjectKey, projectStartedEvent.TimeStamp, false); - setColor(ConsoleColor.Cyan); - string message; - if (string.IsNullOrEmpty(targetNames)) - { - message = ResourceUtilities.FormatResourceString("ProjectStartedTopLevelProjectWithDefaultTargets", current, currentProjectNodeId); - } - else - { - message = ResourceUtilities.FormatResourceString("ProjectStartedTopLevelProjectWithTargetNames", current, currentProjectNodeId, targetNames); - } - - WriteMessageAligned(message, true); - resetColor(); - } - else - { - WriteLinePrefix(parentStartedEvent.FullProjectKey, parentStartedEvent.TimeStamp, false); - setColor(ConsoleColor.Cyan); - if (string.IsNullOrEmpty(targetNames)) - { - WriteMessageAligned(ResourceUtilities.FormatResourceString("ProjectStartedWithDefaultTargetsMultiProc", previous, parentStartedEvent.FullProjectKey, current, projectStartedEvent.FullProjectKey, currentProjectNodeId), true); - } - else - { - WriteMessageAligned(ResourceUtilities.FormatResourceString("ProjectStartedWithTargetsMultiProc", previous, parentStartedEvent.FullProjectKey, current, projectStartedEvent.FullProjectKey, currentProjectNodeId, targetNames), true); - } - resetColor(); - } - - ShownBuildEventContext(e); - } - } - } - - /// - /// Prints a custom event - /// - public override void CustomEventHandler(object sender, CustomBuildEventArgs e) - { - if (showOnlyErrors || showOnlyWarnings) - { - return; - } - - ErrorUtilities.VerifyThrowArgumentNull(e.BuildEventContext, "BuildEventContext"); - if (IsVerbosityAtLeast(LoggerVerbosity.Detailed)) - { - // ignore custom events with null messages -- some other - // logger will handle them appropriately - if (e.Message != null) - { - DisplayDeferredStartedEvents(e.BuildEventContext); - WriteLinePrefix(e.BuildEventContext, e.Timestamp, false); - WriteMessageAligned(e.Message, true); - ShownBuildEventContext(e.BuildEventContext); - } - } - } - - /// - /// Writes message contextual information for each message displayed on the console - /// - private void WriteLinePrefix(BuildEventContext e, DateTime eventTimeStamp, bool isMessagePrefix) - { - WriteLinePrefix(GetFullProjectKey(e).ToString(verbosity), eventTimeStamp, isMessagePrefix); - } - - private void WriteLinePrefix(string key, DateTime eventTimeStamp, bool isMessagePrefix) - { - // Dont want any prefix for single proc - if (numberOfProcessors == 1) - { - return; - } - - setColor(ConsoleColor.Cyan); - - string context = string.Empty; - if (showTimeStamp || IsVerbosityAtLeast(LoggerVerbosity.Diagnostic)) - { - context = LogFormatter.FormatLogTimeStamp(eventTimeStamp); - } - - string prefixString; - if (!isMessagePrefix || IsVerbosityAtLeast(LoggerVerbosity.Detailed)) - { - prefixString = ResourceUtilities.FormatResourceString("BuildEventContext", context, key) + ">"; - } - else - { - prefixString = ResourceUtilities.FormatResourceString("BuildEventContext", context, string.Empty) + " "; - } - - WritePretty(prefixString); - resetColor(); - - if (prefixWidth == 0) - { - prefixWidth = prefixString.Length; - } - } - - /// - /// Extract the full project key from the BuildEventContext - /// - private ProjectFullKey GetFullProjectKey(BuildEventContext e) - { - ProjectStartedEventMinimumFields startedEvent = null; - - if (e != null) - { - startedEvent = buildEventManager.GetProjectStartedEvent(e); - } - - //Project started event can be null, if the message has come before the project started event - // or the message is not part of a project such as if the message came from the engine - if (startedEvent == null) - { - return new ProjectFullKey(0, 0); - } - else - { - return new ProjectFullKey(startedEvent.ProjectKey, startedEvent.EntryPointKey); - } - } - - /// - /// Returns a performance counter for a given scope (either task name or target name) - /// from the given table. - /// - /// Task name or target name. - /// Table that has tasks or targets. - internal static new MPPerformanceCounter GetPerformanceCounter(string scopeName, ref Hashtable table) - { - // Lazily construct the performance counter table. - if (table == null) - { - table = new Hashtable(StringComparer.OrdinalIgnoreCase); - } - - MPPerformanceCounter counter = (MPPerformanceCounter)table[scopeName]; - - // And lazily construct the performance counter itself. - if (counter == null) - { - counter = new MPPerformanceCounter(scopeName); - table[scopeName] = counter; - } - - return counter; - } - #endregion - - #region InternalClass - /// - /// Stores and calculates the performance numbers for the different events - /// - internal class MPPerformanceCounter : PerformanceCounter - { - // Set of performance counters for a project - private Hashtable internalPerformanceCounters; - // Dictionary mapping event context to the start number of ticks, this will be used to calculate the amount - // of time between the start of the performance counter and the end - // An object is being used to box the start time long value to prevent jitting when this code path is executed. - private Dictionary startedEvent; - private int messageIdentLevel = 2; - - internal int MessageIdentLevel - { - get { return messageIdentLevel; } - set { messageIdentLevel = value; } - } - - internal MPPerformanceCounter(string scopeName) - : base(scopeName) - { - // Do Nothing - } - - /// - /// Add a started event to the performance counter, by adding the event this sets the start time of the performance counter - /// - internal void AddEventStarted(string projectTargetNames, BuildEventContext buildEventContext, DateTime eventTimeStamp, IEqualityComparer comparer) - { - //If the projectTargetNames are set then we should be a projectstarted event - if (!string.IsNullOrEmpty(projectTargetNames)) - { - // Create a new performance counter for the project entry point to calculate how much time and how many calls - // were made to the entry point - MPPerformanceCounter entryPoint = GetPerformanceCounter(projectTargetNames, ref internalPerformanceCounters); - entryPoint.AddEventStarted(null, buildEventContext, eventTimeStamp, compareContextNodeIdTargetId); - // Indent the output so it is intented with respect to its parent project - entryPoint.messageIdentLevel = 7; - } - - if (startedEvent == null) - { - if (comparer == null) - { - startedEvent = new Dictionary(); - } - else - { - startedEvent = new Dictionary(comparer); - } - } - - if (!startedEvent.ContainsKey(buildEventContext)) - { - startedEvent.Add(buildEventContext, (object)eventTimeStamp.Ticks); - ++calls; - } - } - - /// - /// Add a finished event to the performance counter, so perf numbers can be calculated - /// - internal void AddEventFinished(string projectTargetNames, BuildEventContext buildEventContext, DateTime eventTimeStamp) - { - if (!string.IsNullOrEmpty(projectTargetNames)) - { - MPPerformanceCounter entryPoint = GetPerformanceCounter(projectTargetNames, ref internalPerformanceCounters); - entryPoint.AddEventFinished(null, buildEventContext, eventTimeStamp); - } - - if (startedEvent == null) - { - Debug.Assert(startedEvent != null, "Cannot have finished counter without started counter. "); - } - - if (startedEvent.ContainsKey(buildEventContext)) - { - // Calculate the amount of time spent in the event based on the time stamp of when - // the started event was created and when the finished event was created - elapsedTime += (TimeSpan.FromTicks(eventTimeStamp.Ticks - (long)startedEvent[buildEventContext])); - startedEvent.Remove(buildEventContext); - } - } - - /// - /// Print out the performance counter message - /// - internal override void PrintCounterMessage(WriteLinePrettyFromResourceDelegate WriteLinePrettyFromResource, ColorSetter setColor, ColorResetter resetColor) - { - // round: submillisecond values are not meaningful - string time = String.Format(CultureInfo.CurrentCulture, - "{0,5}", Math.Round(elapsedTime.TotalMilliseconds, 0)); - - WriteLinePrettyFromResource - ( - messageIdentLevel, - "PerformanceLine", - time, - String.Format(CultureInfo.CurrentCulture, - "{0,-40}" /* pad to 40 align left */, scopeName), - String.Format(CultureInfo.CurrentCulture, - "{0,3}", calls) - ); - - if (internalPerformanceCounters?.Count > 0) - { - // For each of the entry points in the project print out the performance numbers for them - foreach (MPPerformanceCounter counter in internalPerformanceCounters.Values) - { - setColor(ConsoleColor.White); - counter.PrintCounterMessage(WriteLinePrettyFromResource, setColor, resetColor); - resetColor(); - } - } - } - } - #endregion - - #region internal MemberData - private static ComparerContextNodeId compareContextNodeId = new ComparerContextNodeId(); - private static ComparerContextNodeIdTargetId compareContextNodeIdTargetId = new ComparerContextNodeIdTargetId(); - private BuildEventContext lastDisplayedBuildEventContext; - private int bufferWidth = -1; - private object lockObject = new Object(); - private int prefixWidth = 0; - private ProjectFullKey lastProjectFullKey = new ProjectFullKey(-1, -1); - private bool alignMessages; - private bool forceNoAlign; - private bool showEventId; - // According to the documentaion for ENABLE_PROCESSED_OUTPUT tab width for the console is 8 characters - private const string consoleTab = " "; - #endregion - - #region Per-build Members - //Holds messages that were going to be shown before the project started event, buffer them until the project started event is shown - private Dictionary> deferredMessages; - private BuildEventManager buildEventManager; - // Has the build started - private bool hasBuildStarted; - private bool showCommandline; - private bool showTimeStamp; - #endregion - } -} diff --git a/src/Deprecated/Engine/Logging/ParallelLogger/ParallelLoggerHelpers.cs b/src/Deprecated/Engine/Logging/ParallelLogger/ParallelLoggerHelpers.cs deleted file mode 100644 index 648e5f48a44..00000000000 --- a/src/Deprecated/Engine/Logging/ParallelLogger/ParallelLoggerHelpers.cs +++ /dev/null @@ -1,672 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections.Generic; -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine.Shared; -using System.Globalization; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// Stores and manages projects and targets events for logging purposes - /// - internal class BuildEventManager - { - #region Data - private Dictionary projectStartedEvents; - private Dictionary targetStartedEvents; - private Dictionary projectTargetKey = new Dictionary(StringComparer.OrdinalIgnoreCase); - private Dictionary projectKey = new Dictionary(StringComparer.OrdinalIgnoreCase); - private static ComparerContextNodeId compareContextNodeId = new ComparerContextNodeId(); - private static ComparerContextNodeIdTargetId compareContextNodeIdTargetId = new ComparerContextNodeIdTargetId(); - private int projectIncrementKey; - #endregion - - #region Constructors - internal BuildEventManager() - { - projectStartedEvents = new Dictionary(compareContextNodeId); - targetStartedEvents = new Dictionary(compareContextNodeIdTargetId); - projectIncrementKey = 0; - } - #endregion - - #region Methods - /// - /// Adds a new project to the list of project started events which have been fired - /// - internal void AddProjectStartedEvent(ProjectStartedEventArgs e) - { //Parent event can be null if this is the root project - ProjectStartedEventMinimumFields parentEvent = GetProjectStartedEvent(e.ParentProjectBuildEventContext); - lock (projectStartedEvents) - { - if (!projectStartedEvents.ContainsKey(e.BuildEventContext)) - { - int projectTargetKeyLocal = 1; - int projectIncrementKeyLocal; - // If we haven't seen this project before (by full path) then - // allocate a new key for it and save it away - if (!projectKey.ContainsKey(e.ProjectFile)) - { - projectIncrementKey++; - - projectKey[e.ProjectFile] = projectIncrementKey; - projectIncrementKeyLocal = projectIncrementKey; - } - else - { - // We've seen this project before, so retrieve it - projectIncrementKeyLocal = projectKey[e.ProjectFile]; - } - - // If we haven't seen any entrypoint for the current project (by full path) then - // allocate a new entry point key - if (!projectTargetKey.ContainsKey(e.ProjectFile)) - { - projectTargetKey[e.ProjectFile] = projectTargetKeyLocal; - } - else - { - // We've seen this project before, but not this entrypoint, so increment - // the entrypoint key that we have. - projectTargetKeyLocal = projectTargetKey[e.ProjectFile] + 1; - projectTargetKey[e.ProjectFile] = projectTargetKeyLocal; - } - - projectStartedEvents.Add(e.BuildEventContext, new ProjectStartedEventMinimumFields(projectIncrementKeyLocal, projectTargetKeyLocal, e, parentEvent)); - } - } - } - - /// - /// Adds a new target to the list of project started events which have been fired - /// - internal void AddTargetStartedEvent(TargetStartedEventArgs e) - { - if (!targetStartedEvents.ContainsKey(e.BuildEventContext)) - { - targetStartedEvents.Add(e.BuildEventContext, new TargetStartedEventMinimumFields(e)); - } - } - - /// - /// Get a call stack of event contexts for a starting point event context - /// - internal List GetProjectCallStack(BuildEventContext e) - { - List stackTrace = new List(); - - ProjectStartedEventMinimumFields currentKey = GetProjectStartedEvent(e); - - // currentKey can be null if the stack trace is requested before the project started event has been seen - // or if the call stack is requested by an event which is not associated with a project such as an event - // from the engine itself - if (currentKey != null) - { - //Add the event where the stack should start - stackTrace.Add(currentKey); - - // Loop through the call tree until the root project started event has been found - while (currentKey.ParentProjectStartedEvent != null) - { - currentKey = currentKey.ParentProjectStartedEvent; - stackTrace.Add(currentKey); - } - } - return stackTrace; - } - - /// - /// Set an error flag on all projects in the call stack of a given event context - /// - internal void SetErrorWarningFlagOnCallStack(BuildEventContext e) - { - List projectStackTrace = GetProjectCallStack(e); - foreach (ProjectStartedEventMinimumFields startedEvent in projectStackTrace) - { - // Can be null if the event occures before the project startedEvent or outside of a project - if (startedEvent != null) - { - startedEvent.ErrorInProject = true; - } - } - } - - /// - /// Retrieve the project call stack based on the starting point of buildEventContext e - /// - internal string[] ProjectCallStackFromProject(BuildEventContext e) - { - BuildEventContext currentKey = e; - - ProjectStartedEventMinimumFields startedEvent = GetProjectStartedEvent(currentKey); - - List stackTrace = new List(); - // If there is no started event then there should be no stack trace - // this is a valid situation if the event occures in the engine or outside the context of a project - // or the event is raised before the project started event - if (startedEvent == null) - { - return new string[0]; - } - - List projectStackTrace = GetProjectCallStack(e); - foreach (ProjectStartedEventMinimumFields projectStartedEvent in projectStackTrace) - { - if (!string.IsNullOrEmpty(projectStartedEvent.TargetNames)) - { - stackTrace.Add(ResourceUtilities.FormatResourceString("ProjectStackWithTargetNames", projectStartedEvent.ProjectFile, projectStartedEvent.TargetNames, projectStartedEvent.FullProjectKey)); - } - else - { - stackTrace.Add(ResourceUtilities.FormatResourceString("ProjectStackWithDefaultTargets", projectStartedEvent.ProjectFile, projectStartedEvent.FullProjectKey)); - } - } - stackTrace.Reverse(); - return stackTrace.ToArray(); - } - - /// - /// Get a deferred project started event based on a given event context - /// - internal ProjectStartedEventMinimumFields GetProjectStartedEvent(BuildEventContext e) - { - ProjectStartedEventMinimumFields buildEvent; - if (projectStartedEvents.ContainsKey(e)) - { - buildEvent = projectStartedEvents[e]; - } - else - { - buildEvent = null; - } - return buildEvent; - } - - /// - /// Get a deferred target started event based on a given event context - /// - internal TargetStartedEventMinimumFields GetTargetStartedEvent(BuildEventContext e) - { - TargetStartedEventMinimumFields buildEvent; - if (targetStartedEvents.ContainsKey(e)) - { - buildEvent = targetStartedEvents[e]; - } - else - { - buildEvent = null; - } - return buildEvent; - } - - /// - /// Will remove a project started event from the list of deferred project started events - /// - internal void RemoveProjectStartedEvent(BuildEventContext e) - { - ProjectStartedEventMinimumFields startedEvent = GetProjectStartedEvent(e); - // Only remove the project from the event list if it is in the list, and no errors have occurred in the project - if (startedEvent?.ErrorInProject == false) - { - projectStartedEvents.Remove(e); - } - } - - /// - /// Will remove a project started event from the list of deferred project started events - /// - internal void RemoveTargetStartedEvent(BuildEventContext e) - { - TargetStartedEventMinimumFields startedEvent = GetTargetStartedEvent(e); - // Only remove the project from the event list if it is in the list, and no errors have occurred in the project - if (startedEvent?.ErrorInTarget == false) - { - targetStartedEvents.Remove(e); - } - } - #endregion - } - - /// - /// Compares two event contexts on ProjectContextId and NodeId only - /// - internal class ComparerContextNodeId : IEqualityComparer - { - #region Methods - public bool Equals(T x, T y) - { - BuildEventContext contextX = x as BuildEventContext; - BuildEventContext contextY = y as BuildEventContext; - - if (contextX == null || contextY == null) - { - return false; - } - - // Return true if the fields match: - return (contextX.NodeId == contextY.NodeId) - && (contextX.ProjectContextId == contextY.ProjectContextId); - } - - public int GetHashCode(T x) - { - BuildEventContext context = x as BuildEventContext; - return context.ProjectContextId + (context.NodeId << 24); - } - #endregion - } - - /// - /// Compares two event contexts based on the ProjectContextId, NodeId, and TargetId only - /// - internal class ComparerContextNodeIdTargetId : IEqualityComparer - { - #region Methods - public bool Equals(T x, T y) - { - BuildEventContext contextX = x as BuildEventContext; - BuildEventContext contextY = y as BuildEventContext; - - if (contextX == null || contextY == null) - { - return false; - } - - // Return true if the fields match: - return (contextX.NodeId == contextY.NodeId) - && (contextX.ProjectContextId == contextY.ProjectContextId) - && (contextX.TargetId == contextY.TargetId); - } - - public int GetHashCode(T x) - { - BuildEventContext context = x as BuildEventContext; - return context.ProjectContextId + (context.NodeId << 24); - } - - #endregion - } - - /// - /// This class stands in for a full project started event because it contains only the - /// minimum amount of inforomation needed for the logger - /// - internal class ProjectStartedEventMinimumFields - { - #region Data - private DateTime timeStamp; - private string targetNames; - private string projectFile; - private bool showProjectFinishedEvent; - private bool errorInProject; - private int projectId; - private ProjectFullKey projectFullKey; - private BuildEventContext buildEventContext; - private ProjectStartedEventMinimumFields parentProjectStartedEvent; - #endregion - - #region Properties - - internal DateTime TimeStamp - { - get - { - return timeStamp; - } - } - - internal int ProjectKey - { - get - { - return projectFullKey.ProjectKey; - } - } - - internal int EntryPointKey - { - get - { - return projectFullKey.EntryPointKey; - } - } - - internal string FullProjectKey - { - get - { - return projectFullKey.ToString(); - } - } - - internal ProjectStartedEventMinimumFields ParentProjectStartedEvent - { - get - { - return parentProjectStartedEvent; - } - } - - internal string TargetNames - { - get - { - return targetNames; - } - } - - internal int ProjectId - { - get - { - return projectId; - } - } - - internal string ProjectFile - { - get - { - return projectFile; - } - } - - internal bool ShowProjectFinishedEvent - { - get - { - return showProjectFinishedEvent; - } - - set - { - showProjectFinishedEvent = value; - } - } - - internal bool ErrorInProject - { - get - { - return this.errorInProject; - } - - set - { - this.errorInProject = value; - } - } - - internal BuildEventContext ProjectBuildEventContext - { - get - { - return this.buildEventContext; - } - } - #endregion - - #region Constructors - internal ProjectStartedEventMinimumFields(int projectKey, int entryPointKey, ProjectStartedEventArgs startedEvent, ProjectStartedEventMinimumFields parentProjectStartedEvent) - { - this.targetNames = startedEvent.TargetNames; - this.projectFile = startedEvent.ProjectFile; - this.showProjectFinishedEvent = false; - this.errorInProject = false; - this.projectId = startedEvent.ProjectId; - this.buildEventContext = startedEvent.BuildEventContext; - this.parentProjectStartedEvent = parentProjectStartedEvent; - this.projectFullKey = new ProjectFullKey(projectKey, entryPointKey); - this.timeStamp = startedEvent.Timestamp; - } - #endregion - } - - /// - /// This class stands in for a full target started event because it contains only the - /// minimum amount of inforomation needed for the logger - /// - internal class TargetStartedEventMinimumFields - { - #region Data - private DateTime timeStamp; - private string targetName; - private string targetFile; - private bool showTargetFinishedEvent; - private bool errorInTarget; - private BuildEventContext buildEventContext; - #endregion - - #region Properties - internal DateTime TimeStamp - { - get - { - return timeStamp; - } - } - - internal string TargetName - { - get - { - return targetName; - } - } - - internal string TargetFile - { - get - { - return targetFile; - } - } - - internal bool ShowTargetFinishedEvent - { - get - { - return showTargetFinishedEvent; - } - - set - { - showTargetFinishedEvent = value; - } - } - - internal bool ErrorInTarget - { - get - { - return this.errorInTarget; - } - - set - { - this.errorInTarget = value; - } - } - internal BuildEventContext ProjectBuildEventContext - { - get - { - return this.buildEventContext; - } - } - #endregion - - #region Constructors - internal TargetStartedEventMinimumFields(TargetStartedEventArgs startedEvent) - { - this.targetName = startedEvent.TargetName; - this.targetFile = startedEvent.TargetFile; - this.ShowTargetFinishedEvent = false; - this.errorInTarget = false; - this.buildEventContext = startedEvent.BuildEventContext; - this.timeStamp = startedEvent.Timestamp; - } - #endregion - } - - /// - /// This class is used as a key to group warnings and errors by the project entry point and the target they - /// error or warning was in - /// - internal class ErrorWarningSummaryDictionaryKey - { - #region Data - private BuildEventContext entryPointContext; - private string targetName; - private static ComparerContextNodeId eventComparer = new ComparerContextNodeId(); - #endregion - - #region Constructor - internal ErrorWarningSummaryDictionaryKey(BuildEventContext entryPoint, string targetName) - { - this.entryPointContext = entryPoint; - this.targetName = targetName ?? string.Empty; - } - #endregion - - #region Properties - internal BuildEventContext EntryPointContext - { - get - { - return entryPointContext; - } - } - - internal string TargetName - { - get - { - return targetName; - } - } - - #endregion - - #region Equality - - public override bool Equals(object obj) - { - ErrorWarningSummaryDictionaryKey key = obj as ErrorWarningSummaryDictionaryKey; - if (key == null) - { - return false; - } - return eventComparer.Equals(entryPointContext, key.EntryPointContext) && (String.Equals(targetName, key.TargetName, StringComparison.OrdinalIgnoreCase)); - } - - public override int GetHashCode() - { - return entryPointContext.GetHashCode() + targetName.GetHashCode(); - } - #endregion - - } - - /// - /// Structure that holds both project and entrypoint keys - /// - internal class ProjectFullKey - { - #region Data - private int projectKey; - private int entryPointKey; - #endregion - - #region Properties - internal int ProjectKey - { - get { return projectKey; } - set { projectKey = value; } - } - - internal int EntryPointKey - { - get { return entryPointKey; } - set { entryPointKey = value; } - } - #endregion - - #region Constructor - internal ProjectFullKey(int projectKey, int entryPointKey) - { - this.projectKey = projectKey; - this.entryPointKey = entryPointKey; - } - #endregion - - #region ToString - /// - /// Output the projectKey or the projectKey and the entrypointKey depending on the verbosity level of the logger - /// - - public string ToString(LoggerVerbosity verbosity) - { - string fullProjectKey; - - if (verbosity > LoggerVerbosity.Normal) - { - fullProjectKey = this.ToString(); - } - else - { - fullProjectKey = String.Format(CultureInfo.InvariantCulture, "{0}", projectKey); - } - - return fullProjectKey; - } - /// - /// The default of he ToString method should be to output the projectKey or the projectKey and the entrypointKey depending if a - /// entry point key exists or not - /// - /// - public override string ToString() - { - string fullProjectKey; - - if (entryPointKey > 1) - { - fullProjectKey = String.Format(CultureInfo.InvariantCulture, "{0}:{1}", projectKey, entryPointKey); - } - else - { - fullProjectKey = String.Format(CultureInfo.InvariantCulture, "{0}", projectKey); - } - - return fullProjectKey; - } - #endregion - - #region Equality - public override bool Equals(object obj) - { - ProjectFullKey compareKey = obj as ProjectFullKey; - if (compareKey != null) - { - return (compareKey.projectKey == this.projectKey) && (compareKey.entryPointKey == this.entryPointKey); - } - else - { - return false; - } - } - - public override int GetHashCode() - { - return this.projectKey + (this.entryPointKey << 16); - } - #endregion - } -} diff --git a/src/Deprecated/Engine/Logging/SerialConsoleLogger.cs b/src/Deprecated/Engine/Logging/SerialConsoleLogger.cs deleted file mode 100644 index 7fd23470acf..00000000000 --- a/src/Deprecated/Engine/Logging/SerialConsoleLogger.cs +++ /dev/null @@ -1,984 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections; -using System.Diagnostics; - -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - internal class SerialConsoleLogger : BaseConsoleLogger - { - #region Constructors - - /// - /// Default constructor. - /// - /// SumedhK - public SerialConsoleLogger() - : this(LoggerVerbosity.Normal) - { - // do nothing - } - - /// - /// Create a logger instance with a specific verbosity. This logs to - /// the default console. - /// - /// SumedhK - /// Verbosity level. - public SerialConsoleLogger(LoggerVerbosity verbosity) - : - this - ( - verbosity, - new WriteHandler(Console.Out.Write), - new ColorSetter(SetColor), - new ColorResetter(Console.ResetColor) - ) - { - // do nothing - } - - /// - /// Initializes the logger, with alternate output handlers. - /// - /// t-jeffv, sumedhk - /// - /// - /// - /// - public SerialConsoleLogger - ( - LoggerVerbosity verbosity, - WriteHandler write, - ColorSetter colorSet, - ColorResetter colorReset - ) - { - InitializeConsoleMethods(verbosity, write, colorSet, colorReset); - } - - #endregion - - #region Methods - - /// - /// Reset the states of per-build member variables - /// VSW#516376 - /// - internal override void ResetConsoleLoggerState() - { - if (ShowSummary) - { - errorList = new ArrayList(); - warningList = new ArrayList(); - } - else - { - errorList = null; - warningList = null; - } - - errorCount = 0; - warningCount = 0; - - projectPerformanceCounters = null; - targetPerformanceCounters = null; - taskPerformanceCounters = null; - } - - /// - /// Handler for build started events - /// - /// sender (should be null) - /// event arguments - /// t-jeffv, sumedhk - public override void BuildStartedHandler(object sender, BuildStartedEventArgs e) - { - buildStarted = e.Timestamp; - - // if verbosity is detailed or diagnostic - if (IsVerbosityAtLeast(LoggerVerbosity.Normal)) - { - WriteLinePrettyFromResource("BuildStartedWithTime", e.Timestamp); - } - } - - /// - /// Handler for build finished events - /// - /// sender (should be null) - /// event arguments - /// t-jeffv, sumedhk - public override void BuildFinishedHandler(object sender, BuildFinishedEventArgs e) - { - // Show the performance summary iff the verbosity is diagnostic or the user specifically asked for it - // with a logger parameter. - if (this.showPerfSummary) - { - ShowPerfSummary(); - } - - // if verbosity is normal, detailed or diagnostic - if (IsVerbosityAtLeast(LoggerVerbosity.Normal)) - { - if (e.Succeeded) - { - setColor(ConsoleColor.Green); - } - - // Write the "Build Finished" event. - WriteNewLine(); - WriteLinePretty(e.Message); - - resetColor(); - } - - // The decision whether or not to show a summary at this verbosity - // was made during initalization. We just do what we're told. - if (ShowSummary) - { - ShowErrorWarningSummary(); - - if (IsVerbosityAtLeast(LoggerVerbosity.Normal)) - { - // Emit text like: - // 1 Warning(s) - // 0 Error(s) - // Don't color the line if it's zero. (Per Whidbey behavior.) - if (warningCount > 0) - { - setColor(ConsoleColor.Yellow); - } - WriteLinePrettyFromResource(2, "WarningCount", warningCount); - resetColor(); - - if (errorCount > 0) - { - setColor(ConsoleColor.Red); - } - WriteLinePrettyFromResource(2, "ErrorCount", errorCount); - resetColor(); - } - } - - if (IsVerbosityAtLeast(LoggerVerbosity.Normal)) - { - string timeElapsed = LogFormatter.FormatTimeSpan(e.Timestamp - buildStarted); - - WriteNewLine(); - WriteLinePrettyFromResource("TimeElapsed", timeElapsed); - } - - ResetConsoleLoggerState(); - } - - /// - /// At the end of the build, repeats the errors and warnings that occurred - /// during the build, and displays the error count and warning count. - /// - private void ShowErrorWarningSummary() - { - if (warningCount == 0 && errorCount == 0) - { - return; - } - - // Make some effort to distinguish the summary from the previous output - WriteNewLine(); - - if (warningCount > 0) - { - setColor(ConsoleColor.Yellow); - foreach (BuildWarningEventArgs warningEventArgs in warningList) - { - WriteLinePretty(EventArgsFormatting.FormatEventMessage(warningEventArgs, runningWithCharacterFileType)); - } - } - - if (errorCount > 0) - { - setColor(ConsoleColor.Red); - foreach (BuildErrorEventArgs errorEventArgs in errorList) - { - WriteLinePretty(EventArgsFormatting.FormatEventMessage(errorEventArgs, runningWithCharacterFileType)); - } - } - - resetColor(); - } - - /// - /// Handler for project started events - /// - /// sender (should be null) - /// event arguments - /// t-jeffv, sumedhk - public override void ProjectStartedHandler(object sender, ProjectStartedEventArgs e) - { - if (!contextStack.IsEmpty()) - { - this.VerifyStack(contextStack.Peek().type == FrameType.Target, "Bad stack -- Top is project {0}", contextStack.Peek().ID); - } - - // if verbosity is normal, detailed or diagnostic - if (IsVerbosityAtLeast(LoggerVerbosity.Normal)) - { - ShowDeferredMessages(); - - // check for stack corruption - if (!contextStack.IsEmpty()) - { - this.VerifyStack(contextStack.Peek().type == FrameType.Target, "Bad stack -- Top is target {0}", contextStack.Peek().ID); - } - - contextStack.Push(new Frame(FrameType.Project, - false, // message not yet displayed - this.currentIndentLevel, - e.ProjectFile, - e.TargetNames, - null, - GetCurrentlyBuildingProjectFile())); - WriteProjectStarted(); - } - else - { - contextStack.Push(new Frame(FrameType.Project, - false, // message not yet displayed - this.currentIndentLevel, - e.ProjectFile, - e.TargetNames, - null, - GetCurrentlyBuildingProjectFile())); - } - - if (this.showPerfSummary) - { - PerformanceCounter counter = GetPerformanceCounter(e.ProjectFile, ref projectPerformanceCounters); - - // Place the counter "in scope" meaning the project is executing right now. - counter.InScope = true; - } - - if (Verbosity == LoggerVerbosity.Diagnostic && showItemAndPropertyList) - { - if (e.Properties != null) - { - ArrayList propertyList = ExtractPropertyList(e.Properties); - WriteProperties(propertyList); - } - - if (e.Items != null) - { - SortedList itemList = ExtractItemList(e.Items); - WriteItems(itemList); - } - } - } - - /// - /// Handler for project finished events - /// - /// sender (should be null) - /// event arguments - /// t-jeffv, sumedhk - public override void ProjectFinishedHandler(object sender, ProjectFinishedEventArgs e) - { - if (this.showPerfSummary) - { - PerformanceCounter counter = GetPerformanceCounter(e.ProjectFile, ref projectPerformanceCounters); - - // Place the counter "in scope" meaning the project is done executing right now. - counter.InScope = false; - } - - // if verbosity is detailed or diagnostic, - // or there was an error or warning - if (contextStack.Peek().hasErrorsOrWarnings - || (IsVerbosityAtLeast(LoggerVerbosity.Detailed))) - { - setColor(ConsoleColor.Cyan); - - if (IsVerbosityAtLeast(LoggerVerbosity.Normal)) - { - WriteNewLine(); - } - - WriteLinePretty(e.Message); - - resetColor(); - } - - Frame top = contextStack.Pop(); - - this.VerifyStack(top.type == FrameType.Project, "Unexpected project frame {0}", top.ID); - this.VerifyStack(top.ID == e.ProjectFile, "Project frame {0} expected, but was {1}.", e.ProjectFile, top.ID); - } - - /// - /// Handler for target started events - /// - /// sender (should be null) - /// event arguments - /// t-jeffv, sumedhk - public override void TargetStartedHandler(object sender, TargetStartedEventArgs e) - { - contextStack.Push(new Frame(FrameType.Target, - false, - this.currentIndentLevel, - e.TargetName, - null, - e.TargetFile, - GetCurrentlyBuildingProjectFile())); - - // if verbosity is detailed or diagnostic - if (IsVerbosityAtLeast(LoggerVerbosity.Detailed)) - { - WriteTargetStarted(); - } - - if (this.showPerfSummary) - { - PerformanceCounter counter = GetPerformanceCounter(e.TargetName, ref targetPerformanceCounters); - - // Place the counter "in scope" meaning the target is executing right now. - counter.InScope = true; - } - - // Bump up the overall number of indents, so that anything within this target will show up - // indented. - this.currentIndentLevel++; - } - - /// - /// Handler for target finished events - /// - /// sender (should be null) - /// event arguments - /// t-jeffv, sumedhk - public override void TargetFinishedHandler(object sender, TargetFinishedEventArgs e) - { - // Done with the target, so shift everything left again. - this.currentIndentLevel--; - - if (this.showPerfSummary) - { - PerformanceCounter counter = GetPerformanceCounter(e.TargetName, ref targetPerformanceCounters); - - // Place the counter "in scope" meaning the target is done executing right now. - counter.InScope = false; - } - - bool targetHasErrorsOrWarnings = contextStack.Peek().hasErrorsOrWarnings; - - // if verbosity is diagnostic, - // or there was an error or warning and verbosity is normal or detailed - if ((targetHasErrorsOrWarnings && (IsVerbosityAtLeast(LoggerVerbosity.Normal))) - || Verbosity == LoggerVerbosity.Diagnostic) - { - setColor(ConsoleColor.Cyan); - WriteLinePretty(e.Message); - resetColor(); - } - - Frame top = contextStack.Pop(); - this.VerifyStack(top.type == FrameType.Target, "bad stack frame type"); - this.VerifyStack(top.ID == e.TargetName, "bad stack frame id"); - - // set the value on the Project frame, for the ProjectFinished handler - if (targetHasErrorsOrWarnings) - { - SetErrorsOrWarningsOnCurrentFrame(); - } - } - - /// - /// Handler for task started events - /// - /// sender (should be null) - /// event arguments - /// t-jeffv, sumedhk - public override void TaskStartedHandler(object sender, TaskStartedEventArgs e) - { - // if verbosity is detailed or diagnostic - if (IsVerbosityAtLeast(LoggerVerbosity.Detailed)) - { - setColor(ConsoleColor.Cyan); - WriteLinePretty(e.Message); - resetColor(); - } - - if (this.showPerfSummary) - { - PerformanceCounter counter = GetPerformanceCounter(e.TaskName, ref taskPerformanceCounters); - - // Place the counter "in scope" meaning the task is executing right now. - counter.InScope = true; - } - - // Bump up the overall number of indents, so that anything within this task will show up - // indented. - this.currentIndentLevel++; - } - - /// - /// Handler for task finished events - /// - /// sender (should be null) - /// event arguments - /// t-jeffv, sumedhk - public override void TaskFinishedHandler(object sender, TaskFinishedEventArgs e) - { - // Done with the task, so shift everything left again. - this.currentIndentLevel--; - - if (this.showPerfSummary) - { - PerformanceCounter counter = GetPerformanceCounter(e.TaskName, ref taskPerformanceCounters); - - // Place the counter "in scope" meaning the task is done executing. - counter.InScope = false; - } - - // if verbosity is detailed or diagnostic - if (IsVerbosityAtLeast(LoggerVerbosity.Detailed)) - { - setColor(ConsoleColor.Cyan); - WriteLinePretty(e.Message); - resetColor(); - } - } - - /// - /// Prints an error event - /// - /// t-jeffv, sumedhk - public override void ErrorHandler(object sender, BuildErrorEventArgs e) - { - errorCount++; - SetErrorsOrWarningsOnCurrentFrame(); - ShowDeferredMessages(); - setColor(ConsoleColor.Red); - WriteLinePretty(EventArgsFormatting.FormatEventMessage(e, runningWithCharacterFileType)); - if (ShowSummary) - { - errorList.Add(e); - } - resetColor(); - } - - /// - /// Prints a warning event - /// - /// t-jeffv, sumedhk - public override void WarningHandler(object sender, BuildWarningEventArgs e) - { - warningCount++; - SetErrorsOrWarningsOnCurrentFrame(); - ShowDeferredMessages(); - setColor(ConsoleColor.Yellow); - WriteLinePretty(EventArgsFormatting.FormatEventMessage(e, runningWithCharacterFileType)); - if (ShowSummary) - { - warningList.Add(e); - } - resetColor(); - } - - /// - /// Prints a message event - /// - /// t-jeffv, sumedhk - public override void MessageHandler(object sender, BuildMessageEventArgs e) - { - bool print = false; - bool lightenText = false; - switch (e.Importance) - { - case MessageImportance.High: - print = IsVerbosityAtLeast(LoggerVerbosity.Minimal); - break; - - case MessageImportance.Normal: - print = IsVerbosityAtLeast(LoggerVerbosity.Normal); - lightenText = true; - break; - - case MessageImportance.Low: - print = IsVerbosityAtLeast(LoggerVerbosity.Detailed); - lightenText = true; - break; - - default: - ErrorUtilities.VerifyThrow(false, "Impossible"); - break; - } - - if (print) - { - ShowDeferredMessages(); - - if (lightenText) - { - setColor(ConsoleColor.DarkGray); - } - - // null messages are ok -- treat as blank line - string nonNullMessage = e.Message ?? String.Empty; - - WriteLinePretty(nonNullMessage); - - if (lightenText) - { - resetColor(); - } - } - } - - /// - /// Prints a custom event - /// - /// t-jeffv, sumedhk - public override void CustomEventHandler(object sender, CustomBuildEventArgs e) - { - // if verbosity is detailed or diagnostic - if (IsVerbosityAtLeast(LoggerVerbosity.Detailed)) - { - // ignore custom events with null messages -- some other - // logger will handle them appropriately - if (e.Message != null) - { - ShowDeferredMessages(); - WriteLinePretty(e.Message); - } - } - } - - /// - /// Writes project started messages. - /// - /// t-jeffv, sumedhk - internal void WriteProjectStarted() - { - this.VerifyStack(!contextStack.IsEmpty(), "Bad project stack"); - - //Pop the current project - Frame outerMost = contextStack.Pop(); - - this.VerifyStack(!outerMost.displayed, "Bad project stack on {0}", outerMost.ID); - this.VerifyStack(outerMost.type == FrameType.Project, "Bad project stack"); - - outerMost.displayed = true; - contextStack.Push(outerMost); - - WriteProjectStartedText(outerMost.ID, outerMost.targetNames, outerMost.parentProjectFile, - this.IsVerbosityAtLeast(LoggerVerbosity.Normal) ? outerMost.indentLevel : 0); - } - - /// - /// Displays the text for a project started message. - /// - /// current project file - /// previous project file - /// targets that are being invoked - /// indentation level - /// t-jeffv, sumedhk - private void WriteProjectStartedText(string current, string targetNames, string previous, int indentLevel) - { - if (!SkipProjectStartedText) - { - setColor(ConsoleColor.Cyan); - - this.VerifyStack(current != null, "Unexpected null project stack"); - - WriteLinePretty(projectSeparatorLine); - - if (previous == null) - { - if (string.IsNullOrEmpty(targetNames)) - { - WriteLinePrettyFromResource(indentLevel, "ProjectStartedPrefixForTopLevelProjectWithDefaultTargets", current); - } - else - { - WriteLinePrettyFromResource(indentLevel, "ProjectStartedPrefixForTopLevelProjectWithTargetNames", current, targetNames); - } - } - else - { - if (string.IsNullOrEmpty(targetNames)) - { - WriteLinePrettyFromResource(indentLevel, "ProjectStartedPrefixForNestedProjectWithDefaultTargets", previous, current); - } - else - { - WriteLinePrettyFromResource(indentLevel, "ProjectStartedPrefixForNestedProjectWithTargetNames", previous, current, targetNames); - } - } - - // add a little bit of extra space - WriteNewLine(); - - resetColor(); - } - } - - /// - /// Writes target started messages. - /// - /// SumedhK - private void WriteTargetStarted() - { - Frame f = contextStack.Pop(); - f.displayed = true; - contextStack.Push(f); - - setColor(ConsoleColor.Cyan); - - if (this.Verbosity == LoggerVerbosity.Diagnostic) - { - WriteLinePrettyFromResource(f.indentLevel, "TargetStartedFromFile", f.ID, f.file); - } - else - { - WriteLinePrettyFromResource(this.IsVerbosityAtLeast(LoggerVerbosity.Normal) ? f.indentLevel : 0, - "TargetStartedPrefix", f.ID); - } - - resetColor(); - } - - /// - /// Determines the currently building project file. - /// - /// name of project file currently being built - /// RGoel - private string GetCurrentlyBuildingProjectFile() - { - if (contextStack.IsEmpty()) - { - return null; - } - - Frame topOfStack = contextStack.Peek(); - - // If the top of the stack is a TargetStarted event, then its parent project - // file is the one we want. - if (topOfStack.type == FrameType.Target) - { - return topOfStack.parentProjectFile; - } - // If the top of the stack is a ProjectStarted event, then its ID is the project - // file we want. - else if (topOfStack.type == FrameType.Project) - { - return topOfStack.ID; - } - else - { - ErrorUtilities.VerifyThrow(false, "Unexpected frame type."); - return null; - } - } - - /// - /// Displays project started and target started messages that - /// are shown only when the associated project or target produces - /// output. - /// - /// t-jeffv, sumedhk - private void ShowDeferredMessages() - { - if (contextStack.IsEmpty()) - { - return; - } - - if (!contextStack.Peek().displayed) - { - Frame f = contextStack.Pop(); - - ShowDeferredMessages(); - - //push now, so that the stack is in a good state - //for WriteProjectStarted() and WriteLinePretty() - //because we use the stack to control indenting - contextStack.Push(f); - - switch (f.type) - { - case FrameType.Project: - WriteProjectStarted(); - break; - - case FrameType.Target: - // Only do things if we're at normal verbosity. If - // we're at a higher verbosity, we can assume that all - // targets have already be printed. If we're at lower - // verbosity we don't need to print at all. - ErrorUtilities.VerifyThrow(this.Verbosity < LoggerVerbosity.Detailed, - "This target should have already been printed at a higher verbosity."); - - if (IsVerbosityAtLeast(LoggerVerbosity.Normal)) - { - WriteTargetStarted(); - } - - break; - - default: - ErrorUtilities.VerifyThrow(false, "Unexpected frame type."); - break; - } - } - } - - /// - /// Marks the current frame to indicate that an error or warning - /// occurred during it. - /// - /// danmose - private void SetErrorsOrWarningsOnCurrentFrame() - { - // under unit test, there may not be frames on the stack - if (contextStack.Count == 0) - { - return; - } - - Frame frame = contextStack.Pop(); - frame.hasErrorsOrWarnings = true; - contextStack.Push(frame); - } - - /// - /// Checks the condition passed in. If it's false, it emits an error message to the console - /// indicating that there's a problem with the console logger. These "problems" should - /// never occur in the real world after we ship, unless there's a bug in the MSBuild - /// engine such that events aren't getting paired up properly. So the messages don't - /// really need to be localized here, since they're only for our own benefit, and have - /// zero value to a customer. - /// - /// - /// - /// - /// RGoel - private void VerifyStack - ( - bool condition, - string unformattedMessage, - params object[] args - ) - { - if (!condition && !ignoreLoggerErrors) - { - string errorMessage = "INTERNAL CONSOLE LOGGER ERROR. " + ResourceUtilities.FormatString(unformattedMessage, args); - BuildErrorEventArgs errorEvent = new BuildErrorEventArgs(null, null, null, 0, 0, 0, 0, - errorMessage, null, null); - - Debug.Assert(false, errorMessage); - - ErrorHandler(null, errorEvent); - } - } - #endregion - - #region Supporting classes - - /// - /// This enumeration represents the kinds of context that can be - /// stored in the context stack. - /// - /// t-jeffv, sumedhk - internal enum FrameType - { - Project, - Target - } - - /// - /// This struct represents context information about a single - /// target or project. - /// - /// t-jeffv, sumedhk - internal struct Frame - { - /// - /// Creates a new instance of frame with all fields specified. - /// - /// the type of the this frame - /// display state. true indicates this frame has been displayed to the user - /// indentation level for this frame - /// frame id - /// targets to execute, in the case of a project frame - /// the file name where the target is defined - /// parent project file - /// t-jeffv, sumedhk - internal Frame - ( - FrameType t, - bool d, - int indent, - string s, - string targets, - string fileOfTarget, - string parent - ) - { - type = t; - displayed = d; - indentLevel = indent; - ID = s; - targetNames = targets; - file = fileOfTarget; - hasErrorsOrWarnings = false; - parentProjectFile = parent; - } - - /// - /// Indicates if project or target frame. - /// - /// t-jeffv, sumedhk - internal FrameType type; - - /// - /// Set to true to indicate the user has seen a message about this frame. - /// - /// t-jeffv, sumedhk - internal bool displayed; - - /// - /// The number of tabstops to indent this event when it is eventually displayed. - /// - /// RGoel - internal int indentLevel; - - /// - /// A string associated with this frame -- should be a target name - /// or a project file. - /// - /// t-jeffv, sumedhk - internal string ID; - - /// - /// For a TargetStarted or a ProjectStarted event, this field tells us - /// the name of the *parent* project file that was responsible. - /// - internal string parentProjectFile; - - /// - /// Stores the TargetNames from the ProjectStarted event. Null for Target frames. - /// - /// t-jeffv, sumedhk - internal string targetNames; - - /// - /// For TargetStarted events, this stores the filename where the Target is defined - /// (e.g., Microsoft.Common.targets). This is different than the project that is - /// being built. - /// For ProjectStarted events, this is null. - /// - internal string file; - - /// - /// True if there were errors/warnings during the project or target frame. - /// - /// t-jeffv, sumedhk - internal bool hasErrorsOrWarnings; - } - - /// - /// The FrameStack class represents a (lifo) stack of Frames. - /// - /// t-jeffv, sumedhk - internal class FrameStack - { - /// - /// The frames member is contained by FrameStack and does - /// all the heavy lifting for FrameStack. - /// - /// t-jeffv, sumedhk - private System.Collections.Stack frames; - - /// - /// Create a new, empty, FrameStack. - /// - /// t-jeffv, sumedhk - internal FrameStack() - { - frames = new System.Collections.Stack(); - } - - /// - /// Remove and return the top element in the stack. - /// - /// t-jeffv, sumedhk - /// Thrown when stack is empty. - internal Frame Pop() - { - return (Frame)(frames.Pop()); - } - - /// - /// Returns, but does not remove, the top of the stack. - /// - /// t-jeffv, sumedhk - internal Frame Peek() - { - return (Frame)(frames.Peek()); - } - - /// - /// Push(f) adds f to the top of the stack. - /// - /// a frame to push - /// t-jeffv, sumedhk - internal void Push(Frame f) - { - frames.Push(f); - } - - /// - /// Constant property that indicates the number of elements - /// in the stack. - /// - /// t-jeffv, sumedhk - internal int Count - { - get - { - return frames.Count; - } - } - - /// - /// s.IsEmpty() is true iff s.Count == 0 - /// - /// t-jeffv, sumedhk - internal bool IsEmpty() - { - return frames.Count == 0; - } - } - #endregion - - #region Private member data - - /// - /// contextStack is the only interesting state in the console - /// logger. The context stack contains a sequence of frames - /// denoting current and previous containing projects and targets - /// - /// t-jeffv, sumedhk - internal FrameStack contextStack = new FrameStack(); - #endregion - } -} diff --git a/src/Deprecated/Engine/Microsoft.Build.Engine.csproj b/src/Deprecated/Engine/Microsoft.Build.Engine.csproj deleted file mode 100644 index fdd96ff09e0..00000000000 --- a/src/Deprecated/Engine/Microsoft.Build.Engine.csproj +++ /dev/null @@ -1,223 +0,0 @@ - - - $(FullFrameworkTFM) - $(NoWarn);618 - true - false - - true - $(XMakeRefPath) - $(XMakeRefPath) - true - true - true - This package contains the $(MSBuildProjectName) assembly which contains the legacy compatibility shim for the MSBuild engine. NOTE: This assembly is deprecated. - false - $(NoWarn);1570;1572;1573;1587 - disable - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $(AssemblyName).Strings.resources - Designer - - - - Resources\Strings.shared.resx - $(AssemblyName).Strings.shared.resources - Designer - - - - - diff --git a/src/Deprecated/Engine/Microsoft.Build.Engine.pkgdef b/src/Deprecated/Engine/Microsoft.Build.Engine.pkgdef deleted file mode 100644 index bdc0d56b1c1..00000000000 --- a/src/Deprecated/Engine/Microsoft.Build.Engine.pkgdef +++ /dev/null @@ -1,7 +0,0 @@ -[$RootKey$\RuntimeConfiguration\dependentAssembly\bindingRedirection\{7214565F-670F-4FEA-B50E-144CDC590E7B}] -"name"="Microsoft.Build.Engine" -"codeBase"="$BaseInstallDir$\MSBuild\Current\Bin\Microsoft.Build.Engine.dll" -"publicKeyToken"="b03f5f7f11d50a3a" -"culture"="neutral" -"oldVersion"="0.0.0.0-99.9.9.9" -"newVersion"="15.1.0.0" diff --git a/src/Deprecated/Engine/Properties/BuildProperty.cs b/src/Deprecated/Engine/Properties/BuildProperty.cs deleted file mode 100644 index 6ac5465d80e..00000000000 --- a/src/Deprecated/Engine/Properties/BuildProperty.cs +++ /dev/null @@ -1,898 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Xml; -using System.Diagnostics; -using System.IO; - -using Microsoft.Build.BuildEngine.Shared; -using System.Collections.Generic; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This is an enumeration of property types. Each one is explained further - /// below. - /// - /// rgoel - internal enum PropertyType - { - // A "normal" property is the kind that is settable by the project - // author from within the project file. They are arbitrarily named - // by the author. - NormalProperty, - - // An "imported" property is like a "normal" property, except that - // instead of coming directly from the project file, its definition - // is in one of the imported files (e.g., "CSharp.buildrules"). - ImportedProperty, - - // A "global" property is the kind that is set outside of the project file. - // Once such a property is set, it cannot be overridden by the project file. - // For example, when the user sets a property via a switch on the XMake - // command-line, this is a global property. In the IDE case, "Configuration" - // would be a global property set by the IDE. - GlobalProperty, - - // A "reserved" property behaves much like a read-only property, except - // that the names are not arbitrary; they are chosen by us. Also, - // no user can ever set or override these properties. For example, - // "XMakeProjectName" would be a property that is only settable by - // XMake code. Any attempt to set this property via the project file - // or any other mechanism should result in an error. - ReservedProperty, - - // An "environment" property is one that came from an environment variable. - EnvironmentProperty, - - // An "output" property is generated by a task. Properties of this type - // override all properties except "reserved" ones. - OutputProperty - } - - /// - /// This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// This class holds an MSBuild property. This may be a property that is - /// represented in the MSBuild project file by an XML element, or it - /// may not be represented in any real XML file (e.g., global properties, - /// environment properties, etc.) - /// - /// - /// [!WARNING] - /// > This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// rgoel - [DebuggerDisplay("BuildProperty (Name = { Name }, Value = { Value }, FinalValue = { FinalValue }, Condition = { Condition })")] - public class BuildProperty - { - #region Member Data - // This is an alternative location for property data: if propertyElement - // is null, which means the property is not persisted, we should not store - // the name/value pair in an XML attribute, because the property name - // may contain illegal XML characters. - private string propertyName = null; - - // We'll still store the value no matter what, because fetching the inner - // XML can be an expensive operation. - private string propertyValue = null; - - // This is the final evaluated value for the property. - private string finalValueEscaped = String.Empty; - - // This the type of the property from the PropertyType enumeration defined - // above. - private PropertyType type = PropertyType.NormalProperty; - - // This is the XML element for this property. This contains the name and - // value for this property as well as the condition. For example, - // this node may look like this: - // 4 - // - // If this property is not represented by an actual XML element in the - // project file, it's okay if this is null. - private XmlElement propertyElement = null; - - // This is the specific XML attribute in the above XML element which - // contains the "Condition". - private XmlAttribute conditionAttribute = null; - - // If this property is persisted in the project file, then we need to - // store a reference to the parent . - private BuildPropertyGroup parentPersistedPropertyGroup = null; - - // Dictionary to intern the value and finalEscapedValue strings as they are deserialized - private static Dictionary customInternTable = new Dictionary(StringComparer.OrdinalIgnoreCase); - #endregion - - #region CustomSerializationToStream - internal void WriteToStream(BinaryWriter writer) - { - // Cannot be null - writer.Write(propertyName); - writer.Write(propertyValue); - - // Only bother serializing the finalValueEscaped - // if it's not identical to the Value (it often is) - if (propertyValue == finalValueEscaped) - { - writer.Write((byte)1); - } - else - { - writer.Write((byte)0); - writer.Write(finalValueEscaped); - } - writer.Write((Int32)type); - } - - /// - /// Avoid creating duplicate strings when deserializing. We are using a custom intern table - /// because String.Intern keeps a reference to the string until the appdomain is unloaded. - /// - private static string Intern(string stringToIntern) - { - string value; - if (!customInternTable.TryGetValue(stringToIntern, out value)) - { - customInternTable.Add(stringToIntern, stringToIntern); - value = stringToIntern; - } - - return value; - } - - internal static BuildProperty CreateFromStream(BinaryReader reader) - { - string name = reader.ReadString(); - string value = Intern(reader.ReadString()); - - byte marker = reader.ReadByte(); - string finalValueEscaped; - - if (marker == (byte)1) - { - finalValueEscaped = value; - } - else - { - finalValueEscaped = Intern(reader.ReadString()); - } - - PropertyType type = (PropertyType)reader.ReadInt32(); - - BuildProperty property = new BuildProperty(name, value, type); - property.finalValueEscaped = finalValueEscaped; - return property; - } - - /// - /// Clear the static intern table, so that the memory can be released - /// when a build is released and the node is waiting for re-use. - /// - internal static void ClearInternTable() - { - customInternTable.Clear(); - } - #endregion - - #region Constructors - - /// - /// Constructor, that initializes the property with an existing XML element. - /// - /// - /// - /// rgoel - internal BuildProperty - ( - XmlElement propertyElement, - PropertyType propertyType - ) : - this(propertyElement, - propertyElement != null ? Utilities.GetXmlNodeInnerContents(propertyElement) : null, - propertyType) - { - ProjectErrorUtilities.VerifyThrowInvalidProject(XMakeElements.IllegalItemPropertyNames[this.Name] == null, - propertyElement, "CannotModifyReservedProperty", this.Name); - } - - /// - /// Constructor, that initializes the property with cloned information. - /// - /// Callers -- Please ensure that the propertyValue passed into this constructor - /// is actually computed by calling GetXmlNodeInnerContents on the propertyElement. - /// - /// - /// - /// - /// rgoel - private BuildProperty - ( - XmlElement propertyElement, - string propertyValue, - PropertyType propertyType - ) - { - // Make sure the property node has been given to us. - ErrorUtilities.VerifyThrow(propertyElement != null, - "Need an XML node representing the property element."); - - // Validate that the property name doesn't contain any illegal characters. - XmlUtilities.VerifyThrowProjectValidElementName(propertyElement); - - this.propertyElement = propertyElement; - - // Loop through the list of attributes on the property element. - foreach (XmlAttribute propertyAttribute in propertyElement.Attributes) - { - switch (propertyAttribute.Name) - { - case XMakeAttributes.condition: - // We found the "condition" attribute. Process it. - this.conditionAttribute = propertyAttribute; - break; - - default: - ProjectXmlUtilities.ThrowProjectInvalidAttribute(propertyAttribute); - break; - } - } - - this.propertyValue = propertyValue; - this.finalValueEscaped = propertyValue; - this.type = propertyType; - } - - /// - /// Constructor, that initializes the property from the raw data, like - /// the property name and property value. This constructor actually creates - /// a new XML element to represent the property, and so it needs the owner - /// XML document. - /// - /// - /// - /// - /// - /// rgoel - internal BuildProperty - ( - XmlDocument ownerDocument, - string propertyName, - string propertyValue, - PropertyType propertyType - ) - { - ErrorUtilities.VerifyThrowArgumentLength(propertyName, nameof(propertyName)); - ErrorUtilities.VerifyThrowArgumentNull(propertyValue, nameof(propertyValue)); - - // Validate that the property name doesn't contain any illegal characters. - XmlUtilities.VerifyThrowValidElementName(propertyName); - - // If we've been given an owner XML document, create a new property - // XML element in that document. - if (ownerDocument != null) - { - // Create the new property XML element. - this.propertyElement = ownerDocument.CreateElement(propertyName, XMakeAttributes.defaultXmlNamespace); - - // Set the value - Utilities.SetXmlNodeInnerContents(this.propertyElement, propertyValue); - - // Get the value back. Because of some XML weirdness (particularly whitespace between XML attribute), - // what you set may not be exactly what you get back. That's why we ask XML to give us the value - // back, rather than assuming it's the same as the string we set. - this.propertyValue = Utilities.GetXmlNodeInnerContents(this.propertyElement); - } - else - { - // Otherwise this property is not going to be persisted, so we don't - // need an XML element. - this.propertyName = propertyName; - this.propertyValue = propertyValue; - - this.propertyElement = null; - } - - ErrorUtilities.VerifyThrowInvalidOperation(XMakeElements.IllegalItemPropertyNames[this.Name] == null, - "CannotModifyReservedProperty", this.Name); - - // Initialize the final evaluated value of this property to just the - // normal unevaluated value. We actually can't evaluate it in isolation ... - // we need the context of all the properties in the project file. - this.finalValueEscaped = propertyValue; - - // We default to a null condition. Setting a condition must be done - // through the "Condition" property after construction. - this.conditionAttribute = null; - - // Assign the property type. - this.type = propertyType; - } - - /// - /// Constructor, that initializes the property from the raw data, like - /// the property name and property value. This constructor actually creates - /// a new XML element to represent the property, and creates this XML element - /// under some dummy XML document. This would be used if the property didn't - /// need to be persisted in an actual XML file at any point, like a "global" - /// property or an "environment" property". - /// - /// - /// - /// - /// rgoel - internal BuildProperty - ( - string propertyName, - string propertyValue, - PropertyType propertyType - ) : - this(null, propertyName, propertyValue, propertyType) - { - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Constructor, which initializes the property from just the property - /// name and value, creating it as a "normal" property. This ends up - /// creating a new XML element for the property under a dummy XML document. - /// - /// - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// rgoel - public BuildProperty - ( - string propertyName, - string propertyValue - ) : - this(propertyName, propertyValue, PropertyType.NormalProperty) - { - } - - #endregion - - #region Properties - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Accessor for the property name. This is read-only, so one cannot - /// change the property name once it's set ... your only option is - /// to create a new BuildProperty object. The reason is that BuildProperty objects - /// are often stored in hash tables where the hash function is based - /// on the property name. Modifying the property name of an existing - /// BuildProperty object would make the hash table incorrect. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// RGoel - public string Name - { - get - { - if (propertyElement != null) - { - // Get the property name directly off the XML element. - return this.propertyElement.Name; - } - else - { - // If we are not persisted, propertyName and propertyValue must not be null. - ErrorUtilities.VerifyThrow(!string.IsNullOrEmpty(this.propertyName) && (this.propertyValue != null), - "BuildProperty object doesn't have a name/value pair."); - - // Get the property name from the string variable - return this.propertyName; - } - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Accessor for the property value. Normal properties can be modified; - /// other property types cannot. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// RGoel - public string Value - { - get - { - // If we are not persisted, propertyName and propertyValue must not be null. - ErrorUtilities.VerifyThrow(this.propertyValue != null, - "BuildProperty object doesn't have a name/value pair."); - - return this.propertyValue; - } - - set - { - ErrorUtilities.VerifyThrowInvalidOperation(this.type != PropertyType.ImportedProperty, - "CannotModifyImportedProjects", this.Name); - - ErrorUtilities.VerifyThrowInvalidOperation(this.type != PropertyType.EnvironmentProperty, - "CannotModifyEnvironmentProperty", this.Name); - - ErrorUtilities.VerifyThrowInvalidOperation(this.type != PropertyType.ReservedProperty, - "CannotModifyReservedProperty", this.Name); - - ErrorUtilities.VerifyThrowInvalidOperation(this.type != PropertyType.GlobalProperty, - "CannotModifyGlobalProperty", this.Name, "Project.GlobalProperties"); - - SetValue(value); - } - } - - /// - /// Helper method to set the value of a BuildProperty. - /// - /// DavidLe - /// - /// nothing - internal void SetValue(string value) - { - ErrorUtilities.VerifyThrowArgumentNull(value, "Value"); - - // NO OP if the value we set is the same we already have - // This will prevent making the project dirty - if (value == this.propertyValue) - { - return; - } - - // NOTE: allow output properties to be modified -- they're just like normal properties (except for their - // precedence), and it doesn't really matter if they are modified, since they are transient (virtual) - - if (this.propertyElement != null) - { - // If our XML element is not null, store the value in it. - Utilities.SetXmlNodeInnerContents(this.propertyElement, value); - - // Get the value back. Because of some XML weirdness (particularly whitespace between XML attribute), - // what you set may not be exactly what you get back. That's why we ask XML to give us the value - // back, rather than assuming it's the same as the string we set. - this.propertyValue = Utilities.GetXmlNodeInnerContents(this.propertyElement); - } - else - { - // Otherwise, store the value in the string variable. - this.propertyValue = value; - } - - this.finalValueEscaped = value; - MarkPropertyAsDirty(); - } - - /// - /// Accessor for the final evaluated property value. This is read-only. - /// To modify the raw value of a property, use BuildProperty.Value. - /// - /// RGoel - internal string FinalValueEscaped - { - get - { - return this.finalValueEscaped; - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Returns the unescaped value of the property. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// RGoel - public string FinalValue - { - get - { - return EscapingUtilities.UnescapeAll(this.FinalValueEscaped); - } - } - - /// - /// Accessor for the property type. This is internal, so that nobody - /// calling the OM can modify the type. We actually need to modify - /// it in certain cases internally. C# doesn't allow a different - /// access mode for the "get" vs. the "set", so we've made them both - /// internal. - /// - /// RGoel - internal PropertyType Type - { - get - { - return this.type; - } - - set - { - this.type = value; - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Did this property originate from an imported project file? - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// RGoel - public bool IsImported - { - get - { - return this.type == PropertyType.ImportedProperty; - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Accessor for the condition on the property. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// RGoel - public string Condition - { - get - { - return (this.conditionAttribute == null) ? String.Empty : this.conditionAttribute.Value; - } - - set - { - // If this BuildProperty object is not actually represented by an - // XML element in the project file, then do not allow - // the caller to set the condition. - ErrorUtilities.VerifyThrowInvalidOperation(this.propertyElement != null, - "CannotSetCondition"); - - // If this property was imported from another project, we don't allow modifying it. - ErrorUtilities.VerifyThrowInvalidOperation(this.Type != PropertyType.ImportedProperty, - "CannotModifyImportedProjects"); - - this.conditionAttribute = ProjectXmlUtilities.SetOrRemoveAttribute(propertyElement, XMakeAttributes.condition, value); - - MarkPropertyAsDirty(); - } - } - - /// - /// Read-only accessor for accessing the XML attribute for "Condition". Callers should - /// never try and modify this. Go through this.Condition to change the condition. - /// - /// RGoel - internal XmlAttribute ConditionAttribute - { - get - { - return this.conditionAttribute; - } - } - - /// - /// Accessor for the XmlElement representing this property. This is internal - /// to MSBuild, and is read-only. - /// - /// RGoel - internal XmlElement PropertyElement - { - get - { - return this.propertyElement; - } - } - - /// - /// We need to store a reference to the parent BuildPropertyGroup, so we can - /// send up notifications. - /// - /// RGoel - internal BuildPropertyGroup ParentPersistedPropertyGroup - { - get - { - return this.parentPersistedPropertyGroup; - } - - set - { - ErrorUtilities.VerifyThrow(((value == null) && (this.parentPersistedPropertyGroup != null)) || ((value != null) && (this.parentPersistedPropertyGroup == null)), - "Either new parent cannot be assigned because we already have a parent, or old parent cannot be removed because none exists."); - - this.parentPersistedPropertyGroup = value; - } - } - - #endregion - - #region Methods - - /// - /// Given a property bag, this method evaluates the current property, - /// expanding any property references contained within. It stores this - /// evaluated value in the "finalValue" member. - /// - /// RGoel - internal void Evaluate - ( - Expander expander - ) - { - ErrorUtilities.VerifyThrow(expander != null, "Expander required to evaluated property."); - - this.finalValueEscaped = expander.ExpandAllIntoStringLeaveEscaped(this.Value, this.propertyElement); - } - - /// - /// Marks the parent project as dirty. - /// - /// RGoel - private void MarkPropertyAsDirty - ( - ) - { - if (this.ParentPersistedPropertyGroup != null) - { - ErrorUtilities.VerifyThrow(this.ParentPersistedPropertyGroup.ParentProject != null, "Persisted BuildPropertyGroup doesn't have parent project."); - this.ParentPersistedPropertyGroup.MarkPropertyGroupAsDirty(); - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Creates a shallow or deep clone of this BuildProperty object. - /// - /// A shallow clone points at the same XML element as the original, so - /// that modifications to the name or value will be reflected in both - /// copies. However, the two copies could have different a finalValue. - /// - /// A deep clone actually clones the XML element as well, so that the - /// two copies are completely independent of each other. - /// - /// - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// rgoel - public BuildProperty Clone - ( - bool deepClone - ) - { - BuildProperty clone; - - // If this property object is represented as an XML element. - if (this.propertyElement != null) - { - XmlElement newPropertyElement; - - if (deepClone) - { - // Clone the XML element itself. The new XML element will be - // associated with the same XML document as the original property, - // but won't actually get added to the XML document. - newPropertyElement = (XmlElement)this.propertyElement.Clone(); - } - else - { - newPropertyElement = this.propertyElement; - } - - // Create the cloned BuildProperty object, and return it. - clone = new BuildProperty(newPropertyElement, this.propertyValue, this.Type); - } - else - { - // Otherwise, it's just an in-memory property. We can't do a shallow - // clone for this type of property, because there's no XML element for - // the clone to share. - ErrorUtilities.VerifyThrowInvalidOperation(deepClone, "ShallowCloneNotAllowed"); - - // Create a new property, using the same name, value, and property type. - clone = new BuildProperty(this.Name, this.Value, this.Type); - } - - // Do not set the ParentPersistedPropertyGroup on the cloned property, because it isn't really - // part of the property group. - - // Be certain we didn't copy the value string: it's a waste of memory - ErrorUtilities.VerifyThrow(Object.ReferenceEquals(clone.Value, this.Value), "Clone value should be identical reference"); - - return clone; - } - - /// - /// Compares two BuildProperty objects ("this" and "compareToProperty") to determine - /// if all the fields within the BuildProperty are the same. - /// - /// - /// true if the properties are equivalent, false otherwise - internal bool IsEquivalent - ( - BuildProperty compareToProperty - ) - { - // Intentionally do not compare parentPersistedPropertyGroup, because this is - // just a back-pointer, and doesn't really contribute to the "identity" of - // the property. - - return - (compareToProperty != null) && - (String.Equals(compareToProperty.propertyName, this.propertyName, StringComparison.OrdinalIgnoreCase)) && - (compareToProperty.propertyValue == this.propertyValue) && - (compareToProperty.FinalValue == this.FinalValue) && - (compareToProperty.type == this.type); - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Returns the property value. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// RGoel - public override string ToString - ( - ) - { - return (string)this; - } - - #endregion - - #region Operators - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// This allows an implicit typecast from a "BuildProperty" to a "string" - /// when trying to access the property's value. - /// - /// - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// rgoel - public static explicit operator string - ( - BuildProperty propertyToCast - ) - { - if (propertyToCast == null) - { - return String.Empty; - } - - return propertyToCast.FinalValue; - } - - #endregion - } -} diff --git a/src/Deprecated/Engine/Properties/BuildPropertyGroup.cs b/src/Deprecated/Engine/Properties/BuildPropertyGroup.cs deleted file mode 100644 index de0cdfc4c5a..00000000000 --- a/src/Deprecated/Engine/Properties/BuildPropertyGroup.cs +++ /dev/null @@ -1,1809 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Xml; -using System.IO; -using System.Collections; -using System.Diagnostics; - -using Microsoft.Build.BuildEngine.Shared; - -using error = Microsoft.Build.BuildEngine.Shared.ErrorUtilities; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// A BuildPropertyGroup is a collection of BuildProperty objects. This could be represented by a persisted <PropertyGroup> - /// element in the project file, or it could be a virtual collection of properties, such as in the case of global properties, - /// environment variable properties, or the final evaluated properties of a project. These two types of PropertyGroups - /// (persisted and virtual) are handled differently by many of the methods in this class, but in order to reduce the number of - /// concepts for the consumer of the OM, we've merged them into a single class. - /// - /// - /// [!WARNING] - /// > This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// RGoel - [DebuggerDisplay("BuildPropertyGroup (Count = { Count }, Condition = { Condition })")] - public class BuildPropertyGroup : IItemPropertyGrouping, IEnumerable - { - #region Member Data - - // This is the XML element representing the in the XMake - // project file. If this BuildPropertyGroup object doesn't represent an - // actual element in the XMake project file, it's - // okay if this remains null throughout the life of this object. - private XmlElement propertyGroupElement = null; - - // If this is a persisted , this boolean tells us whether - // it came from the main project file, or an imported project file. - private bool importedFromAnotherProject = false; - - // the ownerDocument is used for creating and adding new properties - private XmlDocument ownerDocument = null; - - // This is the "Condition" attribute on the element above. - private XmlAttribute conditionAttribute = null; - - // If this is a persisted BuildPropertyGroup, it has a parent Project object. - private Project parentProject = null; - - // Collection property belongs to. - private GroupingCollection parentCollection = null; - - // This is a table of BuildProperty objects, hashed by property name, so - // that specific properties can be found easily. Obviously, there - // can only be one property with a given name in this table. This - // table is only valid (non-null) for virtual property groups (i.e., - // those not persisted in a element in the project). - private CopyOnWriteHashtable propertyTableByName = null; - - // holds properties that have been overridden by output properties from tasks, so that we can restore them on demand - private CopyOnWriteHashtable propertiesOverriddenByOutputProperties; - - // This is the raw list of all the properties in this property group, - // in the order that they appear in the project file. In this list, - // there can be multiple properties of the same name. This member - // is only valid (non-null) if this is a persisted . - // For virtual property groups (e.g., evaluated property groups, - // global property groups, etc.), this will remain null. - private ArrayList propertyList = null; - - // Contains the name of the project file this property group was - // imported from. This string will only be set if the property group - // was created by the IDE adding a new property. - private string importedFromFilename = null; - - #endregion - - #region CustomSerializationToStream - - internal void WriteToStream(BinaryWriter writer) - { - if (propertyTableByName == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - writer.Write((Int32)propertyTableByName.Count); - foreach (string key in propertyTableByName.Keys) - { - writer.Write(key); - if (propertyTableByName[key] == null) - { - writer.Write((byte)0); - } - else - { - writer.Write((byte)1); - ((BuildProperty)propertyTableByName[key]).WriteToStream(writer); - } - } - } - } - - internal void CreateFromStream(BinaryReader reader) - { - if (reader.ReadByte() == 0) - { - propertyTableByName = null; - } - else - { - // Write Number of HashItems - int numberOfHashKeyValuePairs = reader.ReadInt32(); - propertyTableByName = new CopyOnWriteHashtable(numberOfHashKeyValuePairs, StringComparer.OrdinalIgnoreCase); - for (int i = 0; i < numberOfHashKeyValuePairs; i++) - { - string key = reader.ReadString(); - BuildProperty value = null; - if (reader.ReadByte() == 1) - { - value = BuildProperty.CreateFromStream(reader); - } - propertyTableByName.Add(key, value); - } - } - } - #endregion - - #region Constructors - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Default constructor, that creates an empty virtual (non-persisted) BuildPropertyGroup. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public BuildPropertyGroup() - : this(null, 0) - { - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Default constructor, that creates an empty virtual (non-persisted) BuildPropertyGroup. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public BuildPropertyGroup(Project parentProject) - : this(parentProject, 0) - { - } - - /// - /// Constructor for empty virtual (non-persisted) BuildPropertyGroup. Use this constructor - /// when the initial number of properties can be estimated, to reduce re-sizing of the list. - /// - private BuildPropertyGroup(Project parentProject, int capacity) - { - this.parentProject = parentProject; - this.propertyGroupElement = null; - this.importedFromAnotherProject = false; - this.conditionAttribute = null; - - this.propertyTableByName = new CopyOnWriteHashtable(capacity, StringComparer.OrdinalIgnoreCase); - this.propertyList = null; - } - - /// - /// Constructor, from an existing <PropertyGroup> XML element. - /// - /// - /// - /// RGoel - internal BuildPropertyGroup - ( - Project parentProject, - string importedFilename, - string condition - ) : this(parentProject, Engine.GlobalDummyXmlDoc, true) - { - // Set the new "Condition" attribute on the element. - this.propertyGroupElement.SetAttribute(XMakeAttributes.condition, condition); - this.conditionAttribute = this.propertyGroupElement.Attributes[XMakeAttributes.condition]; - this.importedFromFilename = importedFilename; - } - - /// - /// Constructor, from an existing <PropertyGroup> XML element in the - /// main project file. - /// - internal BuildPropertyGroup(Project parentProject, XmlElement propertyGroupElement) - : this(parentProject, propertyGroupElement, PropertyType.NormalProperty) - { - } - - /// - /// Constructor, from an existing <PropertyGroup> XML element, which may - /// be imported - /// - internal BuildPropertyGroup(Project parentProject, XmlElement propertyGroupElement, bool isImported) - : this(parentProject, propertyGroupElement, isImported ? PropertyType.ImportedProperty : PropertyType.NormalProperty) - { - } - - /// - /// Constructor, from an existing <PropertyGroup> XML element. - /// - internal BuildPropertyGroup(Project parentProject, XmlElement propertyGroupElement, PropertyType propertyType) - { - error.VerifyThrow(propertyGroupElement != null, "Need valid element."); - - // Make sure this really is the node. - ProjectXmlUtilities.VerifyThrowElementName(propertyGroupElement, XMakeElements.propertyGroup); - - this.parentProject = parentProject; - - this.propertyGroupElement = propertyGroupElement; - this.importedFromAnotherProject = (propertyType == PropertyType.ImportedProperty); - this.conditionAttribute = null; - - this.propertyTableByName = null; - this.propertyList = new ArrayList(); - - this.ownerDocument = propertyGroupElement.OwnerDocument; - - // This is coming from an existing XML element, so - // walk through all the attributes and child elements, creating the - // necessary BuildProperty objects. - - // Loop through the list of attributes on the element. - foreach (XmlAttribute propertyGroupAttribute in this.propertyGroupElement.Attributes) - { - switch (propertyGroupAttribute.Name) - { - // Process the "condition" attribute. - case XMakeAttributes.condition: - this.conditionAttribute = propertyGroupAttribute; - break; - - // only recognized by the new OM: - // just ignore here - case XMakeAttributes.label: - // do nothing - break; - - // Unrecognized attribute. - default: - ProjectXmlUtilities.ThrowProjectInvalidAttribute(propertyGroupAttribute); - break; - } - } - - // Loop through the child nodes of the element. - foreach (XmlNode propertyGroupChildNode in this.propertyGroupElement) - { - switch (propertyGroupChildNode.NodeType) - { - // Handle XML comments under the node (just ignore them). - case XmlNodeType.Comment: - // fall through - case XmlNodeType.Whitespace: - // ignore whitespace - break; - - case XmlNodeType.Element: - // The only type of child node that a element can contain - // is a property element. - - // Make sure the property doesn't have a custom namespace - ProjectXmlUtilities.VerifyThrowProjectValidNamespace((XmlElement)propertyGroupChildNode); - - // Send the property element to another class for processing. - BuildProperty newProperty = new BuildProperty((XmlElement)propertyGroupChildNode, propertyType); - newProperty.ParentPersistedPropertyGroup = this; - this.propertyList.Add(newProperty); - break; - - default: - // Unrecognized child element. - ProjectXmlUtilities.ThrowProjectInvalidChildElement(propertyGroupChildNode); - break; - } - } - } - - /// - /// Constructor which creates a new <PropertyGroup> in the XML document - /// specified. - /// - /// - /// - /// RGoel - internal BuildPropertyGroup - ( - Project parentProject, - XmlDocument ownerDocument, - bool importedFromAnotherProject - ) - { - error.VerifyThrow(ownerDocument != null, "Need valid XmlDocument owner for this property group."); - - this.parentProject = parentProject; - - // Create the new XML element. - this.propertyGroupElement = ownerDocument.CreateElement(XMakeElements.propertyGroup, XMakeAttributes.defaultXmlNamespace); - this.importedFromAnotherProject = importedFromAnotherProject; - - this.ownerDocument = ownerDocument; - - this.conditionAttribute = null; - - this.propertyTableByName = null; - this.propertyList = new ArrayList(); - } - - #endregion - - #region Properties - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// This returns a boolean telling you whether this particular property - /// group was imported from another project, or whether it was defined - /// in the main project. For virtual property groups which have no - /// persistence, this is false. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// RGoel - public bool IsImported - { - get - { - return this.importedFromAnotherProject; - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Accessor for the condition on the property group. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// RGoel - public string Condition - { - get - { - return (this.conditionAttribute == null) ? String.Empty : this.conditionAttribute.Value; - } - - set - { - // If this BuildPropertyGroup object is not actually represented by a - // element in the project file, then do not allow - // the caller to set the condition. - MustBePersisted("CannotSetCondition", null); - - // If this BuildPropertyGroup was imported from another project, we don't allow modifying it. - error.VerifyThrowInvalidOperation(!this.importedFromAnotherProject, - "CannotModifyImportedProjects"); - - this.conditionAttribute = ProjectXmlUtilities.SetOrRemoveAttribute(propertyGroupElement, XMakeAttributes.condition, value); - - this.MarkPropertyGroupAsDirty(); - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Allows setting the condition for imported property groups. Changes will not be persisted. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public void SetImportedPropertyGroupCondition(string condition) - { - // If this BuildPropertyGroup object is not actually represented by a - // element in the project file, then do not allow - // the caller to set the condition. - MustBePersisted("CannotSetCondition", null); - - this.conditionAttribute = ProjectXmlUtilities.SetOrRemoveAttribute(propertyGroupElement, XMakeAttributes.condition, condition); - - this.MarkPropertyGroupAsDirty(); - } - - /// - /// Read-only accessor for accessing the XML attribute for "Condition". Callers should - /// never try and modify this. Go through this.Condition to change the condition. - /// - /// RGoel - internal XmlAttribute ConditionAttribute - { - get - { - return this.conditionAttribute; - } - } - - /// - /// Accessor for the XmlElement representing this property group. This is - /// internal to MSBuild, and is read-only. - /// - /// RGoel - internal XmlElement PropertyGroupElement - { - get - { - return this.propertyGroupElement; - } - } - - /// - /// Accessor for the parent Project object. - /// - internal Project ParentProject - { - get { return parentProject; } - set { parentProject = value; } - } - - /// - /// Setter for parent project field that makes explicit that's it's only for clearing it. - /// - internal void ClearParentProject() - { - parentProject = null; - } - - /// - /// Accessor for the ParentCollection - /// - /// Collection BuildPropertyGroup belongs to - /// davidle - internal GroupingCollection ParentCollection - { - get - { - return this.parentCollection; - } - - set - { - this.parentCollection = value; - } - } - - /// - /// Accessor for the XML parent element - /// - /// Collection BuildPropertyGroup belongs to - /// davidle - internal XmlElement ParentElement - { - get - { - if (this.propertyGroupElement != null) - { - if (this.propertyGroupElement.ParentNode is XmlElement) - { - return (XmlElement)this.propertyGroupElement.ParentNode; - } - } - - return null; - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// - /// Microsoft.Build.Execution - /// Returns the number of properties contained in this BuildPropertyGroup. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// RGoel - public int Count - { - get - { - // If this is a persisted , return the count on the ArrayList. - if (this.propertyList != null) - { - error.VerifyThrow(this.propertyTableByName == null, "Did not expect a property hash table."); - - return this.propertyList.Count; - } - - // If this is a virtual BuildPropertyGroup, return the count on the HashTable. - if (this.propertyTableByName != null) - { - return this.propertyTableByName.Count; - } - - // If this is neither, we have an internal failure. - error.VerifyThrow(false, "Expected either a hash table or an array list of properties."); - - return 0; - } - } - - /// - /// Implements logic to get filename from propertygroups that doesn't have an - /// XmlElement behind it. - /// - /// string containing filename of import file - /// davidle - internal string ImportedFromFilename - { - get - { - if (!this.importedFromAnotherProject) - { - return string.Empty; - } - - if (this.importedFromFilename != null) - { - return this.importedFromFilename; - } - - if (this.PropertyGroupElement != null) - { - return XmlUtilities.GetXmlNodeFile(this.PropertyGroupElement, string.Empty); - } - - ErrorUtilities.VerifyThrow(false, "BuildPropertyGroup is imported, doesn't have an ownerDocument, and importedFilename is null."); - return string.Empty; - } - - set - { - ErrorUtilities.VerifyThrow(this.importedFromAnotherProject, "You can't set the imported filename on a non-imported PropertyGroup."); - this.importedFromFilename = value; - } - } - #endregion - - #region Operators - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// This is the indexer for the BuildPropertyGroup class, which allows the caller to set or get the property data using simple - /// array indexer [] notation. The caller passes in the property name inside the [], and out comes the BuildProperty object, - /// which can be typecast to a string in order to get just the property value. Or if it's used on the left of the "=" - /// sign, the same notation can set a new BuildProperty object, overwriting. - /// Getting a value requires the property group be virtual. - /// - /// RGoel - /// - /// The property with the given name, or null if it does not exist in this group - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public BuildProperty this[string propertyName] - { - get - { - // We don't support this method for PropertyGroups that are persisted. - // This is because persisted PropertyGroups can contain multiple - // properties with the same name, so you can't index by name. - MustBeVirtual("CannotAccessPropertyByName"); - - // Do the lookup in the hash table using the hash table's - // indexer method. Get back the property data object, - // which will be "null" if the property hasn't been set. Note - // that we key off property names in a case-insensitive fashion. - return (BuildProperty)propertyTableByName[propertyName]; - } - - set - { - error.VerifyThrowArgument(value != null, "CannotSetPropertyToNull"); - - // Make sure that the property name passed into the indexer matches - // the property name on the BuildProperty object. - error.VerifyThrowArgument(String.Equals(propertyName, value.Name, StringComparison.OrdinalIgnoreCase), - "PropertyNamesDoNotMatch", "BuildProperty"); - - this.SetProperty(value); - } - } - - #endregion - - #region Methods - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// This IEnumerable method returns an IEnumerator object, which allows - /// the caller to enumerate through the BuildProperty objects contained in - /// this BuildPropertyGroup. - /// - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// RGoel - public IEnumerator GetEnumerator - ( - ) - { - // If this is a persisted , return the enumerator on the ArrayList. - if (this.propertyList != null) - { - error.VerifyThrow(this.propertyTableByName == null, "Did not expect a property hash table."); - - return this.propertyList.GetEnumerator(); - } - - // If this is a virtual BuildPropertyGroup, return the enumerator on the HashTable. - if (this.propertyTableByName != null) - { - // Unfortunately, hash tables return a bunch DictionaryEntry's, and the - // real BuildProperty object is stored in DictionaryEntry.Value. In order to - // make life a little easier for the caller, we give him an enumerator over just the values. - return this.propertyTableByName.Values.GetEnumerator(); - } - - // If this is neither, we have an internal failure. - error.VerifyThrow(false, "Expected either a hash table or an array list of properties."); - - return null; - } - - /// - /// Does a shallow clone, creating a new group with pointers to the same properties as the old group. - /// - internal BuildPropertyGroup ShallowClone() - { - return Clone(false /* shallow */); - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// This method creates a copy of the BuildPropertyGroup. A shallow clone will reference the same BuildProperty objects as the - /// original. A deep clone will deep clone the BuildProperty objects themselves. If this is a persisted BuildPropertyGroup, only - /// deep clones are allowed, because you can't have the same XML element belonging to two parents. - /// - /// RGoel - /// - /// The cloned BuildPropertyGroup. - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public BuildPropertyGroup Clone - ( - bool deepClone - ) - { - BuildPropertyGroup clone; - - if (IsVirtual) - { - // This is a virtual BuildPropertyGroup. - MustBeVirtual("NeedVirtualPropertyGroup"); - - if (deepClone) - { - // Loop through every BuildProperty in our collection, and add those same properties - // to the cloned collection. - - // Create a new virtual BuildPropertyGroup. - // Do not set the ParentProject on the new BuildPropertyGroup, because it isn't really - // part of the project - clone = new BuildPropertyGroup(null, propertyTableByName.Count); - - foreach (DictionaryEntry propertyEntry in this.propertyTableByName) - { - // If the caller requested a deep clone, then deep clone the BuildProperty object, - // and add the new BuildProperty to the new BuildPropertyGroup. - clone.propertyTableByName.Add(propertyEntry.Key, ((BuildProperty)propertyEntry.Value).Clone(true /* deep clone */)); - } - - // also clone over any overridden non-output properties - if (this.propertiesOverriddenByOutputProperties != null) - { - clone.propertiesOverriddenByOutputProperties = new CopyOnWriteHashtable(propertiesOverriddenByOutputProperties.Count, StringComparer.OrdinalIgnoreCase); - - foreach (DictionaryEntry propertyEntry in this.propertiesOverriddenByOutputProperties) - { - if (propertyEntry.Value != null) - { - clone.propertiesOverriddenByOutputProperties.Add(propertyEntry.Key, ((BuildProperty)propertyEntry.Value).Clone(true /* deep clone */)); - } - else - { - clone.propertiesOverriddenByOutputProperties.Add(propertyEntry.Key, null); - } - } - } - } - else - { - // shallow cloning is easy, we only clone the Hashtables - clone = new BuildPropertyGroup(); - clone.propertyTableByName = (CopyOnWriteHashtable)this.propertyTableByName.Clone(); - - if (this.propertiesOverriddenByOutputProperties != null) - { - clone.propertiesOverriddenByOutputProperties = (CopyOnWriteHashtable)this.propertiesOverriddenByOutputProperties.Clone(); - } - } - } - else - { - // This is a persisted . - MustBePersisted("NeedPersistedPropertyGroup", XMakeElements.propertyGroup); - - // Only deep clones are permitted when dealing with a persisted . - // This is because a shallow clone would attempt to add the same property - // elements to two different parent elements, and this is - // not allowed. - error.VerifyThrowInvalidOperation(deepClone, "ShallowCloneNotAllowed"); - - // Create a new persisted . It won't actually get added - // to any XmlDocument, but it will be associated with the same XmlDocument - // as the current BuildPropertyGroup. - clone = new BuildPropertyGroup - ( - null, /* Do not set the ParentProject on the cloned BuildPropertyGroup, because it isn't really - part of the project */ - ownerDocument, - this.importedFromAnotherProject - ); - - // Loop through every BuildProperty in our collection, and add those same properties - // to the cloned collection. - foreach (BuildProperty property in this) - { - // If the caller requested a deep clone, then deep clone the BuildProperty object, - // and add the new BuildProperty to the new BuildPropertyGroup. Otherwise, just add - // a reference to the existing BuildProperty object to the new BuildPropertyGroup. - clone.AddProperty(property.Clone(true)); - } - - clone.Condition = this.Condition; - } - - // Return the cloned collection to the caller. - return clone; - } - - /// - /// ImportInitialProperties is used when setting up an evaluated BuildProperty - /// Group with the initial set of properties from MSBuild reserved properties, - /// environment variables, tools version dependent properties, and global - /// properties. After this virtual BuildPropertyGroup has been populated with - /// these, we can continue to read in the properties from the project file. - /// - /// - /// - /// - /// - /// RGoel - internal void ImportInitialProperties - ( - BuildPropertyGroup environmentProperties, - BuildPropertyGroup reservedProperties, - BuildPropertyGroup toolsVersionDependentProperties, - BuildPropertyGroup globalProperties - ) - { - // The consumer of the OM has the ability to add new properties to the - // GlobalProperties BuildPropertyGroup, and the OM doesn't expose the - // property type, because that would be too dangerous. So all properties - // created by the OM consumer will be "normal" properties, even those - // set in the GlobalProperties BuildPropertyGroup. But in order to make - // property precedence work correctly, we should now go through and - // make sure that all the global properties really are of type "global". - // However, we don't want to modify the original global property group, - // so we clone it here. - BuildPropertyGroup clonedGlobalProperties = globalProperties.Clone(true); - - foreach (BuildProperty globalProperty in clonedGlobalProperties) - { - globalProperty.Type = PropertyType.GlobalProperty; - } - - // Import the environment variables into this virtual BuildPropertyGroup. - this.ImportProperties(environmentProperties); - - // Import the XMake reserved properties into this virtual BuildPropertyGroup. - this.ImportProperties(reservedProperties); - - // Import the tools version dependent properties into this virtual BuildPropertyGroup. - this.ImportProperties(toolsVersionDependentProperties); - - // Import the global properties into this virtual BuildPropertyGroup. - this.ImportProperties(clonedGlobalProperties); - } - - /// - /// Sets a property. - /// - /// Either overrides the value of the property with the given name, or adds it if it - /// doesn't already exist. Setting to the same value as before does nothing. - /// - /// This method will take into account property precedence rules, so that for - /// example, a reserved MSBuild property cannot be overridden by a normal property. - /// - /// PropertyGroup must be virtual. - /// - /// - internal void SetProperty - ( - BuildProperty newProperty - ) - { - // We don't support this method for PropertyGroups that are - // represented by an actual element. This is because - // persisted PropertyGroups can contain multiple properties with the same - // name, so the behavior of SetProperty becomes ambiguous. - MustBeVirtual("NeedVirtualPropertyGroup"); - - // If a property with this name already exists in our collection, then we have - // to override it, taking into account the precedence rules for properties. - BuildProperty existingProperty = (BuildProperty)propertyTableByName[newProperty.Name]; - - bool isEquivalentToExistingProperty = false; - - if (existingProperty != null) - { - // If the existing property is an XMake reserved property, we may have an - // invalid project file, because reserved properties are not allowed to - // be set. - // Don't fail if the new property is itself a "reserved" property. We - // want to be able to override reserved properties with new reserved - // properties, otherwise the engine itself would never be allowed to - // change the value of a reserved property. - ProjectErrorUtilities.VerifyThrowInvalidProject( - (existingProperty.Type != PropertyType.ReservedProperty) || - (newProperty.Type == PropertyType.ReservedProperty), - newProperty.PropertyElement, "CannotModifyReservedProperty", newProperty.Name); - - // Also make sure it's not a read-only property (such as a property - // that was set at the XMake command-line), but don't actually throw - // an error in this case. Only output properties from tasks are allowed - // to override read-only properties - if ((existingProperty.Type == PropertyType.GlobalProperty) && - (newProperty.Type != PropertyType.OutputProperty)) - { - return; - } - - isEquivalentToExistingProperty = newProperty.IsEquivalent(existingProperty); - - if (!isEquivalentToExistingProperty) - { - // Allow properties to be "set" to the same value during a build. This is because Visual Studio unfortunately does this often, - // and it is safe to do this, because we won't actually change any state. - ErrorUtilities.VerifyThrowInvalidOperation(parentProject?.IsBuilding != true, "CannotSetPropertyDuringBuild"); - } - } - - // Keep track of all output properties, so we can remove them later. - if (newProperty.Type == PropertyType.OutputProperty) - { - if (propertiesOverriddenByOutputProperties == null) - { - propertiesOverriddenByOutputProperties = new CopyOnWriteHashtable(StringComparer.OrdinalIgnoreCase); - } - - if (propertiesOverriddenByOutputProperties.Contains(newProperty.Name)) - { - error.VerifyThrow(existingProperty != null, "If we've overridden this property before, it must exist in the main property table."); - error.VerifyThrow(existingProperty.Type == PropertyType.OutputProperty, "If we've overriden this property before, it must be stored as an output property in the main property table."); - } - else - { - error.VerifyThrow((existingProperty == null) || (existingProperty.Type != PropertyType.OutputProperty), - "If the property already exists in the main property table, it can't already be there as an output property, because then we would have stored an entry in propertiesOverriddenByOutputProperties."); - - // NOTE: Use Hashtable.Add() because each output property should only be added to this - // table once. If we ever try to add the same output property to this table twice, - // it's a bug in our code. - // "existingProperty" may be null, and that's okay. - propertiesOverriddenByOutputProperties.Add(newProperty.Name, existingProperty); - } - } - - // Okay, now actually set our property, but only if the value has actually changed. - if (!isEquivalentToExistingProperty) - { - this.propertyTableByName[newProperty.Name] = newProperty; - this.MarkPropertyGroupAsDirty(); - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Sets a property taking the property name and value as strings directly. - /// - /// Either overrides the value of the property with the given name, or adds it if it - /// doesn't already exist. Setting to the same value as before does nothing. - /// - /// This method will take into account property precedence rules, so that for - /// example, a reserved MSBuild property cannot be overridden by a normal property. - /// - /// PropertyGroup must be virtual. - /// - /// - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public void SetProperty(string propertyName, string propertyValue) - { - this.SetProperty(new BuildProperty(propertyName, propertyValue)); - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Sets a property in this PropertyGroup, optionally escaping the property value so - /// that it will be treated as a literal. - /// - /// - /// - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// RGoel - public void SetProperty - ( - string propertyName, - string propertyValue, - bool treatPropertyValueAsLiteral - ) - { - this.SetProperty(propertyName, - treatPropertyValueAsLiteral ? EscapingUtilities.Escape(propertyValue) : propertyValue); - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// The AddNewProperty method adds a new property element to the persisted - /// <PropertyGroup> at the end. This method takes the property name and - /// value as strings directly, so that the BuildProperty object can be created - /// with the correct owner XML document and parent XML element. - /// - /// - /// - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// RGoel - public BuildProperty AddNewProperty - ( - string propertyName, - string propertyValue - ) - { - MustBePersisted("NeedPersistedPropertyGroup", XMakeElements.propertyGroup); - - error.VerifyThrowInvalidOperation(!this.importedFromAnotherProject, - "CannotModifyImportedProjects"); - - BuildProperty newProperty = new BuildProperty(this.ownerDocument, propertyName, propertyValue, PropertyType.NormalProperty); - - this.AddProperty(newProperty); - - return newProperty; - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Adds a new property to the PropertyGroup, optionally escaping the property value so - /// that it will be treated as a literal. - /// - /// - /// - /// - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// RGoel - public BuildProperty AddNewProperty - ( - string propertyName, - string propertyValue, - bool treatPropertyValueAsLiteral - ) - { - return this.AddNewProperty(propertyName, - treatPropertyValueAsLiteral ? EscapingUtilities.Escape(propertyValue) : propertyValue); - } - - /// - /// The AddNewImportedProperty method adds a new imported propert element. - /// This method takes the property name and value as strings directly. The - /// Project representing the imported Project is passed in so parent document - /// can be retrieved. - /// - /// DavidLe - /// - /// - /// - /// The new BuildPropertyGroup. - internal BuildProperty AddNewImportedProperty - ( - string propertyName, - string propertyValue, - Project importedProject - ) - { - MustBePersisted("NeedPersistedPropertyGroup", XMakeElements.propertyGroup); - XmlDocument parentDocument = importedProject.XmlDocument; - - BuildProperty newProperty = new BuildProperty(parentDocument, propertyName, propertyValue, PropertyType.ImportedProperty); - - this.AddExistingProperty(newProperty); - - return newProperty; - } - - /// - /// Adds an existing BuildProperty to the list of properties, does not attempt - /// to add backing Xml for the item. - /// - /// - /// JomoF - internal void AddExistingProperty - ( - BuildProperty propertyToAdd - ) - { - MustBePersisted("NeedPersistedPropertyGroup", XMakeElements.propertyGroup); - - // Add the item to our list. - propertyToAdd.ParentPersistedPropertyGroup = this; - this.propertyList.Add(propertyToAdd); - this.MarkPropertyGroupAsDirty(); - } - - /// - /// The AddProperty method adds an existing property element to the persisted - /// <PropertyGroup> at the end. This property element must be associated - /// with the same Xml document as the <PropertyGroup>. - /// - /// - /// RGoel - internal void AddProperty - ( - BuildProperty propertyToAdd - ) - { - MustBePersisted("NeedPersistedPropertyGroup", XMakeElements.propertyGroup); - - // We don't allow any modifications to the XML of any of the imported - // project files ... only the main project file. - error.VerifyThrowInvalidOperation(!this.importedFromAnotherProject, - "CannotModifyImportedProjects"); - - // Make sure the property to be added has an XML element backing it, - // and that its XML belongs to the same XML document as our BuildPropertyGroup. - error.VerifyThrow(propertyToAdd.PropertyElement != null, "BuildProperty does not have an XML element"); - error.VerifyThrow(propertyToAdd.PropertyElement.OwnerDocument == this.ownerDocument, - "Cannot add an BuildProperty with a different XML owner document."); - - // For persisted groups, just append the property at the end of the tag. - this.propertyGroupElement.AppendChild(propertyToAdd.PropertyElement); - - // Add the property to our list. - this.AddExistingProperty(propertyToAdd); - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Removes the given BuildProperty object from either a persisted or a virtual - /// BuildPropertyGroup. - /// - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// RGoel - public void RemoveProperty - ( - BuildProperty property - ) - { - error.VerifyThrowArgumentNull(property, nameof(property)); - - // If this is a persisted , then remove the property element from - // the XML and from the array list. - if (IsPersisted) - { - MustBePersisted("NeedPersistedPropertyGroup", XMakeElements.propertyGroup); - - // We don't allow any modifications to the XML of any of the imported - // project files ... only the main project file. - error.VerifyThrowInvalidOperation(!this.importedFromAnotherProject, - "CannotModifyImportedProjects"); - - // Find the property XML element. - XmlElement propertyElement = property.PropertyElement; - - MustBelongToPropertyGroup(propertyElement); - - // Get the parent node, and then delete this property from it. - propertyElement.ParentNode.RemoveChild(propertyElement); - - // Remove the property object from the array list. - this.propertyList.Remove(property); - property.ParentPersistedPropertyGroup = null; - } - else - { - RemoveProperty(property.Name); - } - - this.MarkPropertyGroupAsDirty(); - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Removes all properties with the given name from either a persisted or a virtual BuildPropertyGroup. For persisted - /// PropertyGroups, there could be multiple. For a virtual BuildPropertyGroup, there can be only one. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// RGoel - /// - public void RemoveProperty - ( - string propertyName - ) - { - // If this is a persisted , then remove all of the properties - // with the specified name. - if (IsPersisted) - { - MustBePersisted("NeedPersistedPropertyGroup", XMakeElements.propertyGroup); - - // For persisted 's, there could be multiple properties - // with the given name. We need to loop through our arraylist of properties, - // finding all the ones with the given property name, and delete them. But we - // shouldn't be modifying the arraylist while we're still enumerating through - // it. So, first we create a new list of all the properties we want to remove, - // and then we later go through and actually remove them. - ArrayList propertiesToRemove = new ArrayList(); - - // Search for all properties in the arraylist that have the given property - // name. - foreach (BuildProperty property in this) - { - if (String.Equals(property.Name, propertyName, StringComparison.OrdinalIgnoreCase)) - { - // Add the property to our list of things to remove. - propertiesToRemove.Add(property); - } - } - - // Go remove all the properties we found with the given name. - foreach (BuildProperty propertyToRemove in propertiesToRemove) - { - this.RemoveProperty(propertyToRemove); - } - } - else - { - MustBeVirtual("NeedVirtualPropertyGroup"); - - // We only need to remove the BuildProperty object with the given name from - // the Hashtable. There can be only one. - this.propertyTableByName.Remove(propertyName); - - // if the property was overridden by an output property, we also want to remove the original - propertiesOverriddenByOutputProperties?.Remove(propertyName); - } - - this.MarkPropertyGroupAsDirty(); - } - - /// - /// Make sure that this property group doesn't contain any reserved properties. - /// - internal void EnsureNoReservedProperties() - { - foreach (BuildProperty property in this.propertyList) - { - // Make sure this property doesn't override a reserved property - ProjectErrorUtilities.VerifyThrowInvalidProject(this.ParentProject.ReservedProperties[property.Name] == null, - property.PropertyElement, "CannotModifyReservedProperty", property.Name); - } - } - - /// - /// Removes all output properties, and restores the non-output properties that were overridden. - /// Requires property group to be virtual. - /// - internal void RevertAllOutputProperties() - { - MustBeVirtual("NeedVirtualPropertyGroup"); - - if (propertiesOverriddenByOutputProperties != null) - { - foreach (DictionaryEntry propertyEntry in propertiesOverriddenByOutputProperties) - { - propertyTableByName.Remove(propertyEntry.Key); - - if (propertyEntry.Value != null) - { - propertyTableByName.Add(propertyEntry.Key, propertyEntry.Value); - } - } - - propertiesOverriddenByOutputProperties = null; - } - - MarkPropertyGroupAsDirty(); - } - - /// - /// Imports all the properties from another BuildPropertyGroup into this one. - /// Any existing properties with the same name are overridden by the new properties. - /// Requires property group to be virtual. - /// - internal void ImportProperties - ( - BuildPropertyGroup sourceProperties - ) - { - MustBeVirtual("NeedVirtualPropertyGroup"); - - // Loop through all the properties in the source BuildPropertyGroup, and add them - // to this BuildPropertyGroup. - foreach (DictionaryEntry propertyEntry in sourceProperties.propertyTableByName) - { - // We want a SetProperty here, because we want to override any existing - // properties with the same name. - SetProperty((BuildProperty)propertyEntry.Value); - } - } - - /// - /// Helper for the Clear methods - /// - internal void ClearHelper(bool clearImportedPropertyGroup) - { - // If this group is backed by XML, clear all attributes and - // children out unless it's an imported group, in which case we don't want to modify the XML - if (IsPersisted && !clearImportedPropertyGroup) - { - MustBePersisted("NeedPersistedPropertyGroup", XMakeElements.propertyGroup); - - // We don't allow any modifications to the XML of any of the imported - // project files ... only the main project file. - error.VerifyThrowInvalidOperation(!this.importedFromAnotherProject || clearImportedPropertyGroup, - "CannotModifyImportedProjects"); - - // Remove all of the property elements from wherever they may be. - foreach (BuildProperty propertyToRemove in this.propertyList) - { - // Find the property XML element. - XmlElement propertyElement = propertyToRemove.PropertyElement; - - MustBelongToPropertyGroup(propertyElement); - - // Remove the property element. - propertyElement.ParentNode.RemoveChild(propertyElement); - - propertyToRemove.ParentPersistedPropertyGroup = null; - } - - MustBePersisted("NeedPersistedPropertyGroup", XMakeElements.propertyGroup); - } - - this.conditionAttribute = null; - - // Clear the contents of the hash table, if one exists. - this.propertyTableByName?.Clear(); - - // clear out saved properties - propertiesOverriddenByOutputProperties = null; - - // Clear the contents of the arraylist, if one exists. - this.propertyList?.Clear(); - - this.MarkPropertyGroupAsDirty(); - } - - /// - /// Removes all properties and conditions from this BuildPropertyGroup. - /// - /// RGoel - internal void ClearImportedPropertyGroup - ( - ) - { - ClearHelper(true /* allow imported */); - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Removes all properties and conditions from this BuildPropertyGroup. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// RGoel - public void Clear - ( - ) - { - ClearHelper(false /* disallow imported */); - } - - /// - /// Marks the parent project as dirty. - /// - /// RGoel - internal void MarkPropertyGroupAsDirty - ( - ) - { - if (this.ParentProject != null) - { - if (this.IsPersisted && !this.IsImported) - { - // This is a change to the contents of the main project file. - this.ParentProject.MarkProjectAsDirty(); - } - else - { - // This is not a change to the contents of the project file, however - // this change does require a re-evaluation of the project. For - // example, if a global property changes.... - this.ParentProject.MarkProjectAsDirtyForReevaluation(); - } - } - } - - /// - /// This method grabs all the environment variables and sets them as - /// properties. This method can be invoked multiple times if there is - /// reason to believe the environment has changed. It will update all - /// the previously gathered variables, and set new ones. This method - /// will not, however, unset previously set variables. - /// Requires property group to be virtual. - /// - /// NOTE: this method does not allow environment variables to override - /// previously set properties of type "GlobalProperty" or "ReservedProperty" - /// - internal void GatherEnvironmentVariables() - { - MustBeVirtual("NeedVirtualPropertyGroup"); - - SetExtensionsPathProperties(); - - IDictionary environmentVariablesBag = Environment.GetEnvironmentVariables(); - if (environmentVariablesBag != null) - { - foreach (DictionaryEntry environmentVariable in environmentVariablesBag) - { - // We're going to just skip environment variables that contain names - // with characters we can't handle. There's no logger registered yet - // when this method is called, so we can't really log anything. - string environmentVariableName = environmentVariable.Key.ToString(); - - if (XmlUtilities.IsValidElementName(environmentVariableName)) - { - this.SetProperty(new BuildProperty(environmentVariableName, - environmentVariable.Value.ToString(), PropertyType.EnvironmentProperty)); - } - else - { - // The name was invalid, so we just didn't add the environment variable. - // That's fine, continue for the next one. - } - } - } - } - - /// - /// Set the special "MSBuildExtensionsPath" and "MSBuildExtensionsPath32" properties. - /// - private void SetExtensionsPathProperties() - { - // We set the MSBuildExtensionsPath variables here because we don't want to make them official - // reserved properties; we need the ability for people to override our default in their - // environment or as a global property. - - // "MSBuildExtensionsPath32". This points to whatever the value of "Program Files (x86)" environment variable is; - // but on a 32 bit box this isn't set, and we should use "Program Files" instead. - string programFiles = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles); - - // Similarly for "MSBuildExtensionsPath32". This points to whatever the value of "Program Files (x86)" environment variable is; - // but on a 32 bit box this isn't set, and we should use "Program Files" instead. - string programFiles32 = Environment.GetEnvironmentVariable(Constants.programFilesx86); - if (String.IsNullOrEmpty(programFiles32)) - { - // 32 bit box - programFiles32 = programFiles; - } - - string extensionsPath32 = Path.Combine(programFiles32, ReservedPropertyNames.extensionsPathSuffix); - SetProperty(new BuildProperty(ReservedPropertyNames.extensionsPath32, extensionsPath32, PropertyType.EnvironmentProperty)); - - // MSBuildExtensionsPath: The way this used to work is that it would point to "Program Files\MSBuild" on both - // 32-bit and 64-bit machines. We have a switch to continue using that behavior; however the default is now for - // MSBuildExtensionsPath to always point to the same location as MSBuildExtensionsPath32. - - bool useLegacyMSBuildExtensionsPathBehavior = !String.IsNullOrEmpty(Environment.GetEnvironmentVariable("MSBUILDLEGACYEXTENSIONSPATH")); - - string extensionsPath; - if (useLegacyMSBuildExtensionsPathBehavior) - { - extensionsPath = Path.Combine(programFiles, ReservedPropertyNames.extensionsPathSuffix); - } - else - { - extensionsPath = extensionsPath32; - } - - SetProperty(new BuildProperty(ReservedPropertyNames.extensionsPath, extensionsPath, PropertyType.EnvironmentProperty)); - } - - /// - /// This method does a comparison of the actual contents of two property bags - /// and returns True if they are equal, else False. Equality means that - /// the two collections contain the same set of property names (case insensitive) - /// with the same values (case sensitive). - /// Requires property group to be virtual. - /// - /// - /// RGoel - /// true if the two property bags are equivalent, and false otherwise. - internal bool IsEquivalent - ( - BuildPropertyGroup compareToPropertyGroup - ) - { - ErrorUtilities.VerifyThrow(compareToPropertyGroup != null, "Received a null propertyBag!"); - - // IsEquivalent is only supported for virtual PropertyGroups. - this.MustBeVirtual("NeedVirtualPropertyGroup"); - compareToPropertyGroup.MustBeVirtual("NeedVirtualPropertyGroup"); - - // Reference equality is easy - if (this == compareToPropertyGroup) - { - return true; - } - - // First check if the sizes of the two bags match. If they don't, - // we don't need to do anything further. - bool isEqual = true; - if (this.Count == compareToPropertyGroup.Count) - { - // If both bags do have the same number of elements, it should - // be sufficient to check if one bag contains all of the - // elements in the other. - foreach (DictionaryEntry entry in this.propertyTableByName) - { - BuildProperty leftProperty = (BuildProperty)entry.Value; - - ErrorUtilities.VerifyThrow(leftProperty != null, "How can we have a null entry in the hash table?"); - - BuildProperty rightProperty = compareToPropertyGroup[(string)entry.Key]; - - if (!leftProperty.IsEquivalent(rightProperty)) - { - isEqual = false; - break; - } - } - } - else - { - // Sizes are unequal - isEqual = false; - } - - return isEqual; - } - - /// - /// Returns a boolean that indicates whether this is a virtual property - /// group. - /// - private bool IsVirtual - { - get { return !IsPersisted; } - } - - /// - /// Call this method to verify that this property group is a well-formed - /// virtual property group. - /// Requires property group to be virtual. - /// PERF WARNING: this method is called a lot because virtual PropertyGroups - /// are used extensively -- keep this method fast and cheap - /// - /// - /// JomoF - private void MustBeVirtual - ( - string errorResourceName - ) - { - error.VerifyThrowInvalidOperation(IsVirtual, errorResourceName, XMakeElements.propertyGroup); - - // If this is a virtual BuildPropertyGroup (not a element), then - // we should not have an ArrayList of BuildProperty objects ... we should only have - // the hash table. - error.VerifyThrow(this.propertyList == null, - "ArrayList of BuildProperty objects not expected for a virtual BuildPropertyGroup."); - - error.VerifyThrow(this.propertyTableByName != null, - "HashTable of BuildProperty objects expected for a virtual BuildPropertyGroup."); - } - - /// - /// Returns whether this is a persisted group. - /// - /// - private bool IsPersisted - { - get { return this.propertyGroupElement != null; } - } - - /// - /// Verifies group is persisted. - /// - /// - /// - /// JomoF - private void MustBePersisted - ( - string errorResourceName, - string arg - ) - { - error.VerifyThrowInvalidOperation(IsPersisted, errorResourceName, arg); - - // If this is a persisted element, then we should have an - // ArrayList of BuildProperty objects, but not a hash table. - error.VerifyThrow(this.propertyList != null, - "ArrayList of BuildProperty objects expected for this BuildPropertyGroup."); - error.VerifyThrow(this.propertyTableByName == null, - "HashTable of BuildProperty objects not expected for this BuildPropertyGroup."); - error.VerifyThrow(this.ownerDocument != null, - "There must be an owner document. It should have been set in the constructor."); - } - - /// - /// Verifies the XmlElement is a child node of the propertyGroupElement backing this BuildPropertyGroup. - /// - /// - private void MustBelongToPropertyGroup - ( - XmlElement propertyElement - ) - { - error.VerifyThrowInvalidOperation(propertyElement != null, - "PropertyDoesNotBelongToPropertyGroup"); - error.VerifyThrowInvalidOperation(propertyElement.ParentNode == this.propertyGroupElement, - "PropertyDoesNotBelongToPropertyGroup"); - } - - /// - /// Evaluates condition on property group, and if true, evaluates - /// on each contained property. If that's true as well, adds property - /// to evaluatedPropertyBag. - /// - /// DavidLe - /// - /// - /// - internal void Evaluate - ( - BuildPropertyGroup evaluatedPropertyBag, - Hashtable conditionedPropertiesTable, - ProcessingPass pass - ) - { - ErrorUtilities.VerifyThrow(pass == ProcessingPass.Pass1, "Pass should be Pass1 for PropertyGroups."); - - Expander expander = new Expander(evaluatedPropertyBag); - - if (!Utilities.EvaluateCondition(this.Condition, this.ConditionAttribute, - expander, conditionedPropertiesTable, ParserOptions.AllowProperties, - ParentProject.ParentEngine.LoggingServices, ParentProject.ProjectBuildEventContext)) - { - return; - } - - // Add all the properties to our project-level property bag. - foreach (BuildProperty currentProperty in this.propertyList) - { - if (!Utilities.EvaluateCondition(currentProperty.Condition, currentProperty.ConditionAttribute, - expander, conditionedPropertiesTable, ParserOptions.AllowProperties, - ParentProject.ParentEngine.LoggingServices, parentProject.ProjectBuildEventContext)) - { - continue; - } - - BuildProperty newProperty = currentProperty.Clone(false); - newProperty.Evaluate(expander); - evaluatedPropertyBag.SetProperty(newProperty); - } - } - #endregion - } -} diff --git a/src/Deprecated/Engine/Properties/BuildPropertyGroupCollection.cs b/src/Deprecated/Engine/Properties/BuildPropertyGroupCollection.cs deleted file mode 100644 index 8a02719ea94..00000000000 --- a/src/Deprecated/Engine/Properties/BuildPropertyGroupCollection.cs +++ /dev/null @@ -1,308 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// This class represents a collection of persisted <PropertyGroup>'s. Each - /// MSBuild project has exactly one BuildPropertyGroupCollection, which includes - /// all the imported PropertyGroups as well as the ones in the main project file. - /// - /// The implementation of this class is that it's basically a Facade. It just - /// calls into the GroupingCollection within the Project to do it's work. It - /// doesn't maintain any BuildPropertyGroup state on its own. - /// - /// - /// [!WARNING] - /// > This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// DavidLe - public class BuildPropertyGroupCollection : ICollection, IEnumerable - { - #region Member Data - - private GroupingCollection groupingCollection = null; - - #endregion - - #region Constructors - - /// - /// Private default constructor. This object can't be instantiated by - /// OM consumers. - /// - /// DavidLe, RGoel - private BuildPropertyGroupCollection - ( - ) - { - } - - /// - /// Constructor. - /// - /// - /// rgoel - internal BuildPropertyGroupCollection - ( - GroupingCollection groupingCollection - ) - { - this.groupingCollection = groupingCollection; - } - - #endregion - - #region Properties - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Read-only property which returns the number of PropertyGroups contained - /// in our collection. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// RGoel - public int Count - { - get - { - return this.groupingCollection.PropertyGroupCount; - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// This ICollection property tells whether this object is thread-safe. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// RGoel - public bool IsSynchronized - { - get - { - return this.groupingCollection.IsSynchronized; - } - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// This ICollection property returns the object to be used to synchronize - /// access to the class. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// RGoel - public object SyncRoot - { - get - { - return this.groupingCollection.SyncRoot; - } - } - - /// - /// This looks through all the local property groups (those in the main - /// project file, as opposed to any imported project files). It returns - /// the last one that comes before any imported property groups. This - /// is the heuristic we use to determine where to add new property groups - /// into the project file. - /// - /// RGoel - internal BuildPropertyGroup LastLocalPropertyGroup - { - get - { - BuildPropertyGroup lastLocalPropertyGroup = null; - foreach (BuildPropertyGroup propertyGroup in this.groupingCollection.PropertyGroupsTopLevel) - { - if (propertyGroup.IsImported) - { - // As soon as we hit an imported BuildPropertyGroup, we want to - // completely bail out. The goal of this function is - // to return the last BuildPropertyGroup that is *before* any - // imported PropertyGroups. - break; - } - else - { - lastLocalPropertyGroup = propertyGroup; - } - } - - return lastLocalPropertyGroup; - } - } - - #endregion - - #region Methods - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// This ICollection method copies the contents of this collection to an - /// array. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// RGoel - public void CopyTo - ( - Array array, - int index - ) - { - this.groupingCollection.PropertyCopyTo(array, index); - } - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// This IEnumerable method returns an IEnumerator object, which allows - /// the caller to enumerate through the BuildPropertyGroup objects contained in - /// this BuildPropertyGroupCollection. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// RGoel - public IEnumerator GetEnumerator - ( - ) - { - return this.groupingCollection.GetPropertyEnumerator(); - } - - /// - /// Adds a new BuildPropertyGroup as the first element of our collection. - /// This method does nothing to manipulate the project's XML content. - /// - /// RGoel - internal void InsertAtBeginning - ( - BuildPropertyGroup newPropertyGroup - ) - { - this.groupingCollection.InsertAtBeginning(newPropertyGroup); - } - - /// - /// Adds a new BuildPropertyGroup to our collection, at the specified insertion - /// point. This method does nothing to manipulate the project's XML content. - /// - /// RGoel - internal void InsertAfter - ( - BuildPropertyGroup newPropertyGroup, - BuildPropertyGroup insertionPoint - ) - { - this.groupingCollection.InsertAfter(newPropertyGroup, insertionPoint); - } - - /// - /// Adds a new BuildPropertyGroup as the last element of our collection. - /// This method does nothing to manipulate the project's XML content. - /// - /// RGoel - internal void InsertAtEnd - ( - BuildPropertyGroup newPropertyGroup - ) - { - this.groupingCollection.InsertAtEnd(newPropertyGroup); - } - - /// - /// Removes a BuildPropertyGroup from our collection. This method does nothing - /// to manipulate the project's XML content. - /// - /// RGoel - internal void RemovePropertyGroup - ( - BuildPropertyGroup propertyGroup - ) - { - this.groupingCollection.RemovePropertyGroup(propertyGroup); - } - - #endregion - } -} diff --git a/src/Deprecated/Engine/Properties/BuildPropertyGroupProxy.cs b/src/Deprecated/Engine/Properties/BuildPropertyGroupProxy.cs deleted file mode 100644 index 41fb6995ac2..00000000000 --- a/src/Deprecated/Engine/Properties/BuildPropertyGroupProxy.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System.Collections; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// An enumerable wrapper for a BuildPropertyGroup that allows read-only - /// access to the properties. - /// - /// - /// This class is designed to be passed to loggers. - /// The expense of copying properties is only incurred if and when - /// a logger chooses to enumerate over it. - /// - /// danmose - internal class BuildPropertyGroupProxy : IEnumerable - { - // Property group that this proxies - private BuildPropertyGroup backingPropertyGroup; - - private BuildPropertyGroupProxy() - { - // Do nothing - } - - /// - /// Constructor - /// - /// Property group this class should proxy - public BuildPropertyGroupProxy(BuildPropertyGroup propertyGroup) - { - this.backingPropertyGroup = propertyGroup; - } - - /// - /// Returns an enumerator that provides copies of the property name-value pairs - /// in the backing property group. - /// - /// - public IEnumerator GetEnumerator() - { - foreach (BuildProperty prop in backingPropertyGroup) - { - // No need to clone the property; just return copies of the name and value - yield return new DictionaryEntry(prop.Name, prop.FinalValue); - } - } - } -} diff --git a/src/Deprecated/Engine/README.md b/src/Deprecated/Engine/README.md deleted file mode 100644 index 50dbb26a4cf..00000000000 --- a/src/Deprecated/Engine/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Microsoft.Build.Engine - -⚠️ This package is **deprecated** and should not be referenced. It will be removed in a future version of MSBuild. - -Contains `Microsoft.Build.Engine.dll`, which is provided with MSBuild for compatibility purposes. diff --git a/src/Deprecated/Engine/Resources/AssemblyResources.cs b/src/Deprecated/Engine/Resources/AssemblyResources.cs deleted file mode 100644 index 31da122b840..00000000000 --- a/src/Deprecated/Engine/Resources/AssemblyResources.cs +++ /dev/null @@ -1,114 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System.Resources; -using System.Reflection; -using System.Globalization; - -namespace Microsoft.Build.BuildEngine.Shared -{ - /// - /// This class provides access to the assembly's resources. - /// - /// SumedhK - internal static class AssemblyResources - { - /// - /// A slot for msbuild.exe to add a resource manager over its own resources, that can also be consulted. - /// - private static ResourceManager msbuildExeResourceManager; - - /// - /// The internals of the Engine are exposed to MSBuild.exe, so they must share the same AssemblyResources class and - /// ResourceUtilities class that uses it. To make this possible, MSBuild.exe registers its resources here and they are - /// normally consulted last. This assumes that there are no duplicated resource ID's between the Engine and MSBuild.exe. - /// (Actually there are currently two: LoggerCreationError and LoggerNotFoundError. - /// We can't change the resource ID's this late in the cycle (UNDONE) and we sometimes want to load the MSBuild.exe ones, - /// because they're a little different. So for that purpose we call GetStringLookingInMSBuildExeResourcesFirst() ) - /// - internal static void RegisterMSBuildExeResources(ResourceManager manager) - { - ErrorUtilities.VerifyThrow(msbuildExeResourceManager == null, "Only one extra resource manager"); - - msbuildExeResourceManager = manager; - } - - /// - /// Loads the specified resource string, either from the assembly's primary resources, or its shared resources. - /// - /// This method is thread-safe. - /// SumedhK - /// - /// The resource string, or null if not found. - internal static string GetString(string name) - { - // NOTE: the ResourceManager.GetString() method is thread-safe - string resource = GetStringFromEngineResources(name); - - if (resource == null) - { - resource = GetStringFromMSBuildExeResources(name); - } - - return resource; - } - - /// - /// Loads the specified resource string. - /// - /// The resource string, or null if not found. - internal static string GetStringLookingInMSBuildExeResourcesFirst(string name) - { - string resource = GetStringFromMSBuildExeResources(name); - - if (resource == null) - { - resource = GetStringFromEngineResources(name); - } - - return resource; - } - - /// - /// Loads the specified resource string, from the Engine or else Shared resources. - /// - /// The resource string, or null if not found. - private static string GetStringFromEngineResources(string name) - { - string resource = resources.GetString(name, CultureInfo.CurrentUICulture); - - if (resource == null) - { - resource = sharedResources.GetString(name, CultureInfo.CurrentUICulture); - } - - return resource; - } - - /// - /// Loads the specified resource string, from the MSBuild.exe resources. - /// - /// The resource string, or null if not found. - private static string GetStringFromMSBuildExeResources(string name) - { - string resource = null; - - if (msbuildExeResourceManager != null) - { - // Try MSBuild.exe's resources - resource = msbuildExeResourceManager.GetString(name, CultureInfo.CurrentUICulture); - } - - return resource; - } - - // assembly resources - private static readonly ResourceManager resources = new ResourceManager("Microsoft.Build.Engine.Strings", Assembly.GetExecutingAssembly()); - // shared resources - private static readonly ResourceManager sharedResources = new ResourceManager("Microsoft.Build.Engine.Strings.shared", Assembly.GetExecutingAssembly()); - } -} diff --git a/src/Deprecated/Engine/Resources/Constants.cs b/src/Deprecated/Engine/Resources/Constants.cs deleted file mode 100644 index 8078797df60..00000000000 --- a/src/Deprecated/Engine/Resources/Constants.cs +++ /dev/null @@ -1,226 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections.Generic; -using System.Collections.Concurrent; -using Microsoft.Build.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// Contains a list of the special (reserved) properties that are settable by MSBuild code only. - /// - /// RGoel - internal static class ReservedPropertyNames - { - internal const string projectDirectory = "MSBuildProjectDirectory"; - internal const string projectDirectoryNoRoot = "MSBuildProjectDirectoryNoRoot"; - internal const string projectFile = "MSBuildProjectFile"; - internal const string projectExtension = "MSBuildProjectExtension"; - internal const string projectFullPath = "MSBuildProjectFullPath"; - internal const string projectName = "MSBuildProjectName"; - internal const string binPath = "MSBuildBinPath"; - internal const string projectDefaultTargets = "MSBuildProjectDefaultTargets"; - internal const string extensionsPath = "MSBuildExtensionsPath"; - internal const string extensionsPath32 = "MSBuildExtensionsPath32"; - internal const string toolsPath = "MSBuildToolsPath"; - internal const string toolsVersion = "MSBuildToolsVersion"; - internal const string startupDirectory = "MSBuildStartupDirectory"; - internal const string buildNodeCount = "MSBuildNodeCount"; - internal const string extensionsPathSuffix = "MSBuild"; - internal const string programFiles32 = "MSBuildProgramFiles32"; - internal const string assemblyVersion = "MSBuildAssemblyVersion"; - - /// - /// Indicates if the given property is a reserved property. - /// - /// SumedhK - /// - /// true, if specified property is reserved - internal static bool IsReservedProperty(string property) - { - return - - (String.Equals(property, projectDirectory, StringComparison.OrdinalIgnoreCase)) || - (String.Equals(property, projectFile, StringComparison.OrdinalIgnoreCase)) || - (String.Equals(property, projectExtension, StringComparison.OrdinalIgnoreCase)) || - (String.Equals(property, projectFullPath, StringComparison.OrdinalIgnoreCase)) || - (String.Equals(property, projectName, StringComparison.OrdinalIgnoreCase)) || - (String.Equals(property, binPath, StringComparison.OrdinalIgnoreCase)) || - (String.Equals(property, toolsPath, StringComparison.OrdinalIgnoreCase)) || - (String.Equals(property, projectDefaultTargets, StringComparison.OrdinalIgnoreCase)) || - (String.Equals(property, programFiles32, StringComparison.OrdinalIgnoreCase)) || - (String.Equals(property, assemblyVersion, StringComparison.OrdinalIgnoreCase)) - // Intentionally do not include MSBuildExtensionsPath or MSBuildExtensionsPath32 in this list. We need tasks to be able to override those. - ; - } - } - - /// - /// Constants used by the Engine - /// - internal static class Constants - { - /// - /// If no default tools version is specified in the config file or registry, we'll use 2.0. - /// The engine will use its binpath for the matching toolset path. - /// - internal const string defaultToolsVersion = "2.0"; - - /// - /// The toolsversion we will fall back to as a last resort if the default one cannot be found, this fallback should be the most current toolsversion known - /// - internal const string defaultFallbackToolsVersion = "4.0"; - - - internal const string defaultSolutionWrapperProjectToolsVersion = "4.0"; - - /// - /// Current version of this MSBuild Engine assembly in the - /// form, e.g, "4.0" - /// - internal static string AssemblyVersion - { - get - { - return MSBuildConstants.CurrentToolsVersion; - } - } - - internal const string defaultTargetCacheName = "##DefaultTargets##"; - internal const string initialTargetCacheName = "##InitialTargets##"; - internal const string projectIdCacheName = "##ProjectId##"; - - // Name of the environment variable that always points to 32-bit program files. - internal const string programFilesx86 = "ProgramFiles(x86)"; - } - - /// - /// Function related constants. - /// - /// - /// Placed here to avoid StyleCop error. - /// - internal static class FunctionConstants - { - /// - /// Static methods that are allowed in constants. Key = Type or Type::Method, Value = AssemblyQualifiedTypeName (where null = mscorlib) - /// - private static ConcurrentDictionary> availableStaticMethods; - - /// - /// The set of available static methods. - /// NOTE: Do not allow methods here that could do "bad" things under any circumstances. - /// These must be completely benign operations, as they run during project load, which must be safe in VS. - /// Key = Type or Type::Method, Value = AssemblyQualifiedTypeName (where null = mscorlib) - /// - internal static IDictionary> AvailableStaticMethods - { - get - { - // Initialize lazily, as many projects might not - // even use functions - if (availableStaticMethods == null) - { - // Initialization is thread-safe - InitializeAvailableMethods(); - } - - return availableStaticMethods; - } - } - - /// - /// Re-initialize. - /// Unit tests need this when they enable "unsafe" methods -- which will then go in the collection, - /// and mess up subsequent tests. - /// - internal static void Reset_ForUnitTestsOnly() - { - InitializeAvailableMethods(); - } - - /// - /// Fill up the dictionary for first use - /// - private static void InitializeAvailableMethods() - { - availableStaticMethods = new ConcurrentDictionary>(StringComparer.OrdinalIgnoreCase); - - // Pre declare our common type Tuples - Tuple environmentType = new Tuple(null, typeof(System.Environment)); - Tuple directoryType = new Tuple(null, typeof(System.IO.Directory)); - Tuple fileType = new Tuple(null, typeof(System.IO.File)); - - // Make specific static methods available (Assembly qualified type names are *NOT* supported, only null which means mscorlib): - availableStaticMethods.TryAdd("System.Environment::CommandLine", environmentType); - availableStaticMethods.TryAdd("System.Environment::ExpandEnvironmentVariables", environmentType); - availableStaticMethods.TryAdd("System.Environment::GetEnvironmentVariable", environmentType); - availableStaticMethods.TryAdd("System.Environment::GetEnvironmentVariables", environmentType); - availableStaticMethods.TryAdd("System.Environment::GetFolderPath", environmentType); - availableStaticMethods.TryAdd("System.Environment::GetLogicalDrives", environmentType); - availableStaticMethods.TryAdd("System.Environment::Is64BitOperatingSystem", environmentType); - availableStaticMethods.TryAdd("System.Environment::Is64BitProcess", environmentType); - availableStaticMethods.TryAdd("System.Environment::MachineName", environmentType); - availableStaticMethods.TryAdd("System.Environment::OSVersion", environmentType); - availableStaticMethods.TryAdd("System.Environment::ProcessorCount", environmentType); - availableStaticMethods.TryAdd("System.Environment::StackTrace", environmentType); - availableStaticMethods.TryAdd("System.Environment::SystemDirectory", environmentType); - availableStaticMethods.TryAdd("System.Environment::SystemPageSize", environmentType); - availableStaticMethods.TryAdd("System.Environment::TickCount", environmentType); - availableStaticMethods.TryAdd("System.Environment::UserDomainName", environmentType); - availableStaticMethods.TryAdd("System.Environment::UserInteractive", environmentType); - availableStaticMethods.TryAdd("System.Environment::UserName", environmentType); - availableStaticMethods.TryAdd("System.Environment::Version", environmentType); - availableStaticMethods.TryAdd("System.Environment::WorkingSet", environmentType); - - availableStaticMethods.TryAdd("System.IO.Directory::GetDirectories", directoryType); - availableStaticMethods.TryAdd("System.IO.Directory::GetFiles", directoryType); - availableStaticMethods.TryAdd("System.IO.Directory::GetLastAccessTime", directoryType); - availableStaticMethods.TryAdd("System.IO.Directory::GetLastWriteTime", directoryType); - availableStaticMethods.TryAdd("System.IO.Directory::GetParent", directoryType); - availableStaticMethods.TryAdd("System.IO.File::Exists", fileType); - availableStaticMethods.TryAdd("System.IO.File::GetCreationTime", fileType); - availableStaticMethods.TryAdd("System.IO.File::GetAttributes", fileType); - availableStaticMethods.TryAdd("System.IO.File::GetLastAccessTime", fileType); - availableStaticMethods.TryAdd("System.IO.File::GetLastWriteTime", fileType); - availableStaticMethods.TryAdd("System.IO.File::ReadAllText", fileType); - - availableStaticMethods.TryAdd("System.Globalization.CultureInfo::GetCultureInfo", new Tuple(null, typeof(System.Globalization.CultureInfo))); // user request - availableStaticMethods.TryAdd("System.Globalization.CultureInfo::CurrentUICulture", new Tuple(null, typeof(System.Globalization.CultureInfo))); // user request - - // All static methods of the following are available (Assembly qualified type names are supported): - availableStaticMethods.TryAdd("MSBuild", new Tuple(null, typeof(Microsoft.Build.BuildEngine.IntrinsicFunctions))); - availableStaticMethods.TryAdd("System.Byte", new Tuple(null, typeof(System.Byte))); - availableStaticMethods.TryAdd("System.Char", new Tuple(null, typeof(System.Char))); - availableStaticMethods.TryAdd("System.Convert", new Tuple(null, typeof(System.Convert))); - availableStaticMethods.TryAdd("System.DateTime", new Tuple(null, typeof(System.DateTime))); - availableStaticMethods.TryAdd("System.Decimal", new Tuple(null, typeof(System.Decimal))); - availableStaticMethods.TryAdd("System.Double", new Tuple(null, typeof(System.Double))); - availableStaticMethods.TryAdd("System.Enum", new Tuple(null, typeof(System.Enum))); - availableStaticMethods.TryAdd("System.Guid", new Tuple(null, typeof(System.Guid))); - availableStaticMethods.TryAdd("System.Int16", new Tuple(null, typeof(System.Int16))); - availableStaticMethods.TryAdd("System.Int32", new Tuple(null, typeof(System.Int32))); - availableStaticMethods.TryAdd("System.Int64", new Tuple(null, typeof(System.Int64))); - availableStaticMethods.TryAdd("System.IO.Path", new Tuple(null, typeof(System.IO.Path))); - availableStaticMethods.TryAdd("System.Math", new Tuple(null, typeof(System.Math))); - availableStaticMethods.TryAdd("System.UInt16", new Tuple(null, typeof(System.UInt16))); - availableStaticMethods.TryAdd("System.UInt32", new Tuple(null, typeof(System.UInt32))); - availableStaticMethods.TryAdd("System.UInt64", new Tuple(null, typeof(System.UInt64))); - availableStaticMethods.TryAdd("System.SByte", new Tuple(null, typeof(System.SByte))); - availableStaticMethods.TryAdd("System.Single", new Tuple(null, typeof(System.Single))); - availableStaticMethods.TryAdd("System.String", new Tuple(null, typeof(System.String))); - availableStaticMethods.TryAdd("System.StringComparer", new Tuple(null, typeof(System.StringComparer))); - availableStaticMethods.TryAdd("System.TimeSpan", new Tuple(null, typeof(System.TimeSpan))); - availableStaticMethods.TryAdd("System.Text.RegularExpressions.Regex", new Tuple(null, typeof(System.Text.RegularExpressions.Regex))); - availableStaticMethods.TryAdd("System.UriBuilder", new Tuple(null, typeof(System.UriBuilder))); - availableStaticMethods.TryAdd("System.Version", new Tuple(null, typeof(System.Version))); - availableStaticMethods.TryAdd("Microsoft.Build.Utilities.ToolLocationHelper", new Tuple("Microsoft.Build.Utilities.ToolLocationHelper, Microsoft.Build.Utilities.Core, Version=" + MSBuildConstants.CurrentAssemblyVersion + ", Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", null)); - } - } -} diff --git a/src/Deprecated/Engine/Resources/Strings.resx b/src/Deprecated/Engine/Resources/Strings.resx deleted file mode 100644 index a3e9cc5d3ba..00000000000 --- a/src/Deprecated/Engine/Resources/Strings.resx +++ /dev/null @@ -1,1200 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - MSB4001: The "{0}" task has more than one parameter called "{1}". - {StrBegin="MSB4001: "}UE: This message is shown when a task has more than one .NET property with the same name -- it's unclear which of - those properties the task wants to use as a parameter in project files. - - - MSB4081: The value "{0}" of the "ItemName" attribute in element <Output> contains an "@" character. If you intended to use an item name then remove the @( ) around the item name. - {StrBegin="MSB4081: "}UE: This message is shown when an output tag has an itemname that contains an @. They probably typed @(foo) instead of foo in the ItemName.LOCALIZATION: Output and ItemName should not be localized. - - - MSB4002: There was a failure retrieving the attributes for parameters in the "{0}" task. {1} - {StrBegin="MSB4002: "}UE: This message is shown when the .NET attributes that a task's .NET properties are decorated with, cannot be - retrieved -- this is typically because the .NET classes that define the .NET attributes cannot be loaded because the assembly - they are defined in cannot be found, or the classes themselves cannot be found. - - - MSB4003: "{0}" is a reserved attribute of the <{1}> element, and must be spelled with the correct casing. This attribute cannot be used as a parameter to the "{2}" task. - {StrBegin="MSB4003: "}UE: Tasks are not allowed to use incorrect case for reserved attributes on the task nodes e.g. "continueonerror" - instead of the "ContinueOnError". - - - The "REQUESTBATCHSIZE" must be a number greater than 1. "{0}" is an invalid value. The value 10 will be used instead. - The name "REQUESTBATCHSIZE" is an environment variable - - - Build completed in {0}. - - - Build FAILED. - - - Build succeeded. - - - Build started. - - - Build started {0}. - - - Building target "{0}" completely. - {0} is the name of the target. - - - No input files were specified. - - - Input file "{0}" is newer than output file "{1}". - {0} and {1} are filenames on disk. - - - Output file "{0}" does not exist. - {0} is a filename on disk. - - - Input file "{0}" does not exist. - {0} is a filename on disk. - - - Building target "{0}" partially, because some output files are out of date with respect to their input files. - {0} is the name of the target. - - - [{0}: Input={1}, Output={2}] Input file is newer than output file. - {0} is the name of an MSBuild item. {1} and {2} are filenames on disk. - - - [{0}: Input={1}, Output={2}] Output file does not exist. - {0} is the name of an MSBuild item. {1} and {2} are filenames on disk. - - - [{0}: Input={1}, Output={2}] Input file does not exist. - {0} is the name of an MSBuild item. {1} and {2} are filenames on disk. - - - The attribute "{0}" is a known MSBuild attribute, and cannot be accessed using this method. - - - Properties in persisted property groups cannot be accessed by name. - - - MSB4023: Cannot evaluate the item metadata "%({0})". {1} - {StrBegin="MSB4023: "}UE: This message is shown when the value of an item metadata cannot be computed for some reason e.g. trying to apply - %(RootDir) to an item-spec that's not a valid path, would result in this error. - LOCALIZATION: "{1}" is a localized message explaining the problem. - - - Cannot execute a task not associated with a project object. - - - The cache entry has already been set to a different value and cannot be modified. - - - The "{0}" property comes from an environment variable, and cannot be modified. - - - The "{0}" property is a global property, and cannot be modified through an evaluated property group. Use "{1}" instead. - - - Modifying the XML of an imported project file is not allowed. Open that project file directly. - - - MSB4117: The "{0}" item name is reserved, and cannot be used. - {StrBegin="MSB4117: "}UE: This message is shown when the user tries to redefine one of the reserved MSBuild items e.g. @(Choose) - - - MSB4118: The "{0}" item metadata name is reserved, and cannot be used. - {StrBegin="MSB4118: "}UE: This message is shown when the user tries to redefine one of the reserved MSBuild items e.g. @(Choose) - - - MSB4004: The "{0}" property is reserved, and cannot be modified. - {StrBegin="MSB4004: "}UE: This message is shown when the user tries to redefine one of the reserved MSBuild properties e.g. $(MSBuildProjectFile) - - - MSB4094: "{0}" is an invalid value for the "{1}" parameter of the "{3}" task. Multiple items cannot be passed into a parameter of type "{2}". - {StrBegin="MSB4094: "} - UE: This error is shown when a project tries to pass multiple items into a task parameter of type ITaskItem (singular). - - - - MSB4115: The "{0}" function only accepts a scalar value, but its argument "{1}" evaluates to "{2}" which is not a scalar value. - {StrBegin="MSB4115: "} - UE: This error is shown when a project tries to pass multiple items into a function in a conditional expression, that can only accept a scalar value (such as the "exists()" function). - - - - The task is currently associated with a project object, and should not be added to a different one. - - - MSB4095: The item metadata %({0}) is being referenced without an item name. Specify the item name by using %(itemname.{0}). - {StrBegin="MSB4095: "} - - - The task is not associated with the specified target element collection, and should not be removed from it. - - - MSB4005: The current working directory could not be restored to {0}. {1} - {StrBegin="MSB4005: "}UE: This message is shown when the current working directory cannot be reset after a build. "{1}" contains a message explaining why. - LOCALIZATION: "{1}" is a message from an CLR/FX exception and is already localized. - - - Cannot set a condition on an object not represented by an XML element in the project file. - - - Cannot set ContinueOnError on an object not represented by an XML element in the project file. - - - MSB4134: DefaultToolsVersion cannot be set after a project has been loaded into the Engine. - {StrBegin="MSB4134: "} - - - Assigning the "{0}" attribute on an item that has been evaluated is not allowed. This operation is only allowed on the original persisted item that came directly from the project file. - - - Assigning the "{0}" attribute of a virtual item is not allowed. - - - A property cannot be set while building. - - - A property cannot be set to null. - - - Cannot get or set parameters on a task not associated with a project object. - - - MSB4162: <{0}> is not valid. Child elements are not allowed below a item remove element. - {StrBegin="MSB4162: "} - - - MSB4166: Child node "{0}" exited prematurely. Shutting down. - {StrBegin="MSB4166: "} - - - MSB4085: A <Choose> must contain at least one <When>. - {StrBegin="MSB4085: "} - - - MSB4114: <Choose> elements cannot be nested more than {0} levels deep. - {StrBegin="MSB4114: "}UE: This message appears if the project file contains unreasonably nested Choose elements. - LOCALIZATION: Do not localize "Choose" as it is an XML element name. - - - MSB4006: There is a circular dependency in the target dependency graph involving target "{0}". - {StrBegin="MSB4006: "}UE: This message is shown when the build engine detects a target referenced in a circular manner -- a project cannot - request a target to build itself (perhaps via a chain of other targets). - - - MSB4086: A numeric comparison was attempted on "{1}" that evaluates to "{2}" instead of a number, in condition "{0}". - {StrBegin="MSB4086: "} - - - MSB4007: The clause "{0}", specified in the "{1}" attribute is invalid. - {StrBegin="MSB4007: "}UE: This message is shown when the Condition on an element is invalid in some way -- e.g. syntax error, unrecognized operator. - - - MSB4130: The condition "{0}" may have been evaluated incorrectly in an earlier version of MSBuild. Please verify that the order of the AND and OR clauses is written as intended. To avoid this warning, add parentheses to make the evaluation order explicit. - {StrBegin="MSB4130: "} - - - MSB4087: Specified condition "{0}" does not evaluate to a boolean. - {StrBegin="MSB4087: "} - - - MSB4113: Specified condition "{0}" evaluates to "{1}" instead of a boolean. - {StrBegin="MSB4113: "} - - - {0}, line {1} - - - MSB4136: Error reading the toolset information from the configuration file "{0}". {1} - {StrBegin="MSB4136: "} - - - MSB4008: A conflicting assembly for the task assembly "{0}" has been found at "{1}". - {StrBegin="MSB4008: "}UE: This message is shown when the type/class of a task cannot be resolved uniquely from a single assembly. - - - MSB4142: MSBuildToolsPath is not the same as MSBuildBinPath for the ToolsVersion "{0}" defined at "{1}". If both are present they must have the same value. - {StrBegin="MSB4142: "} - - - MSB4097: The element <{0}> beneath element <{1}> may not have a custom XML namespace. - {StrBegin="MSB4097: "} - - - MSB4009: The default tasks file could not be successfully loaded. {0} - {StrBegin="MSB4009: "}UE: This message is shown when one of the default tasks file (*.tasks) located alongside the MSBuild binaries cannot - be opened/parsed. "{0}" contains a message explaining why. The filename itself is not part of the message but is provided - separately to loggers. - LOCALIZATION: "{0}" is a message from some FX method and is already localized. - - - MSB4010: The "{0}" files could not be successfully loaded from their expected location "{1}". Default tasks will not be available. {2} - {StrBegin="MSB4010: "}UE: This message is shown when the default tasks files that are located alongside the MSBuild binaries cannot be - found, either because they don't exist, or because of lack of permissions. "{2}" contains a message explaining why. - LOCALIZATION: "{2}" is a message from some FX method and is already localized. - - - MSB4140: Default tools version is specified in neither the registry nor the configuration file. - {StrBegin="MSB4140: "} - - - MSB4133: A default tools version "{0}" was specified, but its definition could not be found. - {StrBegin="MSB4133: "} - - - MSB4080: The value "{0}" of the "PropertyName" attribute in element <Output> contains a "$" character. If you intended to use a property name then remove the $( ) around the property name. - {StrBegin="MSB4080: "}UE: This message is shown when an output tag has an property name that contains an $. They probably typed $(foo) instead of foo in the PropertyName. LOCALIZATION: Output and PropertyName should not be localized. - - - MSB4011: There is a circular reference involving the import of file "{0}". This file may have been imported more than once, or you may have attempted to import the main project file. All except the first instance of this file will be ignored. - {StrBegin="MSB4011: "} - - - MSB4079: The <ProjectExtensions> element occurs more than once. - {StrBegin="MSB4079: "} - - - MSB4012: The expression "{0}" cannot be used in this context. Item lists cannot be concatenated with other strings where an item list is expected. Use a semicolon to separate multiple item lists. - {StrBegin="MSB4012: "}UE: This message is shown when the user does not properly specify an item list when an item list is expected - e.g. "badprefix@(foo)badsuffix" instead of "prefix; @(foo); suffix" - - - Need to specify the project file name. - UE: This message is shown when the user calls into the engine to build a project without specifying a filename. - - - end of input - This is the name of the "EndOfInput" token. It is displayed in quotes as the - unexpected char or token when the end of a conditional was unexpectedly reached. - - - The previous error was converted to a warning because the task was called with ContinueOnError=true. - - - {0} Error(s) - - - MSB4159: Error creating the toolset "{0}". {1} - {StrBegin="MSB4159: "} - - - MSB4146: Cannot evaluate the property expression "{0}" found at "{1}". {2} - {StrBegin="MSB4146: "} - - - The <{0}> tag is no longer supported as a child of the <Project> element. Place this tag within a target, and add the name of the target to the "InitialTargets" attribute of the <Project> element. - - - MSB4100: Expected "{0}" to evaluate to a boolean instead of "{1}", in condition "{2}". - {StrBegin="MSB4100: "} - - - MSB4028: The "{0}" task's outputs could not be retrieved from the "{1}" parameter. {2} - {StrBegin="MSB4028: "} - - - MSB4014: The build was aborted because of an internal failure. - {StrBegin="MSB4014: "}UE: This message is shown when an unhandled exception terminates the build. The cause is most likely a programming - error in the build engine. - - - MSB4015: The build was aborted because the "{0}" logger failed unexpectedly during shutdown. - {StrBegin="MSB4015: "}UE: This message is used for a special exception that is thrown when a logger fails while shutting down (most likely - because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a special - exception to abort the build. - - - MSB4016: The build was aborted because the "{0}" logger failed unexpectedly during initialization. - {StrBegin="MSB4016: "}UE: This message is used for a special exception that is thrown when a logger fails while initializing itself (most - likely because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a - special exception to abort the build. - - - MSB4017: The build was aborted because of an unexpected logger failure. - {StrBegin="MSB4017: "}UE: This message is used for a special exception that is thrown when a logger fails while logging an event (most - likely because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a - special exception to abort the build. - - - MSB4018: The "{0}" task failed unexpectedly. - {StrBegin="MSB4018: "}UE: This message is shown when a task terminates because of an unhandled exception. The cause is most likely a - programming error in the task; however, it is also possible that the unhandled exception originated in the engine, and was - surfaced through the task when the task called into the engine. - - - MSB4165: Failed to receive a response from the child node "{0}" in the timeout period "{1}" ms. Shutting down. - {StrBegin="MSB4165: "} - - - MSB4088: Condition "{0}" is improperly constructed. - {StrBegin="MSB4088: "} - - - MSB4105: Found an unexpected character '{2}' at position {1} in condition "{0}". Did you intend to use "=="? - {StrBegin="MSB4105: "} - - - MSB4106: Expected an item list at position {1} in condition "{0}". Did you forget the closing parenthesis? - {StrBegin="MSB4106: "} - - - MSB4107: Expected an item list at position {1} in condition "{0}". Did you forget the opening parenthesis after the '@'? To use a literal '@', use '%40' instead. - {StrBegin="MSB4107: "} - - - MSB4108: Expected an item list at position {1} in condition "{0}". Did you forget to close a quote inside the item list expression? - {StrBegin="MSB4108: "} - - - MSB4109: Expected a property at position {1} in condition "{0}". Did you forget the closing parenthesis? - {StrBegin="MSB4109: "} - - - MSB4110: Expected a property at position {1} in condition "{0}". Did you forget the opening parenthesis after the '$'? To use a literal '$', use '%24' instead. - {StrBegin="MSB4110: "} - - - MSB4101: Expected a closing quote after position {1} in condition "{0}". - {StrBegin="MSB4101: "} - - - MSB4019: The imported project "{0}" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. - {StrBegin="MSB4019: "}LOCALIZATION: <Import> should not be localized. - - - MSB4089: Incorrect number of arguments to function in condition "{0}". Found {1} argument(s) when expecting {2}. - {StrBegin="MSB4089: "} - - - The "{0}" object specified does not belong to the correct "{1}" object. - - - MSB4020: The value "{0}" of the "{1}" attribute in element <{2}> is invalid. - {StrBegin="MSB4020: "}UE: This is a generic message that is displayed when we find a project element with an incorrect value for one of its - attributes e.g. <Import Project=""> -- the value of Project should not be an empty string. - - - MSB4102: The value "{0}" of the "{1}" attribute in element <{2}> is invalid. {3} - {StrBegin="MSB4102: "}UE: This is a generic message that is displayed when we find a project element with an incorrect value for one of its - attributes. At the end of the message we show the exception text we got trying to use the value. - - - MSB4021: The "ContinueOnError" attribute of the "{0}" task is not valid. {1} - {StrBegin="MSB4021: "}LOCALIZATION: "ContinueOnError" should not be localized. "{1}" is a message from another exception explaining the problem. - - - MSB4139: Invalid value for default ToolsVersion is specified in registry key "{0}". - {StrBegin="MSB4139: "} - - - MSB4022: The result "{0}" of evaluating the value "{1}" of the "{2}" attribute in element <{3}> is not valid. - {StrBegin="MSB4022: "}UE: This message is shown when the engine is checking the correctness of the value (after evaluating embedded - properties/items) assigned to an XML attribute of an XML element in the project file. - - - "{0}" is not a valid event category. To raise a custom event, use the "{1}" category. - - - "{0}" is not a valid importance level for events. - - - MSB4104: Failed to write to log file "{0}". {1} - {StrBegin="MSB4104: "}UE: This is shown when the File Logger can't create or write to the file it was instructed to log to. - - - MSB4024: The imported project file could not be loaded. {0} - {StrBegin="MSB4024: "}UE: This message is shown when an imported project file cannot be loaded because of incorrect XML. The project - filename is not part of the message because it is provided separately to loggers. - LOCALIZATION: {0} is a localized message from the CLR/FX explaining why the project is invalid. - - - Operation invalid for a persisted item group. - - - Operation invalid for a virtual item group. - - - MSB4071: The value Importance="{0}" in the <Message> element is invalid. Valid values are: High, Normal and Low. - {StrBegin="MSB4071: "}UE: This message is shown when a user specifies a value for the importance attribute of Message which is not valid. - The importance enumeration is: High, Normal and Low. Specifying any other importance will result in this message being shown - LOCALIZATION: "Importance" should not be localized. - "Message" should not be localized. - High should not be localized. - Normal should not be localized. - Low should not be localized. - - - MSB4025: The project file could not be loaded. {0} - {StrBegin="MSB4025: "}UE: This message is shown when the project file given to the engine cannot be loaded because the filename/path is - invalid, or due to lack of permissions, or incorrect XML. The project filename is not part of the message because it is - provided separately to loggers. - LOCALIZATION: {0} is a localized message from the CLR/FX explaining why the project is invalid. - - - MSB4147: The property "{0}" at "{1}" is invalid. {2} - {StrBegin="MSB4147: "} - - - "{0}" is an invalid "ProjectFileEncoding" value. - LOCALIZATION: "ProjectFileEncoding" should not be localized. - - - MSB4143: The expression "{0}" cannot be evaluated. {1} - {StrBegin="MSB4143: "} - UE: This message is shown when the user attempts to provide an expression like "$(Registry:HKEY_LOCAL_MACHINE\Software\Vendor\Tools@TaskLocation)" - LOCALIZATION: "{0}" is the expression that was bad. "{1}" is a message from an FX exception that describes why the expression is bad. - - - - MSB4184: The expression "{0}" cannot be evaluated. {1} - {StrBegin="MSB4184: "} - Single quotes as the expression will typically have double quotes in it. - UE: This message is shown when the user attempts to provide an expression like "$(SomeProperty.ToLower())" - LOCALIZATION: "{0}" is the expression that was bad. "{1}" is a message from an FX exception that describes why the expression is bad. - - - - MSB4185: The function "{0}" on type "{1}" has not been enabled for execution. - {StrBegin="MSB4185: "} - UE: This message is shown when the user attempts to provide an expression like "$([System.DateTime]::Now)", but the expression has not been enabled - LOCALIZATION: "{0}" is the static function name, "{1}" is the .NET Framework type name - - - - MSB4186: Invalid static method invocation syntax: "{0}". Static method invocation should be of the form: $([FullTypeName]::Method()), e.g. $([System.IO.Path]::Combine(`a`, `b`)) - {StrBegin="MSB4186: "} - UE: This message is shown when the user attempts to call a static method on a type, but has used the incorrect syntax - LOCALIZATION: "{0}" is the function expression which is in error - - - - MSB4070: The schema "{0}" is not valid. {1} - {StrBegin="MSB4070: "}UE: This message is shown when the schema file provided for the validation of a project is itself not valid. - LOCALIZATION: "{0}" is the schema file path. "{1}" is a message from an FX exception that describes why the schema file is bad. - - - MSB4026: The "{0}={1}" parameter for the "{2}" task is invalid. - {StrBegin="MSB4026: "}UE: This message is displayed when a task has an invalid parameter that cannot be initialized. - - - MSB4027: The "{0}" task generated invalid items from the "{1}" output parameter. {2} - {StrBegin="MSB4027: "} - - - MSB4029: The "{0}" task has an invalid output specification. The "TaskParameter" attribute is required, and either the "ItemName" or "PropertyName" attribute must be specified (but not both). - {StrBegin="MSB4029: "}LOCALIZATION: "TaskParameter", "ItemName" and "PropertyName" should not be localized. - - - MSB4030: "{0}" is an invalid value for the "{1}" parameter of the "{3}" task. The "{1}" parameter is of type "{2}". - {StrBegin="MSB4030: "}UE: This error is shown when a type mis-match occurs between the value assigned to task parameter in the project file - and the type of the .NET property that corresponds to the task parameter. For example, if an int task parameter called "Count" - is assigned the value "x", this error would be displayed: <MyTask Count="x" /> - - - MSB4137: Invalid value specified in the configuration file at "{0}". Property name or tools version name is an empty string. - {StrBegin="MSB4137: "} - - - MSB4103: "{0}" is not a valid logger verbosity level. - {StrBegin="MSB4103: "} - - - MSB4163: <ItemDefinitionGroup> is not allowed inside a target. - {StrBegin="MSB4163: "} - - - The specified item does not belong to the current item group. - - - MSB4096: The item "{0}" in item list "{1}" does not define a value for metadata "{2}". In order to use this metadata, either qualify it by specifying %({1}.{2}), or ensure that all items in this list define a value for this metadata. - {StrBegin="MSB4096: "} - - - MSB4099: A reference to an item list at position {1} is not allowed in this condition "{0}". - {StrBegin="MSB4099: "} - - - MSB4033: "{0}" is a reserved item metadata, and cannot be redefined as a custom metadata on the item. - {StrBegin="MSB4033: "} - - - An InternalLoggerException can only be thrown by the MSBuild engine. The public constructors of this class cannot be used to create an instance of the exception. - UE: This message is shown when a user tries to instantiate a special exception called InternalLoggerException through the OM -- - only the engine is allowed to create and throw this exception. - LOCALIZATION: "InternalLoggerException" and "MSBuild" should not be localized. - - - Initial Items: - - - MSB4083: Expected a Condition attribute on element "{0}". - {StrBegin="MSB4083: "} - - - MSB4164: The value "{0}" of metadata "{1}" contains an item list expression. Item list expressions are not allowed on default metadata values. - {StrBegin="MSB4164: "} - - - MSBuild is expecting a valid "{0}" object. - - - - MSB4035: The required attribute "{0}" is missing from element <{1}>. - {StrBegin="MSB4035: "}UE: This message is shown when a user leaves off a required attribute from a project element - e.g. <UsingTask AssemblyName="foo"> -- this is missing the "TaskName" attribute. - - - MSB4036: The "{0}" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "{1}" directory. - {StrBegin="MSB4036: "}LOCALIZATION: <UsingTask> and "*.tasks" should not be localized. - - - MSB4141: MSBuildToolsPath is not specified for the ToolsVersion "{0}" defined at "{1}", or the value specified evaluates to the empty string. - {StrBegin="MSB4141: "} - - - MSB4031: The "MSBuildVersion" attribute is deprecated. If the project is authored in the MSBuild 2003 format, please remove the attribute from the <Project> tag. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format. - {StrBegin="MSB4031: "}UE: This message is shown for projects that still contain the "MSBuildVersion" attribute in their <Project> - tag. We no longer need this attribute because the project's XML namespace (i.e. the "xmlns" attribute) gives us all the - version information we need. - LOCALIZATION: "MSBuild", "MSBuildVersion" and <Project> should not be localized. - - - MSB4144: Multiple definitions were found for the toolset "{0}". - {StrBegin="MSB4144: "} - - - MSB4145: Multiple definitions were found for the property "{0}". - {StrBegin="MSB4145: "} - - - MSB4082: Choose has more than one <Otherwise> element. - {StrBegin="MSB4082: "} - - - This method is only valid for persisted <{0}> elements. - - - This method is only valid for virtual property groups, not <{0}> elements. - - - MSB4038: The element <{0}> must be last under element <{1}>. Found element <{2}> instead. - {StrBegin="MSB4038: "} - - - MSB4138: Non-string data was specified at the registry location "{0}". - {StrBegin="MSB4138: "} - - - MSB4039: No "{0}" element was found in the project file. - {StrBegin="MSB4039: "} - - - MSB4040: There is no target in the project. - {StrBegin="MSB4040: "} - - - Removing the "{0}" attribute of an item is not allowed. - - - The object passed in is not part of the project. - - - Overriding target "{0}" in project "{1}" with target "{2}" from project "{3}". - - - MSB4167: The parent process unexpectedly exited. Shutting down child node "{0}". - {StrBegin="MSB4167: "} - - - {0} ms {1} {2} calls - - - (* = timing was not recorded because of reentrancy) - - - This project object has been unloaded from the MSBuild engine and is no longer valid. - - - The project file "{0}" was not found. - UE: This message is shown when the user calls into the OM to build a project that doesn't exist on disk. - - - Done building project "{0}" -- FAILED. - - - Done building project "{0}". - - - MSB4041: The default XML namespace of the project must be the MSBuild XML namespace. If the project is authored in the MSBuild 2003 format, please add xmlns="{0}" to the <Project> element. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format. - {StrBegin="MSB4041: "}UE: This is a Beta 1 message only. - LOCALIZATION: <Project>, "MSBuild" and "xmlns" should not be localized. - - - Project Performance Summary: - - - MSB4042: Stopping because of syntax errors in project file. - {StrBegin="MSB4042: "} - - - Project "{0}" is building "{1}" ({2} target(s)): - - - Project "{0}" is building "{1}" (default targets): - - - Project "{0}" ({1} target(s)): - - - Project "{0}" (default targets): - - - Done Building Project "{0}" ({1} target(s)). - - - Done Building Project "{0}" (default targets). - - - Done Building Project "{0}" ({1} target(s)) -- FAILED. - - - Done Building Project "{0}" (default targets) -- FAILED. - - - MSB4075: The project file must be opened in the Visual Studio IDE and converted to the latest version before it can be built by MSBuild. - {StrBegin="MSB4075: "} - - - MSB4192: The project file "{0}" is in the ".vcproj" file format, which MSBuild no longer supports. Please convert the project by opening it in the Visual Studio IDE or running the conversion tool, or use MSBuild 3.5 or earlier to build it. - {StrBegin="MSB4192: "} LOC: ".vcproj" should not be localized - - - The specified property does not belong to the current property group. - - - Initial Properties: - - - MSB4148: The name of a property stored under the registry key "{0}" has zero length. - {StrBegin="MSB4148: "} - - - The property names in the indexer and the "{0}" object do not match. - - - MSB4043: The item metadata reference "{0}" is invalid because it is qualified with an item name. Item metadata referenced in transforms do not need to be qualified, because the item name is automatically deduced from the items being transformed. Change "{0}" to "%({1})". - {StrBegin="MSB4043: "}UE: This message is shown when the user does something like this: @(foo->'%(foo.metadata)'). There is no need to specify - "foo.metadata", because "foo" is automatically deduced. In corollary, "bar.metadata" is not allowed either, where "bar" is a different - item list type. - - - MSB4135: Error reading the toolset information from the registry location "{0}". {1} - {StrBegin="MSB4135: "} - - - MSB4044: The "{0}" task was not given a value for the required parameter "{1}". - {StrBegin="MSB4044: "}UE: This message is shown when a task parameter designated as "required" is not set in the project file. - - - Validating project using schema file "{0}". - LOCALIZATION: "{0}" is the location of the schema file. - - - MSB4045: Project is not valid. {0} - {StrBegin="MSB4045: "}UE: This error is shown when the user asks his project to be validated against a schema (/val switch for - MSBuild.exe), and the project has errors. "{0}" contains a message explaining the problem. - LOCALIZATION: "{0}" is a message from the System.XML schema validator and is already localized. - - - MSB4112: The targets in this project have been disabled by the host and therefore cannot be built at this time. This may have been done for security reasons. To enable the targets, the host must set Project.BuildEnabled to "true". - {StrBegin="MSB4112: "} - - - MSB4093: The "{0}" parameter of the "{1}" task cannot be written to because it does not have a "set" accessor. - {StrBegin="MSB4093: "}UE: This error is shown when a project tries to assign a value to a task parameter that does not have a "set" - accessor on the corresponding .NET property on the task class. - - - A shallow clone of this object cannot be created. - - - Skipping target "{0}" because it has no inputs. - - - Though the target has declared its inputs, the input specification only references empty properties and/or empty item lists. - - - Skipping target "{0}" because it has no outputs. - - - Though the target has declared its outputs, the output specification only references empty properties and/or empty item lists. - - - Skipping target "{0}" because all output files are up-to-date with respect to the input files. - - - Input files: {0} - {0} is a semicolon-separated list of filenames. - - - Output files: {0} - {0} is a semicolon-separated list of filenames. - - - Building solution configuration "{0}". - UE: This is not an error, so doesn't need an error code. - - - Using solution cache file "{0}" for configuration "{1}" and tools version "{2}". - UE: This is not an error, so doesn't need an error code. - - - Failed to read solution cache file "{0}". {1} Using solution file directly. - UE: This is not a true error, so doesn't need an error code. - - - Failed to write solution cache file "{0}". {1} - UE: This is not a true error, so doesn't need an error code. - - - Solution cache file was created for a "{0}" value of "{1}" but the current value is "{2}". Refreshing cache file. - UE: This is not an error, so doesn't need an error code. - - - Solution cache file has an internal version number "{0}" but the current value is "{1}". Refreshing cache file. - UE: This is not an error, so doesn't need an error code. - - - Solution cache file is out of date. Refreshing cache file. {0} - UE: This is not an error, so doesn't need an error code. - - - MSB4160: A circular dependency involving project "{0}" has been detected. - {StrBegin="MSB4160: "} - - - MSB4126: The specified solution configuration "{0}" is invalid. Please specify a valid solution configuration using the Configuration and Platform properties (e.g. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU") or leave those properties blank to use the default solution configuration. - {StrBegin="MSB4126: "}UE: The solution filename is provided separately to loggers. - - - MSB4046: Error reading project file "{0}": {1} - {StrBegin="MSB4046: "} - - - MSB4125: The project file name "{0}" is invalid. {1} - {StrBegin="MSB4125: "}UE: The solution filename is provided separately to loggers. - - - MSB4051: Project {0} is referencing a project with GUID {1}, but a project with this GUID was not found in the .SLN file. - {StrBegin="MSB4051: "}UE: The solution filename is provided separately to loggers. - - - MSB4078: The project file "{0}" is not supported by MSBuild and cannot be built. - {StrBegin="MSB4078: "} - - - MSB4054: The solution file must be opened in the Visual Studio IDE and converted to the latest version before it can be built by MSBuild. - {StrBegin="MSB4054: "}UE: The solution filename is provided separately to loggers. - - - MSB4121: The project configuration for project "{0}" was not specified in the solution file for the solution configuration "{1}". - {StrBegin="MSB4121: "} - - - The project "{0}" is not selected for building in solution configuration "{1}". - - UE: This is not an error, so doesn't need an error code. - - - - MSB4122: Scanning project dependencies for project "{0}" failed. {1} - {StrBegin="MSB4122: "} - - - MSB4149: The tools version "{0}" of the solution does not support building projects with a different tools version. - {StrBegin="MSB4149: "} - - - Web projects do not support the "Clean" target. Continuing with remaining projects ... - UE: This is not an error, so doesn't need an error code. - LOCALIZATION: Do not localize "Clean". - - - Web projects do not support the "Publish" target. Continuing with remaining projects ... - UE: This is not an error, so doesn't need an error code. - LOCALIZATION: Do not localize "Publish". - - - Skipping because the "$(AspNetConfiguration)" configuration is not supported for this web project. You can use the AspNetConfiguration property to override the configuration used for building web projects, by adding /p:AspNetConfiguration=<value> to the command line. Currently web projects only support Debug and Release configurations. - - UE: This is not an error, so doesn't need an error code. - LOCALIZATION: Do NOT localize "AspNetConfiguration", "Debug", "Release". - - - - MSB4076: VC projects do not support the "Publish" target. - {StrBegin="MSB4076: "}LOCALIZATION: Do not localize "Publish". - - - MSB4098: MSBuild is invoking VCBuild to build this project. Project-to-project references between VC++ projects (.VCPROJ) and C#/VB/VJ# projects (.CSPROJ, .VBPROJ, .VJSPROJ) are not supported by the command-line build systems when building stand-alone VC++ projects. Projects that contain such project-to-project references will fail to build. Please build the solution file containing this project instead. - {StrBegin="MSB4098: "} - - - MSB4056: The MSBuild engine must be called on a single-threaded-apartment. Current threading model is "{0}". Proceeding, but some tasks may not function correctly. - {StrBegin="MSB4056: "} - - - Schema validation - UE: this fragment is used to describe errors that are caused by schema validation. For example, if a normal error is - displayed like this: "MSBUILD : error MSB0000: This is an error.", then an error from schema validation would look like this: - "MSBUILD : Schema validation error MSB0000: This is an error." - LOCALIZATION: This fragment needs to be localized. - - - Target "{0}" skipped. Previously built unsuccessfully. - - - Target "{0}" skipped. Previously built successfully. - - - MSB4116: The condition "{1}" on the "{0}" target has a reference to item metadata. References to item metadata are not allowed in target conditions unless they are part of an item transform. - {StrBegin="MSB4116: "} - - - MSB4057: The target "{0}" does not exist in the project. - {StrBegin="MSB4057: "} - - - Done building target "{0}" in project "{1}" -- FAILED. - - - Done building target "{0}" in project "{1}". - - - {0}: (TargetId:{1}) - - - MSB4058: The "{0}" target is missing its output specification. If a target declares inputs, it must also declare outputs. - {StrBegin="MSB4058: "} - - - MSB4168: The item "{0}" of type "{1}" does not define a value for the metadata in the expression "{2}". This expression is used in the target output for target "{3}". If a target declares outputs that are transforms, all items in the transform must have a value for the metadata in the transform. - {StrBegin="MSB4168: "} - - - Target Performance Summary: - - - Target "{0}" skipped, due to false condition; ({1}) was evaluated as ({2}). - - - Target "{0}" in project "{1}" - - - Target {0}: - - - Target "{0}" in file "{1}": - - - Build continuing because "{0}" on the task "{1}" is set to "{2}". - - - Target {0} from project "{1}": - - - Target "{0}" in file "{1}" from project "{2}": - - - MSB4060: The "{0}" task has been declared or used incorrectly, or failed during construction. Check the spelling of the task name and the assembly name. - {StrBegin="MSB4060: "} - - - MSB4077: The "{0}" task has been marked with the attribute LoadInSeparateAppDomain, but does not derive from MarshalByRefObject. Check that the task derives from MarshalByRefObject or AppDomainIsolatedTask. - {StrBegin="MSB4077: "}LOCALIZATION: <LoadInSeparateAppDomain>, <MarshalByRefObject>, <AppDomainIsolatedTask> should not be localized. - - - Done executing task "{0}" -- FAILED. - - - Done executing task "{0}". - - - {0} (TaskId:{1}) - - - Using "{0}" task from assembly "{1}". - UE: This informational message helps users determine which assemblies their tasks were loaded from. - - - MSB4061: The "{0}" task could not be instantiated from the assembly "{1}". {2} - {StrBegin="MSB4061: "}LOCALIZATION: "{2}" is a localized message from a CLR/FX exception. - - - MSB4127: The "{0}" task could not be instantiated from the assembly "{1}". Please verify the task assembly has been built using the same version of the Microsoft.Build.Framework assembly as the one installed on your computer and that your host application is not missing a binding redirect for Microsoft.Build.Framework. {2} - {StrBegin="MSB4127: "}UE: This message is a specialized version of the TaskInstantiationFailureError message and can probably reuse some of its docs. - LOCALIZATION: "{2}" is a localized message from a CLR/FX exception. Also, Microsoft.Build.Framework should not be localized - - - MSB4062: The "{0}" task could not be loaded from the assembly {1}. {2} Confirm that the <UsingTask> declaration is correct, and that the assembly and all its dependencies are available. - {StrBegin="MSB4062: "}UE: This message is shown when a task cannot be loaded from its assembly for various reasons e.g. corrupt assembly, - invalid task declaration, disk error, etc. "{2}" contains a message explaining what happened. - LOCALIZATION: "{2}" is a message from the CLR loader and is already localized. Also, <UsingTask> should not be localized. - - - MSB4063: The "{0}" task could not be initialized with its input parameters. {1} - {StrBegin="MSB4063: "} - - - Task Performance Summary: - - - Task "{0}" skipped, due to false condition; ({1}) was evaluated as ({2}). - - - Task "{0}" - - - Time Elapsed {0} - - - Building with tools version "{0}". - - - Project file contains ToolsVersion="{0}". This toolset is unknown or missing. You may be able to resolve this by installing the appropriate .NET Framework for this toolset. Treating the project as if it had ToolsVersion="4.0". - - - Deferred Messages - - - Some messages did not display because they were not associated with any ProjectStarted events. Use diagnostic verbosity to view these messages. - - - MSB4090: Found an unexpected character '{2}' at position {1} in condition "{0}". - {StrBegin="MSB4090: "} - - - MSB4091: Found a call to an undefined function "{1}" in condition "{0}". - {StrBegin="MSB4091: "} - - - MSB4064: The "{0}" parameter is not supported by the "{1}" task. Verify the parameter exists on the task, and it is a settable public instance property. - {StrBegin="MSB4064: "} - - - MSB4131: The "{0}" parameter is not supported by the "{1}" task. Verify the parameter exists on the task, and it is a gettable public instance property. - {StrBegin="MSB4131: "} - - - MSB4092: An unexpected token "{1}" was found at character position {2} in condition "{0}". - {StrBegin="MSB4092: "} - - - MSB4065: The "{0}" parameter is not marked for output by the "{1}" task. - {StrBegin="MSB4065: "} - - - MSB4066: The attribute "{0}" in element <{1}> is unrecognized. - {StrBegin="MSB4066: "} - - - MSB4067: The element <{0}> beneath element <{1}> is unrecognized. - {StrBegin="MSB4067: "} - - - MSB4068: The element <{0}> is unrecognized, or not supported in this context. - {StrBegin="MSB4068: "} - - - MSB4132: The tools version "{0}" is unrecognized. - {StrBegin="MSB4132: "} - - - MSB4069: The "{0}" type of the "{1}" parameter of the "{2}" task is not supported by MSBuild. - {StrBegin="MSB4069: "}LOCALIZATION: "MSBuild" should not be localized. - - - MSB4072: A <{0}> element must contain either the "{1}" attribute or the "{2}" attribute (but not both). - {StrBegin="MSB4072: "} - - - {0} Warning(s) - - - MSB4084: A <When> element may not follow an <Otherwise> element in a <Choose>. - {StrBegin="MSB4084: "} - - - Target Name: "{0}" Project Name: "{1}" - - - Cycle trace: - - - MSB4150: Must initialize the console logger using the initialize method before using ApplyParameter - {StrBegin="MSB4150: "} - - - MSB4151: An error occurred while building project "{0}", target "{1}". Please see innerException for detailed information. - {StrBegin="MSB4151: "} - - - MSB4152: An error occurred on the child node "{0}" and could not be passed to the parent node. {1} - {StrBegin="MSB4152: "} - - - MSB4153: A call is made on an inactive IBuildEngine interface corresponding to a task that already finished execution. - {StrBegin="MSB4153: "} - - - MSB4154: A forwarding logger is attempting to forward BuildFinished event - {StrBegin="MSB4154: "} - - - MSB4155: There was an error while communicating with a node. - {StrBegin="MSB4155: "} - - - MSB1021: Cannot create an instance of the logger - {0}. - {StrBegin="MSB1021: "}The error code for this message is duplicated from MSBuild.exe. - - - MSB1020: The logger {0} was not found. Check the following: 1.) The logger name specified is the same as the name of the logger class. 2.) The logger class is "public" and implements the Microsoft.Build.Framework.ILogger interface. 3.) The path to the logger assembly is correct, or the logger can be loaded using only the assembly name provided. - {StrBegin="MSB1020: "}The error code for this message is duplicated from MSBuild.exe. - - - MSB4156: A forwarding logger is attempting to forward BuildStarted event - {StrBegin="MSB4156: "} - - - "{0}" ({1} target) ({2}) -> - - - "{0}" (default target) ({1}) -> - - - {0} {1,5} - - - Project "{0}" on node {1} ({2} target(s)). - - - Project "{0}" on node {1} (default targets). - - - Project "{0}" ({1}) is building "{2}" ({3}) on node {4} ({5} target(s)). - - - Project "{0}" ({1}) is building "{2}" ({3}) on node {4} (default targets). - - - ({0} target) -> - - - MSB4157: The array of project files needs to contain at least one value. - {StrBegin="MSB4157: "} - - - MSB4158: The project file name at element {0} is empty. - {StrBegin="MSB4158: "} - - - The property "{0}" with value "{1}" is being overridden by another batch. The property is now: "{2}" - - - Please see inner exception for error information. - - - Event type "{0}" was expected to be serializable. The event was not serializable and has been ignored. - - - The log file path cannot be null or empty. - - - MSB4161: Project "{0}" was loaded and unloaded during the current build. Reloading a project during the build can result in errors or an inconsistent build state. Either avoid unloading project "{0}" or cache the evaluation results of target(s) "{1}" before unloading the project. - {StrBegin="MSB4161: "} - - - [default] - - - - diff --git a/src/Deprecated/Engine/Resources/xlf/Strings.cs.xlf b/src/Deprecated/Engine/Resources/xlf/Strings.cs.xlf deleted file mode 100644 index b36ef289457..00000000000 --- a/src/Deprecated/Engine/Resources/xlf/Strings.cs.xlf +++ /dev/null @@ -1,2674 +0,0 @@ - - - -
- - 4013 - 1176.8 - 1176.8 - 0 - 0 - - - 0 - 981 - 2334 - 0 - 0 - 698 - 0 - -
- - - MSB4001: The "{0}" task has more than one parameter called "{1}". - MSB4001: Úloha {0} má více než jeden parametr s názvem {1}. - {StrBegin="MSB4001: "}UE: This message is shown when a task has more than one .NET property with the same name -- it's unclear which of - those properties the task wants to use as a parameter in project files. - - MSB4001: Die {0}-Aufgabe enthält mehrere Parameter mit dem Namen "{1}". - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4081: The value "{0}" of the "ItemName" attribute in element <Output> contains an "@" character. If you intended to use an item name then remove the @( ) around the item name. - MSB4081: Hodnota {0} atributu ItemName v elementu <Output> obsahuje znak @. Pokud jste chtěli použít název položky, odeberte znaky @( ) kolem názvu položky. - {StrBegin="MSB4081: "}UE: This message is shown when an output tag has an itemname that contains an @. They probably typed @(foo) instead of foo in the ItemName.LOCALIZATION: Output and ItemName should not be localized. - - MSB4081: Der Wert "{0}" "ItemName-Attribut im Element < Output > enthält ein" @"Zeichen. Soll ein Elementname verwenden und entfernen dann die @ (), um den Namen des Elements. - - fuzzyMatch="15" wordcount="30" adjWordcount="25.5" curWordcount="25.5" - - - MSB4002: There was a failure retrieving the attributes for parameters in the "{0}" task. {1} - MSB4002: Došlo k chybě při načítání atributů pro parametry úlohy {0}. {1} - {StrBegin="MSB4002: "}UE: This message is shown when the .NET attributes that a task's .NET properties are decorated with, cannot be - retrieved -- this is typically because the .NET classes that define the .NET attributes cannot be loaded because the assembly - they are defined in cannot be found, or the classes themselves cannot be found. - - MSB4002: Fehler beim Abrufen der Attribute für Parameter in der {0}-Aufgabe. {1} - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - MSB4003: "{0}" is a reserved attribute of the <{1}> element, and must be spelled with the correct casing. This attribute cannot be used as a parameter to the "{2}" task. - MSB4003: {0} je vyhrazený atribut elementu <{1}> a jeho název musí být správně zadán s rozlišením velkých a malých písmen. Tento atribut nelze použít jako parametr úlohy {2}. - {StrBegin="MSB4003: "}UE: Tasks are not allowed to use incorrect case for reserved attributes on the task nodes e.g. "continueonerror" - instead of the "ContinueOnError". - - MSB4003: "{0}" ist ein reserviertes Attribut der <{1}>-Element und mit der richtigen Groß-/Kleinschreibung geschrieben werden muss. Dieses Attribut kann nicht verwendet werden, als Parameter an die "{2}" Aufgabe. - - fuzzyMatch="15" wordcount="31" adjWordcount="26.35" curWordcount="26.35" - - - The "REQUESTBATCHSIZE" must be a number greater than 1. "{0}" is an invalid value. The value 10 will be used instead. - Hodnota REQUESTBATCHSIZE musí být číslo větší než 1. {0} je neplatná hodnota. Místo ní bude použita hodnota 10. - The name "REQUESTBATCHSIZE" is an environment variable - - Die "REQUESTBATCHSIZE" muss eine Zahl größer als 1 sein. "{0}" ist ein ungültiger Wert. Der Wert 10 wird stattdessen verwendet. - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - Build completed in {0}. - Sestavení bylo dokončeno za {0}. - - - Das Erstellen wurde in {0} beendet. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - Build FAILED. - Sestavení SE NEZDAŘILO. - - - Fehler beim Buildvorgang. - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Build succeeded. - Vytváření sestavení bylo úspěšně dokončeno. - - - Buildvorgang erfolgreich. - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Build started. - Vytváření sestavení bylo zahájeno. - - - Der Buildvorgang wurde gestartet. - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Build started {0}. - Vytváření sestavení bylo zahájeno {0}. - - - Der Buildvorgang wurde am {0} gestartet. - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Building target "{0}" completely. - Probíhá vytváření úplného sestavení cíle {0}. - {0} is the name of the target. - - Das Ziel "{0}" wird vollständig erstellt. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - No input files were specified. - Nebyly zadány žádné vstupní soubory. - - - Es wurden keine Eingabedateien angegeben. - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Input file "{0}" is newer than output file "{1}". - Vstupní soubor {0} je novější než výstupní soubor {1}. - {0} and {1} are filenames on disk. - - Die Eingabedatei "{0}" ist neuer als die Ausgabedatei "{1}". - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - Output file "{0}" does not exist. - Výstupní soubor {0} neexistuje. - {0} is a filename on disk. - - Die Ausgabedatei "{0}" ist nicht vorhanden. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Input file "{0}" does not exist. - Vstupní soubor {0} neexistuje. - {0} is a filename on disk. - - Die Eingabedatei "{0}" ist nicht vorhanden. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Building target "{0}" partially, because some output files are out of date with respect to their input files. - Probíhá částečné vytváření cíle {0}, protože některé výstupní soubory nejsou aktuální vzhledem k jejich vstupním souborům. - {0} is the name of the target. - - Das Ziel "{0}" wird teilweise erstellt, da einige Ausgabedateien hinsichtlich ihrer Eingabedateien veraltet sind. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - [{0}: Input={1}, Output={2}] Input file is newer than output file. - [{0}: Vstup={1}, Výstup={2}] Vstupní soubor je novější než výstupní soubor. - {0} is the name of an MSBuild item. {1} and {2} are filenames on disk. - - [{0}: Eingabe={1}, Ausgabe={2}] Die Eingabedatei ist neuer als die Ausgabedatei. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - [{0}: Input={1}, Output={2}] Output file does not exist. - [{0}: Vstup={1}, Výstup={2}] Výstupní soubor neexistuje. - {0} is the name of an MSBuild item. {1} and {2} are filenames on disk. - - [{0}: Eingabe={1}, Ausgabe={2}] Die Ausgabedatei ist nicht vorhanden. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - [{0}: Input={1}, Output={2}] Input file does not exist. - [{0}: Vstup={1}, Výstup={2}] Vstupní soubor neexistuje. - {0} is the name of an MSBuild item. {1} and {2} are filenames on disk. - - [{0}: Eingabe={1}, Ausgabe={2}] Die Eingabedatei ist nicht vorhanden. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - The attribute "{0}" is a known MSBuild attribute, and cannot be accessed using this method. - Atribut {0} je znám jako atribut nástroje MSBuild a nelze k němu získat přístup pomocí této metody. - - - Das {0}-Attribut ist ein bekanntes MSBuild-Attribut, auf das mithilfe dieser Methode nicht zugegriffen werden kann. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - Properties in persisted property groups cannot be accessed by name. - K vlastnostem v trvalých skupinách vlastností nelze přistupovat pomocí názvu. - - - Auf Eigenschaften in persistenten Eigenschaftengruppen ist kein Zugriff über den Namen möglich. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4023: Cannot evaluate the item metadata "%({0})". {1} - MSB4023: Nelze vyhodnotit metadata položky %({0}). {1} - {StrBegin="MSB4023: "}UE: This message is shown when the value of an item metadata cannot be computed for some reason e.g. trying to apply - %(RootDir) to an item-spec that's not a valid path, would result in this error. - LOCALIZATION: "{1}" is a localized message explaining the problem. - - MSB4023: Elementmetadaten "%({0})" können nicht ausgewertet werden. {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Cannot execute a task not associated with a project object. - Nelze provést úlohu, která není přidružena k objektu projektu. - - - Eine Aufgabe, die keinem Projektobjekt zugeordnet ist, kann nicht ausgeführt werden. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - The cache entry has already been set to a different value and cannot be modified. - Položka mezipaměti již byla nastavena na jinou hodnotu a nelze ji změnit. - - - Der Cacheeintrag wurde bereits auf einen anderen Wert festgelegt und kann nicht geändert werden. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - The "{0}" property comes from an environment variable, and cannot be modified. - Vlastnost {0} závisí na proměnné prostředí a nelze ji upravovat. - - - Die {0}-Eigenschaft stammt aus einer Umgebungsvariablen und kann nicht geändert werden. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - The "{0}" property is a global property, and cannot be modified through an evaluated property group. Use "{1}" instead. - Vlastnost {0} je globální vlastnost a nelze ji upravovat prostřednictvím vyhodnocené skupiny vlastností. Místo toho použijte {1}. - - - Die {0}-Eigenschaft ist eine globale Eigenschaft und kann nicht über eine ausgewertete Eigenschaftengruppe geändert werden. Verwenden Sie stattdessen {1}. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - Modifying the XML of an imported project file is not allowed. Open that project file directly. - Úpravy kódu XML importovaného souboru projektu nejsou povoleny. Otevřete tento soubor projektu přímo. - - - Der XML-Code einer importierten Projektdatei darf nicht geändert werden. Öffnen Sie diese Projektdatei direkt. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB4117: The "{0}" item name is reserved, and cannot be used. - MSB4117: Název položky {0} je vyhrazen a nelze ho použít. - {StrBegin="MSB4117: "}UE: This message is shown when the user tries to redefine one of the reserved MSBuild items e.g. @(Choose) - - MSB4117: Der Elementname "{0}" ist reserviert und kann nicht verwendet werden. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4118: The "{0}" item metadata name is reserved, and cannot be used. - MSB4118: Název metadat položky {0} je vyhrazen a nelze ho použít. - {StrBegin="MSB4118: "}UE: This message is shown when the user tries to redefine one of the reserved MSBuild items e.g. @(Choose) - - MSB4118: Der Elementmetadatenname "{0}" ist reserviert und kann nicht verwendet werden. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4004: The "{0}" property is reserved, and cannot be modified. - MSB4004: Vlastnost {0} je vyhrazena a nelze ji upravit. - {StrBegin="MSB4004: "}UE: This message is shown when the user tries to redefine one of the reserved MSBuild properties e.g. $(MSBuildProjectFile) - - MSB4004: Die {0}-Eigenschaft ist reserviert und kann nicht geändert werden. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4094: "{0}" is an invalid value for the "{1}" parameter of the "{3}" task. Multiple items cannot be passed into a parameter of type "{2}". - MSB4094: {0} je neplatná hodnota parametru {1} úlohy {3}. Parametru typu {2} nelze předat více položek. - {StrBegin="MSB4094: "} - UE: This error is shown when a project tries to pass multiple items into a task parameter of type ITaskItem (singular). - - - MSB4094: "{0}" ist ein ungültiger Wert für den "{1}"-Parameter der "{3}"-Aufgabe. Mehrere Elemente können nicht in einen Parameter vom Typ "{2}" übergeben werden. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4115: The "{0}" function only accepts a scalar value, but its argument "{1}" evaluates to "{2}" which is not a scalar value. - MSB4115: Pro funkci {0} lze zadat pouze skalární hodnoty. Hodnota jejího argumentu {1} však byla vyhodnocena jako {2}, což není skalární hodnota. - {StrBegin="MSB4115: "} - UE: This error is shown when a project tries to pass multiple items into a function in a conditional expression, that can only accept a scalar value (such as the "exists()" function). - - - MSB4115: Die "{0}"-Funktion nimmt nur einen Skalarwert an, ihr "{1}"-Argument wird jedoch zu "{2}" ausgewertet, bei dem es sich nicht um einen Skalarwert handelt. - - fuzzyMatch="100" wordcount="22" adjWordcount="5.5" curWordcount="5.5" tmLabel="N''" - - - The task is currently associated with a project object, and should not be added to a different one. - Úloha je nyní přidružena k objektu projektu a neměla by být přidána k jinému. - - - Die Aufgabe ist derzeit einem Projektobjekt zugeordnet und sollte zu keinem anderen Projektobjekt hinzugefügt werden. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - MSB4095: The item metadata %({0}) is being referenced without an item name. Specify the item name by using %(itemname.{0}). - MSB4095: Na metadata položky %({0}) se odkazuje bez názvu položky. Zadejte název položky ve formátu %(název_položky.{0}). - {StrBegin="MSB4095: "} - - MSB4095: Auf die %({0})-Elementmetadaten wird ohne einen Elementnamen verwiesen. Geben Sie den Namen mithilfe von %(itemname.{0}) an. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - The task is not associated with the specified target element collection, and should not be removed from it. - Úloha není přidružena k zadané kolekci elementu cíle a neměla by z ní být odebrána. - - - Die Aufgabe ist nicht der angegebenen Auflistung von Zielelementen zugeordnet und sollte nicht daraus entfernt werden. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - MSB4005: The current working directory could not be restored to {0}. {1} - MSB4005: Aktuální pracovní adresář nelze obnovit do umístění {0}. {1} - {StrBegin="MSB4005: "}UE: This message is shown when the current working directory cannot be reset after a build. "{1}" contains a message explaining why. - LOCALIZATION: "{1}" is a message from an CLR/FX exception and is already localized. - - MSB4005: Das aktuelle Arbeitsverzeichnis konnte unter {0} nicht wiederhergestellt werden. {1} - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Cannot set a condition on an object not represented by an XML element in the project file. - Nelze nastavit podmínku u objektu, který není reprezentován elementem XML v souboru projektu. - - - Eine Bedingung kann nicht für ein Objekt festgelegt werden, wenn das Objekt nicht von einem XML-Element in der Projektdatei repräsentiert wird. - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - Cannot set ContinueOnError on an object not represented by an XML element in the project file. - Nelze nastavit atribut ContinueOnError u objektu, který není reprezentován elementem XML v souboru projektu. - - - Das ContinueOnError-Attribut kann nicht für ein Objekt festgelegt werden, wenn das Objekt nicht von einem XML-Element in der Projektdatei repräsentiert wird. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB4134: DefaultToolsVersion cannot be set after a project has been loaded into the Engine. - MSB4134: Po načtení projektu do modulu nelze nastavit parametr DefaultToolsVersion. - {StrBegin="MSB4134: "} - - MSB4134: DefaultToolsVersion darf nicht festgelegt werden, nachdem ein Projekt in das Modul geladen wurde. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - Assigning the "{0}" attribute on an item that has been evaluated is not allowed. This operation is only allowed on the original persisted item that came directly from the project file. - Přiřazení atributu {0} u položky, která byla vyhodnocena, není povoleno. Tato operace je povolena pouze u původní trvalé položky, která pocházela přímo z projektového souboru. - - - Das {0}-Attribut darf nicht einem Element zugewiesen werden, das ausgewertet wurde. Dieser Vorgang ist nur für das ursprüngliche persistente Element zulässig, das direkt aus der Projektdatei stammt. - - fuzzyMatch="101" wordcount="31" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Assigning the "{0}" attribute of a virtual item is not allowed. - Přiřazení atributu {0} virtuální položky není povoleno. - - - Das Zuweisen des {0}-Attributs eines virtuellen Elements ist nicht zulässig. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - A property cannot be set while building. - Vlastnost nelze nastavovat při sestavování. - - - Eine Eigenschaft kann nicht während des Erstellens festgelegt werden. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - A property cannot be set to null. - Vlastnost nelze nastavit na hodnotu null. - - - Eine Eigenschaft kann nicht auf NULL festgelegt werden. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Cannot get or set parameters on a task not associated with a project object. - Nelze získat nebo nastavit parametry úlohy, která není přidružena k objektu projektu. - - - Parameter für eine Aufgabe können nicht abgefragt oder festgelegt werden, wenn die Aufgabe keinem Projektobjekt zugeordnet ist. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4162: <{0}> is not valid. Child elements are not allowed below a item remove element. - MSB4162: Element <{0}> není platný. Pod elementem odebrání položky nejsou povoleny podřízené elementy. - {StrBegin="MSB4162: "} - - MSB4162: <{0}> ist ungültig. Untergeordnete Elemente dürfen nicht unter einem Element Element entfernen. - - fuzzyMatch="15" wordcount="16" adjWordcount="13.6" curWordcount="13.6" - - - MSB4166: Child node "{0}" exited prematurely. Shutting down. - MSB4166: Podřízený uzel {0} skončil předčasně. Probíhá ukončení práce. - {StrBegin="MSB4166: "} - - MSB4166: Der untergeordnete Knoten "{0}" wurde vorzeitig beendet. Herunterfahren. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4085: A <Choose> must contain at least one <When>. - MSB4085: Element <Choose> musí obsahovat aspoň jeden element <When>. - {StrBegin="MSB4085: "} - - MSB4085: < auswählen > muss mindestens < Wenn >. - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB4114: <Choose> elements cannot be nested more than {0} levels deep. - MSB4114: Elementy <Choose> nemohou být vnořeny ve více než {0} úrovních. - {StrBegin="MSB4114: "}UE: This message appears if the project file contains unreasonably nested Choose elements. - LOCALIZATION: Do not localize "Choose" as it is an XML element name. - - MSB4114: < auswählen > Elemente können nicht geschachtelt werden mehr als {0} Ebenen. - - fuzzyMatch="15" wordcount="12" adjWordcount="10.2" curWordcount="10.2" - - - MSB4006: There is a circular dependency in the target dependency graph involving target "{0}". - MSB4006: Existuje cyklická závislost v grafu závislosti cílů zahrnující cíl {0}. - {StrBegin="MSB4006: "}UE: This message is shown when the build engine detects a target referenced in a circular manner -- a project cannot - request a target to build itself (perhaps via a chain of other targets). - - MSB4006: Im Zielabhängigkeitsdiagramm besteht eine Ringabhängigkeit im Zusammenhang mit dem Ziel "{0}". - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4086: A numeric comparison was attempted on "{1}" that evaluates to "{2}" instead of a number, in condition "{0}". - MSB4086: Byl proveden pokus o numerické porovnání pro {1} s vyhodnocenou nečíselnou hodnotou {2} v podmínce {0}. - {StrBegin="MSB4086: "} - - MSB4086: Es wurde versucht, einen numerischen Vergleich für "{1}" auszuführen, der zu "{2}" anstatt zu einer Zahl in Bedingung "{0}" ausgewertet wird. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4007: The clause "{0}", specified in the "{1}" attribute is invalid. - MSB4007: Klauzule {0} zadaná v atributu {1} je neplatná. - {StrBegin="MSB4007: "}UE: This message is shown when the Condition on an element is invalid in some way -- e.g. syntax error, unrecognized operator. - - MSB4007: Die im {1}-Attribut festgelegte {0}-Klausel ist ungültig. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4130: The condition "{0}" may have been evaluated incorrectly in an earlier version of MSBuild. Please verify that the order of the AND and OR clauses is written as intended. To avoid this warning, add parentheses to make the evaluation order explicit. - MSB4130: Je možné, že podmínka {0} byla ve starší verzi nástroje MSBuild vyhodnocována nesprávně. Zkontrolujte, zda pořadí klauzulí AND a OR odpovídá záměru. Chcete-li zabránit dalšímu zobrazování tohoto upozornění, přidejte do podmínky závorky, které explicitně určí pořadí vyhodnocování. - {StrBegin="MSB4130: "} - - MSB4130: Die Bedingung "{0}" ist in einer früheren Version von MSBuild möglicherweise fehlerhaft ausgewertet worden. Stellen Sie sicher, dass die AND- und OR-Klauseln in der beabsichtigten Reihenfolge stehen. Damit diese Warnung nicht angezeigt wird, fügen Sie Klammern hinzu, um die Auswertungsreihenfolge explizit anzugeben. - - fuzzyMatch="101" wordcount="42" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4087: Specified condition "{0}" does not evaluate to a boolean. - MSB4087: Zadaná podmínka {0} není vyhodnocena jako logická hodnota. - {StrBegin="MSB4087: "} - - MSB4087: Die angegebene {0}-Bedingung wird nicht zu einem booleschen Wert ausgewertet. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4113: Specified condition "{0}" evaluates to "{1}" instead of a boolean. - MSB4113: Zadaná podmínka {0} je vyhodnocena jako {1} místo jako logická hodnota. - {StrBegin="MSB4113: "} - - MSB4113: Die angegebene Bedingung {0} wird zu {1} statt zu einem booleschen Wert ausgewertet. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - {0}, line {1} - {0}, řádek {1} - - - {0}, Zeile {1} - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - MSB4136: Error reading the toolset information from the configuration file "{0}". {1} - MSB4136: Při čtení informací o sadě nástrojů z konfiguračního souboru {0} došlo k chybě. {1} - {StrBegin="MSB4136: "} - - MSB4136: Fehler beim Lesen der Toolsetinformationen aus der Konfigurationsdatei "{0}". {1} - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4008: A conflicting assembly for the task assembly "{0}" has been found at "{1}". - MSB4008: Bylo nalezeno konfliktní sestavení pro sestavení úlohy {0} v umístění {1}. - {StrBegin="MSB4008: "}UE: This message is shown when the type/class of a task cannot be resolved uniquely from a single assembly. - - MSB4008: Eine mit der Aufgabenassembly "{0}" in Konflikt stehende Assembly wurde in "{1}" gefunden. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4142: MSBuildToolsPath is not the same as MSBuildBinPath for the ToolsVersion "{0}" defined at "{1}". If both are present they must have the same value. - MSB4142: Hodnota MSBuildToolsPath není stejná jako hodnota MSBuildBinPath pro parametr ToolsVersion {0} definovaný v {1}. Pokud jsou přítomny oba parametry, musí mít stejnou hodnotu. - {StrBegin="MSB4142: "} - - MSB4142: MSBuildToolsPath ist nicht identisch mit MSBuildBinPath für die bei "{1}" definierte ToolsVersion {0}. Wenn beide Pfade vorhanden sind, müssen sie identische Werte haben. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4097: The element <{0}> beneath element <{1}> may not have a custom XML namespace. - MSB4097: Element <{0}> pod elementem <{1}> nemůže mít vlastní obor názvů XML. - {StrBegin="MSB4097: "} - - MSB4097: Das Element <{0}> unter Element <{1}> möglicherweise keinen benutzerdefinierten XML-Namespace. - - fuzzyMatch="15" wordcount="16" adjWordcount="13.6" curWordcount="13.6" - - - MSB4009: The default tasks file could not be successfully loaded. {0} - MSB4009: Výchozí soubor úloh nelze úspěšně načíst. {0} - {StrBegin="MSB4009: "}UE: This message is shown when one of the default tasks file (*.tasks) located alongside the MSBuild binaries cannot - be opened/parsed. "{0}" contains a message explaining why. The filename itself is not part of the message but is provided - separately to loggers. - LOCALIZATION: "{0}" is a message from some FX method and is already localized. - - MSB4009: Die Standardaufgabendatei konnte nicht geladen werden. {0} - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4010: The "{0}" files could not be successfully loaded from their expected location "{1}". Default tasks will not be available. {2} - MSB4010: Soubory {0} nelze úspěšně načíst z očekávaného umístění {1}. Výchozí úlohy nebudou k dispozici. {2} - {StrBegin="MSB4010: "}UE: This message is shown when the default tasks files that are located alongside the MSBuild binaries cannot be - found, either because they don't exist, or because of lack of permissions. "{2}" contains a message explaining why. - LOCALIZATION: "{2}" is a message from some FX method and is already localized. - - MSB4010: Die {0}-Dateien konnten nicht vom erwarteten Speicherplatz "{1}" geladen werden. Standardaufgaben sind nicht verfügbar. {2} - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - MSB4140: Default tools version is specified in neither the registry nor the configuration file. - MSB4140: V registru ani v konfiguračním souboru není určena výchozí verze nástrojů. - {StrBegin="MSB4140: "} - - MSB4140: Die Standardtoolsversion ist weder in der Registrierung noch in der Konfigurationsdatei angegeben. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4133: A default tools version "{0}" was specified, but its definition could not be found. - MSB4133: Byla určena výchozí verze nástrojů {0}, nepodařilo se však najít její definici. - {StrBegin="MSB4133: "} - - MSB4133: Eine Standardtoolsversion "{0}" wurde angegeben, aber ihre Definition konnte nicht gefunden werden. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - MSB4080: The value "{0}" of the "PropertyName" attribute in element <Output> contains a "$" character. If you intended to use a property name then remove the $( ) around the property name. - MSB4080: Hodnota {0} atributu PropertyName v elementu <Output> obsahuje znak $. Pokud jste chtěli použít název vlastnosti, odeberte znaky $( ) kolem názvu vlastnosti. - {StrBegin="MSB4080: "}UE: This message is shown when an output tag has an property name that contains an $. They probably typed $(foo) instead of foo in the PropertyName. LOCALIZATION: Output and PropertyName should not be localized. - - MSB4080: Der Wert "{0}" "PropertyName-Attribut im Element < Output >"$"-Zeichen enthält. Wenn Sie auf einen Eigenschaftennamen verwenden und entfernen Sie anschließend die ($), um den Eigenschaftennamen. - - fuzzyMatch="15" wordcount="32" adjWordcount="27.2" curWordcount="27.2" - - - MSB4011: There is a circular reference involving the import of file "{0}". This file may have been imported more than once, or you may have attempted to import the main project file. All except the first instance of this file will be ignored. - MSB4011: Existuje cyklická závislost týkající se importu souboru {0}. Je možné, že byl tento soubor naimportován více než jednou nebo že jste se pokusili naimportovat hlavní soubor projektu. Kromě první instance budou všechny ostatní instance tohoto souboru ignorovány. - {StrBegin="MSB4011: "} - - MSB4011: Es besteht eine Ringabhängigkeit im Zusammenhang mit dem Import der Datei {0}. Diese Datei wurde unter Umständen mehrmals importiert, oder es wurde versucht, die Hauptprojektdatei zu importieren. Alle außer der ersten Instanz dieser Datei werden ignoriert. - - fuzzyMatch="101" wordcount="43" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4079: The <ProjectExtensions> element occurs more than once. - MSB4079: Element <ProjectExtensions> se vyskytuje více než jednou. - {StrBegin="MSB4079: "} - - MSB4079: Das Element < ProjectExtensions > tritt mehr als einmal. - - fuzzyMatch="15" wordcount="9" adjWordcount="7.65" curWordcount="7.65" - - - MSB4012: The expression "{0}" cannot be used in this context. Item lists cannot be concatenated with other strings where an item list is expected. Use a semicolon to separate multiple item lists. - MSB4012: Výraz {0} nelze v tomto kontextu použít. Seznamy položek nelze řetězit s dalšími řetězci tam, kde se očekává seznam položek. K oddělení více seznamů položek použijte středník. - {StrBegin="MSB4012: "}UE: This message is shown when the user does not properly specify an item list when an item list is expected - e.g. "badprefix@(foo)badsuffix" instead of "prefix; @(foo); suffix" - - MSB4012: Der Ausdruck {0} kann in diesem Kontext nicht verwendet werden. Elementlisten können nicht mit anderen Zeichenfolgen verkettet werden, wenn eine Elementliste erwartet wird. Verwenden Sie ein Semikolon, um mehrere Elementlisten voneinander zu trennen. - - fuzzyMatch="101" wordcount="32" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Need to specify the project file name. - Je třeba zadat název souboru projektu. - UE: This message is shown when the user calls into the engine to build a project without specifying a filename. - - Geben Sie den Projektdateinamen an. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - end of input - konec vstupu - This is the name of the "EndOfInput" token. It is displayed in quotes as the - unexpected char or token when the end of a conditional was unexpectedly reached. - - Ende der Eingabe - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - The previous error was converted to a warning because the task was called with ContinueOnError=true. - Předchozí chyba byla převedena na upozornění, protože úloha byla volána s hodnotou ContinueOnError=true. - - - Der vorherige Fehler wurde in eine Warnung umgewandelt, da die Aufgabe mit ContinueOnError=true aufgerufen wurde. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - {0} Error(s) - Počet chyb: {0} - - - {0} Fehler - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4159: Error creating the toolset "{0}". {1} - MSB4159: Chyba při vytvoření sady nástrojů {0}. {1} - {StrBegin="MSB4159: "} - - MSB4159: Fehler beim Erstellen des Toolsets "{0}". {1} - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4146: Cannot evaluate the property expression "{0}" found at "{1}". {2} - MSB4146: Nelze vyhodnotit výraz vlastnosti {0} nalezený v {1}. {2} - {StrBegin="MSB4146: "} - - MSB4146: Der bei "{1}" gefundene Eigenschaftsausdruck "{0}" kann nicht ausgewertet werden. {2} - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - The <{0}> tag is no longer supported as a child of the <Project> element. Place this tag within a target, and add the name of the target to the "InitialTargets" attribute of the <Project> element. - Značka <{0}> již není podporována jako podřízený element elementu <Project>. Umístěte tuto značku v rámci cíle a přidejte název cíle do atributu InitialTargets elementu <Project>. - - - Das <{0}>-Tag nicht als untergeordnetes Element des < Project >-Elements unterstützt. Platzieren Sie dieses Tag in einem Ziel und fügen Sie den Namen des Ziels InitialTargets-Attribut des < Project >-Elements hinzu. - - fuzzyMatch="15" wordcount="38" adjWordcount="32.3" curWordcount="32.3" - - - MSB4100: Expected "{0}" to evaluate to a boolean instead of "{1}", in condition "{2}". - MSB4100: Bylo očekáváno, že {0} bude v podmínce {2} vyhodnoceno jako logická hodnota místo hodnoty {1}. - {StrBegin="MSB4100: "} - - MSB4100: Das Ergebnis der Auswertung von {0} war {1}, es wurde jedoch ein boolescher Wert in der {2}-Bedingung erwartet. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4028: The "{0}" task's outputs could not be retrieved from the "{1}" parameter. {2} - MSB4028: Výstupy úlohy {0} nebylo možné z parametru {1} načíst. {2} - {StrBegin="MSB4028: "} - - MSB4028: Die Ausgaben der {0}-Aufgabe konnten nicht aus dem {1}-Parameter abgerufen werden. {2} - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4014: The build was aborted because of an internal failure. - MSB4014: Sestavování bylo přerušeno z důvodu interní chyby. - {StrBegin="MSB4014: "}UE: This message is shown when an unhandled exception terminates the build. The cause is most likely a programming - error in the build engine. - - MSB4014: Das Erstellen wurde aufgrund eines internen Fehlers abgebrochen. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4015: The build was aborted because the "{0}" logger failed unexpectedly during shutdown. - MSB4015: Sestavování bylo přerušeno, protože během ukončování došlo neočekávaně k chybě protokolovacího nástroje {0}. - {StrBegin="MSB4015: "}UE: This message is used for a special exception that is thrown when a logger fails while shutting down (most likely - because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a special - exception to abort the build. - - MSB4015: Das Erstellen wurde abgebrochen, da für die {0}-Protokollierung beim Herunterfahren ein unerwarteter Fehler aufgetreten ist. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4016: The build was aborted because the "{0}" logger failed unexpectedly during initialization. - MSB4016: Sestavování bylo přerušeno, protože během inicializace došlo neočekávaně k chybě protokolovacího nástroje {0}. - {StrBegin="MSB4016: "}UE: This message is used for a special exception that is thrown when a logger fails while initializing itself (most - likely because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a - special exception to abort the build. - - MSB4016: Das Erstellen wurde abgebrochen, da für die {0}-Protokollierung bei der Initialisierung ein unerwarteter Fehler aufgetreten ist. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4017: The build was aborted because of an unexpected logger failure. - MSB4017: Sestavování bylo přerušeno z důvodu neočekávané chyby protokolovacího nástroje. - {StrBegin="MSB4017: "}UE: This message is used for a special exception that is thrown when a logger fails while logging an event (most - likely because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a - special exception to abort the build. - - MSB4017: Das Erstellen wurde wegen eines unerwarteten Protokollierungsfehlers abgebrochen. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4018: The "{0}" task failed unexpectedly. - MSB4018: Došlo k neočekávané chybě úlohy {0}. - {StrBegin="MSB4018: "}UE: This message is shown when a task terminates because of an unhandled exception. The cause is most likely a - programming error in the task; however, it is also possible that the unhandled exception originated in the engine, and was - surfaced through the task when the task called into the engine. - - MSB4018: Unerwarteter Fehler bei der {0}-Aufgabe. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4165: Failed to receive a response from the child node "{0}" in the timeout period "{1}" ms. Shutting down. - MSB4165: Nepodařilo se přijmout odezvu z podřízeného uzlu {0} v časovém limitu {1} ms. Probíhá ukončení práce. - {StrBegin="MSB4165: "} - - MSB4165: Vom untergeordneten Knoten "{0}" wurde innerhalb des Zeitlimits von "{1}" ms keine Antwort empfangen. Herunterfahren. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4088: Condition "{0}" is improperly constructed. - MSB4088: Podmínka {0} není vytvořena správně. - {StrBegin="MSB4088: "} - - MSB4088: Die {0}-Bedingung ist falsch konstruiert. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4105: Found an unexpected character '{2}' at position {1} in condition "{0}". Did you intend to use "=="? - MSB4105: Byl nalezen neočekávaný znak {2} na pozici {1} v podmínce {0}. Nechtěli jste použít znaky ==? - {StrBegin="MSB4105: "} - - MSB4105: Ein unerwartetes Zeichen {2} wurde an Position {1} in der {0}-Bedingung gefunden. Wollten Sie "==" verwenden? - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - MSB4106: Expected an item list at position {1} in condition "{0}". Did you forget the closing parenthesis? - MSB4106: Na pozici {1} v podmínce {0} byl očekáván seznam položek. Nezapomněli jste zadat pravou závorku? - {StrBegin="MSB4106: "} - - MSB4106: Eine Elementliste wurde an Position {1} in Bedingung {0} erwartet. Haben Sie die schließende Klammer vergessen? - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - MSB4107: Expected an item list at position {1} in condition "{0}". Did you forget the opening parenthesis after the '@'? To use a literal '@', use '%40' instead. - MSB4107: Na pozici {1} v podmínce {0} byl očekáván seznam položek. Nezapomněli jste zadat levou závorku za znak @? Chcete-li použít literál @, použijte místo toho znak %40. - {StrBegin="MSB4107: "} - - MSB4107: Eine Elementliste wurde an Position {1} in Bedingung {0} erwartet. Haben Sie die öffnende Klammer hinter dem Zeichen "@" vergessen? Wenn Sie ein literales "@" verwenden möchten, geben Sie "%40" ein. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4108: Expected an item list at position {1} in condition "{0}". Did you forget to close a quote inside the item list expression? - MSB4108: Na pozici {1} v podmínce {0} byl očekáván seznam položek. Nezapomněli jste zadat pravé uvozovky uvnitř výrazu seznamu položek? - {StrBegin="MSB4108: "} - - MSB4108: Eine Elementliste wurde an Position {1} in Bedingung {0} erwartet. Haben Sie das schließende Anführungszeichen innerhalb des Elementlistenausdrucks vergessen? - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - MSB4109: Expected a property at position {1} in condition "{0}". Did you forget the closing parenthesis? - MSB4109: Na pozici {1} v podmínce {0} byla očekávána vlastnost. Nezapomněli jste zadat pravou závorku? - {StrBegin="MSB4109: "} - - MSB4109: Eine Eigenschaft wurde an Position {1} in Bedingung {0} erwartet. Haben Sie die schließende Klammer vergessen? - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB4110: Expected a property at position {1} in condition "{0}". Did you forget the opening parenthesis after the '$'? To use a literal '$', use '%24' instead. - MSB4110: Na pozici {1} v podmínce {0} byla očekávána vlastnost. Nezapomněli jste zadat levou závorku za znak $? Chcete-li použít literál $, použijte místo toho znak %24. - {StrBegin="MSB4110: "} - - MSB4110: Eine Eigenschaft wurde an Position {1} in Bedingung {0} erwartet. Haben Sie die öffnende Klammer hinter dem Zeichen "$" vergessen? Wenn Sie eine literales "$" verwenden möchten, geben Sie "%24" ein. - - fuzzyMatch="101" wordcount="27" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4101: Expected a closing quote after position {1} in condition "{0}". - MSB4101: Na pozici {1} v podmínce {0} byla očekávána pravá uvozovka. - {StrBegin="MSB4101: "} - - MSB4101: Es wurde ein schließendes Anführungszeichen hinter Position {1} in Bedingung {0} erwartet. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4019: The imported project "{0}" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. - MSB4019: Naimportovaný projekt {0} nebyl nalezen. Zkontrolujte, zda je cesta v deklaraci <Import> správná a zda soubor na disku existuje. - {StrBegin="MSB4019: "}LOCALIZATION: <Import> should not be localized. - - MSB4019: Das importierte Projekt "{0}" wurde nicht gefunden. Bestätigen Sie den Pfad in der Deklaration < Import > und die Datei auf dem Datenträger vorhanden ist. - - fuzzyMatch="15" wordcount="26" adjWordcount="22.1" curWordcount="22.1" - - - MSB4089: Incorrect number of arguments to function in condition "{0}". Found {1} argument(s) when expecting {2}. - MSB4089: Počet argumentů pro funkci v podmínce {0} není správný. Nalezený počet argumentů: {1}, očekávaný počet: {2}. - {StrBegin="MSB4089: "} - - MSB4089: Falsche Anzahl von Argumenten für eine Funktion in der Bedingung "{0}". {1} Argument(e) gefunden, obwohl {2} erwartet wurde(n). - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - The "{0}" object specified does not belong to the correct "{1}" object. - Zadaný objekt {0} nepatří ke správnému objektu {1}. - - - Das angegebene {0}-Objekt gehört nicht zum korrekten {1}-Objekt. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4020: The value "{0}" of the "{1}" attribute in element <{2}> is invalid. - MSB4020: Hodnota {0} atributu {1} v elementu <{2}> je neplatná. - {StrBegin="MSB4020: "}UE: This is a generic message that is displayed when we find a project element with an incorrect value for one of its - attributes e.g. <Import Project=""> -- the value of Project should not be an empty string. - - MSB4020: Der Wert "{0}" von der "{1}" Attribut im Element <{2}> ist ungültig. - - fuzzyMatch="15" wordcount="14" adjWordcount="11.9" curWordcount="11.9" - - - MSB4102: The value "{0}" of the "{1}" attribute in element <{2}> is invalid. {3} - MSB4102: Hodnota {0} atributu {1} v elementu <{2}> je neplatná. {3} - {StrBegin="MSB4102: "}UE: This is a generic message that is displayed when we find a project element with an incorrect value for one of its - attributes. At the end of the message we show the exception text we got trying to use the value. - - MSB4102: Der Wert "{0}" von der "{1}" Attribut im Element <{2}> ist ungültig. {3} - - fuzzyMatch="15" wordcount="15" adjWordcount="12.75" curWordcount="12.75" - - - MSB4021: The "ContinueOnError" attribute of the "{0}" task is not valid. {1} - MSB4021: Atribut ContinueOnError úlohy {0} je neplatný. {1} - {StrBegin="MSB4021: "}LOCALIZATION: "ContinueOnError" should not be localized. "{1}" is a message from another exception explaining the problem. - - MSB4021: Das ContinueOnError-Attribut für die {0}-Aufgabe ist ungültig. {1} - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4139: Invalid value for default ToolsVersion is specified in registry key "{0}". - MSB4139: V klíči registru {0} je uvedena neplatná hodnota výchozího parametru ToolsVersion. - {StrBegin="MSB4139: "} - - MSB4139: Im Registrierungsschlüssel "{0}" ist ein ungültiger Wert für die Standard-ToolsVersion angegeben. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4022: The result "{0}" of evaluating the value "{1}" of the "{2}" attribute in element <{3}> is not valid. - MSB4022: Výsledek {0} vyhodnocení hodnoty {1} atributu {2} v elementu <{3}> je neplatný. - {StrBegin="MSB4022: "}UE: This message is shown when the engine is checking the correctness of the value (after evaluating embedded - properties/items) assigned to an XML attribute of an XML element in the project file. - - MSB4022: Das Ergebnis "{0}"der Auswertung des Werts"{1}" von der "{2}" Attribut im Element <{3}> ist ungültig. - - fuzzyMatch="15" wordcount="20" adjWordcount="17" curWordcount="17" - - - "{0}" is not a valid event category. To raise a custom event, use the "{1}" category. - {0} je neplatná kategorie událostí. Chcete-li vyvolat vlastní událost, použijte kategorii {1}. - - - {0} ist keine gültige Ereigniskategorie. Verwenden Sie die {1}-Kategorie, um ein benutzerdefiniertes Ereignis auszulösen. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - "{0}" is not a valid importance level for events. - {0} není platná úroveň důležitosti pro události. - - - {0} ist kein gültiger Wert für die Bedeutung eines Ereignisses. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4104: Failed to write to log file "{0}". {1} - MSB4104: Nelze zapisovat do souboru protokolu {0}. {1} - {StrBegin="MSB4104: "}UE: This is shown when the File Logger can't create or write to the file it was instructed to log to. - - MSB4104: Fehler beim Schreiben in die Protokollierungsdatei "{0}". {1} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4024: The imported project file could not be loaded. {0} - MSB4024: Importovaný soubor projektu nelze načíst. {0} - {StrBegin="MSB4024: "}UE: This message is shown when an imported project file cannot be loaded because of incorrect XML. The project - filename is not part of the message because it is provided separately to loggers. - LOCALIZATION: {0} is a localized message from the CLR/FX explaining why the project is invalid. - - MSB4024: Die importierte Projektdatei konnte nicht geladen werden. {0} - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - Operation invalid for a persisted item group. - Operace není platná pro trvalou skupinu položek. - - - Ungültiger Vorgang für eine persistente Elementgruppe. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Operation invalid for a virtual item group. - Operace není platná pro virtuální skupinu položek. - - - Ungültiger Vorgang für eine virtuelle Elementgruppe. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4071: The value Importance="{0}" in the <Message> element is invalid. Valid values are: High, Normal and Low. - MSB4071: Hodnota Importance={0} v elementu <Message> je neplatná. Platné hodnoty: High, Normal a Low. - {StrBegin="MSB4071: "}UE: This message is shown when a user specifies a value for the importance attribute of Message which is not valid. - The importance enumeration is: High, Normal and Low. Specifying any other importance will result in this message being shown - LOCALIZATION: "Importance" should not be localized. - "Message" should not be localized. - High should not be localized. - Normal should not be localized. - Low should not be localized. - - MSB4071: Der Wert Importance = "{0}" in < Nachricht > Element ist ungültig. Gültige Werte sind: hoch, Normal und niedrig. - - fuzzyMatch="15" wordcount="18" adjWordcount="15.3" curWordcount="15.3" - - - MSB4025: The project file could not be loaded. {0} - MSB4025: Soubor projektu nelze načíst. {0} - {StrBegin="MSB4025: "}UE: This message is shown when the project file given to the engine cannot be loaded because the filename/path is - invalid, or due to lack of permissions, or incorrect XML. The project filename is not part of the message because it is - provided separately to loggers. - LOCALIZATION: {0} is a localized message from the CLR/FX explaining why the project is invalid. - - MSB4025: Die Projektdatei konnte nicht geladen werden. {0} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4147: The property "{0}" at "{1}" is invalid. {2} - MSB4147: Vlastnost {0} v {1} je neplatná. {2} - {StrBegin="MSB4147: "} - - MSB4147: Die {0}-Eigenschaft bei "{1}" ist ungültig. {2} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - "{0}" is an invalid "ProjectFileEncoding" value. - {0} je neplaná hodnota ProjectFileEncoding. - LOCALIZATION: "ProjectFileEncoding" should not be localized. - - {0} ist ein ungültiger ProjectFileEncoding-Wert. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4143: The expression "{0}" cannot be evaluated. {1} - MSB4143: Výraz {0} nelze vyhodnotit. {1} - {StrBegin="MSB4143: "} - UE: This message is shown when the user attempts to provide an expression like "$(Registry:HKEY_LOCAL_MACHINE\Software\Vendor\Tools@TaskLocation)" - LOCALIZATION: "{0}" is the expression that was bad. "{1}" is a message from an FX exception that describes why the expression is bad. - - - MSB4143: Der Ausdruck "{0}" kann nicht ausgewertet werden. {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4184: The expression "{0}" cannot be evaluated. {1} - MSB4184: Výraz {0} nelze vyhodnotit. {1} - {StrBegin="MSB4184: "} - Single quotes as the expression will typically have double quotes in it. - UE: This message is shown when the user attempts to provide an expression like "$(SomeProperty.ToLower())" - LOCALIZATION: "{0}" is the expression that was bad. "{1}" is a message from an FX exception that describes why the expression is bad. - - - MSB4184: Der Ausdruck "{0}" kann nicht ausgewertet werden. {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4185: The function "{0}" on type "{1}" has not been enabled for execution. - MSB4185: Nebylo povoleno spuštění funkce {0} na typu {1}. - {StrBegin="MSB4185: "} - UE: This message is shown when the user attempts to provide an expression like "$([System.DateTime]::Now)", but the expression has not been enabled - LOCALIZATION: "{0}" is the static function name, "{1}" is the .NET Framework type name - - - MSB4185: Die {0}-Funktion für den {1}-Typ wurde nicht für die Ausführung aktiviert. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4186: Invalid static method invocation syntax: "{0}". Static method invocation should be of the form: $([FullTypeName]::Method()), e.g. $([System.IO.Path]::Combine(`a`, `b`)) - MSB4186: Syntaxe volání statické metody je neplatná: {0}. Volání statické metody by mělo mít tento tvar: $([FullTypeName]::Metoda()), např. $([System.IO.Path]::Combine(`a`, `b`)) - {StrBegin="MSB4186: "} - UE: This message is shown when the user attempts to call a static method on a type, but has used the incorrect syntax - LOCALIZATION: "{0}" is the function expression which is in error - - - MSB4186: Ungültige Aufrufsyntax für statische Methode: "{0}". Für den Aufruf statischer Methoden muss folgendes Format verwendet werden: $([vollständiger Typname]::Methode()), z. B. $([System.IO.Path]::Combine(`a`, `b`)) - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4070: The schema "{0}" is not valid. {1} - MSB4070: Schéma {0} není platné. {1} - {StrBegin="MSB4070: "}UE: This message is shown when the schema file provided for the validation of a project is itself not valid. - LOCALIZATION: "{0}" is the schema file path. "{1}" is a message from an FX exception that describes why the schema file is bad. - - MSB4070: Das Schema "{0}" ist nicht gültig. {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4026: The "{0}={1}" parameter for the "{2}" task is invalid. - MSB4026: Parametr {0}={1} pro úlohu {2} je neplatný. - {StrBegin="MSB4026: "}UE: This message is displayed when a task has an invalid parameter that cannot be initialized. - - MSB4026: Der {0}={1}-Parameter für die {2}-Aufgabe ist ungültig. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4027: The "{0}" task generated invalid items from the "{1}" output parameter. {2} - MSB4027: Úloha {0} generovala neplatné položky z výstupního parametru {1}. {2} - {StrBegin="MSB4027: "} - - MSB4027: Die {0}-Aufgabe generierte ungültige Elemente aus dem {1}-Ausgabeparameter. {2} - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4029: The "{0}" task has an invalid output specification. The "TaskParameter" attribute is required, and either the "ItemName" or "PropertyName" attribute must be specified (but not both). - MSB4029: Úloha {0} má neplatnou výstupní specifikaci. Atribut TaskParameter je vyžadován a je nutné zadat buď atribut ItemName, nebo PropertyName (ale ne oba). - {StrBegin="MSB4029: "}LOCALIZATION: "TaskParameter", "ItemName" and "PropertyName" should not be localized. - - MSB4029: Die {0}-Aufgabe enthält eine ungültige Ausgabespezifikation. Das TaskParameter-Attribut ist erforderlich, und es muss entweder das ItemName- oder PropertyName-Attribut angegeben werden (jedoch nicht beide). - - fuzzyMatch="101" wordcount="27" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4030: "{0}" is an invalid value for the "{1}" parameter of the "{3}" task. The "{1}" parameter is of type "{2}". - MSB4030: {0} je neplatná hodnota parametru {1} úlohy {3}. Parametr {1} je typu {2}. - {StrBegin="MSB4030: "}UE: This error is shown when a type mis-match occurs between the value assigned to task parameter in the project file - and the type of the .NET property that corresponds to the task parameter. For example, if an int task parameter called "Count" - is assigned the value "x", this error would be displayed: <MyTask Count="x" /> - - MSB4030: "{0}" ist ein ungültiger Wert für den {1}-Parameter der {3}-Aufgabe. Der {1}-Parameter ist vom Typ "{2}". - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - MSB4137: Invalid value specified in the configuration file at "{0}". Property name or tools version name is an empty string. - MSB4137: V konfiguračním souboru na {0} byla zadána neplatná hodnota. Název vlastnosti nebo název verze nástrojů je prázdný řetězec. - {StrBegin="MSB4137: "} - - MSB4137: In der Konfigurationsdatei ist bei "{0}" ein ungültiger Wert angegeben. Der Eigenschaftenname oder der Toolsversionname ist eine leere Zeichenfolge. - - fuzzyMatch="100" wordcount="20" adjWordcount="5" curWordcount="5" tmLabel="N''" - - - MSB4103: "{0}" is not a valid logger verbosity level. - MSB4103: {0} není platná úroveň podrobností protokolovacího nástroje. - {StrBegin="MSB4103: "} - - MSB4103: "{0}" ist kein gültiger Ausführlichkeitsgrad für die Protokollierung. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4163: <ItemDefinitionGroup> is not allowed inside a target. - MSB4163: Uvnitř cíle není povolena položka <ItemDefinitionGroup>. - {StrBegin="MSB4163: "} - - MSB4163: < ItemDefinitionGroup > ist in einem Ziel nicht zulässig. - - fuzzyMatch="15" wordcount="9" adjWordcount="7.65" curWordcount="7.65" - - - The specified item does not belong to the current item group. - Zadaná položka nepatří do aktuální skupiny položek. - - - Das angegebene Element gehört nicht zu der aktuellen Elementgruppe. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4096: The item "{0}" in item list "{1}" does not define a value for metadata "{2}". In order to use this metadata, either qualify it by specifying %({1}.{2}), or ensure that all items in this list define a value for this metadata. - MSB4096: Položka {0} v seznamu položek {1} nedefinuje hodnotu pro metadata {2}. Chcete-li používat tato metadata, kvalifikujte je zadáním %({1}.{2}) nebo zajistěte, aby všechny položky v tomto seznamu definovaly hodnotu pro tato metadata. - {StrBegin="MSB4096: "} - - MSB4096: Das Element "{0}" in der Elementliste "{1}" definiert keinen Wert für die {2}-Metadaten. Wenn Sie diese Metadaten verwenden möchten, qualifizieren Sie sie, indem Sie %({1}.{2}) angeben, oder vergewissern Sie sich, dass alle Elemente in der Liste einen Wert für diese Metadaten definieren. - - fuzzyMatch="101" wordcount="42" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4099: A reference to an item list at position {1} is not allowed in this condition "{0}". - MSB4099: Odkaz na seznam položek na pozici {1} není v této podmínce {0} povolen. - {StrBegin="MSB4099: "} - - MSB4099: Ein Verweis auf eine Elementliste an Position {1} ist in dieser {0}-Bedingung nicht zulässig. - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - MSB4033: "{0}" is a reserved item metadata, and cannot be redefined as a custom metadata on the item. - MSB4033: {0} jsou rezervovaná metadata položky a nelze je předefinovat jako přizpůsobená metadata této položky. - {StrBegin="MSB4033: "} - - MSB4033: "{0}" sind reservierte Elementmetadaten und können nicht als benutzerdefinierte Metadaten für das Element neu definiert werden. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - An InternalLoggerException can only be thrown by the MSBuild engine. The public constructors of this class cannot be used to create an instance of the exception. - Výjimku InternalLoggerException může vyvolat pouze nástroj MSBuild. Veřejné konstruktory této třídy nelze používat k vytvoření instance výjimky. - UE: This message is shown when a user tries to instantiate a special exception called InternalLoggerException through the OM -- - only the engine is allowed to create and throw this exception. - LOCALIZATION: "InternalLoggerException" and "MSBuild" should not be localized. - - Eine InternalLoggerException kann nur durch das MSBuild-Modul ausgelöst werden. Die öffentlichen Konstruktoren dieser Klasse können nicht verwendet werden, um eine Instanz der Ausnahme zu erstellen. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Initial Items: - Počáteční položky: - - - Ursprüngliche Elemente: - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4083: Expected a Condition attribute on element "{0}". - MSB4083: Byl očekáván atribut Condition elementu {0}. - {StrBegin="MSB4083: "} - - MSB4083: Es wurde ein Bedingungsattribut für das {0}-Element erwartet. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4164: The value "{0}" of metadata "{1}" contains an item list expression. Item list expressions are not allowed on default metadata values. - MSB4164: Hodnota {0} metadat {1} obsahuje výraz seznamu položek. Ve výchozích hodnotách metadat nejsou výrazy seznamů položek povoleny. - {StrBegin="MSB4164: "} - - MSB4164: Der Wert "{0}" der {1}-Metadaten enthält einen Elementlistenausdruck. Elementlistenausdrücke sind nicht als Standardwerte für Metadaten zulässig. - - fuzzyMatch="100" wordcount="22" adjWordcount="5.5" curWordcount="5.5" tmLabel="N''" - - - MSBuild is expecting a valid "{0}" object. - Nástroj MSBuild očekává platný objekt {0}. - - - MSBuild erwartet ein gültiges {0}-Objekt. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4035: The required attribute "{0}" is missing from element <{1}>. - MSB4035: Nebyl nalezen požadovaný atribut {0} elementu <{1}>. - {StrBegin="MSB4035: "}UE: This message is shown when a user leaves off a required attribute from a project element - e.g. <UsingTask AssemblyName="foo"> -- this is missing the "TaskName" attribute. - - MSB4035: Das erforderliche Attribut "{0}"-Element fehlt <{1}>. - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB4036: The "{0}" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "{1}" directory. - MSB4036: Nebyla nalezena úloha {0}. Zkontrolujte, zda platí následující skutečnosti: 1.) Název úlohy v souboru projektu je stejný jako název třídy úloh. 2.) Třída úloh je veřejná (public) a implementuje rozhraní Microsoft.Build.Framework.ITask. 3.) Úloha je správně deklarována s elementem <UsingTask> v souboru projektu nebo v souborech *.tasks v adresáři {1}. - {StrBegin="MSB4036: "}LOCALIZATION: <UsingTask> and "*.tasks" should not be localized. - - MSB4036: Die "{0}" Task wurde nicht gefunden. Überprüfen Sie Folgendes: 1.) der Name der Aufgabe in der Projektdatei entspricht dem Namen der Aufgabenklasse. 2) die Aufgabenklasse ist "public" und implementiert die Microsoft.Build.Framework.ITask-Schnittstelle. 3) die Aufgabe korrekt mit < UsingTask > deklariert, in der Projektdatei oder in den Tasks-Dateien der "{1}" Verzeichnis. - - fuzzyMatch="15" wordcount="64" adjWordcount="54.4" curWordcount="54.4" - - - MSB4141: MSBuildToolsPath is not specified for the ToolsVersion "{0}" defined at "{1}", or the value specified evaluates to the empty string. - MSB4141: Pro verzi ToolsVersion {0} definovanou v {1} není zadán parametr MSBuildToolsPath nebo je výsledkem vyhodnocení zadané hodnoty prázdný řetězec. - {StrBegin="MSB4141: "} - - MSB4141: MSBuildToolsPath ist für die bei "{1}" definierte ToolsVersion {0} nicht angegeben, oder der angegebene Wert wird zu einer leeren Zeichenfolge ausgewertet. - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - MSB4031: The "MSBuildVersion" attribute is deprecated. If the project is authored in the MSBuild 2003 format, please remove the attribute from the <Project> tag. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format. - MSB4031: Atribut MSBuildVersion se již nepoužívá. Pokud je projekt vytvořen ve formátu MSBuild 2003, odeberte atribut ze značky <Project>. Jestliže byl projekt vytvořen ve starém formátu 1.0 nebo 1.2, převeďte jej na formát MSBuild 2003. - {StrBegin="MSB4031: "}UE: This message is shown for projects that still contain the "MSBuildVersion" attribute in their <Project> - tag. We no longer need this attribute because the project's XML namespace (i.e. the "xmlns" attribute) gives us all the - version information we need. - LOCALIZATION: "MSBuild", "MSBuildVersion" and <Project> should not be localized. - - MSB4031: Das Attribut "MSBuildVersion" ist veraltet. Wenn das Projekt im Format MSBuild 2003 erstellt wurde, entfernen Sie das Attribut aus dem Tag < Project >. Wenn das Projekt im alten Format 1.0 oder 1.2 erstellt wurde, konvertieren Sie es in das MSBuild 2003-Format. - - fuzzyMatch="15" wordcount="45" adjWordcount="38.25" curWordcount="38.25" - - - MSB4144: Multiple definitions were found for the toolset "{0}". - MSB4144: Bylo nalezeno více definicí sady nástrojů {0}. - {StrBegin="MSB4144: "} - - MSB4144: Für das Toolset wurden mehrere Definitionen gefunden "{0}". - - fuzzyMatch="15" wordcount="9" adjWordcount="7.65" curWordcount="7.65" - - - MSB4145: Multiple definitions were found for the property "{0}". - MSB4145: Bylo nalezeno více definicí vlastnosti {0}. - {StrBegin="MSB4145: "} - - MSB4145: Für die {0}-Eigenschaft wurden mehrere Definitionen gefunden. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4082: Choose has more than one <Otherwise> element. - MSB4082: Choose má více než jeden element <Otherwise>. - {StrBegin="MSB4082: "} - - MSB4082: Wählen Sie mehrere < Otherwise >-Element enthält. - - fuzzyMatch="15" wordcount="9" adjWordcount="7.65" curWordcount="7.65" - - - This method is only valid for persisted <{0}> elements. - Tato metoda je platná pouze pro trvalé elementy <{0}>. - - - Diese Methode ist nur gültig für beibehalten <{0}> Elemente. - - fuzzyMatch="15" wordcount="10" adjWordcount="8.5" curWordcount="8.5" - - - This method is only valid for virtual property groups, not <{0}> elements. - Tato metoda je platná pouze pro virtuální skupiny vlastností, nikoli pro elementy <{0}>. - - - Diese Methode gilt nur für virtuelle Eigenschaftengruppen nicht <{0}> Elemente. - - fuzzyMatch="15" wordcount="13" adjWordcount="11.05" curWordcount="11.05" - - - MSB4038: The element <{0}> must be last under element <{1}>. Found element <{2}> instead. - MSB4038: Element <{0}> musí být poslední pod elementem <{1}>. Místo něj byl nalezen element <{2}>. - {StrBegin="MSB4038: "} - - MSB4038: Das Element <{0}> muss unter Element <{1}>. Element wurde gefunden <{2}> statt. - - fuzzyMatch="15" wordcount="17" adjWordcount="14.45" curWordcount="14.45" - - - MSB4138: Non-string data was specified at the registry location "{0}". - MSB4138: V umístění registru {0} byla nalezena neřetězcová data. - {StrBegin="MSB4138: "} - - MSB4138: Am Registrierungsspeicherort "{0}" wurden Daten angegeben, die keine Zeichenfolge sind. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4039: No "{0}" element was found in the project file. - MSB4039: V tomto souboru projektu nebyl nalezen žádný element {0}. - {StrBegin="MSB4039: "} - - MSB4039: Das {0}-Element wurde in der Projektdatei nicht gefunden. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4040: There is no target in the project. - MSB4040: V projektu neexistuje žádný cíl. - {StrBegin="MSB4040: "} - - MSB4040: Das Projekt enthält kein Ziel. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Removing the "{0}" attribute of an item is not allowed. - Odebrání atributu {0} položky není povoleno. - - - Das Löschen des {0}-Attributs eines Elements ist nicht zulässig. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - The object passed in is not part of the project. - Předaný objekt není součástí projektu. - - - Das übergebene Objekt ist nicht Teil des Projekts. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - Overriding target "{0}" in project "{1}" with target "{2}" from project "{3}". - Probíhá přepisování cíle {0} v projektu {1} cílem {2} z projektu {3}. - - - Das Ziel "{0}" im Projekt "{1}" wird durch das Ziel "{2}" aus dem Projekt "{3}" außer Kraft gesetzt. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4167: The parent process unexpectedly exited. Shutting down child node "{0}". - MSB4167: Nadřazený proces neočekávaně skončil. Probíhá ukončení práce podřízeného uzlu {0}. - {StrBegin="MSB4167: "} - - MSB4167: Der übergeordnete Prozess wurde unerwartet beendet. Der untergeordnete Knoten "{0}" wird heruntergefahren. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - {0} ms {1} {2} calls - {0} ms {1} {2} volání - - - {0} ms {1} {2} Aufrufe - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - (* = timing was not recorded because of reentrancy) - (* = Časy nebyly zaznamenány kvůli vícenásobnému přístupu.) - - - (* = Zeit wurde aufgrund des erneuten Eintretens nicht aufgezeichnet) - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - This project object has been unloaded from the MSBuild engine and is no longer valid. - U tohoto objektu projektu bylo zrušeno načtení z nástroje MSBuild. Tento objekt již není platný. - - - Dieses Projektobjekt wurde aus dem MSBuild-Modul entladen und ist nicht mehr gültig. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - The project file "{0}" was not found. - Soubor projektu {0} nebyl nalezen. - UE: This message is shown when the user calls into the OM to build a project that doesn't exist on disk. - - Die Projektdatei "{0}" wurde nicht gefunden. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Done building project "{0}" -- FAILED. - Sestavení projektu {0} bylo dokončeno: CHYBA. - - - Die Erstellung des Projekts "{0}" ist abgeschlossen – FEHLER. - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Done building project "{0}". - Sestavení projektu {0} bylo dokončeno. - - - Die Erstellung des Projekts "{0}" ist abgeschlossen. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - MSB4041: The default XML namespace of the project must be the MSBuild XML namespace. If the project is authored in the MSBuild 2003 format, please add xmlns="{0}" to the <Project> element. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format. - MSB4041: Výchozí obor názvů XML projektu musí být oborem názvů XML nástroje MSBuild. Pokud je projekt vytvořen ve formátu MSBuild 2003, přidejte do elementu <Project> atribut xmlns="{0}". Jestliže byl projekt vytvořen ve starém formátu 1.0 nebo 1.2, převeďte jej na formát MSBuild 2003. - {StrBegin="MSB4041: "}UE: This is a Beta 1 message only. - LOCALIZATION: <Project>, "MSBuild" and "xmlns" should not be localized. - - MSB4041: Der XML-Standardnamespace des Projekts muss MSBuild XML-Namespace. Wenn das Projekt im Format MSBuild 2003 erstellt wurde, fügen Sie Xmlns = "{0}" < Project >-Element. Wenn das Projekt im alten Format 1.0 oder 1.2 erstellt wurde, konvertieren Sie es in das MSBuild 2003-Format. - - fuzzyMatch="15" wordcount="52" adjWordcount="44.2" curWordcount="44.2" - - - Project Performance Summary: - Souhrnné informace o výkonu projektu: - - - Leistungszusammenfassung für das Projekt: - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - MSB4042: Stopping because of syntax errors in project file. - MSB4042: Zpracování je zastaveno z důvodu chyb syntaxe v souboru projektu. - {StrBegin="MSB4042: "} - - MSB4042: Prozess aufgrund von Syntaxfehlern in der Projektdatei angehalten. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - Project "{0}" is building "{1}" ({2} target(s)): - Projekt {0} sestavuje {1} ({2} cíle): - - - Das Projekt {0} erstellt {1} ({2} Ziel(e)): - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Project "{0}" is building "{1}" (default targets): - Projekt {0} sestavuje {1} (výchozí cíle): - - - Das Projekt "{0}" erstellt "{1}" (Standardziele): - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Project "{0}" ({1} target(s)): - Projekt {0} ({1} cíle): - - - Projekt "{0}", {1} Ziel(e): - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - Project "{0}" (default targets): - Projekt {0} (výchozí cíle): - - - Projekt "{0}" (Standardziele): - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - Done Building Project "{0}" ({1} target(s)). - Sestavení projektu {0} (počet cílů: {1}) bylo dokončeno. - - - Die Erstellung von Projekt "{0}" ist abgeschlossen ({1} Ziel(e)). - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Done Building Project "{0}" (default targets). - Sestavení projektu {0} (s výchozími cíli) bylo dokončeno. - - - Die Erstellung von Projekt "{0}" ist abgeschlossen (Standardziele). - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Done Building Project "{0}" ({1} target(s)) -- FAILED. - Sestavení projektu {0} (počet cílů: {1}) bylo dokončeno: CHYBA. - - - Die Erstellung des Projekts "{0}" ist abgeschlossen, {1} Ziel(e) -- FEHLER. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Done Building Project "{0}" (default targets) -- FAILED. - Sestavení projektu {0} (s výchozími cíli) bylo dokončeno: CHYBA. - - - Die Erstellung von Projekt "{0}" ist abgeschlossen (Standardziele) -- FEHLER. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4075: The project file must be opened in the Visual Studio IDE and converted to the latest version before it can be built by MSBuild. - MSB4075: Soubor projektu musí být otevřen v prostředí Visual Studio IDE a převeden na nejnovější verzi. Teprve potom ho bude možné sestavit pomocí nástroje MSBuild. - {StrBegin="MSB4075: "} - - MSB4075: Die Projektdatei muss in der Visual Studio IDE geöffnet und in ein aktuelles Versionsformat gebracht werden, bevor sie mit MSBuild erstellt werden kann. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4192: The project file "{0}" is in the ".vcproj" file format, which MSBuild no longer supports. Please convert the project by opening it in the Visual Studio IDE or running the conversion tool, or use MSBuild 3.5 or earlier to build it. - MSB4192: Soubor projektu {0} má formát VCPROJ, který již nástroj MSBuild nepodporuje. Proveďte převod projektu – otevřete projekt v prostředí IDE aplikace Visual Studio nebo spusťte nástroj pro převod. Projekt můžete sestavit také pomocí nástroje MSBuild verze 3.5 nebo starší. - {StrBegin="MSB4192: "} LOC: ".vcproj" should not be localized - - MSB4192: Die Projektdatei "{0}" ist im VSPROJ-Dateiformat gespeichert, das nicht mehr von MSBuild unterstützt wird. Konvertieren Sie das Projekt, indem Sie es in der Visual Studio IDE öffnen oder das Konvertierungstool ausführen, oder verwenden Sie MSBuild 3.5 oder früher zum Erstellen des Projekts. - - fuzzyMatch="101" wordcount="42" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - The specified property does not belong to the current property group. - Zadaná vlastnost nepatří do aktuální skupiny vlastností. - - - Die angegebene Eigenschaft gehört nicht zu der aktuellen Eigenschaftengruppe. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - Initial Properties: - Počáteční vlastnosti: - - - Ursprüngliche Eigenschaften: - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4148: The name of a property stored under the registry key "{0}" has zero length. - MSB4148: Název vlastnosti uložený v klíči registru {0} má nulovou délku. - {StrBegin="MSB4148: "} - - MSB4148: Der Name einer unter dem Registrierungsschlüssel "{0}" gespeicherten Eigenschaft hat eine Länge von Null. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - The property names in the indexer and the "{0}" object do not match. - Názvy vlastností v indexovacím členu a objektu {0} se neshodují. - - - Die Eigenschaftennamen im Indexer und das {0}-Objekt stimmen nicht überein. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4043: The item metadata reference "{0}" is invalid because it is qualified with an item name. Item metadata referenced in transforms do not need to be qualified, because the item name is automatically deduced from the items being transformed. Change "{0}" to "%({1})". - MSB4043: Odkaz na položku metadat {0} je neplatný, protože je kvalifikován pomocí názvu položky. Metadata položek, na která odkazují transformace, nemusí být kvalifikovaná, protože název položky se automaticky odvozuje od převáděných položek. Změňte odkaz {0} na %({1}). - {StrBegin="MSB4043: "}UE: This message is shown when the user does something like this: @(foo->'%(foo.metadata)'). There is no need to specify - "foo.metadata", because "foo" is automatically deduced. In corollary, "bar.metadata" is not allowed either, where "bar" is a different - item list type. - - MSB4043: Der Elementmetadatenverweis "{0}" ist ungültig, da er mit einem Elementnamen qualifiziert ist. Elementmetadaten, auf die bei Transformationen verwiesen wird, müssen nicht qualifiziert werden, da der Elementname automatisch aus den transformierten Elementen abgeleitet wird. Ändern Sie "{0}" in "%({1})". - - fuzzyMatch="101" wordcount="43" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4135: Error reading the toolset information from the registry location "{0}". {1} - MSB4135: Chyba při čtení informací o sadě nástrojů z umístění registru {0}. {1} - {StrBegin="MSB4135: "} - - MSB4135: Fehler beim Lesen der Toolsetinformationen am Registrierungsspeicherort "{0}". {1} - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4044: The "{0}" task was not given a value for the required parameter "{1}". - MSB4044: Pro úlohu {0} nebyla zadána hodnota požadovaného parametru {1}. - {StrBegin="MSB4044: "}UE: This message is shown when a task parameter designated as "required" is not set in the project file. - - MSB4044: Die {0}-Aufgabe hat keinen Wert für den erforderlichen {1}-Parameter erhalten. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - Validating project using schema file "{0}". - Probíhá ověřování projektu pomocí souboru schématu {0}. - LOCALIZATION: "{0}" is the location of the schema file. - - Das Projekt wird anhand der Schemadatei "{0}" überprüft. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4045: Project is not valid. {0} - MSB4045: Projekt je neplatný. {0} - {StrBegin="MSB4045: "}UE: This error is shown when the user asks his project to be validated against a schema (/val switch for - MSBuild.exe), and the project has errors. "{0}" contains a message explaining the problem. - LOCALIZATION: "{0}" is a message from the System.XML schema validator and is already localized. - - MSB4045: Ungültiges Projekt. {0} - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4112: The targets in this project have been disabled by the host and therefore cannot be built at this time. This may have been done for security reasons. To enable the targets, the host must set Project.BuildEnabled to "true". - MSB4112: Cíle v tomto projektu byly zakázány hostitelem, a proto je nelze nyní sestavit. Důvodem může být zabezpečení. Chcete-li cíle povolit, hostitel musí nastavit vlastnost Project.BuildEnabled na hodnotu true. - {StrBegin="MSB4112: "} - - MSB4112: Die Ziele in diesem Projekt wurden vom Host deaktiviert und können aus diesem Grund derzeit nicht erstellt werden. Die Deaktivierung wurde wahrscheinlich aus Sicherheitsgründen durchgeführt. Wenn Sie die Ziele aktivieren möchten, muss der Host Project.BuildEnabled auf "true" festlegen. - - fuzzyMatch="101" wordcount="39" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4093: The "{0}" parameter of the "{1}" task cannot be written to because it does not have a "set" accessor. - MSB4093: Do parametru {0} úlohy {1} nelze zapisovat, protože nemá přístupovou metodu set. - {StrBegin="MSB4093: "}UE: This error is shown when a project tries to assign a value to a task parameter that does not have a "set" - accessor on the corresponding .NET property on the task class. - - MSB4093: In den {0}-Parameter der {1}-Aufgabe kann nicht geschrieben werden, da er keinen set-Accessor besitzt. - - fuzzyMatch="100" wordcount="20" adjWordcount="5" curWordcount="5" tmLabel="N''" - - - A shallow clone of this object cannot be created. - Nelze vytvořit mělký klon tohoto objektu. - - - Ein unechter Klon dieses Objekts kann nicht erstellt werden. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - Skipping target "{0}" because it has no inputs. - Cíl {0} bude vynechán, protože nemá žádné vstupy. - - - Das {0}-Ziel wird übersprungen, da es keine Eingaben besitzt. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Though the target has declared its inputs, the input specification only references empty properties and/or empty item lists. - Přestože jsou vstupy cíle deklarovány, odkazuje specifikace vstupů pouze na prázdné vlastnosti nebo na prázdné seznamy položek. - - - Obwohl das Ziel seine Eingaben deklariert hat, verweist die Eingabespezifikation nur auf leere Eigenschaften und/oder leere Elementlisten. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - Skipping target "{0}" because it has no outputs. - Cíl {0} bude vynechán, protože nemá žádné výstupy. - - - Das Ziel "{0}" wird übersprungen, da es keine Ausgaben enthält. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Though the target has declared its outputs, the output specification only references empty properties and/or empty item lists. - Přestože jsou výstupy cíle deklarovány, odkazuje specifikace výstupů pouze na prázdné vlastnosti nebo na prázdné seznamy položek. - - - Obwohl das Ziel seine Ausgaben deklariert hat, verweist die Ausgabespezifikation nur auf leere Eigenschaften und/oder leere Elementlisten. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - Skipping target "{0}" because all output files are up-to-date with respect to the input files. - Cíl {0} bude vynechán, protože všechny výstupní soubory jsou aktuální vzhledem ke vstupním souborům. - - - Das Ziel "{0}" wird übersprungen, da alle Ausgabedateien hinsichtlich der Eingabedateien aktuell sind. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - Input files: {0} - Vstupní soubory: {0} - {0} is a semicolon-separated list of filenames. - - Eingabedateien: {0} - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Output files: {0} - Výstupní soubory: {0} - {0} is a semicolon-separated list of filenames. - - Ausgabedateien: {0} - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Building solution configuration "{0}". - Probíhá vytváření konfigurace řešení {0}. - UE: This is not an error, so doesn't need an error code. - - Die Projektmappenkonfiguration "{0}" wird erstellt. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - Using solution cache file "{0}" for configuration "{1}" and tools version "{2}". - Je použit soubor mezipaměti řešení {0} pro konfiguraci {1} a verzi nástrojů {2}. - UE: This is not an error, so doesn't need an error code. - - Die Projektmappen-Cachedatei "{0}" wird für die Konfiguration "{1}" und die Toolsversion "{2}" verwendet. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Failed to read solution cache file "{0}". {1} Using solution file directly. - Nepodařilo se načíst soubor mezipaměti řešení {0}. {1} Bude použit přímo soubor řešení. - UE: This is not a true error, so doesn't need an error code. - - Fehler beim Lesen der Projektmappen-Cachedatei "{0}". {1} Projektmappendatei wird direkt verwendet. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Failed to write solution cache file "{0}". {1} - Nepodařilo se zapsat soubor mezipaměti řešení {0}. {1} - UE: This is not a true error, so doesn't need an error code. - - Fehler beim Schreiben der Projektmappen-Cachedatei "{0}". {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Solution cache file was created for a "{0}" value of "{1}" but the current value is "{2}". Refreshing cache file. - Soubor mezipaměti řešení byl vytvořen pro hodnotu {0} = {1}, aktuální hodnota je však {2}. Probíhá aktualizace souboru mezipaměti. - UE: This is not an error, so doesn't need an error code. - - Die Projektmappen-Cachedatei wurde für den {0}-Wert "{1}" erstellt, aber der aktuelle Wert ist "{2}". Cachedatei wird aktualisiert. - - fuzzyMatch="100" wordcount="20" adjWordcount="5" curWordcount="5" tmLabel="N''" - - - Solution cache file has an internal version number "{0}" but the current value is "{1}". Refreshing cache file. - Interní číslo verze souboru mezipaměti řešení je {0}, aktuální hodnota je však {1}. Probíhá aktualizace souboru mezipaměti. - UE: This is not an error, so doesn't need an error code. - - Die Projektmappen-Cachedatei hat die interne Versionsnummer "{0}", der aktuelle Wert ist aber "{1}". Cachedatei wird aktualisiert. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - Solution cache file is out of date. Refreshing cache file. {0} - Soubor mezipaměti řešení je neaktuální. Probíhá aktualizace souboru mezipaměti. {0} - UE: This is not an error, so doesn't need an error code. - - Die Projektmappen-Cachedatei ist veraltet. Cachedatei wird aktualisiert. {0} - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4160: A circular dependency involving project "{0}" has been detected. - MSB4160: Byla zjištěna cyklická závislost zahrnující projekt {0}. - {StrBegin="MSB4160: "} - - MSB4160: Eine Ringabhängigkeit im Zusammenhang mit dem Projekt "{0}" wurde erkannt. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4126: The specified solution configuration "{0}" is invalid. Please specify a valid solution configuration using the Configuration and Platform properties (e.g. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU") or leave those properties blank to use the default solution configuration. - MSB4126: Zadaná konfigurace řešení {0} je neplatná. Zadejte platnou konfiguraci řešení pomocí vlastností Configuration a Platform (například MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Libovolný procesor"). Pokud chcete použít výchozí konfiguraci řešení, nechejte tyto vlastnosti prázdné. - {StrBegin="MSB4126: "}UE: The solution filename is provided separately to loggers. - - MSB4126: Die angegebene Projektmappenkonfiguration "{0}" ist ungültig. Geben Sie mithilfe der Konfigurations- und Plattformeigenschaften eine gültige Projektmappenkonfiguration an (z. B. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU"), oder lassen Sie diese Eigenschaften leer, sodass die Standardprojektmappenkonfiguration verwendet wird. - - fuzzyMatch="101" wordcount="37" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4046: Error reading project file "{0}": {1} - MSB4046: Při čtení souboru projektu {0} došlo k chybě: {1} - {StrBegin="MSB4046: "} - - MSB4046: Fehler beim Lesen der Projektdatei "{0}": {1} - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4125: The project file name "{0}" is invalid. {1} - MSB4125: Název souboru projektu {0} je neplatný. {1} - {StrBegin="MSB4125: "}UE: The solution filename is provided separately to loggers. - - MSB4125: Der Projektdateiname "{0}" ist ungültig. {1} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4051: Project {0} is referencing a project with GUID {1}, but a project with this GUID was not found in the .SLN file. - MSB4051: Projekt {0} odkazuje na projekt s identifikátorem GUID {1}, projekt s tímto identifikátorem GUID však nebyl v souboru SLN nalezen. - {StrBegin="MSB4051: "}UE: The solution filename is provided separately to loggers. - - MSB4051: Das Projekt "{0}" verweist auf ein Projekt mit der GUID {1}, in der SLN-Datei wurde jedoch kein Projekt mit dieser GUID gefunden. - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - MSB4078: The project file "{0}" is not supported by MSBuild and cannot be built. - MSB4078: Nástroj MSBuild nepodporuje soubor projektu {0}, nelze ho proto sestavit. - {StrBegin="MSB4078: "} - - MSB4078: Die Projektdatei "{0}" wird nicht von MSBuild unterstützt und kann nicht erstellt werden. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4054: The solution file must be opened in the Visual Studio IDE and converted to the latest version before it can be built by MSBuild. - MSB4054: Soubor řešení musí být otevřen v prostředí Visual Studio IDE a převeden na nejnovější verzi. Teprve potom jej bude možné sestavit nástrojem MSBuild. - {StrBegin="MSB4054: "}UE: The solution filename is provided separately to loggers. - - MSB4054: Die Projektmappendatei muss in der Visual Studio IDE geöffnet und in die neuste Version konvertiert werden, bevor sie mit MSBuild erstellt werden kann. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4121: The project configuration for project "{0}" was not specified in the solution file for the solution configuration "{1}". - MSB4121: Nebyla zadána konfigurace projektu pro projekt {0} v souboru řešení pro konfiguraci řešení {1}. - {StrBegin="MSB4121: "} - - MSB4121: Die Projektkonfiguration für das Projekt "{0}" wurde nicht in der Projektmappendatei für die Projektmappenkonfiguration "{1}" angegeben. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - The project "{0}" is not selected for building in solution configuration "{1}". - Projekt {0} není vybrán k sestavování v konfiguraci řešení {1}. - - UE: This is not an error, so doesn't need an error code. - - - Das Projekt "{0}" ist in der Projektmappenkonfiguration "{1}" nicht zum Erstellen ausgewählt. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4122: Scanning project dependencies for project "{0}" failed. {1} - MSB4122: Vyhledávání projektových závislostí pro projekt {0} se nezdařilo. {1} - {StrBegin="MSB4122: "} - - MSB4122: Fehler beim Überprüfen der Projektabhängigkeiten für Projekt "{0}". {1} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4149: The tools version "{0}" of the solution does not support building projects with a different tools version. - MSB4149: Verze nástrojů {0} řešení nepodporuje sestavování projektů s jinou verzí nástrojů. - {StrBegin="MSB4149: "} - - MSB4149: Die Toolsversion {0} der Projektmappe unterstützt das Erstellen von Projekten mit unterschiedlichen Toolsversionen nicht. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - Web projects do not support the "Clean" target. Continuing with remaining projects ... - Webové projekty nepodporují cíl Clean. Pokračuje zpracování zbývajících projektů... - UE: This is not an error, so doesn't need an error code. - LOCALIZATION: Do not localize "Clean". - - Webprojekte unterstützen das Clean-Ziel nicht. Verbleibende Projekte werden fortgesetzt... - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Web projects do not support the "Publish" target. Continuing with remaining projects ... - Webové projekty nepodporují cíl Publish. Pokračuje zpracování zbývajících projektů... - UE: This is not an error, so doesn't need an error code. - LOCALIZATION: Do not localize "Publish". - - Webprojekte unterstützen das Publish-Ziel nicht. Verbleibende Projekte werden fortgesetzt... - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Skipping because the "$(AspNetConfiguration)" configuration is not supported for this web project. You can use the AspNetConfiguration property to override the configuration used for building web projects, by adding /p:AspNetConfiguration=<value> to the command line. Currently web projects only support Debug and Release configurations. - Vynecháno, protože konfigurace $(AspNetConfiguration) není pro tento webový projekt podporována. Pomocí vlastnosti AspNetConfiguration můžete přepsat konfiguraci používanou k sestavování webových projektů, a to přidáním příkazu /p:AspNetConfiguration=<hodnota> do příkazového řádku. Webové projekty nyní podporují pouze konfigurace Debug a Release. - - UE: This is not an error, so doesn't need an error code. - LOCALIZATION: Do NOT localize "AspNetConfiguration", "Debug", "Release". - - - Da der "$(AspNetConfiguration)" Konfiguration für dieses Webprojekt nicht unterstützt. Verwenden die AspNetConfiguration-Eigenschaft die Konfiguration zum Erstellen von Webprojekten hinzufügen/p: AspNetConfiguration überschreiben = < Wert > in der Befehlszeile. Aktuell unterstützen Webprojekte nur Debug- und Releasekonfigurationen. - - fuzzyMatch="15" wordcount="44" adjWordcount="37.4" curWordcount="37.4" - - - MSB4076: VC projects do not support the "Publish" target. - MSB4076: Projekty VC nepodporují cíl Publish. - {StrBegin="MSB4076: "}LOCALIZATION: Do not localize "Publish". - - MSB4076: VC-Projekte unterstützen nicht das Publish-Ziel. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4098: MSBuild is invoking VCBuild to build this project. Project-to-project references between VC++ projects (.VCPROJ) and C#/VB/VJ# projects (.CSPROJ, .VBPROJ, .VJSPROJ) are not supported by the command-line build systems when building stand-alone VC++ projects. Projects that contain such project-to-project references will fail to build. Please build the solution file containing this project instead. - MSB4098: Nástroj MSBuild volá za účelem sestavení tohoto projektu nástroj VCBuild. Křížové odkazy mezi projekty VC++ (VCPROJ) a C#/VB/VJ# (CSPROJ, VBPROJ, VJSPROJ) nejsou podporovány sestavovacími systémy příkazového řádku při sestavování samostatných projektů VC++. Projekty obsahující takovéto křížové odkazy mezi projekty se nepodaří sestavit. Místo toho sestavte soubor řešení obsahující tento projekt. - {StrBegin="MSB4098: "} - - MSB4098: MSBuild ruft zum Erstellen dieses Projekts VCBuild auf. Interprojektverweise zwischen VC++-Projekten (.VCPROJ) und C#-/VB-/VJ#-Projekten (.CSPROJ, .VBPROJ, .VJSPROJ) werden beim Erstellen eigenständiger VC++-Projekte von den Befehlszeilen-Buildsystemen nicht unterstützt. Projekte, die solche Interprojektverweise enthalten, werden nicht erstellt. Erstellen Sie stattdessen die Projektmappendatei, die dieses Projekt enthält. - - fuzzyMatch="101" wordcount="53" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4056: The MSBuild engine must be called on a single-threaded-apartment. Current threading model is "{0}". Proceeding, but some tasks may not function correctly. - MSB4056: Nástroj MSBuild je nutné volat v režimu STA (Single Thread Apartment). Aktuální model vláken je {0}. Zpracování bude pokračovat, některé úlohy však pravděpodobně nebudou fungovat správně. - {StrBegin="MSB4056: "} - - MSB4056: Das MSBuild-Modul muss in einem Singlethread-Apartment aufgerufen werden. Das aktuelle Threadmodell ist {0}. Der Vorgang wird fortgesetzt, aber einige Aufgaben werden möglicherweise nicht ordnungsgemäß ausgeführt. - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - Schema validation - Ověřování schématu - UE: this fragment is used to describe errors that are caused by schema validation. For example, if a normal error is - displayed like this: "MSBUILD : error MSB0000: This is an error.", then an error from schema validation would look like this: - "MSBUILD : Schema validation error MSB0000: This is an error." - LOCALIZATION: This fragment needs to be localized. - - Schemavalidierung - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Target "{0}" skipped. Previously built unsuccessfully. - Cíl {0} byl vynechán. Předchozí sestavení se nezdařilo. - - - Das Ziel "{0}" wurde übersprungen. Die vorherige Erstellung war nicht erfolgreich. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Target "{0}" skipped. Previously built successfully. - Cíl {0} byl vynechán. Předchozí sestavení bylo úspěšné. - - - Das Ziel "{0}" wurde übersprungen. Die vorherige Erstellung war erfolgreich. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4116: The condition "{1}" on the "{0}" target has a reference to item metadata. References to item metadata are not allowed in target conditions unless they are part of an item transform. - MSB4116: Podmínka {1} u cíle {0} odkazuje na metadata položky. Odkazy na metadata položky nejsou v podmínkách cílů povoleny, pokud nejsou součástí transformace položky. - {StrBegin="MSB4116: "} - - MSB4116: Die Bedingung "{1}" des {0}-Ziels enthält einen Verweis auf Elementmetadaten. Verweise auf Elementmetadaten sind in Zielbedingungen nicht zulässig, es sei denn, sie sind Teil einer Elementtransformation. - - fuzzyMatch="101" wordcount="32" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4057: The target "{0}" does not exist in the project. - MSB4057: Cíl {0} v projektu neexistuje. - {StrBegin="MSB4057: "} - - MSB4057: Das Ziel "{0}" ist im Projekt nicht vorhanden. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - Done building target "{0}" in project "{1}" -- FAILED. - Bylo dokončeno sestavování cíle {0} v projektu {1}: CHYBA. - - - Erstellen des {0}-Ziels in Projekt {1} beendet - Fehler beim Erstellen. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Done building target "{0}" in project "{1}". - Bylo dokončeno sestavování cíle {0} v projektu {1}. - - - Die Erstellung des Ziels "{0}" im Projekt "{1}" ist abgeschlossen. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - {0}: (TargetId:{1}) - {0}: (TargetId:{1}) - - - {0}: (Ziel-ID:{1}) - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4058: The "{0}" target is missing its output specification. If a target declares inputs, it must also declare outputs. - MSB4058: V cíli {0} nebyla nalezena specifikace vstupů. Pokud cíl deklaruje vstupy, musí deklarovat také výstupy. - {StrBegin="MSB4058: "} - - MSB4058: Das {0}-Ziel enthält keine Ausgabespezifikation. Wenn ein Ziel Eingaben deklariert, muss es auch Ausgaben deklarieren. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4168: The item "{0}" of type "{1}" does not define a value for the metadata in the expression "{2}". This expression is used in the target output for target "{3}". If a target declares outputs that are transforms, all items in the transform must have a value for the metadata in the transform. - MSB4168: Položka {0} typu {1} nedefinuje hodnotu metadat ve výrazu {2}. Tento výraz se používá v cílovém výstupu pro cíl {3}. Pokud cíl deklaruje výstupy jako transformace, musí všechny položky v transformaci obsahovat hodnotu metadat v dané transformaci. - {StrBegin="MSB4168: "} - - MSB4168: Das Element "{0}" vom Typ "{1}" definiert keinen Wert für die Metadaten im Ausdruck "{2}". Dieser Ausdruck wird in der Zielausgabe für "{3}" verwendet. Wenn ein Ziel Ausgaben deklariert, bei denen es sich um Transformationen handelt, müssen alle Elemente in der Transformation einen Wert für die in der Transformation enthaltenen Metadaten aufweisen. - - fuzzyMatch="101" wordcount="53" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Target Performance Summary: - Souhrnné informace o výkonu cíle: - - - Leistungszusammenfassung für das Ziel: - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Target "{0}" skipped, due to false condition; ({1}) was evaluated as ({2}). - Cíl {0} byl vynechán z důvodu podmínky vyhodnocené jako false; ({1}) bylo vyhodnoceno jako ({2}). - - - Das Ziel "{0}" wurde übersprungen, da die Bedingung "false" war . ({1}) wurde als ({2}) ausgewertet. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Target "{0}" in project "{1}" - Cíl {0} v projektu {1} - - - {0}-Ziel in {1}-Projekt. - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Target {0}: - Cíl {0}: - - - Ziel "{0}": - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Target "{0}" in file "{1}": - Cíl {0} v souboru {1}: - - - Ziel "{0}" in Datei "{1}": - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Build continuing because "{0}" on the task "{1}" is set to "{2}". - Pokračuje sestavování, protože {0} u úlohy {1} je nastaveno na {2}. - - - Der Buildvorgang wird fortgesetzt, da {0} in der {1}-Aufgabe auf "{2}" festgelegt ist. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Target {0} from project "{1}": - Cíl {0} z projektu {1}: - - - Ziel "{0}" aus Projekt "{1}": - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Target "{0}" in file "{1}" from project "{2}": - Cíl {0} v souboru {1} projektu {2}: - - - Ziel "{0}" in Datei "{1}" aus Projekt "{2}": - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4060: The "{0}" task has been declared or used incorrectly, or failed during construction. Check the spelling of the task name and the assembly name. - MSB4060: Úloha {0} byla deklarována nebo použita nesprávně. Je také možné, že došlo k chybě při konstrukci. Zkontrolujte, zda je název úlohy a sestavení zadán správně. - {StrBegin="MSB4060: "} - - MSB4060: Die {0}-Aufgabe wurde falsch deklariert, falsch verwendet oder konnte bei der Erstellung nicht ausgeführt werden. Überprüfen Sie die Schreibweise des Aufgaben- und des Assemblynamens. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4077: The "{0}" task has been marked with the attribute LoadInSeparateAppDomain, but does not derive from MarshalByRefObject. Check that the task derives from MarshalByRefObject or AppDomainIsolatedTask. - MSB4077: Úloha {0} byla označena atributem LoadInSeparateAppDomain, není ale odvozena od třídy MarshalByRefObject. Zkontrolujte, jestli je úloha odvozena od třídy MarshalByRefObject nebo AppDomainIsolatedTask. - {StrBegin="MSB4077: "}LOCALIZATION: <LoadInSeparateAppDomain>, <MarshalByRefObject>, <AppDomainIsolatedTask> should not be localized. - - MSB4077: Die Aufgabe "{0}" wurde mit dem LoadInSeparateAppDomain-Attribut markiert, ist jedoch nicht von MarshalByRefObject abgeleitet. Stellen Sie sicher, dass die Aufgabe von MarshalByRefObject oder AppDomainIsolatedTask abgeleitet wird. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Done executing task "{0}" -- FAILED. - Provádění úlohy {0} je dokončeno: CHYBA. - - - Die Ausführung von Task "{0}" wurde beendet – FEHLER. - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Done executing task "{0}". - Provádění úlohy {0} je dokončeno. - - - Die Ausführung von Task "{0}" wurde beendet. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - {0} (TaskId:{1}) - {0} (TaskId:{1}) - - - {0} (Aufgaben-ID: {1}) - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Using "{0}" task from assembly "{1}". - Probíhá použití úlohy {0} ze sestavení {1}. - UE: This informational message helps users determine which assemblies their tasks were loaded from. - - Die {0}-Aufgabe aus der {1}-Assembly wird verwendet. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4061: The "{0}" task could not be instantiated from the assembly "{1}". {2} - MSB4061: Nelze vytvořit instanci úlohy {0} ze sestavení {1}. {2} - {StrBegin="MSB4061: "}LOCALIZATION: "{2}" is a localized message from a CLR/FX exception. - - MSB4061: Die {0}-Aufgabe konnte nicht aus der {1}-Assembly instanziiert werden. {2} - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4127: The "{0}" task could not be instantiated from the assembly "{1}". Please verify the task assembly has been built using the same version of the Microsoft.Build.Framework assembly as the one installed on your computer and that your host application is not missing a binding redirect for Microsoft.Build.Framework. {2} - MSB4127: Nelze vytvořit instanci úlohy {0} ze sestavení {1}. Zkontrolujte, zda bylo sestavení úlohy vytvořeno s použitím stejné verze sestavení Microsoft.Build.Framework jako sestavení nainstalované do počítače a zda v hostitelské aplikaci nechybí přesměrování vazby pro rozhraní Microsoft.Build.Framework. {2} - {StrBegin="MSB4127: "}UE: This message is a specialized version of the TaskInstantiationFailureError message and can probably reuse some of its docs. - LOCALIZATION: "{2}" is a localized message from a CLR/FX exception. Also, Microsoft.Build.Framework should not be localized - - MSB4127: Die "{0}"-Aufgabe konnte nicht aus der "{1}"-Assembly instanziiert werden. Überprüfen Sie, ob die Aufgabenassembly mit der gleichen Version der Microsoft.Build.Framework-Assembly erstellt wurde, die auf Ihrem Computer installiert ist, und dass Ihrer Hostanwendung kein BindingRedirect-Eintrag für Microsoft.Build.Framework fehlt. {2} - - fuzzyMatch="101" wordcount="49" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4062: The "{0}" task could not be loaded from the assembly {1}. {2} Confirm that the <UsingTask> declaration is correct, and that the assembly and all its dependencies are available. - MSB4062: Úlohu {0} nelze načíst ze sestavení {1}. {2} Zkontrolujte, zda je deklarace <UsingTask> správná a zda sestavení a všechny jeho závislosti jsou k dispozici. - {StrBegin="MSB4062: "}UE: This message is shown when a task cannot be loaded from its assembly for various reasons e.g. corrupt assembly, - invalid task declaration, disk error, etc. "{2}" contains a message explaining what happened. - LOCALIZATION: "{2}" is a message from the CLR loader and is already localized. Also, <UsingTask> should not be localized. - - MSB4062: Die "{0}" Vorgang konnte nicht aus der Assembly geladen werden {1}. {2} Bestätigen < UsingTask > Erklärung richtig ist und die Assembly und die zugehörigen Dateien verfügbar sind. - - fuzzyMatch="15" wordcount="31" adjWordcount="26.35" curWordcount="26.35" - - - MSB4063: The "{0}" task could not be initialized with its input parameters. {1} - MSB4063: Úlohu {0} nelze inicializovat s použitím jejích vstupních parametrů. {1} - {StrBegin="MSB4063: "} - - MSB4063: Die "{0}"-Aufgabe konnte nicht mit ihren Eingabeparametern initialisiert werden. {1} - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - Task Performance Summary: - Souhrnné informace o výkonu úlohy: - - - Leistungszusammenfassung für die Aufgabe: - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Task "{0}" skipped, due to false condition; ({1}) was evaluated as ({2}). - Úloha {0} byla vynechána z důvodu podmínky vyhodnocené jako false; ({1}) bylo vyhodnoceno jako ({2}). - - - Die {0}-Aufgabe wurde übersprungen, da die Bedingung "false" war . ({1}) wurde als ({2}) ausgewertet. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Task "{0}" - Úloha {0} - - - Task "{0}" - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Time Elapsed {0} - Uplynulý čas {0} - - - Verstrichene Zeit {0} - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Building with tools version "{0}". - Probíhá sestavení s verzí nástrojů {0}. - - - Erstellung mit der Toolsversion "{0}". - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Project file contains ToolsVersion="{0}". This toolset is unknown or missing. You may be able to resolve this by installing the appropriate .NET Framework for this toolset. Treating the project as if it had ToolsVersion="4.0". - Soubor projektu obsahuje parametr ToolsVersion="{0}". Tato sada nástrojů je neznámá nebo chybí. Řešením tohoto problému může být instalace příslušného rozhraní .NET Framework pro tuto sadu nástrojů. Projekt bude zpracován, jako by měl parametr ToolsVersion="4.0". - - - Die Projektdatei enthält ToolsVersion="{0}". Dieses Toolset ist nicht bekannt oder nicht vorhanden. Sie können das Problem möglicherweise beheben, indem Sie das entsprechende .NET Framework für dieses Toolset installieren. Das Projekt wird behandelt als enthielte es ToolsVersion="4.0". - - fuzzyMatch="101" wordcount="34" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Deferred Messages - Odložené zprávy - - - Zurückgestellte Meldungen - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Some messages did not display because they were not associated with any ProjectStarted events. Use diagnostic verbosity to view these messages. - Některé zprávy se nezobrazily, protože nebyly přiřazeny k žádným událostem ProjectStarted. Chcete-li tyto zprávy zobrazit, nastavte diagnostickou úroveň podrobností. - - - Einige Meldungen wurden nicht angezeigt, weil sie keinem ProjectStarted-Ereignis zugeordnet sind. Verwenden Sie den Ausführlichkeitsgrad "diagnostic", um diese Meldungen anzuzeigen. - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - MSB4090: Found an unexpected character '{2}' at position {1} in condition "{0}". - MSB4090: Byl nalezen neočekávaný znak {2} na pozici {1} v podmínce {0}. - {StrBegin="MSB4090: "} - - MSB4090: Das unerwartete Zeichen {2} wurde an Position {1} in der {0}-Bedingung gefunden. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4091: Found a call to an undefined function "{1}" in condition "{0}". - MSB4091: Bylo nalezeno volání nedefinované funkce {1} v podmínce {0}. - {StrBegin="MSB4091: "} - - MSB4091: Aufruf zu einer undefinierten Funktion "{1}" in Bedingung "{0}" gefunden. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4064: The "{0}" parameter is not supported by the "{1}" task. Verify the parameter exists on the task, and it is a settable public instance property. - MSB4064: Parametr {0} není podporován úlohou {1}. Zkontrolujte, zda parametr úlohy existuje a zda se jedná o nastavitelnou vlastnost veřejné instance. - {StrBegin="MSB4064: "} - - MSB4064: Der {0}-Parameter wird von der {1}-Aufgabe nicht unterstützt. Vergewissern Sie sich, dass der Parameter in der Aufgabe vorhanden ist und es sich um eine festlegbare öffentliche Instanzeigenschaft handelt. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4131: The "{0}" parameter is not supported by the "{1}" task. Verify the parameter exists on the task, and it is a gettable public instance property. - MSB4131: Parametr {0} není podporován úlohou {1}. Zkontrolujte, zda parametr v úloze existuje a zda se jedná o veřejnou vlastnost instance, kterou lze získat pomocí funkce get. - {StrBegin="MSB4131: "} - - MSB4131: Der {0}-Parameter wird von der {1}-Aufgabe nicht unterstützt. Vergewissern Sie sich, dass der Parameter in der Aufgabe vorhanden ist und es sich um eine abrufbare öffentliche Instanzeigenschaft handelt. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4092: An unexpected token "{1}" was found at character position {2} in condition "{0}". - MSB4092: Byl nalezen neočekávaný token {1} na pozici znaku {2} v podmínce {0}. - {StrBegin="MSB4092: "} - - MSB4092: Ein unerwartetes Token "{1}" wurde an Zeichenposition "{2}" in Bedingung "{0}" gefunden. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4065: The "{0}" parameter is not marked for output by the "{1}" task. - MSB4065: Parametr {0} není označen pro výstup úlohou {1}. - {StrBegin="MSB4065: "} - - MSB4065: Der {0}-Parameter ist nicht für die Ausgabe durch die {1}-Aufgabe markiert. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4066: The attribute "{0}" in element <{1}> is unrecognized. - MSB4066: Atribut {0} v elementu <{1}> nebyl rozpoznán. - {StrBegin="MSB4066: "} - - MSB4066: Das Attribut "{0}" im Element <{1}> wurde nicht erkannt. - - fuzzyMatch="15" wordcount="10" adjWordcount="8.5" curWordcount="8.5" - - - MSB4067: The element <{0}> beneath element <{1}> is unrecognized. - MSB4067: Element <{0}> pod elementem <{1}> nebyl rozpoznán. - {StrBegin="MSB4067: "} - - MSB4067: Das Element <{0}> unter Element <{1}> wurde nicht erkannt. - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB4068: The element <{0}> is unrecognized, or not supported in this context. - MSB4068: Element <{0}> nebyl rozpoznán nebo není v tomto kontextu podporován. - {StrBegin="MSB4068: "} - - MSB4068: Das Element <{0}> ist unbekannt oder in diesem Kontext nicht unterstützt. - - fuzzyMatch="15" wordcount="13" adjWordcount="11.05" curWordcount="11.05" - - - MSB4132: The tools version "{0}" is unrecognized. - MSB4132: Verze nástrojů {0} je neznámá. - {StrBegin="MSB4132: "} - - MSB4132: Die Toolsversion "{0}" ist unbekannt. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4069: The "{0}" type of the "{1}" parameter of the "{2}" task is not supported by MSBuild. - MSB4069: Typ {0} parametru {1} úlohy {2} není podporován nástrojem MSBuild. - {StrBegin="MSB4069: "}LOCALIZATION: "MSBuild" should not be localized. - - MSB4069: Der {0}-Typ des {1}-Parameters der {2}-Aufgabe wird von MSBuild nicht unterstützt. - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - MSB4072: A <{0}> element must contain either the "{1}" attribute or the "{2}" attribute (but not both). - MSB4072: Element <{0}> musí obsahovat buď atribut {1}, nebo atribut {2} (nikoli však oba). - {StrBegin="MSB4072: "} - - MSB4072: Ein <{0}>-Element muss entweder die "{1}" Attribut oder "{2}" Attribut (jedoch nicht beide). - - fuzzyMatch="15" wordcount="18" adjWordcount="15.3" curWordcount="15.3" - - - {0} Warning(s) - {0} upozornění - - - {0} Warnung(en) - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4084: A <When> element may not follow an <Otherwise> element in a <Choose>. - MSB4084: V elementu <Choose> nesmí element <When> následovat po elementu <Otherwise>. - {StrBegin="MSB4084: "} - - MSB4084: A < >-Element kein Element < Otherwise > < auswählen > folgen. - - fuzzyMatch="15" wordcount="16" adjWordcount="13.6" curWordcount="13.6" - - - Target Name: "{0}" Project Name: "{1}" - Název cíle: {0} Název projektu: {1} - - - Zielname: "{0}" Projektname: "{1}" - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Cycle trace: - Trasování cyklu: - - - Schleifenablaufverfolgung: - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4150: Must initialize the console logger using the initialize method before using ApplyParameter - MSB4150: Před použitím funkce ApplyParameter je nutné inicializovat protokolovací nástroj konzoly pomocí inicializační metody. - {StrBegin="MSB4150: "} - - MSB4150: Die Konsolenprotokollierung muss vor der Verwendung von ApplyParameter mithilfe der Initialisierungsmethode initialisiert werden. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4151: An error occurred while building project "{0}", target "{1}". Please see innerException for detailed information. - MSB4151: Došlo k chybě při sestavování projektu {0}, cíl {1}. Podrobné informace naleznete v datech innerException. - {StrBegin="MSB4151: "} - - MSB4151: Fehler beim Erstellen von Projekt "{0}", Ziel "{1}". Ausführliche Informationen finden Sie in der innerException. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB4152: An error occurred on the child node "{0}" and could not be passed to the parent node. {1} - MSB4152: V podřízeném uzlu {0} došlo k chybě a nebylo možné provést předání nadřazenému uzlu. {1} - {StrBegin="MSB4152: "} - - MSB4152: Fehler im untergeordneten Knoten "{0}", der nicht an den übergeordneten Knoten übergeben werden konnte. {1} - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4153: A call is made on an inactive IBuildEngine interface corresponding to a task that already finished execution. - MSB4153: Bylo voláno neaktivní rozhraní IBuildEngine odpovídající úloze, jejíž provádění již bylo dokončeno. - {StrBegin="MSB4153: "} - - MSB4153: Eine inaktive IBuildEngine-Schnittstelle wird aufgerufen, der eine Aufgabe entspricht, deren Ausführung bereits abgeschlossen wurde. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - MSB4154: A forwarding logger is attempting to forward BuildFinished event - MSB4154: Předávající protokolovací nástroj se pokouší předat událost BuildFinished - {StrBegin="MSB4154: "} - - MSB4154: Eine weiterleitende Protokollierung versucht, das BuildFinished-Ereignis weiterzuleiten. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4155: There was an error while communicating with a node. - MSB4155: Došlo k chybě při komunikaci s uzlem. - {StrBegin="MSB4155: "} - - MSB4155: Fehler bei der Kommunikation mit einem Knoten. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB1021: Cannot create an instance of the logger - {0}. - MSB1021: Nelze vytvořit instanci protokolovacího nástroje - {0}. - {StrBegin="MSB1021: "}The error code for this message is duplicated from MSBuild.exe. - - MSB1021: Eine Instanz der Protokollierung kann nicht erstellt werden - {0}. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB1020: The logger {0} was not found. Check the following: 1.) The logger name specified is the same as the name of the logger class. 2.) The logger class is "public" and implements the Microsoft.Build.Framework.ILogger interface. 3.) The path to the logger assembly is correct, or the logger can be loaded using only the assembly name provided. - MSB1020: Protokolovací nástroj {0} nebyl nalezen. Zkontrolujte, zda platí následující skutečnosti: 1.) Zadaný název protokolovacího nástroje je stejný jako název třídy protokolovacího nástroje. 2.) Třída protokolovacího nástroje je veřejná (public) a implementuje rozhraní Microsoft.Build.Framework.ILogger. 3.) Cesta k sestavení protokolovacího nástroje je správná, nebo lze protokolovací nástroj načíst pouze pomocí zadaného názvu sestavení. - {StrBegin="MSB1020: "}The error code for this message is duplicated from MSBuild.exe. - - MSB1020: Die Protokollierung {0} wurde nicht gefunden. Überprüfen Sie Folgendes: 1.) Der angegebene Name der Protokollierung ist mit dem Namen der Protokollierungsklasse identisch. 2.) Die Protokollierungsklasse ist "public" und implementiert die Microsoft.Build.Framework.ILogger-Schnittstelle. 3.) Der Pfad zur Protokollierungsassembly ist richtig, bzw. die Protokollierung kann alleine mithilfe des angegebenen Assemblynamens geladen werden. - - fuzzyMatch="101" wordcount="57" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4156: A forwarding logger is attempting to forward BuildStarted event - MSB4156: Předávající protokolovací nástroj se pokouší předat událost BuildStarted - {StrBegin="MSB4156: "} - - MSB4156: Eine weiterleitende Protokollierung versucht, das BuildStarted-Ereignis weiterzuleiten. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - "{0}" ({1} target) ({2}) -> - {0} ({1} cíl) ({2}) -> - - - "{0}" ({1} target) ({2}) -> - - fuzzyMatch="15" wordcount="5" adjWordcount="4.25" curWordcount="4.25" - - - "{0}" (default target) ({1}) -> - "{0}" (výchozí cíl) ({1}) -> - - - "{0}" (Standardziel) ({1}) -> - - fuzzyMatch="15" wordcount="5" adjWordcount="4.25" curWordcount="4.25" - - - {0} {1,5} - {0} {1,5} - - - {0} {1,5} - - fuzzyMatch="15" wordcount="2" adjWordcount="1.7" curWordcount="1.7" - - - Project "{0}" on node {1} ({2} target(s)). - Projekt {0} v uzlu {1} (počet cílů: {2}). - - - Projekt "{0}" auf Knoten "{1}", {2} Ziel(e). - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Project "{0}" on node {1} (default targets). - Projekt {0} v uzlu {1} (výchozí cíle). - - - Projekt "{0}" auf Knoten "{1}" (Standardziele). - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Project "{0}" ({1}) is building "{2}" ({3}) on node {4} ({5} target(s)). - Probíhá sestavení projektu {0} ({1}) – {2} ({3}) v uzlu {4} (počet cílů: {5}). - - - Das Projekt "{0}" ({1}) erstellt "{2}" ({3}) auf Knoten "{4}", {5} Ziel(e). - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Project "{0}" ({1}) is building "{2}" ({3}) on node {4} (default targets). - Probíhá sestavení projektu {0} ({1}) – {2} ({3}) v uzlu {4} (výchozí cíle). - - - Das Projekt "{0}" ({1}) erstellt "{2}" ({3}) auf Knoten "{4}" (Standardziele). - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - ({0} target) -> - (cíl {0}) -> - - - ({0} Ziel) -> - - fuzzyMatch="15" wordcount="3" adjWordcount="2.55" curWordcount="2.55" - - - MSB4157: The array of project files needs to contain at least one value. - MSB4157: Pole souborů projektu musí obsahovat alespoň jednu hodnotu. - {StrBegin="MSB4157: "} - - MSB4157: Das Array der Projektdateien muss mindestens einen Wert enthalten. - - fuzzyMatch="15" wordcount="13" adjWordcount="11.05" curWordcount="11.05" - - - MSB4158: The project file name at element {0} is empty. - MSB4158: Název souboru projektu {0} je prázdný. - {StrBegin="MSB4158: "} - - MSB4158: Der Projektdateiname bei Element {0} ist leer. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - The property "{0}" with value "{1}" is being overridden by another batch. The property is now: "{2}" - Probíhá přepsání vlastnosti {0} s hodnotou {1} jinou dávkou. Nová hodnota vlastnosti: {2}. - - - Die Eigenschaft "{0}" mit dem Wert "{1}" wird von einem anderen Batch überschrieben. Die Eigenschaft ist jetzt: "{2}" - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - Please see inner exception for error information. - Informace o chybě naleznete v datech vnitřní výjimky. - - - Fehlerinformationen finden Sie in der internen Ausnahme. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Event type "{0}" was expected to be serializable. The event was not serializable and has been ignored. - Typ události {0} měl být podle očekávání serializovatelný. Událost nebyla serializovatelná a byla ignorována. - - - Es wurde erwartet, dass der Typ "{0}" serialisierbar ist. Das Ereignis war nicht serialisierbar und wurde ignoriert. - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - The log file path cannot be null or empty. - Cesta k souboru protokolu nemůže mít hodnotu Null a nesmí být prázdná. - - - Der Protokolldateipfad darf nicht NULL oder leer sein. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4161: Project "{0}" was loaded and unloaded during the current build. Reloading a project during the build can result in errors or an inconsistent build state. Either avoid unloading project "{0}" or cache the evaluation results of target(s) "{1}" before unloading the project. - MSB4161: Během aktuálního sestavení byl načten a uvolněn projekt {0}. Opětovné načtení projektu během sestavení může vést k chybám nebo k nekonzistentnímu stavu sestavení. Buď projekt {0} neuvolňujte, nebo před jeho uvolněním uložte do mezipaměti výsledky vyhodnocení cílů {1}. - {StrBegin="MSB4161: "} - - MSB4161: Das Projekt "{0}" wurde während der aktuellen Erstellung geladen und entladen. Das erneute Laden eines Projekts während der Erstellung kann zu Fehlern oder einem nicht konsistenten Buildzustand führen. Vermeiden Sie entweder das Entladen des Projekts "{0}", oder speichern Sie die Auswertungsergebnisse der Ziele "{1}" vor dem Entladen des Projekts im Cache. - - fuzzyMatch="101" wordcount="43" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - [default] - [výchozí] - - - [Standard] - - fuzzyMatch="100" wordcount="1" adjWordcount="0.25" curWordcount="0.25" tmLabel="N''" - - -
-
\ No newline at end of file diff --git a/src/Deprecated/Engine/Resources/xlf/Strings.de.xlf b/src/Deprecated/Engine/Resources/xlf/Strings.de.xlf deleted file mode 100644 index 499f85f4136..00000000000 --- a/src/Deprecated/Engine/Resources/xlf/Strings.de.xlf +++ /dev/null @@ -1,2674 +0,0 @@ - - - -
- - 4013 - 1176.8 - 1176.8 - 0 - 0 - - - 0 - 981 - 2334 - 0 - 0 - 698 - 0 - -
- - - MSB4001: The "{0}" task has more than one parameter called "{1}". - MSB4001: Die {0}-Aufgabe enthält mehrere Parameter mit dem Namen "{1}". - {StrBegin="MSB4001: "}UE: This message is shown when a task has more than one .NET property with the same name -- it's unclear which of - those properties the task wants to use as a parameter in project files. - - MSB4001: Die {0}-Aufgabe enthält mehrere Parameter mit dem Namen "{1}". - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4081: The value "{0}" of the "ItemName" attribute in element <Output> contains an "@" character. If you intended to use an item name then remove the @( ) around the item name. - MSB4081: Der {0}-Wert des ItemName-Attributs im <Output>-Element enthält das Zeichen "@". Wenn Sie einen Elementnamen verwenden möchten, entfernen Sie die Zeichen @( ) vor und hinter dem Elementnamen. - {StrBegin="MSB4081: "}UE: This message is shown when an output tag has an itemname that contains an @. They probably typed @(foo) instead of foo in the ItemName.LOCALIZATION: Output and ItemName should not be localized. - - MSB4081: Der Wert "{0}" "ItemName-Attribut im Element < Output > enthält ein" @"Zeichen. Soll ein Elementname verwenden und entfernen dann die @ (), um den Namen des Elements. - - fuzzyMatch="15" wordcount="30" adjWordcount="25.5" curWordcount="25.5" - - - MSB4002: There was a failure retrieving the attributes for parameters in the "{0}" task. {1} - MSB4002: Fehler beim Abrufen der Attribute für Parameter in der {0}-Aufgabe. {1} - {StrBegin="MSB4002: "}UE: This message is shown when the .NET attributes that a task's .NET properties are decorated with, cannot be - retrieved -- this is typically because the .NET classes that define the .NET attributes cannot be loaded because the assembly - they are defined in cannot be found, or the classes themselves cannot be found. - - MSB4002: Fehler beim Abrufen der Attribute für Parameter in der {0}-Aufgabe. {1} - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - MSB4003: "{0}" is a reserved attribute of the <{1}> element, and must be spelled with the correct casing. This attribute cannot be used as a parameter to the "{2}" task. - MSB4003: {0} ist ein reserviertes Attribut des <{1}>-Elements, bei dem die Groß-/Kleinschreibung beachtet werden muss. Dieses Attribut kann nicht als Parameter für die {2}-Aufgabe verwendet werden. - {StrBegin="MSB4003: "}UE: Tasks are not allowed to use incorrect case for reserved attributes on the task nodes e.g. "continueonerror" - instead of the "ContinueOnError". - - MSB4003: "{0}" ist ein reserviertes Attribut der <{1}>-Element und mit der richtigen Groß-/Kleinschreibung geschrieben werden muss. Dieses Attribut kann nicht verwendet werden, als Parameter an die "{2}" Aufgabe. - - fuzzyMatch="15" wordcount="31" adjWordcount="26.35" curWordcount="26.35" - - - The "REQUESTBATCHSIZE" must be a number greater than 1. "{0}" is an invalid value. The value 10 will be used instead. - Die "REQUESTBATCHSIZE" muss eine Zahl größer als 1 sein. "{0}" ist ein ungültiger Wert. Der Wert 10 wird stattdessen verwendet. - The name "REQUESTBATCHSIZE" is an environment variable - - Die "REQUESTBATCHSIZE" muss eine Zahl größer als 1 sein. "{0}" ist ein ungültiger Wert. Der Wert 10 wird stattdessen verwendet. - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - Build completed in {0}. - Das Erstellen wurde in {0} beendet. - - - Das Erstellen wurde in {0} beendet. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - Build FAILED. - Fehler beim Buildvorgang. - - - Fehler beim Buildvorgang. - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Build succeeded. - Der Buildvorgang wurde erfolgreich ausgeführt. - - - Buildvorgang erfolgreich. - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Build started. - Der Buildvorgang wurde gestartet. - - - Der Buildvorgang wurde gestartet. - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Build started {0}. - Der Buildvorgang wurde am {0} gestartet. - - - Der Buildvorgang wurde am {0} gestartet. - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Building target "{0}" completely. - Das Ziel "{0}" wird vollständig erstellt. - {0} is the name of the target. - - Das Ziel "{0}" wird vollständig erstellt. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - No input files were specified. - Es wurden keine Eingabedateien angegeben. - - - Es wurden keine Eingabedateien angegeben. - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Input file "{0}" is newer than output file "{1}". - Die Eingabedatei "{0}" ist neuer als die Ausgabedatei "{1}". - {0} and {1} are filenames on disk. - - Die Eingabedatei "{0}" ist neuer als die Ausgabedatei "{1}". - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - Output file "{0}" does not exist. - Die Ausgabedatei "{0}" ist nicht vorhanden. - {0} is a filename on disk. - - Die Ausgabedatei "{0}" ist nicht vorhanden. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Input file "{0}" does not exist. - Die Eingabedatei "{0}" ist nicht vorhanden. - {0} is a filename on disk. - - Die Eingabedatei "{0}" ist nicht vorhanden. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Building target "{0}" partially, because some output files are out of date with respect to their input files. - Das Ziel "{0}" wird teilweise erstellt, da einige Ausgabedateien hinsichtlich ihrer Eingabedateien veraltet sind. - {0} is the name of the target. - - Das Ziel "{0}" wird teilweise erstellt, da einige Ausgabedateien hinsichtlich ihrer Eingabedateien veraltet sind. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - [{0}: Input={1}, Output={2}] Input file is newer than output file. - [{0}: Eingabe={1}, Ausgabe={2}] Die Eingabedatei ist neuer als die Ausgabedatei. - {0} is the name of an MSBuild item. {1} and {2} are filenames on disk. - - [{0}: Eingabe={1}, Ausgabe={2}] Die Eingabedatei ist neuer als die Ausgabedatei. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - [{0}: Input={1}, Output={2}] Output file does not exist. - [{0}: Eingabe={1}, Ausgabe={2}] Die Ausgabedatei ist nicht vorhanden. - {0} is the name of an MSBuild item. {1} and {2} are filenames on disk. - - [{0}: Eingabe={1}, Ausgabe={2}] Die Ausgabedatei ist nicht vorhanden. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - [{0}: Input={1}, Output={2}] Input file does not exist. - [{0}: Eingabe={1}, Ausgabe={2}] Die Eingabedatei ist nicht vorhanden. - {0} is the name of an MSBuild item. {1} and {2} are filenames on disk. - - [{0}: Eingabe={1}, Ausgabe={2}] Die Eingabedatei ist nicht vorhanden. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - The attribute "{0}" is a known MSBuild attribute, and cannot be accessed using this method. - Das {0}-Attribut ist ein bekanntes MSBuild-Attribut, auf das mithilfe dieser Methode nicht zugegriffen werden kann. - - - Das {0}-Attribut ist ein bekanntes MSBuild-Attribut, auf das mithilfe dieser Methode nicht zugegriffen werden kann. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - Properties in persisted property groups cannot be accessed by name. - Auf Eigenschaften in persistenten Eigenschaftengruppen ist kein Zugriff über den Namen möglich. - - - Auf Eigenschaften in persistenten Eigenschaftengruppen ist kein Zugriff über den Namen möglich. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4023: Cannot evaluate the item metadata "%({0})". {1} - MSB4023: Elementmetadaten "%({0})" können nicht ausgewertet werden. {1} - {StrBegin="MSB4023: "}UE: This message is shown when the value of an item metadata cannot be computed for some reason e.g. trying to apply - %(RootDir) to an item-spec that's not a valid path, would result in this error. - LOCALIZATION: "{1}" is a localized message explaining the problem. - - MSB4023: Elementmetadaten "%({0})" können nicht ausgewertet werden. {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Cannot execute a task not associated with a project object. - Eine Aufgabe, die keinem Projektobjekt zugeordnet ist, kann nicht ausgeführt werden. - - - Eine Aufgabe, die keinem Projektobjekt zugeordnet ist, kann nicht ausgeführt werden. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - The cache entry has already been set to a different value and cannot be modified. - Der Cacheeintrag wurde bereits auf einen anderen Wert festgelegt und kann nicht geändert werden. - - - Der Cacheeintrag wurde bereits auf einen anderen Wert festgelegt und kann nicht geändert werden. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - The "{0}" property comes from an environment variable, and cannot be modified. - Die {0}-Eigenschaft stammt aus einer Umgebungsvariablen und kann nicht geändert werden. - - - Die {0}-Eigenschaft stammt aus einer Umgebungsvariablen und kann nicht geändert werden. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - The "{0}" property is a global property, and cannot be modified through an evaluated property group. Use "{1}" instead. - Die {0}-Eigenschaft ist eine globale Eigenschaft und kann nicht über eine ausgewertete Eigenschaftengruppe geändert werden. Verwenden Sie stattdessen {1}. - - - Die {0}-Eigenschaft ist eine globale Eigenschaft und kann nicht über eine ausgewertete Eigenschaftengruppe geändert werden. Verwenden Sie stattdessen {1}. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - Modifying the XML of an imported project file is not allowed. Open that project file directly. - Der XML-Code einer importierten Projektdatei darf nicht geändert werden. Öffnen Sie diese Projektdatei direkt. - - - Der XML-Code einer importierten Projektdatei darf nicht geändert werden. Öffnen Sie diese Projektdatei direkt. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB4117: The "{0}" item name is reserved, and cannot be used. - MSB4117: Der Elementname "{0}" ist reserviert und kann nicht verwendet werden. - {StrBegin="MSB4117: "}UE: This message is shown when the user tries to redefine one of the reserved MSBuild items e.g. @(Choose) - - MSB4117: Der Elementname "{0}" ist reserviert und kann nicht verwendet werden. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4118: The "{0}" item metadata name is reserved, and cannot be used. - MSB4118: Der Elementmetadatenname "{0}" ist reserviert und kann nicht verwendet werden. - {StrBegin="MSB4118: "}UE: This message is shown when the user tries to redefine one of the reserved MSBuild items e.g. @(Choose) - - MSB4118: Der Elementmetadatenname "{0}" ist reserviert und kann nicht verwendet werden. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4004: The "{0}" property is reserved, and cannot be modified. - MSB4004: Die {0}-Eigenschaft ist reserviert und kann nicht geändert werden. - {StrBegin="MSB4004: "}UE: This message is shown when the user tries to redefine one of the reserved MSBuild properties e.g. $(MSBuildProjectFile) - - MSB4004: Die {0}-Eigenschaft ist reserviert und kann nicht geändert werden. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4094: "{0}" is an invalid value for the "{1}" parameter of the "{3}" task. Multiple items cannot be passed into a parameter of type "{2}". - MSB4094: "{0}" ist ein ungültiger Wert für den "{1}"-Parameter der "{3}"-Aufgabe. Mehrere Elemente können nicht in einen Parameter vom Typ "{2}" übergeben werden. - {StrBegin="MSB4094: "} - UE: This error is shown when a project tries to pass multiple items into a task parameter of type ITaskItem (singular). - - - MSB4094: "{0}" ist ein ungültiger Wert für den "{1}"-Parameter der "{3}"-Aufgabe. Mehrere Elemente können nicht in einen Parameter vom Typ "{2}" übergeben werden. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4115: The "{0}" function only accepts a scalar value, but its argument "{1}" evaluates to "{2}" which is not a scalar value. - MSB4115: Die "{0}"-Funktion nimmt nur einen Skalarwert an, ihr "{1}"-Argument wird jedoch zu "{2}" ausgewertet, bei dem es sich nicht um einen Skalarwert handelt. - {StrBegin="MSB4115: "} - UE: This error is shown when a project tries to pass multiple items into a function in a conditional expression, that can only accept a scalar value (such as the "exists()" function). - - - MSB4115: Die "{0}"-Funktion nimmt nur einen Skalarwert an, ihr "{1}"-Argument wird jedoch zu "{2}" ausgewertet, bei dem es sich nicht um einen Skalarwert handelt. - - fuzzyMatch="100" wordcount="22" adjWordcount="5.5" curWordcount="5.5" tmLabel="N''" - - - The task is currently associated with a project object, and should not be added to a different one. - Die Aufgabe ist derzeit einem Projektobjekt zugeordnet und sollte zu keinem anderen Projektobjekt hinzugefügt werden. - - - Die Aufgabe ist derzeit einem Projektobjekt zugeordnet und sollte zu keinem anderen Projektobjekt hinzugefügt werden. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - MSB4095: The item metadata %({0}) is being referenced without an item name. Specify the item name by using %(itemname.{0}). - MSB4095: Auf die %({0})-Elementmetadaten wird ohne einen Elementnamen verwiesen. Geben Sie den Namen mithilfe von %(itemname.{0}) an. - {StrBegin="MSB4095: "} - - MSB4095: Auf die %({0})-Elementmetadaten wird ohne einen Elementnamen verwiesen. Geben Sie den Namen mithilfe von %(itemname.{0}) an. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - The task is not associated with the specified target element collection, and should not be removed from it. - Die Aufgabe ist nicht der angegebenen Sammlung von Zielelementen zugeordnet und sollte nicht daraus entfernt werden. - - - Die Aufgabe ist nicht der angegebenen Auflistung von Zielelementen zugeordnet und sollte nicht daraus entfernt werden. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - MSB4005: The current working directory could not be restored to {0}. {1} - MSB4005: Das aktuelle Arbeitsverzeichnis konnte unter {0} nicht wiederhergestellt werden. {1} - {StrBegin="MSB4005: "}UE: This message is shown when the current working directory cannot be reset after a build. "{1}" contains a message explaining why. - LOCALIZATION: "{1}" is a message from an CLR/FX exception and is already localized. - - MSB4005: Das aktuelle Arbeitsverzeichnis konnte unter {0} nicht wiederhergestellt werden. {1} - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Cannot set a condition on an object not represented by an XML element in the project file. - Eine Bedingung kann nicht für ein Objekt festgelegt werden, wenn das Objekt nicht von einem XML-Element in der Projektdatei repräsentiert wird. - - - Eine Bedingung kann nicht für ein Objekt festgelegt werden, wenn das Objekt nicht von einem XML-Element in der Projektdatei repräsentiert wird. - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - Cannot set ContinueOnError on an object not represented by an XML element in the project file. - Das ContinueOnError-Attribut kann nicht für ein Objekt festgelegt werden, wenn das Objekt nicht von einem XML-Element in der Projektdatei repräsentiert wird. - - - Das ContinueOnError-Attribut kann nicht für ein Objekt festgelegt werden, wenn das Objekt nicht von einem XML-Element in der Projektdatei repräsentiert wird. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB4134: DefaultToolsVersion cannot be set after a project has been loaded into the Engine. - MSB4134: DefaultToolsVersion darf nicht festgelegt werden, nachdem ein Projekt in die Engine geladen wurde. - {StrBegin="MSB4134: "} - - MSB4134: DefaultToolsVersion darf nicht festgelegt werden, nachdem ein Projekt in das Modul geladen wurde. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - Assigning the "{0}" attribute on an item that has been evaluated is not allowed. This operation is only allowed on the original persisted item that came directly from the project file. - Das {0}-Attribut darf nicht einem Element zugewiesen werden, das ausgewertet wurde. Dieser Vorgang ist nur für das ursprüngliche persistente Element zulässig, das direkt aus der Projektdatei stammt. - - - Das {0}-Attribut darf nicht einem Element zugewiesen werden, das ausgewertet wurde. Dieser Vorgang ist nur für das ursprüngliche persistente Element zulässig, das direkt aus der Projektdatei stammt. - - fuzzyMatch="101" wordcount="31" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Assigning the "{0}" attribute of a virtual item is not allowed. - Das Zuweisen des {0}-Attributs eines virtuellen Elements ist nicht zulässig. - - - Das Zuweisen des {0}-Attributs eines virtuellen Elements ist nicht zulässig. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - A property cannot be set while building. - Eine Eigenschaft kann nicht während des Erstellens festgelegt werden. - - - Eine Eigenschaft kann nicht während des Erstellens festgelegt werden. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - A property cannot be set to null. - Eine Eigenschaft kann nicht auf NULL festgelegt werden. - - - Eine Eigenschaft kann nicht auf NULL festgelegt werden. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Cannot get or set parameters on a task not associated with a project object. - Parameter für eine Aufgabe können nicht abgefragt oder festgelegt werden, wenn die Aufgabe keinem Projektobjekt zugeordnet ist. - - - Parameter für eine Aufgabe können nicht abgefragt oder festgelegt werden, wenn die Aufgabe keinem Projektobjekt zugeordnet ist. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4162: <{0}> is not valid. Child elements are not allowed below a item remove element. - MSB4162: <{0}> ist ungültig. Unterhalb eines Elemententfernungselements sind keine untergeordneten Elemente zulässig. - {StrBegin="MSB4162: "} - - MSB4162: <{0}> ist ungültig. Untergeordnete Elemente dürfen nicht unter einem Element Element entfernen. - - fuzzyMatch="15" wordcount="16" adjWordcount="13.6" curWordcount="13.6" - - - MSB4166: Child node "{0}" exited prematurely. Shutting down. - MSB4166: Der untergeordnete Knoten "{0}" wurde vorzeitig beendet. Herunterfahren. - {StrBegin="MSB4166: "} - - MSB4166: Der untergeordnete Knoten "{0}" wurde vorzeitig beendet. Herunterfahren. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4085: A <Choose> must contain at least one <When>. - MSB4085: Ein <Choose>-Element muss mindestens ein <When>-Element enthalten. - {StrBegin="MSB4085: "} - - MSB4085: < auswählen > muss mindestens < Wenn >. - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB4114: <Choose> elements cannot be nested more than {0} levels deep. - MSB4114: <Choose>-Elemente können nicht mehr als {0} Ebenen tief geschachtelt werden. - {StrBegin="MSB4114: "}UE: This message appears if the project file contains unreasonably nested Choose elements. - LOCALIZATION: Do not localize "Choose" as it is an XML element name. - - MSB4114: < auswählen > Elemente können nicht geschachtelt werden mehr als {0} Ebenen. - - fuzzyMatch="15" wordcount="12" adjWordcount="10.2" curWordcount="10.2" - - - MSB4006: There is a circular dependency in the target dependency graph involving target "{0}". - MSB4006: Im Zielabhängigkeitsdiagramm besteht eine Ringabhängigkeit im Zusammenhang mit dem Ziel "{0}". - {StrBegin="MSB4006: "}UE: This message is shown when the build engine detects a target referenced in a circular manner -- a project cannot - request a target to build itself (perhaps via a chain of other targets). - - MSB4006: Im Zielabhängigkeitsdiagramm besteht eine Ringabhängigkeit im Zusammenhang mit dem Ziel "{0}". - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4086: A numeric comparison was attempted on "{1}" that evaluates to "{2}" instead of a number, in condition "{0}". - MSB4086: Es wurde versucht, einen numerischen Vergleich für "{1}" auszuführen, der zu "{2}" anstatt zu einer Zahl in Bedingung "{0}" ausgewertet wird. - {StrBegin="MSB4086: "} - - MSB4086: Es wurde versucht, einen numerischen Vergleich für "{1}" auszuführen, der zu "{2}" anstatt zu einer Zahl in Bedingung "{0}" ausgewertet wird. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4007: The clause "{0}", specified in the "{1}" attribute is invalid. - MSB4007: Die im {1}-Attribut festgelegte {0}-Klausel ist ungültig. - {StrBegin="MSB4007: "}UE: This message is shown when the Condition on an element is invalid in some way -- e.g. syntax error, unrecognized operator. - - MSB4007: Die im {1}-Attribut festgelegte {0}-Klausel ist ungültig. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4130: The condition "{0}" may have been evaluated incorrectly in an earlier version of MSBuild. Please verify that the order of the AND and OR clauses is written as intended. To avoid this warning, add parentheses to make the evaluation order explicit. - MSB4130: Die Bedingung "{0}" wurde in einer früheren Version von MSBuild möglicherweise fehlerhaft ausgewertet. Stellen Sie sicher, dass die AND- und OR-Klauseln in der beabsichtigten Reihenfolge stehen. Damit diese Warnung nicht angezeigt wird, fügen Sie Klammern hinzu, um die Auswertungsreihenfolge explizit anzugeben. - {StrBegin="MSB4130: "} - - MSB4130: Die Bedingung "{0}" ist in einer früheren Version von MSBuild möglicherweise fehlerhaft ausgewertet worden. Stellen Sie sicher, dass die AND- und OR-Klauseln in der beabsichtigten Reihenfolge stehen. Damit diese Warnung nicht angezeigt wird, fügen Sie Klammern hinzu, um die Auswertungsreihenfolge explizit anzugeben. - - fuzzyMatch="101" wordcount="42" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4087: Specified condition "{0}" does not evaluate to a boolean. - MSB4087: Die angegebene {0}-Bedingung wird nicht zu einem booleschen Wert ausgewertet. - {StrBegin="MSB4087: "} - - MSB4087: Die angegebene {0}-Bedingung wird nicht zu einem booleschen Wert ausgewertet. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4113: Specified condition "{0}" evaluates to "{1}" instead of a boolean. - MSB4113: Die angegebene Bedingung {0} wird zu {1} statt zu einem booleschen Wert ausgewertet. - {StrBegin="MSB4113: "} - - MSB4113: Die angegebene Bedingung {0} wird zu {1} statt zu einem booleschen Wert ausgewertet. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - {0}, line {1} - {0}, Zeile {1} - - - {0}, Zeile {1} - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - MSB4136: Error reading the toolset information from the configuration file "{0}". {1} - MSB4136: Fehler beim Lesen der Toolsetinformationen aus der Konfigurationsdatei "{0}". {1} - {StrBegin="MSB4136: "} - - MSB4136: Fehler beim Lesen der Toolsetinformationen aus der Konfigurationsdatei "{0}". {1} - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4008: A conflicting assembly for the task assembly "{0}" has been found at "{1}". - MSB4008: Eine mit der Aufgabenassembly "{0}" in Konflikt stehende Assembly wurde in "{1}" gefunden. - {StrBegin="MSB4008: "}UE: This message is shown when the type/class of a task cannot be resolved uniquely from a single assembly. - - MSB4008: Eine mit der Aufgabenassembly "{0}" in Konflikt stehende Assembly wurde in "{1}" gefunden. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4142: MSBuildToolsPath is not the same as MSBuildBinPath for the ToolsVersion "{0}" defined at "{1}". If both are present they must have the same value. - MSB4142: MSBuildToolsPath ist nicht identisch mit MSBuildBinPath für die bei "{1}" definierte ToolsVersion {0}. Wenn beide Pfade vorhanden sind, müssen sie identische Werte haben. - {StrBegin="MSB4142: "} - - MSB4142: MSBuildToolsPath ist nicht identisch mit MSBuildBinPath für die bei "{1}" definierte ToolsVersion {0}. Wenn beide Pfade vorhanden sind, müssen sie identische Werte haben. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4097: The element <{0}> beneath element <{1}> may not have a custom XML namespace. - MSB4097: Das <{0}>-Element unterhalb des <{1}>-Elements enthält möglicherweise keinen benutzerdefinierten XML-Namespace. - {StrBegin="MSB4097: "} - - MSB4097: Das Element <{0}> unter Element <{1}> möglicherweise keinen benutzerdefinierten XML-Namespace. - - fuzzyMatch="15" wordcount="16" adjWordcount="13.6" curWordcount="13.6" - - - MSB4009: The default tasks file could not be successfully loaded. {0} - MSB4009: Die Standardaufgabendatei konnte nicht geladen werden. {0} - {StrBegin="MSB4009: "}UE: This message is shown when one of the default tasks file (*.tasks) located alongside the MSBuild binaries cannot - be opened/parsed. "{0}" contains a message explaining why. The filename itself is not part of the message but is provided - separately to loggers. - LOCALIZATION: "{0}" is a message from some FX method and is already localized. - - MSB4009: Die Standardaufgabendatei konnte nicht geladen werden. {0} - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4010: The "{0}" files could not be successfully loaded from their expected location "{1}". Default tasks will not be available. {2} - MSB4010: Die "{0}"-Dateien konnten nicht vom erwarteten Speicherplatz "{1}" geladen werden. Standardaufgaben sind nicht verfügbar. {2} - {StrBegin="MSB4010: "}UE: This message is shown when the default tasks files that are located alongside the MSBuild binaries cannot be - found, either because they don't exist, or because of lack of permissions. "{2}" contains a message explaining why. - LOCALIZATION: "{2}" is a message from some FX method and is already localized. - - MSB4010: Die {0}-Dateien konnten nicht vom erwarteten Speicherplatz "{1}" geladen werden. Standardaufgaben sind nicht verfügbar. {2} - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - MSB4140: Default tools version is specified in neither the registry nor the configuration file. - MSB4140: Die Standardtoolsversion ist weder in der Registrierung noch in der Konfigurationsdatei angegeben. - {StrBegin="MSB4140: "} - - MSB4140: Die Standardtoolsversion ist weder in der Registrierung noch in der Konfigurationsdatei angegeben. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4133: A default tools version "{0}" was specified, but its definition could not be found. - MSB4133: Eine Standardtoolsversion "{0}" wurde angegeben, aber ihre Definition konnte nicht gefunden werden. - {StrBegin="MSB4133: "} - - MSB4133: Eine Standardtoolsversion "{0}" wurde angegeben, aber ihre Definition konnte nicht gefunden werden. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - MSB4080: The value "{0}" of the "PropertyName" attribute in element <Output> contains a "$" character. If you intended to use a property name then remove the $( ) around the property name. - MSB4080: Der {0}-Wert des PropertyName-Attributs im <Output>-Element enthält das Zeichen "$". Falls ein Eigenschaftenname verwendet werden soll, entfernen Sie die Zeichen $( ) vor und hinter dem Eigenschaftennamen. - {StrBegin="MSB4080: "}UE: This message is shown when an output tag has an property name that contains an $. They probably typed $(foo) instead of foo in the PropertyName. LOCALIZATION: Output and PropertyName should not be localized. - - MSB4080: Der Wert "{0}" "PropertyName-Attribut im Element < Output >"$"-Zeichen enthält. Wenn Sie auf einen Eigenschaftennamen verwenden und entfernen Sie anschließend die ($), um den Eigenschaftennamen. - - fuzzyMatch="15" wordcount="32" adjWordcount="27.2" curWordcount="27.2" - - - MSB4011: There is a circular reference involving the import of file "{0}". This file may have been imported more than once, or you may have attempted to import the main project file. All except the first instance of this file will be ignored. - MSB4011: Es besteht eine Ringabhängigkeit im Zusammenhang mit dem Import der Datei {0}. Diese Datei wurde unter Umständen mehrmals importiert, oder es wurde versucht, die Hauptprojektdatei zu importieren. Alle außer der ersten Instanz dieser Datei werden ignoriert. - {StrBegin="MSB4011: "} - - MSB4011: Es besteht eine Ringabhängigkeit im Zusammenhang mit dem Import der Datei {0}. Diese Datei wurde unter Umständen mehrmals importiert, oder es wurde versucht, die Hauptprojektdatei zu importieren. Alle außer der ersten Instanz dieser Datei werden ignoriert. - - fuzzyMatch="101" wordcount="43" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4079: The <ProjectExtensions> element occurs more than once. - MSB4079: Das <ProjectExtensions>-Element ist mehrmals vorhanden. - {StrBegin="MSB4079: "} - - MSB4079: Das Element < ProjectExtensions > tritt mehr als einmal. - - fuzzyMatch="15" wordcount="9" adjWordcount="7.65" curWordcount="7.65" - - - MSB4012: The expression "{0}" cannot be used in this context. Item lists cannot be concatenated with other strings where an item list is expected. Use a semicolon to separate multiple item lists. - MSB4012: Der Ausdruck "{0}" kann in diesem Kontext nicht verwendet werden. Elementlisten können nicht mit anderen Zeichenfolgen verkettet werden, wenn eine Elementliste erwartet wird. Verwenden Sie ein Semikolon, um mehrere Elementlisten voneinander zu trennen. - {StrBegin="MSB4012: "}UE: This message is shown when the user does not properly specify an item list when an item list is expected - e.g. "badprefix@(foo)badsuffix" instead of "prefix; @(foo); suffix" - - MSB4012: Der Ausdruck {0} kann in diesem Kontext nicht verwendet werden. Elementlisten können nicht mit anderen Zeichenfolgen verkettet werden, wenn eine Elementliste erwartet wird. Verwenden Sie ein Semikolon, um mehrere Elementlisten voneinander zu trennen. - - fuzzyMatch="101" wordcount="32" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Need to specify the project file name. - Geben Sie den Projektdateinamen an. - UE: This message is shown when the user calls into the engine to build a project without specifying a filename. - - Geben Sie den Projektdateinamen an. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - end of input - Ende der Eingabe - This is the name of the "EndOfInput" token. It is displayed in quotes as the - unexpected char or token when the end of a conditional was unexpectedly reached. - - Ende der Eingabe - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - The previous error was converted to a warning because the task was called with ContinueOnError=true. - Der vorherige Fehler wurde in eine Warnung umgewandelt, da die Aufgabe mit ContinueOnError=true aufgerufen wurde. - - - Der vorherige Fehler wurde in eine Warnung umgewandelt, da die Aufgabe mit ContinueOnError=true aufgerufen wurde. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - {0} Error(s) - {0} Fehler - - - {0} Fehler - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4159: Error creating the toolset "{0}". {1} - MSB4159: Fehler beim Erstellen des Toolsets "{0}". {1} - {StrBegin="MSB4159: "} - - MSB4159: Fehler beim Erstellen des Toolsets "{0}". {1} - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4146: Cannot evaluate the property expression "{0}" found at "{1}". {2} - MSB4146: Der bei "{1}" gefundene Eigenschaftsausdruck "{0}" kann nicht ausgewertet werden. {2} - {StrBegin="MSB4146: "} - - MSB4146: Der bei "{1}" gefundene Eigenschaftsausdruck "{0}" kann nicht ausgewertet werden. {2} - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - The <{0}> tag is no longer supported as a child of the <Project> element. Place this tag within a target, and add the name of the target to the "InitialTargets" attribute of the <Project> element. - Die <{0}>-Kennung wird nicht mehr als untergeordnetes Element des <Project>-Elements unterstützt. Platzieren Sie diese Kennung in einem Ziel, und fügen Sie den Namen des Ziels dem InitialTargets-Attribut des <Project>-Elements hinzu. - - - Das <{0}>-Tag nicht als untergeordnetes Element des < Project >-Elements unterstützt. Platzieren Sie dieses Tag in einem Ziel und fügen Sie den Namen des Ziels InitialTargets-Attribut des < Project >-Elements hinzu. - - fuzzyMatch="15" wordcount="38" adjWordcount="32.3" curWordcount="32.3" - - - MSB4100: Expected "{0}" to evaluate to a boolean instead of "{1}", in condition "{2}". - MSB4100: Das Ergebnis der Auswertung von {0} war {1}, es wurde jedoch ein boolescher Wert in der {2}-Bedingung erwartet. - {StrBegin="MSB4100: "} - - MSB4100: Das Ergebnis der Auswertung von {0} war {1}, es wurde jedoch ein boolescher Wert in der {2}-Bedingung erwartet. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4028: The "{0}" task's outputs could not be retrieved from the "{1}" parameter. {2} - MSB4028: Die Ausgaben der {0}-Aufgabe konnten nicht aus dem {1}-Parameter abgerufen werden. {2} - {StrBegin="MSB4028: "} - - MSB4028: Die Ausgaben der {0}-Aufgabe konnten nicht aus dem {1}-Parameter abgerufen werden. {2} - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4014: The build was aborted because of an internal failure. - MSB4014: Das Erstellen wurde aufgrund eines internen Fehlers abgebrochen. - {StrBegin="MSB4014: "}UE: This message is shown when an unhandled exception terminates the build. The cause is most likely a programming - error in the build engine. - - MSB4014: Das Erstellen wurde aufgrund eines internen Fehlers abgebrochen. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4015: The build was aborted because the "{0}" logger failed unexpectedly during shutdown. - MSB4015: Das Erstellen wurde abgebrochen, da für die {0}-Protokollierung beim Herunterfahren ein unerwarteter Fehler aufgetreten ist. - {StrBegin="MSB4015: "}UE: This message is used for a special exception that is thrown when a logger fails while shutting down (most likely - because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a special - exception to abort the build. - - MSB4015: Das Erstellen wurde abgebrochen, da für die {0}-Protokollierung beim Herunterfahren ein unerwarteter Fehler aufgetreten ist. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4016: The build was aborted because the "{0}" logger failed unexpectedly during initialization. - MSB4016: Das Erstellen wurde abgebrochen, da für die {0}-Protokollierung bei der Initialisierung ein unerwarteter Fehler aufgetreten ist. - {StrBegin="MSB4016: "}UE: This message is used for a special exception that is thrown when a logger fails while initializing itself (most - likely because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a - special exception to abort the build. - - MSB4016: Das Erstellen wurde abgebrochen, da für die {0}-Protokollierung bei der Initialisierung ein unerwarteter Fehler aufgetreten ist. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4017: The build was aborted because of an unexpected logger failure. - MSB4017: Das Erstellen wurde wegen eines unerwarteten Protokollierungsfehlers abgebrochen. - {StrBegin="MSB4017: "}UE: This message is used for a special exception that is thrown when a logger fails while logging an event (most - likely because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a - special exception to abort the build. - - MSB4017: Das Erstellen wurde wegen eines unerwarteten Protokollierungsfehlers abgebrochen. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4018: The "{0}" task failed unexpectedly. - MSB4018: Unerwarteter Fehler bei der {0}-Aufgabe. - {StrBegin="MSB4018: "}UE: This message is shown when a task terminates because of an unhandled exception. The cause is most likely a - programming error in the task; however, it is also possible that the unhandled exception originated in the engine, and was - surfaced through the task when the task called into the engine. - - MSB4018: Unerwarteter Fehler bei der {0}-Aufgabe. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4165: Failed to receive a response from the child node "{0}" in the timeout period "{1}" ms. Shutting down. - MSB4165: Vom untergeordneten Knoten "{0}" wurde innerhalb des Zeitlimits von "{1}" ms keine Antwort empfangen. Herunterfahren. - {StrBegin="MSB4165: "} - - MSB4165: Vom untergeordneten Knoten "{0}" wurde innerhalb des Zeitlimits von "{1}" ms keine Antwort empfangen. Herunterfahren. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4088: Condition "{0}" is improperly constructed. - MSB4088: Die {0}-Bedingung ist falsch konstruiert. - {StrBegin="MSB4088: "} - - MSB4088: Die {0}-Bedingung ist falsch konstruiert. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4105: Found an unexpected character '{2}' at position {1} in condition "{0}". Did you intend to use "=="? - MSB4105: Das unerwartete Zeichen '{2}' wurde an Position {1} in der Bedingung "{0}" gefunden. Wollten Sie "==" verwenden? - {StrBegin="MSB4105: "} - - MSB4105: Ein unerwartetes Zeichen {2} wurde an Position {1} in der {0}-Bedingung gefunden. Wollten Sie "==" verwenden? - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - MSB4106: Expected an item list at position {1} in condition "{0}". Did you forget the closing parenthesis? - MSB4106: Eine Elementliste wurde an Position {1} in Bedingung "{0}" erwartet. Haben Sie die schließende Klammer vergessen? - {StrBegin="MSB4106: "} - - MSB4106: Eine Elementliste wurde an Position {1} in Bedingung {0} erwartet. Haben Sie die schließende Klammer vergessen? - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - MSB4107: Expected an item list at position {1} in condition "{0}". Did you forget the opening parenthesis after the '@'? To use a literal '@', use '%40' instead. - MSB4107: Eine Elementliste wurde an Position {1} in Bedingung "{0}" erwartet. Haben Sie die öffnende Klammer hinter dem Zeichen '@' vergessen? Wenn Sie ein literales '@' verwenden möchten, geben Sie stattdessen '%40' ein. - {StrBegin="MSB4107: "} - - MSB4107: Eine Elementliste wurde an Position {1} in Bedingung {0} erwartet. Haben Sie die öffnende Klammer hinter dem Zeichen "@" vergessen? Wenn Sie ein literales "@" verwenden möchten, geben Sie "%40" ein. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4108: Expected an item list at position {1} in condition "{0}". Did you forget to close a quote inside the item list expression? - MSB4108: Eine Elementliste wurde an Position {1} in Bedingung "{0}" erwartet. Haben Sie das schließende Anführungszeichen innerhalb des Elementlistenausdrucks vergessen? - {StrBegin="MSB4108: "} - - MSB4108: Eine Elementliste wurde an Position {1} in Bedingung {0} erwartet. Haben Sie das schließende Anführungszeichen innerhalb des Elementlistenausdrucks vergessen? - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - MSB4109: Expected a property at position {1} in condition "{0}". Did you forget the closing parenthesis? - MSB4109: Eine Eigenschaft wurde an Position {1} in Bedingung "{0}" erwartet. Haben Sie die schließende Klammer vergessen? - {StrBegin="MSB4109: "} - - MSB4109: Eine Eigenschaft wurde an Position {1} in Bedingung {0} erwartet. Haben Sie die schließende Klammer vergessen? - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB4110: Expected a property at position {1} in condition "{0}". Did you forget the opening parenthesis after the '$'? To use a literal '$', use '%24' instead. - MSB4110: Eine Eigenschaft wurde an Position {1} in Bedingung "{0}" erwartet. Haben Sie die öffnende Klammer hinter dem '$' vergessen? Wenn Sie ein literales '$' verwenden möchten, geben Sie stattdessen '%24' ein. - {StrBegin="MSB4110: "} - - MSB4110: Eine Eigenschaft wurde an Position {1} in Bedingung {0} erwartet. Haben Sie die öffnende Klammer hinter dem Zeichen "$" vergessen? Wenn Sie eine literales "$" verwenden möchten, geben Sie "%24" ein. - - fuzzyMatch="101" wordcount="27" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4101: Expected a closing quote after position {1} in condition "{0}". - MSB4101: Es wurde ein schließendes Anführungszeichen hinter Position {1} in Bedingung {0} erwartet. - {StrBegin="MSB4101: "} - - MSB4101: Es wurde ein schließendes Anführungszeichen hinter Position {1} in Bedingung {0} erwartet. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4019: The imported project "{0}" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. - MSB4019: Das importierte Projekt "{0}" wurde nicht gefunden. Vergewissern Sie sich, dass der Pfad in der <Import>-Deklaration korrekt und die Datei auf dem Datenträger vorhanden ist. - {StrBegin="MSB4019: "}LOCALIZATION: <Import> should not be localized. - - MSB4019: Das importierte Projekt "{0}" wurde nicht gefunden. Bestätigen Sie den Pfad in der Deklaration < Import > und die Datei auf dem Datenträger vorhanden ist. - - fuzzyMatch="15" wordcount="26" adjWordcount="22.1" curWordcount="22.1" - - - MSB4089: Incorrect number of arguments to function in condition "{0}". Found {1} argument(s) when expecting {2}. - MSB4089: Falsche Anzahl von Argumenten für eine Funktion in der Bedingung "{0}". {1} Argument(e) gefunden, obwohl {2} erwartet wurde(n). - {StrBegin="MSB4089: "} - - MSB4089: Falsche Anzahl von Argumenten für eine Funktion in der Bedingung "{0}". {1} Argument(e) gefunden, obwohl {2} erwartet wurde(n). - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - The "{0}" object specified does not belong to the correct "{1}" object. - Das angegebene {0}-Objekt gehört nicht zum korrekten {1}-Objekt. - - - Das angegebene {0}-Objekt gehört nicht zum korrekten {1}-Objekt. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4020: The value "{0}" of the "{1}" attribute in element <{2}> is invalid. - MSB4020: Der Wert "{0}" des {1}-Attributs im <{2}>-Element ist ungültig. - {StrBegin="MSB4020: "}UE: This is a generic message that is displayed when we find a project element with an incorrect value for one of its - attributes e.g. <Import Project=""> -- the value of Project should not be an empty string. - - MSB4020: Der Wert "{0}" von der "{1}" Attribut im Element <{2}> ist ungültig. - - fuzzyMatch="15" wordcount="14" adjWordcount="11.9" curWordcount="11.9" - - - MSB4102: The value "{0}" of the "{1}" attribute in element <{2}> is invalid. {3} - MSB4102: Der Wert "{0}" des {1}-Attributs im <{2}>-Element ist ungültig. {3} - {StrBegin="MSB4102: "}UE: This is a generic message that is displayed when we find a project element with an incorrect value for one of its - attributes. At the end of the message we show the exception text we got trying to use the value. - - MSB4102: Der Wert "{0}" von der "{1}" Attribut im Element <{2}> ist ungültig. {3} - - fuzzyMatch="15" wordcount="15" adjWordcount="12.75" curWordcount="12.75" - - - MSB4021: The "ContinueOnError" attribute of the "{0}" task is not valid. {1} - MSB4021: Das ContinueOnError-Attribut für die {0}-Aufgabe ist ungültig. {1} - {StrBegin="MSB4021: "}LOCALIZATION: "ContinueOnError" should not be localized. "{1}" is a message from another exception explaining the problem. - - MSB4021: Das ContinueOnError-Attribut für die {0}-Aufgabe ist ungültig. {1} - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4139: Invalid value for default ToolsVersion is specified in registry key "{0}". - MSB4139: Im Registrierungsschlüssel "{0}" ist ein ungültiger Wert für die Standard-ToolsVersion angegeben. - {StrBegin="MSB4139: "} - - MSB4139: Im Registrierungsschlüssel "{0}" ist ein ungültiger Wert für die Standard-ToolsVersion angegeben. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4022: The result "{0}" of evaluating the value "{1}" of the "{2}" attribute in element <{3}> is not valid. - MSB4022: Das Ergebnis "{0}" der Auswertung des Werts "{1}" des {2}-Attributs im <{3}>-Element ist ungültig. - {StrBegin="MSB4022: "}UE: This message is shown when the engine is checking the correctness of the value (after evaluating embedded - properties/items) assigned to an XML attribute of an XML element in the project file. - - MSB4022: Das Ergebnis "{0}"der Auswertung des Werts"{1}" von der "{2}" Attribut im Element <{3}> ist ungültig. - - fuzzyMatch="15" wordcount="20" adjWordcount="17" curWordcount="17" - - - "{0}" is not a valid event category. To raise a custom event, use the "{1}" category. - {0} ist keine gültige Ereigniskategorie. Verwenden Sie die {1}-Kategorie, um ein benutzerdefiniertes Ereignis auszulösen. - - - {0} ist keine gültige Ereigniskategorie. Verwenden Sie die {1}-Kategorie, um ein benutzerdefiniertes Ereignis auszulösen. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - "{0}" is not a valid importance level for events. - {0} ist kein gültiger Wert für die Bedeutung eines Ereignisses. - - - {0} ist kein gültiger Wert für die Bedeutung eines Ereignisses. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4104: Failed to write to log file "{0}". {1} - MSB4104: Fehler beim Schreiben in die Protokollierungsdatei "{0}". {1} - {StrBegin="MSB4104: "}UE: This is shown when the File Logger can't create or write to the file it was instructed to log to. - - MSB4104: Fehler beim Schreiben in die Protokollierungsdatei "{0}". {1} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4024: The imported project file could not be loaded. {0} - MSB4024: Die importierte Projektdatei konnte nicht geladen werden. {0} - {StrBegin="MSB4024: "}UE: This message is shown when an imported project file cannot be loaded because of incorrect XML. The project - filename is not part of the message because it is provided separately to loggers. - LOCALIZATION: {0} is a localized message from the CLR/FX explaining why the project is invalid. - - MSB4024: Die importierte Projektdatei konnte nicht geladen werden. {0} - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - Operation invalid for a persisted item group. - Ungültiger Vorgang für eine persistente Elementgruppe. - - - Ungültiger Vorgang für eine persistente Elementgruppe. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Operation invalid for a virtual item group. - Ungültiger Vorgang für eine virtuelle Elementgruppe. - - - Ungültiger Vorgang für eine virtuelle Elementgruppe. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4071: The value Importance="{0}" in the <Message> element is invalid. Valid values are: High, Normal and Low. - MSB4071: Der Wert Importance={0} im <Message>-Element ist ungültig. Gültige Werte sind: High, Normal und Low. - {StrBegin="MSB4071: "}UE: This message is shown when a user specifies a value for the importance attribute of Message which is not valid. - The importance enumeration is: High, Normal and Low. Specifying any other importance will result in this message being shown - LOCALIZATION: "Importance" should not be localized. - "Message" should not be localized. - High should not be localized. - Normal should not be localized. - Low should not be localized. - - MSB4071: Der Wert Importance = "{0}" in < Nachricht > Element ist ungültig. Gültige Werte sind: hoch, Normal und niedrig. - - fuzzyMatch="15" wordcount="18" adjWordcount="15.3" curWordcount="15.3" - - - MSB4025: The project file could not be loaded. {0} - MSB4025: Die Projektdatei konnte nicht geladen werden. {0} - {StrBegin="MSB4025: "}UE: This message is shown when the project file given to the engine cannot be loaded because the filename/path is - invalid, or due to lack of permissions, or incorrect XML. The project filename is not part of the message because it is - provided separately to loggers. - LOCALIZATION: {0} is a localized message from the CLR/FX explaining why the project is invalid. - - MSB4025: Die Projektdatei konnte nicht geladen werden. {0} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4147: The property "{0}" at "{1}" is invalid. {2} - MSB4147: Die {0}-Eigenschaft bei "{1}" ist ungültig. {2} - {StrBegin="MSB4147: "} - - MSB4147: Die {0}-Eigenschaft bei "{1}" ist ungültig. {2} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - "{0}" is an invalid "ProjectFileEncoding" value. - {0} ist ein ungültiger ProjectFileEncoding-Wert. - LOCALIZATION: "ProjectFileEncoding" should not be localized. - - {0} ist ein ungültiger ProjectFileEncoding-Wert. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4143: The expression "{0}" cannot be evaluated. {1} - MSB4143: Der Ausdruck "{0}" kann nicht ausgewertet werden. {1} - {StrBegin="MSB4143: "} - UE: This message is shown when the user attempts to provide an expression like "$(Registry:HKEY_LOCAL_MACHINE\Software\Vendor\Tools@TaskLocation)" - LOCALIZATION: "{0}" is the expression that was bad. "{1}" is a message from an FX exception that describes why the expression is bad. - - - MSB4143: Der Ausdruck "{0}" kann nicht ausgewertet werden. {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4184: The expression "{0}" cannot be evaluated. {1} - MSB4184: Der Ausdruck "{0}" kann nicht ausgewertet werden. {1} - {StrBegin="MSB4184: "} - Single quotes as the expression will typically have double quotes in it. - UE: This message is shown when the user attempts to provide an expression like "$(SomeProperty.ToLower())" - LOCALIZATION: "{0}" is the expression that was bad. "{1}" is a message from an FX exception that describes why the expression is bad. - - - MSB4184: Der Ausdruck "{0}" kann nicht ausgewertet werden. {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4185: The function "{0}" on type "{1}" has not been enabled for execution. - MSB4185: Die {0}-Funktion für den {1}-Typ wurde nicht für die Ausführung aktiviert. - {StrBegin="MSB4185: "} - UE: This message is shown when the user attempts to provide an expression like "$([System.DateTime]::Now)", but the expression has not been enabled - LOCALIZATION: "{0}" is the static function name, "{1}" is the .NET Framework type name - - - MSB4185: Die {0}-Funktion für den {1}-Typ wurde nicht für die Ausführung aktiviert. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4186: Invalid static method invocation syntax: "{0}". Static method invocation should be of the form: $([FullTypeName]::Method()), e.g. $([System.IO.Path]::Combine(`a`, `b`)) - MSB4186: Ungültige Aufrufsyntax für statische Methode: "{0}". Für den Aufruf statischer Methoden muss folgendes Format verwendet werden: $([vollständiger Typname]::Methode()), z. B. $([System.IO.Path]::Combine(`a`, `b`)) - {StrBegin="MSB4186: "} - UE: This message is shown when the user attempts to call a static method on a type, but has used the incorrect syntax - LOCALIZATION: "{0}" is the function expression which is in error - - - MSB4186: Ungültige Aufrufsyntax für statische Methode: "{0}". Für den Aufruf statischer Methoden muss folgendes Format verwendet werden: $([vollständiger Typname]::Methode()), z. B. $([System.IO.Path]::Combine(`a`, `b`)) - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4070: The schema "{0}" is not valid. {1} - MSB4070: Das Schema "{0}" ist nicht gültig. {1} - {StrBegin="MSB4070: "}UE: This message is shown when the schema file provided for the validation of a project is itself not valid. - LOCALIZATION: "{0}" is the schema file path. "{1}" is a message from an FX exception that describes why the schema file is bad. - - MSB4070: Das Schema "{0}" ist nicht gültig. {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4026: The "{0}={1}" parameter for the "{2}" task is invalid. - MSB4026: Der {0}={1}-Parameter für die {2}-Aufgabe ist ungültig. - {StrBegin="MSB4026: "}UE: This message is displayed when a task has an invalid parameter that cannot be initialized. - - MSB4026: Der {0}={1}-Parameter für die {2}-Aufgabe ist ungültig. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4027: The "{0}" task generated invalid items from the "{1}" output parameter. {2} - MSB4027: Die {0}-Aufgabe generierte ungültige Elemente aus dem {1}-Ausgabeparameter. {2} - {StrBegin="MSB4027: "} - - MSB4027: Die {0}-Aufgabe generierte ungültige Elemente aus dem {1}-Ausgabeparameter. {2} - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4029: The "{0}" task has an invalid output specification. The "TaskParameter" attribute is required, and either the "ItemName" or "PropertyName" attribute must be specified (but not both). - MSB4029: Die "{0}"-Aufgabe enthält eine ungültige Ausgabespezifikation. Das "TaskParameter"-Attribut ist erforderlich, und es muss entweder das "ItemName"- oder "PropertyName"-Attribut angegeben werden (jedoch nicht beide). - {StrBegin="MSB4029: "}LOCALIZATION: "TaskParameter", "ItemName" and "PropertyName" should not be localized. - - MSB4029: Die {0}-Aufgabe enthält eine ungültige Ausgabespezifikation. Das TaskParameter-Attribut ist erforderlich, und es muss entweder das ItemName- oder PropertyName-Attribut angegeben werden (jedoch nicht beide). - - fuzzyMatch="101" wordcount="27" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4030: "{0}" is an invalid value for the "{1}" parameter of the "{3}" task. The "{1}" parameter is of type "{2}". - MSB4030: "{0}" ist ein ungültiger Wert für den "{1}"-Parameter der "{3}"-Aufgabe. Der "{1}"-Parameter ist vom Typ "{2}". - {StrBegin="MSB4030: "}UE: This error is shown when a type mis-match occurs between the value assigned to task parameter in the project file - and the type of the .NET property that corresponds to the task parameter. For example, if an int task parameter called "Count" - is assigned the value "x", this error would be displayed: <MyTask Count="x" /> - - MSB4030: "{0}" ist ein ungültiger Wert für den {1}-Parameter der {3}-Aufgabe. Der {1}-Parameter ist vom Typ "{2}". - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - MSB4137: Invalid value specified in the configuration file at "{0}". Property name or tools version name is an empty string. - MSB4137: In der Konfigurationsdatei ist bei "{0}" ein ungültiger Wert angegeben. Der Eigenschaftenname oder der Toolsversionname ist eine leere Zeichenfolge. - {StrBegin="MSB4137: "} - - MSB4137: In der Konfigurationsdatei ist bei "{0}" ein ungültiger Wert angegeben. Der Eigenschaftenname oder der Toolsversionname ist eine leere Zeichenfolge. - - fuzzyMatch="100" wordcount="20" adjWordcount="5" curWordcount="5" tmLabel="N''" - - - MSB4103: "{0}" is not a valid logger verbosity level. - MSB4103: "{0}" ist kein gültiger Ausführlichkeitsgrad für die Protokollierung. - {StrBegin="MSB4103: "} - - MSB4103: "{0}" ist kein gültiger Ausführlichkeitsgrad für die Protokollierung. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4163: <ItemDefinitionGroup> is not allowed inside a target. - MSB4163: <ItemDefinitionGroup> ist in einem Ziel nicht zulässig. - {StrBegin="MSB4163: "} - - MSB4163: < ItemDefinitionGroup > ist in einem Ziel nicht zulässig. - - fuzzyMatch="15" wordcount="9" adjWordcount="7.65" curWordcount="7.65" - - - The specified item does not belong to the current item group. - Das angegebene Element gehört nicht zu der aktuellen Elementgruppe. - - - Das angegebene Element gehört nicht zu der aktuellen Elementgruppe. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4096: The item "{0}" in item list "{1}" does not define a value for metadata "{2}". In order to use this metadata, either qualify it by specifying %({1}.{2}), or ensure that all items in this list define a value for this metadata. - MSB4096: Das Element "{0}" in der Elementliste "{1}" definiert keinen Wert für die Metadaten "{2}". Wenn Sie diese Metadaten verwenden möchten, qualifizieren Sie sie, indem Sie %({1}.{2}) angeben, oder vergewissern Sie sich, dass alle Elemente in der Liste einen Wert für diese Metadaten definieren. - {StrBegin="MSB4096: "} - - MSB4096: Das Element "{0}" in der Elementliste "{1}" definiert keinen Wert für die {2}-Metadaten. Wenn Sie diese Metadaten verwenden möchten, qualifizieren Sie sie, indem Sie %({1}.{2}) angeben, oder vergewissern Sie sich, dass alle Elemente in der Liste einen Wert für diese Metadaten definieren. - - fuzzyMatch="101" wordcount="42" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4099: A reference to an item list at position {1} is not allowed in this condition "{0}". - MSB4099: Ein Verweis auf eine Elementliste an Position {1} ist in dieser {0}-Bedingung nicht zulässig. - {StrBegin="MSB4099: "} - - MSB4099: Ein Verweis auf eine Elementliste an Position {1} ist in dieser {0}-Bedingung nicht zulässig. - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - MSB4033: "{0}" is a reserved item metadata, and cannot be redefined as a custom metadata on the item. - MSB4033: "{0}" sind reservierte Elementmetadaten und können nicht als benutzerdefinierte Metadaten für das Element neu definiert werden. - {StrBegin="MSB4033: "} - - MSB4033: "{0}" sind reservierte Elementmetadaten und können nicht als benutzerdefinierte Metadaten für das Element neu definiert werden. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - An InternalLoggerException can only be thrown by the MSBuild engine. The public constructors of this class cannot be used to create an instance of the exception. - Eine InternalLoggerException kann nur durch die MSBuild-Engine ausgelöst werden. Die öffentlichen Konstruktoren dieser Klasse können nicht verwendet werden, um eine Instanz der Ausnahme zu erstellen. - UE: This message is shown when a user tries to instantiate a special exception called InternalLoggerException through the OM -- - only the engine is allowed to create and throw this exception. - LOCALIZATION: "InternalLoggerException" and "MSBuild" should not be localized. - - Eine InternalLoggerException kann nur durch das MSBuild-Modul ausgelöst werden. Die öffentlichen Konstruktoren dieser Klasse können nicht verwendet werden, um eine Instanz der Ausnahme zu erstellen. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Initial Items: - Ursprüngliche Elemente: - - - Ursprüngliche Elemente: - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4083: Expected a Condition attribute on element "{0}". - MSB4083: Es wurde ein Bedingungsattribut für das {0}-Element erwartet. - {StrBegin="MSB4083: "} - - MSB4083: Es wurde ein Bedingungsattribut für das {0}-Element erwartet. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4164: The value "{0}" of metadata "{1}" contains an item list expression. Item list expressions are not allowed on default metadata values. - MSB4164: Der Wert "{0}" der "{1}"-Metadaten enthält einen Elementlistenausdruck. Elementlistenausdrücke sind nicht als Standardwerte für Metadaten zulässig. - {StrBegin="MSB4164: "} - - MSB4164: Der Wert "{0}" der {1}-Metadaten enthält einen Elementlistenausdruck. Elementlistenausdrücke sind nicht als Standardwerte für Metadaten zulässig. - - fuzzyMatch="100" wordcount="22" adjWordcount="5.5" curWordcount="5.5" tmLabel="N''" - - - MSBuild is expecting a valid "{0}" object. - MSBuild erwartet ein gültiges {0}-Objekt. - - - MSBuild erwartet ein gültiges {0}-Objekt. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4035: The required attribute "{0}" is missing from element <{1}>. - MSB4035: Das erforderliche {0}-Attribut fehlt beim <{1}>-Element. - {StrBegin="MSB4035: "}UE: This message is shown when a user leaves off a required attribute from a project element - e.g. <UsingTask AssemblyName="foo"> -- this is missing the "TaskName" attribute. - - MSB4035: Das erforderliche Attribut "{0}"-Element fehlt <{1}>. - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB4036: The "{0}" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "{1}" directory. - MSB4036: Die {0}-Aufgabe wurde nicht gefunden. Überprüfen Sie Folgendes: 1.) Der Name der Aufgabe in der Projektdatei entspricht dem Namen der Aufgabenklasse. 2.) Die Aufgabenklasse ist "public" und implementiert die Microsoft.Build.Framework.ITask-Schnittstelle. 3.) Die Aufgabe ist in der Projektdatei oder in den TASKS-Dateien im Verzeichnis "{1}" mit <UsingTask> richtig deklariert. - {StrBegin="MSB4036: "}LOCALIZATION: <UsingTask> and "*.tasks" should not be localized. - - MSB4036: Die "{0}" Task wurde nicht gefunden. Überprüfen Sie Folgendes: 1.) der Name der Aufgabe in der Projektdatei entspricht dem Namen der Aufgabenklasse. 2) die Aufgabenklasse ist "public" und implementiert die Microsoft.Build.Framework.ITask-Schnittstelle. 3) die Aufgabe korrekt mit < UsingTask > deklariert, in der Projektdatei oder in den Tasks-Dateien der "{1}" Verzeichnis. - - fuzzyMatch="15" wordcount="64" adjWordcount="54.4" curWordcount="54.4" - - - MSB4141: MSBuildToolsPath is not specified for the ToolsVersion "{0}" defined at "{1}", or the value specified evaluates to the empty string. - MSB4141: MSBuildToolsPath ist für die bei "{1}" definierte ToolsVersion {0} nicht angegeben, oder der angegebene Wert wird zu einer leeren Zeichenfolge ausgewertet. - {StrBegin="MSB4141: "} - - MSB4141: MSBuildToolsPath ist für die bei "{1}" definierte ToolsVersion {0} nicht angegeben, oder der angegebene Wert wird zu einer leeren Zeichenfolge ausgewertet. - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - MSB4031: The "MSBuildVersion" attribute is deprecated. If the project is authored in the MSBuild 2003 format, please remove the attribute from the <Project> tag. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format. - MSB4031: Das MSBuildVersion-Attribut ist veraltet. Wenn das Projekt im Format MSBuild 2003 erstellt wurde, löschen Sie das Attribut aus der <Project>-Kennung. Wenn das Projekt im alten Format 1.0 oder 1.2 erstellt wurde, konvertieren Sie es in das MSBuild 2003-Format. - {StrBegin="MSB4031: "}UE: This message is shown for projects that still contain the "MSBuildVersion" attribute in their <Project> - tag. We no longer need this attribute because the project's XML namespace (i.e. the "xmlns" attribute) gives us all the - version information we need. - LOCALIZATION: "MSBuild", "MSBuildVersion" and <Project> should not be localized. - - MSB4031: Das Attribut "MSBuildVersion" ist veraltet. Wenn das Projekt im Format MSBuild 2003 erstellt wurde, entfernen Sie das Attribut aus dem Tag < Project >. Wenn das Projekt im alten Format 1.0 oder 1.2 erstellt wurde, konvertieren Sie es in das MSBuild 2003-Format. - - fuzzyMatch="15" wordcount="45" adjWordcount="38.25" curWordcount="38.25" - - - MSB4144: Multiple definitions were found for the toolset "{0}". - MSB4144: Für das Toolset "{0}" wurden mehrere Definitionen gefunden. - {StrBegin="MSB4144: "} - - MSB4144: Für das Toolset wurden mehrere Definitionen gefunden "{0}". - - fuzzyMatch="15" wordcount="9" adjWordcount="7.65" curWordcount="7.65" - - - MSB4145: Multiple definitions were found for the property "{0}". - MSB4145: Für die {0}-Eigenschaft wurden mehrere Definitionen gefunden. - {StrBegin="MSB4145: "} - - MSB4145: Für die {0}-Eigenschaft wurden mehrere Definitionen gefunden. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4082: Choose has more than one <Otherwise> element. - MSB4082: Choose enthält mehrere <Otherwise>-Elemente. - {StrBegin="MSB4082: "} - - MSB4082: Wählen Sie mehrere < Otherwise >-Element enthält. - - fuzzyMatch="15" wordcount="9" adjWordcount="7.65" curWordcount="7.65" - - - This method is only valid for persisted <{0}> elements. - Diese Methode ist nur für persistente <{0}>-Elemente gültig. - - - Diese Methode ist nur gültig für beibehalten <{0}> Elemente. - - fuzzyMatch="15" wordcount="10" adjWordcount="8.5" curWordcount="8.5" - - - This method is only valid for virtual property groups, not <{0}> elements. - Diese Methode ist nur für virtuelle Eigenschaftengruppen gültig. Sie kann nicht für <{0}>-Elemente verwendet werden. - - - Diese Methode gilt nur für virtuelle Eigenschaftengruppen nicht <{0}> Elemente. - - fuzzyMatch="15" wordcount="13" adjWordcount="11.05" curWordcount="11.05" - - - MSB4038: The element <{0}> must be last under element <{1}>. Found element <{2}> instead. - MSB4038: Das <{0}>-Element muss das letzte Element unterhalb des <{1}>-Elements sein. Stattdessen wurde das <{2}>-Element gefunden. - {StrBegin="MSB4038: "} - - MSB4038: Das Element <{0}> muss unter Element <{1}>. Element wurde gefunden <{2}> statt. - - fuzzyMatch="15" wordcount="17" adjWordcount="14.45" curWordcount="14.45" - - - MSB4138: Non-string data was specified at the registry location "{0}". - MSB4138: Am Registrierungsspeicherort "{0}" wurden Daten angegeben, die keine Zeichenfolge sind. - {StrBegin="MSB4138: "} - - MSB4138: Am Registrierungsspeicherort "{0}" wurden Daten angegeben, die keine Zeichenfolge sind. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4039: No "{0}" element was found in the project file. - MSB4039: Das {0}-Element wurde in der Projektdatei nicht gefunden. - {StrBegin="MSB4039: "} - - MSB4039: Das {0}-Element wurde in der Projektdatei nicht gefunden. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4040: There is no target in the project. - MSB4040: Das Projekt enthält kein Ziel. - {StrBegin="MSB4040: "} - - MSB4040: Das Projekt enthält kein Ziel. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Removing the "{0}" attribute of an item is not allowed. - Das Löschen des {0}-Attributs eines Elements ist nicht zulässig. - - - Das Löschen des {0}-Attributs eines Elements ist nicht zulässig. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - The object passed in is not part of the project. - Das übergebene Objekt ist nicht Teil des Projekts. - - - Das übergebene Objekt ist nicht Teil des Projekts. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - Overriding target "{0}" in project "{1}" with target "{2}" from project "{3}". - Das Ziel "{0}" im Projekt "{1}" wird durch das Ziel "{2}" aus dem Projekt "{3}" außer Kraft gesetzt. - - - Das Ziel "{0}" im Projekt "{1}" wird durch das Ziel "{2}" aus dem Projekt "{3}" außer Kraft gesetzt. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4167: The parent process unexpectedly exited. Shutting down child node "{0}". - MSB4167: Der übergeordnete Prozess wurde unerwartet beendet. Der untergeordnete Knoten "{0}" wird heruntergefahren. - {StrBegin="MSB4167: "} - - MSB4167: Der übergeordnete Prozess wurde unerwartet beendet. Der untergeordnete Knoten "{0}" wird heruntergefahren. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - {0} ms {1} {2} calls - {0} ms {1} {2} Aufrufe - - - {0} ms {1} {2} Aufrufe - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - (* = timing was not recorded because of reentrancy) - (* = Zeit wurde aufgrund des erneuten Eintretens nicht aufgezeichnet) - - - (* = Zeit wurde aufgrund des erneuten Eintretens nicht aufgezeichnet) - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - This project object has been unloaded from the MSBuild engine and is no longer valid. - Dieses Projektobjekt wurde aus der MSBuild-Engine entladen und ist nicht mehr gültig. - - - Dieses Projektobjekt wurde aus dem MSBuild-Modul entladen und ist nicht mehr gültig. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - The project file "{0}" was not found. - Die Projektdatei "{0}" wurde nicht gefunden. - UE: This message is shown when the user calls into the OM to build a project that doesn't exist on disk. - - Die Projektdatei "{0}" wurde nicht gefunden. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Done building project "{0}" -- FAILED. - Die Erstellung des Projekts "{0}" ist abgeschlossen -- FEHLER. - - - Die Erstellung des Projekts "{0}" ist abgeschlossen – FEHLER. - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Done building project "{0}". - Erstellen des Projekts {0} beendet. - - - Die Erstellung des Projekts "{0}" ist abgeschlossen. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - MSB4041: The default XML namespace of the project must be the MSBuild XML namespace. If the project is authored in the MSBuild 2003 format, please add xmlns="{0}" to the <Project> element. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format. - MSB4041: Der MSBuild-XML-Namespace muss der Standard-XML-Namespace des Projekts sein. Wenn das Projekt im MSBuild 2003-Format erstellt wurde, fügen Sie dem <Project>-Element xmlns="{0}" hinzu. Wenn das Projekt im alten Format 1.0 oder 1.2 erstellt wurde, konvertieren Sie es in das MSBuild 2003-Format. - {StrBegin="MSB4041: "}UE: This is a Beta 1 message only. - LOCALIZATION: <Project>, "MSBuild" and "xmlns" should not be localized. - - MSB4041: Der XML-Standardnamespace des Projekts muss MSBuild XML-Namespace. Wenn das Projekt im Format MSBuild 2003 erstellt wurde, fügen Sie Xmlns = "{0}" < Project >-Element. Wenn das Projekt im alten Format 1.0 oder 1.2 erstellt wurde, konvertieren Sie es in das MSBuild 2003-Format. - - fuzzyMatch="15" wordcount="52" adjWordcount="44.2" curWordcount="44.2" - - - Project Performance Summary: - Leistungszusammenfassung für das Projekt: - - - Leistungszusammenfassung für das Projekt: - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - MSB4042: Stopping because of syntax errors in project file. - MSB4042: Prozess aufgrund von Syntaxfehlern in der Projektdatei angehalten. - {StrBegin="MSB4042: "} - - MSB4042: Prozess aufgrund von Syntaxfehlern in der Projektdatei angehalten. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - Project "{0}" is building "{1}" ({2} target(s)): - Das Projekt {0} erstellt {1} ({2} Ziel(e)): - - - Das Projekt {0} erstellt {1} ({2} Ziel(e)): - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Project "{0}" is building "{1}" (default targets): - Das Projekt "{0}" erstellt "{1}" (Standardziele): - - - Das Projekt "{0}" erstellt "{1}" (Standardziele): - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Project "{0}" ({1} target(s)): - Projekt "{0}", {1} Ziel(e): - - - Projekt "{0}", {1} Ziel(e): - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - Project "{0}" (default targets): - Projekt "{0}" (Standardziele): - - - Projekt "{0}" (Standardziele): - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - Done Building Project "{0}" ({1} target(s)). - Die Erstellung von Projekt "{0}" ist abgeschlossen ({1} Ziel(e)). - - - Die Erstellung von Projekt "{0}" ist abgeschlossen ({1} Ziel(e)). - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Done Building Project "{0}" (default targets). - Die Erstellung von Projekt "{0}" ist abgeschlossen (Standardziele). - - - Die Erstellung von Projekt "{0}" ist abgeschlossen (Standardziele). - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Done Building Project "{0}" ({1} target(s)) -- FAILED. - Die Erstellung des Projekts "{0}" ist abgeschlossen, {1} Ziel(e) -- FEHLER. - - - Die Erstellung des Projekts "{0}" ist abgeschlossen, {1} Ziel(e) -- FEHLER. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Done Building Project "{0}" (default targets) -- FAILED. - Die Erstellung des Projekts "{0}" ist abgeschlossen (Standardziele) -- FEHLER. - - - Die Erstellung von Projekt "{0}" ist abgeschlossen (Standardziele) -- FEHLER. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4075: The project file must be opened in the Visual Studio IDE and converted to the latest version before it can be built by MSBuild. - MSB4075: Die Projektdatei muss in der Visual Studio IDE geöffnet und in ein aktuelles Versionsformat gebracht werden, bevor sie mit MSBuild erstellt werden kann. - {StrBegin="MSB4075: "} - - MSB4075: Die Projektdatei muss in der Visual Studio IDE geöffnet und in ein aktuelles Versionsformat gebracht werden, bevor sie mit MSBuild erstellt werden kann. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4192: The project file "{0}" is in the ".vcproj" file format, which MSBuild no longer supports. Please convert the project by opening it in the Visual Studio IDE or running the conversion tool, or use MSBuild 3.5 or earlier to build it. - MSB4192: Die Projektdatei "{0}" ist im "VCPROJ"-Dateiformat gespeichert, das nicht mehr von MSBuild unterstützt wird. Konvertieren Sie das Projekt, indem Sie es in der Visual Studio IDE öffnen oder das Konvertierungstool ausführen, oder verwenden Sie MSBuild 3.5 oder früher zum Erstellen des Projekts. - {StrBegin="MSB4192: "} LOC: ".vcproj" should not be localized - - MSB4192: Die Projektdatei "{0}" ist im VSPROJ-Dateiformat gespeichert, das nicht mehr von MSBuild unterstützt wird. Konvertieren Sie das Projekt, indem Sie es in der Visual Studio IDE öffnen oder das Konvertierungstool ausführen, oder verwenden Sie MSBuild 3.5 oder früher zum Erstellen des Projekts. - - fuzzyMatch="101" wordcount="42" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - The specified property does not belong to the current property group. - Die angegebene Eigenschaft gehört nicht zu der aktuellen Eigenschaftengruppe. - - - Die angegebene Eigenschaft gehört nicht zu der aktuellen Eigenschaftengruppe. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - Initial Properties: - Ursprüngliche Eigenschaften: - - - Ursprüngliche Eigenschaften: - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4148: The name of a property stored under the registry key "{0}" has zero length. - MSB4148: Der Name einer unter dem Registrierungsschlüssel "{0}" gespeicherten Eigenschaft hat eine Länge von Null. - {StrBegin="MSB4148: "} - - MSB4148: Der Name einer unter dem Registrierungsschlüssel "{0}" gespeicherten Eigenschaft hat eine Länge von Null. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - The property names in the indexer and the "{0}" object do not match. - Die Eigenschaftennamen im Indexer und das {0}-Objekt stimmen nicht überein. - - - Die Eigenschaftennamen im Indexer und das {0}-Objekt stimmen nicht überein. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4043: The item metadata reference "{0}" is invalid because it is qualified with an item name. Item metadata referenced in transforms do not need to be qualified, because the item name is automatically deduced from the items being transformed. Change "{0}" to "%({1})". - MSB4043: Der Elementmetadatenverweis "{0}" ist ungültig, da er mit einem Elementnamen qualifiziert ist. Elementmetadaten, auf die bei Transformationen verwiesen wird, müssen nicht qualifiziert werden, da der Elementname automatisch aus den Elementen die transformiert werden abgeleitet wird. Ändern Sie "{0}" in "%({1})". - {StrBegin="MSB4043: "}UE: This message is shown when the user does something like this: @(foo->'%(foo.metadata)'). There is no need to specify - "foo.metadata", because "foo" is automatically deduced. In corollary, "bar.metadata" is not allowed either, where "bar" is a different - item list type. - - MSB4043: Der Elementmetadatenverweis "{0}" ist ungültig, da er mit einem Elementnamen qualifiziert ist. Elementmetadaten, auf die bei Transformationen verwiesen wird, müssen nicht qualifiziert werden, da der Elementname automatisch aus den transformierten Elementen abgeleitet wird. Ändern Sie "{0}" in "%({1})". - - fuzzyMatch="101" wordcount="43" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4135: Error reading the toolset information from the registry location "{0}". {1} - MSB4135: Fehler beim Lesen der Toolsetinformationen am Registrierungsspeicherort "{0}". {1} - {StrBegin="MSB4135: "} - - MSB4135: Fehler beim Lesen der Toolsetinformationen am Registrierungsspeicherort "{0}". {1} - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4044: The "{0}" task was not given a value for the required parameter "{1}". - MSB4044: Die {0}-Aufgabe hat keinen Wert für den erforderlichen {1}-Parameter erhalten. - {StrBegin="MSB4044: "}UE: This message is shown when a task parameter designated as "required" is not set in the project file. - - MSB4044: Die {0}-Aufgabe hat keinen Wert für den erforderlichen {1}-Parameter erhalten. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - Validating project using schema file "{0}". - Das Projekt wird anhand der Schemadatei "{0}" überprüft. - LOCALIZATION: "{0}" is the location of the schema file. - - Das Projekt wird anhand der Schemadatei "{0}" überprüft. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4045: Project is not valid. {0} - MSB4045: Ungültiges Projekt. {0} - {StrBegin="MSB4045: "}UE: This error is shown when the user asks his project to be validated against a schema (/val switch for - MSBuild.exe), and the project has errors. "{0}" contains a message explaining the problem. - LOCALIZATION: "{0}" is a message from the System.XML schema validator and is already localized. - - MSB4045: Ungültiges Projekt. {0} - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4112: The targets in this project have been disabled by the host and therefore cannot be built at this time. This may have been done for security reasons. To enable the targets, the host must set Project.BuildEnabled to "true". - MSB4112: Die Ziele in diesem Projekt wurden vom Host deaktiviert und können aus diesem Grund derzeit nicht erstellt werden. Die Deaktivierung wurde möglicherweise aus Sicherheitsgründen durchgeführt. Wenn Sie die Ziele aktivieren möchten, muss der Host Project.BuildEnabled auf TRUE festlegen. - {StrBegin="MSB4112: "} - - MSB4112: Die Ziele in diesem Projekt wurden vom Host deaktiviert und können aus diesem Grund derzeit nicht erstellt werden. Die Deaktivierung wurde wahrscheinlich aus Sicherheitsgründen durchgeführt. Wenn Sie die Ziele aktivieren möchten, muss der Host Project.BuildEnabled auf "true" festlegen. - - fuzzyMatch="101" wordcount="39" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4093: The "{0}" parameter of the "{1}" task cannot be written to because it does not have a "set" accessor. - MSB4093: In den {0}-Parameter der {1}-Aufgabe kann nicht geschrieben werden, da er keinen set-Accessor besitzt. - {StrBegin="MSB4093: "}UE: This error is shown when a project tries to assign a value to a task parameter that does not have a "set" - accessor on the corresponding .NET property on the task class. - - MSB4093: In den {0}-Parameter der {1}-Aufgabe kann nicht geschrieben werden, da er keinen set-Accessor besitzt. - - fuzzyMatch="100" wordcount="20" adjWordcount="5" curWordcount="5" tmLabel="N''" - - - A shallow clone of this object cannot be created. - Ein unechter Klon dieses Objekts kann nicht erstellt werden. - - - Ein unechter Klon dieses Objekts kann nicht erstellt werden. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - Skipping target "{0}" because it has no inputs. - Das {0}-Ziel wird übersprungen, da es keine Eingaben besitzt. - - - Das {0}-Ziel wird übersprungen, da es keine Eingaben besitzt. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Though the target has declared its inputs, the input specification only references empty properties and/or empty item lists. - Obwohl das Ziel seine Eingaben deklariert hat, verweist die Eingabespezifikation nur auf leere Eigenschaften und/oder leere Elementlisten. - - - Obwohl das Ziel seine Eingaben deklariert hat, verweist die Eingabespezifikation nur auf leere Eigenschaften und/oder leere Elementlisten. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - Skipping target "{0}" because it has no outputs. - Das Ziel "{0}" wird übersprungen, da es keine Ausgaben enthält. - - - Das Ziel "{0}" wird übersprungen, da es keine Ausgaben enthält. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Though the target has declared its outputs, the output specification only references empty properties and/or empty item lists. - Obwohl das Ziel seine Ausgaben deklariert hat, verweist die Ausgabespezifikation nur auf leere Eigenschaften und/oder leere Elementlisten. - - - Obwohl das Ziel seine Ausgaben deklariert hat, verweist die Ausgabespezifikation nur auf leere Eigenschaften und/oder leere Elementlisten. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - Skipping target "{0}" because all output files are up-to-date with respect to the input files. - Das Ziel "{0}" wird übersprungen, da alle Ausgabedateien hinsichtlich der Eingabedateien aktuell sind. - - - Das Ziel "{0}" wird übersprungen, da alle Ausgabedateien hinsichtlich der Eingabedateien aktuell sind. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - Input files: {0} - Eingabedateien: {0} - {0} is a semicolon-separated list of filenames. - - Eingabedateien: {0} - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Output files: {0} - Ausgabedateien: {0} - {0} is a semicolon-separated list of filenames. - - Ausgabedateien: {0} - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Building solution configuration "{0}". - Die Projektmappenkonfiguration "{0}" wird erstellt. - UE: This is not an error, so doesn't need an error code. - - Die Projektmappenkonfiguration "{0}" wird erstellt. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - Using solution cache file "{0}" for configuration "{1}" and tools version "{2}". - Die Projektmappen-Cachedatei "{0}" wird für die Konfiguration "{1}" und die Toolsversion "{2}" verwendet. - UE: This is not an error, so doesn't need an error code. - - Die Projektmappen-Cachedatei "{0}" wird für die Konfiguration "{1}" und die Toolsversion "{2}" verwendet. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Failed to read solution cache file "{0}". {1} Using solution file directly. - Fehler beim Lesen der Projektmappen-Cachedatei "{0}". {1} Projektmappendatei wird direkt verwendet. - UE: This is not a true error, so doesn't need an error code. - - Fehler beim Lesen der Projektmappen-Cachedatei "{0}". {1} Projektmappendatei wird direkt verwendet. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Failed to write solution cache file "{0}". {1} - Fehler beim Schreiben der Projektmappen-Cachedatei "{0}". {1} - UE: This is not a true error, so doesn't need an error code. - - Fehler beim Schreiben der Projektmappen-Cachedatei "{0}". {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Solution cache file was created for a "{0}" value of "{1}" but the current value is "{2}". Refreshing cache file. - Die Projektmappen-Cachedatei wurde für den {0}-Wert "{1}" erstellt, aber der aktuelle Wert ist "{2}". Cachedatei wird aktualisiert. - UE: This is not an error, so doesn't need an error code. - - Die Projektmappen-Cachedatei wurde für den {0}-Wert "{1}" erstellt, aber der aktuelle Wert ist "{2}". Cachedatei wird aktualisiert. - - fuzzyMatch="100" wordcount="20" adjWordcount="5" curWordcount="5" tmLabel="N''" - - - Solution cache file has an internal version number "{0}" but the current value is "{1}". Refreshing cache file. - Die Projektmappen-Cachedatei hat die interne Versionsnummer "{0}", der aktuelle Wert ist aber "{1}". Cachedatei wird aktualisiert. - UE: This is not an error, so doesn't need an error code. - - Die Projektmappen-Cachedatei hat die interne Versionsnummer "{0}", der aktuelle Wert ist aber "{1}". Cachedatei wird aktualisiert. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - Solution cache file is out of date. Refreshing cache file. {0} - Die Projektmappen-Cachedatei ist veraltet. Cachedatei wird aktualisiert. {0} - UE: This is not an error, so doesn't need an error code. - - Die Projektmappen-Cachedatei ist veraltet. Cachedatei wird aktualisiert. {0} - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4160: A circular dependency involving project "{0}" has been detected. - MSB4160: Eine Ringabhängigkeit im Zusammenhang mit dem Projekt "{0}" wurde erkannt. - {StrBegin="MSB4160: "} - - MSB4160: Eine Ringabhängigkeit im Zusammenhang mit dem Projekt "{0}" wurde erkannt. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4126: The specified solution configuration "{0}" is invalid. Please specify a valid solution configuration using the Configuration and Platform properties (e.g. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU") or leave those properties blank to use the default solution configuration. - MSB4126: Die angegebene Projektmappenkonfiguration "{0}" ist ungültig. Geben Sie mithilfe der Konfigurations- und Plattformeigenschaften eine gültige Projektmappenkonfiguration an (z. B. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU"), oder lassen Sie diese Eigenschaften leer, sodass die Standardprojektmappenkonfiguration verwendet wird. - {StrBegin="MSB4126: "}UE: The solution filename is provided separately to loggers. - - MSB4126: Die angegebene Projektmappenkonfiguration "{0}" ist ungültig. Geben Sie mithilfe der Konfigurations- und Plattformeigenschaften eine gültige Projektmappenkonfiguration an (z. B. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU"), oder lassen Sie diese Eigenschaften leer, sodass die Standardprojektmappenkonfiguration verwendet wird. - - fuzzyMatch="101" wordcount="37" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4046: Error reading project file "{0}": {1} - MSB4046: Fehler beim Lesen der Projektdatei "{0}": {1} - {StrBegin="MSB4046: "} - - MSB4046: Fehler beim Lesen der Projektdatei "{0}": {1} - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4125: The project file name "{0}" is invalid. {1} - MSB4125: Der Projektdateiname "{0}" ist ungültig. {1} - {StrBegin="MSB4125: "}UE: The solution filename is provided separately to loggers. - - MSB4125: Der Projektdateiname "{0}" ist ungültig. {1} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4051: Project {0} is referencing a project with GUID {1}, but a project with this GUID was not found in the .SLN file. - MSB4051: Das Projekt "{0}" verweist auf ein Projekt mit der GUID {1}, in der SLN-Datei wurde jedoch kein Projekt mit dieser GUID gefunden. - {StrBegin="MSB4051: "}UE: The solution filename is provided separately to loggers. - - MSB4051: Das Projekt "{0}" verweist auf ein Projekt mit der GUID {1}, in der SLN-Datei wurde jedoch kein Projekt mit dieser GUID gefunden. - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - MSB4078: The project file "{0}" is not supported by MSBuild and cannot be built. - MSB4078: Die Projektdatei "{0}" wird nicht von MSBuild unterstützt und kann nicht erstellt werden. - {StrBegin="MSB4078: "} - - MSB4078: Die Projektdatei "{0}" wird nicht von MSBuild unterstützt und kann nicht erstellt werden. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4054: The solution file must be opened in the Visual Studio IDE and converted to the latest version before it can be built by MSBuild. - MSB4054: Die Projektmappendatei muss in der Visual Studio IDE geöffnet und in die neuste Version konvertiert werden, bevor sie mit MSBuild erstellt werden kann. - {StrBegin="MSB4054: "}UE: The solution filename is provided separately to loggers. - - MSB4054: Die Projektmappendatei muss in der Visual Studio IDE geöffnet und in die neuste Version konvertiert werden, bevor sie mit MSBuild erstellt werden kann. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4121: The project configuration for project "{0}" was not specified in the solution file for the solution configuration "{1}". - MSB4121: Die Projektkonfiguration für das Projekt "{0}" wurde nicht in der Projektmappendatei für die Projektmappenkonfiguration "{1}" angegeben. - {StrBegin="MSB4121: "} - - MSB4121: Die Projektkonfiguration für das Projekt "{0}" wurde nicht in der Projektmappendatei für die Projektmappenkonfiguration "{1}" angegeben. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - The project "{0}" is not selected for building in solution configuration "{1}". - Das Projekt "{0}" ist in der Projektmappenkonfiguration "{1}" nicht zum Erstellen ausgewählt. - - UE: This is not an error, so doesn't need an error code. - - - Das Projekt "{0}" ist in der Projektmappenkonfiguration "{1}" nicht zum Erstellen ausgewählt. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4122: Scanning project dependencies for project "{0}" failed. {1} - MSB4122: Fehler beim Überprüfen der Projektabhängigkeiten für das Projekt "{0}". {1} - {StrBegin="MSB4122: "} - - MSB4122: Fehler beim Überprüfen der Projektabhängigkeiten für Projekt "{0}". {1} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4149: The tools version "{0}" of the solution does not support building projects with a different tools version. - MSB4149: Die Toolsversion {0} der Projektmappe unterstützt das Erstellen von Projekten mit unterschiedlichen Toolsversionen nicht. - {StrBegin="MSB4149: "} - - MSB4149: Die Toolsversion {0} der Projektmappe unterstützt das Erstellen von Projekten mit unterschiedlichen Toolsversionen nicht. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - Web projects do not support the "Clean" target. Continuing with remaining projects ... - Webprojekte unterstützen das "Clean"-Ziel nicht. Verbleibende Projekte werden fortgesetzt... - UE: This is not an error, so doesn't need an error code. - LOCALIZATION: Do not localize "Clean". - - Webprojekte unterstützen das Clean-Ziel nicht. Verbleibende Projekte werden fortgesetzt... - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Web projects do not support the "Publish" target. Continuing with remaining projects ... - Webprojekte unterstützen nicht das "Publish"-Ziel. Verbleibende Projekte werden fortgesetzt... - UE: This is not an error, so doesn't need an error code. - LOCALIZATION: Do not localize "Publish". - - Webprojekte unterstützen das Publish-Ziel nicht. Verbleibende Projekte werden fortgesetzt... - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Skipping because the "$(AspNetConfiguration)" configuration is not supported for this web project. You can use the AspNetConfiguration property to override the configuration used for building web projects, by adding /p:AspNetConfiguration=<value> to the command line. Currently web projects only support Debug and Release configurations. - Wird übersprungen, da die Konfiguration "$(AspNetConfiguration)" für dieses Webprojekt nicht unterstützt wird. Sie können die zum Erstellen von Webprojekten verwendete Konfiguration mit der AspNetConfiguration-Eigenschaft außer Kraft setzen, indem Sie an der Befehlszeile "/p:AspNetConfiguration=<Wert>" hinzufügen. Zurzeit unterstützen Webprojekte nur Debug- und Release-Konfigurationen. - - UE: This is not an error, so doesn't need an error code. - LOCALIZATION: Do NOT localize "AspNetConfiguration", "Debug", "Release". - - - Da der "$(AspNetConfiguration)" Konfiguration für dieses Webprojekt nicht unterstützt. Verwenden die AspNetConfiguration-Eigenschaft die Konfiguration zum Erstellen von Webprojekten hinzufügen/p: AspNetConfiguration überschreiben = < Wert > in der Befehlszeile. Aktuell unterstützen Webprojekte nur Debug- und Releasekonfigurationen. - - fuzzyMatch="15" wordcount="44" adjWordcount="37.4" curWordcount="37.4" - - - MSB4076: VC projects do not support the "Publish" target. - MSB4076: VC-Projekte unterstützen nicht das Publish-Ziel. - {StrBegin="MSB4076: "}LOCALIZATION: Do not localize "Publish". - - MSB4076: VC-Projekte unterstützen nicht das Publish-Ziel. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4098: MSBuild is invoking VCBuild to build this project. Project-to-project references between VC++ projects (.VCPROJ) and C#/VB/VJ# projects (.CSPROJ, .VBPROJ, .VJSPROJ) are not supported by the command-line build systems when building stand-alone VC++ projects. Projects that contain such project-to-project references will fail to build. Please build the solution file containing this project instead. - MSB4098: MSBuild ruft zum Erstellen dieses Projekts VCBuild auf. Interprojektverweise zwischen VC++-Projekten (.VCPROJ) und C#-/VB-/VJ#-Projekten (.CSPROJ, .VBPROJ, .VJSPROJ) werden beim Erstellen eigenständiger VC++-Projekte von den Befehlszeilen-Buildsystemen nicht unterstützt. Projekte, die solche Interprojektverweise enthalten, werden nicht erstellt. Erstellen Sie stattdessen die Projektmappendatei, die dieses Projekt enthält. - {StrBegin="MSB4098: "} - - MSB4098: MSBuild ruft zum Erstellen dieses Projekts VCBuild auf. Interprojektverweise zwischen VC++-Projekten (.VCPROJ) und C#-/VB-/VJ#-Projekten (.CSPROJ, .VBPROJ, .VJSPROJ) werden beim Erstellen eigenständiger VC++-Projekte von den Befehlszeilen-Buildsystemen nicht unterstützt. Projekte, die solche Interprojektverweise enthalten, werden nicht erstellt. Erstellen Sie stattdessen die Projektmappendatei, die dieses Projekt enthält. - - fuzzyMatch="101" wordcount="53" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4056: The MSBuild engine must be called on a single-threaded-apartment. Current threading model is "{0}". Proceeding, but some tasks may not function correctly. - MSB4056: Die MSBuild-Engine muss in einem Singlethread-Apartment aufgerufen werden. Das aktuelle Threadmodell ist {0}. Der Vorgang wird fortgesetzt, aber einige Aufgaben werden möglicherweise nicht ordnungsgemäß ausgeführt. - {StrBegin="MSB4056: "} - - MSB4056: Das MSBuild-Modul muss in einem Singlethread-Apartment aufgerufen werden. Das aktuelle Threadmodell ist {0}. Der Vorgang wird fortgesetzt, aber einige Aufgaben werden möglicherweise nicht ordnungsgemäß ausgeführt. - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - Schema validation - Schemavalidierung - UE: this fragment is used to describe errors that are caused by schema validation. For example, if a normal error is - displayed like this: "MSBUILD : error MSB0000: This is an error.", then an error from schema validation would look like this: - "MSBUILD : Schema validation error MSB0000: This is an error." - LOCALIZATION: This fragment needs to be localized. - - Schemavalidierung - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Target "{0}" skipped. Previously built unsuccessfully. - Das Ziel "{0}" wurde übersprungen. Die vorherige Erstellung war nicht erfolgreich. - - - Das Ziel "{0}" wurde übersprungen. Die vorherige Erstellung war nicht erfolgreich. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Target "{0}" skipped. Previously built successfully. - Das Ziel "{0}" wurde übersprungen. Die vorherige Erstellung war erfolgreich. - - - Das Ziel "{0}" wurde übersprungen. Die vorherige Erstellung war erfolgreich. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4116: The condition "{1}" on the "{0}" target has a reference to item metadata. References to item metadata are not allowed in target conditions unless they are part of an item transform. - MSB4116: Die Bedingung "{1}" des "{0}"-Ziels enthält einen Verweis auf Elementmetadaten. Verweise auf Elementmetadaten sind in Zielbedingungen nicht zulässig, es sei denn, sie sind Teil einer Elementtransformation. - {StrBegin="MSB4116: "} - - MSB4116: Die Bedingung "{1}" des {0}-Ziels enthält einen Verweis auf Elementmetadaten. Verweise auf Elementmetadaten sind in Zielbedingungen nicht zulässig, es sei denn, sie sind Teil einer Elementtransformation. - - fuzzyMatch="101" wordcount="32" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4057: The target "{0}" does not exist in the project. - MSB4057: Das Ziel "{0}" ist im Projekt nicht vorhanden. - {StrBegin="MSB4057: "} - - MSB4057: Das Ziel "{0}" ist im Projekt nicht vorhanden. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - Done building target "{0}" in project "{1}" -- FAILED. - Die Erstellung des Ziels "{0}" im Projekt "{1}" ist abgeschlossen -- FEHLER. - - - Erstellen des {0}-Ziels in Projekt {1} beendet - Fehler beim Erstellen. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Done building target "{0}" in project "{1}". - Die Erstellung des Ziels "{0}" im Projekt "{1}" ist abgeschlossen. - - - Die Erstellung des Ziels "{0}" im Projekt "{1}" ist abgeschlossen. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - {0}: (TargetId:{1}) - {0}: (Ziel-ID:{1}) - - - {0}: (Ziel-ID:{1}) - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4058: The "{0}" target is missing its output specification. If a target declares inputs, it must also declare outputs. - MSB4058: Das "{0}"-Ziel enthält keine Ausgabespezifikation. Wenn ein Ziel Eingaben deklariert, muss es auch Ausgaben deklarieren. - {StrBegin="MSB4058: "} - - MSB4058: Das {0}-Ziel enthält keine Ausgabespezifikation. Wenn ein Ziel Eingaben deklariert, muss es auch Ausgaben deklarieren. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4168: The item "{0}" of type "{1}" does not define a value for the metadata in the expression "{2}". This expression is used in the target output for target "{3}". If a target declares outputs that are transforms, all items in the transform must have a value for the metadata in the transform. - MSB4168: Das Element "{0}" vom Typ "{1}" definiert keinen Wert für die Metadaten im Ausdruck "{2}". Dieser Ausdruck wird in der Zielausgabe für "{3}" verwendet. Wenn ein Ziel Ausgaben deklariert, bei denen es sich um Transformationen handelt, müssen alle Elemente in der Transformation einen Wert für die in der Transformation enthaltenen Metadaten aufweisen. - {StrBegin="MSB4168: "} - - MSB4168: Das Element "{0}" vom Typ "{1}" definiert keinen Wert für die Metadaten im Ausdruck "{2}". Dieser Ausdruck wird in der Zielausgabe für "{3}" verwendet. Wenn ein Ziel Ausgaben deklariert, bei denen es sich um Transformationen handelt, müssen alle Elemente in der Transformation einen Wert für die in der Transformation enthaltenen Metadaten aufweisen. - - fuzzyMatch="101" wordcount="53" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Target Performance Summary: - Leistungszusammenfassung für das Ziel: - - - Leistungszusammenfassung für das Ziel: - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Target "{0}" skipped, due to false condition; ({1}) was evaluated as ({2}). - Das Ziel "{0}" wurde übersprungen, da die Bedingung "false" war . ({1}) wurde als ({2}) ausgewertet. - - - Das Ziel "{0}" wurde übersprungen, da die Bedingung "false" war . ({1}) wurde als ({2}) ausgewertet. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Target "{0}" in project "{1}" - {0}-Ziel in {1}-Projekt. - - - {0}-Ziel in {1}-Projekt. - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Target {0}: - Ziel "{0}": - - - Ziel "{0}": - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Target "{0}" in file "{1}": - Ziel "{0}" in Datei "{1}": - - - Ziel "{0}" in Datei "{1}": - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Build continuing because "{0}" on the task "{1}" is set to "{2}". - Der Buildvorgang wird fortgesetzt, da {0} in der {1}-Aufgabe auf "{2}" festgelegt ist. - - - Der Buildvorgang wird fortgesetzt, da {0} in der {1}-Aufgabe auf "{2}" festgelegt ist. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Target {0} from project "{1}": - Ziel "{0}" aus Projekt "{1}": - - - Ziel "{0}" aus Projekt "{1}": - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Target "{0}" in file "{1}" from project "{2}": - Ziel "{0}" in Datei "{1}" aus Projekt "{2}": - - - Ziel "{0}" in Datei "{1}" aus Projekt "{2}": - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4060: The "{0}" task has been declared or used incorrectly, or failed during construction. Check the spelling of the task name and the assembly name. - MSB4060: Die "{0}"-Aufgabe wurde falsch deklariert, falsch verwendet oder konnte bei der Erstellung nicht ausgeführt werden. Überprüfen Sie die Schreibweise des Aufgaben- und des Assemblynamens. - {StrBegin="MSB4060: "} - - MSB4060: Die {0}-Aufgabe wurde falsch deklariert, falsch verwendet oder konnte bei der Erstellung nicht ausgeführt werden. Überprüfen Sie die Schreibweise des Aufgaben- und des Assemblynamens. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4077: The "{0}" task has been marked with the attribute LoadInSeparateAppDomain, but does not derive from MarshalByRefObject. Check that the task derives from MarshalByRefObject or AppDomainIsolatedTask. - MSB4077: Die Aufgabe "{0}" wurde mit dem LoadInSeparateAppDomain-Attribut markiert, ist jedoch nicht von MarshalByRefObject abgeleitet. Stellen Sie sicher, dass die Aufgabe von MarshalByRefObject oder AppDomainIsolatedTask abgeleitet wird. - {StrBegin="MSB4077: "}LOCALIZATION: <LoadInSeparateAppDomain>, <MarshalByRefObject>, <AppDomainIsolatedTask> should not be localized. - - MSB4077: Die Aufgabe "{0}" wurde mit dem LoadInSeparateAppDomain-Attribut markiert, ist jedoch nicht von MarshalByRefObject abgeleitet. Stellen Sie sicher, dass die Aufgabe von MarshalByRefObject oder AppDomainIsolatedTask abgeleitet wird. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Done executing task "{0}" -- FAILED. - Die Ausführung der {0}-Aufgabe ist abgeschlossen -- FEHLER. - - - Die Ausführung von Task "{0}" wurde beendet – FEHLER. - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Done executing task "{0}". - Ausführen der {0}-Aufgabe beendet. - - - Die Ausführung von Task "{0}" wurde beendet. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - {0} (TaskId:{1}) - {0} (Aufgaben-ID: {1}) - - - {0} (Aufgaben-ID: {1}) - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Using "{0}" task from assembly "{1}". - Die {0}-Aufgabe aus der {1}-Assembly wird verwendet. - UE: This informational message helps users determine which assemblies their tasks were loaded from. - - Die {0}-Aufgabe aus der {1}-Assembly wird verwendet. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4061: The "{0}" task could not be instantiated from the assembly "{1}". {2} - MSB4061: Die {0}-Aufgabe konnte nicht aus der {1}-Assembly instanziiert werden. {2} - {StrBegin="MSB4061: "}LOCALIZATION: "{2}" is a localized message from a CLR/FX exception. - - MSB4061: Die {0}-Aufgabe konnte nicht aus der {1}-Assembly instanziiert werden. {2} - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4127: The "{0}" task could not be instantiated from the assembly "{1}". Please verify the task assembly has been built using the same version of the Microsoft.Build.Framework assembly as the one installed on your computer and that your host application is not missing a binding redirect for Microsoft.Build.Framework. {2} - MSB4127: Die "{0}"-Aufgabe konnte nicht aus der Assembly "{1}" instanziiert werden. Stellen Sie sicher, dass die Aufgabenassembly mit der auf dem Computer installierten Version der Microsoft.Build.Framework-Assembly erstellt wurde und die Hostanwendung über einen BindingRedirect-Eintrag für Microsoft.Build.Framework verfügt. {2} - {StrBegin="MSB4127: "}UE: This message is a specialized version of the TaskInstantiationFailureError message and can probably reuse some of its docs. - LOCALIZATION: "{2}" is a localized message from a CLR/FX exception. Also, Microsoft.Build.Framework should not be localized - - MSB4127: Die "{0}"-Aufgabe konnte nicht aus der "{1}"-Assembly instanziiert werden. Überprüfen Sie, ob die Aufgabenassembly mit der gleichen Version der Microsoft.Build.Framework-Assembly erstellt wurde, die auf Ihrem Computer installiert ist, und dass Ihrer Hostanwendung kein BindingRedirect-Eintrag für Microsoft.Build.Framework fehlt. {2} - - fuzzyMatch="101" wordcount="49" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4062: The "{0}" task could not be loaded from the assembly {1}. {2} Confirm that the <UsingTask> declaration is correct, and that the assembly and all its dependencies are available. - MSB4062: Die {0}-Aufgabe konnte nicht aus der Assembly {1} geladen werden. {2} Vergewissern Sie sich, dass die <UsingTask>-Deklaration richtig ist und dass die Assembly und alle ihre Abhängigkeiten zur Verfügung stehen. - {StrBegin="MSB4062: "}UE: This message is shown when a task cannot be loaded from its assembly for various reasons e.g. corrupt assembly, - invalid task declaration, disk error, etc. "{2}" contains a message explaining what happened. - LOCALIZATION: "{2}" is a message from the CLR loader and is already localized. Also, <UsingTask> should not be localized. - - MSB4062: Die "{0}" Vorgang konnte nicht aus der Assembly geladen werden {1}. {2} Bestätigen < UsingTask > Erklärung richtig ist und die Assembly und die zugehörigen Dateien verfügbar sind. - - fuzzyMatch="15" wordcount="31" adjWordcount="26.35" curWordcount="26.35" - - - MSB4063: The "{0}" task could not be initialized with its input parameters. {1} - MSB4063: Die "{0}"-Aufgabe konnte nicht mit ihren Eingabeparametern initialisiert werden. {1} - {StrBegin="MSB4063: "} - - MSB4063: Die "{0}"-Aufgabe konnte nicht mit ihren Eingabeparametern initialisiert werden. {1} - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - Task Performance Summary: - Leistungszusammenfassung für die Aufgabe: - - - Leistungszusammenfassung für die Aufgabe: - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Task "{0}" skipped, due to false condition; ({1}) was evaluated as ({2}). - Die {0}-Aufgabe wurde übersprungen, da die Bedingung "false" war . ({1}) wurde als ({2}) ausgewertet. - - - Die {0}-Aufgabe wurde übersprungen, da die Bedingung "false" war . ({1}) wurde als ({2}) ausgewertet. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Task "{0}" - {0}-Aufgabe - - - Task "{0}" - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Time Elapsed {0} - Verstrichene Zeit {0} - - - Verstrichene Zeit {0} - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Building with tools version "{0}". - Erstellung mit der Toolsversion "{0}". - - - Erstellung mit der Toolsversion "{0}". - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Project file contains ToolsVersion="{0}". This toolset is unknown or missing. You may be able to resolve this by installing the appropriate .NET Framework for this toolset. Treating the project as if it had ToolsVersion="4.0". - Die Projektdatei enthält ToolsVersion="{0}". Dieses Toolset ist nicht bekannt oder nicht vorhanden. Sie können das Problem möglicherweise beheben, indem Sie das entsprechende .NET Framework für dieses Toolset installieren. Das Projekt wird behandelt als enthielte es ToolsVersion="4.0". - - - Die Projektdatei enthält ToolsVersion="{0}". Dieses Toolset ist nicht bekannt oder nicht vorhanden. Sie können das Problem möglicherweise beheben, indem Sie das entsprechende .NET Framework für dieses Toolset installieren. Das Projekt wird behandelt als enthielte es ToolsVersion="4.0". - - fuzzyMatch="101" wordcount="34" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Deferred Messages - Zurückgestellte Meldungen - - - Zurückgestellte Meldungen - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Some messages did not display because they were not associated with any ProjectStarted events. Use diagnostic verbosity to view these messages. - Einige Meldungen wurden nicht angezeigt, weil sie keinem ProjectStarted-Ereignis zugeordnet sind. Verwenden Sie den Ausführlichkeitsgrad "diagnostic", um diese Meldungen anzuzeigen. - - - Einige Meldungen wurden nicht angezeigt, weil sie keinem ProjectStarted-Ereignis zugeordnet sind. Verwenden Sie den Ausführlichkeitsgrad "diagnostic", um diese Meldungen anzuzeigen. - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - MSB4090: Found an unexpected character '{2}' at position {1} in condition "{0}". - MSB4090: Das unerwartete Zeichen {2} wurde an Position {1} in der {0}-Bedingung gefunden. - {StrBegin="MSB4090: "} - - MSB4090: Das unerwartete Zeichen {2} wurde an Position {1} in der {0}-Bedingung gefunden. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4091: Found a call to an undefined function "{1}" in condition "{0}". - MSB4091: Aufruf zu einer undefinierten Funktion "{1}" in Bedingung "{0}" gefunden. - {StrBegin="MSB4091: "} - - MSB4091: Aufruf zu einer undefinierten Funktion "{1}" in Bedingung "{0}" gefunden. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4064: The "{0}" parameter is not supported by the "{1}" task. Verify the parameter exists on the task, and it is a settable public instance property. - MSB4064: Der "{0}"-Parameter wird von der "{1}"-Aufgabe nicht unterstützt. Vergewissern Sie sich, dass der Parameter in der Aufgabe vorhanden ist und es sich um eine festlegbare öffentliche Instanzeigenschaft handelt. - {StrBegin="MSB4064: "} - - MSB4064: Der {0}-Parameter wird von der {1}-Aufgabe nicht unterstützt. Vergewissern Sie sich, dass der Parameter in der Aufgabe vorhanden ist und es sich um eine festlegbare öffentliche Instanzeigenschaft handelt. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4131: The "{0}" parameter is not supported by the "{1}" task. Verify the parameter exists on the task, and it is a gettable public instance property. - MSB4131: Der "{0}"-Parameter wird von der "{1}"-Aufgabe nicht unterstützt. Vergewissern Sie sich, dass der Parameter in der Aufgabe vorhanden ist und es sich um eine abrufbare öffentliche Instanzeigenschaft handelt. - {StrBegin="MSB4131: "} - - MSB4131: Der {0}-Parameter wird von der {1}-Aufgabe nicht unterstützt. Vergewissern Sie sich, dass der Parameter in der Aufgabe vorhanden ist und es sich um eine abrufbare öffentliche Instanzeigenschaft handelt. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4092: An unexpected token "{1}" was found at character position {2} in condition "{0}". - MSB4092: Ein unerwartetes Token "{1}" wurde an Zeichenposition "{2}" in Bedingung "{0}" gefunden. - {StrBegin="MSB4092: "} - - MSB4092: Ein unerwartetes Token "{1}" wurde an Zeichenposition "{2}" in Bedingung "{0}" gefunden. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4065: The "{0}" parameter is not marked for output by the "{1}" task. - MSB4065: Der {0}-Parameter ist nicht für die Ausgabe durch die {1}-Aufgabe markiert. - {StrBegin="MSB4065: "} - - MSB4065: Der {0}-Parameter ist nicht für die Ausgabe durch die {1}-Aufgabe markiert. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4066: The attribute "{0}" in element <{1}> is unrecognized. - MSB4066: Das {0}-Attribut im <{1}>-Element ist unbekannt. - {StrBegin="MSB4066: "} - - MSB4066: Das Attribut "{0}" im Element <{1}> wurde nicht erkannt. - - fuzzyMatch="15" wordcount="10" adjWordcount="8.5" curWordcount="8.5" - - - MSB4067: The element <{0}> beneath element <{1}> is unrecognized. - MSB4067: Das <{0}>-Element unterhalb des <{1}>-Elements ist unbekannt. - {StrBegin="MSB4067: "} - - MSB4067: Das Element <{0}> unter Element <{1}> wurde nicht erkannt. - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB4068: The element <{0}> is unrecognized, or not supported in this context. - MSB4068: Das <{0}>-Element ist unbekannt oder wird in diesem Kontext nicht unterstützt. - {StrBegin="MSB4068: "} - - MSB4068: Das Element <{0}> ist unbekannt oder in diesem Kontext nicht unterstützt. - - fuzzyMatch="15" wordcount="13" adjWordcount="11.05" curWordcount="11.05" - - - MSB4132: The tools version "{0}" is unrecognized. - MSB4132: Die Toolsversion "{0}" ist unbekannt. - {StrBegin="MSB4132: "} - - MSB4132: Die Toolsversion "{0}" ist unbekannt. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4069: The "{0}" type of the "{1}" parameter of the "{2}" task is not supported by MSBuild. - MSB4069: Der {0}-Typ des {1}-Parameters der {2}-Aufgabe wird von MSBuild nicht unterstützt. - {StrBegin="MSB4069: "}LOCALIZATION: "MSBuild" should not be localized. - - MSB4069: Der {0}-Typ des {1}-Parameters der {2}-Aufgabe wird von MSBuild nicht unterstützt. - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - MSB4072: A <{0}> element must contain either the "{1}" attribute or the "{2}" attribute (but not both). - MSB4072: Ein <{0}>-Element muss das {1}-Attribut oder das {2}-Attribut enthalten (jedoch nicht beide). - {StrBegin="MSB4072: "} - - MSB4072: Ein <{0}>-Element muss entweder die "{1}" Attribut oder "{2}" Attribut (jedoch nicht beide). - - fuzzyMatch="15" wordcount="18" adjWordcount="15.3" curWordcount="15.3" - - - {0} Warning(s) - {0} Warnung(en) - - - {0} Warnung(en) - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4084: A <When> element may not follow an <Otherwise> element in a <Choose>. - MSB4084: Ein <When>-Element darf in einem <Choose>-Element nicht auf ein <Otherwise>-Element folgen. - {StrBegin="MSB4084: "} - - MSB4084: A < >-Element kein Element < Otherwise > < auswählen > folgen. - - fuzzyMatch="15" wordcount="16" adjWordcount="13.6" curWordcount="13.6" - - - Target Name: "{0}" Project Name: "{1}" - Zielname: "{0}" Projektname: "{1}" - - - Zielname: "{0}" Projektname: "{1}" - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Cycle trace: - Schleifenablaufverfolgung: - - - Schleifenablaufverfolgung: - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4150: Must initialize the console logger using the initialize method before using ApplyParameter - MSB4150: Die Konsolenprotokollierung muss vor der Verwendung von ApplyParameter mithilfe der Initialisierungsmethode initialisiert werden. - {StrBegin="MSB4150: "} - - MSB4150: Die Konsolenprotokollierung muss vor der Verwendung von ApplyParameter mithilfe der Initialisierungsmethode initialisiert werden. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4151: An error occurred while building project "{0}", target "{1}". Please see innerException for detailed information. - MSB4151: Fehler beim Erstellen von Projekt "{0}", Ziel "{1}". Ausführliche Informationen finden Sie in der innerException. - {StrBegin="MSB4151: "} - - MSB4151: Fehler beim Erstellen von Projekt "{0}", Ziel "{1}". Ausführliche Informationen finden Sie in der innerException. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB4152: An error occurred on the child node "{0}" and could not be passed to the parent node. {1} - MSB4152: Fehler im untergeordneten Knoten "{0}", der nicht an den übergeordneten Knoten übergeben werden konnte. {1} - {StrBegin="MSB4152: "} - - MSB4152: Fehler im untergeordneten Knoten "{0}", der nicht an den übergeordneten Knoten übergeben werden konnte. {1} - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4153: A call is made on an inactive IBuildEngine interface corresponding to a task that already finished execution. - MSB4153: Eine inaktive IBuildEngine-Schnittstelle wird aufgerufen, der eine Aufgabe entspricht, deren Ausführung bereits abgeschlossen wurde. - {StrBegin="MSB4153: "} - - MSB4153: Eine inaktive IBuildEngine-Schnittstelle wird aufgerufen, der eine Aufgabe entspricht, deren Ausführung bereits abgeschlossen wurde. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - MSB4154: A forwarding logger is attempting to forward BuildFinished event - MSB4154: Eine weiterleitende Protokollierung versucht, das BuildFinished-Ereignis weiterzuleiten. - {StrBegin="MSB4154: "} - - MSB4154: Eine weiterleitende Protokollierung versucht, das BuildFinished-Ereignis weiterzuleiten. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4155: There was an error while communicating with a node. - MSB4155: Fehler bei der Kommunikation mit einem Knoten. - {StrBegin="MSB4155: "} - - MSB4155: Fehler bei der Kommunikation mit einem Knoten. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB1021: Cannot create an instance of the logger - {0}. - MSB1021: Eine Instanz der Protokollierung kann nicht erstellt werden - {0}. - {StrBegin="MSB1021: "}The error code for this message is duplicated from MSBuild.exe. - - MSB1021: Eine Instanz der Protokollierung kann nicht erstellt werden - {0}. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB1020: The logger {0} was not found. Check the following: 1.) The logger name specified is the same as the name of the logger class. 2.) The logger class is "public" and implements the Microsoft.Build.Framework.ILogger interface. 3.) The path to the logger assembly is correct, or the logger can be loaded using only the assembly name provided. - MSB1020: Die Protokollierung {0} wurde nicht gefunden. Überprüfen Sie Folgendes: 1.) Der angegebene Name der Protokollierung ist mit dem Namen der Protokollierungsklasse identisch. 2.) Die Protokollierungsklasse ist "public" und implementiert die Microsoft.Build.Framework.ILogger-Schnittstelle. 3.) Der Pfad zur Protokollierungsassembly ist richtig, bzw. die Protokollierung kann alleine mithilfe des angegebenen Assemblynamens geladen werden. - {StrBegin="MSB1020: "}The error code for this message is duplicated from MSBuild.exe. - - MSB1020: Die Protokollierung {0} wurde nicht gefunden. Überprüfen Sie Folgendes: 1.) Der angegebene Name der Protokollierung ist mit dem Namen der Protokollierungsklasse identisch. 2.) Die Protokollierungsklasse ist "public" und implementiert die Microsoft.Build.Framework.ILogger-Schnittstelle. 3.) Der Pfad zur Protokollierungsassembly ist richtig, bzw. die Protokollierung kann alleine mithilfe des angegebenen Assemblynamens geladen werden. - - fuzzyMatch="101" wordcount="57" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4156: A forwarding logger is attempting to forward BuildStarted event - MSB4156: Eine weiterleitende Protokollierung versucht, das BuildStarted-Ereignis weiterzuleiten. - {StrBegin="MSB4156: "} - - MSB4156: Eine weiterleitende Protokollierung versucht, das BuildStarted-Ereignis weiterzuleiten. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - "{0}" ({1} target) ({2}) -> - "{0}" ({1} Ziel) ({2}) -> - - - "{0}" ({1} target) ({2}) -> - - fuzzyMatch="15" wordcount="5" adjWordcount="4.25" curWordcount="4.25" - - - "{0}" (default target) ({1}) -> - "{0}" (Standardziel) ({1}) -> - - - "{0}" (Standardziel) ({1}) -> - - fuzzyMatch="15" wordcount="5" adjWordcount="4.25" curWordcount="4.25" - - - {0} {1,5} - {0} {1,5} - - - {0} {1,5} - - fuzzyMatch="15" wordcount="2" adjWordcount="1.7" curWordcount="1.7" - - - Project "{0}" on node {1} ({2} target(s)). - Projekt "{0}" auf Knoten "{1}", {2} Ziel(e). - - - Projekt "{0}" auf Knoten "{1}", {2} Ziel(e). - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Project "{0}" on node {1} (default targets). - Projekt "{0}" auf Knoten "{1}" (Standardziele). - - - Projekt "{0}" auf Knoten "{1}" (Standardziele). - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Project "{0}" ({1}) is building "{2}" ({3}) on node {4} ({5} target(s)). - Das Projekt "{0}" ({1}) erstellt "{2}" ({3}) auf Knoten "{4}", {5} Ziel(e). - - - Das Projekt "{0}" ({1}) erstellt "{2}" ({3}) auf Knoten "{4}", {5} Ziel(e). - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Project "{0}" ({1}) is building "{2}" ({3}) on node {4} (default targets). - Das Projekt "{0}" ({1}) erstellt "{2}" ({3}) auf Knoten "{4}" (Standardziele). - - - Das Projekt "{0}" ({1}) erstellt "{2}" ({3}) auf Knoten "{4}" (Standardziele). - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - ({0} target) -> - ({0} Ziel) -> - - - ({0} Ziel) -> - - fuzzyMatch="15" wordcount="3" adjWordcount="2.55" curWordcount="2.55" - - - MSB4157: The array of project files needs to contain at least one value. - MSB4157: Das Array der Projektdateien muss mindestens einen Wert enthalten. - {StrBegin="MSB4157: "} - - MSB4157: Das Array der Projektdateien muss mindestens einen Wert enthalten. - - fuzzyMatch="15" wordcount="13" adjWordcount="11.05" curWordcount="11.05" - - - MSB4158: The project file name at element {0} is empty. - MSB4158: Der Projektdateiname bei Element {0} ist leer. - {StrBegin="MSB4158: "} - - MSB4158: Der Projektdateiname bei Element {0} ist leer. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - The property "{0}" with value "{1}" is being overridden by another batch. The property is now: "{2}" - Die Eigenschaft "{0}" mit dem Wert "{1}" wird von einem anderen Batch überschrieben. Die Eigenschaft ist jetzt: "{2}" - - - Die Eigenschaft "{0}" mit dem Wert "{1}" wird von einem anderen Batch überschrieben. Die Eigenschaft ist jetzt: "{2}" - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - Please see inner exception for error information. - Fehlerinformationen finden Sie in der internen Ausnahme. - - - Fehlerinformationen finden Sie in der internen Ausnahme. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Event type "{0}" was expected to be serializable. The event was not serializable and has been ignored. - Es wurde erwartet, dass der Typ "{0}" serialisierbar ist. Das Ereignis war nicht serialisierbar und wurde ignoriert. - - - Es wurde erwartet, dass der Typ "{0}" serialisierbar ist. Das Ereignis war nicht serialisierbar und wurde ignoriert. - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - The log file path cannot be null or empty. - Der Protokolldateipfad darf nicht NULL oder leer sein. - - - Der Protokolldateipfad darf nicht NULL oder leer sein. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4161: Project "{0}" was loaded and unloaded during the current build. Reloading a project during the build can result in errors or an inconsistent build state. Either avoid unloading project "{0}" or cache the evaluation results of target(s) "{1}" before unloading the project. - MSB4161: Das Projekt "{0}" wurde während der aktuellen Erstellung geladen und entladen. Das erneute Laden eines Projekts während der Erstellung kann zu Fehlern oder einem nicht konsistenten Buildzustand führen. Vermeiden Sie entweder das Entladen des Projekts "{0}", oder speichern Sie die Auswertungsergebnisse der Ziele "{1}" vor dem Entladen des Projekts im Cache. - {StrBegin="MSB4161: "} - - MSB4161: Das Projekt "{0}" wurde während der aktuellen Erstellung geladen und entladen. Das erneute Laden eines Projekts während der Erstellung kann zu Fehlern oder einem nicht konsistenten Buildzustand führen. Vermeiden Sie entweder das Entladen des Projekts "{0}", oder speichern Sie die Auswertungsergebnisse der Ziele "{1}" vor dem Entladen des Projekts im Cache. - - fuzzyMatch="101" wordcount="43" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - [default] - [Standard] - - - [Standard] - - fuzzyMatch="100" wordcount="1" adjWordcount="0.25" curWordcount="0.25" tmLabel="N''" - - -
-
\ No newline at end of file diff --git a/src/Deprecated/Engine/Resources/xlf/Strings.es.xlf b/src/Deprecated/Engine/Resources/xlf/Strings.es.xlf deleted file mode 100644 index 5505503def8..00000000000 --- a/src/Deprecated/Engine/Resources/xlf/Strings.es.xlf +++ /dev/null @@ -1,2674 +0,0 @@ - - - -
- - 4013 - 1176.8 - 1176.8 - 0 - 0 - - - 0 - 981 - 2334 - 0 - 0 - 698 - 0 - -
- - - MSB4001: The "{0}" task has more than one parameter called "{1}". - MSB4001: La tarea"{0}" tiene más de un parámetro denominado "{1}". - {StrBegin="MSB4001: "}UE: This message is shown when a task has more than one .NET property with the same name -- it's unclear which of - those properties the task wants to use as a parameter in project files. - - MSB4001: Die {0}-Aufgabe enthält mehrere Parameter mit dem Namen "{1}". - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4081: The value "{0}" of the "ItemName" attribute in element <Output> contains an "@" character. If you intended to use an item name then remove the @( ) around the item name. - MSB4081: El valor "{0}" del atributo "ItemName" en el elemento <Output> contiene un carácter "@". Si desea utilizar un nombre de elemento, quite los caracteres @( ) del nombre del elemento. - {StrBegin="MSB4081: "}UE: This message is shown when an output tag has an itemname that contains an @. They probably typed @(foo) instead of foo in the ItemName.LOCALIZATION: Output and ItemName should not be localized. - - MSB4081: Der Wert "{0}" "ItemName-Attribut im Element < Output > enthält ein" @"Zeichen. Soll ein Elementname verwenden und entfernen dann die @ (), um den Namen des Elements. - - fuzzyMatch="15" wordcount="30" adjWordcount="25.5" curWordcount="25.5" - - - MSB4002: There was a failure retrieving the attributes for parameters in the "{0}" task. {1} - MSB4002: No se pudieron recuperar los atributos de los parámetros de la tarea "{0}". {1} - {StrBegin="MSB4002: "}UE: This message is shown when the .NET attributes that a task's .NET properties are decorated with, cannot be - retrieved -- this is typically because the .NET classes that define the .NET attributes cannot be loaded because the assembly - they are defined in cannot be found, or the classes themselves cannot be found. - - MSB4002: Fehler beim Abrufen der Attribute für Parameter in der {0}-Aufgabe. {1} - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - MSB4003: "{0}" is a reserved attribute of the <{1}> element, and must be spelled with the correct casing. This attribute cannot be used as a parameter to the "{2}" task. - MSB4003: "{0}" es un atributo reservado del elemento <{1}> en el que deben escribirse correctamente las mayúsculas y minúsculas. Este atributo no puede usarse como un parámetro de la tarea "{2}". - {StrBegin="MSB4003: "}UE: Tasks are not allowed to use incorrect case for reserved attributes on the task nodes e.g. "continueonerror" - instead of the "ContinueOnError". - - MSB4003: "{0}" ist ein reserviertes Attribut der <{1}>-Element und mit der richtigen Groß-/Kleinschreibung geschrieben werden muss. Dieses Attribut kann nicht verwendet werden, als Parameter an die "{2}" Aufgabe. - - fuzzyMatch="15" wordcount="31" adjWordcount="26.35" curWordcount="26.35" - - - The "REQUESTBATCHSIZE" must be a number greater than 1. "{0}" is an invalid value. The value 10 will be used instead. - "REQUESTBATCHSIZE" debe ser un número mayor que 1. "{0}" es un valor no válido. Se utilizará en su lugar el valor 10. - The name "REQUESTBATCHSIZE" is an environment variable - - Die "REQUESTBATCHSIZE" muss eine Zahl größer als 1 sein. "{0}" ist ein ungültiger Wert. Der Wert 10 wird stattdessen verwendet. - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - Build completed in {0}. - Compilación completada en {0}. - - - Das Erstellen wurde in {0} beendet. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - Build FAILED. - ERROR al compilar. - - - Fehler beim Buildvorgang. - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Build succeeded. - Compilación correcta. - - - Buildvorgang erfolgreich. - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Build started. - Compilación iniciada. - - - Der Buildvorgang wurde gestartet. - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Build started {0}. - Compilación iniciada a las {0}. - - - Der Buildvorgang wurde am {0} gestartet. - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Building target "{0}" completely. - Compilando completamente el destino "{0}". - {0} is the name of the target. - - Das Ziel "{0}" wird vollständig erstellt. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - No input files were specified. - No se especificaron archivos de entrada. - - - Es wurden keine Eingabedateien angegeben. - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Input file "{0}" is newer than output file "{1}". - El archivo de entrada "{0}" es más reciente que el archivo de salida "{1}". - {0} and {1} are filenames on disk. - - Die Eingabedatei "{0}" ist neuer als die Ausgabedatei "{1}". - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - Output file "{0}" does not exist. - El archivo de salida "{0}" no existe. - {0} is a filename on disk. - - Die Ausgabedatei "{0}" ist nicht vorhanden. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Input file "{0}" does not exist. - El archivo de entrada "{0}" no existe. - {0} is a filename on disk. - - Die Eingabedatei "{0}" ist nicht vorhanden. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Building target "{0}" partially, because some output files are out of date with respect to their input files. - Compilando parcialmente el destino "{0}" porque algunos de los archivos de salida están obsoletos respecto a los archivos de entrada. - {0} is the name of the target. - - Das Ziel "{0}" wird teilweise erstellt, da einige Ausgabedateien hinsichtlich ihrer Eingabedateien veraltet sind. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - [{0}: Input={1}, Output={2}] Input file is newer than output file. - [{0}: Entrada={1}, Salida={2}] El archivo de entrada es más reciente que el archivo de salida. - {0} is the name of an MSBuild item. {1} and {2} are filenames on disk. - - [{0}: Eingabe={1}, Ausgabe={2}] Die Eingabedatei ist neuer als die Ausgabedatei. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - [{0}: Input={1}, Output={2}] Output file does not exist. - [{0}: Entrada={1}, Salida={2}] El archivo de salida no existe. - {0} is the name of an MSBuild item. {1} and {2} are filenames on disk. - - [{0}: Eingabe={1}, Ausgabe={2}] Die Ausgabedatei ist nicht vorhanden. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - [{0}: Input={1}, Output={2}] Input file does not exist. - [{0}: Entrada={1}, Salida={2}] El archivo de entrada no existe. - {0} is the name of an MSBuild item. {1} and {2} are filenames on disk. - - [{0}: Eingabe={1}, Ausgabe={2}] Die Eingabedatei ist nicht vorhanden. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - The attribute "{0}" is a known MSBuild attribute, and cannot be accessed using this method. - El atributo "{0}" es un atributo de MSBuild conocido al que no se puede obtener acceso con este método. - - - Das {0}-Attribut ist ein bekanntes MSBuild-Attribut, auf das mithilfe dieser Methode nicht zugegriffen werden kann. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - Properties in persisted property groups cannot be accessed by name. - No se puede obtener acceso por nombre a las propiedades de los grupos de propiedades almacenadas. - - - Auf Eigenschaften in persistenten Eigenschaftengruppen ist kein Zugriff über den Namen möglich. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4023: Cannot evaluate the item metadata "%({0})". {1} - MSB4023: No se pueden evaluar los metadatos del elemento "%({0})". {1} - {StrBegin="MSB4023: "}UE: This message is shown when the value of an item metadata cannot be computed for some reason e.g. trying to apply - %(RootDir) to an item-spec that's not a valid path, would result in this error. - LOCALIZATION: "{1}" is a localized message explaining the problem. - - MSB4023: Elementmetadaten "%({0})" können nicht ausgewertet werden. {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Cannot execute a task not associated with a project object. - No se puede ejecutar una tarea que no está asociada a un objeto Project. - - - Eine Aufgabe, die keinem Projektobjekt zugeordnet ist, kann nicht ausgeführt werden. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - The cache entry has already been set to a different value and cannot be modified. - La entrada de caché ya se ha establecido en un valor diferente y no se puede modificar. - - - Der Cacheeintrag wurde bereits auf einen anderen Wert festgelegt und kann nicht geändert werden. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - The "{0}" property comes from an environment variable, and cannot be modified. - La propiedad "{0}" procede de una variable de entorno y no puede modificarse. - - - Die {0}-Eigenschaft stammt aus einer Umgebungsvariablen und kann nicht geändert werden. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - The "{0}" property is a global property, and cannot be modified through an evaluated property group. Use "{1}" instead. - La propiedad "{0}" es una propiedad global y no puede modificarse con un grupo de propiedades evaluadas. Utilice "{1}" en su lugar. - - - Die {0}-Eigenschaft ist eine globale Eigenschaft und kann nicht über eine ausgewertete Eigenschaftengruppe geändert werden. Verwenden Sie stattdessen {1}. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - Modifying the XML of an imported project file is not allowed. Open that project file directly. - No se permite modificar el XML de un archivo de proyecto importado. Abra dicho archivo directamente. - - - Der XML-Code einer importierten Projektdatei darf nicht geändert werden. Öffnen Sie diese Projektdatei direkt. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB4117: The "{0}" item name is reserved, and cannot be used. - MSB4117: El nombre del elemento "{0}" está reservado y no se puede usar. - {StrBegin="MSB4117: "}UE: This message is shown when the user tries to redefine one of the reserved MSBuild items e.g. @(Choose) - - MSB4117: Der Elementname "{0}" ist reserviert und kann nicht verwendet werden. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4118: The "{0}" item metadata name is reserved, and cannot be used. - MSB4118: El nombre de metadatos para el elemento "{0}" está reservado y no se puede usar. - {StrBegin="MSB4118: "}UE: This message is shown when the user tries to redefine one of the reserved MSBuild items e.g. @(Choose) - - MSB4118: Der Elementmetadatenname "{0}" ist reserviert und kann nicht verwendet werden. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4004: The "{0}" property is reserved, and cannot be modified. - MSB4004: La propiedad "{0}" está reservada y no puede modificarse. - {StrBegin="MSB4004: "}UE: This message is shown when the user tries to redefine one of the reserved MSBuild properties e.g. $(MSBuildProjectFile) - - MSB4004: Die {0}-Eigenschaft ist reserviert und kann nicht geändert werden. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4094: "{0}" is an invalid value for the "{1}" parameter of the "{3}" task. Multiple items cannot be passed into a parameter of type "{2}". - MSB4094: "{0}" no es un valor válido para el parámetro "{1}" de la tarea "{3}". No se pueden pasar varios elementos en un parámetro del tipo "{2}". - {StrBegin="MSB4094: "} - UE: This error is shown when a project tries to pass multiple items into a task parameter of type ITaskItem (singular). - - - MSB4094: "{0}" ist ein ungültiger Wert für den "{1}"-Parameter der "{3}"-Aufgabe. Mehrere Elemente können nicht in einen Parameter vom Typ "{2}" übergeben werden. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4115: The "{0}" function only accepts a scalar value, but its argument "{1}" evaluates to "{2}" which is not a scalar value. - MSB4115: La función "{0}" sólo acepta un valor escalar, pero el argumento "{1}" se evalúa como "{2}" que no es un valor escalar. - {StrBegin="MSB4115: "} - UE: This error is shown when a project tries to pass multiple items into a function in a conditional expression, that can only accept a scalar value (such as the "exists()" function). - - - MSB4115: Die "{0}"-Funktion nimmt nur einen Skalarwert an, ihr "{1}"-Argument wird jedoch zu "{2}" ausgewertet, bei dem es sich nicht um einen Skalarwert handelt. - - fuzzyMatch="100" wordcount="22" adjWordcount="5.5" curWordcount="5.5" tmLabel="N''" - - - The task is currently associated with a project object, and should not be added to a different one. - La tarea está actualmente asociada a un objeto Project y no puede agregarse a otro objeto diferente. - - - Die Aufgabe ist derzeit einem Projektobjekt zugeordnet und sollte zu keinem anderen Projektobjekt hinzugefügt werden. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - MSB4095: The item metadata %({0}) is being referenced without an item name. Specify the item name by using %(itemname.{0}). - MSB4095: Se está haciendo referencia a los metadatos del elemento %({0}) sin un nombre de elemento. Especifique el nombre del elemento con %(itemname.{0}). - {StrBegin="MSB4095: "} - - MSB4095: Auf die %({0})-Elementmetadaten wird ohne einen Elementnamen verwiesen. Geben Sie den Namen mithilfe von %(itemname.{0}) an. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - The task is not associated with the specified target element collection, and should not be removed from it. - La tarea no está asociada a la colección de elementos de destino especificada y no debe quitarse. - - - Die Aufgabe ist nicht der angegebenen Auflistung von Zielelementen zugeordnet und sollte nicht daraus entfernt werden. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - MSB4005: The current working directory could not be restored to {0}. {1} - MSB4005: El directorio de trabajo actual no pudo restaurarse a {0}. {1} - {StrBegin="MSB4005: "}UE: This message is shown when the current working directory cannot be reset after a build. "{1}" contains a message explaining why. - LOCALIZATION: "{1}" is a message from an CLR/FX exception and is already localized. - - MSB4005: Das aktuelle Arbeitsverzeichnis konnte unter {0} nicht wiederhergestellt werden. {1} - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Cannot set a condition on an object not represented by an XML element in the project file. - No se puede establecer una condición en un objeto que no está representado por un elemento XML en el archivo de proyecto. - - - Eine Bedingung kann nicht für ein Objekt festgelegt werden, wenn das Objekt nicht von einem XML-Element in der Projektdatei repräsentiert wird. - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - Cannot set ContinueOnError on an object not represented by an XML element in the project file. - No se puede establecer ContinueOnError en un objeto que no está representado por un elemento XML en el archivo de proyecto. - - - Das ContinueOnError-Attribut kann nicht für ein Objekt festgelegt werden, wenn das Objekt nicht von einem XML-Element in der Projektdatei repräsentiert wird. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB4134: DefaultToolsVersion cannot be set after a project has been loaded into the Engine. - MSB4134: DefaultToolsVersion no se puede establecer una vez cargado un proyecto en el motor. - {StrBegin="MSB4134: "} - - MSB4134: DefaultToolsVersion darf nicht festgelegt werden, nachdem ein Projekt in das Modul geladen wurde. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - Assigning the "{0}" attribute on an item that has been evaluated is not allowed. This operation is only allowed on the original persisted item that came directly from the project file. - No está permitido asignar el atributo "{0}" a un elemento evaluado. Esta operación sólo está permitida en el elemento original almacenado procedente directamente del archivo de proyecto. - - - Das {0}-Attribut darf nicht einem Element zugewiesen werden, das ausgewertet wurde. Dieser Vorgang ist nur für das ursprüngliche persistente Element zulässig, das direkt aus der Projektdatei stammt. - - fuzzyMatch="101" wordcount="31" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Assigning the "{0}" attribute of a virtual item is not allowed. - No está permitido asignar el atributo "{0}" de un elemento virtual. - - - Das Zuweisen des {0}-Attributs eines virtuellen Elements ist nicht zulässig. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - A property cannot be set while building. - No se puede establecer una propiedad al compilar. - - - Eine Eigenschaft kann nicht während des Erstellens festgelegt werden. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - A property cannot be set to null. - Una propiedad no puede establecerse como Null. - - - Eine Eigenschaft kann nicht auf NULL festgelegt werden. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Cannot get or set parameters on a task not associated with a project object. - No se pueden obtener ni establecer parámetros en una tarea que no está asociada a un objeto Project. - - - Parameter für eine Aufgabe können nicht abgefragt oder festgelegt werden, wenn die Aufgabe keinem Projektobjekt zugeordnet ist. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4162: <{0}> is not valid. Child elements are not allowed below a item remove element. - MSB4162: <{0}> no es válido. No se permiten elementos secundarios debajo de un elemento. Quite el elemento. - {StrBegin="MSB4162: "} - - MSB4162: <{0}> ist ungültig. Untergeordnete Elemente dürfen nicht unter einem Element Element entfernen. - - fuzzyMatch="15" wordcount="16" adjWordcount="13.6" curWordcount="13.6" - - - MSB4166: Child node "{0}" exited prematurely. Shutting down. - MSB4166: El nodo secundario "{0}" se cerró antes de tiempo. Se finalizará la ejecución ahora. - {StrBegin="MSB4166: "} - - MSB4166: Der untergeordnete Knoten "{0}" wurde vorzeitig beendet. Herunterfahren. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4085: A <Choose> must contain at least one <When>. - MSB4085: Un elemento <Choose> debe contener al menos un elemento <When>. - {StrBegin="MSB4085: "} - - MSB4085: < auswählen > muss mindestens < Wenn >. - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB4114: <Choose> elements cannot be nested more than {0} levels deep. - MSB4114: Los elementos <Choose> no se pueden anidar más de {0} niveles de profundidad. - {StrBegin="MSB4114: "}UE: This message appears if the project file contains unreasonably nested Choose elements. - LOCALIZATION: Do not localize "Choose" as it is an XML element name. - - MSB4114: < auswählen > Elemente können nicht geschachtelt werden mehr als {0} Ebenen. - - fuzzyMatch="15" wordcount="12" adjWordcount="10.2" curWordcount="10.2" - - - MSB4006: There is a circular dependency in the target dependency graph involving target "{0}". - MSB4006: Existe una dependencia circular en el gráfico de dependencias de destino en la que está involucrado el destino "{0}". - {StrBegin="MSB4006: "}UE: This message is shown when the build engine detects a target referenced in a circular manner -- a project cannot - request a target to build itself (perhaps via a chain of other targets). - - MSB4006: Im Zielabhängigkeitsdiagramm besteht eine Ringabhängigkeit im Zusammenhang mit dem Ziel "{0}". - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4086: A numeric comparison was attempted on "{1}" that evaluates to "{2}" instead of a number, in condition "{0}". - MSB4086: Se intentó realizar una comparación numérica en "{1}" que se evalúa como "{2}" en lugar de un número, en la condición "{0}". - {StrBegin="MSB4086: "} - - MSB4086: Es wurde versucht, einen numerischen Vergleich für "{1}" auszuführen, der zu "{2}" anstatt zu einer Zahl in Bedingung "{0}" ausgewertet wird. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4007: The clause "{0}", specified in the "{1}" attribute is invalid. - MSB4007: La cláusula "{0}", especificada en el atributo "{1}", no es válida. - {StrBegin="MSB4007: "}UE: This message is shown when the Condition on an element is invalid in some way -- e.g. syntax error, unrecognized operator. - - MSB4007: Die im {1}-Attribut festgelegte {0}-Klausel ist ungültig. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4130: The condition "{0}" may have been evaluated incorrectly in an earlier version of MSBuild. Please verify that the order of the AND and OR clauses is written as intended. To avoid this warning, add parentheses to make the evaluation order explicit. - MSB4130: Es posible que la condición "{0}" se evalúe incorrectamente en una versión anterior de MSBuild. Compruebe que el orden especificado de las cláusulas AND y OR es el previsto. Para evitar esta advertencia, agregue paréntesis para definir explícitamente el orden de evaluación. - {StrBegin="MSB4130: "} - - MSB4130: Die Bedingung "{0}" ist in einer früheren Version von MSBuild möglicherweise fehlerhaft ausgewertet worden. Stellen Sie sicher, dass die AND- und OR-Klauseln in der beabsichtigten Reihenfolge stehen. Damit diese Warnung nicht angezeigt wird, fügen Sie Klammern hinzu, um die Auswertungsreihenfolge explizit anzugeben. - - fuzzyMatch="101" wordcount="42" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4087: Specified condition "{0}" does not evaluate to a boolean. - MSB4087: La condición "{0}" especificada no se evalúa como un término booleano. - {StrBegin="MSB4087: "} - - MSB4087: Die angegebene {0}-Bedingung wird nicht zu einem booleschen Wert ausgewertet. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4113: Specified condition "{0}" evaluates to "{1}" instead of a boolean. - MSB4113: La condición especificada "{0}" se evalúa como "{1}" en lugar de como un booleano. - {StrBegin="MSB4113: "} - - MSB4113: Die angegebene Bedingung {0} wird zu {1} statt zu einem booleschen Wert ausgewertet. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - {0}, line {1} - {0}, línea {1} - - - {0}, Zeile {1} - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - MSB4136: Error reading the toolset information from the configuration file "{0}". {1} - MSB4136: Error al leer la información del conjunto de herramientas del archivo de configuración "{0}". {1} - {StrBegin="MSB4136: "} - - MSB4136: Fehler beim Lesen der Toolsetinformationen aus der Konfigurationsdatei "{0}". {1} - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4008: A conflicting assembly for the task assembly "{0}" has been found at "{1}". - MSB4008: Se detectó un ensamblado conflictivo para el ensamblado de tarea "{0}" en "{1}". - {StrBegin="MSB4008: "}UE: This message is shown when the type/class of a task cannot be resolved uniquely from a single assembly. - - MSB4008: Eine mit der Aufgabenassembly "{0}" in Konflikt stehende Assembly wurde in "{1}" gefunden. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4142: MSBuildToolsPath is not the same as MSBuildBinPath for the ToolsVersion "{0}" defined at "{1}". If both are present they must have the same value. - MSB4142: MSBuildToolsPath no tiene el mismo valor que MSBuildBinPath para ToolsVersion "{0}" definido en "{1}". Si ambos existen, deben tener el mismo valor. - {StrBegin="MSB4142: "} - - MSB4142: MSBuildToolsPath ist nicht identisch mit MSBuildBinPath für die bei "{1}" definierte ToolsVersion {0}. Wenn beide Pfade vorhanden sind, müssen sie identische Werte haben. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4097: The element <{0}> beneath element <{1}> may not have a custom XML namespace. - MSB4097: Es posible que el elemento <{0}> del elemento <{1}> no tenga un espacio de nombres XML personalizado. - {StrBegin="MSB4097: "} - - MSB4097: Das Element <{0}> unter Element <{1}> möglicherweise keinen benutzerdefinierten XML-Namespace. - - fuzzyMatch="15" wordcount="16" adjWordcount="13.6" curWordcount="13.6" - - - MSB4009: The default tasks file could not be successfully loaded. {0} - MSB4009: El archivo de tareas predeterminado no pudo cargarse correctamente. {0} - {StrBegin="MSB4009: "}UE: This message is shown when one of the default tasks file (*.tasks) located alongside the MSBuild binaries cannot - be opened/parsed. "{0}" contains a message explaining why. The filename itself is not part of the message but is provided - separately to loggers. - LOCALIZATION: "{0}" is a message from some FX method and is already localized. - - MSB4009: Die Standardaufgabendatei konnte nicht geladen werden. {0} - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4010: The "{0}" files could not be successfully loaded from their expected location "{1}". Default tasks will not be available. {2} - MSB4010: Los archivos "{0}" no se pudieron cargar correctamente desde la ubicación esperada "{1}". Las tareas predeterminadas no estarán disponibles. {2} - {StrBegin="MSB4010: "}UE: This message is shown when the default tasks files that are located alongside the MSBuild binaries cannot be - found, either because they don't exist, or because of lack of permissions. "{2}" contains a message explaining why. - LOCALIZATION: "{2}" is a message from some FX method and is already localized. - - MSB4010: Die {0}-Dateien konnten nicht vom erwarteten Speicherplatz "{1}" geladen werden. Standardaufgaben sind nicht verfügbar. {2} - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - MSB4140: Default tools version is specified in neither the registry nor the configuration file. - MSB4140: La versión de herramientas predeterminada no se ha especificado en el Registro ni en el archivo de configuración. - {StrBegin="MSB4140: "} - - MSB4140: Die Standardtoolsversion ist weder in der Registrierung noch in der Konfigurationsdatei angegeben. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4133: A default tools version "{0}" was specified, but its definition could not be found. - MSB4133: Se ha especificado una versión de herramientas predeterminada "{0}", pero no se pudo encontrar su definición. - {StrBegin="MSB4133: "} - - MSB4133: Eine Standardtoolsversion "{0}" wurde angegeben, aber ihre Definition konnte nicht gefunden werden. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - MSB4080: The value "{0}" of the "PropertyName" attribute in element <Output> contains a "$" character. If you intended to use a property name then remove the $( ) around the property name. - MSB4080: El valor "{0}" del atributo "PropertyName" del elemento <Output> contiene el carácter "$". Si desea utilizar un nombre de propiedad, quite el carácter $( ) del nombre de la propiedad. - {StrBegin="MSB4080: "}UE: This message is shown when an output tag has an property name that contains an $. They probably typed $(foo) instead of foo in the PropertyName. LOCALIZATION: Output and PropertyName should not be localized. - - MSB4080: Der Wert "{0}" "PropertyName-Attribut im Element < Output >"$"-Zeichen enthält. Wenn Sie auf einen Eigenschaftennamen verwenden und entfernen Sie anschließend die ($), um den Eigenschaftennamen. - - fuzzyMatch="15" wordcount="32" adjWordcount="27.2" curWordcount="27.2" - - - MSB4011: There is a circular reference involving the import of file "{0}". This file may have been imported more than once, or you may have attempted to import the main project file. All except the first instance of this file will be ignored. - MSB4011: Existe una referencia circular que implica la importación del archivo "{0}". Es posible que este archivo se importara más de una vez, o bien es posible que intentara importar el archivo de proyecto principal. Se omitirán todas las instancias de este archivo excepto la primera. - {StrBegin="MSB4011: "} - - MSB4011: Es besteht eine Ringabhängigkeit im Zusammenhang mit dem Import der Datei {0}. Diese Datei wurde unter Umständen mehrmals importiert, oder es wurde versucht, die Hauptprojektdatei zu importieren. Alle außer der ersten Instanz dieser Datei werden ignoriert. - - fuzzyMatch="101" wordcount="43" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4079: The <ProjectExtensions> element occurs more than once. - MSB4079: El elemento <ProjectExtensions> aparece más de una vez. - {StrBegin="MSB4079: "} - - MSB4079: Das Element < ProjectExtensions > tritt mehr als einmal. - - fuzzyMatch="15" wordcount="9" adjWordcount="7.65" curWordcount="7.65" - - - MSB4012: The expression "{0}" cannot be used in this context. Item lists cannot be concatenated with other strings where an item list is expected. Use a semicolon to separate multiple item lists. - MSB4012: La expresión "{0}" no se puede usar en este contexto. Las listas de elementos no se pueden concatenar con otras cadenas donde se espera una lista de elementos. Use un punto y coma para separar varias listas de elementos. - {StrBegin="MSB4012: "}UE: This message is shown when the user does not properly specify an item list when an item list is expected - e.g. "badprefix@(foo)badsuffix" instead of "prefix; @(foo); suffix" - - MSB4012: Der Ausdruck {0} kann in diesem Kontext nicht verwendet werden. Elementlisten können nicht mit anderen Zeichenfolgen verkettet werden, wenn eine Elementliste erwartet wird. Verwenden Sie ein Semikolon, um mehrere Elementlisten voneinander zu trennen. - - fuzzyMatch="101" wordcount="32" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Need to specify the project file name. - Especifique el nombre del archivo de proyecto. - UE: This message is shown when the user calls into the engine to build a project without specifying a filename. - - Geben Sie den Projektdateinamen an. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - end of input - fin de entrada - This is the name of the "EndOfInput" token. It is displayed in quotes as the - unexpected char or token when the end of a conditional was unexpectedly reached. - - Ende der Eingabe - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - The previous error was converted to a warning because the task was called with ContinueOnError=true. - El error anterior se ha convertido en una advertencia porque se ha llamado a la tarea con ContinueOnError=true. - - - Der vorherige Fehler wurde in eine Warnung umgewandelt, da die Aufgabe mit ContinueOnError=true aufgerufen wurde. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - {0} Error(s) - {0} Errores - - - {0} Fehler - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4159: Error creating the toolset "{0}". {1} - MSB4159: Error al crear el conjunto de herramientas "{0}". {1} - {StrBegin="MSB4159: "} - - MSB4159: Fehler beim Erstellen des Toolsets "{0}". {1} - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4146: Cannot evaluate the property expression "{0}" found at "{1}". {2} - MSB4146: No se puede evaluar la expresión de propiedad "{0}" encontrada en "{1}". {2} - {StrBegin="MSB4146: "} - - MSB4146: Der bei "{1}" gefundene Eigenschaftsausdruck "{0}" kann nicht ausgewertet werden. {2} - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - The <{0}> tag is no longer supported as a child of the <Project> element. Place this tag within a target, and add the name of the target to the "InitialTargets" attribute of the <Project> element. - La etiqueta <{0}> ya no se admite como elemento secundario del elemento <Project>. Coloque esta etiqueta dentro de un destino y agregue el nombre de dicho destino al atributo "InitialTargets" del elemento <Project>. - - - Das <{0}>-Tag nicht als untergeordnetes Element des < Project >-Elements unterstützt. Platzieren Sie dieses Tag in einem Ziel und fügen Sie den Namen des Ziels InitialTargets-Attribut des < Project >-Elements hinzu. - - fuzzyMatch="15" wordcount="38" adjWordcount="32.3" curWordcount="32.3" - - - MSB4100: Expected "{0}" to evaluate to a boolean instead of "{1}", in condition "{2}". - MSB4100: Se esperaba que "{0}" se evaluara como un booleano en lugar de "{1}", en la condición "{2}". - {StrBegin="MSB4100: "} - - MSB4100: Das Ergebnis der Auswertung von {0} war {1}, es wurde jedoch ein boolescher Wert in der {2}-Bedingung erwartet. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4028: The "{0}" task's outputs could not be retrieved from the "{1}" parameter. {2} - MSB4028: Las salidas de la tarea "{0}" no pudieron recuperarse del parámetro "{1}". {2} - {StrBegin="MSB4028: "} - - MSB4028: Die Ausgaben der {0}-Aufgabe konnten nicht aus dem {1}-Parameter abgerufen werden. {2} - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4014: The build was aborted because of an internal failure. - MSB4014: Se anuló la compilación debido a un error interno. - {StrBegin="MSB4014: "}UE: This message is shown when an unhandled exception terminates the build. The cause is most likely a programming - error in the build engine. - - MSB4014: Das Erstellen wurde aufgrund eines internen Fehlers abgebrochen. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4015: The build was aborted because the "{0}" logger failed unexpectedly during shutdown. - MSB4015: Se anuló la compilación debido a un error inesperado del registrador "{0}" durante el cierre. - {StrBegin="MSB4015: "}UE: This message is used for a special exception that is thrown when a logger fails while shutting down (most likely - because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a special - exception to abort the build. - - MSB4015: Das Erstellen wurde abgebrochen, da für die {0}-Protokollierung beim Herunterfahren ein unerwarteter Fehler aufgetreten ist. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4016: The build was aborted because the "{0}" logger failed unexpectedly during initialization. - MSB4016: Se anuló la compilación debido a un error inesperado del registrador "{0}" durante la inicialización. - {StrBegin="MSB4016: "}UE: This message is used for a special exception that is thrown when a logger fails while initializing itself (most - likely because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a - special exception to abort the build. - - MSB4016: Das Erstellen wurde abgebrochen, da für die {0}-Protokollierung bei der Initialisierung ein unerwarteter Fehler aufgetreten ist. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4017: The build was aborted because of an unexpected logger failure. - MSB4017: Se anuló la compilación debido a un error inesperado del registrador. - {StrBegin="MSB4017: "}UE: This message is used for a special exception that is thrown when a logger fails while logging an event (most - likely because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a - special exception to abort the build. - - MSB4017: Das Erstellen wurde wegen eines unerwarteten Protokollierungsfehlers abgebrochen. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4018: The "{0}" task failed unexpectedly. - MSB4018: Error inesperado en la tarea "{0}". - {StrBegin="MSB4018: "}UE: This message is shown when a task terminates because of an unhandled exception. The cause is most likely a - programming error in the task; however, it is also possible that the unhandled exception originated in the engine, and was - surfaced through the task when the task called into the engine. - - MSB4018: Unerwarteter Fehler bei der {0}-Aufgabe. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4165: Failed to receive a response from the child node "{0}" in the timeout period "{1}" ms. Shutting down. - MSB4165: No se recibió respuesta del nodo secundario "{0}" durante el tiempo de espera de "{1}" ms. Se finalizará la ejecución ahora. - {StrBegin="MSB4165: "} - - MSB4165: Vom untergeordneten Knoten "{0}" wurde innerhalb des Zeitlimits von "{1}" ms keine Antwort empfangen. Herunterfahren. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4088: Condition "{0}" is improperly constructed. - MSB4088: La construcción de la condición "{0}" no es correcta. - {StrBegin="MSB4088: "} - - MSB4088: Die {0}-Bedingung ist falsch konstruiert. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4105: Found an unexpected character '{2}' at position {1} in condition "{0}". Did you intend to use "=="? - MSB4105: Se encontró un carácter inesperado '{2}' en la posición {1} en la condición "{0}". ¿Deseaba usar "=="? - {StrBegin="MSB4105: "} - - MSB4105: Ein unerwartetes Zeichen {2} wurde an Position {1} in der {0}-Bedingung gefunden. Wollten Sie "==" verwenden? - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - MSB4106: Expected an item list at position {1} in condition "{0}". Did you forget the closing parenthesis? - MSB4106: Se esperaba una lista de elementos en la posición {1} en la condición "{0}". ¿Olvidó el paréntesis de cierre? - {StrBegin="MSB4106: "} - - MSB4106: Eine Elementliste wurde an Position {1} in Bedingung {0} erwartet. Haben Sie die schließende Klammer vergessen? - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - MSB4107: Expected an item list at position {1} in condition "{0}". Did you forget the opening parenthesis after the '@'? To use a literal '@', use '%40' instead. - MSB4107: Se esperaba una lista de elementos en la posición {1} en la condición "{0}". ¿Olvidó el paréntesis de apertura después de '@'? Para usar '@' literal, use '%40' en su lugar. - {StrBegin="MSB4107: "} - - MSB4107: Eine Elementliste wurde an Position {1} in Bedingung {0} erwartet. Haben Sie die öffnende Klammer hinter dem Zeichen "@" vergessen? Wenn Sie ein literales "@" verwenden möchten, geben Sie "%40" ein. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4108: Expected an item list at position {1} in condition "{0}". Did you forget to close a quote inside the item list expression? - MSB4108: Se esperaba una lista de elementos en la posición {1} en la condición "{0}". ¿Olvidó cerrar las comillas dentro de la expresión de lista de elementos? - {StrBegin="MSB4108: "} - - MSB4108: Eine Elementliste wurde an Position {1} in Bedingung {0} erwartet. Haben Sie das schließende Anführungszeichen innerhalb des Elementlistenausdrucks vergessen? - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - MSB4109: Expected a property at position {1} in condition "{0}". Did you forget the closing parenthesis? - MSB4109: Se esperaba una propiedad en la posición {1} en la condición "{0}". ¿Olvidó el paréntesis de cierre? - {StrBegin="MSB4109: "} - - MSB4109: Eine Eigenschaft wurde an Position {1} in Bedingung {0} erwartet. Haben Sie die schließende Klammer vergessen? - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB4110: Expected a property at position {1} in condition "{0}". Did you forget the opening parenthesis after the '$'? To use a literal '$', use '%24' instead. - MSB4110: Se esperaba una propiedad en la posición {1} en la condición "{0}". ¿Olvidó el paréntesis de apertura después de '$'? Para usar '$' literal, use '%24' en su lugar. - {StrBegin="MSB4110: "} - - MSB4110: Eine Eigenschaft wurde an Position {1} in Bedingung {0} erwartet. Haben Sie die öffnende Klammer hinter dem Zeichen "$" vergessen? Wenn Sie eine literales "$" verwenden möchten, geben Sie "%24" ein. - - fuzzyMatch="101" wordcount="27" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4101: Expected a closing quote after position {1} in condition "{0}". - MSB4101: Se esperaban unas comillas de cierre después de la posición {1} en la condición "{0}". - {StrBegin="MSB4101: "} - - MSB4101: Es wurde ein schließendes Anführungszeichen hinter Position {1} in Bedingung {0} erwartet. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4019: The imported project "{0}" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. - MSB4019: No se encuentra el proyecto importado "{0}". Asegúrese de que la ruta de acceso de la declaración <Import> es correcta y de que el archivo se encuentra en el disco. - {StrBegin="MSB4019: "}LOCALIZATION: <Import> should not be localized. - - MSB4019: Das importierte Projekt "{0}" wurde nicht gefunden. Bestätigen Sie den Pfad in der Deklaration < Import > und die Datei auf dem Datenträger vorhanden ist. - - fuzzyMatch="15" wordcount="26" adjWordcount="22.1" curWordcount="22.1" - - - MSB4089: Incorrect number of arguments to function in condition "{0}". Found {1} argument(s) when expecting {2}. - MSB4089: Número incorrecto de argumentos en la condición "{0}". Se encontraron {1} argumentos cuando se esperaban {2}. - {StrBegin="MSB4089: "} - - MSB4089: Falsche Anzahl von Argumenten für eine Funktion in der Bedingung "{0}". {1} Argument(e) gefunden, obwohl {2} erwartet wurde(n). - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - The "{0}" object specified does not belong to the correct "{1}" object. - El objeto "{0}" especificado no pertenece al objeto "{1}" correcto. - - - Das angegebene {0}-Objekt gehört nicht zum korrekten {1}-Objekt. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4020: The value "{0}" of the "{1}" attribute in element <{2}> is invalid. - MSB4020: El valor "{0}" del atributo "{1}" del elemento <{2}> no es válido. - {StrBegin="MSB4020: "}UE: This is a generic message that is displayed when we find a project element with an incorrect value for one of its - attributes e.g. <Import Project=""> -- the value of Project should not be an empty string. - - MSB4020: Der Wert "{0}" von der "{1}" Attribut im Element <{2}> ist ungültig. - - fuzzyMatch="15" wordcount="14" adjWordcount="11.9" curWordcount="11.9" - - - MSB4102: The value "{0}" of the "{1}" attribute in element <{2}> is invalid. {3} - MSB4102: El valor "{0}" del atributo"{1}" del elemento <{2}> no es válido. {3} - {StrBegin="MSB4102: "}UE: This is a generic message that is displayed when we find a project element with an incorrect value for one of its - attributes. At the end of the message we show the exception text we got trying to use the value. - - MSB4102: Der Wert "{0}" von der "{1}" Attribut im Element <{2}> ist ungültig. {3} - - fuzzyMatch="15" wordcount="15" adjWordcount="12.75" curWordcount="12.75" - - - MSB4021: The "ContinueOnError" attribute of the "{0}" task is not valid. {1} - MSB4021: El atributo "ContinueOnError" de la tarea "{0}" no es válido. {1} - {StrBegin="MSB4021: "}LOCALIZATION: "ContinueOnError" should not be localized. "{1}" is a message from another exception explaining the problem. - - MSB4021: Das ContinueOnError-Attribut für die {0}-Aufgabe ist ungültig. {1} - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4139: Invalid value for default ToolsVersion is specified in registry key "{0}". - MSB4139: Se ha especificado un valor no válido para el elemento ToolsVersion predeterminado en la clave del Registro "{0}". - {StrBegin="MSB4139: "} - - MSB4139: Im Registrierungsschlüssel "{0}" ist ein ungültiger Wert für die Standard-ToolsVersion angegeben. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4022: The result "{0}" of evaluating the value "{1}" of the "{2}" attribute in element <{3}> is not valid. - MSB4022: El valor "{0}" resultante de evaluar el valor "{1}" del atributo "{2}" del elemento <{3}> no es válido. - {StrBegin="MSB4022: "}UE: This message is shown when the engine is checking the correctness of the value (after evaluating embedded - properties/items) assigned to an XML attribute of an XML element in the project file. - - MSB4022: Das Ergebnis "{0}"der Auswertung des Werts"{1}" von der "{2}" Attribut im Element <{3}> ist ungültig. - - fuzzyMatch="15" wordcount="20" adjWordcount="17" curWordcount="17" - - - "{0}" is not a valid event category. To raise a custom event, use the "{1}" category. - "{0}" no es una categoría de eventos válida. Para provocar un evento personalizado, utilice la categoría "{1}". - - - {0} ist keine gültige Ereigniskategorie. Verwenden Sie die {1}-Kategorie, um ein benutzerdefiniertes Ereignis auszulösen. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - "{0}" is not a valid importance level for events. - "{0}" no es un nivel de importancia válido para eventos. - - - {0} ist kein gültiger Wert für die Bedeutung eines Ereignisses. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4104: Failed to write to log file "{0}". {1} - MSB4104: No se pudo escribir en el archivo de registro "{0}". {1} - {StrBegin="MSB4104: "}UE: This is shown when the File Logger can't create or write to the file it was instructed to log to. - - MSB4104: Fehler beim Schreiben in die Protokollierungsdatei "{0}". {1} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4024: The imported project file could not be loaded. {0} - MSB4024: No puede cargarse el archivo de proyecto importado. {0} - {StrBegin="MSB4024: "}UE: This message is shown when an imported project file cannot be loaded because of incorrect XML. The project - filename is not part of the message because it is provided separately to loggers. - LOCALIZATION: {0} is a localized message from the CLR/FX explaining why the project is invalid. - - MSB4024: Die importierte Projektdatei konnte nicht geladen werden. {0} - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - Operation invalid for a persisted item group. - Operación no válida para un grupo de elementos almacenados. - - - Ungültiger Vorgang für eine persistente Elementgruppe. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Operation invalid for a virtual item group. - Operación no válida para un grupo de elementos virtuales. - - - Ungültiger Vorgang für eine virtuelle Elementgruppe. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4071: The value Importance="{0}" in the <Message> element is invalid. Valid values are: High, Normal and Low. - MSB4071: El valor Importance="{0}" del elemento <Message> no es válido. Los valores admitidos son: High, Normal y Low. - {StrBegin="MSB4071: "}UE: This message is shown when a user specifies a value for the importance attribute of Message which is not valid. - The importance enumeration is: High, Normal and Low. Specifying any other importance will result in this message being shown - LOCALIZATION: "Importance" should not be localized. - "Message" should not be localized. - High should not be localized. - Normal should not be localized. - Low should not be localized. - - MSB4071: Der Wert Importance = "{0}" in < Nachricht > Element ist ungültig. Gültige Werte sind: hoch, Normal und niedrig. - - fuzzyMatch="15" wordcount="18" adjWordcount="15.3" curWordcount="15.3" - - - MSB4025: The project file could not be loaded. {0} - MSB4025: No se pudo cargar el archivo del proyecto. {0} - {StrBegin="MSB4025: "}UE: This message is shown when the project file given to the engine cannot be loaded because the filename/path is - invalid, or due to lack of permissions, or incorrect XML. The project filename is not part of the message because it is - provided separately to loggers. - LOCALIZATION: {0} is a localized message from the CLR/FX explaining why the project is invalid. - - MSB4025: Die Projektdatei konnte nicht geladen werden. {0} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4147: The property "{0}" at "{1}" is invalid. {2} - MSB4147: La propiedad "{0}" en "{1}" no es válida. {2} - {StrBegin="MSB4147: "} - - MSB4147: Die {0}-Eigenschaft bei "{1}" ist ungültig. {2} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - "{0}" is an invalid "ProjectFileEncoding" value. - "{0}" es un valor de "ProjectFileEncoding" no válido. - LOCALIZATION: "ProjectFileEncoding" should not be localized. - - {0} ist ein ungültiger ProjectFileEncoding-Wert. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4143: The expression "{0}" cannot be evaluated. {1} - MSB4143: No se puede evaluar la expresión "{0}". {1} - {StrBegin="MSB4143: "} - UE: This message is shown when the user attempts to provide an expression like "$(Registry:HKEY_LOCAL_MACHINE\Software\Vendor\Tools@TaskLocation)" - LOCALIZATION: "{0}" is the expression that was bad. "{1}" is a message from an FX exception that describes why the expression is bad. - - - MSB4143: Der Ausdruck "{0}" kann nicht ausgewertet werden. {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4184: The expression "{0}" cannot be evaluated. {1} - MSB4184: La expresión "{0}" no se puede evaluar. {1} - {StrBegin="MSB4184: "} - Single quotes as the expression will typically have double quotes in it. - UE: This message is shown when the user attempts to provide an expression like "$(SomeProperty.ToLower())" - LOCALIZATION: "{0}" is the expression that was bad. "{1}" is a message from an FX exception that describes why the expression is bad. - - - MSB4184: Der Ausdruck "{0}" kann nicht ausgewertet werden. {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4185: The function "{0}" on type "{1}" has not been enabled for execution. - MSB4185: La función "{0}" del tipo "{1}" no se ha habilitado para ejecutarla. - {StrBegin="MSB4185: "} - UE: This message is shown when the user attempts to provide an expression like "$([System.DateTime]::Now)", but the expression has not been enabled - LOCALIZATION: "{0}" is the static function name, "{1}" is the .NET Framework type name - - - MSB4185: Die {0}-Funktion für den {1}-Typ wurde nicht für die Ausführung aktiviert. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4186: Invalid static method invocation syntax: "{0}". Static method invocation should be of the form: $([FullTypeName]::Method()), e.g. $([System.IO.Path]::Combine(`a`, `b`)) - MSB4186: Sintaxis de invocación de método estático no válida: "{0}". La invocación del método estático debe tener el formato: $([NombreTipoCompleto]::Método()), p. ej. $([System.IO.Path]::Combine(`a`, `b`)) - {StrBegin="MSB4186: "} - UE: This message is shown when the user attempts to call a static method on a type, but has used the incorrect syntax - LOCALIZATION: "{0}" is the function expression which is in error - - - MSB4186: Ungültige Aufrufsyntax für statische Methode: "{0}". Für den Aufruf statischer Methoden muss folgendes Format verwendet werden: $([vollständiger Typname]::Methode()), z. B. $([System.IO.Path]::Combine(`a`, `b`)) - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4070: The schema "{0}" is not valid. {1} - MSB4070: El esquema "{0}" no es válido. {1} - {StrBegin="MSB4070: "}UE: This message is shown when the schema file provided for the validation of a project is itself not valid. - LOCALIZATION: "{0}" is the schema file path. "{1}" is a message from an FX exception that describes why the schema file is bad. - - MSB4070: Das Schema "{0}" ist nicht gültig. {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4026: The "{0}={1}" parameter for the "{2}" task is invalid. - MSB4026: El parámetro "{0}={1}" para la tarea "{2}" no es válido. - {StrBegin="MSB4026: "}UE: This message is displayed when a task has an invalid parameter that cannot be initialized. - - MSB4026: Der {0}={1}-Parameter für die {2}-Aufgabe ist ungültig. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4027: The "{0}" task generated invalid items from the "{1}" output parameter. {2} - MSB4027: La tarea "{0}" generó elementos no válidos desde el parámetro de salida "{1}". {2} - {StrBegin="MSB4027: "} - - MSB4027: Die {0}-Aufgabe generierte ungültige Elemente aus dem {1}-Ausgabeparameter. {2} - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4029: The "{0}" task has an invalid output specification. The "TaskParameter" attribute is required, and either the "ItemName" or "PropertyName" attribute must be specified (but not both). - MSB4029: La tarea "{0}" tiene una especificación de salida no válida. Es necesario el atributo "TaskParameter" y debe especificarse el atributo "ItemName" o "PropertyName" (pero no ambos). - {StrBegin="MSB4029: "}LOCALIZATION: "TaskParameter", "ItemName" and "PropertyName" should not be localized. - - MSB4029: Die {0}-Aufgabe enthält eine ungültige Ausgabespezifikation. Das TaskParameter-Attribut ist erforderlich, und es muss entweder das ItemName- oder PropertyName-Attribut angegeben werden (jedoch nicht beide). - - fuzzyMatch="101" wordcount="27" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4030: "{0}" is an invalid value for the "{1}" parameter of the "{3}" task. The "{1}" parameter is of type "{2}". - MSB4030: "{0}" no es un valor válido para el parámetro "{1}" de la tarea "{3}". El parámetro "{1}" es del tipo "{2}". - {StrBegin="MSB4030: "}UE: This error is shown when a type mis-match occurs between the value assigned to task parameter in the project file - and the type of the .NET property that corresponds to the task parameter. For example, if an int task parameter called "Count" - is assigned the value "x", this error would be displayed: <MyTask Count="x" /> - - MSB4030: "{0}" ist ein ungültiger Wert für den {1}-Parameter der {3}-Aufgabe. Der {1}-Parameter ist vom Typ "{2}". - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - MSB4137: Invalid value specified in the configuration file at "{0}". Property name or tools version name is an empty string. - MSB4137: Se ha especificado un valor no válido en el archivo de configuración en "{0}". El nombre de la propiedad o el nombre de la versión de herramientas es una cadena vacía. - {StrBegin="MSB4137: "} - - MSB4137: In der Konfigurationsdatei ist bei "{0}" ein ungültiger Wert angegeben. Der Eigenschaftenname oder der Toolsversionname ist eine leere Zeichenfolge. - - fuzzyMatch="100" wordcount="20" adjWordcount="5" curWordcount="5" tmLabel="N''" - - - MSB4103: "{0}" is not a valid logger verbosity level. - MSB4103: "{0}" no es un nivel de detalle del registrador. - {StrBegin="MSB4103: "} - - MSB4103: "{0}" ist kein gültiger Ausführlichkeitsgrad für die Protokollierung. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4163: <ItemDefinitionGroup> is not allowed inside a target. - MSB4163: No se permite incluir <ItemDefinitionGroup> en un destino. - {StrBegin="MSB4163: "} - - MSB4163: < ItemDefinitionGroup > ist in einem Ziel nicht zulässig. - - fuzzyMatch="15" wordcount="9" adjWordcount="7.65" curWordcount="7.65" - - - The specified item does not belong to the current item group. - El elemento especificado no pertenece al grupo de elementos actual. - - - Das angegebene Element gehört nicht zu der aktuellen Elementgruppe. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4096: The item "{0}" in item list "{1}" does not define a value for metadata "{2}". In order to use this metadata, either qualify it by specifying %({1}.{2}), or ensure that all items in this list define a value for this metadata. - MSB4096: El elemento "{0}" de la lista de elementos "{1}" no define un valor para los metadatos "{2}". Para usar estos metadatos, especifique %({1}.{2}) para calificarlos o asegúrese de que todos los elementos de la lista definen un valor para estos metadatos. - {StrBegin="MSB4096: "} - - MSB4096: Das Element "{0}" in der Elementliste "{1}" definiert keinen Wert für die {2}-Metadaten. Wenn Sie diese Metadaten verwenden möchten, qualifizieren Sie sie, indem Sie %({1}.{2}) angeben, oder vergewissern Sie sich, dass alle Elemente in der Liste einen Wert für diese Metadaten definieren. - - fuzzyMatch="101" wordcount="42" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4099: A reference to an item list at position {1} is not allowed in this condition "{0}". - MSB4099: La referencia a una lista de elementos en la posición {1} no está permitida en esta condición "{0}". - {StrBegin="MSB4099: "} - - MSB4099: Ein Verweis auf eine Elementliste an Position {1} ist in dieser {0}-Bedingung nicht zulässig. - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - MSB4033: "{0}" is a reserved item metadata, and cannot be redefined as a custom metadata on the item. - MSB4033: "{0}" es un metadato de elemento reservado y no se puede volver a definir como metadatos personalizados en el elemento. - {StrBegin="MSB4033: "} - - MSB4033: "{0}" sind reservierte Elementmetadaten und können nicht als benutzerdefinierte Metadaten für das Element neu definiert werden. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - An InternalLoggerException can only be thrown by the MSBuild engine. The public constructors of this class cannot be used to create an instance of the exception. - El motor de MSBuild es el único que puede iniciar InternalLoggerException. Los constructores públicos de esta clase no se pueden usar para crear una instancia de la excepción. - UE: This message is shown when a user tries to instantiate a special exception called InternalLoggerException through the OM -- - only the engine is allowed to create and throw this exception. - LOCALIZATION: "InternalLoggerException" and "MSBuild" should not be localized. - - Eine InternalLoggerException kann nur durch das MSBuild-Modul ausgelöst werden. Die öffentlichen Konstruktoren dieser Klasse können nicht verwendet werden, um eine Instanz der Ausnahme zu erstellen. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Initial Items: - Elementos iniciales: - - - Ursprüngliche Elemente: - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4083: Expected a Condition attribute on element "{0}". - MSB4083: Se esperaba un atributo Condition en el elemento "{0}". - {StrBegin="MSB4083: "} - - MSB4083: Es wurde ein Bedingungsattribut für das {0}-Element erwartet. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4164: The value "{0}" of metadata "{1}" contains an item list expression. Item list expressions are not allowed on default metadata values. - MSB4164: El valor "{0}" de los metadatos "{1}" contiene una expresión de lista de elementos. No se permiten expresiones de lista de elementos en valores de metadatos predeterminados. - {StrBegin="MSB4164: "} - - MSB4164: Der Wert "{0}" der {1}-Metadaten enthält einen Elementlistenausdruck. Elementlistenausdrücke sind nicht als Standardwerte für Metadaten zulässig. - - fuzzyMatch="100" wordcount="22" adjWordcount="5.5" curWordcount="5.5" tmLabel="N''" - - - MSBuild is expecting a valid "{0}" object. - MSBuild espera un objeto "{0}" válido. - - - MSBuild erwartet ein gültiges {0}-Objekt. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4035: The required attribute "{0}" is missing from element <{1}>. - MSB4035: Falta el atributo requerido "{0}" en el elemento <{1}>. - {StrBegin="MSB4035: "}UE: This message is shown when a user leaves off a required attribute from a project element - e.g. <UsingTask AssemblyName="foo"> -- this is missing the "TaskName" attribute. - - MSB4035: Das erforderliche Attribut "{0}"-Element fehlt <{1}>. - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB4036: The "{0}" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "{1}" directory. - MSB4036: No se encuentra la tarea "{0}". Compruebe lo siguiente: 1.) El nombre de la tarea del archivo del proyecto es el mismo que el nombre de la clase de tarea. 2.) La clase de tarea es "public" e implementa la interfaz Microsoft.Build.Framework.ITask. 3.) La tarea se declaró correctamente con <UsingTask> en el archivo del proyecto o en los archivos *.tasks ubicados en el directorio "{1}". - {StrBegin="MSB4036: "}LOCALIZATION: <UsingTask> and "*.tasks" should not be localized. - - MSB4036: Die "{0}" Task wurde nicht gefunden. Überprüfen Sie Folgendes: 1.) der Name der Aufgabe in der Projektdatei entspricht dem Namen der Aufgabenklasse. 2) die Aufgabenklasse ist "public" und implementiert die Microsoft.Build.Framework.ITask-Schnittstelle. 3) die Aufgabe korrekt mit < UsingTask > deklariert, in der Projektdatei oder in den Tasks-Dateien der "{1}" Verzeichnis. - - fuzzyMatch="15" wordcount="64" adjWordcount="54.4" curWordcount="54.4" - - - MSB4141: MSBuildToolsPath is not specified for the ToolsVersion "{0}" defined at "{1}", or the value specified evaluates to the empty string. - MSB4141: No se ha especificado MSBuildToolsPath para el elemento ToolsVersion "{0}" definido en "{1}" o el valor especificado se evalúa como una cadena vacía. - {StrBegin="MSB4141: "} - - MSB4141: MSBuildToolsPath ist für die bei "{1}" definierte ToolsVersion {0} nicht angegeben, oder der angegebene Wert wird zu einer leeren Zeichenfolge ausgewertet. - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - MSB4031: The "MSBuildVersion" attribute is deprecated. If the project is authored in the MSBuild 2003 format, please remove the attribute from the <Project> tag. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format. - MSB4031: El atributo "MSBuildVersion" está obsoleto. Si el proyecto se creó en formato MSBuild 2003, quite el atributo de la etiqueta <Project>. Si se creó con el formato 1.0 ó 1.2 anterior, conviértalo al formato MSBuild 2003. - {StrBegin="MSB4031: "}UE: This message is shown for projects that still contain the "MSBuildVersion" attribute in their <Project> - tag. We no longer need this attribute because the project's XML namespace (i.e. the "xmlns" attribute) gives us all the - version information we need. - LOCALIZATION: "MSBuild", "MSBuildVersion" and <Project> should not be localized. - - MSB4031: Das Attribut "MSBuildVersion" ist veraltet. Wenn das Projekt im Format MSBuild 2003 erstellt wurde, entfernen Sie das Attribut aus dem Tag < Project >. Wenn das Projekt im alten Format 1.0 oder 1.2 erstellt wurde, konvertieren Sie es in das MSBuild 2003-Format. - - fuzzyMatch="15" wordcount="45" adjWordcount="38.25" curWordcount="38.25" - - - MSB4144: Multiple definitions were found for the toolset "{0}". - MSB4144: Se encontraron varias definiciones para el conjunto de herramientas "{0}". - {StrBegin="MSB4144: "} - - MSB4144: Für das Toolset wurden mehrere Definitionen gefunden "{0}". - - fuzzyMatch="15" wordcount="9" adjWordcount="7.65" curWordcount="7.65" - - - MSB4145: Multiple definitions were found for the property "{0}". - MSB4145: Se encontraron varias definiciones para la propiedad "{0}". - {StrBegin="MSB4145: "} - - MSB4145: Für die {0}-Eigenschaft wurden mehrere Definitionen gefunden. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4082: Choose has more than one <Otherwise> element. - MSB4082: Choose tiene más de un elemento <Otherwise>. - {StrBegin="MSB4082: "} - - MSB4082: Wählen Sie mehrere < Otherwise >-Element enthält. - - fuzzyMatch="15" wordcount="9" adjWordcount="7.65" curWordcount="7.65" - - - This method is only valid for persisted <{0}> elements. - Este método sólo es válido para elementos <{0}> almacenados. - - - Diese Methode ist nur gültig für beibehalten <{0}> Elemente. - - fuzzyMatch="15" wordcount="10" adjWordcount="8.5" curWordcount="8.5" - - - This method is only valid for virtual property groups, not <{0}> elements. - Este método sólo es válido para grupos de propiedades virtuales, no para elementos <{0}>. - - - Diese Methode gilt nur für virtuelle Eigenschaftengruppen nicht <{0}> Elemente. - - fuzzyMatch="15" wordcount="13" adjWordcount="11.05" curWordcount="11.05" - - - MSB4038: The element <{0}> must be last under element <{1}>. Found element <{2}> instead. - MSB4038: El elemento <{0}> debe estar el último en el elemento <{1}>. Se encontró el elemento <{2}> en su lugar. - {StrBegin="MSB4038: "} - - MSB4038: Das Element <{0}> muss unter Element <{1}>. Element wurde gefunden <{2}> statt. - - fuzzyMatch="15" wordcount="17" adjWordcount="14.45" curWordcount="14.45" - - - MSB4138: Non-string data was specified at the registry location "{0}". - MSB4138: Se han especificado datos que no son del tipo string en la ubicación del Registro "{0}". - {StrBegin="MSB4138: "} - - MSB4138: Am Registrierungsspeicherort "{0}" wurden Daten angegeben, die keine Zeichenfolge sind. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4039: No "{0}" element was found in the project file. - MSB4039: No se encuentra ningún elemento "{0}" en el archivo del proyecto. - {StrBegin="MSB4039: "} - - MSB4039: Das {0}-Element wurde in der Projektdatei nicht gefunden. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4040: There is no target in the project. - MSB4040: No hay ningún destino en el proyecto. - {StrBegin="MSB4040: "} - - MSB4040: Das Projekt enthält kein Ziel. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Removing the "{0}" attribute of an item is not allowed. - No se permite quitar el atributo "{0}" de un elemento. - - - Das Löschen des {0}-Attributs eines Elements ist nicht zulässig. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - The object passed in is not part of the project. - El objeto pasado no forma parte del proyecto. - - - Das übergebene Objekt ist nicht Teil des Projekts. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - Overriding target "{0}" in project "{1}" with target "{2}" from project "{3}". - Invalidando el destino "{0}" del proyecto"{1}" con el destino "{2}" del proyecto "{3}". - - - Das Ziel "{0}" im Projekt "{1}" wird durch das Ziel "{2}" aus dem Projekt "{3}" außer Kraft gesetzt. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4167: The parent process unexpectedly exited. Shutting down child node "{0}". - MSB4167: El proceso primario se cerró de forma inesperada. Se cerrará el nodo secundario "{0}" ahora. - {StrBegin="MSB4167: "} - - MSB4167: Der übergeordnete Prozess wurde unerwartet beendet. Der untergeordnete Knoten "{0}" wird heruntergefahren. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - {0} ms {1} {2} calls - {0} ms {1} {2} llamadas - - - {0} ms {1} {2} Aufrufe - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - (* = timing was not recorded because of reentrancy) - (* = no se registró el control de tiempo debido a la reentrada) - - - (* = Zeit wurde aufgrund des erneuten Eintretens nicht aufgezeichnet) - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - This project object has been unloaded from the MSBuild engine and is no longer valid. - Este objeto Project se descargó del motor de MSBuild y ya no es válido. - - - Dieses Projektobjekt wurde aus dem MSBuild-Modul entladen und ist nicht mehr gültig. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - The project file "{0}" was not found. - No se encontró el archivo de proyecto "{0}". - UE: This message is shown when the user calls into the OM to build a project that doesn't exist on disk. - - Die Projektdatei "{0}" wurde nicht gefunden. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Done building project "{0}" -- FAILED. - Compilación del proyecto "{0}" terminada -- ERROR. - - - Die Erstellung des Projekts "{0}" ist abgeschlossen – FEHLER. - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Done building project "{0}". - Compilación del proyecto "{0}" terminada. - - - Die Erstellung des Projekts "{0}" ist abgeschlossen. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - MSB4041: The default XML namespace of the project must be the MSBuild XML namespace. If the project is authored in the MSBuild 2003 format, please add xmlns="{0}" to the <Project> element. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format. - MSB4041: El espacio de nombres XML del proyecto debe ser el espacio de nombres XML de MSBuild. Si el proyecto se creó con el formato MSBuild 2003, agregue xmlns="{0}" al elemento <Project>. Si se creó con el formato 1.0 ó 1.2 anterior, conviértalo al formato MSBuild 2003. - {StrBegin="MSB4041: "}UE: This is a Beta 1 message only. - LOCALIZATION: <Project>, "MSBuild" and "xmlns" should not be localized. - - MSB4041: Der XML-Standardnamespace des Projekts muss MSBuild XML-Namespace. Wenn das Projekt im Format MSBuild 2003 erstellt wurde, fügen Sie Xmlns = "{0}" < Project >-Element. Wenn das Projekt im alten Format 1.0 oder 1.2 erstellt wurde, konvertieren Sie es in das MSBuild 2003-Format. - - fuzzyMatch="15" wordcount="52" adjWordcount="44.2" curWordcount="44.2" - - - Project Performance Summary: - Resumen del rendimiento del proyecto: - - - Leistungszusammenfassung für das Projekt: - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - MSB4042: Stopping because of syntax errors in project file. - MSB4042: Deteniendo el proceso debido a errores de sintaxis en el archivo de proyecto. - {StrBegin="MSB4042: "} - - MSB4042: Prozess aufgrund von Syntaxfehlern in der Projektdatei angehalten. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - Project "{0}" is building "{1}" ({2} target(s)): - El proyecto "{0}" está compilando "{1}" ({2} destinos): - - - Das Projekt {0} erstellt {1} ({2} Ziel(e)): - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Project "{0}" is building "{1}" (default targets): - El proyecto "{0}" está compilando "{1}" (destinos predeterminados): - - - Das Projekt "{0}" erstellt "{1}" (Standardziele): - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Project "{0}" ({1} target(s)): - Proyecto "{0}" ({1} destino(s)): - - - Projekt "{0}", {1} Ziel(e): - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - Project "{0}" (default targets): - Proyecto "{0}" (destinos predeterminados): - - - Projekt "{0}" (Standardziele): - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - Done Building Project "{0}" ({1} target(s)). - Compilación del proyecto terminada "{0}" ({1} destinos). - - - Die Erstellung von Projekt "{0}" ist abgeschlossen ({1} Ziel(e)). - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Done Building Project "{0}" (default targets). - Compilación del proyecto terminada "{0}" (destinos predeterminados). - - - Die Erstellung von Projekt "{0}" ist abgeschlossen (Standardziele). - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Done Building Project "{0}" ({1} target(s)) -- FAILED. - Compilación del proyecto terminada "{0}" ({1} destinos) -- ERROR. - - - Die Erstellung des Projekts "{0}" ist abgeschlossen, {1} Ziel(e) -- FEHLER. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Done Building Project "{0}" (default targets) -- FAILED. - Compilación del proyecto terminada "{0}" (destinos predeterminados) -- ERROR. - - - Die Erstellung von Projekt "{0}" ist abgeschlossen (Standardziele) -- FEHLER. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4075: The project file must be opened in the Visual Studio IDE and converted to the latest version before it can be built by MSBuild. - MSB4075: El archivo de proyecto debe abrirse en el IDE de Visual Studio y convertirse a la versión más reciente antes de generarlo con MSBuild. - {StrBegin="MSB4075: "} - - MSB4075: Die Projektdatei muss in der Visual Studio IDE geöffnet und in ein aktuelles Versionsformat gebracht werden, bevor sie mit MSBuild erstellt werden kann. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4192: The project file "{0}" is in the ".vcproj" file format, which MSBuild no longer supports. Please convert the project by opening it in the Visual Studio IDE or running the conversion tool, or use MSBuild 3.5 or earlier to build it. - MSB4192: El formato de archivo del proyecto "{0}" es ".vcproj", que MSBuild ya no admite. Convierta el proyecto abriéndolo en el IDE de Visual Studio o ejecutando la herramienta de conversión; o bien use MSBuild 3.5 para compilarlo. - {StrBegin="MSB4192: "} LOC: ".vcproj" should not be localized - - MSB4192: Die Projektdatei "{0}" ist im VSPROJ-Dateiformat gespeichert, das nicht mehr von MSBuild unterstützt wird. Konvertieren Sie das Projekt, indem Sie es in der Visual Studio IDE öffnen oder das Konvertierungstool ausführen, oder verwenden Sie MSBuild 3.5 oder früher zum Erstellen des Projekts. - - fuzzyMatch="101" wordcount="42" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - The specified property does not belong to the current property group. - La propiedad especificada no pertenece al grupo de propiedades actual. - - - Die angegebene Eigenschaft gehört nicht zu der aktuellen Eigenschaftengruppe. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - Initial Properties: - Propiedades iniciales: - - - Ursprüngliche Eigenschaften: - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4148: The name of a property stored under the registry key "{0}" has zero length. - MSB4148: El nombre de una propiedad almacenada en la clave del Registro "{0}" tiene una longitud de cero. - {StrBegin="MSB4148: "} - - MSB4148: Der Name einer unter dem Registrierungsschlüssel "{0}" gespeicherten Eigenschaft hat eine Länge von Null. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - The property names in the indexer and the "{0}" object do not match. - Los nombres de propiedades del indizador y el objeto "{0}" no coinciden. - - - Die Eigenschaftennamen im Indexer und das {0}-Objekt stimmen nicht überein. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4043: The item metadata reference "{0}" is invalid because it is qualified with an item name. Item metadata referenced in transforms do not need to be qualified, because the item name is automatically deduced from the items being transformed. Change "{0}" to "%({1})". - MSB4043: La referencia de metadatos de elemento "{0}" no es válida porque se ha calificado con un nombre de elemento. No es necesario calificar los metadatos de elemento a los que se hace referencia en las transformaciones porque el nombre del elemento se deduce automáticamente de los elementos que se van a transformar. Cambie "{0}" a "%({1})". - {StrBegin="MSB4043: "}UE: This message is shown when the user does something like this: @(foo->'%(foo.metadata)'). There is no need to specify - "foo.metadata", because "foo" is automatically deduced. In corollary, "bar.metadata" is not allowed either, where "bar" is a different - item list type. - - MSB4043: Der Elementmetadatenverweis "{0}" ist ungültig, da er mit einem Elementnamen qualifiziert ist. Elementmetadaten, auf die bei Transformationen verwiesen wird, müssen nicht qualifiziert werden, da der Elementname automatisch aus den transformierten Elementen abgeleitet wird. Ändern Sie "{0}" in "%({1})". - - fuzzyMatch="101" wordcount="43" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4135: Error reading the toolset information from the registry location "{0}". {1} - MSB4135: Error al leer la información del conjunto de herramientas de la ubicación del Registro "{0}". {1} - {StrBegin="MSB4135: "} - - MSB4135: Fehler beim Lesen der Toolsetinformationen am Registrierungsspeicherort "{0}". {1} - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4044: The "{0}" task was not given a value for the required parameter "{1}". - MSB4044: No se especificó un valor para la tarea "{0}" para el parámetro "{1}" requerido. - {StrBegin="MSB4044: "}UE: This message is shown when a task parameter designated as "required" is not set in the project file. - - MSB4044: Die {0}-Aufgabe hat keinen Wert für den erforderlichen {1}-Parameter erhalten. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - Validating project using schema file "{0}". - Validando el proyecto con el archivo de esquema "{0}". - LOCALIZATION: "{0}" is the location of the schema file. - - Das Projekt wird anhand der Schemadatei "{0}" überprüft. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4045: Project is not valid. {0} - MSB4045: El proyecto no es válido. {0} - {StrBegin="MSB4045: "}UE: This error is shown when the user asks his project to be validated against a schema (/val switch for - MSBuild.exe), and the project has errors. "{0}" contains a message explaining the problem. - LOCALIZATION: "{0}" is a message from the System.XML schema validator and is already localized. - - MSB4045: Ungültiges Projekt. {0} - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4112: The targets in this project have been disabled by the host and therefore cannot be built at this time. This may have been done for security reasons. To enable the targets, the host must set Project.BuildEnabled to "true". - MSB4112: El host deshabilitó los destinos de este proyecto y por tanto no se pueden compilar en este momento. Es posible que se deba a motivos de seguridad. Para habilitar los destinos, el host debe establecer Project.BuildEnabled como "true". - {StrBegin="MSB4112: "} - - MSB4112: Die Ziele in diesem Projekt wurden vom Host deaktiviert und können aus diesem Grund derzeit nicht erstellt werden. Die Deaktivierung wurde wahrscheinlich aus Sicherheitsgründen durchgeführt. Wenn Sie die Ziele aktivieren möchten, muss der Host Project.BuildEnabled auf "true" festlegen. - - fuzzyMatch="101" wordcount="39" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4093: The "{0}" parameter of the "{1}" task cannot be written to because it does not have a "set" accessor. - MSB4093: No puede escribirse en el parámetro "{0}" de la tarea "{1}" porque no tiene un descriptor de acceso "set". - {StrBegin="MSB4093: "}UE: This error is shown when a project tries to assign a value to a task parameter that does not have a "set" - accessor on the corresponding .NET property on the task class. - - MSB4093: In den {0}-Parameter der {1}-Aufgabe kann nicht geschrieben werden, da er keinen set-Accessor besitzt. - - fuzzyMatch="100" wordcount="20" adjWordcount="5" curWordcount="5" tmLabel="N''" - - - A shallow clone of this object cannot be created. - No puede crearse un clon superficial de este objeto. - - - Ein unechter Klon dieses Objekts kann nicht erstellt werden. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - Skipping target "{0}" because it has no inputs. - Se omitirá el destino "{0}" porque no tiene entradas. - - - Das {0}-Ziel wird übersprungen, da es keine Eingaben besitzt. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Though the target has declared its inputs, the input specification only references empty properties and/or empty item lists. - Aunque el destino declaró sus entradas, la especificación de las entradas sólo hace referencia a propiedades y/o listas de elementos vacías. - - - Obwohl das Ziel seine Eingaben deklariert hat, verweist die Eingabespezifikation nur auf leere Eigenschaften und/oder leere Elementlisten. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - Skipping target "{0}" because it has no outputs. - Se omitirá el destino "{0}" porque no tiene salidas. - - - Das Ziel "{0}" wird übersprungen, da es keine Ausgaben enthält. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Though the target has declared its outputs, the output specification only references empty properties and/or empty item lists. - Aunque el destino declaró sus salidas, la especificación de las salidas sólo hace referencia a propiedades y/o listas de elementos vacías. - - - Obwohl das Ziel seine Ausgaben deklariert hat, verweist die Ausgabespezifikation nur auf leere Eigenschaften und/oder leere Elementlisten. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - Skipping target "{0}" because all output files are up-to-date with respect to the input files. - Se omitirá el destino "{0}" porque todos los archivos de salida están actualizados respecto a los archivos de entrada. - - - Das Ziel "{0}" wird übersprungen, da alle Ausgabedateien hinsichtlich der Eingabedateien aktuell sind. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - Input files: {0} - Archivos de entrada: {0} - {0} is a semicolon-separated list of filenames. - - Eingabedateien: {0} - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Output files: {0} - Archivos de salida: {0} - {0} is a semicolon-separated list of filenames. - - Ausgabedateien: {0} - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Building solution configuration "{0}". - Compilando la configuración de soluciones "{0}". - UE: This is not an error, so doesn't need an error code. - - Die Projektmappenkonfiguration "{0}" wird erstellt. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - Using solution cache file "{0}" for configuration "{1}" and tools version "{2}". - Se está usando el archivo de caché "{0}" para la configuración "{1}" y la versión "{2}" de las herramientas. - UE: This is not an error, so doesn't need an error code. - - Die Projektmappen-Cachedatei "{0}" wird für die Konfiguration "{1}" und die Toolsversion "{2}" verwendet. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Failed to read solution cache file "{0}". {1} Using solution file directly. - No se pudo leer el archivo de caché de solución "{0}". {1} Se va a usar directamente el archivo de solución. - UE: This is not a true error, so doesn't need an error code. - - Fehler beim Lesen der Projektmappen-Cachedatei "{0}". {1} Projektmappendatei wird direkt verwendet. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Failed to write solution cache file "{0}". {1} - No se pudo escribir el archivo de caché de solución "{0}". {1} - UE: This is not a true error, so doesn't need an error code. - - Fehler beim Schreiben der Projektmappen-Cachedatei "{0}". {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Solution cache file was created for a "{0}" value of "{1}" but the current value is "{2}". Refreshing cache file. - Se creó un archivo de caché de solución para un valor "{0}" de "{1}", pero el valor actual es "{2}". Se va a actualizar dicho archivo. - UE: This is not an error, so doesn't need an error code. - - Die Projektmappen-Cachedatei wurde für den {0}-Wert "{1}" erstellt, aber der aktuelle Wert ist "{2}". Cachedatei wird aktualisiert. - - fuzzyMatch="100" wordcount="20" adjWordcount="5" curWordcount="5" tmLabel="N''" - - - Solution cache file has an internal version number "{0}" but the current value is "{1}". Refreshing cache file. - El archivo de caché de solución tiene el número de versión interna "{0}", pero el valor actual es "{1}". Se va a actualizar el archivo de caché. - UE: This is not an error, so doesn't need an error code. - - Die Projektmappen-Cachedatei hat die interne Versionsnummer "{0}", der aktuelle Wert ist aber "{1}". Cachedatei wird aktualisiert. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - Solution cache file is out of date. Refreshing cache file. {0} - El archivo de caché de solución está obsoleto. Se va a actualizar. {0} - UE: This is not an error, so doesn't need an error code. - - Die Projektmappen-Cachedatei ist veraltet. Cachedatei wird aktualisiert. {0} - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4160: A circular dependency involving project "{0}" has been detected. - MSB4160: Se ha detectado una dependencia circular en la que está involucrado el proyecto "{0}". - {StrBegin="MSB4160: "} - - MSB4160: Eine Ringabhängigkeit im Zusammenhang mit dem Projekt "{0}" wurde erkannt. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4126: The specified solution configuration "{0}" is invalid. Please specify a valid solution configuration using the Configuration and Platform properties (e.g. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU") or leave those properties blank to use the default solution configuration. - MSB4126: La configuración de soluciones especificada "{0}" no es válida. Especifique una configuración de soluciones válida con las propiedades Configuration y Platform (p. ej., MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU") o deje esas propiedades en blanco para usar la configuración de soluciones predeterminada. - {StrBegin="MSB4126: "}UE: The solution filename is provided separately to loggers. - - MSB4126: Die angegebene Projektmappenkonfiguration "{0}" ist ungültig. Geben Sie mithilfe der Konfigurations- und Plattformeigenschaften eine gültige Projektmappenkonfiguration an (z. B. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU"), oder lassen Sie diese Eigenschaften leer, sodass die Standardprojektmappenkonfiguration verwendet wird. - - fuzzyMatch="101" wordcount="37" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4046: Error reading project file "{0}": {1} - MSB4046: Error al leer el archivo del proyecto "{0}": {1} - {StrBegin="MSB4046: "} - - MSB4046: Fehler beim Lesen der Projektdatei "{0}": {1} - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4125: The project file name "{0}" is invalid. {1} - MSB4125: El nombre de archivo del proyecto "{0}" no es válido. {1} - {StrBegin="MSB4125: "}UE: The solution filename is provided separately to loggers. - - MSB4125: Der Projektdateiname "{0}" ist ungültig. {1} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4051: Project {0} is referencing a project with GUID {1}, but a project with this GUID was not found in the .SLN file. - MSB4051: El proyecto {0} hace referencia a un proyecto con GUID {1}, pero no se encuentra un proyecto con este GUID en el archivo .SLN. - {StrBegin="MSB4051: "}UE: The solution filename is provided separately to loggers. - - MSB4051: Das Projekt "{0}" verweist auf ein Projekt mit der GUID {1}, in der SLN-Datei wurde jedoch kein Projekt mit dieser GUID gefunden. - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - MSB4078: The project file "{0}" is not supported by MSBuild and cannot be built. - MSB4078: El archivo del proyecto "{0}" no es compatible con MSBuild y no puede compilarse. - {StrBegin="MSB4078: "} - - MSB4078: Die Projektdatei "{0}" wird nicht von MSBuild unterstützt und kann nicht erstellt werden. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4054: The solution file must be opened in the Visual Studio IDE and converted to the latest version before it can be built by MSBuild. - MSB4054: El archivo de solución debe abrirse en el IDE de Visual Studio y convertirse a la versión más reciente antes de compilarlo con MSBuild. - {StrBegin="MSB4054: "}UE: The solution filename is provided separately to loggers. - - MSB4054: Die Projektmappendatei muss in der Visual Studio IDE geöffnet und in die neuste Version konvertiert werden, bevor sie mit MSBuild erstellt werden kann. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4121: The project configuration for project "{0}" was not specified in the solution file for the solution configuration "{1}". - MSB4121: La configuración del proyecto "{0}" no se especificó en el archivo de solución de la configuración de soluciones "{1}". - {StrBegin="MSB4121: "} - - MSB4121: Die Projektkonfiguration für das Projekt "{0}" wurde nicht in der Projektmappendatei für die Projektmappenkonfiguration "{1}" angegeben. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - The project "{0}" is not selected for building in solution configuration "{1}". - El proyecto"{0}" no se seleccionó para la compilación en la configuración de soluciones "{1}". - - UE: This is not an error, so doesn't need an error code. - - - Das Projekt "{0}" ist in der Projektmappenkonfiguration "{1}" nicht zum Erstellen ausgewählt. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4122: Scanning project dependencies for project "{0}" failed. {1} - MSB4122: No se pudieron examinar las dependencias del proyecto "{0}". {1} - {StrBegin="MSB4122: "} - - MSB4122: Fehler beim Überprüfen der Projektabhängigkeiten für Projekt "{0}". {1} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4149: The tools version "{0}" of the solution does not support building projects with a different tools version. - MSB4149: La versión de herramientas "{0}" de la solución no permite compilar proyectos con una versión de herramientas diferente. - {StrBegin="MSB4149: "} - - MSB4149: Die Toolsversion {0} der Projektmappe unterstützt das Erstellen von Projekten mit unterschiedlichen Toolsversionen nicht. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - Web projects do not support the "Clean" target. Continuing with remaining projects ... - Los proyectos web no admiten el destino "Clean". Continuando con los proyectos restantes... - UE: This is not an error, so doesn't need an error code. - LOCALIZATION: Do not localize "Clean". - - Webprojekte unterstützen das Clean-Ziel nicht. Verbleibende Projekte werden fortgesetzt... - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Web projects do not support the "Publish" target. Continuing with remaining projects ... - Los proyectos web no admiten el destino "Publish". Continuando con los proyectos restantes... - UE: This is not an error, so doesn't need an error code. - LOCALIZATION: Do not localize "Publish". - - Webprojekte unterstützen das Publish-Ziel nicht. Verbleibende Projekte werden fortgesetzt... - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Skipping because the "$(AspNetConfiguration)" configuration is not supported for this web project. You can use the AspNetConfiguration property to override the configuration used for building web projects, by adding /p:AspNetConfiguration=<value> to the command line. Currently web projects only support Debug and Release configurations. - Se omitirá porque la configuración "$(AspNetConfiguration)" no se admite para este proyecto web. Puede usar la propiedad AspNetConfiguration para invalidar la configuración usada para compilar proyectos web si agrega /p:AspNetConfiguration=<valor> a la línea de comandos. Actualmente, los proyectos web sólo admiten configuraciones Debug y Release. - - UE: This is not an error, so doesn't need an error code. - LOCALIZATION: Do NOT localize "AspNetConfiguration", "Debug", "Release". - - - Da der "$(AspNetConfiguration)" Konfiguration für dieses Webprojekt nicht unterstützt. Verwenden die AspNetConfiguration-Eigenschaft die Konfiguration zum Erstellen von Webprojekten hinzufügen/p: AspNetConfiguration überschreiben = < Wert > in der Befehlszeile. Aktuell unterstützen Webprojekte nur Debug- und Releasekonfigurationen. - - fuzzyMatch="15" wordcount="44" adjWordcount="37.4" curWordcount="37.4" - - - MSB4076: VC projects do not support the "Publish" target. - MSB4076: Los proyectos VC no admiten el destino "Publish". - {StrBegin="MSB4076: "}LOCALIZATION: Do not localize "Publish". - - MSB4076: VC-Projekte unterstützen nicht das Publish-Ziel. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4098: MSBuild is invoking VCBuild to build this project. Project-to-project references between VC++ projects (.VCPROJ) and C#/VB/VJ# projects (.CSPROJ, .VBPROJ, .VJSPROJ) are not supported by the command-line build systems when building stand-alone VC++ projects. Projects that contain such project-to-project references will fail to build. Please build the solution file containing this project instead. - MSB4098: MSBuild está invocando VCBuild para generar este proyecto. Al crear proyectos de VC++ independientes, los sistemas de compilación de líneas de comandos no admiten referencias entre proyectos de VC++ (.VCPROJ) y de C#, VB y VJ# (.CSPROJ, .VBPROJ, .VJSPROJ). Los proyectos que incluyan dichas referencias entre proyectos no se compilarán. Compile el archivo de solución que contenga este proyecto en su lugar. - {StrBegin="MSB4098: "} - - MSB4098: MSBuild ruft zum Erstellen dieses Projekts VCBuild auf. Interprojektverweise zwischen VC++-Projekten (.VCPROJ) und C#-/VB-/VJ#-Projekten (.CSPROJ, .VBPROJ, .VJSPROJ) werden beim Erstellen eigenständiger VC++-Projekte von den Befehlszeilen-Buildsystemen nicht unterstützt. Projekte, die solche Interprojektverweise enthalten, werden nicht erstellt. Erstellen Sie stattdessen die Projektmappendatei, die dieses Projekt enthält. - - fuzzyMatch="101" wordcount="53" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4056: The MSBuild engine must be called on a single-threaded-apartment. Current threading model is "{0}". Proceeding, but some tasks may not function correctly. - MSB4056: Se debe llamar al motor de MSBuild en Singlethread-Apartment. El modelo de subprocesos actual es "{0}". El proceso continúa, pero es posible que algunas tareas no funcionen correctamente. - {StrBegin="MSB4056: "} - - MSB4056: Das MSBuild-Modul muss in einem Singlethread-Apartment aufgerufen werden. Das aktuelle Threadmodell ist {0}. Der Vorgang wird fortgesetzt, aber einige Aufgaben werden möglicherweise nicht ordnungsgemäß ausgeführt. - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - Schema validation - Validación de esquemas - UE: this fragment is used to describe errors that are caused by schema validation. For example, if a normal error is - displayed like this: "MSBUILD : error MSB0000: This is an error.", then an error from schema validation would look like this: - "MSBUILD : Schema validation error MSB0000: This is an error." - LOCALIZATION: This fragment needs to be localized. - - Schemavalidierung - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Target "{0}" skipped. Previously built unsuccessfully. - Se omitió el destino "{0}". Compilado previamente de forma incorrecta. - - - Das Ziel "{0}" wurde übersprungen. Die vorherige Erstellung war nicht erfolgreich. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Target "{0}" skipped. Previously built successfully. - Se omitió el destino "{0}". Compilado previamente de forma correcta. - - - Das Ziel "{0}" wurde übersprungen. Die vorherige Erstellung war erfolgreich. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4116: The condition "{1}" on the "{0}" target has a reference to item metadata. References to item metadata are not allowed in target conditions unless they are part of an item transform. - MSB4116: La condición "{1}" del destino "{0}" tiene una referencia a metadatos de elemento. No se permiten las referencias a metadatos de elemento en condiciones de destino a menos que formen parte de una transformación de elemento. - {StrBegin="MSB4116: "} - - MSB4116: Die Bedingung "{1}" des {0}-Ziels enthält einen Verweis auf Elementmetadaten. Verweise auf Elementmetadaten sind in Zielbedingungen nicht zulässig, es sei denn, sie sind Teil einer Elementtransformation. - - fuzzyMatch="101" wordcount="32" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4057: The target "{0}" does not exist in the project. - MSB4057: El destino "{0}" no existe en el proyecto. - {StrBegin="MSB4057: "} - - MSB4057: Das Ziel "{0}" ist im Projekt nicht vorhanden. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - Done building target "{0}" in project "{1}" -- FAILED. - Compilación terminada del destino "{0}" en el proyecto "{1}" -- ERROR. - - - Erstellen des {0}-Ziels in Projekt {1} beendet - Fehler beim Erstellen. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Done building target "{0}" in project "{1}". - Compilación terminada del destino "{0}" en el proyecto "{1}". - - - Die Erstellung des Ziels "{0}" im Projekt "{1}" ist abgeschlossen. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - {0}: (TargetId:{1}) - {0}: (TargetId:{1}) - - - {0}: (Ziel-ID:{1}) - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4058: The "{0}" target is missing its output specification. If a target declares inputs, it must also declare outputs. - MSB4058: Falta la especificación de salida del destino "{0}". Si un destino declara entradas, también debe declarar salidas. - {StrBegin="MSB4058: "} - - MSB4058: Das {0}-Ziel enthält keine Ausgabespezifikation. Wenn ein Ziel Eingaben deklariert, muss es auch Ausgaben deklarieren. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4168: The item "{0}" of type "{1}" does not define a value for the metadata in the expression "{2}". This expression is used in the target output for target "{3}". If a target declares outputs that are transforms, all items in the transform must have a value for the metadata in the transform. - MSB4168: El elemento "{0}" de tipo "{1}" no define un valor para los metadatos de la expresión "{2}". Esta expresión se usa en el resultado para el destino "{3}". Si un destino declara resultados que son transformaciones, todos los elementos de la transformación deben tener un valor para los metadatos de la transformación. - {StrBegin="MSB4168: "} - - MSB4168: Das Element "{0}" vom Typ "{1}" definiert keinen Wert für die Metadaten im Ausdruck "{2}". Dieser Ausdruck wird in der Zielausgabe für "{3}" verwendet. Wenn ein Ziel Ausgaben deklariert, bei denen es sich um Transformationen handelt, müssen alle Elemente in der Transformation einen Wert für die in der Transformation enthaltenen Metadaten aufweisen. - - fuzzyMatch="101" wordcount="53" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Target Performance Summary: - Resumen del rendimiento de destino: - - - Leistungszusammenfassung für das Ziel: - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Target "{0}" skipped, due to false condition; ({1}) was evaluated as ({2}). - Se omitió el destino "{0}" debido a una condición falsa (False); ({1}) se evaluó como ({2}). - - - Das Ziel "{0}" wurde übersprungen, da die Bedingung "false" war . ({1}) wurde als ({2}) ausgewertet. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Target "{0}" in project "{1}" - Destino "{0}" en el proyecto "{1}" - - - {0}-Ziel in {1}-Projekt. - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Target {0}: - Destino {0}: - - - Ziel "{0}": - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Target "{0}" in file "{1}": - Destino "{0}" en el archivo "{1}": - - - Ziel "{0}" in Datei "{1}": - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Build continuing because "{0}" on the task "{1}" is set to "{2}". - La compilación continúa porque "{0}" en la tarea "{1}" está establecido como "{2}". - - - Der Buildvorgang wird fortgesetzt, da {0} in der {1}-Aufgabe auf "{2}" festgelegt ist. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Target {0} from project "{1}": - Destino {0} del proyecto "{1}": - - - Ziel "{0}" aus Projekt "{1}": - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Target "{0}" in file "{1}" from project "{2}": - Destino "{0}" en el archivo "{1}" del proyecto "{2}": - - - Ziel "{0}" in Datei "{1}" aus Projekt "{2}": - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4060: The "{0}" task has been declared or used incorrectly, or failed during construction. Check the spelling of the task name and the assembly name. - MSB4060: La tarea "{0}" se declaró o usó incorrectamente o generó un error durante la construcción. Compruebe la ortografía de los nombres de la tarea y del ensamblado. - {StrBegin="MSB4060: "} - - MSB4060: Die {0}-Aufgabe wurde falsch deklariert, falsch verwendet oder konnte bei der Erstellung nicht ausgeführt werden. Überprüfen Sie die Schreibweise des Aufgaben- und des Assemblynamens. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4077: The "{0}" task has been marked with the attribute LoadInSeparateAppDomain, but does not derive from MarshalByRefObject. Check that the task derives from MarshalByRefObject or AppDomainIsolatedTask. - MSB4077: La tarea "{0}" se marcó con el atributo LoadInSeparateAppDomain, pero esta no deriva de MarshalByRefObject. Asegúrese de que la tarea deriva de MarshalByRefObject o de AppDomainIsolatedTask. - {StrBegin="MSB4077: "}LOCALIZATION: <LoadInSeparateAppDomain>, <MarshalByRefObject>, <AppDomainIsolatedTask> should not be localized. - - MSB4077: Die Aufgabe "{0}" wurde mit dem LoadInSeparateAppDomain-Attribut markiert, ist jedoch nicht von MarshalByRefObject abgeleitet. Stellen Sie sicher, dass die Aufgabe von MarshalByRefObject oder AppDomainIsolatedTask abgeleitet wird. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Done executing task "{0}" -- FAILED. - Ejecución de la tarea "{0}" terminada -- ERROR. - - - Die Ausführung von Task "{0}" wurde beendet – FEHLER. - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Done executing task "{0}". - Ejecución de la tarea "{0}" terminada. - - - Die Ausführung von Task "{0}" wurde beendet. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - {0} (TaskId:{1}) - {0} (TaskId:{1}) - - - {0} (Aufgaben-ID: {1}) - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Using "{0}" task from assembly "{1}". - Usando la tarea "{0}" del ensamblado "{1}". - UE: This informational message helps users determine which assemblies their tasks were loaded from. - - Die {0}-Aufgabe aus der {1}-Assembly wird verwendet. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4061: The "{0}" task could not be instantiated from the assembly "{1}". {2} - MSB4061: No se pudo crear una instancia de la tarea "{0}" desde el ensamblado "{1}". {2} - {StrBegin="MSB4061: "}LOCALIZATION: "{2}" is a localized message from a CLR/FX exception. - - MSB4061: Die {0}-Aufgabe konnte nicht aus der {1}-Assembly instanziiert werden. {2} - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4127: The "{0}" task could not be instantiated from the assembly "{1}". Please verify the task assembly has been built using the same version of the Microsoft.Build.Framework assembly as the one installed on your computer and that your host application is not missing a binding redirect for Microsoft.Build.Framework. {2} - MSB4127: No se pudo crear una instancia de la tarea "{0}" desde el ensamblado "{1}". Compruebe que el ensamblado de la tarea se ha compilado con la misma versión del ensamblado de Microsoft.Build.Framework que está instalada en el equipo y que no falta una redirección de enlace de Microsoft.Build.Framework en la aplicación host. {2} - {StrBegin="MSB4127: "}UE: This message is a specialized version of the TaskInstantiationFailureError message and can probably reuse some of its docs. - LOCALIZATION: "{2}" is a localized message from a CLR/FX exception. Also, Microsoft.Build.Framework should not be localized - - MSB4127: Die "{0}"-Aufgabe konnte nicht aus der "{1}"-Assembly instanziiert werden. Überprüfen Sie, ob die Aufgabenassembly mit der gleichen Version der Microsoft.Build.Framework-Assembly erstellt wurde, die auf Ihrem Computer installiert ist, und dass Ihrer Hostanwendung kein BindingRedirect-Eintrag für Microsoft.Build.Framework fehlt. {2} - - fuzzyMatch="101" wordcount="49" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4062: The "{0}" task could not be loaded from the assembly {1}. {2} Confirm that the <UsingTask> declaration is correct, and that the assembly and all its dependencies are available. - MSB4062: No se pudo cargar la tarea "{0}" desde el ensamblado. {1}. {2} Confirme que la declaración <UsingTask> es correcta y que el ensamblado y todas sus dependencias están disponibles. - {StrBegin="MSB4062: "}UE: This message is shown when a task cannot be loaded from its assembly for various reasons e.g. corrupt assembly, - invalid task declaration, disk error, etc. "{2}" contains a message explaining what happened. - LOCALIZATION: "{2}" is a message from the CLR loader and is already localized. Also, <UsingTask> should not be localized. - - MSB4062: Die "{0}" Vorgang konnte nicht aus der Assembly geladen werden {1}. {2} Bestätigen < UsingTask > Erklärung richtig ist und die Assembly und die zugehörigen Dateien verfügbar sind. - - fuzzyMatch="15" wordcount="31" adjWordcount="26.35" curWordcount="26.35" - - - MSB4063: The "{0}" task could not be initialized with its input parameters. {1} - MSB4063: La tarea "{0}" no se puede inicializar con sus parámetros de entrada. {1} - {StrBegin="MSB4063: "} - - MSB4063: Die "{0}"-Aufgabe konnte nicht mit ihren Eingabeparametern initialisiert werden. {1} - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - Task Performance Summary: - Resumen del rendimiento de la tarea: - - - Leistungszusammenfassung für die Aufgabe: - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Task "{0}" skipped, due to false condition; ({1}) was evaluated as ({2}). - Se omitió la tarea "{0}" debido a una condición falsa (False); ({1}) se evaluó como ({2}). - - - Die {0}-Aufgabe wurde übersprungen, da die Bedingung "false" war . ({1}) wurde als ({2}) ausgewertet. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Task "{0}" - Tarea "{0}" - - - Task "{0}" - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Time Elapsed {0} - Tiempo transcurrido {0} - - - Verstrichene Zeit {0} - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Building with tools version "{0}". - Compilando con la versión de herramientas "{0}". - - - Erstellung mit der Toolsversion "{0}". - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Project file contains ToolsVersion="{0}". This toolset is unknown or missing. You may be able to resolve this by installing the appropriate .NET Framework for this toolset. Treating the project as if it had ToolsVersion="4.0". - El archivo del proyecto contiene ToolsVersion="{0}". Este conjunto de herramientas falta o es desconocido. Es posible que pueda resolver este problema instalando la versión de .NET Framework adecuada para dicho conjunto. Se tratará el proyecto como si contuviera ToolsVersion="4.0". - - - Die Projektdatei enthält ToolsVersion="{0}". Dieses Toolset ist nicht bekannt oder nicht vorhanden. Sie können das Problem möglicherweise beheben, indem Sie das entsprechende .NET Framework für dieses Toolset installieren. Das Projekt wird behandelt als enthielte es ToolsVersion="4.0". - - fuzzyMatch="101" wordcount="34" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Deferred Messages - Mensajes aplazados - - - Zurückgestellte Meldungen - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Some messages did not display because they were not associated with any ProjectStarted events. Use diagnostic verbosity to view these messages. - Algunos mensajes no se mostraron porque no estaban asociados a ningún evento ProjectStarted. Utilice el nivel de detalle de diagnóstico para ver estos mensajes. - - - Einige Meldungen wurden nicht angezeigt, weil sie keinem ProjectStarted-Ereignis zugeordnet sind. Verwenden Sie den Ausführlichkeitsgrad "diagnostic", um diese Meldungen anzuzeigen. - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - MSB4090: Found an unexpected character '{2}' at position {1} in condition "{0}". - MSB4090: Se encontró un carácter inesperado '{2}' en la posición {1} en la condición "{0}". - {StrBegin="MSB4090: "} - - MSB4090: Das unerwartete Zeichen {2} wurde an Position {1} in der {0}-Bedingung gefunden. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4091: Found a call to an undefined function "{1}" in condition "{0}". - MSB4091: Se encontró una llamada a una función "{1}" sin definir en la condición "{0}". - {StrBegin="MSB4091: "} - - MSB4091: Aufruf zu einer undefinierten Funktion "{1}" in Bedingung "{0}" gefunden. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4064: The "{0}" parameter is not supported by the "{1}" task. Verify the parameter exists on the task, and it is a settable public instance property. - MSB4064: El parámetro "{0}" no es compatible con la tarea "{1}". Compruebe que el parámetro existe en la tarea y que es una propiedad de instancia Public que se puede establecer. - {StrBegin="MSB4064: "} - - MSB4064: Der {0}-Parameter wird von der {1}-Aufgabe nicht unterstützt. Vergewissern Sie sich, dass der Parameter in der Aufgabe vorhanden ist und es sich um eine festlegbare öffentliche Instanzeigenschaft handelt. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4131: The "{0}" parameter is not supported by the "{1}" task. Verify the parameter exists on the task, and it is a gettable public instance property. - MSB4131: El parámetro "{0}" no es compatible con la tarea "{1}". Compruebe que el parámetro existe en la tarea y que es una propiedad de instancia Public que se puede obtener. - {StrBegin="MSB4131: "} - - MSB4131: Der {0}-Parameter wird von der {1}-Aufgabe nicht unterstützt. Vergewissern Sie sich, dass der Parameter in der Aufgabe vorhanden ist und es sich um eine abrufbare öffentliche Instanzeigenschaft handelt. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4092: An unexpected token "{1}" was found at character position {2} in condition "{0}". - MSB4092: Se encontró un token "{1}" inesperado en la posición de carácter {2} en la condición "{0}". - {StrBegin="MSB4092: "} - - MSB4092: Ein unerwartetes Token "{1}" wurde an Zeichenposition "{2}" in Bedingung "{0}" gefunden. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4065: The "{0}" parameter is not marked for output by the "{1}" task. - MSB4065: El parámetro "{0}" no está marcado para aparecer en el resultado por la tarea "{1}". - {StrBegin="MSB4065: "} - - MSB4065: Der {0}-Parameter ist nicht für die Ausgabe durch die {1}-Aufgabe markiert. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4066: The attribute "{0}" in element <{1}> is unrecognized. - MSB4066: No se reconoce el atributo "{0}" del elemento <{1}>. - {StrBegin="MSB4066: "} - - MSB4066: Das Attribut "{0}" im Element <{1}> wurde nicht erkannt. - - fuzzyMatch="15" wordcount="10" adjWordcount="8.5" curWordcount="8.5" - - - MSB4067: The element <{0}> beneath element <{1}> is unrecognized. - MSB4067: No se reconoce el subelemento <{0}> del elemento <{1}>. - {StrBegin="MSB4067: "} - - MSB4067: Das Element <{0}> unter Element <{1}> wurde nicht erkannt. - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB4068: The element <{0}> is unrecognized, or not supported in this context. - MSB4068: No se reconoce el elemento <{0}> o no se admite en este contexto. - {StrBegin="MSB4068: "} - - MSB4068: Das Element <{0}> ist unbekannt oder in diesem Kontext nicht unterstützt. - - fuzzyMatch="15" wordcount="13" adjWordcount="11.05" curWordcount="11.05" - - - MSB4132: The tools version "{0}" is unrecognized. - MSB4132: No se reconoce la versión de herramientas "{0}". - {StrBegin="MSB4132: "} - - MSB4132: Die Toolsversion "{0}" ist unbekannt. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4069: The "{0}" type of the "{1}" parameter of the "{2}" task is not supported by MSBuild. - MSB4069: El tipo "{0}" del parámetro "{1}" de la tarea "{2}" no es compatible con MSBuild. - {StrBegin="MSB4069: "}LOCALIZATION: "MSBuild" should not be localized. - - MSB4069: Der {0}-Typ des {1}-Parameters der {2}-Aufgabe wird von MSBuild nicht unterstützt. - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - MSB4072: A <{0}> element must contain either the "{1}" attribute or the "{2}" attribute (but not both). - MSB4072: Un elemento <{0}> debe contener el atributo "{1}" o "{2}" (pero no ambos). - {StrBegin="MSB4072: "} - - MSB4072: Ein <{0}>-Element muss entweder die "{1}" Attribut oder "{2}" Attribut (jedoch nicht beide). - - fuzzyMatch="15" wordcount="18" adjWordcount="15.3" curWordcount="15.3" - - - {0} Warning(s) - {0} Advertencia(s) - - - {0} Warnung(en) - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4084: A <When> element may not follow an <Otherwise> element in a <Choose>. - MSB4084: Es posible que un elemento <When> no siga a <Otherwise> en un elemento <Choose>. - {StrBegin="MSB4084: "} - - MSB4084: A < >-Element kein Element < Otherwise > < auswählen > folgen. - - fuzzyMatch="15" wordcount="16" adjWordcount="13.6" curWordcount="13.6" - - - Target Name: "{0}" Project Name: "{1}" - Nombre de destino: "{0}" Nombre de proyecto: "{1}" - - - Zielname: "{0}" Projektname: "{1}" - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Cycle trace: - Seguimiento de ciclo: - - - Schleifenablaufverfolgung: - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4150: Must initialize the console logger using the initialize method before using ApplyParameter - MSB4150: Debe inicializar el registrador de consola con el método de inicialización antes de usar ApplyParameter - {StrBegin="MSB4150: "} - - MSB4150: Die Konsolenprotokollierung muss vor der Verwendung von ApplyParameter mithilfe der Initialisierungsmethode initialisiert werden. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4151: An error occurred while building project "{0}", target "{1}". Please see innerException for detailed information. - MSB4151: Error al compilar el proyecto "{0}", destino "{1}". Vea innerException para obtener información detallada. - {StrBegin="MSB4151: "} - - MSB4151: Fehler beim Erstellen von Projekt "{0}", Ziel "{1}". Ausführliche Informationen finden Sie in der innerException. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB4152: An error occurred on the child node "{0}" and could not be passed to the parent node. {1} - MSB4152: Error en el nodo secundario "{0}" y no se pudo pasar al nodo principal. {1}. - {StrBegin="MSB4152: "} - - MSB4152: Fehler im untergeordneten Knoten "{0}", der nicht an den übergeordneten Knoten übergeben werden konnte. {1} - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4153: A call is made on an inactive IBuildEngine interface corresponding to a task that already finished execution. - MSB4153: Se ha llamado a una interfaz IBuildEngine inactiva correspondiente a una tarea cuya ejecución ya ha terminado. - {StrBegin="MSB4153: "} - - MSB4153: Eine inaktive IBuildEngine-Schnittstelle wird aufgerufen, der eine Aufgabe entspricht, deren Ausführung bereits abgeschlossen wurde. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - MSB4154: A forwarding logger is attempting to forward BuildFinished event - MSB4154: Un registrador de reenvío está intentando reenviar el evento BuildFinished - {StrBegin="MSB4154: "} - - MSB4154: Eine weiterleitende Protokollierung versucht, das BuildFinished-Ereignis weiterzuleiten. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4155: There was an error while communicating with a node. - MSB4155: Error al comunicar con un nodo. - {StrBegin="MSB4155: "} - - MSB4155: Fehler bei der Kommunikation mit einem Knoten. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB1021: Cannot create an instance of the logger - {0}. - MSB1021: No se puede crear una instancia del registrador: {0}. - {StrBegin="MSB1021: "}The error code for this message is duplicated from MSBuild.exe. - - MSB1021: Eine Instanz der Protokollierung kann nicht erstellt werden - {0}. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB1020: The logger {0} was not found. Check the following: 1.) The logger name specified is the same as the name of the logger class. 2.) The logger class is "public" and implements the Microsoft.Build.Framework.ILogger interface. 3.) The path to the logger assembly is correct, or the logger can be loaded using only the assembly name provided. - MSB1020: No se encontró el registrador {0}. Compruebe lo siguiente: 1.) El nombre del registrador especificado es el mismo que el nombre de la clase de registrador. 2.) La clase de registrador es "public" e implementa la interfaz Microsoft.Build.Framework.ILogger. 3.) La ruta de acceso del ensamblado del registrador es correcta o el registrador puede cargarse usando sólo el nombre del ensamblado especificado. - {StrBegin="MSB1020: "}The error code for this message is duplicated from MSBuild.exe. - - MSB1020: Die Protokollierung {0} wurde nicht gefunden. Überprüfen Sie Folgendes: 1.) Der angegebene Name der Protokollierung ist mit dem Namen der Protokollierungsklasse identisch. 2.) Die Protokollierungsklasse ist "public" und implementiert die Microsoft.Build.Framework.ILogger-Schnittstelle. 3.) Der Pfad zur Protokollierungsassembly ist richtig, bzw. die Protokollierung kann alleine mithilfe des angegebenen Assemblynamens geladen werden. - - fuzzyMatch="101" wordcount="57" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4156: A forwarding logger is attempting to forward BuildStarted event - MSB4156: Un registrador de reenvío está intentando reenviar el evento BuildStarted - {StrBegin="MSB4156: "} - - MSB4156: Eine weiterleitende Protokollierung versucht, das BuildStarted-Ereignis weiterzuleiten. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - "{0}" ({1} target) ({2}) -> - "{0}" ({1} destino) ({2}) -> - - - "{0}" ({1} target) ({2}) -> - - fuzzyMatch="15" wordcount="5" adjWordcount="4.25" curWordcount="4.25" - - - "{0}" (default target) ({1}) -> - "{0}" (destino predeterminado) ({1}) -> - - - "{0}" (Standardziel) ({1}) -> - - fuzzyMatch="15" wordcount="5" adjWordcount="4.25" curWordcount="4.25" - - - {0} {1,5} - {0} {1,5} - - - {0} {1,5} - - fuzzyMatch="15" wordcount="2" adjWordcount="1.7" curWordcount="1.7" - - - Project "{0}" on node {1} ({2} target(s)). - Proyecto "{0}" en el nodo {1} ({2} destinos). - - - Projekt "{0}" auf Knoten "{1}", {2} Ziel(e). - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Project "{0}" on node {1} (default targets). - Proyecto "{0}" en nodo {1} (destinos predeterminados). - - - Projekt "{0}" auf Knoten "{1}" (Standardziele). - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Project "{0}" ({1}) is building "{2}" ({3}) on node {4} ({5} target(s)). - El proyecto "{0}" ({1}) está compilando "{2}" ({3}) en el nodo {4} ({5} destinos). - - - Das Projekt "{0}" ({1}) erstellt "{2}" ({3}) auf Knoten "{4}", {5} Ziel(e). - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Project "{0}" ({1}) is building "{2}" ({3}) on node {4} (default targets). - El proyecto "{0}" ({1}) está compilando "{2}" ({3}) en el nodo {4} (destinos predeterminados). - - - Das Projekt "{0}" ({1}) erstellt "{2}" ({3}) auf Knoten "{4}" (Standardziele). - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - ({0} target) -> - ({0} destino) -> - - - ({0} Ziel) -> - - fuzzyMatch="15" wordcount="3" adjWordcount="2.55" curWordcount="2.55" - - - MSB4157: The array of project files needs to contain at least one value. - MSB4157: La matriz de archivos de proyecto debe contener al menos un valor. - {StrBegin="MSB4157: "} - - MSB4157: Das Array der Projektdateien muss mindestens einen Wert enthalten. - - fuzzyMatch="15" wordcount="13" adjWordcount="11.05" curWordcount="11.05" - - - MSB4158: The project file name at element {0} is empty. - MSB4158: El nombre de archivo de proyecto en el elemento {0} está vacío. - {StrBegin="MSB4158: "} - - MSB4158: Der Projektdateiname bei Element {0} ist leer. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - The property "{0}" with value "{1}" is being overridden by another batch. The property is now: "{2}" - La propiedad "{0}" con el valor "{1}" está siendo invalidada por otro lote. La propiedad es ahora: "{2}" - - - Die Eigenschaft "{0}" mit dem Wert "{1}" wird von einem anderen Batch überschrieben. Die Eigenschaft ist jetzt: "{2}" - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - Please see inner exception for error information. - Vea la excepción interna para obtener información del error. - - - Fehlerinformationen finden Sie in der internen Ausnahme. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Event type "{0}" was expected to be serializable. The event was not serializable and has been ignored. - Se esperaba que el tipo de evento "{0}" fuera serializable. El evento no era serializable y se ha omitido. - - - Es wurde erwartet, dass der Typ "{0}" serialisierbar ist. Das Ereignis war nicht serialisierbar und wurde ignoriert. - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - The log file path cannot be null or empty. - La ruta del archivo de registro no puede ser NULL ni estar vacía. - - - Der Protokolldateipfad darf nicht NULL oder leer sein. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4161: Project "{0}" was loaded and unloaded during the current build. Reloading a project during the build can result in errors or an inconsistent build state. Either avoid unloading project "{0}" or cache the evaluation results of target(s) "{1}" before unloading the project. - MSB4161: El proyecto "{0}" se cargó y descargó durante la compilación actual. Si vuelve a cargar el proyecto durante la compilación, se pueden producir errores o un estado de compilación no coherente. Evite descargar el proyecto "{0}" o guarde en caché los resultados de la evaluación de los destinos "{1}" antes de descargarlo. - {StrBegin="MSB4161: "} - - MSB4161: Das Projekt "{0}" wurde während der aktuellen Erstellung geladen und entladen. Das erneute Laden eines Projekts während der Erstellung kann zu Fehlern oder einem nicht konsistenten Buildzustand führen. Vermeiden Sie entweder das Entladen des Projekts "{0}", oder speichern Sie die Auswertungsergebnisse der Ziele "{1}" vor dem Entladen des Projekts im Cache. - - fuzzyMatch="101" wordcount="43" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - [default] - [predeterminado] - - - [Standard] - - fuzzyMatch="100" wordcount="1" adjWordcount="0.25" curWordcount="0.25" tmLabel="N''" - - -
-
\ No newline at end of file diff --git a/src/Deprecated/Engine/Resources/xlf/Strings.fr.xlf b/src/Deprecated/Engine/Resources/xlf/Strings.fr.xlf deleted file mode 100644 index 20c6fba21ad..00000000000 --- a/src/Deprecated/Engine/Resources/xlf/Strings.fr.xlf +++ /dev/null @@ -1,2674 +0,0 @@ - - - -
- - 4013 - 1176.8 - 1176.8 - 0 - 0 - - - 0 - 981 - 2334 - 0 - 0 - 698 - 0 - -
- - - MSB4001: The "{0}" task has more than one parameter called "{1}". - MSB4001: La tâche "{0}" a plusieurs paramètres appelés "{1}". - {StrBegin="MSB4001: "}UE: This message is shown when a task has more than one .NET property with the same name -- it's unclear which of - those properties the task wants to use as a parameter in project files. - - MSB4001: Die {0}-Aufgabe enthält mehrere Parameter mit dem Namen "{1}". - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4081: The value "{0}" of the "ItemName" attribute in element <Output> contains an "@" character. If you intended to use an item name then remove the @( ) around the item name. - MSB4081: La valeur "{0}" de l'attribut "ItemName" dans l'élément <Output> contient un caractère "@". Si vous souhaitiez utiliser un nom d'élément, supprimez l'arobase et les parenthèses @( ) autour du nom de l'élément. - {StrBegin="MSB4081: "}UE: This message is shown when an output tag has an itemname that contains an @. They probably typed @(foo) instead of foo in the ItemName.LOCALIZATION: Output and ItemName should not be localized. - - MSB4081: Der Wert "{0}" "ItemName-Attribut im Element < Output > enthält ein" @"Zeichen. Soll ein Elementname verwenden und entfernen dann die @ (), um den Namen des Elements. - - fuzzyMatch="15" wordcount="30" adjWordcount="25.5" curWordcount="25.5" - - - MSB4002: There was a failure retrieving the attributes for parameters in the "{0}" task. {1} - MSB4002: Échec lors de l'extraction des attributs des paramètres dans la tâche "{0}". {1} - {StrBegin="MSB4002: "}UE: This message is shown when the .NET attributes that a task's .NET properties are decorated with, cannot be - retrieved -- this is typically because the .NET classes that define the .NET attributes cannot be loaded because the assembly - they are defined in cannot be found, or the classes themselves cannot be found. - - MSB4002: Fehler beim Abrufen der Attribute für Parameter in der {0}-Aufgabe. {1} - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - MSB4003: "{0}" is a reserved attribute of the <{1}> element, and must be spelled with the correct casing. This attribute cannot be used as a parameter to the "{2}" task. - MSB4003: "{0}" est un attribut réservé de l'élément <{1}> et doit être orthographié avec la casse appropriée. Impossible d'utiliser cet attribut comme paramètre de la tâche "{2}". - {StrBegin="MSB4003: "}UE: Tasks are not allowed to use incorrect case for reserved attributes on the task nodes e.g. "continueonerror" - instead of the "ContinueOnError". - - MSB4003: "{0}" ist ein reserviertes Attribut der <{1}>-Element und mit der richtigen Groß-/Kleinschreibung geschrieben werden muss. Dieses Attribut kann nicht verwendet werden, als Parameter an die "{2}" Aufgabe. - - fuzzyMatch="15" wordcount="31" adjWordcount="26.35" curWordcount="26.35" - - - The "REQUESTBATCHSIZE" must be a number greater than 1. "{0}" is an invalid value. The value 10 will be used instead. - "REQUESTBATCHSIZE" doit être un nombre supérieur à 1. "{0}" est une valeur non valide. La valeur 10 sera utilisée à la place. - The name "REQUESTBATCHSIZE" is an environment variable - - Die "REQUESTBATCHSIZE" muss eine Zahl größer als 1 sein. "{0}" ist ein ungültiger Wert. Der Wert 10 wird stattdessen verwendet. - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - Build completed in {0}. - Génération terminée en {0}. - - - Das Erstellen wurde in {0} beendet. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - Build FAILED. - ÉCHEC de la build. - - - Fehler beim Buildvorgang. - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Build succeeded. - La génération a réussi. - - - Buildvorgang erfolgreich. - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Build started. - La génération a démarré. - - - Der Buildvorgang wurde gestartet. - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Build started {0}. - La génération a démarré {0}. - - - Der Buildvorgang wurde am {0} gestartet. - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Building target "{0}" completely. - Génération complète de la cible "{0}". - {0} is the name of the target. - - Das Ziel "{0}" wird vollständig erstellt. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - No input files were specified. - Aucun fichier d'entrée n'a été spécifié. - - - Es wurden keine Eingabedateien angegeben. - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Input file "{0}" is newer than output file "{1}". - Le fichier d'entrée "{0}" est plus récent que le fichier de sortie "{1}". - {0} and {1} are filenames on disk. - - Die Eingabedatei "{0}" ist neuer als die Ausgabedatei "{1}". - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - Output file "{0}" does not exist. - Le fichier de sortie "{0}" n'existe pas. - {0} is a filename on disk. - - Die Ausgabedatei "{0}" ist nicht vorhanden. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Input file "{0}" does not exist. - Le fichier d'entrée "{0}" n'existe pas. - {0} is a filename on disk. - - Die Eingabedatei "{0}" ist nicht vorhanden. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Building target "{0}" partially, because some output files are out of date with respect to their input files. - Génération partielle de la cible "{0}", car certains fichiers de sortie sont obsolètes par rapport aux fichiers d'entrée. - {0} is the name of the target. - - Das Ziel "{0}" wird teilweise erstellt, da einige Ausgabedateien hinsichtlich ihrer Eingabedateien veraltet sind. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - [{0}: Input={1}, Output={2}] Input file is newer than output file. - [{0} : Entrée={1}, Sortie={2}] Le fichier d'entrée est plus récent que le fichier de sortie. - {0} is the name of an MSBuild item. {1} and {2} are filenames on disk. - - [{0}: Eingabe={1}, Ausgabe={2}] Die Eingabedatei ist neuer als die Ausgabedatei. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - [{0}: Input={1}, Output={2}] Output file does not exist. - [{0} : Entrée={1}, Sortie={2}] Le fichier de sortie n'existe pas. - {0} is the name of an MSBuild item. {1} and {2} are filenames on disk. - - [{0}: Eingabe={1}, Ausgabe={2}] Die Ausgabedatei ist nicht vorhanden. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - [{0}: Input={1}, Output={2}] Input file does not exist. - [{0} : Entrée={1}, Sortie={2}] Le fichier d'entrée n'existe pas. - {0} is the name of an MSBuild item. {1} and {2} are filenames on disk. - - [{0}: Eingabe={1}, Ausgabe={2}] Die Eingabedatei ist nicht vorhanden. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - The attribute "{0}" is a known MSBuild attribute, and cannot be accessed using this method. - L'attribut "{0}" est un attribut MSBuild connu et n'est pas accessible avec cette méthode. - - - Das {0}-Attribut ist ein bekanntes MSBuild-Attribut, auf das mithilfe dieser Methode nicht zugegriffen werden kann. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - Properties in persisted property groups cannot be accessed by name. - L'accès aux propriétés de groupes de propriétés persistantes ne peut se faire par nom. - - - Auf Eigenschaften in persistenten Eigenschaftengruppen ist kein Zugriff über den Namen möglich. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4023: Cannot evaluate the item metadata "%({0})". {1} - MSB4023: Impossible d'évaluer la métadonnée d'élément "%({0})". {1} - {StrBegin="MSB4023: "}UE: This message is shown when the value of an item metadata cannot be computed for some reason e.g. trying to apply - %(RootDir) to an item-spec that's not a valid path, would result in this error. - LOCALIZATION: "{1}" is a localized message explaining the problem. - - MSB4023: Elementmetadaten "%({0})" können nicht ausgewertet werden. {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Cannot execute a task not associated with a project object. - Impossible d'exécuter une tâche qui n'est pas associée à un objet du projet. - - - Eine Aufgabe, die keinem Projektobjekt zugeordnet ist, kann nicht ausgeführt werden. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - The cache entry has already been set to a different value and cannot be modified. - Une autre valeur a déjà été affectée à l'entrée de cache et elle ne peut pas être modifiée. - - - Der Cacheeintrag wurde bereits auf einen anderen Wert festgelegt und kann nicht geändert werden. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - The "{0}" property comes from an environment variable, and cannot be modified. - La propriété "{0}" provient d'une variable d'environnement et ne peut pas être modifiée. - - - Die {0}-Eigenschaft stammt aus einer Umgebungsvariablen und kann nicht geändert werden. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - The "{0}" property is a global property, and cannot be modified through an evaluated property group. Use "{1}" instead. - La propriété "{0}" est une propriété globale et ne peut pas être modifiée par le biais d'un groupe de propriétés évaluées. Utilisation de "{1}" à la place. - - - Die {0}-Eigenschaft ist eine globale Eigenschaft und kann nicht über eine ausgewertete Eigenschaftengruppe geändert werden. Verwenden Sie stattdessen {1}. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - Modifying the XML of an imported project file is not allowed. Open that project file directly. - La modification XML d'un fichier projet importé n'est pas autorisée. Ouvrez le fichier projet directement. - - - Der XML-Code einer importierten Projektdatei darf nicht geändert werden. Öffnen Sie diese Projektdatei direkt. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB4117: The "{0}" item name is reserved, and cannot be used. - MSB4117: Le nom de l'élément "{0}" est réservé et ne peut pas être utilisé. - {StrBegin="MSB4117: "}UE: This message is shown when the user tries to redefine one of the reserved MSBuild items e.g. @(Choose) - - MSB4117: Der Elementname "{0}" ist reserviert und kann nicht verwendet werden. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4118: The "{0}" item metadata name is reserved, and cannot be used. - MSB4118: Le nom de métadonnées de l'élément "{0}" est réservé et ne peut pas être utilisé. - {StrBegin="MSB4118: "}UE: This message is shown when the user tries to redefine one of the reserved MSBuild items e.g. @(Choose) - - MSB4118: Der Elementmetadatenname "{0}" ist reserviert und kann nicht verwendet werden. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4004: The "{0}" property is reserved, and cannot be modified. - MSB4004: La propriété "{0}" est réservée et ne peut pas être modifiée. - {StrBegin="MSB4004: "}UE: This message is shown when the user tries to redefine one of the reserved MSBuild properties e.g. $(MSBuildProjectFile) - - MSB4004: Die {0}-Eigenschaft ist reserviert und kann nicht geändert werden. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4094: "{0}" is an invalid value for the "{1}" parameter of the "{3}" task. Multiple items cannot be passed into a parameter of type "{2}". - MSB4094: "{0}" n'est pas une valeur valide pour le paramètre "{1}" de la tâche "{3}". Impossible de passer plusieurs éléments dans un paramètre de type "{2}". - {StrBegin="MSB4094: "} - UE: This error is shown when a project tries to pass multiple items into a task parameter of type ITaskItem (singular). - - - MSB4094: "{0}" ist ein ungültiger Wert für den "{1}"-Parameter der "{3}"-Aufgabe. Mehrere Elemente können nicht in einen Parameter vom Typ "{2}" übergeben werden. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4115: The "{0}" function only accepts a scalar value, but its argument "{1}" evaluates to "{2}" which is not a scalar value. - MSB4115: La fonction "{0}" n'accepte qu'une valeur scalaire, mais son argument "{1}" donne "{2}", qui n'est pas une valeur scalaire. - {StrBegin="MSB4115: "} - UE: This error is shown when a project tries to pass multiple items into a function in a conditional expression, that can only accept a scalar value (such as the "exists()" function). - - - MSB4115: Die "{0}"-Funktion nimmt nur einen Skalarwert an, ihr "{1}"-Argument wird jedoch zu "{2}" ausgewertet, bei dem es sich nicht um einen Skalarwert handelt. - - fuzzyMatch="100" wordcount="22" adjWordcount="5.5" curWordcount="5.5" tmLabel="N''" - - - The task is currently associated with a project object, and should not be added to a different one. - La tâche est actuellement associée à un objet du projet et ne doit pas être ajoutée à un autre objet. - - - Die Aufgabe ist derzeit einem Projektobjekt zugeordnet und sollte zu keinem anderen Projektobjekt hinzugefügt werden. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - MSB4095: The item metadata %({0}) is being referenced without an item name. Specify the item name by using %(itemname.{0}). - MSB4095: Les métadonnées d'élément %({0}) sont référencées sans nom d'élément. Spécifiez le nom d'élément à l'aide de %(itemname.{0}). - {StrBegin="MSB4095: "} - - MSB4095: Auf die %({0})-Elementmetadaten wird ohne einen Elementnamen verwiesen. Geben Sie den Namen mithilfe von %(itemname.{0}) an. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - The task is not associated with the specified target element collection, and should not be removed from it. - La tâche n'est pas associée à la collection d'éléments cible spécifiée et ne doit pas en être supprimée. - - - Die Aufgabe ist nicht der angegebenen Auflistung von Zielelementen zugeordnet und sollte nicht daraus entfernt werden. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - MSB4005: The current working directory could not be restored to {0}. {1} - MSB4005: Le répertoire de travail actif ne peut pas être restauré à {0}. {1} - {StrBegin="MSB4005: "}UE: This message is shown when the current working directory cannot be reset after a build. "{1}" contains a message explaining why. - LOCALIZATION: "{1}" is a message from an CLR/FX exception and is already localized. - - MSB4005: Das aktuelle Arbeitsverzeichnis konnte unter {0} nicht wiederhergestellt werden. {1} - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Cannot set a condition on an object not represented by an XML element in the project file. - Impossible de définir une condition sur un objet qui n'est pas représenté par un élément XML dans le fichier projet. - - - Eine Bedingung kann nicht für ein Objekt festgelegt werden, wenn das Objekt nicht von einem XML-Element in der Projektdatei repräsentiert wird. - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - Cannot set ContinueOnError on an object not represented by an XML element in the project file. - Impossible de définir ContinueOnError sur un objet qui n'est pas représenté par un élément XML dans le fichier projet. - - - Das ContinueOnError-Attribut kann nicht für ein Objekt festgelegt werden, wenn das Objekt nicht von einem XML-Element in der Projektdatei repräsentiert wird. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB4134: DefaultToolsVersion cannot be set after a project has been loaded into the Engine. - MSB4134: Impossible de définir DefaultToolsVersion une fois qu'un projet a été chargé dans le moteur. - {StrBegin="MSB4134: "} - - MSB4134: DefaultToolsVersion darf nicht festgelegt werden, nachdem ein Projekt in das Modul geladen wurde. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - Assigning the "{0}" attribute on an item that has been evaluated is not allowed. This operation is only allowed on the original persisted item that came directly from the project file. - L'assignation de l'attribut "{0}" à un élément qui n'a pas été évalué n'est pas autorisée. Cette opération n'est autorisée que sur l'élément persistant d'origine directement issu du fichier projet. - - - Das {0}-Attribut darf nicht einem Element zugewiesen werden, das ausgewertet wurde. Dieser Vorgang ist nur für das ursprüngliche persistente Element zulässig, das direkt aus der Projektdatei stammt. - - fuzzyMatch="101" wordcount="31" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Assigning the "{0}" attribute of a virtual item is not allowed. - L'assignation de l'attribut "{0}" d'un élément virtuel n'est pas autorisée. - - - Das Zuweisen des {0}-Attributs eines virtuellen Elements ist nicht zulässig. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - A property cannot be set while building. - Impossible de définir une propriété lors de la génération. - - - Eine Eigenschaft kann nicht während des Erstellens festgelegt werden. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - A property cannot be set to null. - Une propriété ne peut pas avoir la valeur "null". - - - Eine Eigenschaft kann nicht auf NULL festgelegt werden. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Cannot get or set parameters on a task not associated with a project object. - Impossible d'obtenir ou de définir les paramètres sur une tâche qui n'est pas associée à un objet du projet. - - - Parameter für eine Aufgabe können nicht abgefragt oder festgelegt werden, wenn die Aufgabe keinem Projektobjekt zugeordnet ist. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4162: <{0}> is not valid. Child elements are not allowed below a item remove element. - MSB4162: <{0}> n'est pas valide. Les éléments enfants ne sont pas autorisés sous un élément item remove. - {StrBegin="MSB4162: "} - - MSB4162: <{0}> ist ungültig. Untergeordnete Elemente dürfen nicht unter einem Element Element entfernen. - - fuzzyMatch="15" wordcount="16" adjWordcount="13.6" curWordcount="13.6" - - - MSB4166: Child node "{0}" exited prematurely. Shutting down. - MSB4166: Fin prématurée du nœud enfant "{0}". Arrêt. - {StrBegin="MSB4166: "} - - MSB4166: Der untergeordnete Knoten "{0}" wurde vorzeitig beendet. Herunterfahren. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4085: A <Choose> must contain at least one <When>. - MSB4085: Un élément <Choose> doit contenir au moins un élément <When>. - {StrBegin="MSB4085: "} - - MSB4085: < auswählen > muss mindestens < Wenn >. - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB4114: <Choose> elements cannot be nested more than {0} levels deep. - MSB4114: Impossible d'imbriquer les éléments <Choose> de plus de {0} niveaux. - {StrBegin="MSB4114: "}UE: This message appears if the project file contains unreasonably nested Choose elements. - LOCALIZATION: Do not localize "Choose" as it is an XML element name. - - MSB4114: < auswählen > Elemente können nicht geschachtelt werden mehr als {0} Ebenen. - - fuzzyMatch="15" wordcount="12" adjWordcount="10.2" curWordcount="10.2" - - - MSB4006: There is a circular dependency in the target dependency graph involving target "{0}". - MSB4006: Il existe une dépendance circulaire dans le graphique de dépendance cible qui implique la cible "{0}". - {StrBegin="MSB4006: "}UE: This message is shown when the build engine detects a target referenced in a circular manner -- a project cannot - request a target to build itself (perhaps via a chain of other targets). - - MSB4006: Im Zielabhängigkeitsdiagramm besteht eine Ringabhängigkeit im Zusammenhang mit dem Ziel "{0}". - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4086: A numeric comparison was attempted on "{1}" that evaluates to "{2}" instead of a number, in condition "{0}". - MSB4086: La comparaison numérique tentée pour "{1}" donne "{2}" au lieu d'un chiffre, dans la condition "{0}". - {StrBegin="MSB4086: "} - - MSB4086: Es wurde versucht, einen numerischen Vergleich für "{1}" auszuführen, der zu "{2}" anstatt zu einer Zahl in Bedingung "{0}" ausgewertet wird. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4007: The clause "{0}", specified in the "{1}" attribute is invalid. - MSB4007: La clause "{0}", spécifiée dans l'attribut "{1}", n'est pas valide. - {StrBegin="MSB4007: "}UE: This message is shown when the Condition on an element is invalid in some way -- e.g. syntax error, unrecognized operator. - - MSB4007: Die im {1}-Attribut festgelegte {0}-Klausel ist ungültig. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4130: The condition "{0}" may have been evaluated incorrectly in an earlier version of MSBuild. Please verify that the order of the AND and OR clauses is written as intended. To avoid this warning, add parentheses to make the evaluation order explicit. - MSB4130: La condition "{0}" a peut-être été évaluée de manière incorrecte dans une version antérieure de MSBuild. Vérifiez que l'ordre des clauses AND et OR est correct. Pour éviter cet avertissement, ajoutez des parenthèses afin de rendre l'ordre d'évaluation explicite. - {StrBegin="MSB4130: "} - - MSB4130: Die Bedingung "{0}" ist in einer früheren Version von MSBuild möglicherweise fehlerhaft ausgewertet worden. Stellen Sie sicher, dass die AND- und OR-Klauseln in der beabsichtigten Reihenfolge stehen. Damit diese Warnung nicht angezeigt wird, fügen Sie Klammern hinzu, um die Auswertungsreihenfolge explizit anzugeben. - - fuzzyMatch="101" wordcount="42" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4087: Specified condition "{0}" does not evaluate to a boolean. - MSB4087: La condition "{0}" spécifiée ne correspond pas à une valeur booléenne. - {StrBegin="MSB4087: "} - - MSB4087: Die angegebene {0}-Bedingung wird nicht zu einem booleschen Wert ausgewertet. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4113: Specified condition "{0}" evaluates to "{1}" instead of a boolean. - MSB4113: La condition "{0}" donne "{1}" au lieu d'une valeur booléenne. - {StrBegin="MSB4113: "} - - MSB4113: Die angegebene Bedingung {0} wird zu {1} statt zu einem booleschen Wert ausgewertet. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - {0}, line {1} - {0}, ligne {1} - - - {0}, Zeile {1} - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - MSB4136: Error reading the toolset information from the configuration file "{0}". {1} - MSB4136: Erreur lors de la lecture des informations relatives à l'ensemble d'outils à partir du fichier de configuration "{0}". {1} - {StrBegin="MSB4136: "} - - MSB4136: Fehler beim Lesen der Toolsetinformationen aus der Konfigurationsdatei "{0}". {1} - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4008: A conflicting assembly for the task assembly "{0}" has been found at "{1}". - MSB4008: un assembly en conflit avec l'assembly de tâche "{0}" a été trouvé sur "{1}". - {StrBegin="MSB4008: "}UE: This message is shown when the type/class of a task cannot be resolved uniquely from a single assembly. - - MSB4008: Eine mit der Aufgabenassembly "{0}" in Konflikt stehende Assembly wurde in "{1}" gefunden. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4142: MSBuildToolsPath is not the same as MSBuildBinPath for the ToolsVersion "{0}" defined at "{1}". If both are present they must have the same value. - MSB4142: MSBuildToolsPath n'est pas identique à MSBuildBinPath pour le ToolsVersion "{0}" défini à "{1}". Si les deux sont présents, ils doivent avoir la même valeur. - {StrBegin="MSB4142: "} - - MSB4142: MSBuildToolsPath ist nicht identisch mit MSBuildBinPath für die bei "{1}" definierte ToolsVersion {0}. Wenn beide Pfade vorhanden sind, müssen sie identische Werte haben. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4097: The element <{0}> beneath element <{1}> may not have a custom XML namespace. - MSB4097: L'élément <{0}> placé sous l'élément <{1}> ne contient peut-être pas un espace de noms XML personnalisé. - {StrBegin="MSB4097: "} - - MSB4097: Das Element <{0}> unter Element <{1}> möglicherweise keinen benutzerdefinierten XML-Namespace. - - fuzzyMatch="15" wordcount="16" adjWordcount="13.6" curWordcount="13.6" - - - MSB4009: The default tasks file could not be successfully loaded. {0} - MSB4009: Impossible de charger correctement le fichier de tâches par défaut. {0} - {StrBegin="MSB4009: "}UE: This message is shown when one of the default tasks file (*.tasks) located alongside the MSBuild binaries cannot - be opened/parsed. "{0}" contains a message explaining why. The filename itself is not part of the message but is provided - separately to loggers. - LOCALIZATION: "{0}" is a message from some FX method and is already localized. - - MSB4009: Die Standardaufgabendatei konnte nicht geladen werden. {0} - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4010: The "{0}" files could not be successfully loaded from their expected location "{1}". Default tasks will not be available. {2} - MSB4010: Impossible de charger correctement les fichiers "{0}" à partir de l'emplacement attendu "{1}". Les tâches par défaut ne sont pas disponibles. {2} - {StrBegin="MSB4010: "}UE: This message is shown when the default tasks files that are located alongside the MSBuild binaries cannot be - found, either because they don't exist, or because of lack of permissions. "{2}" contains a message explaining why. - LOCALIZATION: "{2}" is a message from some FX method and is already localized. - - MSB4010: Die {0}-Dateien konnten nicht vom erwarteten Speicherplatz "{1}" geladen werden. Standardaufgaben sind nicht verfügbar. {2} - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - MSB4140: Default tools version is specified in neither the registry nor the configuration file. - MSB4140: La version des outils par défaut n'est spécifiée ni dans le Registre, ni dans le fichier de configuration. - {StrBegin="MSB4140: "} - - MSB4140: Die Standardtoolsversion ist weder in der Registrierung noch in der Konfigurationsdatei angegeben. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4133: A default tools version "{0}" was specified, but its definition could not be found. - MSB4133: Une version des outils par défaut "{0}" a été spécifiée mais sa définition est introuvable. - {StrBegin="MSB4133: "} - - MSB4133: Eine Standardtoolsversion "{0}" wurde angegeben, aber ihre Definition konnte nicht gefunden werden. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - MSB4080: The value "{0}" of the "PropertyName" attribute in element <Output> contains a "$" character. If you intended to use a property name then remove the $( ) around the property name. - MSB4080: La valeur "{0}" de l'attribut "PropertyName" dans l'élément <Output> contient un caractère "$". Si vous souhaitez utiliser un nom de propriété, supprimez le signe et les parenthèses $( ) autour du nom de propriété. - {StrBegin="MSB4080: "}UE: This message is shown when an output tag has an property name that contains an $. They probably typed $(foo) instead of foo in the PropertyName. LOCALIZATION: Output and PropertyName should not be localized. - - MSB4080: Der Wert "{0}" "PropertyName-Attribut im Element < Output >"$"-Zeichen enthält. Wenn Sie auf einen Eigenschaftennamen verwenden und entfernen Sie anschließend die ($), um den Eigenschaftennamen. - - fuzzyMatch="15" wordcount="32" adjWordcount="27.2" curWordcount="27.2" - - - MSB4011: There is a circular reference involving the import of file "{0}". This file may have been imported more than once, or you may have attempted to import the main project file. All except the first instance of this file will be ignored. - MSB4011: Il existe une référence circulaire qui implique l'importation du fichier "{0}". Ce dernier peut avoir été importé plusieurs fois, ou vous avez tenté d'importer le fichier projet principal. Tout sauf la première instance de ce fichier sera ignoré. - {StrBegin="MSB4011: "} - - MSB4011: Es besteht eine Ringabhängigkeit im Zusammenhang mit dem Import der Datei {0}. Diese Datei wurde unter Umständen mehrmals importiert, oder es wurde versucht, die Hauptprojektdatei zu importieren. Alle außer der ersten Instanz dieser Datei werden ignoriert. - - fuzzyMatch="101" wordcount="43" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4079: The <ProjectExtensions> element occurs more than once. - MSB4079: L'élément <ProjectExtensions> survient plusieurs fois. - {StrBegin="MSB4079: "} - - MSB4079: Das Element < ProjectExtensions > tritt mehr als einmal. - - fuzzyMatch="15" wordcount="9" adjWordcount="7.65" curWordcount="7.65" - - - MSB4012: The expression "{0}" cannot be used in this context. Item lists cannot be concatenated with other strings where an item list is expected. Use a semicolon to separate multiple item lists. - MSB4012: Impossible d'utiliser l'expression "{0}" dans ce contexte. Les listes d'éléments ne peuvent pas être concaténées avec d'autres chaînes où une liste d'éléments est attendue. Utilisez des points-virgules pour séparer plusieurs listes d'éléments. - {StrBegin="MSB4012: "}UE: This message is shown when the user does not properly specify an item list when an item list is expected - e.g. "badprefix@(foo)badsuffix" instead of "prefix; @(foo); suffix" - - MSB4012: Der Ausdruck {0} kann in diesem Kontext nicht verwendet werden. Elementlisten können nicht mit anderen Zeichenfolgen verkettet werden, wenn eine Elementliste erwartet wird. Verwenden Sie ein Semikolon, um mehrere Elementlisten voneinander zu trennen. - - fuzzyMatch="101" wordcount="32" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Need to specify the project file name. - Vous devez spécifier le nom du fichier projet. - UE: This message is shown when the user calls into the engine to build a project without specifying a filename. - - Geben Sie den Projektdateinamen an. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - end of input - entrée terminée - This is the name of the "EndOfInput" token. It is displayed in quotes as the - unexpected char or token when the end of a conditional was unexpectedly reached. - - Ende der Eingabe - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - The previous error was converted to a warning because the task was called with ContinueOnError=true. - L'erreur précédente a été convertie en avertissement, car la tâche a été appelée avec ContinueOnError=true. - - - Der vorherige Fehler wurde in eine Warnung umgewandelt, da die Aufgabe mit ContinueOnError=true aufgerufen wurde. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - {0} Error(s) - {0} Erreur(s) - - - {0} Fehler - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4159: Error creating the toolset "{0}". {1} - MSB4159: Erreur lors de la création de l'ensemble d'outils "{0}". {1} - {StrBegin="MSB4159: "} - - MSB4159: Fehler beim Erstellen des Toolsets "{0}". {1} - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4146: Cannot evaluate the property expression "{0}" found at "{1}". {2} - MSB4146: Impossible d'évaluer l'expression de propriété "{0}" trouvée à "{1}". {2} - {StrBegin="MSB4146: "} - - MSB4146: Der bei "{1}" gefundene Eigenschaftsausdruck "{0}" kann nicht ausgewertet werden. {2} - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - The <{0}> tag is no longer supported as a child of the <Project> element. Place this tag within a target, and add the name of the target to the "InitialTargets" attribute of the <Project> element. - La balise <{0}> n'est plus prise en charge comme enfant de l'élément <Project>. Placez cette balise dans une cible et ajoutez le nom de la cible à l'attribut "InitialTargets" de l'élément <Project>. - - - Das <{0}>-Tag nicht als untergeordnetes Element des < Project >-Elements unterstützt. Platzieren Sie dieses Tag in einem Ziel und fügen Sie den Namen des Ziels InitialTargets-Attribut des < Project >-Elements hinzu. - - fuzzyMatch="15" wordcount="38" adjWordcount="32.3" curWordcount="32.3" - - - MSB4100: Expected "{0}" to evaluate to a boolean instead of "{1}", in condition "{2}". - MSB4100: "{0}" devrait donner une valeur booléenne au lieu de "{1}", dans la condition "{2}". - {StrBegin="MSB4100: "} - - MSB4100: Das Ergebnis der Auswertung von {0} war {1}, es wurde jedoch ein boolescher Wert in der {2}-Bedingung erwartet. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4028: The "{0}" task's outputs could not be retrieved from the "{1}" parameter. {2} - MSB4028: Impossible de récupérer les sorties de la tâche "{0}" à partir du paramètre "{1}". {2} - {StrBegin="MSB4028: "} - - MSB4028: Die Ausgaben der {0}-Aufgabe konnten nicht aus dem {1}-Parameter abgerufen werden. {2} - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4014: The build was aborted because of an internal failure. - MSB4014: La génération a été abandonnée suite à une erreur interne. - {StrBegin="MSB4014: "}UE: This message is shown when an unhandled exception terminates the build. The cause is most likely a programming - error in the build engine. - - MSB4014: Das Erstellen wurde aufgrund eines internen Fehlers abgebrochen. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4015: The build was aborted because the "{0}" logger failed unexpectedly during shutdown. - MSB4015: La génération a été abandonnée car le journal "{0}" a échoué de manière inattendue lors de l'arrêt. - {StrBegin="MSB4015: "}UE: This message is used for a special exception that is thrown when a logger fails while shutting down (most likely - because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a special - exception to abort the build. - - MSB4015: Das Erstellen wurde abgebrochen, da für die {0}-Protokollierung beim Herunterfahren ein unerwarteter Fehler aufgetreten ist. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4016: The build was aborted because the "{0}" logger failed unexpectedly during initialization. - MSB4016: La génération a été abandonnée car le journal "{0}" a échoué de manière inattendue lors de l'initialisation. - {StrBegin="MSB4016: "}UE: This message is used for a special exception that is thrown when a logger fails while initializing itself (most - likely because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a - special exception to abort the build. - - MSB4016: Das Erstellen wurde abgebrochen, da für die {0}-Protokollierung bei der Initialisierung ein unerwarteter Fehler aufgetreten ist. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4017: The build was aborted because of an unexpected logger failure. - MSB4017: La génération a été abandonnée suite à une erreur inattendue du journal. - {StrBegin="MSB4017: "}UE: This message is used for a special exception that is thrown when a logger fails while logging an event (most - likely because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a - special exception to abort the build. - - MSB4017: Das Erstellen wurde wegen eines unerwarteten Protokollierungsfehlers abgebrochen. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4018: The "{0}" task failed unexpectedly. - MSB4018: Échec inattendu de la tâche "{0}". - {StrBegin="MSB4018: "}UE: This message is shown when a task terminates because of an unhandled exception. The cause is most likely a - programming error in the task; however, it is also possible that the unhandled exception originated in the engine, and was - surfaced through the task when the task called into the engine. - - MSB4018: Unerwarteter Fehler bei der {0}-Aufgabe. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4165: Failed to receive a response from the child node "{0}" in the timeout period "{1}" ms. Shutting down. - MSB4165: Échec de réception d'une réponse du nœud enfant "{0}" dans le délai de "{1}" ms. Arrêt. - {StrBegin="MSB4165: "} - - MSB4165: Vom untergeordneten Knoten "{0}" wurde innerhalb des Zeitlimits von "{1}" ms keine Antwort empfangen. Herunterfahren. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4088: Condition "{0}" is improperly constructed. - MSB4088: La condition "{0}" n'est pas formulée correctement. - {StrBegin="MSB4088: "} - - MSB4088: Die {0}-Bedingung ist falsch konstruiert. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4105: Found an unexpected character '{2}' at position {1} in condition "{0}". Did you intend to use "=="? - MSB4105: Un caractère inattendu '{2}' a été trouvé à la position {1} dans la condition "{0}". Vouliez-vous utiliser "==" ? - {StrBegin="MSB4105: "} - - MSB4105: Ein unerwartetes Zeichen {2} wurde an Position {1} in der {0}-Bedingung gefunden. Wollten Sie "==" verwenden? - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - MSB4106: Expected an item list at position {1} in condition "{0}". Did you forget the closing parenthesis? - MSB4106: Liste d'éléments attendue à la position {1} dans la condition "{0}". Avez-vous oublié la parenthèse fermante ? - {StrBegin="MSB4106: "} - - MSB4106: Eine Elementliste wurde an Position {1} in Bedingung {0} erwartet. Haben Sie die schließende Klammer vergessen? - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - MSB4107: Expected an item list at position {1} in condition "{0}". Did you forget the opening parenthesis after the '@'? To use a literal '@', use '%40' instead. - MSB4107: Liste d'éléments attendue à la position {1} dans la condition "{0}". Avez-vous oublié la parenthèse ouvrante après '@' ? Pour utiliser un '@' littéral, utilisez plutôt '%40'. - {StrBegin="MSB4107: "} - - MSB4107: Eine Elementliste wurde an Position {1} in Bedingung {0} erwartet. Haben Sie die öffnende Klammer hinter dem Zeichen "@" vergessen? Wenn Sie ein literales "@" verwenden möchten, geben Sie "%40" ein. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4108: Expected an item list at position {1} in condition "{0}". Did you forget to close a quote inside the item list expression? - MSB4108: Liste d'éléments attendue à la position {1} dans la condition "{0}". Avez-vous oublié un guillemet fermant à l'intérieur de l'expression de liste d'éléments ? - {StrBegin="MSB4108: "} - - MSB4108: Eine Elementliste wurde an Position {1} in Bedingung {0} erwartet. Haben Sie das schließende Anführungszeichen innerhalb des Elementlistenausdrucks vergessen? - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - MSB4109: Expected a property at position {1} in condition "{0}". Did you forget the closing parenthesis? - MSB4109: Propriété attendue à la position {1} dans la condition "{0}". Avez-vous oublié la parenthèse fermante ? - {StrBegin="MSB4109: "} - - MSB4109: Eine Eigenschaft wurde an Position {1} in Bedingung {0} erwartet. Haben Sie die schließende Klammer vergessen? - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB4110: Expected a property at position {1} in condition "{0}". Did you forget the opening parenthesis after the '$'? To use a literal '$', use '%24' instead. - MSB4110: Propriété attendue à la position {1} dans la condition "{0}". Avez-vous oublié la parenthèse ouvrante après '$' ? Pour utiliser un '$' littéral, utilisez plutôt '%24'. - {StrBegin="MSB4110: "} - - MSB4110: Eine Eigenschaft wurde an Position {1} in Bedingung {0} erwartet. Haben Sie die öffnende Klammer hinter dem Zeichen "$" vergessen? Wenn Sie eine literales "$" verwenden möchten, geben Sie "%24" ein. - - fuzzyMatch="101" wordcount="27" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4101: Expected a closing quote after position {1} in condition "{0}". - MSB4101: Guillemet fermant attendu après la position {1} dans la condition "{0}". - {StrBegin="MSB4101: "} - - MSB4101: Es wurde ein schließendes Anführungszeichen hinter Position {1} in Bedingung {0} erwartet. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4019: The imported project "{0}" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. - MSB4019: Le projet importé "{0}" est introuvable. Vérifiez que le chemin d'accès dans la déclaration <Import> est correct et que le fichier existe sur le disque. - {StrBegin="MSB4019: "}LOCALIZATION: <Import> should not be localized. - - MSB4019: Das importierte Projekt "{0}" wurde nicht gefunden. Bestätigen Sie den Pfad in der Deklaration < Import > und die Datei auf dem Datenträger vorhanden ist. - - fuzzyMatch="15" wordcount="26" adjWordcount="22.1" curWordcount="22.1" - - - MSB4089: Incorrect number of arguments to function in condition "{0}". Found {1} argument(s) when expecting {2}. - MSB4089: Nombre d'arguments incorrects dans la condition "{0}". {1} arguments trouvé(s) au lieu de {2} attendu(s). - {StrBegin="MSB4089: "} - - MSB4089: Falsche Anzahl von Argumenten für eine Funktion in der Bedingung "{0}". {1} Argument(e) gefunden, obwohl {2} erwartet wurde(n). - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - The "{0}" object specified does not belong to the correct "{1}" object. - L'objet "{0}" spécifié n'appartient pas à l'objet "{1}" correct. - - - Das angegebene {0}-Objekt gehört nicht zum korrekten {1}-Objekt. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4020: The value "{0}" of the "{1}" attribute in element <{2}> is invalid. - MSB4020: La valeur "{0}" de l'attribut "{1}" dans l'élément <{2}> n'est pas valide. - {StrBegin="MSB4020: "}UE: This is a generic message that is displayed when we find a project element with an incorrect value for one of its - attributes e.g. <Import Project=""> -- the value of Project should not be an empty string. - - MSB4020: Der Wert "{0}" von der "{1}" Attribut im Element <{2}> ist ungültig. - - fuzzyMatch="15" wordcount="14" adjWordcount="11.9" curWordcount="11.9" - - - MSB4102: The value "{0}" of the "{1}" attribute in element <{2}> is invalid. {3} - MSB4102: La valeur "{0}" de l'attribut "{1}" dans l'élément <{2}> n'est pas valide. {3} - {StrBegin="MSB4102: "}UE: This is a generic message that is displayed when we find a project element with an incorrect value for one of its - attributes. At the end of the message we show the exception text we got trying to use the value. - - MSB4102: Der Wert "{0}" von der "{1}" Attribut im Element <{2}> ist ungültig. {3} - - fuzzyMatch="15" wordcount="15" adjWordcount="12.75" curWordcount="12.75" - - - MSB4021: The "ContinueOnError" attribute of the "{0}" task is not valid. {1} - MSB4021: L'attribut "ContinueOnError" de la tâche "{0}" n'est pas valide. {1} - {StrBegin="MSB4021: "}LOCALIZATION: "ContinueOnError" should not be localized. "{1}" is a message from another exception explaining the problem. - - MSB4021: Das ContinueOnError-Attribut für die {0}-Aufgabe ist ungültig. {1} - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4139: Invalid value for default ToolsVersion is specified in registry key "{0}". - MSB4139: Une valeur non valide pour le ToolsVersion par défaut est spécifiée dans la clé de Registre "{0}". - {StrBegin="MSB4139: "} - - MSB4139: Im Registrierungsschlüssel "{0}" ist ein ungültiger Wert für die Standard-ToolsVersion angegeben. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4022: The result "{0}" of evaluating the value "{1}" of the "{2}" attribute in element <{3}> is not valid. - MSB4022: Le résultat "{0}" après évaluation de la valeur "{1}" de l'attribut "{2}" dans l'élément <{3}> n'est pas valide. - {StrBegin="MSB4022: "}UE: This message is shown when the engine is checking the correctness of the value (after evaluating embedded - properties/items) assigned to an XML attribute of an XML element in the project file. - - MSB4022: Das Ergebnis "{0}"der Auswertung des Werts"{1}" von der "{2}" Attribut im Element <{3}> ist ungültig. - - fuzzyMatch="15" wordcount="20" adjWordcount="17" curWordcount="17" - - - "{0}" is not a valid event category. To raise a custom event, use the "{1}" category. - "{0}" n'est pas une catégorie d'événements valide. Pour déclencher un événement personnalisé, utilisez la catégorie "{1}". - - - {0} ist keine gültige Ereigniskategorie. Verwenden Sie die {1}-Kategorie, um ein benutzerdefiniertes Ereignis auszulösen. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - "{0}" is not a valid importance level for events. - "{0}" n'est pas un niveau d'importance valide pour les événements. - - - {0} ist kein gültiger Wert für die Bedeutung eines Ereignisses. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4104: Failed to write to log file "{0}". {1} - MSB4104: Impossible d'écrire dans le fichier journal "{0}". {1} - {StrBegin="MSB4104: "}UE: This is shown when the File Logger can't create or write to the file it was instructed to log to. - - MSB4104: Fehler beim Schreiben in die Protokollierungsdatei "{0}". {1} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4024: The imported project file could not be loaded. {0} - MSB4024: Impossible de charger le fichier projet importé. {0} - {StrBegin="MSB4024: "}UE: This message is shown when an imported project file cannot be loaded because of incorrect XML. The project - filename is not part of the message because it is provided separately to loggers. - LOCALIZATION: {0} is a localized message from the CLR/FX explaining why the project is invalid. - - MSB4024: Die importierte Projektdatei konnte nicht geladen werden. {0} - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - Operation invalid for a persisted item group. - Opération non valide pour un groupe d'éléments persistants. - - - Ungültiger Vorgang für eine persistente Elementgruppe. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Operation invalid for a virtual item group. - Opération non valide pour un groupe d'éléments virtuels. - - - Ungültiger Vorgang für eine virtuelle Elementgruppe. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4071: The value Importance="{0}" in the <Message> element is invalid. Valid values are: High, Normal and Low. - MSB4071: La valeur Importance="{0}" de l'élément <Message> n'est pas valide. Les valeurs valides sont : High, Normal et Low. - {StrBegin="MSB4071: "}UE: This message is shown when a user specifies a value for the importance attribute of Message which is not valid. - The importance enumeration is: High, Normal and Low. Specifying any other importance will result in this message being shown - LOCALIZATION: "Importance" should not be localized. - "Message" should not be localized. - High should not be localized. - Normal should not be localized. - Low should not be localized. - - MSB4071: Der Wert Importance = "{0}" in < Nachricht > Element ist ungültig. Gültige Werte sind: hoch, Normal und niedrig. - - fuzzyMatch="15" wordcount="18" adjWordcount="15.3" curWordcount="15.3" - - - MSB4025: The project file could not be loaded. {0} - MSB4025: Impossible de charger le fichier projet. {0} - {StrBegin="MSB4025: "}UE: This message is shown when the project file given to the engine cannot be loaded because the filename/path is - invalid, or due to lack of permissions, or incorrect XML. The project filename is not part of the message because it is - provided separately to loggers. - LOCALIZATION: {0} is a localized message from the CLR/FX explaining why the project is invalid. - - MSB4025: Die Projektdatei konnte nicht geladen werden. {0} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4147: The property "{0}" at "{1}" is invalid. {2} - MSB4147: La propriété "{0}" à "{1}" n'est pas valide. {2} - {StrBegin="MSB4147: "} - - MSB4147: Die {0}-Eigenschaft bei "{1}" ist ungültig. {2} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - "{0}" is an invalid "ProjectFileEncoding" value. - "{0}" n'est pas une valeur "ProjectFileEncoding" valide. - LOCALIZATION: "ProjectFileEncoding" should not be localized. - - {0} ist ein ungültiger ProjectFileEncoding-Wert. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4143: The expression "{0}" cannot be evaluated. {1} - MSB4143: Impossible d'évaluer l'expression "{0}". {1} - {StrBegin="MSB4143: "} - UE: This message is shown when the user attempts to provide an expression like "$(Registry:HKEY_LOCAL_MACHINE\Software\Vendor\Tools@TaskLocation)" - LOCALIZATION: "{0}" is the expression that was bad. "{1}" is a message from an FX exception that describes why the expression is bad. - - - MSB4143: Der Ausdruck "{0}" kann nicht ausgewertet werden. {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4184: The expression "{0}" cannot be evaluated. {1} - MSB4184: impossible d'évaluer l'expression "{0}". {1} - {StrBegin="MSB4184: "} - Single quotes as the expression will typically have double quotes in it. - UE: This message is shown when the user attempts to provide an expression like "$(SomeProperty.ToLower())" - LOCALIZATION: "{0}" is the expression that was bad. "{1}" is a message from an FX exception that describes why the expression is bad. - - - MSB4184: Der Ausdruck "{0}" kann nicht ausgewertet werden. {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4185: The function "{0}" on type "{1}" has not been enabled for execution. - MSB4185: La fonction "{0}" sur le type "{1}" n'a pas été activée pour l'exécution. - {StrBegin="MSB4185: "} - UE: This message is shown when the user attempts to provide an expression like "$([System.DateTime]::Now)", but the expression has not been enabled - LOCALIZATION: "{0}" is the static function name, "{1}" is the .NET Framework type name - - - MSB4185: Die {0}-Funktion für den {1}-Typ wurde nicht für die Ausführung aktiviert. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4186: Invalid static method invocation syntax: "{0}". Static method invocation should be of the form: $([FullTypeName]::Method()), e.g. $([System.IO.Path]::Combine(`a`, `b`)) - MSB4186: syntaxe d'appel de méthode statique non valide : "{0}". L'appel de méthode statique doit avoir le format : $([FullTypeName]::Method()), par exemple $([System.IO.Path]::Combine(`a`, `b`)) - {StrBegin="MSB4186: "} - UE: This message is shown when the user attempts to call a static method on a type, but has used the incorrect syntax - LOCALIZATION: "{0}" is the function expression which is in error - - - MSB4186: Ungültige Aufrufsyntax für statische Methode: "{0}". Für den Aufruf statischer Methoden muss folgendes Format verwendet werden: $([vollständiger Typname]::Methode()), z. B. $([System.IO.Path]::Combine(`a`, `b`)) - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4070: The schema "{0}" is not valid. {1} - MSB4070: Le schéma "{0}" n'est pas valide. {1} - {StrBegin="MSB4070: "}UE: This message is shown when the schema file provided for the validation of a project is itself not valid. - LOCALIZATION: "{0}" is the schema file path. "{1}" is a message from an FX exception that describes why the schema file is bad. - - MSB4070: Das Schema "{0}" ist nicht gültig. {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4026: The "{0}={1}" parameter for the "{2}" task is invalid. - MSB4026: Le paramètre "{0}={1}" pour la tâche "{2}" n'est pas valide. - {StrBegin="MSB4026: "}UE: This message is displayed when a task has an invalid parameter that cannot be initialized. - - MSB4026: Der {0}={1}-Parameter für die {2}-Aufgabe ist ungültig. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4027: The "{0}" task generated invalid items from the "{1}" output parameter. {2} - MSB4027: La tâche "{0}" a généré des éléments non valides à partir du paramètre de sortie "{1}". {2} - {StrBegin="MSB4027: "} - - MSB4027: Die {0}-Aufgabe generierte ungültige Elemente aus dem {1}-Ausgabeparameter. {2} - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4029: The "{0}" task has an invalid output specification. The "TaskParameter" attribute is required, and either the "ItemName" or "PropertyName" attribute must be specified (but not both). - MSB4029: La sortie spécifiée de la tâche "{0}" n'est pas valide. L'attribut "TaskParameter" est obligatoire et l'attribut "ItemName" ou "PropertyName" doit être spécifié (mais pas les deux). - {StrBegin="MSB4029: "}LOCALIZATION: "TaskParameter", "ItemName" and "PropertyName" should not be localized. - - MSB4029: Die {0}-Aufgabe enthält eine ungültige Ausgabespezifikation. Das TaskParameter-Attribut ist erforderlich, und es muss entweder das ItemName- oder PropertyName-Attribut angegeben werden (jedoch nicht beide). - - fuzzyMatch="101" wordcount="27" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4030: "{0}" is an invalid value for the "{1}" parameter of the "{3}" task. The "{1}" parameter is of type "{2}". - MSB4030: "{0}" n'est pas une valeur valide pour le paramètre "{1}" de la tâche "{3}". Le paramètre "{1}" est de type "{2}". - {StrBegin="MSB4030: "}UE: This error is shown when a type mis-match occurs between the value assigned to task parameter in the project file - and the type of the .NET property that corresponds to the task parameter. For example, if an int task parameter called "Count" - is assigned the value "x", this error would be displayed: <MyTask Count="x" /> - - MSB4030: "{0}" ist ein ungültiger Wert für den {1}-Parameter der {3}-Aufgabe. Der {1}-Parameter ist vom Typ "{2}". - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - MSB4137: Invalid value specified in the configuration file at "{0}". Property name or tools version name is an empty string. - MSB4137: Valeur non valide spécifiée dans le fichier de configuration à "{0}". Le nom de la propriété ou le nom de la version des outils est une chaîne vide. - {StrBegin="MSB4137: "} - - MSB4137: In der Konfigurationsdatei ist bei "{0}" ein ungültiger Wert angegeben. Der Eigenschaftenname oder der Toolsversionname ist eine leere Zeichenfolge. - - fuzzyMatch="100" wordcount="20" adjWordcount="5" curWordcount="5" tmLabel="N''" - - - MSB4103: "{0}" is not a valid logger verbosity level. - MSB4103: "{0}" n'est pas un niveau de verbosité de journaliseur valide. - {StrBegin="MSB4103: "} - - MSB4103: "{0}" ist kein gültiger Ausführlichkeitsgrad für die Protokollierung. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4163: <ItemDefinitionGroup> is not allowed inside a target. - MSB4163: <ItemDefinitionGroup> n'est pas autorisé dans une cible. - {StrBegin="MSB4163: "} - - MSB4163: < ItemDefinitionGroup > ist in einem Ziel nicht zulässig. - - fuzzyMatch="15" wordcount="9" adjWordcount="7.65" curWordcount="7.65" - - - The specified item does not belong to the current item group. - L'élément spécifié n'appartient pas au groupe d'éléments actuels. - - - Das angegebene Element gehört nicht zu der aktuellen Elementgruppe. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4096: The item "{0}" in item list "{1}" does not define a value for metadata "{2}". In order to use this metadata, either qualify it by specifying %({1}.{2}), or ensure that all items in this list define a value for this metadata. - MSB4096: L'élément "{0}" de la liste d'éléments "{1}" ne définit aucune valeur pour les métadonnées "{2}". Pour utiliser ces métadonnées, qualifiez-les en spécifiant %({1}.{2}) ou assurez-vous que tous les éléments de cette liste définissent une valeur pour ces métadonnées. - {StrBegin="MSB4096: "} - - MSB4096: Das Element "{0}" in der Elementliste "{1}" definiert keinen Wert für die {2}-Metadaten. Wenn Sie diese Metadaten verwenden möchten, qualifizieren Sie sie, indem Sie %({1}.{2}) angeben, oder vergewissern Sie sich, dass alle Elemente in der Liste einen Wert für diese Metadaten definieren. - - fuzzyMatch="101" wordcount="42" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4099: A reference to an item list at position {1} is not allowed in this condition "{0}". - MSB4099: Une référence à une liste d'éléments à la position {1} n'est pas autorisée dans cette condition "{0}". - {StrBegin="MSB4099: "} - - MSB4099: Ein Verweis auf eine Elementliste an Position {1} ist in dieser {0}-Bedingung nicht zulässig. - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - MSB4033: "{0}" is a reserved item metadata, and cannot be redefined as a custom metadata on the item. - MSB4033: "{0}" est une métadonnée d'élément réservée qui ne peut pas être redéfinie en tant que métadonnée personnalisée pour l'élément. - {StrBegin="MSB4033: "} - - MSB4033: "{0}" sind reservierte Elementmetadaten und können nicht als benutzerdefinierte Metadaten für das Element neu definiert werden. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - An InternalLoggerException can only be thrown by the MSBuild engine. The public constructors of this class cannot be used to create an instance of the exception. - Une exception InternalLoggerException peut être levée uniquement par le moteur MSBuild. Impossible d'utiliser les constructeurs publics de cette classe pour créer une instance de l'exception. - UE: This message is shown when a user tries to instantiate a special exception called InternalLoggerException through the OM -- - only the engine is allowed to create and throw this exception. - LOCALIZATION: "InternalLoggerException" and "MSBuild" should not be localized. - - Eine InternalLoggerException kann nur durch das MSBuild-Modul ausgelöst werden. Die öffentlichen Konstruktoren dieser Klasse können nicht verwendet werden, um eine Instanz der Ausnahme zu erstellen. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Initial Items: - Éléments initiaux : - - - Ursprüngliche Elemente: - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4083: Expected a Condition attribute on element "{0}". - MSB4083: Attribut Condition attendu sur l'élément "{0}". - {StrBegin="MSB4083: "} - - MSB4083: Es wurde ein Bedingungsattribut für das {0}-Element erwartet. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4164: The value "{0}" of metadata "{1}" contains an item list expression. Item list expressions are not allowed on default metadata values. - MSB4164: La valeur "{0}" de la métadonnée "{1}" contient une expression de liste d'éléments. Les expressions de listes d'éléments ne sont pas autorisées pour les valeurs de métadonnées par défaut. - {StrBegin="MSB4164: "} - - MSB4164: Der Wert "{0}" der {1}-Metadaten enthält einen Elementlistenausdruck. Elementlistenausdrücke sind nicht als Standardwerte für Metadaten zulässig. - - fuzzyMatch="100" wordcount="22" adjWordcount="5.5" curWordcount="5.5" tmLabel="N''" - - - MSBuild is expecting a valid "{0}" object. - MSBuild attend un objet "{0}" valide. - - - MSBuild erwartet ein gültiges {0}-Objekt. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4035: The required attribute "{0}" is missing from element <{1}>. - MSB4035: L'attribut requis "{0}" est absent de l'élément <{1}>. - {StrBegin="MSB4035: "}UE: This message is shown when a user leaves off a required attribute from a project element - e.g. <UsingTask AssemblyName="foo"> -- this is missing the "TaskName" attribute. - - MSB4035: Das erforderliche Attribut "{0}"-Element fehlt <{1}>. - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB4036: The "{0}" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "{1}" directory. - MSB4036: Tâche "{0}" introuvable. Vérifiez les points suivants : 1.) Le nom de la tâche dans le fichier projet est identique au nom de la classe de tâche. 2.) La classe de tâche est "public" et implémente l'interface Microsoft.Build.Framework.ITask. 3.) La tâche est correctement déclarée avec <UsingTask> dans le fichier projet ou dans les fichiers *.tasks stockés dans le répertoire "{1}". - {StrBegin="MSB4036: "}LOCALIZATION: <UsingTask> and "*.tasks" should not be localized. - - MSB4036: Die "{0}" Task wurde nicht gefunden. Überprüfen Sie Folgendes: 1.) der Name der Aufgabe in der Projektdatei entspricht dem Namen der Aufgabenklasse. 2) die Aufgabenklasse ist "public" und implementiert die Microsoft.Build.Framework.ITask-Schnittstelle. 3) die Aufgabe korrekt mit < UsingTask > deklariert, in der Projektdatei oder in den Tasks-Dateien der "{1}" Verzeichnis. - - fuzzyMatch="15" wordcount="64" adjWordcount="54.4" curWordcount="54.4" - - - MSB4141: MSBuildToolsPath is not specified for the ToolsVersion "{0}" defined at "{1}", or the value specified evaluates to the empty string. - MSB4141: MSBuildToolsPath n'est pas spécifié pour le ToolsVersion "{0}" défini à "{1}", ou la valeur spécifiée est une chaîne vide. - {StrBegin="MSB4141: "} - - MSB4141: MSBuildToolsPath ist für die bei "{1}" definierte ToolsVersion {0} nicht angegeben, oder der angegebene Wert wird zu einer leeren Zeichenfolge ausgewertet. - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - MSB4031: The "MSBuildVersion" attribute is deprecated. If the project is authored in the MSBuild 2003 format, please remove the attribute from the <Project> tag. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format. - MSB4031: L'attribut "MSBuildVersion" est déconseillé. Si le projet a été créé au format MSBuild 2003, supprimez l'attribut dans la balise <Project>. S'il a été créé dans des formats anciens comme 1.0 ou 1.2, convertissez-le au format MSBuild 2003. - {StrBegin="MSB4031: "}UE: This message is shown for projects that still contain the "MSBuildVersion" attribute in their <Project> - tag. We no longer need this attribute because the project's XML namespace (i.e. the "xmlns" attribute) gives us all the - version information we need. - LOCALIZATION: "MSBuild", "MSBuildVersion" and <Project> should not be localized. - - MSB4031: Das Attribut "MSBuildVersion" ist veraltet. Wenn das Projekt im Format MSBuild 2003 erstellt wurde, entfernen Sie das Attribut aus dem Tag < Project >. Wenn das Projekt im alten Format 1.0 oder 1.2 erstellt wurde, konvertieren Sie es in das MSBuild 2003-Format. - - fuzzyMatch="15" wordcount="45" adjWordcount="38.25" curWordcount="38.25" - - - MSB4144: Multiple definitions were found for the toolset "{0}". - MSB4144: Plusieurs définitions ont été trouvées pour l'ensemble d'outils "{0}". - {StrBegin="MSB4144: "} - - MSB4144: Für das Toolset wurden mehrere Definitionen gefunden "{0}". - - fuzzyMatch="15" wordcount="9" adjWordcount="7.65" curWordcount="7.65" - - - MSB4145: Multiple definitions were found for the property "{0}". - MSB4145: Plusieurs définitions ont été trouvées pour la propriété "{0}". - {StrBegin="MSB4145: "} - - MSB4145: Für die {0}-Eigenschaft wurden mehrere Definitionen gefunden. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4082: Choose has more than one <Otherwise> element. - MSB4082: L'élément Choose a plusieurs éléments <Otherwise>. - {StrBegin="MSB4082: "} - - MSB4082: Wählen Sie mehrere < Otherwise >-Element enthält. - - fuzzyMatch="15" wordcount="9" adjWordcount="7.65" curWordcount="7.65" - - - This method is only valid for persisted <{0}> elements. - Cette méthode n'est valide que pour les éléments <{0}> persistants. - - - Diese Methode ist nur gültig für beibehalten <{0}> Elemente. - - fuzzyMatch="15" wordcount="10" adjWordcount="8.5" curWordcount="8.5" - - - This method is only valid for virtual property groups, not <{0}> elements. - Cette méthode n'est valide que pour les groupes de propriétés virtuelles, pas pour les éléments <{0}>. - - - Diese Methode gilt nur für virtuelle Eigenschaftengruppen nicht <{0}> Elemente. - - fuzzyMatch="15" wordcount="13" adjWordcount="11.05" curWordcount="11.05" - - - MSB4038: The element <{0}> must be last under element <{1}>. Found element <{2}> instead. - MSB4038: L'élément <{0}> doit être le dernier sous l'élément <{1}>. Élément <{2}> trouvé à la place. - {StrBegin="MSB4038: "} - - MSB4038: Das Element <{0}> muss unter Element <{1}>. Element wurde gefunden <{2}> statt. - - fuzzyMatch="15" wordcount="17" adjWordcount="14.45" curWordcount="14.45" - - - MSB4138: Non-string data was specified at the registry location "{0}". - MSB4138: Des données qui ne sont pas des chaînes ont été spécifiées à l'emplacement de Registre "{0}". - {StrBegin="MSB4138: "} - - MSB4138: Am Registrierungsspeicherort "{0}" wurden Daten angegeben, die keine Zeichenfolge sind. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4039: No "{0}" element was found in the project file. - MSB4039: Aucun élément "{0}" n'a été trouvé dans le fichier projet. - {StrBegin="MSB4039: "} - - MSB4039: Das {0}-Element wurde in der Projektdatei nicht gefunden. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4040: There is no target in the project. - MSB4040: Il n'y a pas de cible dans le projet. - {StrBegin="MSB4040: "} - - MSB4040: Das Projekt enthält kein Ziel. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Removing the "{0}" attribute of an item is not allowed. - La suppression de l'attribut "{0}" d'un élément n'est pas autorisée. - - - Das Löschen des {0}-Attributs eines Elements ist nicht zulässig. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - The object passed in is not part of the project. - L'objet passé ne fait pas partie du projet. - - - Das übergebene Objekt ist nicht Teil des Projekts. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - Overriding target "{0}" in project "{1}" with target "{2}" from project "{3}". - Remplacement de la cible "{0}" du projet "{1}" par la cible "{2}" du projet "{3}". - - - Das Ziel "{0}" im Projekt "{1}" wird durch das Ziel "{2}" aus dem Projekt "{3}" außer Kraft gesetzt. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4167: The parent process unexpectedly exited. Shutting down child node "{0}". - MSB4167: Fin prématurée du processus parent. Arrêt du nœud enfant "{0}". - {StrBegin="MSB4167: "} - - MSB4167: Der übergeordnete Prozess wurde unerwartet beendet. Der untergeordnete Knoten "{0}" wird heruntergefahren. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - {0} ms {1} {2} calls - {0} ms {1} {2} appels - - - {0} ms {1} {2} Aufrufe - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - (* = timing was not recorded because of reentrancy) - (* = le minutage n'a pas été enregistré à cause de la réentrance) - - - (* = Zeit wurde aufgrund des erneuten Eintretens nicht aufgezeichnet) - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - This project object has been unloaded from the MSBuild engine and is no longer valid. - Cet objet de projet a été déchargé du moteur MSBuild et n'est plus valide. - - - Dieses Projektobjekt wurde aus dem MSBuild-Modul entladen und ist nicht mehr gültig. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - The project file "{0}" was not found. - Le fichier projet "{0}"est introuvable. - UE: This message is shown when the user calls into the OM to build a project that doesn't exist on disk. - - Die Projektdatei "{0}" wurde nicht gefunden. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Done building project "{0}" -- FAILED. - Génération du projet "{0}" terminée -- ÉCHEC. - - - Die Erstellung des Projekts "{0}" ist abgeschlossen – FEHLER. - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Done building project "{0}". - Génération du projet "{0}" terminée. - - - Die Erstellung des Projekts "{0}" ist abgeschlossen. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - MSB4041: The default XML namespace of the project must be the MSBuild XML namespace. If the project is authored in the MSBuild 2003 format, please add xmlns="{0}" to the <Project> element. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format. - MSB4041: L'espace de noms XML par défaut du projet doit être l'espace de noms XML MSBuild. Si le projet a été créé au format MSBuild 2003, ajoutez xmlns="{0}" à l'élément <Project>. S'il a été créé dans des formats anciens comme 1.0 ou 1.2, convertissez-le au format MSBuild 2003. - {StrBegin="MSB4041: "}UE: This is a Beta 1 message only. - LOCALIZATION: <Project>, "MSBuild" and "xmlns" should not be localized. - - MSB4041: Der XML-Standardnamespace des Projekts muss MSBuild XML-Namespace. Wenn das Projekt im Format MSBuild 2003 erstellt wurde, fügen Sie Xmlns = "{0}" < Project >-Element. Wenn das Projekt im alten Format 1.0 oder 1.2 erstellt wurde, konvertieren Sie es in das MSBuild 2003-Format. - - fuzzyMatch="15" wordcount="52" adjWordcount="44.2" curWordcount="44.2" - - - Project Performance Summary: - Résumé de performance des projets : - - - Leistungszusammenfassung für das Projekt: - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - MSB4042: Stopping because of syntax errors in project file. - MSB4042: Arrêt en raison d'erreurs de syntaxe dans le fichier projet. - {StrBegin="MSB4042: "} - - MSB4042: Prozess aufgrund von Syntaxfehlern in der Projektdatei angehalten. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - Project "{0}" is building "{1}" ({2} target(s)): - Le projet "{0}" génère "{1}" ({2} cibles) : - - - Das Projekt {0} erstellt {1} ({2} Ziel(e)): - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Project "{0}" is building "{1}" (default targets): - Le projet "{0}" génère "{1}" (cibles par défaut) : - - - Das Projekt "{0}" erstellt "{1}" (Standardziele): - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Project "{0}" ({1} target(s)): - Projet "{0}" ({1} cibles) : - - - Projekt "{0}", {1} Ziel(e): - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - Project "{0}" (default targets): - Projet "{0}" (cibles par défaut) : - - - Projekt "{0}" (Standardziele): - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - Done Building Project "{0}" ({1} target(s)). - Génération du projet "{0}" terminée ({1} cible(s)). - - - Die Erstellung von Projekt "{0}" ist abgeschlossen ({1} Ziel(e)). - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Done Building Project "{0}" (default targets). - Génération du projet "{0}" terminée (cibles par défaut). - - - Die Erstellung von Projekt "{0}" ist abgeschlossen (Standardziele). - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Done Building Project "{0}" ({1} target(s)) -- FAILED. - Génération du projet "{0}" terminée ({1} cible(s)) -- ÉCHEC. - - - Die Erstellung des Projekts "{0}" ist abgeschlossen, {1} Ziel(e) -- FEHLER. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Done Building Project "{0}" (default targets) -- FAILED. - Génération du projet "{0}" terminée (cibles par défaut) -- ÉCHEC. - - - Die Erstellung von Projekt "{0}" ist abgeschlossen (Standardziele) -- FEHLER. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4075: The project file must be opened in the Visual Studio IDE and converted to the latest version before it can be built by MSBuild. - MSB4075: Le fichier projet doit être ouvert dans l'IDE de Visual Studio et converti vers la dernière version avant de pouvoir être généré par MSBuild. - {StrBegin="MSB4075: "} - - MSB4075: Die Projektdatei muss in der Visual Studio IDE geöffnet und in ein aktuelles Versionsformat gebracht werden, bevor sie mit MSBuild erstellt werden kann. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4192: The project file "{0}" is in the ".vcproj" file format, which MSBuild no longer supports. Please convert the project by opening it in the Visual Studio IDE or running the conversion tool, or use MSBuild 3.5 or earlier to build it. - MSB4192: Le fichier projet "{0}" utilise le format de fichier ".vcproj", qui n'est plus pris en charge par MSBuild. Convertissez le projet en l'ouvrant dans Visual Studio IDE ou en exécutant l'outil de conversion, ou générez le projet à l'aide de MSBuild 3.5 ou antérieur. - {StrBegin="MSB4192: "} LOC: ".vcproj" should not be localized - - MSB4192: Die Projektdatei "{0}" ist im VSPROJ-Dateiformat gespeichert, das nicht mehr von MSBuild unterstützt wird. Konvertieren Sie das Projekt, indem Sie es in der Visual Studio IDE öffnen oder das Konvertierungstool ausführen, oder verwenden Sie MSBuild 3.5 oder früher zum Erstellen des Projekts. - - fuzzyMatch="101" wordcount="42" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - The specified property does not belong to the current property group. - La propriété spécifiée n'appartient pas au groupe de propriétés actuelles. - - - Die angegebene Eigenschaft gehört nicht zu der aktuellen Eigenschaftengruppe. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - Initial Properties: - Propriétés initiales : - - - Ursprüngliche Eigenschaften: - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4148: The name of a property stored under the registry key "{0}" has zero length. - MSB4148: La longueur du nom d'une propriété stockée sous la clé de Registre "{0}" est égale à zéro. - {StrBegin="MSB4148: "} - - MSB4148: Der Name einer unter dem Registrierungsschlüssel "{0}" gespeicherten Eigenschaft hat eine Länge von Null. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - The property names in the indexer and the "{0}" object do not match. - Les noms de propriétés dans l'indexeur et l'objet "{0}" ne correspondent pas. - - - Die Eigenschaftennamen im Indexer und das {0}-Objekt stimmen nicht überein. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4043: The item metadata reference "{0}" is invalid because it is qualified with an item name. Item metadata referenced in transforms do not need to be qualified, because the item name is automatically deduced from the items being transformed. Change "{0}" to "%({1})". - MSB4043: La référence aux métadonnées d'élément "{0}" n'est pas valide car elle est qualifiée par un nom d'élément. Les métadonnées d'élément référencées dans les transformations ne nécessitent pas de qualification, car le nom de l'élément est déduit automatiquement des éléments transformés. Remplacez "{0}" par "%({1})". - {StrBegin="MSB4043: "}UE: This message is shown when the user does something like this: @(foo->'%(foo.metadata)'). There is no need to specify - "foo.metadata", because "foo" is automatically deduced. In corollary, "bar.metadata" is not allowed either, where "bar" is a different - item list type. - - MSB4043: Der Elementmetadatenverweis "{0}" ist ungültig, da er mit einem Elementnamen qualifiziert ist. Elementmetadaten, auf die bei Transformationen verwiesen wird, müssen nicht qualifiziert werden, da der Elementname automatisch aus den transformierten Elementen abgeleitet wird. Ändern Sie "{0}" in "%({1})". - - fuzzyMatch="101" wordcount="43" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4135: Error reading the toolset information from the registry location "{0}". {1} - MSB4135: Erreur lors de la lecture des informations relatives à l'ensemble d'outils à partir de l'emplacement de Registre "{0}". {1} - {StrBegin="MSB4135: "} - - MSB4135: Fehler beim Lesen der Toolsetinformationen am Registrierungsspeicherort "{0}". {1} - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4044: The "{0}" task was not given a value for the required parameter "{1}". - MSB4044: La tâche "{0}" ne s'est pas vue assigner de valeur pour le paramètre requis "{1}". - {StrBegin="MSB4044: "}UE: This message is shown when a task parameter designated as "required" is not set in the project file. - - MSB4044: Die {0}-Aufgabe hat keinen Wert für den erforderlichen {1}-Parameter erhalten. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - Validating project using schema file "{0}". - Validation du projet à l'aide du fichier de schéma "{0}". - LOCALIZATION: "{0}" is the location of the schema file. - - Das Projekt wird anhand der Schemadatei "{0}" überprüft. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4045: Project is not valid. {0} - MSB4045: Le projet n'est pas valide. {0} - {StrBegin="MSB4045: "}UE: This error is shown when the user asks his project to be validated against a schema (/val switch for - MSBuild.exe), and the project has errors. "{0}" contains a message explaining the problem. - LOCALIZATION: "{0}" is a message from the System.XML schema validator and is already localized. - - MSB4045: Ungültiges Projekt. {0} - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4112: The targets in this project have been disabled by the host and therefore cannot be built at this time. This may have been done for security reasons. To enable the targets, the host must set Project.BuildEnabled to "true". - MSB4112: Les cibles dans ce projet ont été désactivées par l'hôte et ne peuvent donc pas être générées pour l'instant. Elles ont peut-être été désactivées pour des raisons de sécurité. Pour activer les cibles, l'hôte doit affecter la valeur "true" à Project.BuildEnabled. - {StrBegin="MSB4112: "} - - MSB4112: Die Ziele in diesem Projekt wurden vom Host deaktiviert und können aus diesem Grund derzeit nicht erstellt werden. Die Deaktivierung wurde wahrscheinlich aus Sicherheitsgründen durchgeführt. Wenn Sie die Ziele aktivieren möchten, muss der Host Project.BuildEnabled auf "true" festlegen. - - fuzzyMatch="101" wordcount="39" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4093: The "{0}" parameter of the "{1}" task cannot be written to because it does not have a "set" accessor. - MSB4093: Impossible d'écrire le paramètre "{0}" de la tâche "{1}", car il n'a pas d'accesseur "set". - {StrBegin="MSB4093: "}UE: This error is shown when a project tries to assign a value to a task parameter that does not have a "set" - accessor on the corresponding .NET property on the task class. - - MSB4093: In den {0}-Parameter der {1}-Aufgabe kann nicht geschrieben werden, da er keinen set-Accessor besitzt. - - fuzzyMatch="100" wordcount="20" adjWordcount="5" curWordcount="5" tmLabel="N''" - - - A shallow clone of this object cannot be created. - Impossible de créer un clone superficiel de cet objet. - - - Ein unechter Klon dieses Objekts kann nicht erstellt werden. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - Skipping target "{0}" because it has no inputs. - La cible est ignorée "{0}" car elle ne comporte pas d'entrée. - - - Das {0}-Ziel wird übersprungen, da es keine Eingaben besitzt. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Though the target has declared its inputs, the input specification only references empty properties and/or empty item lists. - Bien que la cible ait déclaré ses entrées, celles spécifiées ne font référence qu'à des propriétés vides et/ou des listes d'éléments vides. - - - Obwohl das Ziel seine Eingaben deklariert hat, verweist die Eingabespezifikation nur auf leere Eigenschaften und/oder leere Elementlisten. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - Skipping target "{0}" because it has no outputs. - La cible est ignorée "{0}" car elle ne comporte pas de sortie. - - - Das Ziel "{0}" wird übersprungen, da es keine Ausgaben enthält. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Though the target has declared its outputs, the output specification only references empty properties and/or empty item lists. - Bien que la cible ait déclaré ses sorties, celles spécifiées ne font référence qu'à des propriétés vides et/ou des listes d'éléments vides. - - - Obwohl das Ziel seine Ausgaben deklariert hat, verweist die Ausgabespezifikation nur auf leere Eigenschaften und/oder leere Elementlisten. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - Skipping target "{0}" because all output files are up-to-date with respect to the input files. - La cible est ignorée "{0}", car tous les fichiers de sortie sont à jour par rapport aux fichiers d'entrée. - - - Das Ziel "{0}" wird übersprungen, da alle Ausgabedateien hinsichtlich der Eingabedateien aktuell sind. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - Input files: {0} - Fichiers d'entrée : {0} - {0} is a semicolon-separated list of filenames. - - Eingabedateien: {0} - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Output files: {0} - Fichiers de sortie : {0} - {0} is a semicolon-separated list of filenames. - - Ausgabedateien: {0} - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Building solution configuration "{0}". - Génération de la configuration de solution "{0}". - UE: This is not an error, so doesn't need an error code. - - Die Projektmappenkonfiguration "{0}" wird erstellt. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - Using solution cache file "{0}" for configuration "{1}" and tools version "{2}". - Utilisation du fichier solution cache "{0}" pour la configuration "{1}" et les outils version "{2}". - UE: This is not an error, so doesn't need an error code. - - Die Projektmappen-Cachedatei "{0}" wird für die Konfiguration "{1}" und die Toolsversion "{2}" verwendet. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Failed to read solution cache file "{0}". {1} Using solution file directly. - Impossible de lire le fichier cache solution "{0}". {1} Utilisation du fichier solution directement. - UE: This is not a true error, so doesn't need an error code. - - Fehler beim Lesen der Projektmappen-Cachedatei "{0}". {1} Projektmappendatei wird direkt verwendet. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Failed to write solution cache file "{0}". {1} - Impossible d'écrire dans le fichier cache solution "{0}". {1} - UE: This is not a true error, so doesn't need an error code. - - Fehler beim Schreiben der Projektmappen-Cachedatei "{0}". {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Solution cache file was created for a "{0}" value of "{1}" but the current value is "{2}". Refreshing cache file. - Le fichier solution cache a été créé pour "{0}" avec la valeur "{1}" mais la valeur actuelle est "{2}". Actualisation du fichier cache. - UE: This is not an error, so doesn't need an error code. - - Die Projektmappen-Cachedatei wurde für den {0}-Wert "{1}" erstellt, aber der aktuelle Wert ist "{2}". Cachedatei wird aktualisiert. - - fuzzyMatch="100" wordcount="20" adjWordcount="5" curWordcount="5" tmLabel="N''" - - - Solution cache file has an internal version number "{0}" but the current value is "{1}". Refreshing cache file. - Le fichier cache de la solution a un numéro de version interne "{0}" mais la valeur actuelle est "{1}". Actualisation du fichier cache. - UE: This is not an error, so doesn't need an error code. - - Die Projektmappen-Cachedatei hat die interne Versionsnummer "{0}", der aktuelle Wert ist aber "{1}". Cachedatei wird aktualisiert. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - Solution cache file is out of date. Refreshing cache file. {0} - Le fichier solution cache est obsolète. Actualisation du fichier cache. {0} - UE: This is not an error, so doesn't need an error code. - - Die Projektmappen-Cachedatei ist veraltet. Cachedatei wird aktualisiert. {0} - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4160: A circular dependency involving project "{0}" has been detected. - MSB4160: Une dépendance circulaire impliquant le projet "{0}" a été détectée. - {StrBegin="MSB4160: "} - - MSB4160: Eine Ringabhängigkeit im Zusammenhang mit dem Projekt "{0}" wurde erkannt. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4126: The specified solution configuration "{0}" is invalid. Please specify a valid solution configuration using the Configuration and Platform properties (e.g. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU") or leave those properties blank to use the default solution configuration. - MSB4126: La configuration de solution spécifiée "{0}" n'est pas valide. Spécifiez une configuration de solution valide à l'aide des propriétés Configuration et Platform (exemple : MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU") ou laissez ces propriétés vides si vous voulez utiliser la configuration de solution par défaut. - {StrBegin="MSB4126: "}UE: The solution filename is provided separately to loggers. - - MSB4126: Die angegebene Projektmappenkonfiguration "{0}" ist ungültig. Geben Sie mithilfe der Konfigurations- und Plattformeigenschaften eine gültige Projektmappenkonfiguration an (z. B. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU"), oder lassen Sie diese Eigenschaften leer, sodass die Standardprojektmappenkonfiguration verwendet wird. - - fuzzyMatch="101" wordcount="37" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4046: Error reading project file "{0}": {1} - MSB4046: Erreur lors de la lecture du fichier projet "{0}" : {1} - {StrBegin="MSB4046: "} - - MSB4046: Fehler beim Lesen der Projektdatei "{0}": {1} - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4125: The project file name "{0}" is invalid. {1} - MSB4125: Le nom du fichier projet "{0}" n'est pas valide. {1} - {StrBegin="MSB4125: "}UE: The solution filename is provided separately to loggers. - - MSB4125: Der Projektdateiname "{0}" ist ungültig. {1} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4051: Project {0} is referencing a project with GUID {1}, but a project with this GUID was not found in the .SLN file. - MSB4051: Le projet {0} fait référence à un projet ayant le GUID {1}, mais ce dernier est introuvable dans le fichier .SLN. - {StrBegin="MSB4051: "}UE: The solution filename is provided separately to loggers. - - MSB4051: Das Projekt "{0}" verweist auf ein Projekt mit der GUID {1}, in der SLN-Datei wurde jedoch kein Projekt mit dieser GUID gefunden. - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - MSB4078: The project file "{0}" is not supported by MSBuild and cannot be built. - MSB4078: Le fichier projet "{0}" n'est pas pris en charge par MSBuild et ne peut pas être généré. - {StrBegin="MSB4078: "} - - MSB4078: Die Projektdatei "{0}" wird nicht von MSBuild unterstützt und kann nicht erstellt werden. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4054: The solution file must be opened in the Visual Studio IDE and converted to the latest version before it can be built by MSBuild. - MSB4054: Le fichier solution doit être ouvert dans l'IDE de Visual Studio et converti vers la dernière version avant de pouvoir être généré par MSBuild. - {StrBegin="MSB4054: "}UE: The solution filename is provided separately to loggers. - - MSB4054: Die Projektmappendatei muss in der Visual Studio IDE geöffnet und in die neuste Version konvertiert werden, bevor sie mit MSBuild erstellt werden kann. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4121: The project configuration for project "{0}" was not specified in the solution file for the solution configuration "{1}". - MSB4121: La configuration du projet "{0}" n'était pas spécifiée dans le fichier solution pour la configuration de solution "{1}". - {StrBegin="MSB4121: "} - - MSB4121: Die Projektkonfiguration für das Projekt "{0}" wurde nicht in der Projektmappendatei für die Projektmappenkonfiguration "{1}" angegeben. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - The project "{0}" is not selected for building in solution configuration "{1}". - Le projet "{0}" n'est pas sélectionné dans le cadre d'une génération dans la configuration de solution "{1}". - - UE: This is not an error, so doesn't need an error code. - - - Das Projekt "{0}" ist in der Projektmappenkonfiguration "{1}" nicht zum Erstellen ausgewählt. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4122: Scanning project dependencies for project "{0}" failed. {1} - MSB4122: Échec de l'analyse des dépendances du projet "{0}". {1} - {StrBegin="MSB4122: "} - - MSB4122: Fehler beim Überprüfen der Projektabhängigkeiten für Projekt "{0}". {1} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4149: The tools version "{0}" of the solution does not support building projects with a different tools version. - MSB4149: La version des outils "{0}" de la solution ne prend pas en charge la génération de projets avec une autre version d'outils. - {StrBegin="MSB4149: "} - - MSB4149: Die Toolsversion {0} der Projektmappe unterstützt das Erstellen von Projekten mit unterschiedlichen Toolsversionen nicht. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - Web projects do not support the "Clean" target. Continuing with remaining projects ... - Les projets web ne prennent pas en charge la cible "Clean". Les projets restants sont utilisés... - UE: This is not an error, so doesn't need an error code. - LOCALIZATION: Do not localize "Clean". - - Webprojekte unterstützen das Clean-Ziel nicht. Verbleibende Projekte werden fortgesetzt... - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Web projects do not support the "Publish" target. Continuing with remaining projects ... - Les projets web ne prennent pas en charge la cible "Publish". Les projets restants sont utilisés... - UE: This is not an error, so doesn't need an error code. - LOCALIZATION: Do not localize "Publish". - - Webprojekte unterstützen das Publish-Ziel nicht. Verbleibende Projekte werden fortgesetzt... - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Skipping because the "$(AspNetConfiguration)" configuration is not supported for this web project. You can use the AspNetConfiguration property to override the configuration used for building web projects, by adding /p:AspNetConfiguration=<value> to the command line. Currently web projects only support Debug and Release configurations. - Opération ignorée, car la configuration "$(AspNetConfiguration)" n'est pas prise en charge pour ce projet web. Vous pouvez utiliser la propriété AspNetConfiguration afin de substituer la configuration utilisée pour la génération de projets web en ajoutant /p:AspNetConfiguration=<valeur> à la ligne de commande. Actuellement, les projets web ne prennent en charge que les configurations Debug et Release. - - UE: This is not an error, so doesn't need an error code. - LOCALIZATION: Do NOT localize "AspNetConfiguration", "Debug", "Release". - - - Da der "$(AspNetConfiguration)" Konfiguration für dieses Webprojekt nicht unterstützt. Verwenden die AspNetConfiguration-Eigenschaft die Konfiguration zum Erstellen von Webprojekten hinzufügen/p: AspNetConfiguration überschreiben = < Wert > in der Befehlszeile. Aktuell unterstützen Webprojekte nur Debug- und Releasekonfigurationen. - - fuzzyMatch="15" wordcount="44" adjWordcount="37.4" curWordcount="37.4" - - - MSB4076: VC projects do not support the "Publish" target. - MSB4076: Les projets VC ne prennent pas en charge la cible "Publish". - {StrBegin="MSB4076: "}LOCALIZATION: Do not localize "Publish". - - MSB4076: VC-Projekte unterstützen nicht das Publish-Ziel. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4098: MSBuild is invoking VCBuild to build this project. Project-to-project references between VC++ projects (.VCPROJ) and C#/VB/VJ# projects (.CSPROJ, .VBPROJ, .VJSPROJ) are not supported by the command-line build systems when building stand-alone VC++ projects. Projects that contain such project-to-project references will fail to build. Please build the solution file containing this project instead. - MSB4098: MSBuild demande à VCBuild de générer ce projet. Les références entre des projets VC++ (.VCPROJ) et des projets C#/VB/VJ# (.CSPROJ, .VBPROJ, .VJSPROJ) ne sont pas prises en charge par les systèmes de génération à partir de la ligne de commande lors de la génération de projets VC++ autonomes. Les projets qui contiennent de telles références entre projets ne pourront pas être générés. Générez le fichier solution qui contient ce projet à la place. - {StrBegin="MSB4098: "} - - MSB4098: MSBuild ruft zum Erstellen dieses Projekts VCBuild auf. Interprojektverweise zwischen VC++-Projekten (.VCPROJ) und C#-/VB-/VJ#-Projekten (.CSPROJ, .VBPROJ, .VJSPROJ) werden beim Erstellen eigenständiger VC++-Projekte von den Befehlszeilen-Buildsystemen nicht unterstützt. Projekte, die solche Interprojektverweise enthalten, werden nicht erstellt. Erstellen Sie stattdessen die Projektmappendatei, die dieses Projekt enthält. - - fuzzyMatch="101" wordcount="53" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4056: The MSBuild engine must be called on a single-threaded-apartment. Current threading model is "{0}". Proceeding, but some tasks may not function correctly. - MSB4056: Le moteur MSBuild doit être appelé sur un thread cloisonné (STA, Single-Threaded Apartment). Le modèle de thread actuel est "{0}". Exécution en cours, mais certaines tâches risqueront de ne pas fonctionner correctement. - {StrBegin="MSB4056: "} - - MSB4056: Das MSBuild-Modul muss in einem Singlethread-Apartment aufgerufen werden. Das aktuelle Threadmodell ist {0}. Der Vorgang wird fortgesetzt, aber einige Aufgaben werden möglicherweise nicht ordnungsgemäß ausgeführt. - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - Schema validation - Validation de schéma - UE: this fragment is used to describe errors that are caused by schema validation. For example, if a normal error is - displayed like this: "MSBUILD : error MSB0000: This is an error.", then an error from schema validation would look like this: - "MSBUILD : Schema validation error MSB0000: This is an error." - LOCALIZATION: This fragment needs to be localized. - - Schemavalidierung - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Target "{0}" skipped. Previously built unsuccessfully. - Cible "{0}" ignorée. Elle n'a pas pu être générée. - - - Das Ziel "{0}" wurde übersprungen. Die vorherige Erstellung war nicht erfolgreich. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Target "{0}" skipped. Previously built successfully. - Cible "{0}" ignorée. Elle a été générée. - - - Das Ziel "{0}" wurde übersprungen. Die vorherige Erstellung war erfolgreich. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4116: The condition "{1}" on the "{0}" target has a reference to item metadata. References to item metadata are not allowed in target conditions unless they are part of an item transform. - MSB4116: La condition "{1}" sur la cible "{0}" contient une référence à des métadonnées d'élément. Les références à des métadonnées d'élément ne sont pas autorisées dans les conditions cibles, sauf si elles font partie d'une transformation d'élément. - {StrBegin="MSB4116: "} - - MSB4116: Die Bedingung "{1}" des {0}-Ziels enthält einen Verweis auf Elementmetadaten. Verweise auf Elementmetadaten sind in Zielbedingungen nicht zulässig, es sei denn, sie sind Teil einer Elementtransformation. - - fuzzyMatch="101" wordcount="32" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4057: The target "{0}" does not exist in the project. - MSB4057: La cible "{0}" n'existe pas dans le projet. - {StrBegin="MSB4057: "} - - MSB4057: Das Ziel "{0}" ist im Projekt nicht vorhanden. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - Done building target "{0}" in project "{1}" -- FAILED. - Génération de la cible "{0}" terminée dans le projet "{1}" -- ÉCHEC. - - - Erstellen des {0}-Ziels in Projekt {1} beendet - Fehler beim Erstellen. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Done building target "{0}" in project "{1}". - Génération de la cible "{0}" terminée dans le projet "{1}". - - - Die Erstellung des Ziels "{0}" im Projekt "{1}" ist abgeschlossen. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - {0}: (TargetId:{1}) - {0} : (IdCible:{1}) - - - {0}: (Ziel-ID:{1}) - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4058: The "{0}" target is missing its output specification. If a target declares inputs, it must also declare outputs. - MSB4058: La spécification des sorties est manquante dans la cible "{0}". Si une cible déclare des entrées, elle doit également déclarer des sorties. - {StrBegin="MSB4058: "} - - MSB4058: Das {0}-Ziel enthält keine Ausgabespezifikation. Wenn ein Ziel Eingaben deklariert, muss es auch Ausgaben deklarieren. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4168: The item "{0}" of type "{1}" does not define a value for the metadata in the expression "{2}". This expression is used in the target output for target "{3}". If a target declares outputs that are transforms, all items in the transform must have a value for the metadata in the transform. - MSB4168: L'élément "{0}" de type "{1}" ne définit aucune valeur pour les métadonnées de l'expression "{2}". Cette expression est utilisée dans la sortie de la cible "{3}". Si une cible déclare des sorties qui sont des transformations, tous les éléments contenus dans la transformation doivent définir une valeur pour les métadonnées de la transformation. - {StrBegin="MSB4168: "} - - MSB4168: Das Element "{0}" vom Typ "{1}" definiert keinen Wert für die Metadaten im Ausdruck "{2}". Dieser Ausdruck wird in der Zielausgabe für "{3}" verwendet. Wenn ein Ziel Ausgaben deklariert, bei denen es sich um Transformationen handelt, müssen alle Elemente in der Transformation einen Wert für die in der Transformation enthaltenen Metadaten aufweisen. - - fuzzyMatch="101" wordcount="53" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Target Performance Summary: - Résumé de performance cible : - - - Leistungszusammenfassung für das Ziel: - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Target "{0}" skipped, due to false condition; ({1}) was evaluated as ({2}). - Cible "{0}" ignorée en raison d'une fausse condition ; ({1}) a été évaluée comme ({2}). - - - Das Ziel "{0}" wurde übersprungen, da die Bedingung "false" war . ({1}) wurde als ({2}) ausgewertet. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Target "{0}" in project "{1}" - Cible "{0}" dans le projet "{1}" - - - {0}-Ziel in {1}-Projekt. - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Target {0}: - {0} cible : - - - Ziel "{0}": - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Target "{0}" in file "{1}": - Cible "{0}" dans le fichier "{1}": - - - Ziel "{0}" in Datei "{1}": - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Build continuing because "{0}" on the task "{1}" is set to "{2}". - Poursuite de la génération, car "{0}" dans la tâche "{1}" a la valeur "{2}". - - - Der Buildvorgang wird fortgesetzt, da {0} in der {1}-Aufgabe auf "{2}" festgelegt ist. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Target {0} from project "{1}": - {0} cible du projet "{1}" : - - - Ziel "{0}" aus Projekt "{1}": - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Target "{0}" in file "{1}" from project "{2}": - Cible "{0}" dans le fichier "{1}" du projet "{2}" : - - - Ziel "{0}" in Datei "{1}" aus Projekt "{2}": - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4060: The "{0}" task has been declared or used incorrectly, or failed during construction. Check the spelling of the task name and the assembly name. - MSB4060: La tâche "{0}" a été déclarée ou utilisée de manière incorrecte, ou a échoué pendant la construction. Vérifiez l'orthographe du nom de la tâche et de l'assembly. - {StrBegin="MSB4060: "} - - MSB4060: Die {0}-Aufgabe wurde falsch deklariert, falsch verwendet oder konnte bei der Erstellung nicht ausgeführt werden. Überprüfen Sie die Schreibweise des Aufgaben- und des Assemblynamens. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4077: The "{0}" task has been marked with the attribute LoadInSeparateAppDomain, but does not derive from MarshalByRefObject. Check that the task derives from MarshalByRefObject or AppDomainIsolatedTask. - MSB4077: la tâche "{0}" a été marquée avec l'attribut LoadInSeparateAppDomain, mais ne dérive pas de MarshalByRefObject. Vérifiez que la tâche dérive de MarshalByRefObject ou de AppDomainIsolatedTask. - {StrBegin="MSB4077: "}LOCALIZATION: <LoadInSeparateAppDomain>, <MarshalByRefObject>, <AppDomainIsolatedTask> should not be localized. - - MSB4077: Die Aufgabe "{0}" wurde mit dem LoadInSeparateAppDomain-Attribut markiert, ist jedoch nicht von MarshalByRefObject abgeleitet. Stellen Sie sicher, dass die Aufgabe von MarshalByRefObject oder AppDomainIsolatedTask abgeleitet wird. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Done executing task "{0}" -- FAILED. - Exécution de la tâche "{0}" terminée -- ÉCHEC. - - - Die Ausführung von Task "{0}" wurde beendet – FEHLER. - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Done executing task "{0}". - Exécution de la tâche "{0}" terminée. - - - Die Ausführung von Task "{0}" wurde beendet. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - {0} (TaskId:{1}) - {0} (IDTâche:{1}) - - - {0} (Aufgaben-ID: {1}) - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Using "{0}" task from assembly "{1}". - Utilisation de la tâche "{0}" à partir de l'assembly "{1}". - UE: This informational message helps users determine which assemblies their tasks were loaded from. - - Die {0}-Aufgabe aus der {1}-Assembly wird verwendet. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4061: The "{0}" task could not be instantiated from the assembly "{1}". {2} - MSB4061: Impossible d'instancier la tâche "{0}" à partir de l'assembly "{1}". {2} - {StrBegin="MSB4061: "}LOCALIZATION: "{2}" is a localized message from a CLR/FX exception. - - MSB4061: Die {0}-Aufgabe konnte nicht aus der {1}-Assembly instanziiert werden. {2} - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4127: The "{0}" task could not be instantiated from the assembly "{1}". Please verify the task assembly has been built using the same version of the Microsoft.Build.Framework assembly as the one installed on your computer and that your host application is not missing a binding redirect for Microsoft.Build.Framework. {2} - MSB4127: Impossible d'instancier la tâche "{0}" à partir de l'assembly "{1}". Vérifiez que l'assembly de tâche a été généré à l'aide de la même version de l'assembly Microsoft.Build.Framework que celle installée sur votre ordinateur et qu'il ne manque pas de redirection de liaison pour Microsoft.Build.Framework dans votre application hôte. {2} - {StrBegin="MSB4127: "}UE: This message is a specialized version of the TaskInstantiationFailureError message and can probably reuse some of its docs. - LOCALIZATION: "{2}" is a localized message from a CLR/FX exception. Also, Microsoft.Build.Framework should not be localized - - MSB4127: Die "{0}"-Aufgabe konnte nicht aus der "{1}"-Assembly instanziiert werden. Überprüfen Sie, ob die Aufgabenassembly mit der gleichen Version der Microsoft.Build.Framework-Assembly erstellt wurde, die auf Ihrem Computer installiert ist, und dass Ihrer Hostanwendung kein BindingRedirect-Eintrag für Microsoft.Build.Framework fehlt. {2} - - fuzzyMatch="101" wordcount="49" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4062: The "{0}" task could not be loaded from the assembly {1}. {2} Confirm that the <UsingTask> declaration is correct, and that the assembly and all its dependencies are available. - MSB4062: Impossible de charger la tâche "{0}" à partir de l'assembly {1}. {2} Assurez-vous que la déclaration <UsingTask> est correcte et que l'assembly et toutes ses dépendances sont disponibles. - {StrBegin="MSB4062: "}UE: This message is shown when a task cannot be loaded from its assembly for various reasons e.g. corrupt assembly, - invalid task declaration, disk error, etc. "{2}" contains a message explaining what happened. - LOCALIZATION: "{2}" is a message from the CLR loader and is already localized. Also, <UsingTask> should not be localized. - - MSB4062: Die "{0}" Vorgang konnte nicht aus der Assembly geladen werden {1}. {2} Bestätigen < UsingTask > Erklärung richtig ist und die Assembly und die zugehörigen Dateien verfügbar sind. - - fuzzyMatch="15" wordcount="31" adjWordcount="26.35" curWordcount="26.35" - - - MSB4063: The "{0}" task could not be initialized with its input parameters. {1} - MSB4063: Impossible d'initialiser la tâche "{0}" avec ses paramètres d'entrée. {1} - {StrBegin="MSB4063: "} - - MSB4063: Die "{0}"-Aufgabe konnte nicht mit ihren Eingabeparametern initialisiert werden. {1} - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - Task Performance Summary: - Résumé de performance des tâches : - - - Leistungszusammenfassung für die Aufgabe: - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Task "{0}" skipped, due to false condition; ({1}) was evaluated as ({2}). - Tâche "{0}" ignorée en raison d'une fausse condition ; ({1}) a été évaluée comme ({2}). - - - Die {0}-Aufgabe wurde übersprungen, da die Bedingung "false" war . ({1}) wurde als ({2}) ausgewertet. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Task "{0}" - Tâche "{0}" - - - Task "{0}" - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Time Elapsed {0} - Temps écoulé {0} - - - Verstrichene Zeit {0} - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Building with tools version "{0}". - Génération à l'aide des outils version "{0}". - - - Erstellung mit der Toolsversion "{0}". - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Project file contains ToolsVersion="{0}". This toolset is unknown or missing. You may be able to resolve this by installing the appropriate .NET Framework for this toolset. Treating the project as if it had ToolsVersion="4.0". - Le fichier projet contient ToolsVersion="{0}". Cet ensemble d'outils est inconnu ou manquant. Vous pouvez résoudre cela en installant le .NET Framework approprié pour cet ensemble d'outils. Projet traité comme si ToolsVersion="4.0". - - - Die Projektdatei enthält ToolsVersion="{0}". Dieses Toolset ist nicht bekannt oder nicht vorhanden. Sie können das Problem möglicherweise beheben, indem Sie das entsprechende .NET Framework für dieses Toolset installieren. Das Projekt wird behandelt als enthielte es ToolsVersion="4.0". - - fuzzyMatch="101" wordcount="34" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Deferred Messages - Messages différés - - - Zurückgestellte Meldungen - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Some messages did not display because they were not associated with any ProjectStarted events. Use diagnostic verbosity to view these messages. - Certains messages ne se sont pas affichés, car ils n'étaient pas associés à des événements ProjectStarted. Utilisez la verbosité de diagnostic pour voir ces messages. - - - Einige Meldungen wurden nicht angezeigt, weil sie keinem ProjectStarted-Ereignis zugeordnet sind. Verwenden Sie den Ausführlichkeitsgrad "diagnostic", um diese Meldungen anzuzeigen. - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - MSB4090: Found an unexpected character '{2}' at position {1} in condition "{0}". - MSB4090: Un caractère inattendu '{2}' a été trouvé à la position {1} dans la condition "{0}". - {StrBegin="MSB4090: "} - - MSB4090: Das unerwartete Zeichen {2} wurde an Position {1} in der {0}-Bedingung gefunden. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4091: Found a call to an undefined function "{1}" in condition "{0}". - MSB4091: Un appel à une fonction "{1}" non définie a été trouvé dans la condition "{0}". - {StrBegin="MSB4091: "} - - MSB4091: Aufruf zu einer undefinierten Funktion "{1}" in Bedingung "{0}" gefunden. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4064: The "{0}" parameter is not supported by the "{1}" task. Verify the parameter exists on the task, and it is a settable public instance property. - MSB4064: Le paramètre "{0}" n'est pas pris en charge par la tâche "{1}". Vérifiez que le paramètre existe pour la tâche et qu'il représente une propriété d'instance publique définissable. - {StrBegin="MSB4064: "} - - MSB4064: Der {0}-Parameter wird von der {1}-Aufgabe nicht unterstützt. Vergewissern Sie sich, dass der Parameter in der Aufgabe vorhanden ist und es sich um eine festlegbare öffentliche Instanzeigenschaft handelt. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4131: The "{0}" parameter is not supported by the "{1}" task. Verify the parameter exists on the task, and it is a gettable public instance property. - MSB4131: Le paramètre "{0}" n'est pas pris en charge par la tâche "{1}". Vérifiez que le paramètre existe pour la tâche et qu'il représente une propriété d'instance publique pouvant être obtenue. - {StrBegin="MSB4131: "} - - MSB4131: Der {0}-Parameter wird von der {1}-Aufgabe nicht unterstützt. Vergewissern Sie sich, dass der Parameter in der Aufgabe vorhanden ist und es sich um eine abrufbare öffentliche Instanzeigenschaft handelt. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4092: An unexpected token "{1}" was found at character position {2} in condition "{0}". - MSB4092: Un jeton inattendu "{1}" a été trouvé à la position de caractère {2} dans la condition "{0}". - {StrBegin="MSB4092: "} - - MSB4092: Ein unerwartetes Token "{1}" wurde an Zeichenposition "{2}" in Bedingung "{0}" gefunden. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4065: The "{0}" parameter is not marked for output by the "{1}" task. - MSB4065: Le paramètre "{0}" n'est pas marqué pour la sortie par la tâche "{1}". - {StrBegin="MSB4065: "} - - MSB4065: Der {0}-Parameter ist nicht für die Ausgabe durch die {1}-Aufgabe markiert. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4066: The attribute "{0}" in element <{1}> is unrecognized. - MSB4066: L'attribut "{0}" de l'élément <{1}> n'est pas reconnu. - {StrBegin="MSB4066: "} - - MSB4066: Das Attribut "{0}" im Element <{1}> wurde nicht erkannt. - - fuzzyMatch="15" wordcount="10" adjWordcount="8.5" curWordcount="8.5" - - - MSB4067: The element <{0}> beneath element <{1}> is unrecognized. - MSB4067: L'élément "{0}" situé sous l'élément <{1}> n'est pas reconnu. - {StrBegin="MSB4067: "} - - MSB4067: Das Element <{0}> unter Element <{1}> wurde nicht erkannt. - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB4068: The element <{0}> is unrecognized, or not supported in this context. - MSB4068: L'élément <{0}> n'est pas reconnu ou n'est pas pris en charge dans ce contexte. - {StrBegin="MSB4068: "} - - MSB4068: Das Element <{0}> ist unbekannt oder in diesem Kontext nicht unterstützt. - - fuzzyMatch="15" wordcount="13" adjWordcount="11.05" curWordcount="11.05" - - - MSB4132: The tools version "{0}" is unrecognized. - MSB4132: La version des outils "{0}" n'est pas reconnue. - {StrBegin="MSB4132: "} - - MSB4132: Die Toolsversion "{0}" ist unbekannt. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4069: The "{0}" type of the "{1}" parameter of the "{2}" task is not supported by MSBuild. - MSB4069: Le type "{0}" du paramètre "{1}" de la tâche "{2}" n'est pas pris en charge par MSBuild. - {StrBegin="MSB4069: "}LOCALIZATION: "MSBuild" should not be localized. - - MSB4069: Der {0}-Typ des {1}-Parameters der {2}-Aufgabe wird von MSBuild nicht unterstützt. - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - MSB4072: A <{0}> element must contain either the "{1}" attribute or the "{2}" attribute (but not both). - MSB4072: Un élément <{0}> doit contenir l'attribut "{1}" ou "{2}" (mais pas les deux). - {StrBegin="MSB4072: "} - - MSB4072: Ein <{0}>-Element muss entweder die "{1}" Attribut oder "{2}" Attribut (jedoch nicht beide). - - fuzzyMatch="15" wordcount="18" adjWordcount="15.3" curWordcount="15.3" - - - {0} Warning(s) - {0} Avertissement(s) - - - {0} Warnung(en) - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4084: A <When> element may not follow an <Otherwise> element in a <Choose>. - MSB4084: Un élément <When> ne peut pas suivre un élément <Otherwise> dans un élément <Choose>. - {StrBegin="MSB4084: "} - - MSB4084: A < >-Element kein Element < Otherwise > < auswählen > folgen. - - fuzzyMatch="15" wordcount="16" adjWordcount="13.6" curWordcount="13.6" - - - Target Name: "{0}" Project Name: "{1}" - Nom de la cible : "{0}" - Nom du projet : "{1}" - - - Zielname: "{0}" Projektname: "{1}" - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Cycle trace: - Suivi du cycle : - - - Schleifenablaufverfolgung: - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4150: Must initialize the console logger using the initialize method before using ApplyParameter - MSB4150: Le journal de console doit être initialisé via la méthode initialize avant l'utilisation de ApplyParameter - {StrBegin="MSB4150: "} - - MSB4150: Die Konsolenprotokollierung muss vor der Verwendung von ApplyParameter mithilfe der Initialisierungsmethode initialisiert werden. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4151: An error occurred while building project "{0}", target "{1}". Please see innerException for detailed information. - MSB4151: Erreur lors de la génération du projet "{0}", cible "{1}". Pour obtenir des informations plus détaillées, consultez innerException. - {StrBegin="MSB4151: "} - - MSB4151: Fehler beim Erstellen von Projekt "{0}", Ziel "{1}". Ausführliche Informationen finden Sie in der innerException. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB4152: An error occurred on the child node "{0}" and could not be passed to the parent node. {1} - MSB4152: Une erreur s'est produite sur le nœud enfant "{0}" et n'a pas pu être passée au nœud parent. {1} - {StrBegin="MSB4152: "} - - MSB4152: Fehler im untergeordneten Knoten "{0}", der nicht an den übergeordneten Knoten übergeben werden konnte. {1} - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4153: A call is made on an inactive IBuildEngine interface corresponding to a task that already finished execution. - MSB4153: Un appel est effectué sur une interface IBuildEngine inactive correspondant à une tâche dont l'exécution est terminée. - {StrBegin="MSB4153: "} - - MSB4153: Eine inaktive IBuildEngine-Schnittstelle wird aufgerufen, der eine Aufgabe entspricht, deren Ausführung bereits abgeschlossen wurde. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - MSB4154: A forwarding logger is attempting to forward BuildFinished event - MSB4154: Un journal de transfert tente de transférer l'événement BuildFinished - {StrBegin="MSB4154: "} - - MSB4154: Eine weiterleitende Protokollierung versucht, das BuildFinished-Ereignis weiterzuleiten. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4155: There was an error while communicating with a node. - MSB4155: Erreur lors de la communication avec un nœud. - {StrBegin="MSB4155: "} - - MSB4155: Fehler bei der Kommunikation mit einem Knoten. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB1021: Cannot create an instance of the logger - {0}. - MSB1021: Impossible de créer une instance du journal - {0}. - {StrBegin="MSB1021: "}The error code for this message is duplicated from MSBuild.exe. - - MSB1021: Eine Instanz der Protokollierung kann nicht erstellt werden - {0}. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB1020: The logger {0} was not found. Check the following: 1.) The logger name specified is the same as the name of the logger class. 2.) The logger class is "public" and implements the Microsoft.Build.Framework.ILogger interface. 3.) The path to the logger assembly is correct, or the logger can be loaded using only the assembly name provided. - MSB1020: Le journal {0} est introuvable. Vérifiez les points suivants : 1.) Le nom du journal est le même que celui de la classe de journalisation. 2.) La classe de journalisation est "public" et implémente l'interface Microsoft.Build.Framework.ILogger. 3.) Le chemin d'accès à l'assembly de journalisation est correct ou le journal peut uniquement être chargé avec le nom d'assembly fourni. - {StrBegin="MSB1020: "}The error code for this message is duplicated from MSBuild.exe. - - MSB1020: Die Protokollierung {0} wurde nicht gefunden. Überprüfen Sie Folgendes: 1.) Der angegebene Name der Protokollierung ist mit dem Namen der Protokollierungsklasse identisch. 2.) Die Protokollierungsklasse ist "public" und implementiert die Microsoft.Build.Framework.ILogger-Schnittstelle. 3.) Der Pfad zur Protokollierungsassembly ist richtig, bzw. die Protokollierung kann alleine mithilfe des angegebenen Assemblynamens geladen werden. - - fuzzyMatch="101" wordcount="57" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4156: A forwarding logger is attempting to forward BuildStarted event - MSB4156: Un journal de transfert tente de transférer l'événement BuildStarted - {StrBegin="MSB4156: "} - - MSB4156: Eine weiterleitende Protokollierung versucht, das BuildStarted-Ereignis weiterzuleiten. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - "{0}" ({1} target) ({2}) -> - "{0}" ({1} cible) ({2}) -> - - - "{0}" ({1} target) ({2}) -> - - fuzzyMatch="15" wordcount="5" adjWordcount="4.25" curWordcount="4.25" - - - "{0}" (default target) ({1}) -> - "{0}" (cible par défaut) ({1}) -> - - - "{0}" (Standardziel) ({1}) -> - - fuzzyMatch="15" wordcount="5" adjWordcount="4.25" curWordcount="4.25" - - - {0} {1,5} - {0} {1,5} - - - {0} {1,5} - - fuzzyMatch="15" wordcount="2" adjWordcount="1.7" curWordcount="1.7" - - - Project "{0}" on node {1} ({2} target(s)). - Projet "{0}" sur le nœud {1} ({2} cible(s)). - - - Projekt "{0}" auf Knoten "{1}", {2} Ziel(e). - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Project "{0}" on node {1} (default targets). - Projet "{0}" sur le nœud {1} (cibles par défaut). - - - Projekt "{0}" auf Knoten "{1}" (Standardziele). - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Project "{0}" ({1}) is building "{2}" ({3}) on node {4} ({5} target(s)). - Le projet "{0}" ({1}) génère "{2}" ({3}) sur le nœud {4} ({5} cible(s)). - - - Das Projekt "{0}" ({1}) erstellt "{2}" ({3}) auf Knoten "{4}", {5} Ziel(e). - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Project "{0}" ({1}) is building "{2}" ({3}) on node {4} (default targets). - Le projet "{0}" ({1}) génère "{2}" ({3}) sur le nœud {4} (cibles par défaut). - - - Das Projekt "{0}" ({1}) erstellt "{2}" ({3}) auf Knoten "{4}" (Standardziele). - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - ({0} target) -> - ({0} cible) -> - - - ({0} Ziel) -> - - fuzzyMatch="15" wordcount="3" adjWordcount="2.55" curWordcount="2.55" - - - MSB4157: The array of project files needs to contain at least one value. - MSB4157: Le tableau de fichiers projet doit contenir au moins une valeur. - {StrBegin="MSB4157: "} - - MSB4157: Das Array der Projektdateien muss mindestens einen Wert enthalten. - - fuzzyMatch="15" wordcount="13" adjWordcount="11.05" curWordcount="11.05" - - - MSB4158: The project file name at element {0} is empty. - MSB4158: Le nom du fichier projet à l'élément {0} est vide. - {StrBegin="MSB4158: "} - - MSB4158: Der Projektdateiname bei Element {0} ist leer. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - The property "{0}" with value "{1}" is being overridden by another batch. The property is now: "{2}" - La propriété "{0}" ayant la valeur "{1}" est substituée par un autre lot. À présent, la propriété est : "{2}" - - - Die Eigenschaft "{0}" mit dem Wert "{1}" wird von einem anderen Batch überschrieben. Die Eigenschaft ist jetzt: "{2}" - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - Please see inner exception for error information. - Consultez l'exception interne pour obtenir des informations sur l'erreur. - - - Fehlerinformationen finden Sie in der internen Ausnahme. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Event type "{0}" was expected to be serializable. The event was not serializable and has been ignored. - Le type d'événement "{0}" devait être sérialisable. L'événement n'était pas sérialisable et a été ignoré. - - - Es wurde erwartet, dass der Typ "{0}" serialisierbar ist. Das Ereignis war nicht serialisierbar und wurde ignoriert. - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - The log file path cannot be null or empty. - Le chemin d'accès du fichier journal ne peut pas être null ou vide. - - - Der Protokolldateipfad darf nicht NULL oder leer sein. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4161: Project "{0}" was loaded and unloaded during the current build. Reloading a project during the build can result in errors or an inconsistent build state. Either avoid unloading project "{0}" or cache the evaluation results of target(s) "{1}" before unloading the project. - MSB4161: Le projet "{0}" a été chargé et déchargé durant la génération actuelle. Le rechargement d'un projet durant la génération peut provoquer des erreurs ou un état de génération incohérent. Évitez de décharger le projet "{0}" ou mettez en cache les résultats d'évaluation des cibles "{1}" avant de décharger le projet. - {StrBegin="MSB4161: "} - - MSB4161: Das Projekt "{0}" wurde während der aktuellen Erstellung geladen und entladen. Das erneute Laden eines Projekts während der Erstellung kann zu Fehlern oder einem nicht konsistenten Buildzustand führen. Vermeiden Sie entweder das Entladen des Projekts "{0}", oder speichern Sie die Auswertungsergebnisse der Ziele "{1}" vor dem Entladen des Projekts im Cache. - - fuzzyMatch="101" wordcount="43" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - [default] - [par défaut] - - - [Standard] - - fuzzyMatch="100" wordcount="1" adjWordcount="0.25" curWordcount="0.25" tmLabel="N''" - - -
-
\ No newline at end of file diff --git a/src/Deprecated/Engine/Resources/xlf/Strings.it.xlf b/src/Deprecated/Engine/Resources/xlf/Strings.it.xlf deleted file mode 100644 index a15dba173bd..00000000000 --- a/src/Deprecated/Engine/Resources/xlf/Strings.it.xlf +++ /dev/null @@ -1,2674 +0,0 @@ - - - -
- - 4013 - 1176.8 - 1176.8 - 0 - 0 - - - 0 - 981 - 2334 - 0 - 0 - 698 - 0 - -
- - - MSB4001: The "{0}" task has more than one parameter called "{1}". - MSB4001: l'attività "{0}" contiene più di un parametro denominato "{1}". - {StrBegin="MSB4001: "}UE: This message is shown when a task has more than one .NET property with the same name -- it's unclear which of - those properties the task wants to use as a parameter in project files. - - MSB4001: Die {0}-Aufgabe enthält mehrere Parameter mit dem Namen "{1}". - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4081: The value "{0}" of the "ItemName" attribute in element <Output> contains an "@" character. If you intended to use an item name then remove the @( ) around the item name. - MSB4081: il valore "{0}" dell'attributo "ItemName" in un elemento <Output> contiene un carattere "@". Se si desidera utilizzare un nome di elemento, non racchiuderlo in @( ). - {StrBegin="MSB4081: "}UE: This message is shown when an output tag has an itemname that contains an @. They probably typed @(foo) instead of foo in the ItemName.LOCALIZATION: Output and ItemName should not be localized. - - MSB4081: Der Wert "{0}" "ItemName-Attribut im Element < Output > enthält ein" @"Zeichen. Soll ein Elementname verwenden und entfernen dann die @ (), um den Namen des Elements. - - fuzzyMatch="15" wordcount="30" adjWordcount="25.5" curWordcount="25.5" - - - MSB4002: There was a failure retrieving the attributes for parameters in the "{0}" task. {1} - MSB4002: errore durante il recupero degli attributi per i parametri nell'attività "{0}". {1} - {StrBegin="MSB4002: "}UE: This message is shown when the .NET attributes that a task's .NET properties are decorated with, cannot be - retrieved -- this is typically because the .NET classes that define the .NET attributes cannot be loaded because the assembly - they are defined in cannot be found, or the classes themselves cannot be found. - - MSB4002: Fehler beim Abrufen der Attribute für Parameter in der {0}-Aufgabe. {1} - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - MSB4003: "{0}" is a reserved attribute of the <{1}> element, and must be spelled with the correct casing. This attribute cannot be used as a parameter to the "{2}" task. - MSB4003: "{0}" è un attributo riservato dell'elemento <{1}> e deve essere scritto con le maiuscole e minuscole corrette. Questo attributo non può essere utilizzato come parametro per l'attività "{2}". - {StrBegin="MSB4003: "}UE: Tasks are not allowed to use incorrect case for reserved attributes on the task nodes e.g. "continueonerror" - instead of the "ContinueOnError". - - MSB4003: "{0}" ist ein reserviertes Attribut der <{1}>-Element und mit der richtigen Groß-/Kleinschreibung geschrieben werden muss. Dieses Attribut kann nicht verwendet werden, als Parameter an die "{2}" Aufgabe. - - fuzzyMatch="15" wordcount="31" adjWordcount="26.35" curWordcount="26.35" - - - The "REQUESTBATCHSIZE" must be a number greater than 1. "{0}" is an invalid value. The value 10 will be used instead. - Il valore di "REQUESTBATCHSIZE" deve essere maggiore di 1. "{0}" non è un valore valido. Verrà usato il valore 10. - The name "REQUESTBATCHSIZE" is an environment variable - - Die "REQUESTBATCHSIZE" muss eine Zahl größer als 1 sein. "{0}" ist ein ungültiger Wert. Der Wert 10 wird stattdessen verwendet. - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - Build completed in {0}. - Compilazione completata in {0}. - - - Das Erstellen wurde in {0} beendet. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - Build FAILED. - Compilazione NON RIUSCITA. - - - Fehler beim Buildvorgang. - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Build succeeded. - Compilazione completata. - - - Buildvorgang erfolgreich. - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Build started. - Compilazione avviata. - - - Der Buildvorgang wurde gestartet. - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Build started {0}. - Compilazione avviata {0}. - - - Der Buildvorgang wurde am {0} gestartet. - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Building target "{0}" completely. - Compilazione completa della destinazione "{0}" in corso. - {0} is the name of the target. - - Das Ziel "{0}" wird vollständig erstellt. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - No input files were specified. - Non è stato specificato alcun file di input. - - - Es wurden keine Eingabedateien angegeben. - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Input file "{0}" is newer than output file "{1}". - Il file di input "{0}" è più recente del file di output "{1}". - {0} and {1} are filenames on disk. - - Die Eingabedatei "{0}" ist neuer als die Ausgabedatei "{1}". - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - Output file "{0}" does not exist. - Il file di output "{0}" non esiste. - {0} is a filename on disk. - - Die Ausgabedatei "{0}" ist nicht vorhanden. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Input file "{0}" does not exist. - Il file di input "{0}" non esiste. - {0} is a filename on disk. - - Die Eingabedatei "{0}" ist nicht vorhanden. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Building target "{0}" partially, because some output files are out of date with respect to their input files. - Compilazione parziale della destinazione "{0}" perché alcuni file di output sono obsoleti rispetto ai file di input corrispondenti. - {0} is the name of the target. - - Das Ziel "{0}" wird teilweise erstellt, da einige Ausgabedateien hinsichtlich ihrer Eingabedateien veraltet sind. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - [{0}: Input={1}, Output={2}] Input file is newer than output file. - [{0}: Input={1}, Output={2}] Il file di input è più recente del file di output. - {0} is the name of an MSBuild item. {1} and {2} are filenames on disk. - - [{0}: Eingabe={1}, Ausgabe={2}] Die Eingabedatei ist neuer als die Ausgabedatei. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - [{0}: Input={1}, Output={2}] Output file does not exist. - [{0}: Input={1}, Output={2}] Il file di output non esiste. - {0} is the name of an MSBuild item. {1} and {2} are filenames on disk. - - [{0}: Eingabe={1}, Ausgabe={2}] Die Ausgabedatei ist nicht vorhanden. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - [{0}: Input={1}, Output={2}] Input file does not exist. - [{0}: Input={1}, Output={2}] Il file di input non esiste. - {0} is the name of an MSBuild item. {1} and {2} are filenames on disk. - - [{0}: Eingabe={1}, Ausgabe={2}] Die Eingabedatei ist nicht vorhanden. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - The attribute "{0}" is a known MSBuild attribute, and cannot be accessed using this method. - L'attributo "{0}" è un attributo MSBuild noto. Non è possibile accedervi usando questo metodo. - - - Das {0}-Attribut ist ein bekanntes MSBuild-Attribut, auf das mithilfe dieser Methode nicht zugegriffen werden kann. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - Properties in persisted property groups cannot be accessed by name. - Non è possibile accedere per nome alle proprietà presenti in gruppi di proprietà persistenti. - - - Auf Eigenschaften in persistenten Eigenschaftengruppen ist kein Zugriff über den Namen möglich. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4023: Cannot evaluate the item metadata "%({0})". {1} - MSB4023: non è possibile valutare i metadati dell'elemento "%({0})". {1} - {StrBegin="MSB4023: "}UE: This message is shown when the value of an item metadata cannot be computed for some reason e.g. trying to apply - %(RootDir) to an item-spec that's not a valid path, would result in this error. - LOCALIZATION: "{1}" is a localized message explaining the problem. - - MSB4023: Elementmetadaten "%({0})" können nicht ausgewertet werden. {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Cannot execute a task not associated with a project object. - Non è possibile eseguire un'attività non associata a un oggetto Project. - - - Eine Aufgabe, die keinem Projektobjekt zugeordnet ist, kann nicht ausgeführt werden. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - The cache entry has already been set to a different value and cannot be modified. - La voce della cache è già stata impostata su un valore differente e non può essere modificata. - - - Der Cacheeintrag wurde bereits auf einen anderen Wert festgelegt und kann nicht geändert werden. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - The "{0}" property comes from an environment variable, and cannot be modified. - Non è possibile modificare la proprietà "{0}". Proviene da una variabile di ambiente. - - - Die {0}-Eigenschaft stammt aus einer Umgebungsvariablen und kann nicht geändert werden. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - The "{0}" property is a global property, and cannot be modified through an evaluated property group. Use "{1}" instead. - Non è possibile modificare la proprietà "{0}" tramite un gruppo di proprietà valutato perché è una proprietà globale. Usare "{1}". - - - Die {0}-Eigenschaft ist eine globale Eigenschaft und kann nicht über eine ausgewertete Eigenschaftengruppe geändert werden. Verwenden Sie stattdessen {1}. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - Modifying the XML of an imported project file is not allowed. Open that project file directly. - La modifica del codice XML di un file di progetto importato non è consentita. Aprire direttamente il file di progetto. - - - Der XML-Code einer importierten Projektdatei darf nicht geändert werden. Öffnen Sie diese Projektdatei direkt. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB4117: The "{0}" item name is reserved, and cannot be used. - MSB4117: il nome di elemento "{0}" è riservato e non può essere usato. - {StrBegin="MSB4117: "}UE: This message is shown when the user tries to redefine one of the reserved MSBuild items e.g. @(Choose) - - MSB4117: Der Elementname "{0}" ist reserviert und kann nicht verwendet werden. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4118: The "{0}" item metadata name is reserved, and cannot be used. - MSB4118: il nome dei metadati dell'elemento "{0}" è riservato e non può essere usato. - {StrBegin="MSB4118: "}UE: This message is shown when the user tries to redefine one of the reserved MSBuild items e.g. @(Choose) - - MSB4118: Der Elementmetadatenname "{0}" ist reserviert und kann nicht verwendet werden. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4004: The "{0}" property is reserved, and cannot be modified. - MSB4004: non è possibile modificare la proprietà "{0}". È riservata. - {StrBegin="MSB4004: "}UE: This message is shown when the user tries to redefine one of the reserved MSBuild properties e.g. $(MSBuildProjectFile) - - MSB4004: Die {0}-Eigenschaft ist reserviert und kann nicht geändert werden. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4094: "{0}" is an invalid value for the "{1}" parameter of the "{3}" task. Multiple items cannot be passed into a parameter of type "{2}". - MSB4094: "{0}" non è un valore valido per il parametro "{1}" dell'attività "{3}". Non è possibile passare più elementi in un parametro di tipo "{2}". - {StrBegin="MSB4094: "} - UE: This error is shown when a project tries to pass multiple items into a task parameter of type ITaskItem (singular). - - - MSB4094: "{0}" ist ein ungültiger Wert für den "{1}"-Parameter der "{3}"-Aufgabe. Mehrere Elemente können nicht in einen Parameter vom Typ "{2}" übergeben werden. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4115: The "{0}" function only accepts a scalar value, but its argument "{1}" evaluates to "{2}" which is not a scalar value. - MSB4115: la funzione "{0}" accetta solo un valore scalare, mentre il relativo argomento "{1}" restituisce "{2}" che non costituisce un valore scalare. - {StrBegin="MSB4115: "} - UE: This error is shown when a project tries to pass multiple items into a function in a conditional expression, that can only accept a scalar value (such as the "exists()" function). - - - MSB4115: Die "{0}"-Funktion nimmt nur einen Skalarwert an, ihr "{1}"-Argument wird jedoch zu "{2}" ausgewertet, bei dem es sich nicht um einen Skalarwert handelt. - - fuzzyMatch="100" wordcount="22" adjWordcount="5.5" curWordcount="5.5" tmLabel="N''" - - - The task is currently associated with a project object, and should not be added to a different one. - L'attività è associata a un oggetto di progetto. Non può essere aggiunta a un oggetto diverso. - - - Die Aufgabe ist derzeit einem Projektobjekt zugeordnet und sollte zu keinem anderen Projektobjekt hinzugefügt werden. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - MSB4095: The item metadata %({0}) is being referenced without an item name. Specify the item name by using %(itemname.{0}). - MSB4095: riferimento ai metadati dell'elemento %({0}) senza un nome di elemento. Specificare il nome dell'elemento usando il formato %(itemname.{0}). - {StrBegin="MSB4095: "} - - MSB4095: Auf die %({0})-Elementmetadaten wird ohne einen Elementnamen verwiesen. Geben Sie den Namen mithilfe von %(itemname.{0}) an. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - The task is not associated with the specified target element collection, and should not be removed from it. - L'attività non è associata alla raccolta di elementi di destinazione specificato. Non può essere rimossa da questa raccolta. - - - Die Aufgabe ist nicht der angegebenen Auflistung von Zielelementen zugeordnet und sollte nicht daraus entfernt werden. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - MSB4005: The current working directory could not be restored to {0}. {1} - MSB4005: non è stato possibile ripristinare la directory di lavoro corrente in {0}. {1} - {StrBegin="MSB4005: "}UE: This message is shown when the current working directory cannot be reset after a build. "{1}" contains a message explaining why. - LOCALIZATION: "{1}" is a message from an CLR/FX exception and is already localized. - - MSB4005: Das aktuelle Arbeitsverzeichnis konnte unter {0} nicht wiederhergestellt werden. {1} - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Cannot set a condition on an object not represented by an XML element in the project file. - Non è possibile impostare una condizione per un oggetto non rappresentato da un elemento XML nel file di progetto. - - - Eine Bedingung kann nicht für ein Objekt festgelegt werden, wenn das Objekt nicht von einem XML-Element in der Projektdatei repräsentiert wird. - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - Cannot set ContinueOnError on an object not represented by an XML element in the project file. - Non è possibile impostare ContinueOnError per un oggetto non rappresentato da un elemento XML nel file di progetto. - - - Das ContinueOnError-Attribut kann nicht für ein Objekt festgelegt werden, wenn das Objekt nicht von einem XML-Element in der Projektdatei repräsentiert wird. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB4134: DefaultToolsVersion cannot be set after a project has been loaded into the Engine. - MSB4134: non è possibile impostare DefaultToolsVersion dopo che un progetto è stato caricato nel motore. - {StrBegin="MSB4134: "} - - MSB4134: DefaultToolsVersion darf nicht festgelegt werden, nachdem ein Projekt in das Modul geladen wurde. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - Assigning the "{0}" attribute on an item that has been evaluated is not allowed. This operation is only allowed on the original persisted item that came directly from the project file. - Non è consentito assegnare l'attributo "{0}" a un elemento valutato. Questa operazione è consentita solo per l'elemento originale persistente proveniente direttamente dal file di progetto. - - - Das {0}-Attribut darf nicht einem Element zugewiesen werden, das ausgewertet wurde. Dieser Vorgang ist nur für das ursprüngliche persistente Element zulässig, das direkt aus der Projektdatei stammt. - - fuzzyMatch="101" wordcount="31" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Assigning the "{0}" attribute of a virtual item is not allowed. - Non è consentito assegnare l'attributo "{0}" di un elemento virtuale. - - - Das Zuweisen des {0}-Attributs eines virtuellen Elements ist nicht zulässig. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - A property cannot be set while building. - Non è possibile impostare una proprietà durante la compilazione. - - - Eine Eigenschaft kann nicht während des Erstellens festgelegt werden. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - A property cannot be set to null. - Non è possibile impostare una proprietà su Null. - - - Eine Eigenschaft kann nicht auf NULL festgelegt werden. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Cannot get or set parameters on a task not associated with a project object. - Non è possibile ottenere o impostare parametri per un'attività non associata a un oggetto di progetto. - - - Parameter für eine Aufgabe können nicht abgefragt oder festgelegt werden, wenn die Aufgabe keinem Projektobjekt zugeordnet ist. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4162: <{0}> is not valid. Child elements are not allowed below a item remove element. - MSB4162: <{0}> non è valido. Elementi figlio non consentiti al di sotto di un elemento rimosso. - {StrBegin="MSB4162: "} - - MSB4162: <{0}> ist ungültig. Untergeordnete Elemente dürfen nicht unter einem Element Element entfernen. - - fuzzyMatch="15" wordcount="16" adjWordcount="13.6" curWordcount="13.6" - - - MSB4166: Child node "{0}" exited prematurely. Shutting down. - MSB4166: nodo figlio "{0}" interrotto in modo anomalo. Chiusura in corso. - {StrBegin="MSB4166: "} - - MSB4166: Der untergeordnete Knoten "{0}" wurde vorzeitig beendet. Herunterfahren. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4085: A <Choose> must contain at least one <When>. - MSB4085: un elemento <Choose> deve contenere almeno un elemento <When>. - {StrBegin="MSB4085: "} - - MSB4085: < auswählen > muss mindestens < Wenn >. - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB4114: <Choose> elements cannot be nested more than {0} levels deep. - MSB4114: il limite massimo di annidamento degli elementi <Choose> è di {0} livelli. - {StrBegin="MSB4114: "}UE: This message appears if the project file contains unreasonably nested Choose elements. - LOCALIZATION: Do not localize "Choose" as it is an XML element name. - - MSB4114: < auswählen > Elemente können nicht geschachtelt werden mehr als {0} Ebenen. - - fuzzyMatch="15" wordcount="12" adjWordcount="10.2" curWordcount="10.2" - - - MSB4006: There is a circular dependency in the target dependency graph involving target "{0}". - MSB4006: è presente una dipendenza circolare nel grafico di dipendenze che usa la destinazione "{0}". - {StrBegin="MSB4006: "}UE: This message is shown when the build engine detects a target referenced in a circular manner -- a project cannot - request a target to build itself (perhaps via a chain of other targets). - - MSB4006: Im Zielabhängigkeitsdiagramm besteht eine Ringabhängigkeit im Zusammenhang mit dem Ziel "{0}". - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4086: A numeric comparison was attempted on "{1}" that evaluates to "{2}" instead of a number, in condition "{0}". - MSB4086: è stato tentato un confronto numerico su "{1}" che ha restituito "{2}" anziché un numero, nella condizione "{0}". - {StrBegin="MSB4086: "} - - MSB4086: Es wurde versucht, einen numerischen Vergleich für "{1}" auszuführen, der zu "{2}" anstatt zu einer Zahl in Bedingung "{0}" ausgewertet wird. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4007: The clause "{0}", specified in the "{1}" attribute is invalid. - MSB4007: la clausola "{0}" specificata nell'attributo "{1}" non è valida. - {StrBegin="MSB4007: "}UE: This message is shown when the Condition on an element is invalid in some way -- e.g. syntax error, unrecognized operator. - - MSB4007: Die im {1}-Attribut festgelegte {0}-Klausel ist ungültig. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4130: The condition "{0}" may have been evaluated incorrectly in an earlier version of MSBuild. Please verify that the order of the AND and OR clauses is written as intended. To avoid this warning, add parentheses to make the evaluation order explicit. - MSB4130: la condizione "{0}" potrebbe essere stata valutata in modo non corretto in una versione precedente di MSBuild. Verificare che l'ordine delle clausole AND e OR sia corretto. Per evitare che venga visualizzato l'avviso, aggiungere parentesi per rendere esplicito l'ordine di valutazione. - {StrBegin="MSB4130: "} - - MSB4130: Die Bedingung "{0}" ist in einer früheren Version von MSBuild möglicherweise fehlerhaft ausgewertet worden. Stellen Sie sicher, dass die AND- und OR-Klauseln in der beabsichtigten Reihenfolge stehen. Damit diese Warnung nicht angezeigt wird, fügen Sie Klammern hinzu, um die Auswertungsreihenfolge explizit anzugeben. - - fuzzyMatch="101" wordcount="42" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4087: Specified condition "{0}" does not evaluate to a boolean. - MSB4087: la condizione specificata "{0}" non restituisce un valore booleano. - {StrBegin="MSB4087: "} - - MSB4087: Die angegebene {0}-Bedingung wird nicht zu einem booleschen Wert ausgewertet. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4113: Specified condition "{0}" evaluates to "{1}" instead of a boolean. - MSB4113: la condizione specificata "{0}" restituisce "{1}" anziché un valore booleano. - {StrBegin="MSB4113: "} - - MSB4113: Die angegebene Bedingung {0} wird zu {1} statt zu einem booleschen Wert ausgewertet. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - {0}, line {1} - {0}, riga {1} - - - {0}, Zeile {1} - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - MSB4136: Error reading the toolset information from the configuration file "{0}". {1} - MSB4136: errore durante la lettura delle informazioni del set di strumenti dal file di configurazione "{0}". {1} - {StrBegin="MSB4136: "} - - MSB4136: Fehler beim Lesen der Toolsetinformationen aus der Konfigurationsdatei "{0}". {1} - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4008: A conflicting assembly for the task assembly "{0}" has been found at "{1}". - MSB4008: rilevato un assembly in conflitto per l'assembly dell'attività "{0}" in "{1}". - {StrBegin="MSB4008: "}UE: This message is shown when the type/class of a task cannot be resolved uniquely from a single assembly. - - MSB4008: Eine mit der Aufgabenassembly "{0}" in Konflikt stehende Assembly wurde in "{1}" gefunden. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4142: MSBuildToolsPath is not the same as MSBuildBinPath for the ToolsVersion "{0}" defined at "{1}". If both are present they must have the same value. - MSB4142: il valore di MSBuildToolsPath non corrisponde al valore di MSBuildBinPath per il parametro ToolsVersion "{0}" definito in "{1}". Se entrambi sono presenti, devono avere lo stesso valore. - {StrBegin="MSB4142: "} - - MSB4142: MSBuildToolsPath ist nicht identisch mit MSBuildBinPath für die bei "{1}" definierte ToolsVersion {0}. Wenn beide Pfade vorhanden sind, müssen sie identische Werte haben. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4097: The element <{0}> beneath element <{1}> may not have a custom XML namespace. - MSB4097: l'elemento <{0}> al di sotto dell'elemento <{1}> non può avere uno spazio dei nomi XML personalizzato. - {StrBegin="MSB4097: "} - - MSB4097: Das Element <{0}> unter Element <{1}> möglicherweise keinen benutzerdefinierten XML-Namespace. - - fuzzyMatch="15" wordcount="16" adjWordcount="13.6" curWordcount="13.6" - - - MSB4009: The default tasks file could not be successfully loaded. {0} - MSB4009: non è stato possibile caricare il file predefinito delle attività. {0} - {StrBegin="MSB4009: "}UE: This message is shown when one of the default tasks file (*.tasks) located alongside the MSBuild binaries cannot - be opened/parsed. "{0}" contains a message explaining why. The filename itself is not part of the message but is provided - separately to loggers. - LOCALIZATION: "{0}" is a message from some FX method and is already localized. - - MSB4009: Die Standardaufgabendatei konnte nicht geladen werden. {0} - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4010: The "{0}" files could not be successfully loaded from their expected location "{1}". Default tasks will not be available. {2} - MSB4010: non è stato possibile caricare i file "{0}" dal percorso previsto "{1}". Le attività predefinite non saranno disponibili. {2} - {StrBegin="MSB4010: "}UE: This message is shown when the default tasks files that are located alongside the MSBuild binaries cannot be - found, either because they don't exist, or because of lack of permissions. "{2}" contains a message explaining why. - LOCALIZATION: "{2}" is a message from some FX method and is already localized. - - MSB4010: Die {0}-Dateien konnten nicht vom erwarteten Speicherplatz "{1}" geladen werden. Standardaufgaben sind nicht verfügbar. {2} - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - MSB4140: Default tools version is specified in neither the registry nor the configuration file. - MSB4140: versione strumenti predefinita non specificata nel Registro di sistema e nel file di configurazione. - {StrBegin="MSB4140: "} - - MSB4140: Die Standardtoolsversion ist weder in der Registrierung noch in der Konfigurationsdatei angegeben. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4133: A default tools version "{0}" was specified, but its definition could not be found. - MSB4133: la definizione della versione strumenti predefinita "{0}" specificata non è stata trovata. - {StrBegin="MSB4133: "} - - MSB4133: Eine Standardtoolsversion "{0}" wurde angegeben, aber ihre Definition konnte nicht gefunden werden. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - MSB4080: The value "{0}" of the "PropertyName" attribute in element <Output> contains a "$" character. If you intended to use a property name then remove the $( ) around the property name. - MSB4080: il valore "{0}" dell'attributo "PropertyName" nell'elemento <Output> contiene un carattere "$". Se si desidera utilizzare un nome di proprietà, non racchiuderlo in $( ). - {StrBegin="MSB4080: "}UE: This message is shown when an output tag has an property name that contains an $. They probably typed $(foo) instead of foo in the PropertyName. LOCALIZATION: Output and PropertyName should not be localized. - - MSB4080: Der Wert "{0}" "PropertyName-Attribut im Element < Output >"$"-Zeichen enthält. Wenn Sie auf einen Eigenschaftennamen verwenden und entfernen Sie anschließend die ($), um den Eigenschaftennamen. - - fuzzyMatch="15" wordcount="32" adjWordcount="27.2" curWordcount="27.2" - - - MSB4011: There is a circular reference involving the import of file "{0}". This file may have been imported more than once, or you may have attempted to import the main project file. All except the first instance of this file will be ignored. - MSB4011: è presente un riferimento circolare che usa l'importazione del file "{0}". Il file potrebbe essere stato importato più volte oppure è possibile che si sia tentato di importare il file di progetto principale. Tutte le istanze del file, ad eccezione della prima, verranno ignorate. - {StrBegin="MSB4011: "} - - MSB4011: Es besteht eine Ringabhängigkeit im Zusammenhang mit dem Import der Datei {0}. Diese Datei wurde unter Umständen mehrmals importiert, oder es wurde versucht, die Hauptprojektdatei zu importieren. Alle außer der ersten Instanz dieser Datei werden ignoriert. - - fuzzyMatch="101" wordcount="43" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4079: The <ProjectExtensions> element occurs more than once. - MSB4079: elemento <ProjectExtensions> presente più di una volta. - {StrBegin="MSB4079: "} - - MSB4079: Das Element < ProjectExtensions > tritt mehr als einmal. - - fuzzyMatch="15" wordcount="9" adjWordcount="7.65" curWordcount="7.65" - - - MSB4012: The expression "{0}" cannot be used in this context. Item lists cannot be concatenated with other strings where an item list is expected. Use a semicolon to separate multiple item lists. - MSB4012: l'espressione "{0}" non può essere usata in questo contesto. Gli elenchi di elementi non possono essere concatenati ad altre stringhe se è previsto un elenco di elementi. Usare un punto e virgola per separare più elenchi di elementi. - {StrBegin="MSB4012: "}UE: This message is shown when the user does not properly specify an item list when an item list is expected - e.g. "badprefix@(foo)badsuffix" instead of "prefix; @(foo); suffix" - - MSB4012: Der Ausdruck {0} kann in diesem Kontext nicht verwendet werden. Elementlisten können nicht mit anderen Zeichenfolgen verkettet werden, wenn eine Elementliste erwartet wird. Verwenden Sie ein Semikolon, um mehrere Elementlisten voneinander zu trennen. - - fuzzyMatch="101" wordcount="32" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Need to specify the project file name. - Specificare il nome di file del progetto. - UE: This message is shown when the user calls into the engine to build a project without specifying a filename. - - Geben Sie den Projektdateinamen an. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - end of input - fine input - This is the name of the "EndOfInput" token. It is displayed in quotes as the - unexpected char or token when the end of a conditional was unexpectedly reached. - - Ende der Eingabe - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - The previous error was converted to a warning because the task was called with ContinueOnError=true. - L'errore precedente è stato convertito in un avviso perché l'attività è stata chiamata con ContinueOnError=true. - - - Der vorherige Fehler wurde in eine Warnung umgewandelt, da die Aufgabe mit ContinueOnError=true aufgerufen wurde. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - {0} Error(s) - Errori: {0} - - - {0} Fehler - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4159: Error creating the toolset "{0}". {1} - MSB4159: errore durante la creazione del set di strumenti "{0}". {1} - {StrBegin="MSB4159: "} - - MSB4159: Fehler beim Erstellen des Toolsets "{0}". {1} - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4146: Cannot evaluate the property expression "{0}" found at "{1}". {2} - MSB4146: non è possibile valutare l'espressione di proprietà "{0}" trovata in "{1}". {2} - {StrBegin="MSB4146: "} - - MSB4146: Der bei "{1}" gefundene Eigenschaftsausdruck "{0}" kann nicht ausgewertet werden. {2} - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - The <{0}> tag is no longer supported as a child of the <Project> element. Place this tag within a target, and add the name of the target to the "InitialTargets" attribute of the <Project> element. - Il tag <{0}> non è più supportato come elemento figlio di <Project>. Inserire questo tag in una destinazione e aggiungere il nome della destinazione nell'attributo "InitialTargets" dell'elemento <Project>. - - - Das <{0}>-Tag nicht als untergeordnetes Element des < Project >-Elements unterstützt. Platzieren Sie dieses Tag in einem Ziel und fügen Sie den Namen des Ziels InitialTargets-Attribut des < Project >-Elements hinzu. - - fuzzyMatch="15" wordcount="38" adjWordcount="32.3" curWordcount="32.3" - - - MSB4100: Expected "{0}" to evaluate to a boolean instead of "{1}", in condition "{2}". - MSB4100: era previsto che "{0}" restituisse un valore booleano anziché "{1}", nella condizione "{2}". - {StrBegin="MSB4100: "} - - MSB4100: Das Ergebnis der Auswertung von {0} war {1}, es wurde jedoch ein boolescher Wert in der {2}-Bedingung erwartet. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4028: The "{0}" task's outputs could not be retrieved from the "{1}" parameter. {2} - MSB4028: non è stato possibile recuperare gli output dell'attività "{0}" dal parametro "{1}". {2} - {StrBegin="MSB4028: "} - - MSB4028: Die Ausgaben der {0}-Aufgabe konnten nicht aus dem {1}-Parameter abgerufen werden. {2} - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4014: The build was aborted because of an internal failure. - MSB4014: errore interno. Compilazione annullata. - {StrBegin="MSB4014: "}UE: This message is shown when an unhandled exception terminates the build. The cause is most likely a programming - error in the build engine. - - MSB4014: Das Erstellen wurde aufgrund eines internen Fehlers abgebrochen. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4015: The build was aborted because the "{0}" logger failed unexpectedly during shutdown. - MSB4015: errore imprevisto del logger "{0}" durante la chiusura. Compilazione annullata. - {StrBegin="MSB4015: "}UE: This message is used for a special exception that is thrown when a logger fails while shutting down (most likely - because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a special - exception to abort the build. - - MSB4015: Das Erstellen wurde abgebrochen, da für die {0}-Protokollierung beim Herunterfahren ein unerwarteter Fehler aufgetreten ist. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4016: The build was aborted because the "{0}" logger failed unexpectedly during initialization. - MSB4016: errore imprevisto del logger "{0}" durante l'inizializzazione. Compilazione annullata. - {StrBegin="MSB4016: "}UE: This message is used for a special exception that is thrown when a logger fails while initializing itself (most - likely because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a - special exception to abort the build. - - MSB4016: Das Erstellen wurde abgebrochen, da für die {0}-Protokollierung bei der Initialisierung ein unerwarteter Fehler aufgetreten ist. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4017: The build was aborted because of an unexpected logger failure. - MSB4017: la compilazione è stata annullata a causa di un errore imprevisto del logger. - {StrBegin="MSB4017: "}UE: This message is used for a special exception that is thrown when a logger fails while logging an event (most - likely because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a - special exception to abort the build. - - MSB4017: Das Erstellen wurde wegen eines unerwarteten Protokollierungsfehlers abgebrochen. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4018: The "{0}" task failed unexpectedly. - MSB4018: errore imprevisto dell'attività "{0}". - {StrBegin="MSB4018: "}UE: This message is shown when a task terminates because of an unhandled exception. The cause is most likely a - programming error in the task; however, it is also possible that the unhandled exception originated in the engine, and was - surfaced through the task when the task called into the engine. - - MSB4018: Unerwarteter Fehler bei der {0}-Aufgabe. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4165: Failed to receive a response from the child node "{0}" in the timeout period "{1}" ms. Shutting down. - MSB4165: non è stato possibile ricevere una risposta dal nodo figlio "{0}" entro il periodo di timeout di "{1}" ms. Chiusura in corso. - {StrBegin="MSB4165: "} - - MSB4165: Vom untergeordneten Knoten "{0}" wurde innerhalb des Zeitlimits von "{1}" ms keine Antwort empfangen. Herunterfahren. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4088: Condition "{0}" is improperly constructed. - MSB4088: condizione "{0}" non costruita correttamente. - {StrBegin="MSB4088: "} - - MSB4088: Die {0}-Bedingung ist falsch konstruiert. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4105: Found an unexpected character '{2}' at position {1} in condition "{0}". Did you intend to use "=="? - MSB4105: è stato trovato un carattere imprevisto '{2}' nella posizione {1} nella condizione "{0}". Si intendeva usare "=="? - {StrBegin="MSB4105: "} - - MSB4105: Ein unerwartetes Zeichen {2} wurde an Position {1} in der {0}-Bedingung gefunden. Wollten Sie "==" verwenden? - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - MSB4106: Expected an item list at position {1} in condition "{0}". Did you forget the closing parenthesis? - MSB4106: è previsto un elenco di elementi nella posizione {1} nella condizione "{0}". Si è omessa la parentesi di chiusura? - {StrBegin="MSB4106: "} - - MSB4106: Eine Elementliste wurde an Position {1} in Bedingung {0} erwartet. Haben Sie die schließende Klammer vergessen? - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - MSB4107: Expected an item list at position {1} in condition "{0}". Did you forget the opening parenthesis after the '@'? To use a literal '@', use '%40' instead. - MSB4107: è previsto un elenco di elementi nella posizione {1} nella condizione "{0}". Si è omessa la parentesi di chiusura dopo '@'? Per usare un valore letterale '@', specificare '%40'. - {StrBegin="MSB4107: "} - - MSB4107: Eine Elementliste wurde an Position {1} in Bedingung {0} erwartet. Haben Sie die öffnende Klammer hinter dem Zeichen "@" vergessen? Wenn Sie ein literales "@" verwenden möchten, geben Sie "%40" ein. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4108: Expected an item list at position {1} in condition "{0}". Did you forget to close a quote inside the item list expression? - MSB4108: è previsto un elenco di elementi nella posizione {1} nella condizione "{0}". Si è omessa una virgoletta di chiusura nell'espressione dell'elenco di elementi? - {StrBegin="MSB4108: "} - - MSB4108: Eine Elementliste wurde an Position {1} in Bedingung {0} erwartet. Haben Sie das schließende Anführungszeichen innerhalb des Elementlistenausdrucks vergessen? - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - MSB4109: Expected a property at position {1} in condition "{0}". Did you forget the closing parenthesis? - MSB4109: è prevista una proprietà nella posizione {1} nella condizione "{0}". Si è omessa la parentesi di chiusura? - {StrBegin="MSB4109: "} - - MSB4109: Eine Eigenschaft wurde an Position {1} in Bedingung {0} erwartet. Haben Sie die schließende Klammer vergessen? - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB4110: Expected a property at position {1} in condition "{0}". Did you forget the opening parenthesis after the '$'? To use a literal '$', use '%24' instead. - MSB4110: è prevista una proprietà nella posizione {1} nella condizione "{0}". Si è omessa la parentesi di apertura dopo il simbolo '$'? Per usare un valore letterale '$', specificare '%24'. - {StrBegin="MSB4110: "} - - MSB4110: Eine Eigenschaft wurde an Position {1} in Bedingung {0} erwartet. Haben Sie die öffnende Klammer hinter dem Zeichen "$" vergessen? Wenn Sie eine literales "$" verwenden möchten, geben Sie "%24" ein. - - fuzzyMatch="101" wordcount="27" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4101: Expected a closing quote after position {1} in condition "{0}". - MSB4101: è prevista una virgoletta di chiusura dopo la posizione {1} nella condizione "{0}". - {StrBegin="MSB4101: "} - - MSB4101: Es wurde ein schließendes Anführungszeichen hinter Position {1} in Bedingung {0} erwartet. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4019: The imported project "{0}" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. - MSB4019: progetto importato "{0}" non trovato. Verificare che il percorso nella dichiarazione <Import> sia corretto e che il file sia presente sul disco. - {StrBegin="MSB4019: "}LOCALIZATION: <Import> should not be localized. - - MSB4019: Das importierte Projekt "{0}" wurde nicht gefunden. Bestätigen Sie den Pfad in der Deklaration < Import > und die Datei auf dem Datenträger vorhanden ist. - - fuzzyMatch="15" wordcount="26" adjWordcount="22.1" curWordcount="22.1" - - - MSB4089: Incorrect number of arguments to function in condition "{0}". Found {1} argument(s) when expecting {2}. - MSB4089: il numero di argomenti non è corretto per la funzione nella condizione "{0}". Sono stati trovati {1} argomenti ma ne sono previsti {2}. - {StrBegin="MSB4089: "} - - MSB4089: Falsche Anzahl von Argumenten für eine Funktion in der Bedingung "{0}". {1} Argument(e) gefunden, obwohl {2} erwartet wurde(n). - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - The "{0}" object specified does not belong to the correct "{1}" object. - L'oggetto "{0}" specificato non appartiene all'oggetto "{1}" corretto. - - - Das angegebene {0}-Objekt gehört nicht zum korrekten {1}-Objekt. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4020: The value "{0}" of the "{1}" attribute in element <{2}> is invalid. - MSB4020: il valore "{0}" dell'attributo "{1}" nell'elemento <{2}> non è valido. - {StrBegin="MSB4020: "}UE: This is a generic message that is displayed when we find a project element with an incorrect value for one of its - attributes e.g. <Import Project=""> -- the value of Project should not be an empty string. - - MSB4020: Der Wert "{0}" von der "{1}" Attribut im Element <{2}> ist ungültig. - - fuzzyMatch="15" wordcount="14" adjWordcount="11.9" curWordcount="11.9" - - - MSB4102: The value "{0}" of the "{1}" attribute in element <{2}> is invalid. {3} - MSB4102: il valore "{0}" dell'attributo "{1}" nell'elemento <{2}> non è valido. {3} - {StrBegin="MSB4102: "}UE: This is a generic message that is displayed when we find a project element with an incorrect value for one of its - attributes. At the end of the message we show the exception text we got trying to use the value. - - MSB4102: Der Wert "{0}" von der "{1}" Attribut im Element <{2}> ist ungültig. {3} - - fuzzyMatch="15" wordcount="15" adjWordcount="12.75" curWordcount="12.75" - - - MSB4021: The "ContinueOnError" attribute of the "{0}" task is not valid. {1} - MSB4021: l'attributo "ContinueOnError" dell'attività "{0}" non è valido. {1} - {StrBegin="MSB4021: "}LOCALIZATION: "ContinueOnError" should not be localized. "{1}" is a message from another exception explaining the problem. - - MSB4021: Das ContinueOnError-Attribut für die {0}-Aufgabe ist ungültig. {1} - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4139: Invalid value for default ToolsVersion is specified in registry key "{0}". - MSB4139: la chiave del Registro di sistema "{0}" contiene un valore non valido per il parametro ToolsVersion predefinito. - {StrBegin="MSB4139: "} - - MSB4139: Im Registrierungsschlüssel "{0}" ist ein ungültiger Wert für die Standard-ToolsVersion angegeben. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4022: The result "{0}" of evaluating the value "{1}" of the "{2}" attribute in element <{3}> is not valid. - MSB4022: il risultato "{0}" della valutazione del valore "{1}" dell'attributo "{2}" nell'elemento <{3}> non è valido. - {StrBegin="MSB4022: "}UE: This message is shown when the engine is checking the correctness of the value (after evaluating embedded - properties/items) assigned to an XML attribute of an XML element in the project file. - - MSB4022: Das Ergebnis "{0}"der Auswertung des Werts"{1}" von der "{2}" Attribut im Element <{3}> ist ungültig. - - fuzzyMatch="15" wordcount="20" adjWordcount="17" curWordcount="17" - - - "{0}" is not a valid event category. To raise a custom event, use the "{1}" category. - "{0}" non è una categoria di eventi valida. Per generare un evento personalizzato, usare la categoria "{1}". - - - {0} ist keine gültige Ereigniskategorie. Verwenden Sie die {1}-Kategorie, um ein benutzerdefiniertes Ereignis auszulösen. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - "{0}" is not a valid importance level for events. - "{0}" non è un livello di importanza valido per gli eventi. - - - {0} ist kein gültiger Wert für die Bedeutung eines Ereignisses. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4104: Failed to write to log file "{0}". {1} - MSB4104: non è stato possibile scrivere nel file di log "{0}". {1} - {StrBegin="MSB4104: "}UE: This is shown when the File Logger can't create or write to the file it was instructed to log to. - - MSB4104: Fehler beim Schreiben in die Protokollierungsdatei "{0}". {1} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4024: The imported project file could not be loaded. {0} - MSB4024: non è stato possibile caricare il file di progetto importato. {0} - {StrBegin="MSB4024: "}UE: This message is shown when an imported project file cannot be loaded because of incorrect XML. The project - filename is not part of the message because it is provided separately to loggers. - LOCALIZATION: {0} is a localized message from the CLR/FX explaining why the project is invalid. - - MSB4024: Die importierte Projektdatei konnte nicht geladen werden. {0} - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - Operation invalid for a persisted item group. - Operazione non valida per un gruppo di elementi persistente. - - - Ungültiger Vorgang für eine persistente Elementgruppe. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Operation invalid for a virtual item group. - Operazione non valida per un gruppo di elementi virtuale. - - - Ungültiger Vorgang für eine virtuelle Elementgruppe. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4071: The value Importance="{0}" in the <Message> element is invalid. Valid values are: High, Normal and Low. - MSB4071: il valore Importance="{0}" nell'elemento <Message> non è valido. I valori validi sono High, Normal e Low. - {StrBegin="MSB4071: "}UE: This message is shown when a user specifies a value for the importance attribute of Message which is not valid. - The importance enumeration is: High, Normal and Low. Specifying any other importance will result in this message being shown - LOCALIZATION: "Importance" should not be localized. - "Message" should not be localized. - High should not be localized. - Normal should not be localized. - Low should not be localized. - - MSB4071: Der Wert Importance = "{0}" in < Nachricht > Element ist ungültig. Gültige Werte sind: hoch, Normal und niedrig. - - fuzzyMatch="15" wordcount="18" adjWordcount="15.3" curWordcount="15.3" - - - MSB4025: The project file could not be loaded. {0} - MSB4025: non è stato possibile caricare il file di progetto. {0} - {StrBegin="MSB4025: "}UE: This message is shown when the project file given to the engine cannot be loaded because the filename/path is - invalid, or due to lack of permissions, or incorrect XML. The project filename is not part of the message because it is - provided separately to loggers. - LOCALIZATION: {0} is a localized message from the CLR/FX explaining why the project is invalid. - - MSB4025: Die Projektdatei konnte nicht geladen werden. {0} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4147: The property "{0}" at "{1}" is invalid. {2} - MSB4147: la proprietà "{0}" in "{1}" non è valida. {2} - {StrBegin="MSB4147: "} - - MSB4147: Die {0}-Eigenschaft bei "{1}" ist ungültig. {2} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - "{0}" is an invalid "ProjectFileEncoding" value. - "{0}" è un valore "ProjectFileEncoding" non valido. - LOCALIZATION: "ProjectFileEncoding" should not be localized. - - {0} ist ein ungültiger ProjectFileEncoding-Wert. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4143: The expression "{0}" cannot be evaluated. {1} - MSB4143: non è possibile valutare l'espressione "{0}". {1} - {StrBegin="MSB4143: "} - UE: This message is shown when the user attempts to provide an expression like "$(Registry:HKEY_LOCAL_MACHINE\Software\Vendor\Tools@TaskLocation)" - LOCALIZATION: "{0}" is the expression that was bad. "{1}" is a message from an FX exception that describes why the expression is bad. - - - MSB4143: Der Ausdruck "{0}" kann nicht ausgewertet werden. {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4184: The expression "{0}" cannot be evaluated. {1} - MSB4184: non è possibile valutare l'espressione "{0}". {1} - {StrBegin="MSB4184: "} - Single quotes as the expression will typically have double quotes in it. - UE: This message is shown when the user attempts to provide an expression like "$(SomeProperty.ToLower())" - LOCALIZATION: "{0}" is the expression that was bad. "{1}" is a message from an FX exception that describes why the expression is bad. - - - MSB4184: Der Ausdruck "{0}" kann nicht ausgewertet werden. {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4185: The function "{0}" on type "{1}" has not been enabled for execution. - MSB4185: la funzione "{0}" nel tipo "{1}" non è stata abilitata per l'esecuzione. - {StrBegin="MSB4185: "} - UE: This message is shown when the user attempts to provide an expression like "$([System.DateTime]::Now)", but the expression has not been enabled - LOCALIZATION: "{0}" is the static function name, "{1}" is the .NET Framework type name - - - MSB4185: Die {0}-Funktion für den {1}-Typ wurde nicht für die Ausführung aktiviert. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4186: Invalid static method invocation syntax: "{0}". Static method invocation should be of the form: $([FullTypeName]::Method()), e.g. $([System.IO.Path]::Combine(`a`, `b`)) - MSB4186: sintassi della chiamata al metodo statico non valida: "{0}". Il formato della chiamata al metodo statico deve essere il seguente: $([FullTypeName]::Method()), ad esempio $([System.IO.Path]::Combine(`a`, `b`)) - {StrBegin="MSB4186: "} - UE: This message is shown when the user attempts to call a static method on a type, but has used the incorrect syntax - LOCALIZATION: "{0}" is the function expression which is in error - - - MSB4186: Ungültige Aufrufsyntax für statische Methode: "{0}". Für den Aufruf statischer Methoden muss folgendes Format verwendet werden: $([vollständiger Typname]::Methode()), z. B. $([System.IO.Path]::Combine(`a`, `b`)) - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4070: The schema "{0}" is not valid. {1} - MSB4070: lo schema "{0}" non è valido. {1} - {StrBegin="MSB4070: "}UE: This message is shown when the schema file provided for the validation of a project is itself not valid. - LOCALIZATION: "{0}" is the schema file path. "{1}" is a message from an FX exception that describes why the schema file is bad. - - MSB4070: Das Schema "{0}" ist nicht gültig. {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4026: The "{0}={1}" parameter for the "{2}" task is invalid. - MSB4026: parametro "{0}={1}" per l'attività "{2}" non valido. - {StrBegin="MSB4026: "}UE: This message is displayed when a task has an invalid parameter that cannot be initialized. - - MSB4026: Der {0}={1}-Parameter für die {2}-Aufgabe ist ungültig. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4027: The "{0}" task generated invalid items from the "{1}" output parameter. {2} - MSB4027: l'attività "{0}" ha generato elementi non validi dal parametro di output "{1}". {2} - {StrBegin="MSB4027: "} - - MSB4027: Die {0}-Aufgabe generierte ungültige Elemente aus dem {1}-Ausgabeparameter. {2} - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4029: The "{0}" task has an invalid output specification. The "TaskParameter" attribute is required, and either the "ItemName" or "PropertyName" attribute must be specified (but not both). - MSB4029: la specifica dell'output dell'attività "{0}" non è valida. L'attributo "TaskParameter" è obbligatorio ed è necessario specificare l'attributo "ItemName" o "PropertyName", ma non entrambi. - {StrBegin="MSB4029: "}LOCALIZATION: "TaskParameter", "ItemName" and "PropertyName" should not be localized. - - MSB4029: Die {0}-Aufgabe enthält eine ungültige Ausgabespezifikation. Das TaskParameter-Attribut ist erforderlich, und es muss entweder das ItemName- oder PropertyName-Attribut angegeben werden (jedoch nicht beide). - - fuzzyMatch="101" wordcount="27" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4030: "{0}" is an invalid value for the "{1}" parameter of the "{3}" task. The "{1}" parameter is of type "{2}". - MSB4030: "{0}" non è un valore valido per il parametro "{1}" dell'attività "{3}". Il parametro "{1}" è di tipo "{2}". - {StrBegin="MSB4030: "}UE: This error is shown when a type mis-match occurs between the value assigned to task parameter in the project file - and the type of the .NET property that corresponds to the task parameter. For example, if an int task parameter called "Count" - is assigned the value "x", this error would be displayed: <MyTask Count="x" /> - - MSB4030: "{0}" ist ein ungültiger Wert für den {1}-Parameter der {3}-Aufgabe. Der {1}-Parameter ist vom Typ "{2}". - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - MSB4137: Invalid value specified in the configuration file at "{0}". Property name or tools version name is an empty string. - MSB4137: è stato specificato un valore non valido nel file di configurazione in "{0}". Il nome della proprietà o il nome della versione degli strumenti è una stringa vuota. - {StrBegin="MSB4137: "} - - MSB4137: In der Konfigurationsdatei ist bei "{0}" ein ungültiger Wert angegeben. Der Eigenschaftenname oder der Toolsversionname ist eine leere Zeichenfolge. - - fuzzyMatch="100" wordcount="20" adjWordcount="5" curWordcount="5" tmLabel="N''" - - - MSB4103: "{0}" is not a valid logger verbosity level. - MSB4103: "{0}" non è un livello di dettaglio valido del logger. - {StrBegin="MSB4103: "} - - MSB4103: "{0}" ist kein gültiger Ausführlichkeitsgrad für die Protokollierung. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4163: <ItemDefinitionGroup> is not allowed inside a target. - MSB4163: <ItemDefinitionGroup> non consentito all'interno di una destinazione. - {StrBegin="MSB4163: "} - - MSB4163: < ItemDefinitionGroup > ist in einem Ziel nicht zulässig. - - fuzzyMatch="15" wordcount="9" adjWordcount="7.65" curWordcount="7.65" - - - The specified item does not belong to the current item group. - L'articolo specificato non appartiene al gruppo di elementi corrente. - - - Das angegebene Element gehört nicht zu der aktuellen Elementgruppe. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4096: The item "{0}" in item list "{1}" does not define a value for metadata "{2}". In order to use this metadata, either qualify it by specifying %({1}.{2}), or ensure that all items in this list define a value for this metadata. - MSB4096: l'elemento "{0}" nell'elenco di elementi "{1}" non definisce un valore per i metadati "{2}". Per poter usare questi metadati, qualificarli specificando %({1}.{2}) o assicurarsi che tutti gli elementi dell'elenco definiscano un valore per questi metadati. - {StrBegin="MSB4096: "} - - MSB4096: Das Element "{0}" in der Elementliste "{1}" definiert keinen Wert für die {2}-Metadaten. Wenn Sie diese Metadaten verwenden möchten, qualifizieren Sie sie, indem Sie %({1}.{2}) angeben, oder vergewissern Sie sich, dass alle Elemente in der Liste einen Wert für diese Metadaten definieren. - - fuzzyMatch="101" wordcount="42" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4099: A reference to an item list at position {1} is not allowed in this condition "{0}". - MSB4099: non è consentito un riferimento a un elenco di elementi nella posizione {1} in questa condizione "{0}". - {StrBegin="MSB4099: "} - - MSB4099: Ein Verweis auf eine Elementliste an Position {1} ist in dieser {0}-Bedingung nicht zulässig. - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - MSB4033: "{0}" is a reserved item metadata, and cannot be redefined as a custom metadata on the item. - MSB4033: "{0}" sono metadati di elemento riservati e non possono essere ridefiniti come metadati personalizzati per l'elemento. - {StrBegin="MSB4033: "} - - MSB4033: "{0}" sind reservierte Elementmetadaten und können nicht als benutzerdefinierte Metadaten für das Element neu definiert werden. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - An InternalLoggerException can only be thrown by the MSBuild engine. The public constructors of this class cannot be used to create an instance of the exception. - InternalLoggerException può essere generato solo dal motore di MSBuild. I costruttori pubblici di questa classe non possono essere usati per creare un'istanza dell'eccezione. - UE: This message is shown when a user tries to instantiate a special exception called InternalLoggerException through the OM -- - only the engine is allowed to create and throw this exception. - LOCALIZATION: "InternalLoggerException" and "MSBuild" should not be localized. - - Eine InternalLoggerException kann nur durch das MSBuild-Modul ausgelöst werden. Die öffentlichen Konstruktoren dieser Klasse können nicht verwendet werden, um eine Instanz der Ausnahme zu erstellen. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Initial Items: - Elementi iniziali: - - - Ursprüngliche Elemente: - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4083: Expected a Condition attribute on element "{0}". - MSB4083: è previsto un attributo Condition per l'elemento "{0}". - {StrBegin="MSB4083: "} - - MSB4083: Es wurde ein Bedingungsattribut für das {0}-Element erwartet. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4164: The value "{0}" of metadata "{1}" contains an item list expression. Item list expressions are not allowed on default metadata values. - MSB4164: il valore "{0}" dei metadati "{1}" contiene un'espressione dell'elenco di elementi. Le espressioni dell'elenco di elementi non sono consentite per i valori dei metadati predefiniti. - {StrBegin="MSB4164: "} - - MSB4164: Der Wert "{0}" der {1}-Metadaten enthält einen Elementlistenausdruck. Elementlistenausdrücke sind nicht als Standardwerte für Metadaten zulässig. - - fuzzyMatch="100" wordcount="22" adjWordcount="5.5" curWordcount="5.5" tmLabel="N''" - - - MSBuild is expecting a valid "{0}" object. - MSBuild prevede un oggetto "{0}" valido. - - - MSBuild erwartet ein gültiges {0}-Objekt. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4035: The required attribute "{0}" is missing from element <{1}>. - MSB4035: l'attributo obbligatorio "{0}" non è presente nell'elemento <{1}>. - {StrBegin="MSB4035: "}UE: This message is shown when a user leaves off a required attribute from a project element - e.g. <UsingTask AssemblyName="foo"> -- this is missing the "TaskName" attribute. - - MSB4035: Das erforderliche Attribut "{0}"-Element fehlt <{1}>. - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB4036: The "{0}" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "{1}" directory. - MSB4036: attività "{0}" non trovata. Verificare quanto segue: 1.) Il nome dell'attività nel file di progetto corrisponde al nome della classe dell'attività. 2.) La classe dell'attività è "public" e implementa l'interfaccia Microsoft.Build.Framework.ITask. 3.) L'attività è stata dichiarata correttamente con <UsingTask> nel file di progetto o nei file *.tasks presenti nella directory "{1}". - {StrBegin="MSB4036: "}LOCALIZATION: <UsingTask> and "*.tasks" should not be localized. - - MSB4036: Die "{0}" Task wurde nicht gefunden. Überprüfen Sie Folgendes: 1.) der Name der Aufgabe in der Projektdatei entspricht dem Namen der Aufgabenklasse. 2) die Aufgabenklasse ist "public" und implementiert die Microsoft.Build.Framework.ITask-Schnittstelle. 3) die Aufgabe korrekt mit < UsingTask > deklariert, in der Projektdatei oder in den Tasks-Dateien der "{1}" Verzeichnis. - - fuzzyMatch="15" wordcount="64" adjWordcount="54.4" curWordcount="54.4" - - - MSB4141: MSBuildToolsPath is not specified for the ToolsVersion "{0}" defined at "{1}", or the value specified evaluates to the empty string. - MSB4141: il valore MSBuildToolsPath non è specificato per il parametro ToolsVersion "{0}" definito in "{1}" o restituisce una stringa vuota. - {StrBegin="MSB4141: "} - - MSB4141: MSBuildToolsPath ist für die bei "{1}" definierte ToolsVersion {0} nicht angegeben, oder der angegebene Wert wird zu einer leeren Zeichenfolge ausgewertet. - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - MSB4031: The "MSBuildVersion" attribute is deprecated. If the project is authored in the MSBuild 2003 format, please remove the attribute from the <Project> tag. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format. - MSB4031: l'attributo "MSBuildVersion" è deprecato. Se il progetto viene modificato in formato MSBuild 2003, rimuovere l'attributo dal tag <Project>. Se il progetto è stato modificato nel formato precedente 1.0 o 1.2, convertirlo nel formato MSBuild 2003. - {StrBegin="MSB4031: "}UE: This message is shown for projects that still contain the "MSBuildVersion" attribute in their <Project> - tag. We no longer need this attribute because the project's XML namespace (i.e. the "xmlns" attribute) gives us all the - version information we need. - LOCALIZATION: "MSBuild", "MSBuildVersion" and <Project> should not be localized. - - MSB4031: Das Attribut "MSBuildVersion" ist veraltet. Wenn das Projekt im Format MSBuild 2003 erstellt wurde, entfernen Sie das Attribut aus dem Tag < Project >. Wenn das Projekt im alten Format 1.0 oder 1.2 erstellt wurde, konvertieren Sie es in das MSBuild 2003-Format. - - fuzzyMatch="15" wordcount="45" adjWordcount="38.25" curWordcount="38.25" - - - MSB4144: Multiple definitions were found for the toolset "{0}". - MSB4144: trovate più definizioni per il set di strumenti "{0}". - {StrBegin="MSB4144: "} - - MSB4144: Für das Toolset wurden mehrere Definitionen gefunden "{0}". - - fuzzyMatch="15" wordcount="9" adjWordcount="7.65" curWordcount="7.65" - - - MSB4145: Multiple definitions were found for the property "{0}". - MSB4145: trovate più definizioni per la proprietà "{0}". - {StrBegin="MSB4145: "} - - MSB4145: Für die {0}-Eigenschaft wurden mehrere Definitionen gefunden. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4082: Choose has more than one <Otherwise> element. - MSB4082: Choose contiene più elementi <Otherwise>. - {StrBegin="MSB4082: "} - - MSB4082: Wählen Sie mehrere < Otherwise >-Element enthält. - - fuzzyMatch="15" wordcount="9" adjWordcount="7.65" curWordcount="7.65" - - - This method is only valid for persisted <{0}> elements. - Questo metodo è valido solo per elementi <{0}> persistenti. - - - Diese Methode ist nur gültig für beibehalten <{0}> Elemente. - - fuzzyMatch="15" wordcount="10" adjWordcount="8.5" curWordcount="8.5" - - - This method is only valid for virtual property groups, not <{0}> elements. - Questo metodo è valido solo per gruppi di proprietà virtuali e non per elementi <{0}>. - - - Diese Methode gilt nur für virtuelle Eigenschaftengruppen nicht <{0}> Elemente. - - fuzzyMatch="15" wordcount="13" adjWordcount="11.05" curWordcount="11.05" - - - MSB4038: The element <{0}> must be last under element <{1}>. Found element <{2}> instead. - MSB4038: l'elemento <{0}> deve essere l'ultimo sotto l'elemento <{1}>. È stato invece trovato l'elemento <{2}>. - {StrBegin="MSB4038: "} - - MSB4038: Das Element <{0}> muss unter Element <{1}>. Element wurde gefunden <{2}> statt. - - fuzzyMatch="15" wordcount="17" adjWordcount="14.45" curWordcount="14.45" - - - MSB4138: Non-string data was specified at the registry location "{0}". - MSB4138: dati non di tipo stringa specificati nel percorso del Registro di sistema "{0}". - {StrBegin="MSB4138: "} - - MSB4138: Am Registrierungsspeicherort "{0}" wurden Daten angegeben, die keine Zeichenfolge sind. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4039: No "{0}" element was found in the project file. - MSB4039: nessun elemento "{0}" nel file di progetto. - {StrBegin="MSB4039: "} - - MSB4039: Das {0}-Element wurde in der Projektdatei nicht gefunden. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4040: There is no target in the project. - MSB4040: nessuna destinazione nel progetto. - {StrBegin="MSB4040: "} - - MSB4040: Das Projekt enthält kein Ziel. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Removing the "{0}" attribute of an item is not allowed. - Rimozione dell'attributo "{0}" di un elemento non consentita. - - - Das Löschen des {0}-Attributs eines Elements ist nicht zulässig. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - The object passed in is not part of the project. - L'oggetto passato non fa parte del progetto. - - - Das übergebene Objekt ist nicht Teil des Projekts. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - Overriding target "{0}" in project "{1}" with target "{2}" from project "{3}". - Override della destinazione "{0}" nel progetto "{1}" con la destinazione "{2}" del progetto "{3}". - - - Das Ziel "{0}" im Projekt "{1}" wird durch das Ziel "{2}" aus dem Projekt "{3}" außer Kraft gesetzt. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4167: The parent process unexpectedly exited. Shutting down child node "{0}". - MSB4167: processo padre interrotto in modo anomalo. Chiusura del nodo figlio "{0}" in corso. - {StrBegin="MSB4167: "} - - MSB4167: Der übergeordnete Prozess wurde unerwartet beendet. Der untergeordnete Knoten "{0}" wird heruntergefahren. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - {0} ms {1} {2} calls - {0} ms {1} {2} chiamate - - - {0} ms {1} {2} Aufrufe - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - (* = timing was not recorded because of reentrancy) - (* = l'intervallo non è stato registrato a causa della reentrancy) - - - (* = Zeit wurde aufgrund des erneuten Eintretens nicht aufgezeichnet) - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - This project object has been unloaded from the MSBuild engine and is no longer valid. - Questo progetto è stato scaricato dal motore di MSBuild è non è più valido. - - - Dieses Projektobjekt wurde aus dem MSBuild-Modul entladen und ist nicht mehr gültig. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - The project file "{0}" was not found. - Il file di progetto "{0}" non è stato trovato. - UE: This message is shown when the user calls into the OM to build a project that doesn't exist on disk. - - Die Projektdatei "{0}" wurde nicht gefunden. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Done building project "{0}" -- FAILED. - Compilazione progetto "{0}" NON COMPLETATA. - - - Die Erstellung des Projekts "{0}" ist abgeschlossen – FEHLER. - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Done building project "{0}". - Compilazione progetto "{0}" completata. - - - Die Erstellung des Projekts "{0}" ist abgeschlossen. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - MSB4041: The default XML namespace of the project must be the MSBuild XML namespace. If the project is authored in the MSBuild 2003 format, please add xmlns="{0}" to the <Project> element. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format. - MSB4041: lo spazio dei nomi XML predefinito del progetto deve essere lo spazio dei nomi XML di MSBuild. Se il progetto viene modificato nel formato MSBuild 2003, aggiungere xmlns="{0}" all'elemento <Project>. Se il progetto è stato modificato nel formato precedente 1.0 o 1.2, convertilo al formato MSBuild 2003. - {StrBegin="MSB4041: "}UE: This is a Beta 1 message only. - LOCALIZATION: <Project>, "MSBuild" and "xmlns" should not be localized. - - MSB4041: Der XML-Standardnamespace des Projekts muss MSBuild XML-Namespace. Wenn das Projekt im Format MSBuild 2003 erstellt wurde, fügen Sie Xmlns = "{0}" < Project >-Element. Wenn das Projekt im alten Format 1.0 oder 1.2 erstellt wurde, konvertieren Sie es in das MSBuild 2003-Format. - - fuzzyMatch="15" wordcount="52" adjWordcount="44.2" curWordcount="44.2" - - - Project Performance Summary: - Riepilogo prestazioni progetto: - - - Leistungszusammenfassung für das Projekt: - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - MSB4042: Stopping because of syntax errors in project file. - MSB4042: arresto a causa di errori di sintassi nel file di progetto. - {StrBegin="MSB4042: "} - - MSB4042: Prozess aufgrund von Syntaxfehlern in der Projektdatei angehalten. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - Project "{0}" is building "{1}" ({2} target(s)): - Compilazione di "{1}" dal progetto "{0}" (destinazioni: {2}): - - - Das Projekt {0} erstellt {1} ({2} Ziel(e)): - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Project "{0}" is building "{1}" (default targets): - Compilazione di "{1}" dal progetto "{0}" (destinazioni predefinite): - - - Das Projekt "{0}" erstellt "{1}" (Standardziele): - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Project "{0}" ({1} target(s)): - Progetto "{0}" (destinazioni: {1}): - - - Projekt "{0}", {1} Ziel(e): - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - Project "{0}" (default targets): - Progetto "{0}" (destinazioni predefinite): - - - Projekt "{0}" (Standardziele): - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - Done Building Project "{0}" ({1} target(s)). - Compilazione progetto "{0}" (destinazioni: {1}) completata. - - - Die Erstellung von Projekt "{0}" ist abgeschlossen ({1} Ziel(e)). - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Done Building Project "{0}" (default targets). - Compilazione progetto "{0}" (destinazioni predefinite) completata. - - - Die Erstellung von Projekt "{0}" ist abgeschlossen (Standardziele). - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Done Building Project "{0}" ({1} target(s)) -- FAILED. - Compilazione progetto "{0}" (destinazioni: {1}) NON RIUSCITA. - - - Die Erstellung des Projekts "{0}" ist abgeschlossen, {1} Ziel(e) -- FEHLER. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Done Building Project "{0}" (default targets) -- FAILED. - Compilazione progetto "{0}" (destinazioni predefinite) NON COMPLETATA. - - - Die Erstellung von Projekt "{0}" ist abgeschlossen (Standardziele) -- FEHLER. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4075: The project file must be opened in the Visual Studio IDE and converted to the latest version before it can be built by MSBuild. - MSB4075: prima di compilare il file di progetto con MSBuild, è necessario aprirlo in Visual Studio IDE e convertirlo alla versione più recente. - {StrBegin="MSB4075: "} - - MSB4075: Die Projektdatei muss in der Visual Studio IDE geöffnet und in ein aktuelles Versionsformat gebracht werden, bevor sie mit MSBuild erstellt werden kann. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4192: The project file "{0}" is in the ".vcproj" file format, which MSBuild no longer supports. Please convert the project by opening it in the Visual Studio IDE or running the conversion tool, or use MSBuild 3.5 or earlier to build it. - MSB4192: il file di progetto "{0}" è in formato ".vcproj", che non è più supportato in MSBuild. Per convertire il progetto, aprirlo in Visual Studio IDE o eseguire lo strumento di conversione oppure compilarlo con MSBuild 3.5 o versione successiva. - {StrBegin="MSB4192: "} LOC: ".vcproj" should not be localized - - MSB4192: Die Projektdatei "{0}" ist im VSPROJ-Dateiformat gespeichert, das nicht mehr von MSBuild unterstützt wird. Konvertieren Sie das Projekt, indem Sie es in der Visual Studio IDE öffnen oder das Konvertierungstool ausführen, oder verwenden Sie MSBuild 3.5 oder früher zum Erstellen des Projekts. - - fuzzyMatch="101" wordcount="42" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - The specified property does not belong to the current property group. - La proprietà specificata non appartiene al gruppo di proprietà corrente. - - - Die angegebene Eigenschaft gehört nicht zu der aktuellen Eigenschaftengruppe. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - Initial Properties: - Proprietà iniziali: - - - Ursprüngliche Eigenschaften: - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4148: The name of a property stored under the registry key "{0}" has zero length. - MSB4148: il nome della proprietà memorizzato nella chiave del Registro di sistema "{0}" è di lunghezza zero. - {StrBegin="MSB4148: "} - - MSB4148: Der Name einer unter dem Registrierungsschlüssel "{0}" gespeicherten Eigenschaft hat eine Länge von Null. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - The property names in the indexer and the "{0}" object do not match. - I nomi delle proprietà nell'indicizzatore e nell'oggetto "{0}" non corrispondono. - - - Die Eigenschaftennamen im Indexer und das {0}-Objekt stimmen nicht überein. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4043: The item metadata reference "{0}" is invalid because it is qualified with an item name. Item metadata referenced in transforms do not need to be qualified, because the item name is automatically deduced from the items being transformed. Change "{0}" to "%({1})". - MSB4043: il riferimento "{0}" ai metadati dell'elemento non è valido. È qualificato con un nome di elemento. I metadati degli elementi a cui si fa riferimento nelle trasformazioni non devono essere qualificati. Il nome dell'elemento viene dedotto automaticamente dagli elementi trasformati. Modificare "{0}" in "%({1})". - {StrBegin="MSB4043: "}UE: This message is shown when the user does something like this: @(foo->'%(foo.metadata)'). There is no need to specify - "foo.metadata", because "foo" is automatically deduced. In corollary, "bar.metadata" is not allowed either, where "bar" is a different - item list type. - - MSB4043: Der Elementmetadatenverweis "{0}" ist ungültig, da er mit einem Elementnamen qualifiziert ist. Elementmetadaten, auf die bei Transformationen verwiesen wird, müssen nicht qualifiziert werden, da der Elementname automatisch aus den transformierten Elementen abgeleitet wird. Ändern Sie "{0}" in "%({1})". - - fuzzyMatch="101" wordcount="43" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4135: Error reading the toolset information from the registry location "{0}". {1} - MSB4135: errore durante la lettura delle informazioni del set di strumenti dal percorso del Registro di sistema "{0}". {1} - {StrBegin="MSB4135: "} - - MSB4135: Fehler beim Lesen der Toolsetinformationen am Registrierungsspeicherort "{0}". {1} - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4044: The "{0}" task was not given a value for the required parameter "{1}". - MSB4044: all'attività "{0}" non è stato assegnato un valore per il parametro obbligatorio "{1}". - {StrBegin="MSB4044: "}UE: This message is shown when a task parameter designated as "required" is not set in the project file. - - MSB4044: Die {0}-Aufgabe hat keinen Wert für den erforderlichen {1}-Parameter erhalten. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - Validating project using schema file "{0}". - Convalida del progetto mediante il file di schema "{0}". - LOCALIZATION: "{0}" is the location of the schema file. - - Das Projekt wird anhand der Schemadatei "{0}" überprüft. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4045: Project is not valid. {0} - MSB4045: progetto non valido. {0} - {StrBegin="MSB4045: "}UE: This error is shown when the user asks his project to be validated against a schema (/val switch for - MSBuild.exe), and the project has errors. "{0}" contains a message explaining the problem. - LOCALIZATION: "{0}" is a message from the System.XML schema validator and is already localized. - - MSB4045: Ungültiges Projekt. {0} - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4112: The targets in this project have been disabled by the host and therefore cannot be built at this time. This may have been done for security reasons. To enable the targets, the host must set Project.BuildEnabled to "true". - MSB4112: le destinazioni di questo progetto sono state disabilitate dall'host e quindi non possono essere compilate. Questa scelta può essere dovuta a motivi di sicurezza. Per abilitare le destinazioni, l'host deve impostare Project.BuildEnabled su "true". - {StrBegin="MSB4112: "} - - MSB4112: Die Ziele in diesem Projekt wurden vom Host deaktiviert und können aus diesem Grund derzeit nicht erstellt werden. Die Deaktivierung wurde wahrscheinlich aus Sicherheitsgründen durchgeführt. Wenn Sie die Ziele aktivieren möchten, muss der Host Project.BuildEnabled auf "true" festlegen. - - fuzzyMatch="101" wordcount="39" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4093: The "{0}" parameter of the "{1}" task cannot be written to because it does not have a "set" accessor. - MSB4093: non è possibile scrivere il parametro "{0}" per l'attività "{1}" perché non è presente una funzione di accesso "set". - {StrBegin="MSB4093: "}UE: This error is shown when a project tries to assign a value to a task parameter that does not have a "set" - accessor on the corresponding .NET property on the task class. - - MSB4093: In den {0}-Parameter der {1}-Aufgabe kann nicht geschrieben werden, da er keinen set-Accessor besitzt. - - fuzzyMatch="100" wordcount="20" adjWordcount="5" curWordcount="5" tmLabel="N''" - - - A shallow clone of this object cannot be created. - Non è possibile creare un clone superficiale dei riferimenti di questo oggetto. - - - Ein unechter Klon dieses Objekts kann nicht erstellt werden. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - Skipping target "{0}" because it has no inputs. - La destinazione "{0}" verrà ignorata. Non sono presenti input. - - - Das {0}-Ziel wird übersprungen, da es keine Eingaben besitzt. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Though the target has declared its inputs, the input specification only references empty properties and/or empty item lists. - Per la destinazione sono dichiarati gli input, ma la specifica dell'input fa riferimento solo a proprietà vuote e/o elenchi di elementi vuoti. - - - Obwohl das Ziel seine Eingaben deklariert hat, verweist die Eingabespezifikation nur auf leere Eigenschaften und/oder leere Elementlisten. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - Skipping target "{0}" because it has no outputs. - La destinazione "{0}" verrà ignorata. Non è associata a output. - - - Das Ziel "{0}" wird übersprungen, da es keine Ausgaben enthält. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Though the target has declared its outputs, the output specification only references empty properties and/or empty item lists. - Per la destinazione sono dichiarati gli output, ma la specifica dell'output fa riferimento solo a proprietà vuote e/o elenchi di elementi vuoti. - - - Obwohl das Ziel seine Ausgaben deklariert hat, verweist die Ausgabespezifikation nur auf leere Eigenschaften und/oder leere Elementlisten. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - Skipping target "{0}" because all output files are up-to-date with respect to the input files. - La destinazione "{0}" verrà ignorata. Tutti i file di output sono aggiornati rispetto ai file di input. - - - Das Ziel "{0}" wird übersprungen, da alle Ausgabedateien hinsichtlich der Eingabedateien aktuell sind. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - Input files: {0} - File di input: {0} - {0} is a semicolon-separated list of filenames. - - Eingabedateien: {0} - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Output files: {0} - File di output: {0} - {0} is a semicolon-separated list of filenames. - - Ausgabedateien: {0} - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Building solution configuration "{0}". - Compilazione della configurazione di soluzione "{0}" in corso. - UE: This is not an error, so doesn't need an error code. - - Die Projektmappenkonfiguration "{0}" wird erstellt. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - Using solution cache file "{0}" for configuration "{1}" and tools version "{2}". - Verrà usato il file di cache "{0}" della soluzione per la configurazione "{1}" e la versione "{2}" degli strumenti. - UE: This is not an error, so doesn't need an error code. - - Die Projektmappen-Cachedatei "{0}" wird für die Konfiguration "{1}" und die Toolsversion "{2}" verwendet. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Failed to read solution cache file "{0}". {1} Using solution file directly. - Non è stato possibile leggere il file di cache "{0}" della soluzione. {1} Verrà usato direttamente il file della soluzione. - UE: This is not a true error, so doesn't need an error code. - - Fehler beim Lesen der Projektmappen-Cachedatei "{0}". {1} Projektmappendatei wird direkt verwendet. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Failed to write solution cache file "{0}". {1} - Non è stato possibile scrivere il file di cache "{0}" della soluzione. {1} - UE: This is not a true error, so doesn't need an error code. - - Fehler beim Schreiben der Projektmappen-Cachedatei "{0}". {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Solution cache file was created for a "{0}" value of "{1}" but the current value is "{2}". Refreshing cache file. - È stato creato il file di cache della soluzione per un valore "{0}" di "{1}" mentre il valore corrente è "{2}". Il file di cache verrà aggiornato. - UE: This is not an error, so doesn't need an error code. - - Die Projektmappen-Cachedatei wurde für den {0}-Wert "{1}" erstellt, aber der aktuelle Wert ist "{2}". Cachedatei wird aktualisiert. - - fuzzyMatch="100" wordcount="20" adjWordcount="5" curWordcount="5" tmLabel="N''" - - - Solution cache file has an internal version number "{0}" but the current value is "{1}". Refreshing cache file. - Il file di cache della soluzione ha un numero di versione interna "{0}", ma il valore corrente è "{1}". Il file di cache verrà aggiornato. - UE: This is not an error, so doesn't need an error code. - - Die Projektmappen-Cachedatei hat die interne Versionsnummer "{0}", der aktuelle Wert ist aber "{1}". Cachedatei wird aktualisiert. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - Solution cache file is out of date. Refreshing cache file. {0} - Il file di cache della soluzione è obsoleto e verrà aggiornato. {0} - UE: This is not an error, so doesn't need an error code. - - Die Projektmappen-Cachedatei ist veraltet. Cachedatei wird aktualisiert. {0} - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4160: A circular dependency involving project "{0}" has been detected. - MSB4160: rilevata dipendenza circolare che comprende il progetto "{0}". - {StrBegin="MSB4160: "} - - MSB4160: Eine Ringabhängigkeit im Zusammenhang mit dem Projekt "{0}" wurde erkannt. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4126: The specified solution configuration "{0}" is invalid. Please specify a valid solution configuration using the Configuration and Platform properties (e.g. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU") or leave those properties blank to use the default solution configuration. - MSB4126: la configurazione di soluzione specificata "{0}" non è valida. Specificare una configurazione di soluzione valida usando le proprietà Configuration e Platform (ad esempio MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU") oppure non specificare alcun valore per tali proprietà in modo da usare la configurazione di soluzione predefinita. - {StrBegin="MSB4126: "}UE: The solution filename is provided separately to loggers. - - MSB4126: Die angegebene Projektmappenkonfiguration "{0}" ist ungültig. Geben Sie mithilfe der Konfigurations- und Plattformeigenschaften eine gültige Projektmappenkonfiguration an (z. B. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU"), oder lassen Sie diese Eigenschaften leer, sodass die Standardprojektmappenkonfiguration verwendet wird. - - fuzzyMatch="101" wordcount="37" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4046: Error reading project file "{0}": {1} - MSB4046: errore durante la lettura del file di progetto "{0}": {1} - {StrBegin="MSB4046: "} - - MSB4046: Fehler beim Lesen der Projektdatei "{0}": {1} - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4125: The project file name "{0}" is invalid. {1} - MSB4125: il nome del file di progetto "{0}" non è valido. {1} - {StrBegin="MSB4125: "}UE: The solution filename is provided separately to loggers. - - MSB4125: Der Projektdateiname "{0}" ist ungültig. {1} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4051: Project {0} is referencing a project with GUID {1}, but a project with this GUID was not found in the .SLN file. - MSB4051: il progetto {0} fa riferimento a un progetto con GUID {1}, che non è stato trovato nel file SLN. - {StrBegin="MSB4051: "}UE: The solution filename is provided separately to loggers. - - MSB4051: Das Projekt "{0}" verweist auf ein Projekt mit der GUID {1}, in der SLN-Datei wurde jedoch kein Projekt mit dieser GUID gefunden. - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - MSB4078: The project file "{0}" is not supported by MSBuild and cannot be built. - MSB4078: file di progetto "{0}" non supportato in MSBuild. Non è possibile compilarlo. - {StrBegin="MSB4078: "} - - MSB4078: Die Projektdatei "{0}" wird nicht von MSBuild unterstützt und kann nicht erstellt werden. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4054: The solution file must be opened in the Visual Studio IDE and converted to the latest version before it can be built by MSBuild. - MSB4054: prima di compilare il file di soluzione con MSBuild, è necessario aprirlo in Visual Studio IDE e convertirlo alla versione più recente. - {StrBegin="MSB4054: "}UE: The solution filename is provided separately to loggers. - - MSB4054: Die Projektmappendatei muss in der Visual Studio IDE geöffnet und in die neuste Version konvertiert werden, bevor sie mit MSBuild erstellt werden kann. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4121: The project configuration for project "{0}" was not specified in the solution file for the solution configuration "{1}". - MSB4121: la configurazione di progetto per il progetto "{0}" non è stata specificata nel file di soluzione per la configurazione di soluzione "{1}". - {StrBegin="MSB4121: "} - - MSB4121: Die Projektkonfiguration für das Projekt "{0}" wurde nicht in der Projektmappendatei für die Projektmappenkonfiguration "{1}" angegeben. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - The project "{0}" is not selected for building in solution configuration "{1}". - Il progetto "{0}" non è selezionato per la compilazione nella configurazione di soluzione "{1}". - - UE: This is not an error, so doesn't need an error code. - - - Das Projekt "{0}" ist in der Projektmappenkonfiguration "{1}" nicht zum Erstellen ausgewählt. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4122: Scanning project dependencies for project "{0}" failed. {1} - MSB4122: esame delle dipendenze di progetto per il progetto "{0}" non riuscito. {1} - {StrBegin="MSB4122: "} - - MSB4122: Fehler beim Überprüfen der Projektabhängigkeiten für Projekt "{0}". {1} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4149: The tools version "{0}" of the solution does not support building projects with a different tools version. - MSB4149: la versione degli strumenti "{0}" della soluzione non supporta la compilazione di progetti con una versione degli strumenti differente. - {StrBegin="MSB4149: "} - - MSB4149: Die Toolsversion {0} der Projektmappe unterstützt das Erstellen von Projekten mit unterschiedlichen Toolsversionen nicht. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - Web projects do not support the "Clean" target. Continuing with remaining projects ... - I progetti Web non supportano la destinazione "Clean". Verranno elaborati i progetti rimanenti... - UE: This is not an error, so doesn't need an error code. - LOCALIZATION: Do not localize "Clean". - - Webprojekte unterstützen das Clean-Ziel nicht. Verbleibende Projekte werden fortgesetzt... - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Web projects do not support the "Publish" target. Continuing with remaining projects ... - I progetti Web non supportano la destinazione "Publish". Verranno elaborati i progetti rimanenti... - UE: This is not an error, so doesn't need an error code. - LOCALIZATION: Do not localize "Publish". - - Webprojekte unterstützen das Publish-Ziel nicht. Verbleibende Projekte werden fortgesetzt... - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Skipping because the "$(AspNetConfiguration)" configuration is not supported for this web project. You can use the AspNetConfiguration property to override the configuration used for building web projects, by adding /p:AspNetConfiguration=<value> to the command line. Currently web projects only support Debug and Release configurations. - Operazione ignorata. La configurazione "$(AspNetConfiguration)" non è supportata per questo progetto Web. Per eseguire l'override della configurazione utilizzata per la compilazione dei progetti Web, è possibile utilizzare la proprietà AspNetConfiguration, aggiungendo /:pAspNetConfiguration=<valore> alla riga di comando. I progetti Web attualmente supportano solo le configurazioni versioni di debug e di rilascio. - - UE: This is not an error, so doesn't need an error code. - LOCALIZATION: Do NOT localize "AspNetConfiguration", "Debug", "Release". - - - Da der "$(AspNetConfiguration)" Konfiguration für dieses Webprojekt nicht unterstützt. Verwenden die AspNetConfiguration-Eigenschaft die Konfiguration zum Erstellen von Webprojekten hinzufügen/p: AspNetConfiguration überschreiben = < Wert > in der Befehlszeile. Aktuell unterstützen Webprojekte nur Debug- und Releasekonfigurationen. - - fuzzyMatch="15" wordcount="44" adjWordcount="37.4" curWordcount="37.4" - - - MSB4076: VC projects do not support the "Publish" target. - MSB4076: i progetti VC non supportano la destinazione di pubblicazione. - {StrBegin="MSB4076: "}LOCALIZATION: Do not localize "Publish". - - MSB4076: VC-Projekte unterstützen nicht das Publish-Ziel. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4098: MSBuild is invoking VCBuild to build this project. Project-to-project references between VC++ projects (.VCPROJ) and C#/VB/VJ# projects (.CSPROJ, .VBPROJ, .VJSPROJ) are not supported by the command-line build systems when building stand-alone VC++ projects. Projects that contain such project-to-project references will fail to build. Please build the solution file containing this project instead. - MSB4098: MSBuild sta richiamando VCBuild per compilare questo progetto o soluzione. I riferimenti da progetto a progetto tra progetti VC++ (VCPROJ) e C#/VB/VJ# (CSPROJ, VBPROJ, VJSPROJ) non sono supportati dai sistemi di compilazione da riga di comando per la compilazione di progetti VC++ autonomi. La compilazione dei progetti che contengono riferimenti da progetto a progetto non verrà completata correttamente. Per evitare questo problema, compilare il file di soluzione contente questo progetto. - {StrBegin="MSB4098: "} - - MSB4098: MSBuild ruft zum Erstellen dieses Projekts VCBuild auf. Interprojektverweise zwischen VC++-Projekten (.VCPROJ) und C#-/VB-/VJ#-Projekten (.CSPROJ, .VBPROJ, .VJSPROJ) werden beim Erstellen eigenständiger VC++-Projekte von den Befehlszeilen-Buildsystemen nicht unterstützt. Projekte, die solche Interprojektverweise enthalten, werden nicht erstellt. Erstellen Sie stattdessen die Projektmappendatei, die dieses Projekt enthält. - - fuzzyMatch="101" wordcount="53" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4056: The MSBuild engine must be called on a single-threaded-apartment. Current threading model is "{0}". Proceeding, but some tasks may not function correctly. - MSB4056: il motore di MSBuild deve essere chiamato su un apartment a thread singolo. Il modello di threading corrente è "{0}". Se si continua, alcune attività potrebbero non funzionare correttamente. - {StrBegin="MSB4056: "} - - MSB4056: Das MSBuild-Modul muss in einem Singlethread-Apartment aufgerufen werden. Das aktuelle Threadmodell ist {0}. Der Vorgang wird fortgesetzt, aber einige Aufgaben werden möglicherweise nicht ordnungsgemäß ausgeführt. - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - Schema validation - Convalida schema - UE: this fragment is used to describe errors that are caused by schema validation. For example, if a normal error is - displayed like this: "MSBUILD : error MSB0000: This is an error.", then an error from schema validation would look like this: - "MSBUILD : Schema validation error MSB0000: This is an error." - LOCALIZATION: This fragment needs to be localized. - - Schemavalidierung - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Target "{0}" skipped. Previously built unsuccessfully. - La destinazione "{0}" è stata ignorata. La compilazione non era riuscita in precedenza. - - - Das Ziel "{0}" wurde übersprungen. Die vorherige Erstellung war nicht erfolgreich. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Target "{0}" skipped. Previously built successfully. - La destinazione "{0}" è stata ignorata. La compilazione era stata completata in precedenza. - - - Das Ziel "{0}" wurde übersprungen. Die vorherige Erstellung war erfolgreich. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4116: The condition "{1}" on the "{0}" target has a reference to item metadata. References to item metadata are not allowed in target conditions unless they are part of an item transform. - MSB4116: la condizione "{1}" nella destinazione "{0}" include un riferimento ai metadati dell'elemento. I riferimenti ai metadati degli elementi non sono consentiti nelle condizioni di destinazione, a meno che non facciano parte di una trasformazione di elemento. - {StrBegin="MSB4116: "} - - MSB4116: Die Bedingung "{1}" des {0}-Ziels enthält einen Verweis auf Elementmetadaten. Verweise auf Elementmetadaten sind in Zielbedingungen nicht zulässig, es sei denn, sie sind Teil einer Elementtransformation. - - fuzzyMatch="101" wordcount="32" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4057: The target "{0}" does not exist in the project. - MSB4057: la destinazione "{0}" non è presente nel progetto. - {StrBegin="MSB4057: "} - - MSB4057: Das Ziel "{0}" ist im Projekt nicht vorhanden. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - Done building target "{0}" in project "{1}" -- FAILED. - Compilazione destinazione "{0}" nel progetto "{1}" NON COMPLETATA. - - - Erstellen des {0}-Ziels in Projekt {1} beendet - Fehler beim Erstellen. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Done building target "{0}" in project "{1}". - Compilazione destinazione "{0}" nel progetto "{1}" completata. - - - Die Erstellung des Ziels "{0}" im Projekt "{1}" ist abgeschlossen. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - {0}: (TargetId:{1}) - {0}: (ID destinazione: {1}) - - - {0}: (Ziel-ID:{1}) - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4058: The "{0}" target is missing its output specification. If a target declares inputs, it must also declare outputs. - MSB4058: nessuna specifica dell'output per la destinazione "{0}". Se per una destinazione sono dichiarati gli input, devono essere dichiarati anche gli output. - {StrBegin="MSB4058: "} - - MSB4058: Das {0}-Ziel enthält keine Ausgabespezifikation. Wenn ein Ziel Eingaben deklariert, muss es auch Ausgaben deklarieren. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4168: The item "{0}" of type "{1}" does not define a value for the metadata in the expression "{2}". This expression is used in the target output for target "{3}". If a target declares outputs that are transforms, all items in the transform must have a value for the metadata in the transform. - MSB4168: l'elemento "{0}" di tipo "{1}" non definisce un valore per i metadati inclusi nell'espressione "{2}". L'espressione viene usata nell'output della destinazione "{3}". Se una destinazione dichiara output che corrispondono a trasformazioni, tutti gli elementi della trasformazione devono contenere un valore per i metadati inclusi nella trasformazione. - {StrBegin="MSB4168: "} - - MSB4168: Das Element "{0}" vom Typ "{1}" definiert keinen Wert für die Metadaten im Ausdruck "{2}". Dieser Ausdruck wird in der Zielausgabe für "{3}" verwendet. Wenn ein Ziel Ausgaben deklariert, bei denen es sich um Transformationen handelt, müssen alle Elemente in der Transformation einen Wert für die in der Transformation enthaltenen Metadaten aufweisen. - - fuzzyMatch="101" wordcount="53" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Target Performance Summary: - Riepilogo prestazioni destinazione: - - - Leistungszusammenfassung für das Ziel: - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Target "{0}" skipped, due to false condition; ({1}) was evaluated as ({2}). - Destinazione"{0}" ignorata. Condizione false. ({1}) ha restituito ({2}). - - - Das Ziel "{0}" wurde übersprungen, da die Bedingung "false" war . ({1}) wurde als ({2}) ausgewertet. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Target "{0}" in project "{1}" - Destinazione "{0}" nel progetto "{1}" - - - {0}-Ziel in {1}-Projekt. - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Target {0}: - Destinazione {0}: - - - Ziel "{0}": - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Target "{0}" in file "{1}": - Destinazione "{0}" nel file "{1}": - - - Ziel "{0}" in Datei "{1}": - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Build continuing because "{0}" on the task "{1}" is set to "{2}". - La compilazione proseguirà perché "{0}" nell'attività "{1}" è impostato su "{2}". - - - Der Buildvorgang wird fortgesetzt, da {0} in der {1}-Aufgabe auf "{2}" festgelegt ist. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Target {0} from project "{1}": - Destinazione "{0}" del progetto "{1}": - - - Ziel "{0}" aus Projekt "{1}": - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Target "{0}" in file "{1}" from project "{2}": - Destinazione "{0}" nel file "{1}" del progetto "{2}": - - - Ziel "{0}" in Datei "{1}" aus Projekt "{2}": - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4060: The "{0}" task has been declared or used incorrectly, or failed during construction. Check the spelling of the task name and the assembly name. - MSB4060: l'attività "{0}" è stata dichiarata o usata in modo errato oppure si è verificato un errore durante la costruzione. Verificare l'ortografia del nome dell'attività e dell'assembly. - {StrBegin="MSB4060: "} - - MSB4060: Die {0}-Aufgabe wurde falsch deklariert, falsch verwendet oder konnte bei der Erstellung nicht ausgeführt werden. Überprüfen Sie die Schreibweise des Aufgaben- und des Assemblynamens. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4077: The "{0}" task has been marked with the attribute LoadInSeparateAppDomain, but does not derive from MarshalByRefObject. Check that the task derives from MarshalByRefObject or AppDomainIsolatedTask. - MSB4077: l'attività "{0}" è stata contrassegnata con l'attributo LoadInSeparateAppDomain, ma non deriva da MarshalByRefObject. Verificare che l'attività derivi da MarshalByRefObject o AppDomainIsolatedTask. - {StrBegin="MSB4077: "}LOCALIZATION: <LoadInSeparateAppDomain>, <MarshalByRefObject>, <AppDomainIsolatedTask> should not be localized. - - MSB4077: Die Aufgabe "{0}" wurde mit dem LoadInSeparateAppDomain-Attribut markiert, ist jedoch nicht von MarshalByRefObject abgeleitet. Stellen Sie sicher, dass die Aufgabe von MarshalByRefObject oder AppDomainIsolatedTask abgeleitet wird. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Done executing task "{0}" -- FAILED. - Esecuzione attività "{0}" NON COMPLETATA. - - - Die Ausführung von Task "{0}" wurde beendet – FEHLER. - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Done executing task "{0}". - Esecuzione attività "{0}" completata. - - - Die Ausführung von Task "{0}" wurde beendet. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - {0} (TaskId:{1}) - {0} (ID attività:{1}) - - - {0} (Aufgaben-ID: {1}) - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Using "{0}" task from assembly "{1}". - Verrà usata l'attività "{0}" dall'assembly "{1}". - UE: This informational message helps users determine which assemblies their tasks were loaded from. - - Die {0}-Aufgabe aus der {1}-Assembly wird verwendet. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4061: The "{0}" task could not be instantiated from the assembly "{1}". {2} - MSB4061: non è stato possibile creare un'istanza dell'attività "{0}" dall'assembly "{1}". {2} - {StrBegin="MSB4061: "}LOCALIZATION: "{2}" is a localized message from a CLR/FX exception. - - MSB4061: Die {0}-Aufgabe konnte nicht aus der {1}-Assembly instanziiert werden. {2} - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4127: The "{0}" task could not be instantiated from the assembly "{1}". Please verify the task assembly has been built using the same version of the Microsoft.Build.Framework assembly as the one installed on your computer and that your host application is not missing a binding redirect for Microsoft.Build.Framework. {2} - MSB4127: non è stato possibile creare un'istanza dell'attività "{0}" dall'assembly "{1}". Verificare che l'assembly dell'attività sia stato compilato con la stessa versione dell'assembly Microsoft.Build.Framework installata nel computer e che nell'applicazione host non manchi un reindirizzamento del binding per Microsoft.Build.Framework. {2} - {StrBegin="MSB4127: "}UE: This message is a specialized version of the TaskInstantiationFailureError message and can probably reuse some of its docs. - LOCALIZATION: "{2}" is a localized message from a CLR/FX exception. Also, Microsoft.Build.Framework should not be localized - - MSB4127: Die "{0}"-Aufgabe konnte nicht aus der "{1}"-Assembly instanziiert werden. Überprüfen Sie, ob die Aufgabenassembly mit der gleichen Version der Microsoft.Build.Framework-Assembly erstellt wurde, die auf Ihrem Computer installiert ist, und dass Ihrer Hostanwendung kein BindingRedirect-Eintrag für Microsoft.Build.Framework fehlt. {2} - - fuzzyMatch="101" wordcount="49" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4062: The "{0}" task could not be loaded from the assembly {1}. {2} Confirm that the <UsingTask> declaration is correct, and that the assembly and all its dependencies are available. - MSB4062: non è stato possibile caricare l'attività "{0}" dall'assembly {1}. {2} Verificare che la dichiarazione <UsingTask> sia corretta e che l'assembly e le relative dipendenze siano disponibili. - {StrBegin="MSB4062: "}UE: This message is shown when a task cannot be loaded from its assembly for various reasons e.g. corrupt assembly, - invalid task declaration, disk error, etc. "{2}" contains a message explaining what happened. - LOCALIZATION: "{2}" is a message from the CLR loader and is already localized. Also, <UsingTask> should not be localized. - - MSB4062: Die "{0}" Vorgang konnte nicht aus der Assembly geladen werden {1}. {2} Bestätigen < UsingTask > Erklärung richtig ist und die Assembly und die zugehörigen Dateien verfügbar sind. - - fuzzyMatch="15" wordcount="31" adjWordcount="26.35" curWordcount="26.35" - - - MSB4063: The "{0}" task could not be initialized with its input parameters. {1} - MSB4063: non è stato possibile inizializzare l'attività "{0}" con i relativi parametri di input. {1} - {StrBegin="MSB4063: "} - - MSB4063: Die "{0}"-Aufgabe konnte nicht mit ihren Eingabeparametern initialisiert werden. {1} - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - Task Performance Summary: - Riepilogo prestazioni attività: - - - Leistungszusammenfassung für die Aufgabe: - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Task "{0}" skipped, due to false condition; ({1}) was evaluated as ({2}). - Attività "{0}" ignorata. Condizione false. ({1}) ha restituito ({2}). - - - Die {0}-Aufgabe wurde übersprungen, da die Bedingung "false" war . ({1}) wurde als ({2}) ausgewertet. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Task "{0}" - Attività "{0}" - - - Task "{0}" - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Time Elapsed {0} - Tempo trascorso {0} - - - Verstrichene Zeit {0} - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Building with tools version "{0}". - Compilazione con la versione degli strumenti "{0}". - - - Erstellung mit der Toolsversion "{0}". - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Project file contains ToolsVersion="{0}". This toolset is unknown or missing. You may be able to resolve this by installing the appropriate .NET Framework for this toolset. Treating the project as if it had ToolsVersion="4.0". - Il file di progetto contiene ToolsVersion="{0}". Questo set di strumenti è sconosciuto o mancante. È possibile risolvere il problema installando la versione di .NET Framework appropriata per questo set di strumenti. Il progetto verrà considerato come se contenesse ToolsVersion="4.0". - - - Die Projektdatei enthält ToolsVersion="{0}". Dieses Toolset ist nicht bekannt oder nicht vorhanden. Sie können das Problem möglicherweise beheben, indem Sie das entsprechende .NET Framework für dieses Toolset installieren. Das Projekt wird behandelt als enthielte es ToolsVersion="4.0". - - fuzzyMatch="101" wordcount="34" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Deferred Messages - Messaggi rinviati - - - Zurückgestellte Meldungen - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Some messages did not display because they were not associated with any ProjectStarted events. Use diagnostic verbosity to view these messages. - Alcuni messaggi non sono stati visualizzati perché non associati ad alcun evento ProjectStarted. Usare il livello di dettaglio diagnostico per visualizzare i messaggi. - - - Einige Meldungen wurden nicht angezeigt, weil sie keinem ProjectStarted-Ereignis zugeordnet sind. Verwenden Sie den Ausführlichkeitsgrad "diagnostic", um diese Meldungen anzuzeigen. - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - MSB4090: Found an unexpected character '{2}' at position {1} in condition "{0}". - MSB4090: trovato carattere imprevisto '{2}' nella posizione {1} nella condizione "{0}". - {StrBegin="MSB4090: "} - - MSB4090: Das unerwartete Zeichen {2} wurde an Position {1} in der {0}-Bedingung gefunden. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4091: Found a call to an undefined function "{1}" in condition "{0}". - MSB4091: trovata chiamata alla funzione non definita "{1}" nella condizione "{0}". - {StrBegin="MSB4091: "} - - MSB4091: Aufruf zu einer undefinierten Funktion "{1}" in Bedingung "{0}" gefunden. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4064: The "{0}" parameter is not supported by the "{1}" task. Verify the parameter exists on the task, and it is a settable public instance property. - MSB4064: il parametro "{0}" non è supportato dall'attività "{1}". Verificare che il parametro sia presente per l'attività e che si tratti di un'istanza pubblica e impostabile della proprietà. - {StrBegin="MSB4064: "} - - MSB4064: Der {0}-Parameter wird von der {1}-Aufgabe nicht unterstützt. Vergewissern Sie sich, dass der Parameter in der Aufgabe vorhanden ist und es sich um eine festlegbare öffentliche Instanzeigenschaft handelt. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4131: The "{0}" parameter is not supported by the "{1}" task. Verify the parameter exists on the task, and it is a gettable public instance property. - MSB4131: il parametro "{0}" non è supportato dall'attività "{1}". Verificare che il parametro sia presente per l'attività e che si tratti di un'istanza pubblica e recuperabile della proprietà. - {StrBegin="MSB4131: "} - - MSB4131: Der {0}-Parameter wird von der {1}-Aufgabe nicht unterstützt. Vergewissern Sie sich, dass der Parameter in der Aufgabe vorhanden ist und es sich um eine abrufbare öffentliche Instanzeigenschaft handelt. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4092: An unexpected token "{1}" was found at character position {2} in condition "{0}". - MSB4092: token imprevisto "{1}" trovato nella posizione di carattere {2} nella condizione "{0}". - {StrBegin="MSB4092: "} - - MSB4092: Ein unerwartetes Token "{1}" wurde an Zeichenposition "{2}" in Bedingung "{0}" gefunden. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4065: The "{0}" parameter is not marked for output by the "{1}" task. - MSB4065: il parametro "{0}" non è contrassegnato per l'output dall'attività "{1}". - {StrBegin="MSB4065: "} - - MSB4065: Der {0}-Parameter ist nicht für die Ausgabe durch die {1}-Aufgabe markiert. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4066: The attribute "{0}" in element <{1}> is unrecognized. - MSB4066: attributo "{0}" nell'elemento <{1}> non riconosciuto. - {StrBegin="MSB4066: "} - - MSB4066: Das Attribut "{0}" im Element <{1}> wurde nicht erkannt. - - fuzzyMatch="15" wordcount="10" adjWordcount="8.5" curWordcount="8.5" - - - MSB4067: The element <{0}> beneath element <{1}> is unrecognized. - MSB4067: elemento <{0}> sotto l'elemento <{1}> non riconosciuto. - {StrBegin="MSB4067: "} - - MSB4067: Das Element <{0}> unter Element <{1}> wurde nicht erkannt. - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB4068: The element <{0}> is unrecognized, or not supported in this context. - MSB4068: elemento <{0}> non riconosciuto o non supportato in questo contesto. - {StrBegin="MSB4068: "} - - MSB4068: Das Element <{0}> ist unbekannt oder in diesem Kontext nicht unterstützt. - - fuzzyMatch="15" wordcount="13" adjWordcount="11.05" curWordcount="11.05" - - - MSB4132: The tools version "{0}" is unrecognized. - MSB4132: versione degli strumenti "{0}" non riconosciuta. - {StrBegin="MSB4132: "} - - MSB4132: Die Toolsversion "{0}" ist unbekannt. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4069: The "{0}" type of the "{1}" parameter of the "{2}" task is not supported by MSBuild. - MSB4069: tipo "{0}" del parametro "{1}" dell'attività "{2}" non supportato in MSBuild. - {StrBegin="MSB4069: "}LOCALIZATION: "MSBuild" should not be localized. - - MSB4069: Der {0}-Typ des {1}-Parameters der {2}-Aufgabe wird von MSBuild nicht unterstützt. - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - MSB4072: A <{0}> element must contain either the "{1}" attribute or the "{2}" attribute (but not both). - MSB4072: un elemento <{0}> deve contenere l'attributo "{1}" o "{2}", ma non entrambi. - {StrBegin="MSB4072: "} - - MSB4072: Ein <{0}>-Element muss entweder die "{1}" Attribut oder "{2}" Attribut (jedoch nicht beide). - - fuzzyMatch="15" wordcount="18" adjWordcount="15.3" curWordcount="15.3" - - - {0} Warning(s) - Avvisi: {0} - - - {0} Warnung(en) - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4084: A <When> element may not follow an <Otherwise> element in a <Choose>. - MSB4084: un elemento <When> non può seguire un elemento <Otherwise> in un elemento <Choose>. - {StrBegin="MSB4084: "} - - MSB4084: A < >-Element kein Element < Otherwise > < auswählen > folgen. - - fuzzyMatch="15" wordcount="16" adjWordcount="13.6" curWordcount="13.6" - - - Target Name: "{0}" Project Name: "{1}" - Nome destinazione: "{0}" Nome progetto: "{1}" - - - Zielname: "{0}" Projektname: "{1}" - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Cycle trace: - Traccia ciclo: - - - Schleifenablaufverfolgung: - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4150: Must initialize the console logger using the initialize method before using ApplyParameter - MSB4150: per poter usare ApplyParameter è necessario inizializzare il logger di console mediante il metodo Initialize - {StrBegin="MSB4150: "} - - MSB4150: Die Konsolenprotokollierung muss vor der Verwendung von ApplyParameter mithilfe der Initialisierungsmethode initialisiert werden. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4151: An error occurred while building project "{0}", target "{1}". Please see innerException for detailed information. - MSB4151: errore durante la compilazione del progetto "{0}", destinazione "{1}". Per informazioni dettagliate, vedere innerException. - {StrBegin="MSB4151: "} - - MSB4151: Fehler beim Erstellen von Projekt "{0}", Ziel "{1}". Ausführliche Informationen finden Sie in der innerException. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB4152: An error occurred on the child node "{0}" and could not be passed to the parent node. {1} - MSB4152: errore sul nodo figlio "{0}". Non è stato possibile passare al nodo padre. {1} - {StrBegin="MSB4152: "} - - MSB4152: Fehler im untergeordneten Knoten "{0}", der nicht an den übergeordneten Knoten übergeben werden konnte. {1} - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4153: A call is made on an inactive IBuildEngine interface corresponding to a task that already finished execution. - MSB4153: su un'interfaccia IBuildEngine inattiva è stata effettuata una chiamata per un'attività la cui esecuzione è già terminata. - {StrBegin="MSB4153: "} - - MSB4153: Eine inaktive IBuildEngine-Schnittstelle wird aufgerufen, der eine Aufgabe entspricht, deren Ausführung bereits abgeschlossen wurde. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - MSB4154: A forwarding logger is attempting to forward BuildFinished event - MSB4154: un logger di inoltro sta tentando di inoltrare l'evento BuildFinished - {StrBegin="MSB4154: "} - - MSB4154: Eine weiterleitende Protokollierung versucht, das BuildFinished-Ereignis weiterzuleiten. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4155: There was an error while communicating with a node. - MSB4155: errore durante la comunicazione con un nodo. - {StrBegin="MSB4155: "} - - MSB4155: Fehler bei der Kommunikation mit einem Knoten. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB1021: Cannot create an instance of the logger - {0}. - MSB1021: non è possibile creare un'istanza del logger - {0}. - {StrBegin="MSB1021: "}The error code for this message is duplicated from MSBuild.exe. - - MSB1021: Eine Instanz der Protokollierung kann nicht erstellt werden - {0}. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB1020: The logger {0} was not found. Check the following: 1.) The logger name specified is the same as the name of the logger class. 2.) The logger class is "public" and implements the Microsoft.Build.Framework.ILogger interface. 3.) The path to the logger assembly is correct, or the logger can be loaded using only the assembly name provided. - MSB1020: il logger {0} non è stato trovato. Verificare quanto segue: 1.) Il nome del logger specificato corrisponde al nome della classe logger. 2.) La classe logger è "public" e implementa l'interfaccia Microsoft.Build.Framework.ILogger. 3.) Il percorso dell'assembly logger è corretto o è possibile caricare il logger usando esclusivamente il nome di assembly fornito. - {StrBegin="MSB1020: "}The error code for this message is duplicated from MSBuild.exe. - - MSB1020: Die Protokollierung {0} wurde nicht gefunden. Überprüfen Sie Folgendes: 1.) Der angegebene Name der Protokollierung ist mit dem Namen der Protokollierungsklasse identisch. 2.) Die Protokollierungsklasse ist "public" und implementiert die Microsoft.Build.Framework.ILogger-Schnittstelle. 3.) Der Pfad zur Protokollierungsassembly ist richtig, bzw. die Protokollierung kann alleine mithilfe des angegebenen Assemblynamens geladen werden. - - fuzzyMatch="101" wordcount="57" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4156: A forwarding logger is attempting to forward BuildStarted event - MSB4156: un logger di inoltro sta tentando di inoltrare l'evento BuildStarted - {StrBegin="MSB4156: "} - - MSB4156: Eine weiterleitende Protokollierung versucht, das BuildStarted-Ereignis weiterzuleiten. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - "{0}" ({1} target) ({2}) -> - "{0}" (destinazione: {1}) ({2}) -> - - - "{0}" ({1} target) ({2}) -> - - fuzzyMatch="15" wordcount="5" adjWordcount="4.25" curWordcount="4.25" - - - "{0}" (default target) ({1}) -> - "{0}" (destinazione predefinita) ({1}) -> - - - "{0}" (Standardziel) ({1}) -> - - fuzzyMatch="15" wordcount="5" adjWordcount="4.25" curWordcount="4.25" - - - {0} {1,5} - {0} {1,5} - - - {0} {1,5} - - fuzzyMatch="15" wordcount="2" adjWordcount="1.7" curWordcount="1.7" - - - Project "{0}" on node {1} ({2} target(s)). - Progetto "{0}" sul nodo {1} (destinazioni: {2}). - - - Projekt "{0}" auf Knoten "{1}", {2} Ziel(e). - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Project "{0}" on node {1} (default targets). - Progetto "{0}" sul nodo {1} (destinazioni predefinite). - - - Projekt "{0}" auf Knoten "{1}" (Standardziele). - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Project "{0}" ({1}) is building "{2}" ({3}) on node {4} ({5} target(s)). - Compilazione di "{2}" ({3}) dal progetto "{0}" ({1}) sul nodo {4} (destinazioni: {5}). - - - Das Projekt "{0}" ({1}) erstellt "{2}" ({3}) auf Knoten "{4}", {5} Ziel(e). - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Project "{0}" ({1}) is building "{2}" ({3}) on node {4} (default targets). - Compilazione di "{2}" ({3}) dal progetto "{0}" ({1}) sul nodo {4} (destinazioni predefinite). - - - Das Projekt "{0}" ({1}) erstellt "{2}" ({3}) auf Knoten "{4}" (Standardziele). - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - ({0} target) -> - (destinazione: {0}) -> - - - ({0} Ziel) -> - - fuzzyMatch="15" wordcount="3" adjWordcount="2.55" curWordcount="2.55" - - - MSB4157: The array of project files needs to contain at least one value. - MSB4157: la matrice dei file di progetto deve contenere almeno un valore. - {StrBegin="MSB4157: "} - - MSB4157: Das Array der Projektdateien muss mindestens einen Wert enthalten. - - fuzzyMatch="15" wordcount="13" adjWordcount="11.05" curWordcount="11.05" - - - MSB4158: The project file name at element {0} is empty. - MSB4158: il nome del file di progetto nell'elemento {0} è vuoto. - {StrBegin="MSB4158: "} - - MSB4158: Der Projektdateiname bei Element {0} ist leer. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - The property "{0}" with value "{1}" is being overridden by another batch. The property is now: "{2}" - Override della proprietà "{0}" con valore "{1}" con un altro batch. La proprietà è adesso: "{2}" - - - Die Eigenschaft "{0}" mit dem Wert "{1}" wird von einem anderen Batch überschrieben. Die Eigenschaft ist jetzt: "{2}" - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - Please see inner exception for error information. - Per informazioni dettagliate, vedere l'eccezione interna. - - - Fehlerinformationen finden Sie in der internen Ausnahme. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Event type "{0}" was expected to be serializable. The event was not serializable and has been ignored. - Previsto tipo evento "{0}" serializzabile. L'evento non era serializzabile ed è stato ignorato. - - - Es wurde erwartet, dass der Typ "{0}" serialisierbar ist. Das Ereignis war nicht serialisierbar und wurde ignoriert. - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - The log file path cannot be null or empty. - Il percorso file di log non può essere Null o vuoto. - - - Der Protokolldateipfad darf nicht NULL oder leer sein. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4161: Project "{0}" was loaded and unloaded during the current build. Reloading a project during the build can result in errors or an inconsistent build state. Either avoid unloading project "{0}" or cache the evaluation results of target(s) "{1}" before unloading the project. - MSB4161: il progetto "{0}" è stato caricato e scaricato durante la compilazione corrente. Il ricaricamento di un progetto durante la compilazione può causare errori o uno stato di compilazione incoerente. Evitare di scaricare il progetto "{0}" oppure memorizzare nella cache i risultati di valutazione delle destinazioni "{1}" prima di scaricare il progetto. - {StrBegin="MSB4161: "} - - MSB4161: Das Projekt "{0}" wurde während der aktuellen Erstellung geladen und entladen. Das erneute Laden eines Projekts während der Erstellung kann zu Fehlern oder einem nicht konsistenten Buildzustand führen. Vermeiden Sie entweder das Entladen des Projekts "{0}", oder speichern Sie die Auswertungsergebnisse der Ziele "{1}" vor dem Entladen des Projekts im Cache. - - fuzzyMatch="101" wordcount="43" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - [default] - [predefinita] - - - [Standard] - - fuzzyMatch="100" wordcount="1" adjWordcount="0.25" curWordcount="0.25" tmLabel="N''" - - -
-
\ No newline at end of file diff --git a/src/Deprecated/Engine/Resources/xlf/Strings.ja.xlf b/src/Deprecated/Engine/Resources/xlf/Strings.ja.xlf deleted file mode 100644 index 8940d8c2e2d..00000000000 --- a/src/Deprecated/Engine/Resources/xlf/Strings.ja.xlf +++ /dev/null @@ -1,2674 +0,0 @@ - - - -
- - 4013 - 1176.8 - 1176.8 - 0 - 0 - - - 0 - 981 - 2334 - 0 - 0 - 698 - 0 - -
- - - MSB4001: The "{0}" task has more than one parameter called "{1}". - MSB4001: "{0}" タスクには "{1}" という名前のパラメーターが 2 つ以上あります。 - {StrBegin="MSB4001: "}UE: This message is shown when a task has more than one .NET property with the same name -- it's unclear which of - those properties the task wants to use as a parameter in project files. - - MSB4001: Die {0}-Aufgabe enthält mehrere Parameter mit dem Namen "{1}". - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4081: The value "{0}" of the "ItemName" attribute in element <Output> contains an "@" character. If you intended to use an item name then remove the @( ) around the item name. - MSB4081: 要素 <Output> の "ItemName" 属性の値 "{0}" は "@" 文字を含んでいます。項目名を使用する場合は、@( ) を項目名の周りから削除してください。 - {StrBegin="MSB4081: "}UE: This message is shown when an output tag has an itemname that contains an @. They probably typed @(foo) instead of foo in the ItemName.LOCALIZATION: Output and ItemName should not be localized. - - MSB4081: Der Wert "{0}" "ItemName-Attribut im Element < Output > enthält ein" @"Zeichen. Soll ein Elementname verwenden und entfernen dann die @ (), um den Namen des Elements. - - fuzzyMatch="15" wordcount="30" adjWordcount="25.5" curWordcount="25.5" - - - MSB4002: There was a failure retrieving the attributes for parameters in the "{0}" task. {1} - MSB4002: "{0}" タスクでパラメーターの属性を取得できませんでした。{1} - {StrBegin="MSB4002: "}UE: This message is shown when the .NET attributes that a task's .NET properties are decorated with, cannot be - retrieved -- this is typically because the .NET classes that define the .NET attributes cannot be loaded because the assembly - they are defined in cannot be found, or the classes themselves cannot be found. - - MSB4002: Fehler beim Abrufen der Attribute für Parameter in der {0}-Aufgabe. {1} - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - MSB4003: "{0}" is a reserved attribute of the <{1}> element, and must be spelled with the correct casing. This attribute cannot be used as a parameter to the "{2}" task. - MSB4003: "{0}" は <{1}> 要素の予約された属性であり、大文字/小文字を正しく区別しなければなりません。この属性を "{2}" タスクへのパラメーターとして使用することはできません。 - {StrBegin="MSB4003: "}UE: Tasks are not allowed to use incorrect case for reserved attributes on the task nodes e.g. "continueonerror" - instead of the "ContinueOnError". - - MSB4003: "{0}" ist ein reserviertes Attribut der <{1}>-Element und mit der richtigen Groß-/Kleinschreibung geschrieben werden muss. Dieses Attribut kann nicht verwendet werden, als Parameter an die "{2}" Aufgabe. - - fuzzyMatch="15" wordcount="31" adjWordcount="26.35" curWordcount="26.35" - - - The "REQUESTBATCHSIZE" must be a number greater than 1. "{0}" is an invalid value. The value 10 will be used instead. - "REQUESTBATCHSIZE" は 1 より大きくなければなりません。"{0}" は無効な値です。代わりに値 10 が使用されます。 - The name "REQUESTBATCHSIZE" is an environment variable - - Die "REQUESTBATCHSIZE" muss eine Zahl größer als 1 sein. "{0}" ist ein ungültiger Wert. Der Wert 10 wird stattdessen verwendet. - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - Build completed in {0}. - {0} でビルドが完了しました。 - - - Das Erstellen wurde in {0} beendet. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - Build FAILED. - ビルドに失敗しました。 - - - Fehler beim Buildvorgang. - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Build succeeded. - ビルドに成功しました。 - - - Buildvorgang erfolgreich. - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Build started. - ビルドを開始しました。 - - - Der Buildvorgang wurde gestartet. - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Build started {0}. - {0} にビルドを開始しました。 - - - Der Buildvorgang wurde am {0} gestartet. - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Building target "{0}" completely. - ターゲット "{0}" を完全にビルドしています。 - {0} is the name of the target. - - Das Ziel "{0}" wird vollständig erstellt. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - No input files were specified. - 入力ファイルが指定されていません。 - - - Es wurden keine Eingabedateien angegeben. - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Input file "{0}" is newer than output file "{1}". - 入力ファイル "{0}" は出力ファイル "{1}" よりも新しいです。 - {0} and {1} are filenames on disk. - - Die Eingabedatei "{0}" ist neuer als die Ausgabedatei "{1}". - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - Output file "{0}" does not exist. - 出力ファイル "{0}" は存在しません。 - {0} is a filename on disk. - - Die Ausgabedatei "{0}" ist nicht vorhanden. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Input file "{0}" does not exist. - 入力ファイル {0} は存在しません。 - {0} is a filename on disk. - - Die Eingabedatei "{0}" ist nicht vorhanden. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Building target "{0}" partially, because some output files are out of date with respect to their input files. - いくつかの出力ファイルが、それらの入力ファイルに対して古い形式であるため、ターゲット "{0}" を部分的にビルドしています。 - {0} is the name of the target. - - Das Ziel "{0}" wird teilweise erstellt, da einige Ausgabedateien hinsichtlich ihrer Eingabedateien veraltet sind. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - [{0}: Input={1}, Output={2}] Input file is newer than output file. - [{0}: Input={1}, Output={2}] 入力ファイルは出力ファイルよりも新しいです。 - {0} is the name of an MSBuild item. {1} and {2} are filenames on disk. - - [{0}: Eingabe={1}, Ausgabe={2}] Die Eingabedatei ist neuer als die Ausgabedatei. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - [{0}: Input={1}, Output={2}] Output file does not exist. - [{0}: Input={1}, Output={2}] 出力ファイルが存在しません。 - {0} is the name of an MSBuild item. {1} and {2} are filenames on disk. - - [{0}: Eingabe={1}, Ausgabe={2}] Die Ausgabedatei ist nicht vorhanden. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - [{0}: Input={1}, Output={2}] Input file does not exist. - [{0}: Input={1}, Output={2}] 入力ファイルは存在しません。 - {0} is the name of an MSBuild item. {1} and {2} are filenames on disk. - - [{0}: Eingabe={1}, Ausgabe={2}] Die Eingabedatei ist nicht vorhanden. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - The attribute "{0}" is a known MSBuild attribute, and cannot be accessed using this method. - 属性 "{0}" は既知の MSBuild 属性であり、このメソッドを使用してアクセスできません。 - - - Das {0}-Attribut ist ein bekanntes MSBuild-Attribut, auf das mithilfe dieser Methode nicht zugegriffen werden kann. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - Properties in persisted property groups cannot be accessed by name. - 持続プロパティ グループのプロパティに名前でアクセスできません。 - - - Auf Eigenschaften in persistenten Eigenschaftengruppen ist kein Zugriff über den Namen möglich. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4023: Cannot evaluate the item metadata "%({0})". {1} - MSB4023: 項目のメタデータ "%({0})" を評価できません。{1} - {StrBegin="MSB4023: "}UE: This message is shown when the value of an item metadata cannot be computed for some reason e.g. trying to apply - %(RootDir) to an item-spec that's not a valid path, would result in this error. - LOCALIZATION: "{1}" is a localized message explaining the problem. - - MSB4023: Elementmetadaten "%({0})" können nicht ausgewertet werden. {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Cannot execute a task not associated with a project object. - プロジェクト オブジェクトに関連付けられていないタスクを実行することはできません。 - - - Eine Aufgabe, die keinem Projektobjekt zugeordnet ist, kann nicht ausgeführt werden. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - The cache entry has already been set to a different value and cannot be modified. - キャッシュ エントリには既に別の値が設定されており、変更できません。 - - - Der Cacheeintrag wurde bereits auf einen anderen Wert festgelegt und kann nicht geändert werden. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - The "{0}" property comes from an environment variable, and cannot be modified. - "{0}" プロパティは環境変数にあり、変更できません。 - - - Die {0}-Eigenschaft stammt aus einer Umgebungsvariablen und kann nicht geändert werden. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - The "{0}" property is a global property, and cannot be modified through an evaluated property group. Use "{1}" instead. - "{0}" プロパティはグローバル プロパティであり、評価されたプロパティ グループをとおして変更することはできません。"{1}" を使用してください。 - - - Die {0}-Eigenschaft ist eine globale Eigenschaft und kann nicht über eine ausgewertete Eigenschaftengruppe geändert werden. Verwenden Sie stattdessen {1}. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - Modifying the XML of an imported project file is not allowed. Open that project file directly. - インポートされたプロジェクト ファイルの XML を変更できません。そのプロジェクト ファイルを直接開いてください。 - - - Der XML-Code einer importierten Projektdatei darf nicht geändert werden. Öffnen Sie diese Projektdatei direkt. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB4117: The "{0}" item name is reserved, and cannot be used. - MSB4117: "{0}" 項目名は予約されているため使用できません。 - {StrBegin="MSB4117: "}UE: This message is shown when the user tries to redefine one of the reserved MSBuild items e.g. @(Choose) - - MSB4117: Der Elementname "{0}" ist reserviert und kann nicht verwendet werden. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4118: The "{0}" item metadata name is reserved, and cannot be used. - MSB4118: "{0}" 項目のメタデータ名は予約されているため使用できません。 - {StrBegin="MSB4118: "}UE: This message is shown when the user tries to redefine one of the reserved MSBuild items e.g. @(Choose) - - MSB4118: Der Elementmetadatenname "{0}" ist reserviert und kann nicht verwendet werden. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4004: The "{0}" property is reserved, and cannot be modified. - MSB4004: "{0}" プロパティは予約されており、変更することはできません。 - {StrBegin="MSB4004: "}UE: This message is shown when the user tries to redefine one of the reserved MSBuild properties e.g. $(MSBuildProjectFile) - - MSB4004: Die {0}-Eigenschaft ist reserviert und kann nicht geändert werden. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4094: "{0}" is an invalid value for the "{1}" parameter of the "{3}" task. Multiple items cannot be passed into a parameter of type "{2}". - MSB4094: "{0}" は、"{3}" タスクの "{1}" パラメーターには無効な値です。複数の項目を、型 "{2}" のパラメーターに渡すことはできません。 - {StrBegin="MSB4094: "} - UE: This error is shown when a project tries to pass multiple items into a task parameter of type ITaskItem (singular). - - - MSB4094: "{0}" ist ein ungültiger Wert für den "{1}"-Parameter der "{3}"-Aufgabe. Mehrere Elemente können nicht in einen Parameter vom Typ "{2}" übergeben werden. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4115: The "{0}" function only accepts a scalar value, but its argument "{1}" evaluates to "{2}" which is not a scalar value. - MSB4115: "{0}" 関数にはスカラー値のみ指定できます。ただし、その引数 "{1}" はスカラー値でない "{2}" として評価されます。 - {StrBegin="MSB4115: "} - UE: This error is shown when a project tries to pass multiple items into a function in a conditional expression, that can only accept a scalar value (such as the "exists()" function). - - - MSB4115: Die "{0}"-Funktion nimmt nur einen Skalarwert an, ihr "{1}"-Argument wird jedoch zu "{2}" ausgewertet, bei dem es sich nicht um einen Skalarwert handelt. - - fuzzyMatch="100" wordcount="22" adjWordcount="5.5" curWordcount="5.5" tmLabel="N''" - - - The task is currently associated with a project object, and should not be added to a different one. - タスクは、現在プロジェクト オブジェクトに関連付けらており、別のオブジェクトに追加することはできません。 - - - Die Aufgabe ist derzeit einem Projektobjekt zugeordnet und sollte zu keinem anderen Projektobjekt hinzugefügt werden. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - MSB4095: The item metadata %({0}) is being referenced without an item name. Specify the item name by using %(itemname.{0}). - MSB4095: 項目のメタデータ %({0}) は、項目名なしに参照されています。%(itemname.{0}) を使用して項目名を指定してください。 - {StrBegin="MSB4095: "} - - MSB4095: Auf die %({0})-Elementmetadaten wird ohne einen Elementnamen verwiesen. Geben Sie den Namen mithilfe von %(itemname.{0}) an. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - The task is not associated with the specified target element collection, and should not be removed from it. - タスクは、指定されたターゲット要素コレクションに関連付けられていないため、削除することはできません。 - - - Die Aufgabe ist nicht der angegebenen Auflistung von Zielelementen zugeordnet und sollte nicht daraus entfernt werden. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - MSB4005: The current working directory could not be restored to {0}. {1} - MSB4005: 現在の作業ディレクトリを {0} に復元することはできません。{1} - {StrBegin="MSB4005: "}UE: This message is shown when the current working directory cannot be reset after a build. "{1}" contains a message explaining why. - LOCALIZATION: "{1}" is a message from an CLR/FX exception and is already localized. - - MSB4005: Das aktuelle Arbeitsverzeichnis konnte unter {0} nicht wiederhergestellt werden. {1} - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Cannot set a condition on an object not represented by an XML element in the project file. - プロジェクト ファイルの XML 要素によって表わされていないオブジェクト上で条件を設定することはできません。 - - - Eine Bedingung kann nicht für ein Objekt festgelegt werden, wenn das Objekt nicht von einem XML-Element in der Projektdatei repräsentiert wird. - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - Cannot set ContinueOnError on an object not represented by an XML element in the project file. - プロジェクト ファイルの XML 要素によって表されていないオブジェクト上では、ContinueOnError を設定することはできません。 - - - Das ContinueOnError-Attribut kann nicht für ein Objekt festgelegt werden, wenn das Objekt nicht von einem XML-Element in der Projektdatei repräsentiert wird. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB4134: DefaultToolsVersion cannot be set after a project has been loaded into the Engine. - MSB4134: プロジェクトがエンジンに読み込まれた後、DefaultToolsVersion を設定することはできません。 - {StrBegin="MSB4134: "} - - MSB4134: DefaultToolsVersion darf nicht festgelegt werden, nachdem ein Projekt in das Modul geladen wurde. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - Assigning the "{0}" attribute on an item that has been evaluated is not allowed. This operation is only allowed on the original persisted item that came directly from the project file. - "{0}" 属性を評価された項目で割り当てることは許可されていません。この操作は、プロジェクト ファイルから持続する元の項目上でのみ許可されます。 - - - Das {0}-Attribut darf nicht einem Element zugewiesen werden, das ausgewertet wurde. Dieser Vorgang ist nur für das ursprüngliche persistente Element zulässig, das direkt aus der Projektdatei stammt. - - fuzzyMatch="101" wordcount="31" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Assigning the "{0}" attribute of a virtual item is not allowed. - 仮想項目の "{0}" 属性の割り当ては許可されていません。 - - - Das Zuweisen des {0}-Attributs eines virtuellen Elements ist nicht zulässig. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - A property cannot be set while building. - ビルド中にプロパティは設定できません。 - - - Eine Eigenschaft kann nicht während des Erstellens festgelegt werden. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - A property cannot be set to null. - プロパティを null に設定できません。 - - - Eine Eigenschaft kann nicht auf NULL festgelegt werden. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Cannot get or set parameters on a task not associated with a project object. - プロジェクト オブジェクトに関連付けられていないタスクでは、パラメーターを取得または設定できません。 - - - Parameter für eine Aufgabe können nicht abgefragt oder festgelegt werden, wenn die Aufgabe keinem Projektobjekt zugeordnet ist. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4162: <{0}> is not valid. Child elements are not allowed below a item remove element. - MSB4162: <{0}> は無効です。子要素は項目削除要素の下には配置できません。 - {StrBegin="MSB4162: "} - - MSB4162: <{0}> ist ungültig. Untergeordnete Elemente dürfen nicht unter einem Element Element entfernen. - - fuzzyMatch="15" wordcount="16" adjWordcount="13.6" curWordcount="13.6" - - - MSB4166: Child node "{0}" exited prematurely. Shutting down. - MSB4166: 子ノード "{0}" は処理の途中で終了しました。シャットダウンしています。 - {StrBegin="MSB4166: "} - - MSB4166: Der untergeordnete Knoten "{0}" wurde vorzeitig beendet. Herunterfahren. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4085: A <Choose> must contain at least one <When>. - MSB4085: <Choose> は少なくとも 1 つの <When> を含んでいなければなりません。 - {StrBegin="MSB4085: "} - - MSB4085: < auswählen > muss mindestens < Wenn >. - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB4114: <Choose> elements cannot be nested more than {0} levels deep. - MSB4114: <Choose> 要素は {0} レベル以上では入れ子にできません。 - {StrBegin="MSB4114: "}UE: This message appears if the project file contains unreasonably nested Choose elements. - LOCALIZATION: Do not localize "Choose" as it is an XML element name. - - MSB4114: < auswählen > Elemente können nicht geschachtelt werden mehr als {0} Ebenen. - - fuzzyMatch="15" wordcount="12" adjWordcount="10.2" curWordcount="10.2" - - - MSB4006: There is a circular dependency in the target dependency graph involving target "{0}". - MSB4006: ターゲット "{0}" で、ターゲット依存グラフに循環する依存関係が存在します。 - {StrBegin="MSB4006: "}UE: This message is shown when the build engine detects a target referenced in a circular manner -- a project cannot - request a target to build itself (perhaps via a chain of other targets). - - MSB4006: Im Zielabhängigkeitsdiagramm besteht eine Ringabhängigkeit im Zusammenhang mit dem Ziel "{0}". - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4086: A numeric comparison was attempted on "{1}" that evaluates to "{2}" instead of a number, in condition "{0}". - MSB4086: 条件 "{0}" で、数字ではなく "{2}" と評価された "{1}" に対して、数値比較を実行しようとしました。 - {StrBegin="MSB4086: "} - - MSB4086: Es wurde versucht, einen numerischen Vergleich für "{1}" auszuführen, der zu "{2}" anstatt zu einer Zahl in Bedingung "{0}" ausgewertet wird. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4007: The clause "{0}", specified in the "{1}" attribute is invalid. - MSB4007: "{1}" 属性で指定された句 "{0}" は無効です。 - {StrBegin="MSB4007: "}UE: This message is shown when the Condition on an element is invalid in some way -- e.g. syntax error, unrecognized operator. - - MSB4007: Die im {1}-Attribut festgelegte {0}-Klausel ist ungültig. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4130: The condition "{0}" may have been evaluated incorrectly in an earlier version of MSBuild. Please verify that the order of the AND and OR clauses is written as intended. To avoid this warning, add parentheses to make the evaluation order explicit. - MSB4130: 条件 "{0}" は旧バージョンの MSBuild で正しく評価されていない可能性があります。AND 句と OR 句が意図したとおりの順序で記述されていることを確認してください。この警告が発生しないようにするには、かっこを追加して評価順序を明示してください。 - {StrBegin="MSB4130: "} - - MSB4130: Die Bedingung "{0}" ist in einer früheren Version von MSBuild möglicherweise fehlerhaft ausgewertet worden. Stellen Sie sicher, dass die AND- und OR-Klauseln in der beabsichtigten Reihenfolge stehen. Damit diese Warnung nicht angezeigt wird, fügen Sie Klammern hinzu, um die Auswertungsreihenfolge explizit anzugeben. - - fuzzyMatch="101" wordcount="42" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4087: Specified condition "{0}" does not evaluate to a boolean. - MSB4087: 指定された条件 "{0}" はブール値として評価されません。 - {StrBegin="MSB4087: "} - - MSB4087: Die angegebene {0}-Bedingung wird nicht zu einem booleschen Wert ausgewertet. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4113: Specified condition "{0}" evaluates to "{1}" instead of a boolean. - MSB4113: 指定された条件 "{0}" はブール値ではなく、"{1}" として評価されます。 - {StrBegin="MSB4113: "} - - MSB4113: Die angegebene Bedingung {0} wird zu {1} statt zu einem booleschen Wert ausgewertet. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - {0}, line {1} - {0}、行 {1} - - - {0}, Zeile {1} - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - MSB4136: Error reading the toolset information from the configuration file "{0}". {1} - MSB4136: 構成ファイル "{0}" からツールセット情報を読み取り中にエラーが発生しました。{1} - {StrBegin="MSB4136: "} - - MSB4136: Fehler beim Lesen der Toolsetinformationen aus der Konfigurationsdatei "{0}". {1} - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4008: A conflicting assembly for the task assembly "{0}" has been found at "{1}". - MSB4008: タスク アセンブリ "{0}" に対して競合しているアセンブリが "{1}" で見つかりました。 - {StrBegin="MSB4008: "}UE: This message is shown when the type/class of a task cannot be resolved uniquely from a single assembly. - - MSB4008: Eine mit der Aufgabenassembly "{0}" in Konflikt stehende Assembly wurde in "{1}" gefunden. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4142: MSBuildToolsPath is not the same as MSBuildBinPath for the ToolsVersion "{0}" defined at "{1}". If both are present they must have the same value. - MSB4142: MSBuildToolsPath が、"{1}" で定義されている ToolsVersion "{0}" の MSBuildBinPath と同じではありません。両方が存在する場合は、同じ値である必要があります。 - {StrBegin="MSB4142: "} - - MSB4142: MSBuildToolsPath ist nicht identisch mit MSBuildBinPath für die bei "{1}" definierte ToolsVersion {0}. Wenn beide Pfade vorhanden sind, müssen sie identische Werte haben. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4097: The element <{0}> beneath element <{1}> may not have a custom XML namespace. - MSB4097: 要素 <{1}> の下の要素 <{0}> は、カスタム XML 名前空間を含んでいない可能性があります。 - {StrBegin="MSB4097: "} - - MSB4097: Das Element <{0}> unter Element <{1}> möglicherweise keinen benutzerdefinierten XML-Namespace. - - fuzzyMatch="15" wordcount="16" adjWordcount="13.6" curWordcount="13.6" - - - MSB4009: The default tasks file could not be successfully loaded. {0} - MSB4009: 既定タスクのファイルを正しく読み込めませんでした。{0} - {StrBegin="MSB4009: "}UE: This message is shown when one of the default tasks file (*.tasks) located alongside the MSBuild binaries cannot - be opened/parsed. "{0}" contains a message explaining why. The filename itself is not part of the message but is provided - separately to loggers. - LOCALIZATION: "{0}" is a message from some FX method and is already localized. - - MSB4009: Die Standardaufgabendatei konnte nicht geladen werden. {0} - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4010: The "{0}" files could not be successfully loaded from their expected location "{1}". Default tasks will not be available. {2} - MSB4010: "{0}" ファイルを予期された場所 "{1}" から正しく読み込めませんでした。既定タスクは利用できません。{2} - {StrBegin="MSB4010: "}UE: This message is shown when the default tasks files that are located alongside the MSBuild binaries cannot be - found, either because they don't exist, or because of lack of permissions. "{2}" contains a message explaining why. - LOCALIZATION: "{2}" is a message from some FX method and is already localized. - - MSB4010: Die {0}-Dateien konnten nicht vom erwarteten Speicherplatz "{1}" geladen werden. Standardaufgaben sind nicht verfügbar. {2} - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - MSB4140: Default tools version is specified in neither the registry nor the configuration file. - MSB4140: 既定のツール バージョンがレジストリにも構成ファイルにも指定されていません。 - {StrBegin="MSB4140: "} - - MSB4140: Die Standardtoolsversion ist weder in der Registrierung noch in der Konfigurationsdatei angegeben. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4133: A default tools version "{0}" was specified, but its definition could not be found. - MSB4133: 既定のツール バージョン "{0}" が指定されましたが、その定義が見つかりませんでした。 - {StrBegin="MSB4133: "} - - MSB4133: Eine Standardtoolsversion "{0}" wurde angegeben, aber ihre Definition konnte nicht gefunden werden. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - MSB4080: The value "{0}" of the "PropertyName" attribute in element <Output> contains a "$" character. If you intended to use a property name then remove the $( ) around the property name. - MSB4080: 要素 <Output> の "PropertyName" 属性の値 "{0}" は "$" 文字を含んでいます。プロパティ名を使用する場合は、$( ) をプロパティ名の周りから削除してください。 - {StrBegin="MSB4080: "}UE: This message is shown when an output tag has an property name that contains an $. They probably typed $(foo) instead of foo in the PropertyName. LOCALIZATION: Output and PropertyName should not be localized. - - MSB4080: Der Wert "{0}" "PropertyName-Attribut im Element < Output >"$"-Zeichen enthält. Wenn Sie auf einen Eigenschaftennamen verwenden und entfernen Sie anschließend die ($), um den Eigenschaftennamen. - - fuzzyMatch="15" wordcount="32" adjWordcount="27.2" curWordcount="27.2" - - - MSB4011: There is a circular reference involving the import of file "{0}". This file may have been imported more than once, or you may have attempted to import the main project file. All except the first instance of this file will be ignored. - MSB4011: ファイル "{0}" のインポートで循環参照が存在します。このファイルは 2 度以上インポートされた可能性があるか、メイン プロジェクト ファイルをインポートしようとした可能性があります。このファイルの最初のインスタンス以外は無視されます。 - {StrBegin="MSB4011: "} - - MSB4011: Es besteht eine Ringabhängigkeit im Zusammenhang mit dem Import der Datei {0}. Diese Datei wurde unter Umständen mehrmals importiert, oder es wurde versucht, die Hauptprojektdatei zu importieren. Alle außer der ersten Instanz dieser Datei werden ignoriert. - - fuzzyMatch="101" wordcount="43" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4079: The <ProjectExtensions> element occurs more than once. - MSB4079: <ProjectExtensions> 要素が複数見つかりました。 - {StrBegin="MSB4079: "} - - MSB4079: Das Element < ProjectExtensions > tritt mehr als einmal. - - fuzzyMatch="15" wordcount="9" adjWordcount="7.65" curWordcount="7.65" - - - MSB4012: The expression "{0}" cannot be used in this context. Item lists cannot be concatenated with other strings where an item list is expected. Use a semicolon to separate multiple item lists. - MSB4012: 式 "{0}" はこのコンテキストでは使用できません。項目一覧が予期される場所で、項目一覧を他の文字列と連結することはできません。セミコロンを使用して、複数の項目一覧を分離してください。 - {StrBegin="MSB4012: "}UE: This message is shown when the user does not properly specify an item list when an item list is expected - e.g. "badprefix@(foo)badsuffix" instead of "prefix; @(foo); suffix" - - MSB4012: Der Ausdruck {0} kann in diesem Kontext nicht verwendet werden. Elementlisten können nicht mit anderen Zeichenfolgen verkettet werden, wenn eine Elementliste erwartet wird. Verwenden Sie ein Semikolon, um mehrere Elementlisten voneinander zu trennen. - - fuzzyMatch="101" wordcount="32" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Need to specify the project file name. - プロジェクト ファイル名を指定しなければなりません。 - UE: This message is shown when the user calls into the engine to build a project without specifying a filename. - - Geben Sie den Projektdateinamen an. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - end of input - 入力の終わり - This is the name of the "EndOfInput" token. It is displayed in quotes as the - unexpected char or token when the end of a conditional was unexpectedly reached. - - Ende der Eingabe - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - The previous error was converted to a warning because the task was called with ContinueOnError=true. - タスクが ContinueOnError=true を伴って呼び出されたため、前のエラーは警告に変換されました。 - - - Der vorherige Fehler wurde in eine Warnung umgewandelt, da die Aufgabe mit ContinueOnError=true aufgerufen wurde. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - {0} Error(s) - {0} エラー - - - {0} Fehler - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4159: Error creating the toolset "{0}". {1} - MSB4159: ツールセット "{0}" の作成中にエラーが発生しました。{1} - {StrBegin="MSB4159: "} - - MSB4159: Fehler beim Erstellen des Toolsets "{0}". {1} - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4146: Cannot evaluate the property expression "{0}" found at "{1}". {2} - MSB4146: "{1}" で見つかったプロパティ式 "{0}" を評価できません。{2} - {StrBegin="MSB4146: "} - - MSB4146: Der bei "{1}" gefundene Eigenschaftsausdruck "{0}" kann nicht ausgewertet werden. {2} - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - The <{0}> tag is no longer supported as a child of the <Project> element. Place this tag within a target, and add the name of the target to the "InitialTargets" attribute of the <Project> element. - <{0}> タグは <Project> 要素の子としてサポートされません。このタグをターゲット内に配置して、ターゲット名を <Project> 要素の "InitialTargets" 属性に追加してください。 - - - Das <{0}>-Tag nicht als untergeordnetes Element des < Project >-Elements unterstützt. Platzieren Sie dieses Tag in einem Ziel und fügen Sie den Namen des Ziels InitialTargets-Attribut des < Project >-Elements hinzu. - - fuzzyMatch="15" wordcount="38" adjWordcount="32.3" curWordcount="32.3" - - - MSB4100: Expected "{0}" to evaluate to a boolean instead of "{1}", in condition "{2}". - MSB4100: "{0}" は条件 "{2}" で、"{1}" ではなくブール値として評価される必要があります。 - {StrBegin="MSB4100: "} - - MSB4100: Das Ergebnis der Auswertung von {0} war {1}, es wurde jedoch ein boolescher Wert in der {2}-Bedingung erwartet. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4028: The "{0}" task's outputs could not be retrieved from the "{1}" parameter. {2} - MSB4028: "{0}" タスクの出力を "{1}" パラメーターから取得できませんでした。{2} - {StrBegin="MSB4028: "} - - MSB4028: Die Ausgaben der {0}-Aufgabe konnten nicht aus dem {1}-Parameter abgerufen werden. {2} - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4014: The build was aborted because of an internal failure. - MSB4014: 内部エラーのため、ビルドは中止されました。 - {StrBegin="MSB4014: "}UE: This message is shown when an unhandled exception terminates the build. The cause is most likely a programming - error in the build engine. - - MSB4014: Das Erstellen wurde aufgrund eines internen Fehlers abgebrochen. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4015: The build was aborted because the "{0}" logger failed unexpectedly during shutdown. - MSB4015: シャットダウン中に "{0}" logger に失敗したため、ビルドは中止されました。 - {StrBegin="MSB4015: "}UE: This message is used for a special exception that is thrown when a logger fails while shutting down (most likely - because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a special - exception to abort the build. - - MSB4015: Das Erstellen wurde abgebrochen, da für die {0}-Protokollierung beim Herunterfahren ein unerwarteter Fehler aufgetreten ist. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4016: The build was aborted because the "{0}" logger failed unexpectedly during initialization. - MSB4016: 初期化中に "{0}" logger に失敗したため、ビルドは中止されました。 - {StrBegin="MSB4016: "}UE: This message is used for a special exception that is thrown when a logger fails while initializing itself (most - likely because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a - special exception to abort the build. - - MSB4016: Das Erstellen wurde abgebrochen, da für die {0}-Protokollierung bei der Initialisierung ein unerwarteter Fehler aufgetreten ist. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4017: The build was aborted because of an unexpected logger failure. - MSB4017: 予期しない logger エラーのため、ビルドは中止されました。 - {StrBegin="MSB4017: "}UE: This message is used for a special exception that is thrown when a logger fails while logging an event (most - likely because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a - special exception to abort the build. - - MSB4017: Das Erstellen wurde wegen eines unerwarteten Protokollierungsfehlers abgebrochen. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4018: The "{0}" task failed unexpectedly. - MSB4018: "{0}" タスクが予期せずに失敗しました。 - {StrBegin="MSB4018: "}UE: This message is shown when a task terminates because of an unhandled exception. The cause is most likely a - programming error in the task; however, it is also possible that the unhandled exception originated in the engine, and was - surfaced through the task when the task called into the engine. - - MSB4018: Unerwarteter Fehler bei der {0}-Aufgabe. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4165: Failed to receive a response from the child node "{0}" in the timeout period "{1}" ms. Shutting down. - MSB4165: 子ノード "{0}" からの応答をタイムアウト期限の "{1}" ミリ秒以内に受信できませんでした。シャットダウンしています。 - {StrBegin="MSB4165: "} - - MSB4165: Vom untergeordneten Knoten "{0}" wurde innerhalb des Zeitlimits von "{1}" ms keine Antwort empfangen. Herunterfahren. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4088: Condition "{0}" is improperly constructed. - MSB4088: 条件 "{0}" は正しく構築されていません。 - {StrBegin="MSB4088: "} - - MSB4088: Die {0}-Bedingung ist falsch konstruiert. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4105: Found an unexpected character '{2}' at position {1} in condition "{0}". Did you intend to use "=="? - MSB4105: 予期しない文字 '{2}' が、条件 "{0}" の場所 {1} で見つかりました。"==" を指定しようとしましたか? - {StrBegin="MSB4105: "} - - MSB4105: Ein unerwartetes Zeichen {2} wurde an Position {1} in der {0}-Bedingung gefunden. Wollten Sie "==" verwenden? - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - MSB4106: Expected an item list at position {1} in condition "{0}". Did you forget the closing parenthesis? - MSB4106: 条件 "{0}" の場所 {1} に項目一覧が必要です。閉じかっこが入力されていることを確認してください。 - {StrBegin="MSB4106: "} - - MSB4106: Eine Elementliste wurde an Position {1} in Bedingung {0} erwartet. Haben Sie die schließende Klammer vergessen? - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - MSB4107: Expected an item list at position {1} in condition "{0}". Did you forget the opening parenthesis after the '@'? To use a literal '@', use '%40' instead. - MSB4107: 条件 "{0}" の場所 {1} に項目一覧が必要です。始めかっこが '@' の後に入力されていることを確認してください。リテラル '@' を使用するには、'%40' を代わりに使用してください。 - {StrBegin="MSB4107: "} - - MSB4107: Eine Elementliste wurde an Position {1} in Bedingung {0} erwartet. Haben Sie die öffnende Klammer hinter dem Zeichen "@" vergessen? Wenn Sie ein literales "@" verwenden möchten, geben Sie "%40" ein. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4108: Expected an item list at position {1} in condition "{0}". Did you forget to close a quote inside the item list expression? - MSB4108: 条件 "{0}" の場所 {1} に項目一覧が必要です。項目一覧式の中の引用符が閉じられているか確認してください。 - {StrBegin="MSB4108: "} - - MSB4108: Eine Elementliste wurde an Position {1} in Bedingung {0} erwartet. Haben Sie das schließende Anführungszeichen innerhalb des Elementlistenausdrucks vergessen? - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - MSB4109: Expected a property at position {1} in condition "{0}". Did you forget the closing parenthesis? - MSB4109: 条件 "{0}" の場所 {1} にプロパティが必要です。閉じかっこが入力されていることを確認してください。 - {StrBegin="MSB4109: "} - - MSB4109: Eine Eigenschaft wurde an Position {1} in Bedingung {0} erwartet. Haben Sie die schließende Klammer vergessen? - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB4110: Expected a property at position {1} in condition "{0}". Did you forget the opening parenthesis after the '$'? To use a literal '$', use '%24' instead. - MSB4110: 条件 "{0}" の場所 {1} にプロパティが必要です。始めかっこが '$' の後に入力されていることを確認してください。リテラル '$' を使用するには、'%24' を代わりに使用してください。 - {StrBegin="MSB4110: "} - - MSB4110: Eine Eigenschaft wurde an Position {1} in Bedingung {0} erwartet. Haben Sie die öffnende Klammer hinter dem Zeichen "$" vergessen? Wenn Sie eine literales "$" verwenden möchten, geben Sie "%24" ein. - - fuzzyMatch="101" wordcount="27" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4101: Expected a closing quote after position {1} in condition "{0}". - MSB4101: 条件 "{0}" の場所 {1} の後に終わり引用符が必要です。 - {StrBegin="MSB4101: "} - - MSB4101: Es wurde ein schließendes Anführungszeichen hinter Position {1} in Bedingung {0} erwartet. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4019: The imported project "{0}" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. - MSB4019: インポートされたプロジェクト "{0}" が見つかりませんでした。<Import> 宣言のパスが正しいかどうか、およびファイルがディスクに存在しているかどうかを確認してください。 - {StrBegin="MSB4019: "}LOCALIZATION: <Import> should not be localized. - - MSB4019: Das importierte Projekt "{0}" wurde nicht gefunden. Bestätigen Sie den Pfad in der Deklaration < Import > und die Datei auf dem Datenträger vorhanden ist. - - fuzzyMatch="15" wordcount="26" adjWordcount="22.1" curWordcount="22.1" - - - MSB4089: Incorrect number of arguments to function in condition "{0}". Found {1} argument(s) when expecting {2}. - MSB4089: 条件 "{0}" の関数への引数の数が正しくありません。引数は {1} 個見つかりましたが、{2} 個必要です。 - {StrBegin="MSB4089: "} - - MSB4089: Falsche Anzahl von Argumenten für eine Funktion in der Bedingung "{0}". {1} Argument(e) gefunden, obwohl {2} erwartet wurde(n). - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - The "{0}" object specified does not belong to the correct "{1}" object. - 指定された "{0}" オブジェクトは正しい "{1}" オブジェクトに属していません。 - - - Das angegebene {0}-Objekt gehört nicht zum korrekten {1}-Objekt. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4020: The value "{0}" of the "{1}" attribute in element <{2}> is invalid. - MSB4020: 要素 <{2}> の "{1}" 属性の値 "{0}" は無効です。 - {StrBegin="MSB4020: "}UE: This is a generic message that is displayed when we find a project element with an incorrect value for one of its - attributes e.g. <Import Project=""> -- the value of Project should not be an empty string. - - MSB4020: Der Wert "{0}" von der "{1}" Attribut im Element <{2}> ist ungültig. - - fuzzyMatch="15" wordcount="14" adjWordcount="11.9" curWordcount="11.9" - - - MSB4102: The value "{0}" of the "{1}" attribute in element <{2}> is invalid. {3} - MSB4102: 要素 <{2}> の "{1}" 属性の値 "{0}" は無効です。{3} - {StrBegin="MSB4102: "}UE: This is a generic message that is displayed when we find a project element with an incorrect value for one of its - attributes. At the end of the message we show the exception text we got trying to use the value. - - MSB4102: Der Wert "{0}" von der "{1}" Attribut im Element <{2}> ist ungültig. {3} - - fuzzyMatch="15" wordcount="15" adjWordcount="12.75" curWordcount="12.75" - - - MSB4021: The "ContinueOnError" attribute of the "{0}" task is not valid. {1} - MSB4021: "{0}" タスクの "ContinueOnError" 属性は無効です。{1} - {StrBegin="MSB4021: "}LOCALIZATION: "ContinueOnError" should not be localized. "{1}" is a message from another exception explaining the problem. - - MSB4021: Das ContinueOnError-Attribut für die {0}-Aufgabe ist ungültig. {1} - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4139: Invalid value for default ToolsVersion is specified in registry key "{0}". - MSB4139: レジストリ キー "{0}" で指定されている既定の ToolsVersion の値が無効です。 - {StrBegin="MSB4139: "} - - MSB4139: Im Registrierungsschlüssel "{0}" ist ein ungültiger Wert für die Standard-ToolsVersion angegeben. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4022: The result "{0}" of evaluating the value "{1}" of the "{2}" attribute in element <{3}> is not valid. - MSB4022: 要素 <{3}> 内の属性 "{2}" の値 "{1}" を評価した結果 "{0}" は無効です。 - {StrBegin="MSB4022: "}UE: This message is shown when the engine is checking the correctness of the value (after evaluating embedded - properties/items) assigned to an XML attribute of an XML element in the project file. - - MSB4022: Das Ergebnis "{0}"der Auswertung des Werts"{1}" von der "{2}" Attribut im Element <{3}> ist ungültig. - - fuzzyMatch="15" wordcount="20" adjWordcount="17" curWordcount="17" - - - "{0}" is not a valid event category. To raise a custom event, use the "{1}" category. - "{0}" は有効なイベント カテゴリではありません。カスタム イベントを発生させるには、"{1}" カテゴリを使用してください。 - - - {0} ist keine gültige Ereigniskategorie. Verwenden Sie die {1}-Kategorie, um ein benutzerdefiniertes Ereignis auszulösen. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - "{0}" is not a valid importance level for events. - "{0}" はイベントの有効な重要度ではありません。 - - - {0} ist kein gültiger Wert für die Bedeutung eines Ereignisses. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4104: Failed to write to log file "{0}". {1} - MSB4104: ログ ファイル "{0}" に書き込めませんでした。{1} - {StrBegin="MSB4104: "}UE: This is shown when the File Logger can't create or write to the file it was instructed to log to. - - MSB4104: Fehler beim Schreiben in die Protokollierungsdatei "{0}". {1} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4024: The imported project file could not be loaded. {0} - MSB4024: インポートされたプロジェクト ファイルを読み込めませんでした。{0} - {StrBegin="MSB4024: "}UE: This message is shown when an imported project file cannot be loaded because of incorrect XML. The project - filename is not part of the message because it is provided separately to loggers. - LOCALIZATION: {0} is a localized message from the CLR/FX explaining why the project is invalid. - - MSB4024: Die importierte Projektdatei konnte nicht geladen werden. {0} - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - Operation invalid for a persisted item group. - 持続項目グループには無効な操作です。 - - - Ungültiger Vorgang für eine persistente Elementgruppe. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Operation invalid for a virtual item group. - 仮想項目グループには無効な操作です。 - - - Ungültiger Vorgang für eine virtuelle Elementgruppe. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4071: The value Importance="{0}" in the <Message> element is invalid. Valid values are: High, Normal and Low. - MSB4071: <Message> 要素の値 Importance="{0}" は無効です。有効な値は、High、Normal および Low です。 - {StrBegin="MSB4071: "}UE: This message is shown when a user specifies a value for the importance attribute of Message which is not valid. - The importance enumeration is: High, Normal and Low. Specifying any other importance will result in this message being shown - LOCALIZATION: "Importance" should not be localized. - "Message" should not be localized. - High should not be localized. - Normal should not be localized. - Low should not be localized. - - MSB4071: Der Wert Importance = "{0}" in < Nachricht > Element ist ungültig. Gültige Werte sind: hoch, Normal und niedrig. - - fuzzyMatch="15" wordcount="18" adjWordcount="15.3" curWordcount="15.3" - - - MSB4025: The project file could not be loaded. {0} - MSB4025: プロジェクト ファイルを読み込めませんでした。{0} - {StrBegin="MSB4025: "}UE: This message is shown when the project file given to the engine cannot be loaded because the filename/path is - invalid, or due to lack of permissions, or incorrect XML. The project filename is not part of the message because it is - provided separately to loggers. - LOCALIZATION: {0} is a localized message from the CLR/FX explaining why the project is invalid. - - MSB4025: Die Projektdatei konnte nicht geladen werden. {0} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4147: The property "{0}" at "{1}" is invalid. {2} - MSB4147: "{1}" にあるプロパティ "{0}" が無効です。{2} - {StrBegin="MSB4147: "} - - MSB4147: Die {0}-Eigenschaft bei "{1}" ist ungültig. {2} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - "{0}" is an invalid "ProjectFileEncoding" value. - "{0}" は "ProjectFileEncoding" には無効な値です。 - LOCALIZATION: "ProjectFileEncoding" should not be localized. - - {0} ist ein ungültiger ProjectFileEncoding-Wert. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4143: The expression "{0}" cannot be evaluated. {1} - MSB4143: 式 "{0}" は評価できません。{1} - {StrBegin="MSB4143: "} - UE: This message is shown when the user attempts to provide an expression like "$(Registry:HKEY_LOCAL_MACHINE\Software\Vendor\Tools@TaskLocation)" - LOCALIZATION: "{0}" is the expression that was bad. "{1}" is a message from an FX exception that describes why the expression is bad. - - - MSB4143: Der Ausdruck "{0}" kann nicht ausgewertet werden. {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4184: The expression "{0}" cannot be evaluated. {1} - MSB4184: 式 "{0}" を評価できません。{1} - {StrBegin="MSB4184: "} - Single quotes as the expression will typically have double quotes in it. - UE: This message is shown when the user attempts to provide an expression like "$(SomeProperty.ToLower())" - LOCALIZATION: "{0}" is the expression that was bad. "{1}" is a message from an FX exception that describes why the expression is bad. - - - MSB4184: Der Ausdruck "{0}" kann nicht ausgewertet werden. {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4185: The function "{0}" on type "{1}" has not been enabled for execution. - MSB4185: 型 "{1}" の関数 "{0}" の実行は有効になっていません。 - {StrBegin="MSB4185: "} - UE: This message is shown when the user attempts to provide an expression like "$([System.DateTime]::Now)", but the expression has not been enabled - LOCALIZATION: "{0}" is the static function name, "{1}" is the .NET Framework type name - - - MSB4185: Die {0}-Funktion für den {1}-Typ wurde nicht für die Ausführung aktiviert. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4186: Invalid static method invocation syntax: "{0}". Static method invocation should be of the form: $([FullTypeName]::Method()), e.g. $([System.IO.Path]::Combine(`a`, `b`)) - MSB4186: 無効な静的メソッド呼び出し構文: "{0}"。静的メソッド呼び出しは $([FullTypeName]::Method()) の形式である必要があります。例: $([System.IO.Path]::Combine(`a`, `b`)) - {StrBegin="MSB4186: "} - UE: This message is shown when the user attempts to call a static method on a type, but has used the incorrect syntax - LOCALIZATION: "{0}" is the function expression which is in error - - - MSB4186: Ungültige Aufrufsyntax für statische Methode: "{0}". Für den Aufruf statischer Methoden muss folgendes Format verwendet werden: $([vollständiger Typname]::Methode()), z. B. $([System.IO.Path]::Combine(`a`, `b`)) - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4070: The schema "{0}" is not valid. {1} - MSB4070: スキーマ "{0}" は無効です。{1} - {StrBegin="MSB4070: "}UE: This message is shown when the schema file provided for the validation of a project is itself not valid. - LOCALIZATION: "{0}" is the schema file path. "{1}" is a message from an FX exception that describes why the schema file is bad. - - MSB4070: Das Schema "{0}" ist nicht gültig. {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4026: The "{0}={1}" parameter for the "{2}" task is invalid. - MSB4026: "{2}" タスクの "{0}={1}" パラメーターは無効です。 - {StrBegin="MSB4026: "}UE: This message is displayed when a task has an invalid parameter that cannot be initialized. - - MSB4026: Der {0}={1}-Parameter für die {2}-Aufgabe ist ungültig. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4027: The "{0}" task generated invalid items from the "{1}" output parameter. {2} - MSB4027: "{0}" タスクは "{1}" 出力パラメーターから無効な項目を生成しました。{2} - {StrBegin="MSB4027: "} - - MSB4027: Die {0}-Aufgabe generierte ungültige Elemente aus dem {1}-Ausgabeparameter. {2} - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4029: The "{0}" task has an invalid output specification. The "TaskParameter" attribute is required, and either the "ItemName" or "PropertyName" attribute must be specified (but not both). - MSB4029: "{0}" タスクには無効な出力指定があります。"TaskParameter" 属性は必要であり、そのうえ "ItemName" か "PropertyName" 属性のいずれかを指定しなければなりません。 - {StrBegin="MSB4029: "}LOCALIZATION: "TaskParameter", "ItemName" and "PropertyName" should not be localized. - - MSB4029: Die {0}-Aufgabe enthält eine ungültige Ausgabespezifikation. Das TaskParameter-Attribut ist erforderlich, und es muss entweder das ItemName- oder PropertyName-Attribut angegeben werden (jedoch nicht beide). - - fuzzyMatch="101" wordcount="27" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4030: "{0}" is an invalid value for the "{1}" parameter of the "{3}" task. The "{1}" parameter is of type "{2}". - MSB4030: "{0}" は "{3}" タスクの "{1}" パラメーターには無効な値です。"{1}" パラメーターは型 "{2}" です。 - {StrBegin="MSB4030: "}UE: This error is shown when a type mis-match occurs between the value assigned to task parameter in the project file - and the type of the .NET property that corresponds to the task parameter. For example, if an int task parameter called "Count" - is assigned the value "x", this error would be displayed: <MyTask Count="x" /> - - MSB4030: "{0}" ist ein ungültiger Wert für den {1}-Parameter der {3}-Aufgabe. Der {1}-Parameter ist vom Typ "{2}". - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - MSB4137: Invalid value specified in the configuration file at "{0}". Property name or tools version name is an empty string. - MSB4137: "{0}" の構成ファイル内に指定されている値が無効です。プロパティ名またはツールのバージョン名が空の文字列になっています。 - {StrBegin="MSB4137: "} - - MSB4137: In der Konfigurationsdatei ist bei "{0}" ein ungültiger Wert angegeben. Der Eigenschaftenname oder der Toolsversionname ist eine leere Zeichenfolge. - - fuzzyMatch="100" wordcount="20" adjWordcount="5" curWordcount="5" tmLabel="N''" - - - MSB4103: "{0}" is not a valid logger verbosity level. - MSB4103: "{0}" は有効なロガー詳細レベルではありません。 - {StrBegin="MSB4103: "} - - MSB4103: "{0}" ist kein gültiger Ausführlichkeitsgrad für die Protokollierung. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4163: <ItemDefinitionGroup> is not allowed inside a target. - MSB4163: <ItemDefinitionGroup> は、ターゲットの内部では許可されていません。 - {StrBegin="MSB4163: "} - - MSB4163: < ItemDefinitionGroup > ist in einem Ziel nicht zulässig. - - fuzzyMatch="15" wordcount="9" adjWordcount="7.65" curWordcount="7.65" - - - The specified item does not belong to the current item group. - 指定された項目は、現在の項目グループに属していません。 - - - Das angegebene Element gehört nicht zu der aktuellen Elementgruppe. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4096: The item "{0}" in item list "{1}" does not define a value for metadata "{2}". In order to use this metadata, either qualify it by specifying %({1}.{2}), or ensure that all items in this list define a value for this metadata. - MSB4096: 項目一覧 "{1}" の項目 "{0}" はメタデータ "{2}" に対して値を定義していません。このメタデータを使用するには、%({1}.{2}) を指定してメタデータを限定するか、またはこの一覧のすべての項目がこのメタデータに対して値を定義していることを確認してください。 - {StrBegin="MSB4096: "} - - MSB4096: Das Element "{0}" in der Elementliste "{1}" definiert keinen Wert für die {2}-Metadaten. Wenn Sie diese Metadaten verwenden möchten, qualifizieren Sie sie, indem Sie %({1}.{2}) angeben, oder vergewissern Sie sich, dass alle Elemente in der Liste einen Wert für diese Metadaten definieren. - - fuzzyMatch="101" wordcount="42" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4099: A reference to an item list at position {1} is not allowed in this condition "{0}". - MSB4099: 場所 {1} での項目一覧への参照は、この条件 "{0}" では許可されていません。 - {StrBegin="MSB4099: "} - - MSB4099: Ein Verweis auf eine Elementliste an Position {1} ist in dieser {0}-Bedingung nicht zulässig. - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - MSB4033: "{0}" is a reserved item metadata, and cannot be redefined as a custom metadata on the item. - MSB4033: "{0}" は予約されている項目メタデータであるため、項目のカスタム メタデータとして再定義できません。 - {StrBegin="MSB4033: "} - - MSB4033: "{0}" sind reservierte Elementmetadaten und können nicht als benutzerdefinierte Metadaten für das Element neu definiert werden. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - An InternalLoggerException can only be thrown by the MSBuild engine. The public constructors of this class cannot be used to create an instance of the exception. - InternalLoggerException は MSBuild エンジンによってのみスローされることができます。このクラスのパブリック コンストラクターを、例外のインスタンスを作成するために使用することはできません。 - UE: This message is shown when a user tries to instantiate a special exception called InternalLoggerException through the OM -- - only the engine is allowed to create and throw this exception. - LOCALIZATION: "InternalLoggerException" and "MSBuild" should not be localized. - - Eine InternalLoggerException kann nur durch das MSBuild-Modul ausgelöst werden. Die öffentlichen Konstruktoren dieser Klasse können nicht verwendet werden, um eine Instanz der Ausnahme zu erstellen. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Initial Items: - 初期項目: - - - Ursprüngliche Elemente: - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4083: Expected a Condition attribute on element "{0}". - MSB4083: 条件属性が要素 "{0}" で必要です。 - {StrBegin="MSB4083: "} - - MSB4083: Es wurde ein Bedingungsattribut für das {0}-Element erwartet. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4164: The value "{0}" of metadata "{1}" contains an item list expression. Item list expressions are not allowed on default metadata values. - MSB4164: メタデータ "{1}" の値 "{0}" には、項目一覧式が含まれています。項目一覧式は、メタデータのデフォルト値では許可されていません。 - {StrBegin="MSB4164: "} - - MSB4164: Der Wert "{0}" der {1}-Metadaten enthält einen Elementlistenausdruck. Elementlistenausdrücke sind nicht als Standardwerte für Metadaten zulässig. - - fuzzyMatch="100" wordcount="22" adjWordcount="5.5" curWordcount="5.5" tmLabel="N''" - - - MSBuild is expecting a valid "{0}" object. - MSBuild は有効な "{0}" オブジェクトを必要としています。 - - - MSBuild erwartet ein gültiges {0}-Objekt. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4035: The required attribute "{0}" is missing from element <{1}>. - MSB4035: 要素 <{1}> に必要な属性 "{0}" が存在しません。 - {StrBegin="MSB4035: "}UE: This message is shown when a user leaves off a required attribute from a project element - e.g. <UsingTask AssemblyName="foo"> -- this is missing the "TaskName" attribute. - - MSB4035: Das erforderliche Attribut "{0}"-Element fehlt <{1}>. - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB4036: The "{0}" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "{1}" directory. - MSB4036: "{0}" タスクが見つかりませんでした。次のことを確認してください。1.) プロジェクト ファイルの中のタスク名がタスク クラス名と同一である。2.) タスク クラスが public であり Microsoft.Build.Framework.ITask インターフェイスを実装する。3.) プロジェクト ファイルまたは "{1}" ディレクトリに配置された *.tasks ファイルの中の <UsingTask> でタスクが正しく宣言されている。 - {StrBegin="MSB4036: "}LOCALIZATION: <UsingTask> and "*.tasks" should not be localized. - - MSB4036: Die "{0}" Task wurde nicht gefunden. Überprüfen Sie Folgendes: 1.) der Name der Aufgabe in der Projektdatei entspricht dem Namen der Aufgabenklasse. 2) die Aufgabenklasse ist "public" und implementiert die Microsoft.Build.Framework.ITask-Schnittstelle. 3) die Aufgabe korrekt mit < UsingTask > deklariert, in der Projektdatei oder in den Tasks-Dateien der "{1}" Verzeichnis. - - fuzzyMatch="15" wordcount="64" adjWordcount="54.4" curWordcount="54.4" - - - MSB4141: MSBuildToolsPath is not specified for the ToolsVersion "{0}" defined at "{1}", or the value specified evaluates to the empty string. - MSB4141: "{1}" で定義されている ToolsVersion "{0}" に MSBuildToolsPath が指定されていないか、指定された値が空の文字列として評価されています。 - {StrBegin="MSB4141: "} - - MSB4141: MSBuildToolsPath ist für die bei "{1}" definierte ToolsVersion {0} nicht angegeben, oder der angegebene Wert wird zu einer leeren Zeichenfolge ausgewertet. - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - MSB4031: The "MSBuildVersion" attribute is deprecated. If the project is authored in the MSBuild 2003 format, please remove the attribute from the <Project> tag. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format. - MSB4031: "MSBuildVersion" 属性を使用できません。プロジェクトが MSBuild 2003 形式で作成されている場合、<Project> タグから属性を削除してください。プロジェクトが古い 1.0 または 1.2 形式で作成された場合は、MSBuild 2003 形式に変換してください。 - {StrBegin="MSB4031: "}UE: This message is shown for projects that still contain the "MSBuildVersion" attribute in their <Project> - tag. We no longer need this attribute because the project's XML namespace (i.e. the "xmlns" attribute) gives us all the - version information we need. - LOCALIZATION: "MSBuild", "MSBuildVersion" and <Project> should not be localized. - - MSB4031: Das Attribut "MSBuildVersion" ist veraltet. Wenn das Projekt im Format MSBuild 2003 erstellt wurde, entfernen Sie das Attribut aus dem Tag < Project >. Wenn das Projekt im alten Format 1.0 oder 1.2 erstellt wurde, konvertieren Sie es in das MSBuild 2003-Format. - - fuzzyMatch="15" wordcount="45" adjWordcount="38.25" curWordcount="38.25" - - - MSB4144: Multiple definitions were found for the toolset "{0}". - MSB4144: ツールセット "{0}" に対して複数の定義が見つかりました。 - {StrBegin="MSB4144: "} - - MSB4144: Für das Toolset wurden mehrere Definitionen gefunden "{0}". - - fuzzyMatch="15" wordcount="9" adjWordcount="7.65" curWordcount="7.65" - - - MSB4145: Multiple definitions were found for the property "{0}". - MSB4145: プロパティ "{0}" に対して複数の定義が見つかりました。 - {StrBegin="MSB4145: "} - - MSB4145: Für die {0}-Eigenschaft wurden mehrere Definitionen gefunden. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4082: Choose has more than one <Otherwise> element. - MSB4082: Choose には、2 つ以上の <Otherwise> 要素があります。 - {StrBegin="MSB4082: "} - - MSB4082: Wählen Sie mehrere < Otherwise >-Element enthält. - - fuzzyMatch="15" wordcount="9" adjWordcount="7.65" curWordcount="7.65" - - - This method is only valid for persisted <{0}> elements. - このメソッドは、持続する <{0}> 要素にのみ有効です。 - - - Diese Methode ist nur gültig für beibehalten <{0}> Elemente. - - fuzzyMatch="15" wordcount="10" adjWordcount="8.5" curWordcount="8.5" - - - This method is only valid for virtual property groups, not <{0}> elements. - このメソッドは、仮想プロパティ グループにのみ有効であり、<{0}> 要素には有効ではありません。 - - - Diese Methode gilt nur für virtuelle Eigenschaftengruppen nicht <{0}> Elemente. - - fuzzyMatch="15" wordcount="13" adjWordcount="11.05" curWordcount="11.05" - - - MSB4038: The element <{0}> must be last under element <{1}>. Found element <{2}> instead. - MSB4038: 要素 <{0}> は要素 <{1}> の最後になければなりません。要素 <{2}> が見つかりました。 - {StrBegin="MSB4038: "} - - MSB4038: Das Element <{0}> muss unter Element <{1}>. Element wurde gefunden <{2}> statt. - - fuzzyMatch="15" wordcount="17" adjWordcount="14.45" curWordcount="14.45" - - - MSB4138: Non-string data was specified at the registry location "{0}". - MSB4138: レジストリの場所 "{0}" に文字列以外のデータが指定されています。 - {StrBegin="MSB4138: "} - - MSB4138: Am Registrierungsspeicherort "{0}" wurden Daten angegeben, die keine Zeichenfolge sind. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4039: No "{0}" element was found in the project file. - MSB4039: "{0}" 要素がプロジェクト ファイルで見つかりませんでした。 - {StrBegin="MSB4039: "} - - MSB4039: Das {0}-Element wurde in der Projektdatei nicht gefunden. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4040: There is no target in the project. - MSB4040: プロジェクトにターゲットがありません。 - {StrBegin="MSB4040: "} - - MSB4040: Das Projekt enthält kein Ziel. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Removing the "{0}" attribute of an item is not allowed. - 項目の "{0}" 属性を削除することは許可されていません。 - - - Das Löschen des {0}-Attributs eines Elements ist nicht zulässig. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - The object passed in is not part of the project. - 渡されたオブジェクトはプロジェクトの一部ではありません。 - - - Das übergebene Objekt ist nicht Teil des Projekts. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - Overriding target "{0}" in project "{1}" with target "{2}" from project "{3}". - プロジェクト "{1}" のターゲット "{0}" をプロジェクト "{3}" からのターゲット "{2}" でオーバーライドしています。 - - - Das Ziel "{0}" im Projekt "{1}" wird durch das Ziel "{2}" aus dem Projekt "{3}" außer Kraft gesetzt. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4167: The parent process unexpectedly exited. Shutting down child node "{0}". - MSB4167: 親プロセスは予期せずに終了しました。子ノード "{0}" をシャットダウンしています。 - {StrBegin="MSB4167: "} - - MSB4167: Der übergeordnete Prozess wurde unerwartet beendet. Der untergeordnete Knoten "{0}" wird heruntergefahren. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - {0} ms {1} {2} calls - {0} ミリ秒 {1} {2} 回呼び出し - - - {0} ms {1} {2} Aufrufe - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - (* = timing was not recorded because of reentrancy) - (* = 再入によりタイミングは記録されませんでした) - - - (* = Zeit wurde aufgrund des erneuten Eintretens nicht aufgezeichnet) - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - This project object has been unloaded from the MSBuild engine and is no longer valid. - プロジェクト オブジェクトは MSBuild エンジンからアンロードされ、現在有効ではありません。 - - - Dieses Projektobjekt wurde aus dem MSBuild-Modul entladen und ist nicht mehr gültig. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - The project file "{0}" was not found. - プロジェクト ファイル "{0}" が見つかりませんでした。 - UE: This message is shown when the user calls into the OM to build a project that doesn't exist on disk. - - Die Projektdatei "{0}" wurde nicht gefunden. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Done building project "{0}" -- FAILED. - プロジェクト "{0}" のビルドが終了しました -- 失敗。 - - - Die Erstellung des Projekts "{0}" ist abgeschlossen – FEHLER. - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Done building project "{0}". - プロジェクト "{0}" のビルドが終了しました。 - - - Die Erstellung des Projekts "{0}" ist abgeschlossen. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - MSB4041: The default XML namespace of the project must be the MSBuild XML namespace. If the project is authored in the MSBuild 2003 format, please add xmlns="{0}" to the <Project> element. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format. - MSB4041: プロジェクトの既定の XML 名前空間は MSBuild の XML 名前空間でなければなりません。プロジェクトが MSBuild 2003 形式で作成されている場合、xmlns="{0}" を <Project> 要素に追加してください。プロジェクトが古い 1.0 または 1.2 形式で作成された場合、MSBuild 2003 形式に変換してください。 - {StrBegin="MSB4041: "}UE: This is a Beta 1 message only. - LOCALIZATION: <Project>, "MSBuild" and "xmlns" should not be localized. - - MSB4041: Der XML-Standardnamespace des Projekts muss MSBuild XML-Namespace. Wenn das Projekt im Format MSBuild 2003 erstellt wurde, fügen Sie Xmlns = "{0}" < Project >-Element. Wenn das Projekt im alten Format 1.0 oder 1.2 erstellt wurde, konvertieren Sie es in das MSBuild 2003-Format. - - fuzzyMatch="15" wordcount="52" adjWordcount="44.2" curWordcount="44.2" - - - Project Performance Summary: - プロジェクト パフォーマンスの概要: - - - Leistungszusammenfassung für das Projekt: - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - MSB4042: Stopping because of syntax errors in project file. - MSB4042: プロジェクト ファイルに構文エラーがあるため停止します。 - {StrBegin="MSB4042: "} - - MSB4042: Prozess aufgrund von Syntaxfehlern in der Projektdatei angehalten. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - Project "{0}" is building "{1}" ({2} target(s)): - プロジェクト "{0}" は "{1}" ({2} ターゲット) をビルドしています: - - - Das Projekt {0} erstellt {1} ({2} Ziel(e)): - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Project "{0}" is building "{1}" (default targets): - プロジェクト "{0}" は "{1}" (既定のターゲット) をビルドしています: - - - Das Projekt "{0}" erstellt "{1}" (Standardziele): - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Project "{0}" ({1} target(s)): - プロジェクト "{0}" ({1} ターゲット): - - - Projekt "{0}", {1} Ziel(e): - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - Project "{0}" (default targets): - プロジェクト "{0}" (既定のターゲット): - - - Projekt "{0}" (Standardziele): - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - Done Building Project "{0}" ({1} target(s)). - プロジェクト "{0}" ({1} ターゲット) のビルドが完了しました。 - - - Die Erstellung von Projekt "{0}" ist abgeschlossen ({1} Ziel(e)). - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Done Building Project "{0}" (default targets). - プロジェクト "{0}" (既定のターゲット) のビルドが完了しました。 - - - Die Erstellung von Projekt "{0}" ist abgeschlossen (Standardziele). - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Done Building Project "{0}" ({1} target(s)) -- FAILED. - プロジェクト "{0}" ({1} ターゲット) のビルドが終了しました -- 失敗。 - - - Die Erstellung des Projekts "{0}" ist abgeschlossen, {1} Ziel(e) -- FEHLER. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Done Building Project "{0}" (default targets) -- FAILED. - プロジェクト "{0}" (既定のターゲット) のビルドが終了しました -- 失敗。 - - - Die Erstellung von Projekt "{0}" ist abgeschlossen (Standardziele) -- FEHLER. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4075: The project file must be opened in the Visual Studio IDE and converted to the latest version before it can be built by MSBuild. - MSB4075: プロジェクト ファイルを MSBuild でビルドできるようにするには、Visual Studio IDE でプロジェクト ファイルを開き、最新バージョンに変換しなければなりません。 - {StrBegin="MSB4075: "} - - MSB4075: Die Projektdatei muss in der Visual Studio IDE geöffnet und in ein aktuelles Versionsformat gebracht werden, bevor sie mit MSBuild erstellt werden kann. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4192: The project file "{0}" is in the ".vcproj" file format, which MSBuild no longer supports. Please convert the project by opening it in the Visual Studio IDE or running the conversion tool, or use MSBuild 3.5 or earlier to build it. - MSB4192: プロジェクト ファイル "{0}" は ".vcproj" ファイル形式であり、MSBuild では現在サポートされていません。Visual Studio IDE で開くか変換ツールを実行することでプロジェクトを変換するか、MSBuild 3.5 またはそれより前のバージョンを使用してビルドしてください。 - {StrBegin="MSB4192: "} LOC: ".vcproj" should not be localized - - MSB4192: Die Projektdatei "{0}" ist im VSPROJ-Dateiformat gespeichert, das nicht mehr von MSBuild unterstützt wird. Konvertieren Sie das Projekt, indem Sie es in der Visual Studio IDE öffnen oder das Konvertierungstool ausführen, oder verwenden Sie MSBuild 3.5 oder früher zum Erstellen des Projekts. - - fuzzyMatch="101" wordcount="42" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - The specified property does not belong to the current property group. - 指定されたプロパティは現在のプロパティ グループに属していません。 - - - Die angegebene Eigenschaft gehört nicht zu der aktuellen Eigenschaftengruppe. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - Initial Properties: - 初期プロパティ: - - - Ursprüngliche Eigenschaften: - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4148: The name of a property stored under the registry key "{0}" has zero length. - MSB4148: レジストリ キー "{0}" の下に格納されているプロパティの名前の長さが 0 です。 - {StrBegin="MSB4148: "} - - MSB4148: Der Name einer unter dem Registrierungsschlüssel "{0}" gespeicherten Eigenschaft hat eine Länge von Null. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - The property names in the indexer and the "{0}" object do not match. - インデクサーと "{0}" オブジェクトのプロパティ名が一致しません。 - - - Die Eigenschaftennamen im Indexer und das {0}-Objekt stimmen nicht überein. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4043: The item metadata reference "{0}" is invalid because it is qualified with an item name. Item metadata referenced in transforms do not need to be qualified, because the item name is automatically deduced from the items being transformed. Change "{0}" to "%({1})". - MSB4043: 項目の名前で限定されているため、項目メタデータ参照 "{0}" は無効です。項目名は、変換される項目から自動的に推測されるため、トランスフォームで参照された項目メタデータは限定される必要はありません。"{0}" から "%({1})" に変更します。 - {StrBegin="MSB4043: "}UE: This message is shown when the user does something like this: @(foo->'%(foo.metadata)'). There is no need to specify - "foo.metadata", because "foo" is automatically deduced. In corollary, "bar.metadata" is not allowed either, where "bar" is a different - item list type. - - MSB4043: Der Elementmetadatenverweis "{0}" ist ungültig, da er mit einem Elementnamen qualifiziert ist. Elementmetadaten, auf die bei Transformationen verwiesen wird, müssen nicht qualifiziert werden, da der Elementname automatisch aus den transformierten Elementen abgeleitet wird. Ändern Sie "{0}" in "%({1})". - - fuzzyMatch="101" wordcount="43" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4135: Error reading the toolset information from the registry location "{0}". {1} - MSB4135: レジストリの場所 "{0}" からツールセット情報を読み取り中にエラーが発生しました。{1} - {StrBegin="MSB4135: "} - - MSB4135: Fehler beim Lesen der Toolsetinformationen am Registrierungsspeicherort "{0}". {1} - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4044: The "{0}" task was not given a value for the required parameter "{1}". - MSB4044: "{0}" タスクは、必要なパラメーター "{1}" に対して値を指定されていませんでした。 - {StrBegin="MSB4044: "}UE: This message is shown when a task parameter designated as "required" is not set in the project file. - - MSB4044: Die {0}-Aufgabe hat keinen Wert für den erforderlichen {1}-Parameter erhalten. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - Validating project using schema file "{0}". - スキーマ ファイル "{0}" を使用してプロジェクトを検証しています。 - LOCALIZATION: "{0}" is the location of the schema file. - - Das Projekt wird anhand der Schemadatei "{0}" überprüft. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4045: Project is not valid. {0} - MSB4045: プロジェクトは無効です。{0} - {StrBegin="MSB4045: "}UE: This error is shown when the user asks his project to be validated against a schema (/val switch for - MSBuild.exe), and the project has errors. "{0}" contains a message explaining the problem. - LOCALIZATION: "{0}" is a message from the System.XML schema validator and is already localized. - - MSB4045: Ungültiges Projekt. {0} - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4112: The targets in this project have been disabled by the host and therefore cannot be built at this time. This may have been done for security reasons. To enable the targets, the host must set Project.BuildEnabled to "true". - MSB4112: このプロジェクトのターゲットがホストによって無効にされているため、現在ビルドすることができません。これはセキュリティ上の理由による可能性があります。ターゲットを有効にするには、ホストにより Project.BuildEnabled が "true" に設定される必要があります。 - {StrBegin="MSB4112: "} - - MSB4112: Die Ziele in diesem Projekt wurden vom Host deaktiviert und können aus diesem Grund derzeit nicht erstellt werden. Die Deaktivierung wurde wahrscheinlich aus Sicherheitsgründen durchgeführt. Wenn Sie die Ziele aktivieren möchten, muss der Host Project.BuildEnabled auf "true" festlegen. - - fuzzyMatch="101" wordcount="39" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4093: The "{0}" parameter of the "{1}" task cannot be written to because it does not have a "set" accessor. - MSB4093: "{1}" タスクの "{0}" パラメーターには、"set" アクセサーがないため書き込めません。 - {StrBegin="MSB4093: "}UE: This error is shown when a project tries to assign a value to a task parameter that does not have a "set" - accessor on the corresponding .NET property on the task class. - - MSB4093: In den {0}-Parameter der {1}-Aufgabe kann nicht geschrieben werden, da er keinen set-Accessor besitzt. - - fuzzyMatch="100" wordcount="20" adjWordcount="5" curWordcount="5" tmLabel="N''" - - - A shallow clone of this object cannot be created. - このオブジェクトの浅いクローンを作成できません。 - - - Ein unechter Klon dieses Objekts kann nicht erstellt werden. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - Skipping target "{0}" because it has no inputs. - 入力がないため、ターゲット "{0}" を省略しています。 - - - Das {0}-Ziel wird übersprungen, da es keine Eingaben besitzt. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Though the target has declared its inputs, the input specification only references empty properties and/or empty item lists. - ターゲットはその入力を宣言しましたが、入力指定は空のプロパティおよび空の項目一覧のみを参照しています。 - - - Obwohl das Ziel seine Eingaben deklariert hat, verweist die Eingabespezifikation nur auf leere Eigenschaften und/oder leere Elementlisten. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - Skipping target "{0}" because it has no outputs. - 出力がないため、ターゲット "{0}" を省略しています。 - - - Das Ziel "{0}" wird übersprungen, da es keine Ausgaben enthält. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Though the target has declared its outputs, the output specification only references empty properties and/or empty item lists. - ターゲットはその出力を宣言しましたが、出力指定は空のプロパティおよび空の項目一覧のみを参照しています。 - - - Obwohl das Ziel seine Ausgaben deklariert hat, verweist die Ausgabespezifikation nur auf leere Eigenschaften und/oder leere Elementlisten. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - Skipping target "{0}" because all output files are up-to-date with respect to the input files. - すべての出力ファイルが入力ファイルに対して最新なので、ターゲット "{0}" を省略します。 - - - Das Ziel "{0}" wird übersprungen, da alle Ausgabedateien hinsichtlich der Eingabedateien aktuell sind. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - Input files: {0} - 入力ファイル: {0} - {0} is a semicolon-separated list of filenames. - - Eingabedateien: {0} - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Output files: {0} - 出力ファイル: {0} - {0} is a semicolon-separated list of filenames. - - Ausgabedateien: {0} - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Building solution configuration "{0}". - ソリューション構成 "{0}" をビルドしています。 - UE: This is not an error, so doesn't need an error code. - - Die Projektmappenkonfiguration "{0}" wird erstellt. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - Using solution cache file "{0}" for configuration "{1}" and tools version "{2}". - 構成 "{1}" とツール バージョン "{2}" に対してソリューション キャッシュ ファイル "{0}" を使用しています。 - UE: This is not an error, so doesn't need an error code. - - Die Projektmappen-Cachedatei "{0}" wird für die Konfiguration "{1}" und die Toolsversion "{2}" verwendet. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Failed to read solution cache file "{0}". {1} Using solution file directly. - ソリューション キャッシュ ファイル "{0}" から読み取れませんでした。{1} ソリューション ファイルを直接使用しています。 - UE: This is not a true error, so doesn't need an error code. - - Fehler beim Lesen der Projektmappen-Cachedatei "{0}". {1} Projektmappendatei wird direkt verwendet. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Failed to write solution cache file "{0}". {1} - ソリューション キャッシュ ファイル "{0}" に書き込めませんでした。{1} - UE: This is not a true error, so doesn't need an error code. - - Fehler beim Schreiben der Projektmappen-Cachedatei "{0}". {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Solution cache file was created for a "{0}" value of "{1}" but the current value is "{2}". Refreshing cache file. - ソリューション キャッシュ ファイルは "{0}" の値 "{1}" に対して作成されましたが、現在の値は "{2}" です。キャッシュ ファイルを更新しています。 - UE: This is not an error, so doesn't need an error code. - - Die Projektmappen-Cachedatei wurde für den {0}-Wert "{1}" erstellt, aber der aktuelle Wert ist "{2}". Cachedatei wird aktualisiert. - - fuzzyMatch="100" wordcount="20" adjWordcount="5" curWordcount="5" tmLabel="N''" - - - Solution cache file has an internal version number "{0}" but the current value is "{1}". Refreshing cache file. - ソリューション キャッシュ ファイルの内部バージョン番号は "{0}" ですが、現在の値は "{1}" です。キャッシュ ファイルを更新しています。 - UE: This is not an error, so doesn't need an error code. - - Die Projektmappen-Cachedatei hat die interne Versionsnummer "{0}", der aktuelle Wert ist aber "{1}". Cachedatei wird aktualisiert. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - Solution cache file is out of date. Refreshing cache file. {0} - ソリューション キャッシュ ファイルは最新ではありません。キャッシュ ファイルを更新しています。{0} - UE: This is not an error, so doesn't need an error code. - - Die Projektmappen-Cachedatei ist veraltet. Cachedatei wird aktualisiert. {0} - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4160: A circular dependency involving project "{0}" has been detected. - MSB4160: プロジェクト "{0}" を含む、循環する依存関係が見つかりました。 - {StrBegin="MSB4160: "} - - MSB4160: Eine Ringabhängigkeit im Zusammenhang mit dem Projekt "{0}" wurde erkannt. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4126: The specified solution configuration "{0}" is invalid. Please specify a valid solution configuration using the Configuration and Platform properties (e.g. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU") or leave those properties blank to use the default solution configuration. - MSB4126: 指定されたソリューション構成 "{0}" は無効です。構成とプラットフォームのプロパティ (例: MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU") を使用して有効なソリューション構成を指定するか、または既定のソリューション構成を使用するために、それらのプロパティを空にしておいてください。 - {StrBegin="MSB4126: "}UE: The solution filename is provided separately to loggers. - - MSB4126: Die angegebene Projektmappenkonfiguration "{0}" ist ungültig. Geben Sie mithilfe der Konfigurations- und Plattformeigenschaften eine gültige Projektmappenkonfiguration an (z. B. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU"), oder lassen Sie diese Eigenschaften leer, sodass die Standardprojektmappenkonfiguration verwendet wird. - - fuzzyMatch="101" wordcount="37" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4046: Error reading project file "{0}": {1} - MSB4046: プロジェクト ファイル "{0}" の読み取りエラーです: {1} - {StrBegin="MSB4046: "} - - MSB4046: Fehler beim Lesen der Projektdatei "{0}": {1} - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4125: The project file name "{0}" is invalid. {1} - MSB4125: プロジェクト ファイル名 "{0}" は無効です。{1} - {StrBegin="MSB4125: "}UE: The solution filename is provided separately to loggers. - - MSB4125: Der Projektdateiname "{0}" ist ungültig. {1} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4051: Project {0} is referencing a project with GUID {1}, but a project with this GUID was not found in the .SLN file. - MSB4051: プロジェクト {0} は GUID {1} を含むプロジェクトを参照していますが、.SLN ファイルに、この GUID を含むプロジェクトは見つかりませんでした。 - {StrBegin="MSB4051: "}UE: The solution filename is provided separately to loggers. - - MSB4051: Das Projekt "{0}" verweist auf ein Projekt mit der GUID {1}, in der SLN-Datei wurde jedoch kein Projekt mit dieser GUID gefunden. - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - MSB4078: The project file "{0}" is not supported by MSBuild and cannot be built. - MSB4078: プロジェクト ファイル "{0}" は MSBuild ではサポートされていないため、ビルドできません。 - {StrBegin="MSB4078: "} - - MSB4078: Die Projektdatei "{0}" wird nicht von MSBuild unterstützt und kann nicht erstellt werden. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4054: The solution file must be opened in the Visual Studio IDE and converted to the latest version before it can be built by MSBuild. - MSB4054: ソリューション ファイルを MSBuild でビルドできるようにするには、Visual Studio IDE でソリューション ファイルを開き、最新バージョンに変換しなければなりません。 - {StrBegin="MSB4054: "}UE: The solution filename is provided separately to loggers. - - MSB4054: Die Projektmappendatei muss in der Visual Studio IDE geöffnet und in die neuste Version konvertiert werden, bevor sie mit MSBuild erstellt werden kann. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4121: The project configuration for project "{0}" was not specified in the solution file for the solution configuration "{1}". - MSB4121: プロジェクト "{0}" のプロジェクト構成は、ソリューション構成 "{1}" のソリューション ファイルで指定されていませんでした。 - {StrBegin="MSB4121: "} - - MSB4121: Die Projektkonfiguration für das Projekt "{0}" wurde nicht in der Projektmappendatei für die Projektmappenkonfiguration "{1}" angegeben. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - The project "{0}" is not selected for building in solution configuration "{1}". - プロジェクト "{0}" は、ソリューション構成 "{1}" 内でビルドされるように選択されていません。 - - UE: This is not an error, so doesn't need an error code. - - - Das Projekt "{0}" ist in der Projektmappenkonfiguration "{1}" nicht zum Erstellen ausgewählt. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4122: Scanning project dependencies for project "{0}" failed. {1} - MSB4122: プロジェクト "{0}" のプロジェクト依存関係をスキャンできませんでした。{1} - {StrBegin="MSB4122: "} - - MSB4122: Fehler beim Überprüfen der Projektabhängigkeiten für Projekt "{0}". {1} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4149: The tools version "{0}" of the solution does not support building projects with a different tools version. - MSB4149: ソリューションのツール バージョン "{0}" では、別のツール バージョンでのプロジェクトのビルドはサポートされません。 - {StrBegin="MSB4149: "} - - MSB4149: Die Toolsversion {0} der Projektmappe unterstützt das Erstellen von Projekten mit unterschiedlichen Toolsversionen nicht. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - Web projects do not support the "Clean" target. Continuing with remaining projects ... - Web プロジェクトは "Clean" ターゲットをサポートしません。残りのプロジェクトで続行します... - UE: This is not an error, so doesn't need an error code. - LOCALIZATION: Do not localize "Clean". - - Webprojekte unterstützen das Clean-Ziel nicht. Verbleibende Projekte werden fortgesetzt... - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Web projects do not support the "Publish" target. Continuing with remaining projects ... - Web プロジェクトは "Publish" ターゲットをサポートしません。残りのプロジェクトで続行します... - UE: This is not an error, so doesn't need an error code. - LOCALIZATION: Do not localize "Publish". - - Webprojekte unterstützen das Publish-Ziel nicht. Verbleibende Projekte werden fortgesetzt... - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Skipping because the "$(AspNetConfiguration)" configuration is not supported for this web project. You can use the AspNetConfiguration property to override the configuration used for building web projects, by adding /p:AspNetConfiguration=<value> to the command line. Currently web projects only support Debug and Release configurations. - "$(AspNetConfiguration)" 構成はこの Web プロジェクトではサポートされていないため、省略します。AspNetConfiguration プロパティを使用し、/p:AspNetConfiguration=<value> をコマンド ラインに追加することによって、Web プロジェクトをビルドするのに使われた構成を上書きすることができます。現在、Web プロジェクトでは、Debug 構成と Release 構成のみがサポートされています。 - - UE: This is not an error, so doesn't need an error code. - LOCALIZATION: Do NOT localize "AspNetConfiguration", "Debug", "Release". - - - Da der "$(AspNetConfiguration)" Konfiguration für dieses Webprojekt nicht unterstützt. Verwenden die AspNetConfiguration-Eigenschaft die Konfiguration zum Erstellen von Webprojekten hinzufügen/p: AspNetConfiguration überschreiben = < Wert > in der Befehlszeile. Aktuell unterstützen Webprojekte nur Debug- und Releasekonfigurationen. - - fuzzyMatch="15" wordcount="44" adjWordcount="37.4" curWordcount="37.4" - - - MSB4076: VC projects do not support the "Publish" target. - MSB4076: VC プロジェクトは "Publish" ターゲットをサポートしません。 - {StrBegin="MSB4076: "}LOCALIZATION: Do not localize "Publish". - - MSB4076: VC-Projekte unterstützen nicht das Publish-Ziel. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4098: MSBuild is invoking VCBuild to build this project. Project-to-project references between VC++ projects (.VCPROJ) and C#/VB/VJ# projects (.CSPROJ, .VBPROJ, .VJSPROJ) are not supported by the command-line build systems when building stand-alone VC++ projects. Projects that contain such project-to-project references will fail to build. Please build the solution file containing this project instead. - MSB4098: MSBuild は、このプロジェクトをビルドするために VCBuild を呼び出しています。VC++ プロジェクト (.VCPROJ) および C#/VB/VJ# プロジェクト (.CSPROJ、.VBPROJ、.VJSPROJ) 間でのプロジェクト間参照は、スタンドアロンの VC++ プロジェクトをビルドしているときに、コマンドラインのビルド システムによってサポートされていません。そのようなプロジェクト間参照を含んでいるプロジェクトはビルドに失敗します。代わりに、このプロジェクトを含んでいるソリューション ファイルをビルドしてください。 - {StrBegin="MSB4098: "} - - MSB4098: MSBuild ruft zum Erstellen dieses Projekts VCBuild auf. Interprojektverweise zwischen VC++-Projekten (.VCPROJ) und C#-/VB-/VJ#-Projekten (.CSPROJ, .VBPROJ, .VJSPROJ) werden beim Erstellen eigenständiger VC++-Projekte von den Befehlszeilen-Buildsystemen nicht unterstützt. Projekte, die solche Interprojektverweise enthalten, werden nicht erstellt. Erstellen Sie stattdessen die Projektmappendatei, die dieses Projekt enthält. - - fuzzyMatch="101" wordcount="53" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4056: The MSBuild engine must be called on a single-threaded-apartment. Current threading model is "{0}". Proceeding, but some tasks may not function correctly. - MSB4056: MSBuild エンジンは、シングル スレッド アパートメント上で呼び出されなければなりません。現在のスレッド モデルは "{0}" です。続行しますが、いくつかのタスクが正しく機能しない可能性があります。 - {StrBegin="MSB4056: "} - - MSB4056: Das MSBuild-Modul muss in einem Singlethread-Apartment aufgerufen werden. Das aktuelle Threadmodell ist {0}. Der Vorgang wird fortgesetzt, aber einige Aufgaben werden möglicherweise nicht ordnungsgemäß ausgeführt. - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - Schema validation - スキーマの検証 - UE: this fragment is used to describe errors that are caused by schema validation. For example, if a normal error is - displayed like this: "MSBUILD : error MSB0000: This is an error.", then an error from schema validation would look like this: - "MSBUILD : Schema validation error MSB0000: This is an error." - LOCALIZATION: This fragment needs to be localized. - - Schemavalidierung - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Target "{0}" skipped. Previously built unsuccessfully. - ターゲット "{0}" を省略しました。以前に正しくビルドされていませんでした。 - - - Das Ziel "{0}" wurde übersprungen. Die vorherige Erstellung war nicht erfolgreich. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Target "{0}" skipped. Previously built successfully. - ターゲット "{0}" を省略しました。以前に正しくビルドされていました。 - - - Das Ziel "{0}" wurde übersprungen. Die vorherige Erstellung war erfolgreich. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4116: The condition "{1}" on the "{0}" target has a reference to item metadata. References to item metadata are not allowed in target conditions unless they are part of an item transform. - MSB4116: "{0}" ターゲットの条件 "{1}" には項目メタデータへの参照が含まれます。参照が項目の変換の一部でない限り、項目メタデータへの参照はターゲットの条件内では許可されていません。 - {StrBegin="MSB4116: "} - - MSB4116: Die Bedingung "{1}" des {0}-Ziels enthält einen Verweis auf Elementmetadaten. Verweise auf Elementmetadaten sind in Zielbedingungen nicht zulässig, es sei denn, sie sind Teil einer Elementtransformation. - - fuzzyMatch="101" wordcount="32" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4057: The target "{0}" does not exist in the project. - MSB4057: ターゲット "{0}" はプロジェクト内に存在しません。 - {StrBegin="MSB4057: "} - - MSB4057: Das Ziel "{0}" ist im Projekt nicht vorhanden. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - Done building target "{0}" in project "{1}" -- FAILED. - プロジェクト "{1}" 内のターゲット "{0}" のビルドが終了しました -- 失敗。 - - - Erstellen des {0}-Ziels in Projekt {1} beendet - Fehler beim Erstellen. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Done building target "{0}" in project "{1}". - プロジェクト "{1}" 内のターゲット "{0}" のビルドが終了しました。 - - - Die Erstellung des Ziels "{0}" im Projekt "{1}" ist abgeschlossen. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - {0}: (TargetId:{1}) - {0}: (ターゲット ID: {1}) - - - {0}: (Ziel-ID:{1}) - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4058: The "{0}" target is missing its output specification. If a target declares inputs, it must also declare outputs. - MSB4058: "{0}" ターゲットにその出力指定が存在しません。ターゲットが入力を宣言する場合、出力も宣言しなければなりません。 - {StrBegin="MSB4058: "} - - MSB4058: Das {0}-Ziel enthält keine Ausgabespezifikation. Wenn ein Ziel Eingaben deklariert, muss es auch Ausgaben deklarieren. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4168: The item "{0}" of type "{1}" does not define a value for the metadata in the expression "{2}". This expression is used in the target output for target "{3}". If a target declares outputs that are transforms, all items in the transform must have a value for the metadata in the transform. - MSB4168: 型 "{1}" の項目 "{0}" は、式 "{2}" でメタデータの値を定義しません。この式は、ターゲット "{3}" のターゲット出力で使用されます。トランスフォームである出力をターゲットが宣言する場合、そのトランスフォーム内のすべての項目がトランスフォームでメタデータの値を持つ必要があります。 - {StrBegin="MSB4168: "} - - MSB4168: Das Element "{0}" vom Typ "{1}" definiert keinen Wert für die Metadaten im Ausdruck "{2}". Dieser Ausdruck wird in der Zielausgabe für "{3}" verwendet. Wenn ein Ziel Ausgaben deklariert, bei denen es sich um Transformationen handelt, müssen alle Elemente in der Transformation einen Wert für die in der Transformation enthaltenen Metadaten aufweisen. - - fuzzyMatch="101" wordcount="53" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Target Performance Summary: - ターゲット パフォーマンスの概要: - - - Leistungszusammenfassung für das Ziel: - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Target "{0}" skipped, due to false condition; ({1}) was evaluated as ({2}). - false 条件により、ターゲット "{0}" を省略しました。({1}) は ({2}) として評価されました。 - - - Das Ziel "{0}" wurde übersprungen, da die Bedingung "false" war . ({1}) wurde als ({2}) ausgewertet. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Target "{0}" in project "{1}" - プロジェクト "{1}" 内のターゲット "{0}" です。 - - - {0}-Ziel in {1}-Projekt. - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Target {0}: - ターゲット {0}: - - - Ziel "{0}": - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Target "{0}" in file "{1}": - ファイル "{1}" 内のターゲット "{0}": - - - Ziel "{0}" in Datei "{1}": - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Build continuing because "{0}" on the task "{1}" is set to "{2}". - タスク "{1}" の "{0}" が "{2}" に設定されているため、ビルドを続行しています。 - - - Der Buildvorgang wird fortgesetzt, da {0} in der {1}-Aufgabe auf "{2}" festgelegt ist. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Target {0} from project "{1}": - プロジェクト "{1}" からのターゲット {0}: - - - Ziel "{0}" aus Projekt "{1}": - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Target "{0}" in file "{1}" from project "{2}": - ファイル "{1}" 内にある、プロジェクト "{2}" からのターゲット "{0}": - - - Ziel "{0}" in Datei "{1}" aus Projekt "{2}": - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4060: The "{0}" task has been declared or used incorrectly, or failed during construction. Check the spelling of the task name and the assembly name. - MSB4060: "{0}" タスクが宣言されたか、正しく使用されなかったか、または作成中に失敗しました。タスク名とアセンブリ名のスペルを確認してください。 - {StrBegin="MSB4060: "} - - MSB4060: Die {0}-Aufgabe wurde falsch deklariert, falsch verwendet oder konnte bei der Erstellung nicht ausgeführt werden. Überprüfen Sie die Schreibweise des Aufgaben- und des Assemblynamens. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4077: The "{0}" task has been marked with the attribute LoadInSeparateAppDomain, but does not derive from MarshalByRefObject. Check that the task derives from MarshalByRefObject or AppDomainIsolatedTask. - MSB4077: "{0}" タスクに属性 LoadInSeparateAppDomain が設定されていますが、MarshalByRefObject から派生していません。そのタスクが MarshalByRefObject または AppDomainIsolatedTask から派生していることを確認してください。 - {StrBegin="MSB4077: "}LOCALIZATION: <LoadInSeparateAppDomain>, <MarshalByRefObject>, <AppDomainIsolatedTask> should not be localized. - - MSB4077: Die Aufgabe "{0}" wurde mit dem LoadInSeparateAppDomain-Attribut markiert, ist jedoch nicht von MarshalByRefObject abgeleitet. Stellen Sie sicher, dass die Aufgabe von MarshalByRefObject oder AppDomainIsolatedTask abgeleitet wird. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Done executing task "{0}" -- FAILED. - タスク "{0}" の実行が終了しました -- 失敗。 - - - Die Ausführung von Task "{0}" wurde beendet – FEHLER. - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Done executing task "{0}". - タスク "{0}" の実行が終了しました。 - - - Die Ausführung von Task "{0}" wurde beendet. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - {0} (TaskId:{1}) - {0} (TaskId: {1}) - - - {0} (Aufgaben-ID: {1}) - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Using "{0}" task from assembly "{1}". - "{0}" タスクをアセンブリ "{1}" から使用しています。 - UE: This informational message helps users determine which assemblies their tasks were loaded from. - - Die {0}-Aufgabe aus der {1}-Assembly wird verwendet. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4061: The "{0}" task could not be instantiated from the assembly "{1}". {2} - MSB4061: "{0}" タスクをアセンブリ "{1}" からインスタンス化できませんでした。{2} - {StrBegin="MSB4061: "}LOCALIZATION: "{2}" is a localized message from a CLR/FX exception. - - MSB4061: Die {0}-Aufgabe konnte nicht aus der {1}-Assembly instanziiert werden. {2} - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4127: The "{0}" task could not be instantiated from the assembly "{1}". Please verify the task assembly has been built using the same version of the Microsoft.Build.Framework assembly as the one installed on your computer and that your host application is not missing a binding redirect for Microsoft.Build.Framework. {2} - MSB4127: "{0}" タスクをアセンブリ "{1}" からインスタンス化できませんでした。タスク アセンブリのビルドに使用された Microsoft.Build.Framework アセンブリのバージョンがコンピューターにインストールされているものと同じであることと、ホスト アプリケーションに Microsoft.Build.Framework のバインド リダイレクトが存在することを確認してください。{2} - {StrBegin="MSB4127: "}UE: This message is a specialized version of the TaskInstantiationFailureError message and can probably reuse some of its docs. - LOCALIZATION: "{2}" is a localized message from a CLR/FX exception. Also, Microsoft.Build.Framework should not be localized - - MSB4127: Die "{0}"-Aufgabe konnte nicht aus der "{1}"-Assembly instanziiert werden. Überprüfen Sie, ob die Aufgabenassembly mit der gleichen Version der Microsoft.Build.Framework-Assembly erstellt wurde, die auf Ihrem Computer installiert ist, und dass Ihrer Hostanwendung kein BindingRedirect-Eintrag für Microsoft.Build.Framework fehlt. {2} - - fuzzyMatch="101" wordcount="49" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4062: The "{0}" task could not be loaded from the assembly {1}. {2} Confirm that the <UsingTask> declaration is correct, and that the assembly and all its dependencies are available. - MSB4062: "{0}" タスクをアセンブリ {1} から読み込めませんでした。{2} <UsingTask> 宣言が正しいこと、およびアセンブリとその依存関係が使用可能であることを確認してください。 - {StrBegin="MSB4062: "}UE: This message is shown when a task cannot be loaded from its assembly for various reasons e.g. corrupt assembly, - invalid task declaration, disk error, etc. "{2}" contains a message explaining what happened. - LOCALIZATION: "{2}" is a message from the CLR loader and is already localized. Also, <UsingTask> should not be localized. - - MSB4062: Die "{0}" Vorgang konnte nicht aus der Assembly geladen werden {1}. {2} Bestätigen < UsingTask > Erklärung richtig ist und die Assembly und die zugehörigen Dateien verfügbar sind. - - fuzzyMatch="15" wordcount="31" adjWordcount="26.35" curWordcount="26.35" - - - MSB4063: The "{0}" task could not be initialized with its input parameters. {1} - MSB4063: "{0}" タスクを指定の入力パラメーターで初期化できませんでした。{1} - {StrBegin="MSB4063: "} - - MSB4063: Die "{0}"-Aufgabe konnte nicht mit ihren Eingabeparametern initialisiert werden. {1} - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - Task Performance Summary: - タスク パフォーマンスの概要: - - - Leistungszusammenfassung für die Aufgabe: - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Task "{0}" skipped, due to false condition; ({1}) was evaluated as ({2}). - false 条件のため、タスク "{0}" を省略しました。({1}) は ({2}) として評価されました。 - - - Die {0}-Aufgabe wurde übersprungen, da die Bedingung "false" war . ({1}) wurde als ({2}) ausgewertet. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Task "{0}" - タスク "{0}" - - - Task "{0}" - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Time Elapsed {0} - 経過時間 {0} - - - Verstrichene Zeit {0} - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Building with tools version "{0}". - ツール バージョン "{0}" でビルドしています。 - - - Erstellung mit der Toolsversion "{0}". - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Project file contains ToolsVersion="{0}". This toolset is unknown or missing. You may be able to resolve this by installing the appropriate .NET Framework for this toolset. Treating the project as if it had ToolsVersion="4.0". - プロジェクト ファイルに ToolsVersion="{0}" が含まれています。このツールセットが不明であるか、存在しません。この問題は、このツールセットに適切な .NET Framework をインストールすることで解決できる可能性があります。プロジェクトを ToolsVersion="4.0" として扱います。 - - - Die Projektdatei enthält ToolsVersion="{0}". Dieses Toolset ist nicht bekannt oder nicht vorhanden. Sie können das Problem möglicherweise beheben, indem Sie das entsprechende .NET Framework für dieses Toolset installieren. Das Projekt wird behandelt als enthielte es ToolsVersion="4.0". - - fuzzyMatch="101" wordcount="34" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Deferred Messages - 遅延メッセージ - - - Zurückgestellte Meldungen - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Some messages did not display because they were not associated with any ProjectStarted events. Use diagnostic verbosity to view these messages. - 一部のメッセージは ProjectStarted イベントと関連付けられていなかったため、表示されていません。これらのメッセージを表示するには、詳細レベル diagnostic を使用してしてください。 - - - Einige Meldungen wurden nicht angezeigt, weil sie keinem ProjectStarted-Ereignis zugeordnet sind. Verwenden Sie den Ausführlichkeitsgrad "diagnostic", um diese Meldungen anzuzeigen. - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - MSB4090: Found an unexpected character '{2}' at position {1} in condition "{0}". - MSB4090: 予期しない文字 '{2}' が、条件 "{0}" の場所 {1} で見つかりました。 - {StrBegin="MSB4090: "} - - MSB4090: Das unerwartete Zeichen {2} wurde an Position {1} in der {0}-Bedingung gefunden. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4091: Found a call to an undefined function "{1}" in condition "{0}". - MSB4091: 定義されていない関数 "{1}" への呼び出しが、条件 "{0}" で見つかりました。 - {StrBegin="MSB4091: "} - - MSB4091: Aufruf zu einer undefinierten Funktion "{1}" in Bedingung "{0}" gefunden. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4064: The "{0}" parameter is not supported by the "{1}" task. Verify the parameter exists on the task, and it is a settable public instance property. - MSB4064: "{0}" パラメーターは "{1}" タスクではサポートされていません。タスク上にパラメーターが存在し、設定可能なパブリック インスタンス プロパティであることを確認してください。 - {StrBegin="MSB4064: "} - - MSB4064: Der {0}-Parameter wird von der {1}-Aufgabe nicht unterstützt. Vergewissern Sie sich, dass der Parameter in der Aufgabe vorhanden ist und es sich um eine festlegbare öffentliche Instanzeigenschaft handelt. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4131: The "{0}" parameter is not supported by the "{1}" task. Verify the parameter exists on the task, and it is a gettable public instance property. - MSB4131: "{0}" パラメーターは "{1}" タスクではサポートされていません。タスク上にパラメーターが存在し、取得可能なパブリック インスタンス プロパティであることを確認してください。 - {StrBegin="MSB4131: "} - - MSB4131: Der {0}-Parameter wird von der {1}-Aufgabe nicht unterstützt. Vergewissern Sie sich, dass der Parameter in der Aufgabe vorhanden ist und es sich um eine abrufbare öffentliche Instanzeigenschaft handelt. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4092: An unexpected token "{1}" was found at character position {2} in condition "{0}". - MSB4092: 予期しないトークン "{1}" が、条件 "{0}" の文字の場所 {2} で見つかりました。 - {StrBegin="MSB4092: "} - - MSB4092: Ein unerwartetes Token "{1}" wurde an Zeichenposition "{2}" in Bedingung "{0}" gefunden. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4065: The "{0}" parameter is not marked for output by the "{1}" task. - MSB4065: "{0}" パラメーターは、"{1}" タスクによって出力を設定されていません。 - {StrBegin="MSB4065: "} - - MSB4065: Der {0}-Parameter ist nicht für die Ausgabe durch die {1}-Aufgabe markiert. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4066: The attribute "{0}" in element <{1}> is unrecognized. - MSB4066: 要素 <{1}> の属性 "{0}" は認識されていません。 - {StrBegin="MSB4066: "} - - MSB4066: Das Attribut "{0}" im Element <{1}> wurde nicht erkannt. - - fuzzyMatch="15" wordcount="10" adjWordcount="8.5" curWordcount="8.5" - - - MSB4067: The element <{0}> beneath element <{1}> is unrecognized. - MSB4067: 要素 <{1}> の下の要素 <{0}> は認識されていません。 - {StrBegin="MSB4067: "} - - MSB4067: Das Element <{0}> unter Element <{1}> wurde nicht erkannt. - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB4068: The element <{0}> is unrecognized, or not supported in this context. - MSB4068: 要素 <{0}> は認識されていないか、またはこのコンテキストでサポートされていません。 - {StrBegin="MSB4068: "} - - MSB4068: Das Element <{0}> ist unbekannt oder in diesem Kontext nicht unterstützt. - - fuzzyMatch="15" wordcount="13" adjWordcount="11.05" curWordcount="11.05" - - - MSB4132: The tools version "{0}" is unrecognized. - MSB4132: ツール バージョン "{0}" が認識されません。 - {StrBegin="MSB4132: "} - - MSB4132: Die Toolsversion "{0}" ist unbekannt. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4069: The "{0}" type of the "{1}" parameter of the "{2}" task is not supported by MSBuild. - MSB4069: "{2}" タスクの "{1}" パラメーターの "{0}" 型は、MSBuild ではサポートされていません。 - {StrBegin="MSB4069: "}LOCALIZATION: "MSBuild" should not be localized. - - MSB4069: Der {0}-Typ des {1}-Parameters der {2}-Aufgabe wird von MSBuild nicht unterstützt. - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - MSB4072: A <{0}> element must contain either the "{1}" attribute or the "{2}" attribute (but not both). - MSB4072: <{0}> 要素は、"{1}" 属性または "{2}" 属性 (いずれか 1 つ) を含んでいなければなりません。 - {StrBegin="MSB4072: "} - - MSB4072: Ein <{0}>-Element muss entweder die "{1}" Attribut oder "{2}" Attribut (jedoch nicht beide). - - fuzzyMatch="15" wordcount="18" adjWordcount="15.3" curWordcount="15.3" - - - {0} Warning(s) - {0} 個の警告 - - - {0} Warnung(en) - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4084: A <When> element may not follow an <Otherwise> element in a <Choose>. - MSB4084: <When> 要素は、<Choose> 内の <Otherwise> 要素の後に配置することはできません。 - {StrBegin="MSB4084: "} - - MSB4084: A < >-Element kein Element < Otherwise > < auswählen > folgen. - - fuzzyMatch="15" wordcount="16" adjWordcount="13.6" curWordcount="13.6" - - - Target Name: "{0}" Project Name: "{1}" - ターゲット名: "{0}" プロジェクト名:"{1}" - - - Zielname: "{0}" Projektname: "{1}" - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Cycle trace: - 循環トレース: - - - Schleifenablaufverfolgung: - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4150: Must initialize the console logger using the initialize method before using ApplyParameter - MSB4150: ApplyParameter を使用するには、最初に初期化メソッドを使用してコンソール ロガーを初期化する必要があります。 - {StrBegin="MSB4150: "} - - MSB4150: Die Konsolenprotokollierung muss vor der Verwendung von ApplyParameter mithilfe der Initialisierungsmethode initialisiert werden. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4151: An error occurred while building project "{0}", target "{1}". Please see innerException for detailed information. - MSB4151: プロジェクト "{0}" (ターゲット "{1}") のビルド中にエラーが発生しました。詳細については、innerException を参照してください。 - {StrBegin="MSB4151: "} - - MSB4151: Fehler beim Erstellen von Projekt "{0}", Ziel "{1}". Ausführliche Informationen finden Sie in der innerException. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB4152: An error occurred on the child node "{0}" and could not be passed to the parent node. {1} - MSB4152: 子ノード "{0}" でエラーが発生したため、親ノードに渡せませんでした。{1} - {StrBegin="MSB4152: "} - - MSB4152: Fehler im untergeordneten Knoten "{0}", der nicht an den übergeordneten Knoten übergeben werden konnte. {1} - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4153: A call is made on an inactive IBuildEngine interface corresponding to a task that already finished execution. - MSB4153: アクティブでない IBuildEngine インターフェイスが呼び出されています。このインターフェイスに対応するタスクは既に実行を終了しています。 - {StrBegin="MSB4153: "} - - MSB4153: Eine inaktive IBuildEngine-Schnittstelle wird aufgerufen, der eine Aufgabe entspricht, deren Ausführung bereits abgeschlossen wurde. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - MSB4154: A forwarding logger is attempting to forward BuildFinished event - MSB4154: 転送ロガーが BuildFinished イベントを転送しようとしています - {StrBegin="MSB4154: "} - - MSB4154: Eine weiterleitende Protokollierung versucht, das BuildFinished-Ereignis weiterzuleiten. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4155: There was an error while communicating with a node. - MSB4155: ノードとの通信中にエラーが発生しました。 - {StrBegin="MSB4155: "} - - MSB4155: Fehler bei der Kommunikation mit einem Knoten. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB1021: Cannot create an instance of the logger - {0}. - MSB1021: ロガーのインスタンスを作成できません - {0}。 - {StrBegin="MSB1021: "}The error code for this message is duplicated from MSBuild.exe. - - MSB1021: Eine Instanz der Protokollierung kann nicht erstellt werden - {0}. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB1020: The logger {0} was not found. Check the following: 1.) The logger name specified is the same as the name of the logger class. 2.) The logger class is "public" and implements the Microsoft.Build.Framework.ILogger interface. 3.) The path to the logger assembly is correct, or the logger can be loaded using only the assembly name provided. - MSB1020: ロガー {0} は見つかりませんでした。次のことを確認してください: 1.) 指定したロガー名がロガー クラスの名前と同じであること。2.) ロガー クラスが "public" であり、Microsoft.Build.Framework.ILogger インターフェイスを実装していること。3.) ロガー アセンブリへのパスが正しいこと。または指定のアセンブリ名だけを使用してロガーを読み込めること。 - {StrBegin="MSB1020: "}The error code for this message is duplicated from MSBuild.exe. - - MSB1020: Die Protokollierung {0} wurde nicht gefunden. Überprüfen Sie Folgendes: 1.) Der angegebene Name der Protokollierung ist mit dem Namen der Protokollierungsklasse identisch. 2.) Die Protokollierungsklasse ist "public" und implementiert die Microsoft.Build.Framework.ILogger-Schnittstelle. 3.) Der Pfad zur Protokollierungsassembly ist richtig, bzw. die Protokollierung kann alleine mithilfe des angegebenen Assemblynamens geladen werden. - - fuzzyMatch="101" wordcount="57" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4156: A forwarding logger is attempting to forward BuildStarted event - MSB4156: 転送ロガーが BuildStarted イベントを転送しようとしています - {StrBegin="MSB4156: "} - - MSB4156: Eine weiterleitende Protokollierung versucht, das BuildStarted-Ereignis weiterzuleiten. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - "{0}" ({1} target) ({2}) -> - "{0}" ({1} ターゲット) ({2}) -> - - - "{0}" ({1} target) ({2}) -> - - fuzzyMatch="15" wordcount="5" adjWordcount="4.25" curWordcount="4.25" - - - "{0}" (default target) ({1}) -> - "{0}" (既定のターゲット) ({1}) -> - - - "{0}" (Standardziel) ({1}) -> - - fuzzyMatch="15" wordcount="5" adjWordcount="4.25" curWordcount="4.25" - - - {0} {1,5} - {0} {1,5} - - - {0} {1,5} - - fuzzyMatch="15" wordcount="2" adjWordcount="1.7" curWordcount="1.7" - - - Project "{0}" on node {1} ({2} target(s)). - ノード {1} 上のプロジェクト "{0}" ({2} ターゲット)。 - - - Projekt "{0}" auf Knoten "{1}", {2} Ziel(e). - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Project "{0}" on node {1} (default targets). - ノード {1} 上のプロジェクト "{0}" (既定のターゲット)。 - - - Projekt "{0}" auf Knoten "{1}" (Standardziele). - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Project "{0}" ({1}) is building "{2}" ({3}) on node {4} ({5} target(s)). - プロジェクト "{0}" ({1}) は、ノード {4} 上に "{2}" ({3}) をビルドしています ({5} ターゲット)。 - - - Das Projekt "{0}" ({1}) erstellt "{2}" ({3}) auf Knoten "{4}", {5} Ziel(e). - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Project "{0}" ({1}) is building "{2}" ({3}) on node {4} (default targets). - プロジェクト "{0}" ({1}) は、ノード {4} 上に "{2}" ({3}) をビルドしています (既定のターゲット)。 - - - Das Projekt "{0}" ({1}) erstellt "{2}" ({3}) auf Knoten "{4}" (Standardziele). - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - ({0} target) -> - ({0} ターゲット) -> - - - ({0} Ziel) -> - - fuzzyMatch="15" wordcount="3" adjWordcount="2.55" curWordcount="2.55" - - - MSB4157: The array of project files needs to contain at least one value. - MSB4157: プロジェクト ファイルの配列には、少なくとも 1 つの値が必要です。 - {StrBegin="MSB4157: "} - - MSB4157: Das Array der Projektdateien muss mindestens einen Wert enthalten. - - fuzzyMatch="15" wordcount="13" adjWordcount="11.05" curWordcount="11.05" - - - MSB4158: The project file name at element {0} is empty. - MSB4158: 要素 {0} のプロジェクト ファイル名が空です。 - {StrBegin="MSB4158: "} - - MSB4158: Der Projektdateiname bei Element {0} ist leer. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - The property "{0}" with value "{1}" is being overridden by another batch. The property is now: "{2}" - 値 "{1}" が指定されたプロパティ "{0}" は別のバッチによってオーバーライドされています。現在のプロパティ: "{2}" - - - Die Eigenschaft "{0}" mit dem Wert "{1}" wird von einem anderen Batch überschrieben. Die Eigenschaft ist jetzt: "{2}" - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - Please see inner exception for error information. - エラーについては、内部例外を参照してください。 - - - Fehlerinformationen finden Sie in der internen Ausnahme. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Event type "{0}" was expected to be serializable. The event was not serializable and has been ignored. - イベントの種類 "{0}" はシリアル化可能であることが想定されていましたが、シリアル化可能でなかったため無視されました。 - - - Es wurde erwartet, dass der Typ "{0}" serialisierbar ist. Das Ereignis war nicht serialisierbar und wurde ignoriert. - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - The log file path cannot be null or empty. - ログ ファイル パスは null または空にできません。 - - - Der Protokolldateipfad darf nicht NULL oder leer sein. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4161: Project "{0}" was loaded and unloaded during the current build. Reloading a project during the build can result in errors or an inconsistent build state. Either avoid unloading project "{0}" or cache the evaluation results of target(s) "{1}" before unloading the project. - MSB4161: プロジェクト "{0}" は現在のビルド中に読み込まれ、アンロードされました。ビルド中にプロジェクトを再度読み込んだ場合、エラーが発生したり、ビルドの状態に不整合が生じたりする場合があります。プロジェクト "{0}" をアンロードしないようにするか、プロジェクトをアンロードする前にターゲット "{1}" の評価結果をキャッシュしてください。 - {StrBegin="MSB4161: "} - - MSB4161: Das Projekt "{0}" wurde während der aktuellen Erstellung geladen und entladen. Das erneute Laden eines Projekts während der Erstellung kann zu Fehlern oder einem nicht konsistenten Buildzustand führen. Vermeiden Sie entweder das Entladen des Projekts "{0}", oder speichern Sie die Auswertungsergebnisse der Ziele "{1}" vor dem Entladen des Projekts im Cache. - - fuzzyMatch="101" wordcount="43" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - [default] - [既定] - - - [Standard] - - fuzzyMatch="100" wordcount="1" adjWordcount="0.25" curWordcount="0.25" tmLabel="N''" - - -
-
\ No newline at end of file diff --git a/src/Deprecated/Engine/Resources/xlf/Strings.ko.xlf b/src/Deprecated/Engine/Resources/xlf/Strings.ko.xlf deleted file mode 100644 index 1aa923a6820..00000000000 --- a/src/Deprecated/Engine/Resources/xlf/Strings.ko.xlf +++ /dev/null @@ -1,2674 +0,0 @@ - - - -
- - 4013 - 1176.8 - 1176.8 - 0 - 0 - - - 0 - 981 - 2334 - 0 - 0 - 698 - 0 - -
- - - MSB4001: The "{0}" task has more than one parameter called "{1}". - MSB4001: "{0}" 작업에 이름이 "{1}"인 매개 변수가 두 개 이상 있습니다. - {StrBegin="MSB4001: "}UE: This message is shown when a task has more than one .NET property with the same name -- it's unclear which of - those properties the task wants to use as a parameter in project files. - - MSB4001: Die {0}-Aufgabe enthält mehrere Parameter mit dem Namen "{1}". - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4081: The value "{0}" of the "ItemName" attribute in element <Output> contains an "@" character. If you intended to use an item name then remove the @( ) around the item name. - MSB4081: <Output> 요소에 있는 "ItemName" 특성의 "{0}" 값에 "@" 문자가 있습니다. 항목 이름을 사용하려면 항목 이름 주위에 있는 @( )를 제거하십시오. - {StrBegin="MSB4081: "}UE: This message is shown when an output tag has an itemname that contains an @. They probably typed @(foo) instead of foo in the ItemName.LOCALIZATION: Output and ItemName should not be localized. - - MSB4081: Der Wert "{0}" "ItemName-Attribut im Element < Output > enthält ein" @"Zeichen. Soll ein Elementname verwenden und entfernen dann die @ (), um den Namen des Elements. - - fuzzyMatch="15" wordcount="30" adjWordcount="25.5" curWordcount="25.5" - - - MSB4002: There was a failure retrieving the attributes for parameters in the "{0}" task. {1} - MSB4002: "{0}" 작업의 매개 변수 특성을 검색하지 못했습니다. {1} - {StrBegin="MSB4002: "}UE: This message is shown when the .NET attributes that a task's .NET properties are decorated with, cannot be - retrieved -- this is typically because the .NET classes that define the .NET attributes cannot be loaded because the assembly - they are defined in cannot be found, or the classes themselves cannot be found. - - MSB4002: Fehler beim Abrufen der Attribute für Parameter in der {0}-Aufgabe. {1} - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - MSB4003: "{0}" is a reserved attribute of the <{1}> element, and must be spelled with the correct casing. This attribute cannot be used as a parameter to the "{2}" task. - MSB4003: "{0}"은(는) <{1}> 요소의 예약된 특성이며 대/소문자를 구분하여 입력해야 합니다. 이 특성은 "{2}" 작업의 매개 변수로 사용할 수 없습니다. - {StrBegin="MSB4003: "}UE: Tasks are not allowed to use incorrect case for reserved attributes on the task nodes e.g. "continueonerror" - instead of the "ContinueOnError". - - MSB4003: "{0}" ist ein reserviertes Attribut der <{1}>-Element und mit der richtigen Groß-/Kleinschreibung geschrieben werden muss. Dieses Attribut kann nicht verwendet werden, als Parameter an die "{2}" Aufgabe. - - fuzzyMatch="15" wordcount="31" adjWordcount="26.35" curWordcount="26.35" - - - The "REQUESTBATCHSIZE" must be a number greater than 1. "{0}" is an invalid value. The value 10 will be used instead. - "REQUESTBATCHSIZE"는 1보다 큰 숫자여야 합니다. "{0}"은(는) 잘못된 값이므로 대신 10을 사용합니다. - The name "REQUESTBATCHSIZE" is an environment variable - - Die "REQUESTBATCHSIZE" muss eine Zahl größer als 1 sein. "{0}" ist ein ungültiger Wert. Der Wert 10 wird stattdessen verwendet. - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - Build completed in {0}. - {0}에서 빌드가 완료되었습니다. - - - Das Erstellen wurde in {0} beendet. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - Build FAILED. - 빌드하지 못했습니다. - - - Fehler beim Buildvorgang. - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Build succeeded. - 빌드했습니다. - - - Buildvorgang erfolgreich. - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Build started. - 빌드를 시작했습니다. - - - Der Buildvorgang wurde gestartet. - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Build started {0}. - 빌드 시작: {0} - - - Der Buildvorgang wurde am {0} gestartet. - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Building target "{0}" completely. - "{0}" 대상을 모두 빌드하고 있습니다. - {0} is the name of the target. - - Das Ziel "{0}" wird vollständig erstellt. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - No input files were specified. - 입력 파일을 지정하지 않았습니다. - - - Es wurden keine Eingabedateien angegeben. - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Input file "{0}" is newer than output file "{1}". - 입력 파일 "{0}"이(가) 출력 파일 "{1}"보다 최신 파일입니다. - {0} and {1} are filenames on disk. - - Die Eingabedatei "{0}" ist neuer als die Ausgabedatei "{1}". - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - Output file "{0}" does not exist. - 출력 파일 "{0}"이(가) 없습니다. - {0} is a filename on disk. - - Die Ausgabedatei "{0}" ist nicht vorhanden. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Input file "{0}" does not exist. - 입력 파일 "{0}"이(가) 없습니다. - {0} is a filename on disk. - - Die Eingabedatei "{0}" ist nicht vorhanden. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Building target "{0}" partially, because some output files are out of date with respect to their input files. - 해당 입력 파일과 비교하여 출력 파일이 최신 파일이 아니므로 "{0}" 대상을 일부만 빌드하고 있습니다. - {0} is the name of the target. - - Das Ziel "{0}" wird teilweise erstellt, da einige Ausgabedateien hinsichtlich ihrer Eingabedateien veraltet sind. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - [{0}: Input={1}, Output={2}] Input file is newer than output file. - [{0}: 입력={1}, 출력={2}] 입력 파일이 출력 파일보다 최신 파일입니다. - {0} is the name of an MSBuild item. {1} and {2} are filenames on disk. - - [{0}: Eingabe={1}, Ausgabe={2}] Die Eingabedatei ist neuer als die Ausgabedatei. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - [{0}: Input={1}, Output={2}] Output file does not exist. - [{0}: 입력={1}, 출력={2}] 출력 파일이 없습니다. - {0} is the name of an MSBuild item. {1} and {2} are filenames on disk. - - [{0}: Eingabe={1}, Ausgabe={2}] Die Ausgabedatei ist nicht vorhanden. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - [{0}: Input={1}, Output={2}] Input file does not exist. - [{0}: 입력={1}, 출력={2}] 입력 파일이 없습니다. - {0} is the name of an MSBuild item. {1} and {2} are filenames on disk. - - [{0}: Eingabe={1}, Ausgabe={2}] Die Eingabedatei ist nicht vorhanden. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - The attribute "{0}" is a known MSBuild attribute, and cannot be accessed using this method. - "{0}" 특성은 알려진 MSBuild 특성이므로 이 메서드를 사용하여 액세스할 수 없습니다. - - - Das {0}-Attribut ist ein bekanntes MSBuild-Attribut, auf das mithilfe dieser Methode nicht zugegriffen werden kann. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - Properties in persisted property groups cannot be accessed by name. - 보관된 속성 그룹의 속성은 이름으로 액세스할 수 없습니다. - - - Auf Eigenschaften in persistenten Eigenschaftengruppen ist kein Zugriff über den Namen möglich. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4023: Cannot evaluate the item metadata "%({0})". {1} - MSB4023: 항목 메타데이터 "%({0})"을(를) 계산할 수 없습니다. {1} - {StrBegin="MSB4023: "}UE: This message is shown when the value of an item metadata cannot be computed for some reason e.g. trying to apply - %(RootDir) to an item-spec that's not a valid path, would result in this error. - LOCALIZATION: "{1}" is a localized message explaining the problem. - - MSB4023: Elementmetadaten "%({0})" können nicht ausgewertet werden. {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Cannot execute a task not associated with a project object. - 프로젝트 개체에 연결되지 않은 작업은 실행할 수 없습니다. - - - Eine Aufgabe, die keinem Projektobjekt zugeordnet ist, kann nicht ausgeführt werden. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - The cache entry has already been set to a different value and cannot be modified. - 캐시 엔트리가 이미 다른 값으로 설정되었으므로 수정할 수 없습니다. - - - Der Cacheeintrag wurde bereits auf einen anderen Wert festgelegt und kann nicht geändert werden. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - The "{0}" property comes from an environment variable, and cannot be modified. - "{0}" 속성은 환경 변수에서 가져온 것이므로 수정할 수 없습니다. - - - Die {0}-Eigenschaft stammt aus einer Umgebungsvariablen und kann nicht geändert werden. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - The "{0}" property is a global property, and cannot be modified through an evaluated property group. Use "{1}" instead. - "{0}" 속성은 전역 속성이므로 확인된 속성 그룹을 통해 수정할 수 없습니다. "{1}"을(를) 대신 사용하십시오. - - - Die {0}-Eigenschaft ist eine globale Eigenschaft und kann nicht über eine ausgewertete Eigenschaftengruppe geändert werden. Verwenden Sie stattdessen {1}. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - Modifying the XML of an imported project file is not allowed. Open that project file directly. - 가져온 프로젝트 파일의 XML은 수정할 수 없습니다. 해당 프로젝트 파일을 직접 열어야 합니다. - - - Der XML-Code einer importierten Projektdatei darf nicht geändert werden. Öffnen Sie diese Projektdatei direkt. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB4117: The "{0}" item name is reserved, and cannot be used. - MSB4117: 항목 이름 "{0}"은(는) 예약되었으므로 사용할 수 없습니다. - {StrBegin="MSB4117: "}UE: This message is shown when the user tries to redefine one of the reserved MSBuild items e.g. @(Choose) - - MSB4117: Der Elementname "{0}" ist reserviert und kann nicht verwendet werden. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4118: The "{0}" item metadata name is reserved, and cannot be used. - MSB4118: 항목 메타데이터 이름 "{0}"은(는) 예약되었으므로 사용할 수 없습니다. - {StrBegin="MSB4118: "}UE: This message is shown when the user tries to redefine one of the reserved MSBuild items e.g. @(Choose) - - MSB4118: Der Elementmetadatenname "{0}" ist reserviert und kann nicht verwendet werden. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4004: The "{0}" property is reserved, and cannot be modified. - MSB4004: "{0}" 속성은 예약되었으므로 수정할 수 없습니다. - {StrBegin="MSB4004: "}UE: This message is shown when the user tries to redefine one of the reserved MSBuild properties e.g. $(MSBuildProjectFile) - - MSB4004: Die {0}-Eigenschaft ist reserviert und kann nicht geändert werden. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4094: "{0}" is an invalid value for the "{1}" parameter of the "{3}" task. Multiple items cannot be passed into a parameter of type "{2}". - MSB4094: "{0}"은(는) "{3}" 작업의 "{1}" 매개 변수에 사용할 수 없는 값입니다. 여러 개의 항목을 "{2}" 형식의 매개 변수로 전달할 수 없습니다. - {StrBegin="MSB4094: "} - UE: This error is shown when a project tries to pass multiple items into a task parameter of type ITaskItem (singular). - - - MSB4094: "{0}" ist ein ungültiger Wert für den "{1}"-Parameter der "{3}"-Aufgabe. Mehrere Elemente können nicht in einen Parameter vom Typ "{2}" übergeben werden. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4115: The "{0}" function only accepts a scalar value, but its argument "{1}" evaluates to "{2}" which is not a scalar value. - MSB4115: "{0}" 함수는 스칼라 값만 허용하는데 해당 "{1}" 인수는 스칼라 값이 아닌 "{2}"(으)로 계산됩니다. - {StrBegin="MSB4115: "} - UE: This error is shown when a project tries to pass multiple items into a function in a conditional expression, that can only accept a scalar value (such as the "exists()" function). - - - MSB4115: Die "{0}"-Funktion nimmt nur einen Skalarwert an, ihr "{1}"-Argument wird jedoch zu "{2}" ausgewertet, bei dem es sich nicht um einen Skalarwert handelt. - - fuzzyMatch="100" wordcount="22" adjWordcount="5.5" curWordcount="5.5" tmLabel="N''" - - - The task is currently associated with a project object, and should not be added to a different one. - 이 작업은 현재 프로젝트 개체에 연결되어 있으므로 다른 개체에 추가할 수 없습니다. - - - Die Aufgabe ist derzeit einem Projektobjekt zugeordnet und sollte zu keinem anderen Projektobjekt hinzugefügt werden. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - MSB4095: The item metadata %({0}) is being referenced without an item name. Specify the item name by using %(itemname.{0}). - MSB4095: 항목 이름이 없는 항목 메타데이터 %({0})이(가) 참조되고 있습니다. %(itemname.{0})을(를) 사용하여 항목 이름을 지정하세요. - {StrBegin="MSB4095: "} - - MSB4095: Auf die %({0})-Elementmetadaten wird ohne einen Elementnamen verwiesen. Geben Sie den Namen mithilfe von %(itemname.{0}) an. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - The task is not associated with the specified target element collection, and should not be removed from it. - 이 작업은 지정한 대상 요소 컬렉션에 연결되지 않으므로 해당 컬렉션에서 제거할 수 없습니다. - - - Die Aufgabe ist nicht der angegebenen Auflistung von Zielelementen zugeordnet und sollte nicht daraus entfernt werden. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - MSB4005: The current working directory could not be restored to {0}. {1} - MSB4005: 현재 작업 디렉터리를 {0}(으)로 복원할 수 없습니다. {1} - {StrBegin="MSB4005: "}UE: This message is shown when the current working directory cannot be reset after a build. "{1}" contains a message explaining why. - LOCALIZATION: "{1}" is a message from an CLR/FX exception and is already localized. - - MSB4005: Das aktuelle Arbeitsverzeichnis konnte unter {0} nicht wiederhergestellt werden. {1} - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Cannot set a condition on an object not represented by an XML element in the project file. - 프로젝트 파일에 XML 요소로 표시되지 않은 개체에는 조건을 설정할 수 없습니다. - - - Eine Bedingung kann nicht für ein Objekt festgelegt werden, wenn das Objekt nicht von einem XML-Element in der Projektdatei repräsentiert wird. - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - Cannot set ContinueOnError on an object not represented by an XML element in the project file. - 프로젝트 파일에 XML 요소로 표시되지 않은 개체에 대해서는 ContinueOnError를 설정할 수 없습니다. - - - Das ContinueOnError-Attribut kann nicht für ein Objekt festgelegt werden, wenn das Objekt nicht von einem XML-Element in der Projektdatei repräsentiert wird. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB4134: DefaultToolsVersion cannot be set after a project has been loaded into the Engine. - MSB4134: 프로젝트를 엔진으로 로드한 다음에는 DefaultToolsVersion을 설정할 수 없습니다. - {StrBegin="MSB4134: "} - - MSB4134: DefaultToolsVersion darf nicht festgelegt werden, nachdem ein Projekt in das Modul geladen wurde. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - Assigning the "{0}" attribute on an item that has been evaluated is not allowed. This operation is only allowed on the original persisted item that came directly from the project file. - 확인된 항목에는 "{0}" 특성을 지정할 수 없습니다. 이 작업은 프로젝트 파일에서 직접 가져온 원래 보관된 항목에 대해서만 수행할 수 있습니다. - - - Das {0}-Attribut darf nicht einem Element zugewiesen werden, das ausgewertet wurde. Dieser Vorgang ist nur für das ursprüngliche persistente Element zulässig, das direkt aus der Projektdatei stammt. - - fuzzyMatch="101" wordcount="31" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Assigning the "{0}" attribute of a virtual item is not allowed. - 가상 항목의 "{0}" 특성은 할당할 수 없습니다. - - - Das Zuweisen des {0}-Attributs eines virtuellen Elements ist nicht zulässig. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - A property cannot be set while building. - 빌드하는 동안에는 속성을 설정할 수 없습니다. - - - Eine Eigenschaft kann nicht während des Erstellens festgelegt werden. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - A property cannot be set to null. - 속성은 null로 설정할 수 없습니다. - - - Eine Eigenschaft kann nicht auf NULL festgelegt werden. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Cannot get or set parameters on a task not associated with a project object. - 프로젝트 개체에 연결되지 않은 작업에 대해서는 매개 변수를 가져오거나 설정할 수 없습니다. - - - Parameter für eine Aufgabe können nicht abgefragt oder festgelegt werden, wenn die Aufgabe keinem Projektobjekt zugeordnet ist. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4162: <{0}> is not valid. Child elements are not allowed below a item remove element. - MSB4162: <{0}>이(가) 잘못되었습니다. 자식 요소는 항목 제거 요소 아래에 있을 수 없습니다. - {StrBegin="MSB4162: "} - - MSB4162: <{0}> ist ungültig. Untergeordnete Elemente dürfen nicht unter einem Element Element entfernen. - - fuzzyMatch="15" wordcount="16" adjWordcount="13.6" curWordcount="13.6" - - - MSB4166: Child node "{0}" exited prematurely. Shutting down. - MSB4166: 자식 노드 "{0}"이(가) 중간에 종료되었습니다. 종료합니다. - {StrBegin="MSB4166: "} - - MSB4166: Der untergeordnete Knoten "{0}" wurde vorzeitig beendet. Herunterfahren. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4085: A <Choose> must contain at least one <When>. - MSB4085: <Choose>에는 적어도 하나의 <When>이 있어야 합니다. - {StrBegin="MSB4085: "} - - MSB4085: < auswählen > muss mindestens < Wenn >. - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB4114: <Choose> elements cannot be nested more than {0} levels deep. - MSB4114: <Choose> 요소는 {0}단계 이하로만 중첩할 수 있습니다. - {StrBegin="MSB4114: "}UE: This message appears if the project file contains unreasonably nested Choose elements. - LOCALIZATION: Do not localize "Choose" as it is an XML element name. - - MSB4114: < auswählen > Elemente können nicht geschachtelt werden mehr als {0} Ebenen. - - fuzzyMatch="15" wordcount="12" adjWordcount="10.2" curWordcount="10.2" - - - MSB4006: There is a circular dependency in the target dependency graph involving target "{0}". - MSB4006: 대상 종속성 그래프에 "{0}" 대상과 관련된 순환 종속성이 있습니다. - {StrBegin="MSB4006: "}UE: This message is shown when the build engine detects a target referenced in a circular manner -- a project cannot - request a target to build itself (perhaps via a chain of other targets). - - MSB4006: Im Zielabhängigkeitsdiagramm besteht eine Ringabhängigkeit im Zusammenhang mit dem Ziel "{0}". - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4086: A numeric comparison was attempted on "{1}" that evaluates to "{2}" instead of a number, in condition "{0}". - MSB4086: "{0}" 조건에서 숫자 대신 "{2}"(으)로 계산되는 "{1}"에 대해 숫자 비교를 시도했습니다. - {StrBegin="MSB4086: "} - - MSB4086: Es wurde versucht, einen numerischen Vergleich für "{1}" auszuführen, der zu "{2}" anstatt zu einer Zahl in Bedingung "{0}" ausgewertet wird. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4007: The clause "{0}", specified in the "{1}" attribute is invalid. - MSB4007: "{1}" 특성에 지정한 "{0}" 절이 잘못되었습니다. - {StrBegin="MSB4007: "}UE: This message is shown when the Condition on an element is invalid in some way -- e.g. syntax error, unrecognized operator. - - MSB4007: Die im {1}-Attribut festgelegte {0}-Klausel ist ungültig. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4130: The condition "{0}" may have been evaluated incorrectly in an earlier version of MSBuild. Please verify that the order of the AND and OR clauses is written as intended. To avoid this warning, add parentheses to make the evaluation order explicit. - MSB4130: 이전 MSBuild에서 "{0}" 조건이 잘못 계산되었을 수 있습니다. AND 및 OR 절의 순서가 맞는지 확인하세요. 이 경고가 발생하지 않도록 하려면 괄호를 사용하여 계산 순서를 명확하게 표시하세요. - {StrBegin="MSB4130: "} - - MSB4130: Die Bedingung "{0}" ist in einer früheren Version von MSBuild möglicherweise fehlerhaft ausgewertet worden. Stellen Sie sicher, dass die AND- und OR-Klauseln in der beabsichtigten Reihenfolge stehen. Damit diese Warnung nicht angezeigt wird, fügen Sie Klammern hinzu, um die Auswertungsreihenfolge explizit anzugeben. - - fuzzyMatch="101" wordcount="42" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4087: Specified condition "{0}" does not evaluate to a boolean. - MSB4087: 지정한 조건 "{0}"이(가) 부울로 계산되지 않습니다. - {StrBegin="MSB4087: "} - - MSB4087: Die angegebene {0}-Bedingung wird nicht zu einem booleschen Wert ausgewertet. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4113: Specified condition "{0}" evaluates to "{1}" instead of a boolean. - MSB4113: 지정한 조건 "{0}"이(가) 부울 대신 "{1}"(으)로 계산됩니다. - {StrBegin="MSB4113: "} - - MSB4113: Die angegebene Bedingung {0} wird zu {1} statt zu einem booleschen Wert ausgewertet. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - {0}, line {1} - {0}, 줄 {1} - - - {0}, Zeile {1} - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - MSB4136: Error reading the toolset information from the configuration file "{0}". {1} - MSB4136: "{0}" 구성 파일에서 도구 집합 정보를 읽는 동안 오류가 발생했습니다. {1} - {StrBegin="MSB4136: "} - - MSB4136: Fehler beim Lesen der Toolsetinformationen aus der Konfigurationsdatei "{0}". {1} - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4008: A conflicting assembly for the task assembly "{0}" has been found at "{1}". - MSB4008: 작업 어셈블리 "{0}"과(와) 충돌하는 어셈블리가 "{1}"에 있습니다. - {StrBegin="MSB4008: "}UE: This message is shown when the type/class of a task cannot be resolved uniquely from a single assembly. - - MSB4008: Eine mit der Aufgabenassembly "{0}" in Konflikt stehende Assembly wurde in "{1}" gefunden. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4142: MSBuildToolsPath is not the same as MSBuildBinPath for the ToolsVersion "{0}" defined at "{1}". If both are present they must have the same value. - MSB4142: MSBuildToolsPath가 "{1}"에 정의된 ToolsVersion "{0}"의 MSBuildBinPath와 다릅니다. 두 항목이 모두 있는 경우 값이 같아야 합니다. - {StrBegin="MSB4142: "} - - MSB4142: MSBuildToolsPath ist nicht identisch mit MSBuildBinPath für die bei "{1}" definierte ToolsVersion {0}. Wenn beide Pfade vorhanden sind, müssen sie identische Werte haben. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4097: The element <{0}> beneath element <{1}> may not have a custom XML namespace. - MSB4097: <{1}> 요소 아래의 <{0}> 요소에는 사용자 지정 XML 네임스페이스를 사용할 수 없습니다. - {StrBegin="MSB4097: "} - - MSB4097: Das Element <{0}> unter Element <{1}> möglicherweise keinen benutzerdefinierten XML-Namespace. - - fuzzyMatch="15" wordcount="16" adjWordcount="13.6" curWordcount="13.6" - - - MSB4009: The default tasks file could not be successfully loaded. {0} - MSB4009: 기본 작업 파일을 로드할 수 없습니다. {0} - {StrBegin="MSB4009: "}UE: This message is shown when one of the default tasks file (*.tasks) located alongside the MSBuild binaries cannot - be opened/parsed. "{0}" contains a message explaining why. The filename itself is not part of the message but is provided - separately to loggers. - LOCALIZATION: "{0}" is a message from some FX method and is already localized. - - MSB4009: Die Standardaufgabendatei konnte nicht geladen werden. {0} - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4010: The "{0}" files could not be successfully loaded from their expected location "{1}". Default tasks will not be available. {2} - MSB4010: "{0}" 파일을 예상 위치 "{1}"에서 로드할 수 없습니다. 기본 작업을 사용할 수 없게 됩니다. {2} - {StrBegin="MSB4010: "}UE: This message is shown when the default tasks files that are located alongside the MSBuild binaries cannot be - found, either because they don't exist, or because of lack of permissions. "{2}" contains a message explaining why. - LOCALIZATION: "{2}" is a message from some FX method and is already localized. - - MSB4010: Die {0}-Dateien konnten nicht vom erwarteten Speicherplatz "{1}" geladen werden. Standardaufgaben sind nicht verfügbar. {2} - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - MSB4140: Default tools version is specified in neither the registry nor the configuration file. - MSB4140: 기본 도구 버전이 레지스트리나 구성 파일에 지정되어 있지 않습니다. - {StrBegin="MSB4140: "} - - MSB4140: Die Standardtoolsversion ist weder in der Registrierung noch in der Konfigurationsdatei angegeben. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4133: A default tools version "{0}" was specified, but its definition could not be found. - MSB4133: 기본 도구 버전 "{0}"이(가) 지정되었지만 해당 정의를 찾을 수 없습니다. - {StrBegin="MSB4133: "} - - MSB4133: Eine Standardtoolsversion "{0}" wurde angegeben, aber ihre Definition konnte nicht gefunden werden. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - MSB4080: The value "{0}" of the "PropertyName" attribute in element <Output> contains a "$" character. If you intended to use a property name then remove the $( ) around the property name. - MSB4080: <Output> 요소에 있는 "PropertyName" 특성의 "{0}" 값에 "$" 문자가 있습니다. 속성 이름을 사용하려면 속성 이름 주위에 있는 $( )를 제거하십시오. - {StrBegin="MSB4080: "}UE: This message is shown when an output tag has an property name that contains an $. They probably typed $(foo) instead of foo in the PropertyName. LOCALIZATION: Output and PropertyName should not be localized. - - MSB4080: Der Wert "{0}" "PropertyName-Attribut im Element < Output >"$"-Zeichen enthält. Wenn Sie auf einen Eigenschaftennamen verwenden und entfernen Sie anschließend die ($), um den Eigenschaftennamen. - - fuzzyMatch="15" wordcount="32" adjWordcount="27.2" curWordcount="27.2" - - - MSB4011: There is a circular reference involving the import of file "{0}". This file may have been imported more than once, or you may have attempted to import the main project file. All except the first instance of this file will be ignored. - MSB4011: "{0}" 파일 가져오기와 관련된 순환 참조가 있습니다. 이 파일을 두 번 이상 가져왔거나 기본 프로젝트 파일을 가져오려고 시도했을 수 있습니다. 이 파일의 첫 번째 인스턴스를 제외한 모든 인스턴스가 무시됩니다. - {StrBegin="MSB4011: "} - - MSB4011: Es besteht eine Ringabhängigkeit im Zusammenhang mit dem Import der Datei {0}. Diese Datei wurde unter Umständen mehrmals importiert, oder es wurde versucht, die Hauptprojektdatei zu importieren. Alle außer der ersten Instanz dieser Datei werden ignoriert. - - fuzzyMatch="101" wordcount="43" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4079: The <ProjectExtensions> element occurs more than once. - MSB4079: <ProjectExtensions> 요소가 두 번 이상 나타납니다. - {StrBegin="MSB4079: "} - - MSB4079: Das Element < ProjectExtensions > tritt mehr als einmal. - - fuzzyMatch="15" wordcount="9" adjWordcount="7.65" curWordcount="7.65" - - - MSB4012: The expression "{0}" cannot be used in this context. Item lists cannot be concatenated with other strings where an item list is expected. Use a semicolon to separate multiple item lists. - MSB4012: 이 컨텍스트에서는 "{0}" 식을 사용할 수 없습니다. 항목 목록이 필요한 위치에서는 항목 목록을 다른 문자열과 연결할 수 없습니다. 세미콜론을 사용하여 여러 항목 목록을 구분하세요. - {StrBegin="MSB4012: "}UE: This message is shown when the user does not properly specify an item list when an item list is expected - e.g. "badprefix@(foo)badsuffix" instead of "prefix; @(foo); suffix" - - MSB4012: Der Ausdruck {0} kann in diesem Kontext nicht verwendet werden. Elementlisten können nicht mit anderen Zeichenfolgen verkettet werden, wenn eine Elementliste erwartet wird. Verwenden Sie ein Semikolon, um mehrere Elementlisten voneinander zu trennen. - - fuzzyMatch="101" wordcount="32" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Need to specify the project file name. - 프로젝트 파일 이름을 지정해야 합니다. - UE: This message is shown when the user calls into the engine to build a project without specifying a filename. - - Geben Sie den Projektdateinamen an. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - end of input - 입력의 끝 - This is the name of the "EndOfInput" token. It is displayed in quotes as the - unexpected char or token when the end of a conditional was unexpectedly reached. - - Ende der Eingabe - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - The previous error was converted to a warning because the task was called with ContinueOnError=true. - ContinueOnError=true로 작업을 호출했으므로 이전 오류가 경고로 변환되었습니다. - - - Der vorherige Fehler wurde in eine Warnung umgewandelt, da die Aufgabe mit ContinueOnError=true aufgerufen wurde. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - {0} Error(s) - 오류 {0}개 - - - {0} Fehler - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4159: Error creating the toolset "{0}". {1} - MSB4159: "{0}" 도구 집합을 만드는 동안 오류가 발생했습니다. {1} - {StrBegin="MSB4159: "} - - MSB4159: Fehler beim Erstellen des Toolsets "{0}". {1} - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4146: Cannot evaluate the property expression "{0}" found at "{1}". {2} - MSB4146: "{1}"에 있는 속성 식 "{0}"을(를) 계산할 수 없습니다. {2} - {StrBegin="MSB4146: "} - - MSB4146: Der bei "{1}" gefundene Eigenschaftsausdruck "{0}" kann nicht ausgewertet werden. {2} - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - The <{0}> tag is no longer supported as a child of the <Project> element. Place this tag within a target, and add the name of the target to the "InitialTargets" attribute of the <Project> element. - <{0}> 태그는 더 이상 <Project> 요소의 자식으로 지원되지 않습니다. 이 태그를 대상 안에 넣고 대상의 이름을 <Project> 요소의 "InitialTargets" 특성에 추가하세요. - - - Das <{0}>-Tag nicht als untergeordnetes Element des < Project >-Elements unterstützt. Platzieren Sie dieses Tag in einem Ziel und fügen Sie den Namen des Ziels InitialTargets-Attribut des < Project >-Elements hinzu. - - fuzzyMatch="15" wordcount="38" adjWordcount="32.3" curWordcount="32.3" - - - MSB4100: Expected "{0}" to evaluate to a boolean instead of "{1}", in condition "{2}". - MSB4100: "{2}" 조건에서 "{1}" 대신 부울로 계산되는 "{0}"이(가) 필요합니다. - {StrBegin="MSB4100: "} - - MSB4100: Das Ergebnis der Auswertung von {0} war {1}, es wurde jedoch ein boolescher Wert in der {2}-Bedingung erwartet. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4028: The "{0}" task's outputs could not be retrieved from the "{1}" parameter. {2} - MSB4028: "{0}" 작업의 출력을 "{1}" 매개 변수에서 검색할 수 없습니다. {2} - {StrBegin="MSB4028: "} - - MSB4028: Die Ausgaben der {0}-Aufgabe konnten nicht aus dem {1}-Parameter abgerufen werden. {2} - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4014: The build was aborted because of an internal failure. - MSB4014: 내부 오류로 인해 빌드가 중단되었습니다. - {StrBegin="MSB4014: "}UE: This message is shown when an unhandled exception terminates the build. The cause is most likely a programming - error in the build engine. - - MSB4014: Das Erstellen wurde aufgrund eines internen Fehlers abgebrochen. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4015: The build was aborted because the "{0}" logger failed unexpectedly during shutdown. - MSB4015: 종료하는 동안 "{0}" 로거에서 예기치 않은 오류가 발생하여 빌드가 중단되었습니다. - {StrBegin="MSB4015: "}UE: This message is used for a special exception that is thrown when a logger fails while shutting down (most likely - because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a special - exception to abort the build. - - MSB4015: Das Erstellen wurde abgebrochen, da für die {0}-Protokollierung beim Herunterfahren ein unerwarteter Fehler aufgetreten ist. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4016: The build was aborted because the "{0}" logger failed unexpectedly during initialization. - MSB4016: 초기화하는 동안 "{0}" 로거에서 예기치 않은 오류가 발생하여 빌드가 중단되었습니다. - {StrBegin="MSB4016: "}UE: This message is used for a special exception that is thrown when a logger fails while initializing itself (most - likely because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a - special exception to abort the build. - - MSB4016: Das Erstellen wurde abgebrochen, da für die {0}-Protokollierung bei der Initialisierung ein unerwarteter Fehler aufgetreten ist. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4017: The build was aborted because of an unexpected logger failure. - MSB4017: 예기치 않은 로거 오류가 발생하여 빌드가 중단되었습니다. - {StrBegin="MSB4017: "}UE: This message is used for a special exception that is thrown when a logger fails while logging an event (most - likely because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a - special exception to abort the build. - - MSB4017: Das Erstellen wurde wegen eines unerwarteten Protokollierungsfehlers abgebrochen. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4018: The "{0}" task failed unexpectedly. - MSB4018: "{0}" 작업에서 예기치 않은 오류가 발생했습니다. - {StrBegin="MSB4018: "}UE: This message is shown when a task terminates because of an unhandled exception. The cause is most likely a - programming error in the task; however, it is also possible that the unhandled exception originated in the engine, and was - surfaced through the task when the task called into the engine. - - MSB4018: Unerwarteter Fehler bei der {0}-Aufgabe. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4165: Failed to receive a response from the child node "{0}" in the timeout period "{1}" ms. Shutting down. - MSB4165: "{1}"ms의 제한 시간 내에 자식 노드 "{0}"에서 응답을 받지 못했습니다. 종료합니다. - {StrBegin="MSB4165: "} - - MSB4165: Vom untergeordneten Knoten "{0}" wurde innerhalb des Zeitlimits von "{1}" ms keine Antwort empfangen. Herunterfahren. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4088: Condition "{0}" is improperly constructed. - MSB4088: "{0}" 조건이 제대로 생성되지 않았습니다. - {StrBegin="MSB4088: "} - - MSB4088: Die {0}-Bedingung ist falsch konstruiert. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4105: Found an unexpected character '{2}' at position {1} in condition "{0}". Did you intend to use "=="? - MSB4105: "{0}" 조건의 {1} 위치에 예기치 않은 '{2}' 문자가 있습니다. "=="를 사용하려고 했나요? - {StrBegin="MSB4105: "} - - MSB4105: Ein unerwartetes Zeichen {2} wurde an Position {1} in der {0}-Bedingung gefunden. Wollten Sie "==" verwenden? - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - MSB4106: Expected an item list at position {1} in condition "{0}". Did you forget the closing parenthesis? - MSB4106: "{0}" 조건의 {1} 위치에 항목 목록이 필요합니다. 닫는 괄호가 없습니다. - {StrBegin="MSB4106: "} - - MSB4106: Eine Elementliste wurde an Position {1} in Bedingung {0} erwartet. Haben Sie die schließende Klammer vergessen? - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - MSB4107: Expected an item list at position {1} in condition "{0}". Did you forget the opening parenthesis after the '@'? To use a literal '@', use '%40' instead. - MSB4107: "{0}" 조건의 {1} 위치에 항목 목록이 필요합니다. '@' 뒤에 여는 괄호가 없습니다. '@' 리터럴을 사용하려면 '%40'을 대신 사용하세요. - {StrBegin="MSB4107: "} - - MSB4107: Eine Elementliste wurde an Position {1} in Bedingung {0} erwartet. Haben Sie die öffnende Klammer hinter dem Zeichen "@" vergessen? Wenn Sie ein literales "@" verwenden möchten, geben Sie "%40" ein. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4108: Expected an item list at position {1} in condition "{0}". Did you forget to close a quote inside the item list expression? - MSB4108: "{0}" 조건의 {1} 위치에 항목 목록이 필요합니다. 항목 목록 식 안에 닫는 따옴표가 없습니다. - {StrBegin="MSB4108: "} - - MSB4108: Eine Elementliste wurde an Position {1} in Bedingung {0} erwartet. Haben Sie das schließende Anführungszeichen innerhalb des Elementlistenausdrucks vergessen? - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - MSB4109: Expected a property at position {1} in condition "{0}". Did you forget the closing parenthesis? - MSB4109: "{0}" 조건의 {1} 위치에 속성이 필요합니다. 닫는 괄호가 없습니다. - {StrBegin="MSB4109: "} - - MSB4109: Eine Eigenschaft wurde an Position {1} in Bedingung {0} erwartet. Haben Sie die schließende Klammer vergessen? - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB4110: Expected a property at position {1} in condition "{0}". Did you forget the opening parenthesis after the '$'? To use a literal '$', use '%24' instead. - MSB4110: "{0}" 조건의 {1} 위치에 속성이 필요합니다. '$' 뒤에 여는 괄호가 없습니다. '$' 리터럴을 사용하려면 '%24'를 대신 사용하세요. - {StrBegin="MSB4110: "} - - MSB4110: Eine Eigenschaft wurde an Position {1} in Bedingung {0} erwartet. Haben Sie die öffnende Klammer hinter dem Zeichen "$" vergessen? Wenn Sie eine literales "$" verwenden möchten, geben Sie "%24" ein. - - fuzzyMatch="101" wordcount="27" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4101: Expected a closing quote after position {1} in condition "{0}". - MSB4101: "{0}" 조건의 {1} 위치 뒤에 닫는 따옴표가 필요합니다. - {StrBegin="MSB4101: "} - - MSB4101: Es wurde ein schließendes Anführungszeichen hinter Position {1} in Bedingung {0} erwartet. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4019: The imported project "{0}" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. - MSB4019: 가져온 "{0}" 프로젝트를 찾을 수 없습니다. <Import> 선언에 지정한 경로가 올바른지 그리고 파일이 디스크에 있는지 확인하십시오. - {StrBegin="MSB4019: "}LOCALIZATION: <Import> should not be localized. - - MSB4019: Das importierte Projekt "{0}" wurde nicht gefunden. Bestätigen Sie den Pfad in der Deklaration < Import > und die Datei auf dem Datenträger vorhanden ist. - - fuzzyMatch="15" wordcount="26" adjWordcount="22.1" curWordcount="22.1" - - - MSB4089: Incorrect number of arguments to function in condition "{0}". Found {1} argument(s) when expecting {2}. - MSB4089: "{0}" 조건에 사용된 함수의 인수 개수가 잘못되었습니다. 인수가 {2}개 있어야 하는데 {1}개 있습니다. - {StrBegin="MSB4089: "} - - MSB4089: Falsche Anzahl von Argumenten für eine Funktion in der Bedingung "{0}". {1} Argument(e) gefunden, obwohl {2} erwartet wurde(n). - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - The "{0}" object specified does not belong to the correct "{1}" object. - 지정한 "{0}" 개체는 올바른 "{1}" 개체에 속하지 않습니다. - - - Das angegebene {0}-Objekt gehört nicht zum korrekten {1}-Objekt. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4020: The value "{0}" of the "{1}" attribute in element <{2}> is invalid. - MSB4020: <{2}> 요소에 있는 "{1}" 특성의 "{0}" 값이 잘못되었습니다. - {StrBegin="MSB4020: "}UE: This is a generic message that is displayed when we find a project element with an incorrect value for one of its - attributes e.g. <Import Project=""> -- the value of Project should not be an empty string. - - MSB4020: Der Wert "{0}" von der "{1}" Attribut im Element <{2}> ist ungültig. - - fuzzyMatch="15" wordcount="14" adjWordcount="11.9" curWordcount="11.9" - - - MSB4102: The value "{0}" of the "{1}" attribute in element <{2}> is invalid. {3} - MSB4102: <{2}> 요소에 있는 "{1}" 특성의 "{0}" 값이 잘못되었습니다. {3} - {StrBegin="MSB4102: "}UE: This is a generic message that is displayed when we find a project element with an incorrect value for one of its - attributes. At the end of the message we show the exception text we got trying to use the value. - - MSB4102: Der Wert "{0}" von der "{1}" Attribut im Element <{2}> ist ungültig. {3} - - fuzzyMatch="15" wordcount="15" adjWordcount="12.75" curWordcount="12.75" - - - MSB4021: The "ContinueOnError" attribute of the "{0}" task is not valid. {1} - MSB4021: "{0}" 작업의 "ContinueOnError" 특성이 잘못되었습니다. {1} - {StrBegin="MSB4021: "}LOCALIZATION: "ContinueOnError" should not be localized. "{1}" is a message from another exception explaining the problem. - - MSB4021: Das ContinueOnError-Attribut für die {0}-Aufgabe ist ungültig. {1} - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4139: Invalid value for default ToolsVersion is specified in registry key "{0}". - MSB4139: 레지스트리 키 "{0}"에 지정된 기본 ToolsVersion 값이 잘못되었습니다. - {StrBegin="MSB4139: "} - - MSB4139: Im Registrierungsschlüssel "{0}" ist ein ungültiger Wert für die Standard-ToolsVersion angegeben. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4022: The result "{0}" of evaluating the value "{1}" of the "{2}" attribute in element <{3}> is not valid. - MSB4022: <{3}> 요소에 있는 "{2}" 특성의 "{1}" 값을 확인한 결과인 "{0}"이(가) 잘못되었습니다. - {StrBegin="MSB4022: "}UE: This message is shown when the engine is checking the correctness of the value (after evaluating embedded - properties/items) assigned to an XML attribute of an XML element in the project file. - - MSB4022: Das Ergebnis "{0}"der Auswertung des Werts"{1}" von der "{2}" Attribut im Element <{3}> ist ungültig. - - fuzzyMatch="15" wordcount="20" adjWordcount="17" curWordcount="17" - - - "{0}" is not a valid event category. To raise a custom event, use the "{1}" category. - "{0}"은(는) 올바른 이벤트 범주가 아닙니다. 사용자 지정 이벤트를 발생시키려면 "{1}" 범주를 사용하십시오. - - - {0} ist keine gültige Ereigniskategorie. Verwenden Sie die {1}-Kategorie, um ein benutzerdefiniertes Ereignis auszulösen. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - "{0}" is not a valid importance level for events. - "{0}"은(는) 올바른 이벤트 중요도 수준이 아닙니다. - - - {0} ist kein gültiger Wert für die Bedeutung eines Ereignisses. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4104: Failed to write to log file "{0}". {1} - MSB4104: "{0}" 로그 파일에 쓰지 못했습니다. {1} - {StrBegin="MSB4104: "}UE: This is shown when the File Logger can't create or write to the file it was instructed to log to. - - MSB4104: Fehler beim Schreiben in die Protokollierungsdatei "{0}". {1} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4024: The imported project file could not be loaded. {0} - MSB4024: 가져온 프로젝트 파일을 로드할 수 없습니다. {0} - {StrBegin="MSB4024: "}UE: This message is shown when an imported project file cannot be loaded because of incorrect XML. The project - filename is not part of the message because it is provided separately to loggers. - LOCALIZATION: {0} is a localized message from the CLR/FX explaining why the project is invalid. - - MSB4024: Die importierte Projektdatei konnte nicht geladen werden. {0} - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - Operation invalid for a persisted item group. - 보관된 항목 그룹에 대한 작업이 잘못되었습니다. - - - Ungültiger Vorgang für eine persistente Elementgruppe. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Operation invalid for a virtual item group. - 가상 항목 그룹에 대한 작업이 잘못되었습니다. - - - Ungültiger Vorgang für eine virtuelle Elementgruppe. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4071: The value Importance="{0}" in the <Message> element is invalid. Valid values are: High, Normal and Low. - MSB4071: <Message> 요소의 Importance="{0}" 값이 잘못되었습니다. 유효한 값은 High, Normal 및 Low입니다. - {StrBegin="MSB4071: "}UE: This message is shown when a user specifies a value for the importance attribute of Message which is not valid. - The importance enumeration is: High, Normal and Low. Specifying any other importance will result in this message being shown - LOCALIZATION: "Importance" should not be localized. - "Message" should not be localized. - High should not be localized. - Normal should not be localized. - Low should not be localized. - - MSB4071: Der Wert Importance = "{0}" in < Nachricht > Element ist ungültig. Gültige Werte sind: hoch, Normal und niedrig. - - fuzzyMatch="15" wordcount="18" adjWordcount="15.3" curWordcount="15.3" - - - MSB4025: The project file could not be loaded. {0} - MSB4025: 프로젝트 파일을 로드할 수 없습니다. {0} - {StrBegin="MSB4025: "}UE: This message is shown when the project file given to the engine cannot be loaded because the filename/path is - invalid, or due to lack of permissions, or incorrect XML. The project filename is not part of the message because it is - provided separately to loggers. - LOCALIZATION: {0} is a localized message from the CLR/FX explaining why the project is invalid. - - MSB4025: Die Projektdatei konnte nicht geladen werden. {0} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4147: The property "{0}" at "{1}" is invalid. {2} - MSB4147: "{1}"의 "{0}" 속성이 잘못되었습니다. {2} - {StrBegin="MSB4147: "} - - MSB4147: Die {0}-Eigenschaft bei "{1}" ist ungültig. {2} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - "{0}" is an invalid "ProjectFileEncoding" value. - "{0}"은(는) 잘못된 "ProjectFileEncoding" 값입니다. - LOCALIZATION: "ProjectFileEncoding" should not be localized. - - {0} ist ein ungültiger ProjectFileEncoding-Wert. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4143: The expression "{0}" cannot be evaluated. {1} - MSB4143: "{0}" 식을 계산할 수 없습니다. {1} - {StrBegin="MSB4143: "} - UE: This message is shown when the user attempts to provide an expression like "$(Registry:HKEY_LOCAL_MACHINE\Software\Vendor\Tools@TaskLocation)" - LOCALIZATION: "{0}" is the expression that was bad. "{1}" is a message from an FX exception that describes why the expression is bad. - - - MSB4143: Der Ausdruck "{0}" kann nicht ausgewertet werden. {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4184: The expression "{0}" cannot be evaluated. {1} - MSB4184: "{0}" 식을 계산할 수 없습니다. {1} - {StrBegin="MSB4184: "} - Single quotes as the expression will typically have double quotes in it. - UE: This message is shown when the user attempts to provide an expression like "$(SomeProperty.ToLower())" - LOCALIZATION: "{0}" is the expression that was bad. "{1}" is a message from an FX exception that describes why the expression is bad. - - - MSB4184: Der Ausdruck "{0}" kann nicht ausgewertet werden. {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4185: The function "{0}" on type "{1}" has not been enabled for execution. - MSB4185: "{1}" 형식의 "{0}" 함수를 실행할 수 없습니다. - {StrBegin="MSB4185: "} - UE: This message is shown when the user attempts to provide an expression like "$([System.DateTime]::Now)", but the expression has not been enabled - LOCALIZATION: "{0}" is the static function name, "{1}" is the .NET Framework type name - - - MSB4185: Die {0}-Funktion für den {1}-Typ wurde nicht für die Ausführung aktiviert. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4186: Invalid static method invocation syntax: "{0}". Static method invocation should be of the form: $([FullTypeName]::Method()), e.g. $([System.IO.Path]::Combine(`a`, `b`)) - MSB4186: 정적 메서드 호출 구문 "{0}"이(가) 잘못되었습니다. 정적 메서드 호출의 형식은 $([FullTypeName]::Method())여야 합니다. 예: $([System.IO.Path]::Combine(`a`, `b`)) - {StrBegin="MSB4186: "} - UE: This message is shown when the user attempts to call a static method on a type, but has used the incorrect syntax - LOCALIZATION: "{0}" is the function expression which is in error - - - MSB4186: Ungültige Aufrufsyntax für statische Methode: "{0}". Für den Aufruf statischer Methoden muss folgendes Format verwendet werden: $([vollständiger Typname]::Methode()), z. B. $([System.IO.Path]::Combine(`a`, `b`)) - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4070: The schema "{0}" is not valid. {1} - MSB4070: "{0}" 스키마가 잘못되었습니다. {1} - {StrBegin="MSB4070: "}UE: This message is shown when the schema file provided for the validation of a project is itself not valid. - LOCALIZATION: "{0}" is the schema file path. "{1}" is a message from an FX exception that describes why the schema file is bad. - - MSB4070: Das Schema "{0}" ist nicht gültig. {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4026: The "{0}={1}" parameter for the "{2}" task is invalid. - MSB4026: "{2}" 작업의 "{0}={1}" 매개 변수가 잘못되었습니다. - {StrBegin="MSB4026: "}UE: This message is displayed when a task has an invalid parameter that cannot be initialized. - - MSB4026: Der {0}={1}-Parameter für die {2}-Aufgabe ist ungültig. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4027: The "{0}" task generated invalid items from the "{1}" output parameter. {2} - MSB4027: "{0}" 작업이 "{1}" 출력 매개 변수에서 잘못된 항목을 생성했습니다. {2} - {StrBegin="MSB4027: "} - - MSB4027: Die {0}-Aufgabe generierte ungültige Elemente aus dem {1}-Ausgabeparameter. {2} - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4029: The "{0}" task has an invalid output specification. The "TaskParameter" attribute is required, and either the "ItemName" or "PropertyName" attribute must be specified (but not both). - MSB4029: "{0}" 작업의 출력 사양이 잘못되었습니다. "TaskParameter" 특성이 필요하고 "ItemName" 또는 "PropertyName" 특성 중 하나를 지정해야 합니다(둘 다 지정할 수 없음). - {StrBegin="MSB4029: "}LOCALIZATION: "TaskParameter", "ItemName" and "PropertyName" should not be localized. - - MSB4029: Die {0}-Aufgabe enthält eine ungültige Ausgabespezifikation. Das TaskParameter-Attribut ist erforderlich, und es muss entweder das ItemName- oder PropertyName-Attribut angegeben werden (jedoch nicht beide). - - fuzzyMatch="101" wordcount="27" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4030: "{0}" is an invalid value for the "{1}" parameter of the "{3}" task. The "{1}" parameter is of type "{2}". - MSB4030: "{0}"은(는) "{3}" 작업의 "{1}" 매개 변수에 사용할 수 없는 값입니다. "{1}" 매개 변수는 "{2}" 형식입니다. - {StrBegin="MSB4030: "}UE: This error is shown when a type mis-match occurs between the value assigned to task parameter in the project file - and the type of the .NET property that corresponds to the task parameter. For example, if an int task parameter called "Count" - is assigned the value "x", this error would be displayed: <MyTask Count="x" /> - - MSB4030: "{0}" ist ein ungültiger Wert für den {1}-Parameter der {3}-Aufgabe. Der {1}-Parameter ist vom Typ "{2}". - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - MSB4137: Invalid value specified in the configuration file at "{0}". Property name or tools version name is an empty string. - MSB4137: 구성 파일의 "{0}"에 잘못된 값이 지정되었습니다. 속성 이름 또는 도구 버전 이름이 빈 문자열입니다. - {StrBegin="MSB4137: "} - - MSB4137: In der Konfigurationsdatei ist bei "{0}" ein ungültiger Wert angegeben. Der Eigenschaftenname oder der Toolsversionname ist eine leere Zeichenfolge. - - fuzzyMatch="100" wordcount="20" adjWordcount="5" curWordcount="5" tmLabel="N''" - - - MSB4103: "{0}" is not a valid logger verbosity level. - MSB4103: "{0}"은(는) 로거의 세부 정보 표시로 알맞지 않습니다. - {StrBegin="MSB4103: "} - - MSB4103: "{0}" ist kein gültiger Ausführlichkeitsgrad für die Protokollierung. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4163: <ItemDefinitionGroup> is not allowed inside a target. - MSB4163: <ItemDefinitionGroup>은 대상 내에 사용할 수 없습니다. - {StrBegin="MSB4163: "} - - MSB4163: < ItemDefinitionGroup > ist in einem Ziel nicht zulässig. - - fuzzyMatch="15" wordcount="9" adjWordcount="7.65" curWordcount="7.65" - - - The specified item does not belong to the current item group. - 지정한 항목은 현재 항목 그룹에 속하지 않습니다. - - - Das angegebene Element gehört nicht zu der aktuellen Elementgruppe. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4096: The item "{0}" in item list "{1}" does not define a value for metadata "{2}". In order to use this metadata, either qualify it by specifying %({1}.{2}), or ensure that all items in this list define a value for this metadata. - MSB4096: 항목 목록 "{1}"의 "{0}" 항목은 "{2}" 메타데이터의 값을 정의하지 않습니다. 이 메타데이터를 사용하려면 %({1}.{2})을(를) 지정하여 메타데이터를 한정하거나, 이 목록에 있는 모든 항목이 이 메타데이터의 값을 정의하는지 확인하세요. - {StrBegin="MSB4096: "} - - MSB4096: Das Element "{0}" in der Elementliste "{1}" definiert keinen Wert für die {2}-Metadaten. Wenn Sie diese Metadaten verwenden möchten, qualifizieren Sie sie, indem Sie %({1}.{2}) angeben, oder vergewissern Sie sich, dass alle Elemente in der Liste einen Wert für diese Metadaten definieren. - - fuzzyMatch="101" wordcount="42" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4099: A reference to an item list at position {1} is not allowed in this condition "{0}". - MSB4099: 이 조건 "{0}"에서는 {1} 위치에 있는 항목 목록을 참조할 수 없습니다. - {StrBegin="MSB4099: "} - - MSB4099: Ein Verweis auf eine Elementliste an Position {1} ist in dieser {0}-Bedingung nicht zulässig. - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - MSB4033: "{0}" is a reserved item metadata, and cannot be redefined as a custom metadata on the item. - MSB4033: "{0}"은(는) 예약된 항목 메타데이터이므로 항목의 사용자 지정 메타데이터로 다시 정의할 수 없습니다. - {StrBegin="MSB4033: "} - - MSB4033: "{0}" sind reservierte Elementmetadaten und können nicht als benutzerdefinierte Metadaten für das Element neu definiert werden. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - An InternalLoggerException can only be thrown by the MSBuild engine. The public constructors of this class cannot be used to create an instance of the exception. - InternalLoggerException은 MSBuild 엔진에서만 throw할 수 있습니다. 이 클래스의 public 생성자는 예외의 인스턴스를 만드는 데 사용할 수 없습니다. - UE: This message is shown when a user tries to instantiate a special exception called InternalLoggerException through the OM -- - only the engine is allowed to create and throw this exception. - LOCALIZATION: "InternalLoggerException" and "MSBuild" should not be localized. - - Eine InternalLoggerException kann nur durch das MSBuild-Modul ausgelöst werden. Die öffentlichen Konstruktoren dieser Klasse können nicht verwendet werden, um eine Instanz der Ausnahme zu erstellen. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Initial Items: - 초기 항목: - - - Ursprüngliche Elemente: - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4083: Expected a Condition attribute on element "{0}". - MSB4083: "{0}" 요소에 Condition 특성이 필요합니다. - {StrBegin="MSB4083: "} - - MSB4083: Es wurde ein Bedingungsattribut für das {0}-Element erwartet. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4164: The value "{0}" of metadata "{1}" contains an item list expression. Item list expressions are not allowed on default metadata values. - MSB4164: "{1}" 메타데이터의 "{0}" 값에 항목 목록 식이 있습니다. 기본 메타데이터 값에는 항목 목록 식이 허용되지 않습니다. - {StrBegin="MSB4164: "} - - MSB4164: Der Wert "{0}" der {1}-Metadaten enthält einen Elementlistenausdruck. Elementlistenausdrücke sind nicht als Standardwerte für Metadaten zulässig. - - fuzzyMatch="100" wordcount="22" adjWordcount="5.5" curWordcount="5.5" tmLabel="N''" - - - MSBuild is expecting a valid "{0}" object. - MSBuild에 올바른 "{0}" 개체가 필요합니다. - - - MSBuild erwartet ein gültiges {0}-Objekt. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4035: The required attribute "{0}" is missing from element <{1}>. - MSB4035: 필요한 "{0}" 특성이 <{1}> 요소에 없습니다. - {StrBegin="MSB4035: "}UE: This message is shown when a user leaves off a required attribute from a project element - e.g. <UsingTask AssemblyName="foo"> -- this is missing the "TaskName" attribute. - - MSB4035: Das erforderliche Attribut "{0}"-Element fehlt <{1}>. - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB4036: The "{0}" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "{1}" directory. - MSB4036: "{0}" 작업을 찾을 수 없습니다. 다음을 수행하십시오. 1) 프로젝트 파일에 있는 작업 이름이 작업 클래스 이름과 같은지 확인합니다. 2) 작업 클래스가 "public"이고 Microsoft.Build.Framework.ITask 인터페이스를 구현하는지 확인합니다. 3) 프로젝트 파일 또는 "{1}" 디렉터리에 있는 *.tasks 파일에 <UsingTask>를 사용하여 작업이 올바르게 선언되었는지 확인합니다. - {StrBegin="MSB4036: "}LOCALIZATION: <UsingTask> and "*.tasks" should not be localized. - - MSB4036: Die "{0}" Task wurde nicht gefunden. Überprüfen Sie Folgendes: 1.) der Name der Aufgabe in der Projektdatei entspricht dem Namen der Aufgabenklasse. 2) die Aufgabenklasse ist "public" und implementiert die Microsoft.Build.Framework.ITask-Schnittstelle. 3) die Aufgabe korrekt mit < UsingTask > deklariert, in der Projektdatei oder in den Tasks-Dateien der "{1}" Verzeichnis. - - fuzzyMatch="15" wordcount="64" adjWordcount="54.4" curWordcount="54.4" - - - MSB4141: MSBuildToolsPath is not specified for the ToolsVersion "{0}" defined at "{1}", or the value specified evaluates to the empty string. - MSB4141: "{1}"에 정의된 ToolsVersion "{0}"에 대해 MSBuildToolsPath가 지정되지 않았거나 지정된 값이 빈 문자열로 계산됩니다. - {StrBegin="MSB4141: "} - - MSB4141: MSBuildToolsPath ist für die bei "{1}" definierte ToolsVersion {0} nicht angegeben, oder der angegebene Wert wird zu einer leeren Zeichenfolge ausgewertet. - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - MSB4031: The "MSBuildVersion" attribute is deprecated. If the project is authored in the MSBuild 2003 format, please remove the attribute from the <Project> tag. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format. - MSB4031: "MSBuildVersion" 특성은 사용되지 않습니다. 프로젝트를 MSBuild 2003 형식으로 작성한 경우에는 <Project> 태그에서 이 특성을 제거하고, 프로젝트를 이전 1.0 또는 1.2 형식으로 작성한 경우에는 해당 특성을 MSBuild 2003 형식으로 변환하십시오. - {StrBegin="MSB4031: "}UE: This message is shown for projects that still contain the "MSBuildVersion" attribute in their <Project> - tag. We no longer need this attribute because the project's XML namespace (i.e. the "xmlns" attribute) gives us all the - version information we need. - LOCALIZATION: "MSBuild", "MSBuildVersion" and <Project> should not be localized. - - MSB4031: Das Attribut "MSBuildVersion" ist veraltet. Wenn das Projekt im Format MSBuild 2003 erstellt wurde, entfernen Sie das Attribut aus dem Tag < Project >. Wenn das Projekt im alten Format 1.0 oder 1.2 erstellt wurde, konvertieren Sie es in das MSBuild 2003-Format. - - fuzzyMatch="15" wordcount="45" adjWordcount="38.25" curWordcount="38.25" - - - MSB4144: Multiple definitions were found for the toolset "{0}". - MSB4144: "{0}" 도구 집합에 대한 정의가 여러 개 있습니다. - {StrBegin="MSB4144: "} - - MSB4144: Für das Toolset wurden mehrere Definitionen gefunden "{0}". - - fuzzyMatch="15" wordcount="9" adjWordcount="7.65" curWordcount="7.65" - - - MSB4145: Multiple definitions were found for the property "{0}". - MSB4145: "{0}" 속성에 대한 정의가 여러 개 있습니다. - {StrBegin="MSB4145: "} - - MSB4145: Für die {0}-Eigenschaft wurden mehrere Definitionen gefunden. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4082: Choose has more than one <Otherwise> element. - MSB4082: Choose에 <Otherwise> 요소가 두 개 이상 있습니다. - {StrBegin="MSB4082: "} - - MSB4082: Wählen Sie mehrere < Otherwise >-Element enthält. - - fuzzyMatch="15" wordcount="9" adjWordcount="7.65" curWordcount="7.65" - - - This method is only valid for persisted <{0}> elements. - 이 메서드는 보관된 <{0}> 요소에만 사용할 수 있습니다. - - - Diese Methode ist nur gültig für beibehalten <{0}> Elemente. - - fuzzyMatch="15" wordcount="10" adjWordcount="8.5" curWordcount="8.5" - - - This method is only valid for virtual property groups, not <{0}> elements. - 이 메서드는 <{0}> 요소가 아니라 가상 속성 그룹에만 사용할 수 있습니다. - - - Diese Methode gilt nur für virtuelle Eigenschaftengruppen nicht <{0}> Elemente. - - fuzzyMatch="15" wordcount="13" adjWordcount="11.05" curWordcount="11.05" - - - MSB4038: The element <{0}> must be last under element <{1}>. Found element <{2}> instead. - MSB4038: <{1}> 요소 아래의 마지막 항목은 <{0}> 요소여야 하는데 <{2}> 요소가 있습니다. - {StrBegin="MSB4038: "} - - MSB4038: Das Element <{0}> muss unter Element <{1}>. Element wurde gefunden <{2}> statt. - - fuzzyMatch="15" wordcount="17" adjWordcount="14.45" curWordcount="14.45" - - - MSB4138: Non-string data was specified at the registry location "{0}". - MSB4138: 레지스트리 위치 "{0}"에 문자열이 아닌 데이터가 지정되었습니다. - {StrBegin="MSB4138: "} - - MSB4138: Am Registrierungsspeicherort "{0}" wurden Daten angegeben, die keine Zeichenfolge sind. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4039: No "{0}" element was found in the project file. - MSB4039: 프로젝트 파일에 "{0}" 요소가 없습니다. - {StrBegin="MSB4039: "} - - MSB4039: Das {0}-Element wurde in der Projektdatei nicht gefunden. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4040: There is no target in the project. - MSB4040: 프로젝트에 대상이 없습니다. - {StrBegin="MSB4040: "} - - MSB4040: Das Projekt enthält kein Ziel. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Removing the "{0}" attribute of an item is not allowed. - 항목의 "{0}" 특성은 제거할 수 없습니다. - - - Das Löschen des {0}-Attributs eines Elements ist nicht zulässig. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - The object passed in is not part of the project. - 전달된 개체가 프로젝트의 일부가 아닙니다. - - - Das übergebene Objekt ist nicht Teil des Projekts. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - Overriding target "{0}" in project "{1}" with target "{2}" from project "{3}". - "{1}" 프로젝트의 "{0}" 대상을 "{3}" 프로젝트의 "{2}" 대상으로 재정의하고 있습니다. - - - Das Ziel "{0}" im Projekt "{1}" wird durch das Ziel "{2}" aus dem Projekt "{3}" außer Kraft gesetzt. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4167: The parent process unexpectedly exited. Shutting down child node "{0}". - MSB4167: 부모 프로세스가 예기치 않게 종료되었습니다. 자식 노드 "{0}"을(를) 종료합니다. - {StrBegin="MSB4167: "} - - MSB4167: Der übergeordnete Prozess wurde unerwartet beendet. Der untergeordnete Knoten "{0}" wird heruntergefahren. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - {0} ms {1} {2} calls - {0}ms {1} {2}회 호출 - - - {0} ms {1} {2} Aufrufe - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - (* = timing was not recorded because of reentrancy) - (* = 재입력으로 인해 타이밍이 기록되지 않았습니다.) - - - (* = Zeit wurde aufgrund des erneuten Eintretens nicht aufgezeichnet) - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - This project object has been unloaded from the MSBuild engine and is no longer valid. - 이 프로젝트 개체는 MSBuild 엔진에서 언로드되었으며 더 이상 유효하지 않습니다. - - - Dieses Projektobjekt wurde aus dem MSBuild-Modul entladen und ist nicht mehr gültig. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - The project file "{0}" was not found. - 프로젝트 파일 "{0}"을(를) 찾을 수 없습니다. - UE: This message is shown when the user calls into the OM to build a project that doesn't exist on disk. - - Die Projektdatei "{0}" wurde nicht gefunden. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Done building project "{0}" -- FAILED. - "{0}" 프로젝트를 빌드했습니다. - 실패 - - - Die Erstellung des Projekts "{0}" ist abgeschlossen – FEHLER. - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Done building project "{0}". - "{0}" 프로젝트를 빌드했습니다. - - - Die Erstellung des Projekts "{0}" ist abgeschlossen. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - MSB4041: The default XML namespace of the project must be the MSBuild XML namespace. If the project is authored in the MSBuild 2003 format, please add xmlns="{0}" to the <Project> element. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format. - MSB4041: 프로젝트의 기본 XML 네임스페이스는 MSBuild XML 네임스페이스여야 합니다. 프로젝트를 MSBuild 2003 형식으로 작성한 경우에는 <Project> 요소에 xmlns="{0}"을(를) 추가하고, 프로젝트를 이전 1.0 또는 1.2 형식으로 작성한 경우에는 MSBuild 2003 형식으로 변환하십시오. - {StrBegin="MSB4041: "}UE: This is a Beta 1 message only. - LOCALIZATION: <Project>, "MSBuild" and "xmlns" should not be localized. - - MSB4041: Der XML-Standardnamespace des Projekts muss MSBuild XML-Namespace. Wenn das Projekt im Format MSBuild 2003 erstellt wurde, fügen Sie Xmlns = "{0}" < Project >-Element. Wenn das Projekt im alten Format 1.0 oder 1.2 erstellt wurde, konvertieren Sie es in das MSBuild 2003-Format. - - fuzzyMatch="15" wordcount="52" adjWordcount="44.2" curWordcount="44.2" - - - Project Performance Summary: - 프로젝트 성능 요약: - - - Leistungszusammenfassung für das Projekt: - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - MSB4042: Stopping because of syntax errors in project file. - MSB4042: 프로젝트 파일에서 구문 오류가 발생했으므로 작업을 중단합니다. - {StrBegin="MSB4042: "} - - MSB4042: Prozess aufgrund von Syntaxfehlern in der Projektdatei angehalten. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - Project "{0}" is building "{1}" ({2} target(s)): - "{0}" 프로젝트에서 "{1}" 빌드 중({2} 대상): - - - Das Projekt {0} erstellt {1} ({2} Ziel(e)): - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Project "{0}" is building "{1}" (default targets): - "{0}" 프로젝트에서 "{1}" 빌드 중(기본 대상): - - - Das Projekt "{0}" erstellt "{1}" (Standardziele): - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Project "{0}" ({1} target(s)): - "{0}" 프로젝트({1} 대상): - - - Projekt "{0}", {1} Ziel(e): - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - Project "{0}" (default targets): - "{0}" 프로젝트(기본 대상): - - - Projekt "{0}" (Standardziele): - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - Done Building Project "{0}" ({1} target(s)). - "{0}" 프로젝트를 빌드했습니다({1} 대상). - - - Die Erstellung von Projekt "{0}" ist abgeschlossen ({1} Ziel(e)). - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Done Building Project "{0}" (default targets). - "{0}" 프로젝트를 빌드했습니다(기본 대상). - - - Die Erstellung von Projekt "{0}" ist abgeschlossen (Standardziele). - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Done Building Project "{0}" ({1} target(s)) -- FAILED. - "{0}" 프로젝트를 빌드했습니다({1} 대상). - 실패 - - - Die Erstellung des Projekts "{0}" ist abgeschlossen, {1} Ziel(e) -- FEHLER. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Done Building Project "{0}" (default targets) -- FAILED. - "{0}" 프로젝트를 빌드했습니다(기본 대상). - 실패 - - - Die Erstellung von Projekt "{0}" ist abgeschlossen (Standardziele) -- FEHLER. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4075: The project file must be opened in the Visual Studio IDE and converted to the latest version before it can be built by MSBuild. - MSB4075: 프로젝트 파일을 MSBuild로 빌드하려면 파일을 Visual Studio IDE에서 열어 최신 버전으로 변환해야 합니다. - {StrBegin="MSB4075: "} - - MSB4075: Die Projektdatei muss in der Visual Studio IDE geöffnet und in ein aktuelles Versionsformat gebracht werden, bevor sie mit MSBuild erstellt werden kann. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4192: The project file "{0}" is in the ".vcproj" file format, which MSBuild no longer supports. Please convert the project by opening it in the Visual Studio IDE or running the conversion tool, or use MSBuild 3.5 or earlier to build it. - MSB4192: 프로젝트 파일 "{0}"이(가) MSBuild에서 더 이상 지원하지 않는 ".vcproj" 파일 형식입니다. 프로젝트를 Visual Studio IDE에서 열거나 변환 도구를 실행하여 프로젝트를 변환하거나, MSBuild 3.5 이하 버전을 사용하여 프로젝트를 빌드하세요. - {StrBegin="MSB4192: "} LOC: ".vcproj" should not be localized - - MSB4192: Die Projektdatei "{0}" ist im VSPROJ-Dateiformat gespeichert, das nicht mehr von MSBuild unterstützt wird. Konvertieren Sie das Projekt, indem Sie es in der Visual Studio IDE öffnen oder das Konvertierungstool ausführen, oder verwenden Sie MSBuild 3.5 oder früher zum Erstellen des Projekts. - - fuzzyMatch="101" wordcount="42" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - The specified property does not belong to the current property group. - 지정한 속성은 현재 속성 그룹에 속하지 않습니다. - - - Die angegebene Eigenschaft gehört nicht zu der aktuellen Eigenschaftengruppe. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - Initial Properties: - 초기 속성: - - - Ursprüngliche Eigenschaften: - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4148: The name of a property stored under the registry key "{0}" has zero length. - MSB4148: 레지스트리 키 "{0}"에 저장된 속성 이름의 길이가 0입니다. - {StrBegin="MSB4148: "} - - MSB4148: Der Name einer unter dem Registrierungsschlüssel "{0}" gespeicherten Eigenschaft hat eine Länge von Null. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - The property names in the indexer and the "{0}" object do not match. - 인덱서와 "{0}" 개체의 속성 이름이 일치하지 않습니다. - - - Die Eigenschaftennamen im Indexer und das {0}-Objekt stimmen nicht überein. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4043: The item metadata reference "{0}" is invalid because it is qualified with an item name. Item metadata referenced in transforms do not need to be qualified, because the item name is automatically deduced from the items being transformed. Change "{0}" to "%({1})". - MSB4043: 항목 메타데이터 참조 "{0}"은(는) 항목 이름으로 한정되므로 올바르지 않습니다. 항목 이름은 변환되는 항목에서 자동으로 추론되므로 변환에서 참조하는 항목 메타데이터는 한정하지 않아도 됩니다. "{0}"을(를) "%({1})"(으)로 변경하세요. - {StrBegin="MSB4043: "}UE: This message is shown when the user does something like this: @(foo->'%(foo.metadata)'). There is no need to specify - "foo.metadata", because "foo" is automatically deduced. In corollary, "bar.metadata" is not allowed either, where "bar" is a different - item list type. - - MSB4043: Der Elementmetadatenverweis "{0}" ist ungültig, da er mit einem Elementnamen qualifiziert ist. Elementmetadaten, auf die bei Transformationen verwiesen wird, müssen nicht qualifiziert werden, da der Elementname automatisch aus den transformierten Elementen abgeleitet wird. Ändern Sie "{0}" in "%({1})". - - fuzzyMatch="101" wordcount="43" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4135: Error reading the toolset information from the registry location "{0}". {1} - MSB4135: 레지스트리 위치 "{0}"에서 도구 집합 정보를 읽는 동안 오류가 발생했습니다. {1} - {StrBegin="MSB4135: "} - - MSB4135: Fehler beim Lesen der Toolsetinformationen am Registrierungsspeicherort "{0}". {1} - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4044: The "{0}" task was not given a value for the required parameter "{1}". - MSB4044: "{0}" 작업의 필수 매개 변수 "{1}"에 값을 지정하지 않았습니다. - {StrBegin="MSB4044: "}UE: This message is shown when a task parameter designated as "required" is not set in the project file. - - MSB4044: Die {0}-Aufgabe hat keinen Wert für den erforderlichen {1}-Parameter erhalten. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - Validating project using schema file "{0}". - "{0}" 스키마 파일을 사용하여 프로젝트의 유효성을 검사하고 있습니다. - LOCALIZATION: "{0}" is the location of the schema file. - - Das Projekt wird anhand der Schemadatei "{0}" überprüft. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4045: Project is not valid. {0} - MSB4045: 프로젝트가 잘못되었습니다. {0} - {StrBegin="MSB4045: "}UE: This error is shown when the user asks his project to be validated against a schema (/val switch for - MSBuild.exe), and the project has errors. "{0}" contains a message explaining the problem. - LOCALIZATION: "{0}" is a message from the System.XML schema validator and is already localized. - - MSB4045: Ungültiges Projekt. {0} - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4112: The targets in this project have been disabled by the host and therefore cannot be built at this time. This may have been done for security reasons. To enable the targets, the host must set Project.BuildEnabled to "true". - MSB4112: 호스트에서 이 프로젝트의 대상을 사용할 수 없도록 설정했으므로 지금은 빌드할 수 없습니다. 보안상의 이유로 이렇게 설정한 것 같습니다. 해당 대상을 사용하도록 설정하려면 호스트에서 Project.BuildEnabled를 "true"로 설정해야 합니다. - {StrBegin="MSB4112: "} - - MSB4112: Die Ziele in diesem Projekt wurden vom Host deaktiviert und können aus diesem Grund derzeit nicht erstellt werden. Die Deaktivierung wurde wahrscheinlich aus Sicherheitsgründen durchgeführt. Wenn Sie die Ziele aktivieren möchten, muss der Host Project.BuildEnabled auf "true" festlegen. - - fuzzyMatch="101" wordcount="39" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4093: The "{0}" parameter of the "{1}" task cannot be written to because it does not have a "set" accessor. - MSB4093: "set" 접근자가 없으므로 "{1}" 작업의 "{0}" 매개 변수에 쓸 수 없습니다. - {StrBegin="MSB4093: "}UE: This error is shown when a project tries to assign a value to a task parameter that does not have a "set" - accessor on the corresponding .NET property on the task class. - - MSB4093: In den {0}-Parameter der {1}-Aufgabe kann nicht geschrieben werden, da er keinen set-Accessor besitzt. - - fuzzyMatch="100" wordcount="20" adjWordcount="5" curWordcount="5" tmLabel="N''" - - - A shallow clone of this object cannot be created. - 이 개체의 부분 복제본을 만들 수 없습니다. - - - Ein unechter Klon dieses Objekts kann nicht erstellt werden. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - Skipping target "{0}" because it has no inputs. - 입력이 없으므로 "{0}" 대상을 건너뜁니다. - - - Das {0}-Ziel wird übersprungen, da es keine Eingaben besitzt. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Though the target has declared its inputs, the input specification only references empty properties and/or empty item lists. - 대상에서 입력을 선언했지만 입력 사양이 빈 속성 및/또는 빈 항목 목록만 참조합니다. - - - Obwohl das Ziel seine Eingaben deklariert hat, verweist die Eingabespezifikation nur auf leere Eigenschaften und/oder leere Elementlisten. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - Skipping target "{0}" because it has no outputs. - 출력이 없으므로 "{0}" 대상을 건너뜁니다. - - - Das Ziel "{0}" wird übersprungen, da es keine Ausgaben enthält. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Though the target has declared its outputs, the output specification only references empty properties and/or empty item lists. - 대상에서 출력을 선언했지만 출력 사양이 빈 속성 및/또는 빈 항목 목록만 참조합니다. - - - Obwohl das Ziel seine Ausgaben deklariert hat, verweist die Ausgabespezifikation nur auf leere Eigenschaften und/oder leere Elementlisten. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - Skipping target "{0}" because all output files are up-to-date with respect to the input files. - 해당 입력 파일과 비교하여 출력 파일이 모두 최신 파일이므로 "{0}" 대상을 건너뜁니다. - - - Das Ziel "{0}" wird übersprungen, da alle Ausgabedateien hinsichtlich der Eingabedateien aktuell sind. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - Input files: {0} - 입력 파일: {0} - {0} is a semicolon-separated list of filenames. - - Eingabedateien: {0} - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Output files: {0} - 출력 파일: {0} - {0} is a semicolon-separated list of filenames. - - Ausgabedateien: {0} - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Building solution configuration "{0}". - 솔루션 구성 "{0}"을(를) 빌드하고 있습니다. - UE: This is not an error, so doesn't need an error code. - - Die Projektmappenkonfiguration "{0}" wird erstellt. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - Using solution cache file "{0}" for configuration "{1}" and tools version "{2}". - 구성 "{1}" 및 도구 버전 "{2}"의 솔루션 캐시 파일 "{0}"을(를) 사용하고 있습니다. - UE: This is not an error, so doesn't need an error code. - - Die Projektmappen-Cachedatei "{0}" wird für die Konfiguration "{1}" und die Toolsversion "{2}" verwendet. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Failed to read solution cache file "{0}". {1} Using solution file directly. - 솔루션 캐시 파일 "{0}"을(를) 읽지 못했습니다. {1} 솔루션 파일을 직접 사용하고 있습니다. - UE: This is not a true error, so doesn't need an error code. - - Fehler beim Lesen der Projektmappen-Cachedatei "{0}". {1} Projektmappendatei wird direkt verwendet. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Failed to write solution cache file "{0}". {1} - 솔루션 캐시 파일 "{0}"을(를) 쓰지 못했습니다. {1} - UE: This is not a true error, so doesn't need an error code. - - Fehler beim Schreiben der Projektmappen-Cachedatei "{0}". {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Solution cache file was created for a "{0}" value of "{1}" but the current value is "{2}". Refreshing cache file. - "{1}"의 "{0}" 값에 대해 솔루션 캐시 파일이 만들어졌지만 현재 값은 "{2}"입니다. 캐시 파일을 새로 고칩니다. - UE: This is not an error, so doesn't need an error code. - - Die Projektmappen-Cachedatei wurde für den {0}-Wert "{1}" erstellt, aber der aktuelle Wert ist "{2}". Cachedatei wird aktualisiert. - - fuzzyMatch="100" wordcount="20" adjWordcount="5" curWordcount="5" tmLabel="N''" - - - Solution cache file has an internal version number "{0}" but the current value is "{1}". Refreshing cache file. - 솔루션 캐시 파일의 내부 버전 번호는 "{0}"인데 현재 값은 "{1}"입니다. 캐시 파일을 새로 고칩니다. - UE: This is not an error, so doesn't need an error code. - - Die Projektmappen-Cachedatei hat die interne Versionsnummer "{0}", der aktuelle Wert ist aber "{1}". Cachedatei wird aktualisiert. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - Solution cache file is out of date. Refreshing cache file. {0} - 솔루션 캐시 파일이 만료되었습니다. 캐시 파일을 새로 고칩니다. {0} - UE: This is not an error, so doesn't need an error code. - - Die Projektmappen-Cachedatei ist veraltet. Cachedatei wird aktualisiert. {0} - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4160: A circular dependency involving project "{0}" has been detected. - MSB4160: "{0}" 프로젝트와 관련하여 순환 종속성이 발견되었습니다. - {StrBegin="MSB4160: "} - - MSB4160: Eine Ringabhängigkeit im Zusammenhang mit dem Projekt "{0}" wurde erkannt. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4126: The specified solution configuration "{0}" is invalid. Please specify a valid solution configuration using the Configuration and Platform properties (e.g. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU") or leave those properties blank to use the default solution configuration. - MSB4126: 지정된 솔루션 구성 "{0}"이(가) 잘못되었습니다. Configuration 및 Platform 속성을 사용하여 올바른 솔루션 구성을 지정(예: MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU")하거나 기본 솔루션 구성을 사용하도록 이 속성을 빈 상태로 두세요. - {StrBegin="MSB4126: "}UE: The solution filename is provided separately to loggers. - - MSB4126: Die angegebene Projektmappenkonfiguration "{0}" ist ungültig. Geben Sie mithilfe der Konfigurations- und Plattformeigenschaften eine gültige Projektmappenkonfiguration an (z. B. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU"), oder lassen Sie diese Eigenschaften leer, sodass die Standardprojektmappenkonfiguration verwendet wird. - - fuzzyMatch="101" wordcount="37" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4046: Error reading project file "{0}": {1} - MSB4046: 프로젝트 파일 "{0}"을(를) 읽는 동안 오류가 발생했습니다. {1} - {StrBegin="MSB4046: "} - - MSB4046: Fehler beim Lesen der Projektdatei "{0}": {1} - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4125: The project file name "{0}" is invalid. {1} - MSB4125: 프로젝트 파일 이름 "{0}"이(가) 잘못되었습니다. {1} - {StrBegin="MSB4125: "}UE: The solution filename is provided separately to loggers. - - MSB4125: Der Projektdateiname "{0}" ist ungültig. {1} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4051: Project {0} is referencing a project with GUID {1}, but a project with this GUID was not found in the .SLN file. - MSB4051: {0} 프로젝트에서 GUID가 {1}인 프로젝트를 참조하지만 .SLN 파일에서 이 GUID를 사용하는 프로젝트를 찾을 수 없습니다. - {StrBegin="MSB4051: "}UE: The solution filename is provided separately to loggers. - - MSB4051: Das Projekt "{0}" verweist auf ein Projekt mit der GUID {1}, in der SLN-Datei wurde jedoch kein Projekt mit dieser GUID gefunden. - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - MSB4078: The project file "{0}" is not supported by MSBuild and cannot be built. - MSB4078: 프로젝트 파일 "{0}"을(를) MSBuild에서 지원하지 않으므로 빌드할 수 없습니다. - {StrBegin="MSB4078: "} - - MSB4078: Die Projektdatei "{0}" wird nicht von MSBuild unterstützt und kann nicht erstellt werden. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4054: The solution file must be opened in the Visual Studio IDE and converted to the latest version before it can be built by MSBuild. - MSB4054: 솔루션 파일을 MSBuild로 빌드하려면 파일을 Visual Studio IDE에서 열어 최신 버전으로 변환해야 합니다. - {StrBegin="MSB4054: "}UE: The solution filename is provided separately to loggers. - - MSB4054: Die Projektmappendatei muss in der Visual Studio IDE geöffnet und in die neuste Version konvertiert werden, bevor sie mit MSBuild erstellt werden kann. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4121: The project configuration for project "{0}" was not specified in the solution file for the solution configuration "{1}". - MSB4121: 솔루션 구성 "{1}"에 대한 솔루션 파일에 "{0}" 프로젝트에 대한 프로젝트 구성이 지정되어 있지 않습니다. - {StrBegin="MSB4121: "} - - MSB4121: Die Projektkonfiguration für das Projekt "{0}" wurde nicht in der Projektmappendatei für die Projektmappenkonfiguration "{1}" angegeben. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - The project "{0}" is not selected for building in solution configuration "{1}". - "{0}" 프로젝트가 솔루션 구성 "{1}"에서 빌드되도록 선택되지 않았습니다. - - UE: This is not an error, so doesn't need an error code. - - - Das Projekt "{0}" ist in der Projektmappenkonfiguration "{1}" nicht zum Erstellen ausgewählt. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4122: Scanning project dependencies for project "{0}" failed. {1} - MSB4122: "{0}" 프로젝트에 대한 프로젝트 종속성을 검색하지 못했습니다. {1} - {StrBegin="MSB4122: "} - - MSB4122: Fehler beim Überprüfen der Projektabhängigkeiten für Projekt "{0}". {1} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4149: The tools version "{0}" of the solution does not support building projects with a different tools version. - MSB4149: 솔루션의 도구 버전 "{0}"은(는) 다른 도구 버전을 사용한 프로젝트 빌드를 지원하지 않습니다. - {StrBegin="MSB4149: "} - - MSB4149: Die Toolsversion {0} der Projektmappe unterstützt das Erstellen von Projekten mit unterschiedlichen Toolsversionen nicht. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - Web projects do not support the "Clean" target. Continuing with remaining projects ... - 웹 프로젝트에서는 "Clean" 대상을 지원하지 않습니다. 나머지 프로젝트를 진행합니다. - UE: This is not an error, so doesn't need an error code. - LOCALIZATION: Do not localize "Clean". - - Webprojekte unterstützen das Clean-Ziel nicht. Verbleibende Projekte werden fortgesetzt... - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Web projects do not support the "Publish" target. Continuing with remaining projects ... - 웹 프로젝트에서는 "Publish" 대상을 지원하지 않습니다. 나머지 프로젝트를 진행합니다. - UE: This is not an error, so doesn't need an error code. - LOCALIZATION: Do not localize "Publish". - - Webprojekte unterstützen das Publish-Ziel nicht. Verbleibende Projekte werden fortgesetzt... - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Skipping because the "$(AspNetConfiguration)" configuration is not supported for this web project. You can use the AspNetConfiguration property to override the configuration used for building web projects, by adding /p:AspNetConfiguration=<value> to the command line. Currently web projects only support Debug and Release configurations. - 이 웹 프로젝트에서는 "$(AspNetConfiguration)" 구성이 지원되지 않으므로 건너뜁니다. 명령줄에 /p:AspNetConfiguration=<value>를 추가하여 AspNetConfiguration 속성을 통해 웹 프로젝트를 빌드하는 데 사용된 구성을 재정의할 수 있습니다. 현재 웹 프로젝트는 Debug 및 Release 구성만 지원합니다. - - UE: This is not an error, so doesn't need an error code. - LOCALIZATION: Do NOT localize "AspNetConfiguration", "Debug", "Release". - - - Da der "$(AspNetConfiguration)" Konfiguration für dieses Webprojekt nicht unterstützt. Verwenden die AspNetConfiguration-Eigenschaft die Konfiguration zum Erstellen von Webprojekten hinzufügen/p: AspNetConfiguration überschreiben = < Wert > in der Befehlszeile. Aktuell unterstützen Webprojekte nur Debug- und Releasekonfigurationen. - - fuzzyMatch="15" wordcount="44" adjWordcount="37.4" curWordcount="37.4" - - - MSB4076: VC projects do not support the "Publish" target. - MSB4076: VC 프로젝트에서는 "Publish" 대상을 지원하지 않습니다. - {StrBegin="MSB4076: "}LOCALIZATION: Do not localize "Publish". - - MSB4076: VC-Projekte unterstützen nicht das Publish-Ziel. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4098: MSBuild is invoking VCBuild to build this project. Project-to-project references between VC++ projects (.VCPROJ) and C#/VB/VJ# projects (.CSPROJ, .VBPROJ, .VJSPROJ) are not supported by the command-line build systems when building stand-alone VC++ projects. Projects that contain such project-to-project references will fail to build. Please build the solution file containing this project instead. - MSB4098: 이 프로젝트를 빌드하기 위해 MSBuild에서 VCBuild를 호출하고 있습니다. 독립 실행형 VC++ 프로젝트를 빌드할 때는 명령줄 빌드 시스템에서 VC++ 프로젝트(.VCPROJ)와 C#/VB/VJ# 프로젝트(.CSPROJ, .VBPROJ, .VJSPROJ) 사이의 프로젝트 간 참조를 사용할 수 없습니다. 이러한 프로젝트 간 참조가 있는 프로젝트는 빌드되지 않습니다. 대신 이 프로젝트가 포함된 솔루션 파일을 빌드하십시오. - {StrBegin="MSB4098: "} - - MSB4098: MSBuild ruft zum Erstellen dieses Projekts VCBuild auf. Interprojektverweise zwischen VC++-Projekten (.VCPROJ) und C#-/VB-/VJ#-Projekten (.CSPROJ, .VBPROJ, .VJSPROJ) werden beim Erstellen eigenständiger VC++-Projekte von den Befehlszeilen-Buildsystemen nicht unterstützt. Projekte, die solche Interprojektverweise enthalten, werden nicht erstellt. Erstellen Sie stattdessen die Projektmappendatei, die dieses Projekt enthält. - - fuzzyMatch="101" wordcount="53" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4056: The MSBuild engine must be called on a single-threaded-apartment. Current threading model is "{0}". Proceeding, but some tasks may not function correctly. - MSB4056: MSBuild 엔진은 단일 스레드 아파트에서 호출되어야 합니다. 현재 스레딩 모델은 "{0}"입니다. 작업을 진행할 수 있지만 일부 작업이 제대로 수행되지 않을 수 있습니다. - {StrBegin="MSB4056: "} - - MSB4056: Das MSBuild-Modul muss in einem Singlethread-Apartment aufgerufen werden. Das aktuelle Threadmodell ist {0}. Der Vorgang wird fortgesetzt, aber einige Aufgaben werden möglicherweise nicht ordnungsgemäß ausgeführt. - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - Schema validation - 스키마 유효성 검사 - UE: this fragment is used to describe errors that are caused by schema validation. For example, if a normal error is - displayed like this: "MSBUILD : error MSB0000: This is an error.", then an error from schema validation would look like this: - "MSBUILD : Schema validation error MSB0000: This is an error." - LOCALIZATION: This fragment needs to be localized. - - Schemavalidierung - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Target "{0}" skipped. Previously built unsuccessfully. - "{0}" 대상을 건너뜁니다. 이전에 제대로 빌드되지 않았습니다. - - - Das Ziel "{0}" wurde übersprungen. Die vorherige Erstellung war nicht erfolgreich. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Target "{0}" skipped. Previously built successfully. - "{0}" 대상을 건너뜁니다. 이전에 빌드되었습니다. - - - Das Ziel "{0}" wurde übersprungen. Die vorherige Erstellung war erfolgreich. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4116: The condition "{1}" on the "{0}" target has a reference to item metadata. References to item metadata are not allowed in target conditions unless they are part of an item transform. - MSB4116: "{0}" 대상에 대한 "{1}" 조건에 항목 메타데이터에 대한 참조가 있습니다. 항목 메타데이터에 대한 참조는 항목 변환의 일부가 아니면 대상 조건에서 사용할 수 없습니다. - {StrBegin="MSB4116: "} - - MSB4116: Die Bedingung "{1}" des {0}-Ziels enthält einen Verweis auf Elementmetadaten. Verweise auf Elementmetadaten sind in Zielbedingungen nicht zulässig, es sei denn, sie sind Teil einer Elementtransformation. - - fuzzyMatch="101" wordcount="32" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4057: The target "{0}" does not exist in the project. - MSB4057: 프로젝트에 "{0}" 대상이 없습니다. - {StrBegin="MSB4057: "} - - MSB4057: Das Ziel "{0}" ist im Projekt nicht vorhanden. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - Done building target "{0}" in project "{1}" -- FAILED. - "{1}" 프로젝트에 "{0}" 대상을 빌드했습니다. - 실패 - - - Erstellen des {0}-Ziels in Projekt {1} beendet - Fehler beim Erstellen. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Done building target "{0}" in project "{1}". - "{1}" 프로젝트에 "{0}" 대상을 빌드했습니다. - - - Die Erstellung des Ziels "{0}" im Projekt "{1}" ist abgeschlossen. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - {0}: (TargetId:{1}) - {0}: (대상 ID:{1}) - - - {0}: (Ziel-ID:{1}) - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4058: The "{0}" target is missing its output specification. If a target declares inputs, it must also declare outputs. - MSB4058: "{0}" 대상에 출력 사양이 없습니다. 대상에서 입력을 선언한 경우 출력도 선언해야 합니다. - {StrBegin="MSB4058: "} - - MSB4058: Das {0}-Ziel enthält keine Ausgabespezifikation. Wenn ein Ziel Eingaben deklariert, muss es auch Ausgaben deklarieren. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4168: The item "{0}" of type "{1}" does not define a value for the metadata in the expression "{2}". This expression is used in the target output for target "{3}". If a target declares outputs that are transforms, all items in the transform must have a value for the metadata in the transform. - MSB4168: "{1}" 형식의 "{0}" 항목은 "{2}" 식의 메타데이터 값을 정의하지 않습니다. 이 식은 대상 "{3}"의 대상 출력에 사용됩니다. 대상에서 변환 출력을 선언한 경우 변환의 모든 항목에는 변환의 메타데이터 값이 있어야 합니다. - {StrBegin="MSB4168: "} - - MSB4168: Das Element "{0}" vom Typ "{1}" definiert keinen Wert für die Metadaten im Ausdruck "{2}". Dieser Ausdruck wird in der Zielausgabe für "{3}" verwendet. Wenn ein Ziel Ausgaben deklariert, bei denen es sich um Transformationen handelt, müssen alle Elemente in der Transformation einen Wert für die in der Transformation enthaltenen Metadaten aufweisen. - - fuzzyMatch="101" wordcount="53" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Target Performance Summary: - 대상 성능 요약: - - - Leistungszusammenfassung für das Ziel: - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Target "{0}" skipped, due to false condition; ({1}) was evaluated as ({2}). - 조건이 잘못되어 "{0}" 대상을 건너뜁니다. ({1})이(가) ({2})(으)로 확인되었습니다. - - - Das Ziel "{0}" wurde übersprungen, da die Bedingung "false" war . ({1}) wurde als ({2}) ausgewertet. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Target "{0}" in project "{1}" - "{1}" 프로젝트의 "{0}" 대상 - - - {0}-Ziel in {1}-Projekt. - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Target {0}: - {0} 대상: - - - Ziel "{0}": - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Target "{0}" in file "{1}": - "{1}" 파일의 "{0}" 대상: - - - Ziel "{0}" in Datei "{1}": - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Build continuing because "{0}" on the task "{1}" is set to "{2}". - "{1}" 작업의 "{0}"이(가) "{2}"(으)로 설정되어 있으므로 빌드가 계속됩니다. - - - Der Buildvorgang wird fortgesetzt, da {0} in der {1}-Aufgabe auf "{2}" festgelegt ist. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Target {0} from project "{1}": - "{1}" 프로젝트의 {0} 대상: - - - Ziel "{0}" aus Projekt "{1}": - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Target "{0}" in file "{1}" from project "{2}": - "{2}" 프로젝트의 "{1}" 파일에 있는 "{0}" 대상: - - - Ziel "{0}" in Datei "{1}" aus Projekt "{2}": - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4060: The "{0}" task has been declared or used incorrectly, or failed during construction. Check the spelling of the task name and the assembly name. - MSB4060: "{0}" 작업이 잘못 선언 또는 사용되었거나, 생성 중에 실패했습니다. 작업 이름 및 어셈블리 이름의 철자를 확인하세요. - {StrBegin="MSB4060: "} - - MSB4060: Die {0}-Aufgabe wurde falsch deklariert, falsch verwendet oder konnte bei der Erstellung nicht ausgeführt werden. Überprüfen Sie die Schreibweise des Aufgaben- und des Assemblynamens. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4077: The "{0}" task has been marked with the attribute LoadInSeparateAppDomain, but does not derive from MarshalByRefObject. Check that the task derives from MarshalByRefObject or AppDomainIsolatedTask. - MSB4077: "{0}" 작업이 LoadInSeparateAppDomain 특성으로 표시되었지만 MarshalByRefObject에서 파생되지 않습니다. 해당 작업이 MarshalByRefObject 또는 AppDomainIsolatedTask에서 파생되는지 확인하십시오. - {StrBegin="MSB4077: "}LOCALIZATION: <LoadInSeparateAppDomain>, <MarshalByRefObject>, <AppDomainIsolatedTask> should not be localized. - - MSB4077: Die Aufgabe "{0}" wurde mit dem LoadInSeparateAppDomain-Attribut markiert, ist jedoch nicht von MarshalByRefObject abgeleitet. Stellen Sie sicher, dass die Aufgabe von MarshalByRefObject oder AppDomainIsolatedTask abgeleitet wird. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Done executing task "{0}" -- FAILED. - "{0}" 작업을 실행했습니다. - 실패 - - - Die Ausführung von Task "{0}" wurde beendet – FEHLER. - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Done executing task "{0}". - "{0}" 작업을 실행했습니다. - - - Die Ausführung von Task "{0}" wurde beendet. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - {0} (TaskId:{1}) - {0}(작업 ID:{1}) - - - {0} (Aufgaben-ID: {1}) - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Using "{0}" task from assembly "{1}". - "{1}" 어셈블리에서 "{0}" 작업을 사용합니다. - UE: This informational message helps users determine which assemblies their tasks were loaded from. - - Die {0}-Aufgabe aus der {1}-Assembly wird verwendet. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4061: The "{0}" task could not be instantiated from the assembly "{1}". {2} - MSB4061: "{1}" 어셈블리에서 "{0}" 작업을 인스턴스화할 수 없습니다. {2} - {StrBegin="MSB4061: "}LOCALIZATION: "{2}" is a localized message from a CLR/FX exception. - - MSB4061: Die {0}-Aufgabe konnte nicht aus der {1}-Assembly instanziiert werden. {2} - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4127: The "{0}" task could not be instantiated from the assembly "{1}". Please verify the task assembly has been built using the same version of the Microsoft.Build.Framework assembly as the one installed on your computer and that your host application is not missing a binding redirect for Microsoft.Build.Framework. {2} - MSB4127: "{1}" 어셈블리에서 "{0}" 작업을 인스턴스화할 수 없습니다. 컴퓨터에 설치된 버전과 동일한 Microsoft.Build.Framework 어셈블리를 사용하여 작업 어셈블리가 빌드되었는지, 호스트 애플리케이션에 Microsoft.Build.Framework에 대한 바인딩 리디렉션이 누락되지 않았는지 확인하세요. {2} - {StrBegin="MSB4127: "}UE: This message is a specialized version of the TaskInstantiationFailureError message and can probably reuse some of its docs. - LOCALIZATION: "{2}" is a localized message from a CLR/FX exception. Also, Microsoft.Build.Framework should not be localized - - MSB4127: Die "{0}"-Aufgabe konnte nicht aus der "{1}"-Assembly instanziiert werden. Überprüfen Sie, ob die Aufgabenassembly mit der gleichen Version der Microsoft.Build.Framework-Assembly erstellt wurde, die auf Ihrem Computer installiert ist, und dass Ihrer Hostanwendung kein BindingRedirect-Eintrag für Microsoft.Build.Framework fehlt. {2} - - fuzzyMatch="101" wordcount="49" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4062: The "{0}" task could not be loaded from the assembly {1}. {2} Confirm that the <UsingTask> declaration is correct, and that the assembly and all its dependencies are available. - MSB4062: {1} 어셈블리에서 "{0}" 작업을 로드할 수 없습니다. {2} <UsingTask> 선언이 올바른지, 그리고 어셈블리와 여기에 종속되어 있는 어셈블리를 모두 사용할 수 있는지 확인하십시오. - {StrBegin="MSB4062: "}UE: This message is shown when a task cannot be loaded from its assembly for various reasons e.g. corrupt assembly, - invalid task declaration, disk error, etc. "{2}" contains a message explaining what happened. - LOCALIZATION: "{2}" is a message from the CLR loader and is already localized. Also, <UsingTask> should not be localized. - - MSB4062: Die "{0}" Vorgang konnte nicht aus der Assembly geladen werden {1}. {2} Bestätigen < UsingTask > Erklärung richtig ist und die Assembly und die zugehörigen Dateien verfügbar sind. - - fuzzyMatch="15" wordcount="31" adjWordcount="26.35" curWordcount="26.35" - - - MSB4063: The "{0}" task could not be initialized with its input parameters. {1} - MSB4063: 해당 입력 매개 변수를 사용하여 "{0}" 작업을 초기화할 수 없습니다. {1} - {StrBegin="MSB4063: "} - - MSB4063: Die "{0}"-Aufgabe konnte nicht mit ihren Eingabeparametern initialisiert werden. {1} - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - Task Performance Summary: - 작업 성능 요약: - - - Leistungszusammenfassung für die Aufgabe: - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Task "{0}" skipped, due to false condition; ({1}) was evaluated as ({2}). - 조건이 잘못되어 "{0}" 작업을 건너뜁니다. ({1})이(가) ({2})(으)로 확인되었습니다. - - - Die {0}-Aufgabe wurde übersprungen, da die Bedingung "false" war . ({1}) wurde als ({2}) ausgewertet. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Task "{0}" - "{0}" 작업 - - - Task "{0}" - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Time Elapsed {0} - 경과 시간: {0} - - - Verstrichene Zeit {0} - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Building with tools version "{0}". - 도구 버전 "{0}"(을)를 사용하여 빌드하고 있습니다. - - - Erstellung mit der Toolsversion "{0}". - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Project file contains ToolsVersion="{0}". This toolset is unknown or missing. You may be able to resolve this by installing the appropriate .NET Framework for this toolset. Treating the project as if it had ToolsVersion="4.0". - 프로젝트 파일에 ToolsVersion="{0}"이(가) 들어 있습니다. 이 도구 집합을 알 수 없거나 누락되었습니다. 이 도구 집합에 적합한 .NET Framework를 설치하면 이 문제를 해결할 수 있습니다. 프로젝트에 ToolsVersion="4.0"이 들어 있는 것으로 간주합니다. - - - Die Projektdatei enthält ToolsVersion="{0}". Dieses Toolset ist nicht bekannt oder nicht vorhanden. Sie können das Problem möglicherweise beheben, indem Sie das entsprechende .NET Framework für dieses Toolset installieren. Das Projekt wird behandelt als enthielte es ToolsVersion="4.0". - - fuzzyMatch="101" wordcount="34" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Deferred Messages - 지연된 메시지 - - - Zurückgestellte Meldungen - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Some messages did not display because they were not associated with any ProjectStarted events. Use diagnostic verbosity to view these messages. - ProjectStarted 이벤트와 연결되지 않은 일부 메시지가 표시되지 않았습니다. 이러한 메시지를 보려면 세부 정보 표시로 diagnostic을 사용하세요. - - - Einige Meldungen wurden nicht angezeigt, weil sie keinem ProjectStarted-Ereignis zugeordnet sind. Verwenden Sie den Ausführlichkeitsgrad "diagnostic", um diese Meldungen anzuzeigen. - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - MSB4090: Found an unexpected character '{2}' at position {1} in condition "{0}". - MSB4090: "{0}" 조건의 {1} 위치에 예기치 않은 '{2}' 문자가 있습니다. - {StrBegin="MSB4090: "} - - MSB4090: Das unerwartete Zeichen {2} wurde an Position {1} in der {0}-Bedingung gefunden. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4091: Found a call to an undefined function "{1}" in condition "{0}". - MSB4091: "{0}" 조건에 정의되지 않은 "{1}" 함수의 호출이 있습니다. - {StrBegin="MSB4091: "} - - MSB4091: Aufruf zu einer undefinierten Funktion "{1}" in Bedingung "{0}" gefunden. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4064: The "{0}" parameter is not supported by the "{1}" task. Verify the parameter exists on the task, and it is a settable public instance property. - MSB4064: "{1}" 작업에서 "{0}" 매개 변수를 지원하지 않습니다. 해당 매개 변수가 작업에 있는지 그리고 설정 가능한 public 인스턴스 속성인지 확인하세요. - {StrBegin="MSB4064: "} - - MSB4064: Der {0}-Parameter wird von der {1}-Aufgabe nicht unterstützt. Vergewissern Sie sich, dass der Parameter in der Aufgabe vorhanden ist und es sich um eine festlegbare öffentliche Instanzeigenschaft handelt. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4131: The "{0}" parameter is not supported by the "{1}" task. Verify the parameter exists on the task, and it is a gettable public instance property. - MSB4131: "{1}" 작업에서 "{0}" 매개 변수를 지원하지 않습니다. 해당 매개 변수가 작업에 있는지 그리고 가져올 수 있는 public 인스턴스 속성인지 확인하세요. - {StrBegin="MSB4131: "} - - MSB4131: Der {0}-Parameter wird von der {1}-Aufgabe nicht unterstützt. Vergewissern Sie sich, dass der Parameter in der Aufgabe vorhanden ist und es sich um eine abrufbare öffentliche Instanzeigenschaft handelt. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4092: An unexpected token "{1}" was found at character position {2} in condition "{0}". - MSB4092: "{0}" 조건의 문자 위치 {2}에 예기치 않은 "{1}" 토큰이 있습니다. - {StrBegin="MSB4092: "} - - MSB4092: Ein unerwartetes Token "{1}" wurde an Zeichenposition "{2}" in Bedingung "{0}" gefunden. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4065: The "{0}" parameter is not marked for output by the "{1}" task. - MSB4065: "{1}" 작업에서 "{0}" 매개 변수를 출력용으로 표시하지 않았습니다. - {StrBegin="MSB4065: "} - - MSB4065: Der {0}-Parameter ist nicht für die Ausgabe durch die {1}-Aufgabe markiert. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4066: The attribute "{0}" in element <{1}> is unrecognized. - MSB4066: <{1}> 요소의 "{0}" 특성을 인식할 수 없습니다. - {StrBegin="MSB4066: "} - - MSB4066: Das Attribut "{0}" im Element <{1}> wurde nicht erkannt. - - fuzzyMatch="15" wordcount="10" adjWordcount="8.5" curWordcount="8.5" - - - MSB4067: The element <{0}> beneath element <{1}> is unrecognized. - MSB4067: <{1}> 요소 아래의 <{0}> 요소를 인식할 수 없습니다. - {StrBegin="MSB4067: "} - - MSB4067: Das Element <{0}> unter Element <{1}> wurde nicht erkannt. - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB4068: The element <{0}> is unrecognized, or not supported in this context. - MSB4068: <{0}> 요소를 인식할 수 없거나 요소가 이 컨텍스트에서 지원되지 않습니다. - {StrBegin="MSB4068: "} - - MSB4068: Das Element <{0}> ist unbekannt oder in diesem Kontext nicht unterstützt. - - fuzzyMatch="15" wordcount="13" adjWordcount="11.05" curWordcount="11.05" - - - MSB4132: The tools version "{0}" is unrecognized. - MSB4132: 도구 버전 "{0}"을(를) 인식할 수 없습니다. - {StrBegin="MSB4132: "} - - MSB4132: Die Toolsversion "{0}" ist unbekannt. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4069: The "{0}" type of the "{1}" parameter of the "{2}" task is not supported by MSBuild. - MSB4069: MSBuild에서는 "{2}" 작업의 "{1}" 매개 변수에 "{0}" 형식을 사용할 수 없습니다. - {StrBegin="MSB4069: "}LOCALIZATION: "MSBuild" should not be localized. - - MSB4069: Der {0}-Typ des {1}-Parameters der {2}-Aufgabe wird von MSBuild nicht unterstützt. - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - MSB4072: A <{0}> element must contain either the "{1}" attribute or the "{2}" attribute (but not both). - MSB4072: <{0}> 요소는 "{1}" 특성 또는 "{2}" 특성 중 하나를 포함해야 합니다(둘 다 포함할 수 없음). - {StrBegin="MSB4072: "} - - MSB4072: Ein <{0}>-Element muss entweder die "{1}" Attribut oder "{2}" Attribut (jedoch nicht beide). - - fuzzyMatch="15" wordcount="18" adjWordcount="15.3" curWordcount="15.3" - - - {0} Warning(s) - 경고 {0}개 - - - {0} Warnung(en) - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4084: A <When> element may not follow an <Otherwise> element in a <Choose>. - MSB4084: <Choose>에서 <When> 요소는 <Otherwise> 요소 다음에 올 수 없습니다. - {StrBegin="MSB4084: "} - - MSB4084: A < >-Element kein Element < Otherwise > < auswählen > folgen. - - fuzzyMatch="15" wordcount="16" adjWordcount="13.6" curWordcount="13.6" - - - Target Name: "{0}" Project Name: "{1}" - 대상 이름: "{0}" 프로젝트 이름: "{1}" - - - Zielname: "{0}" Projektname: "{1}" - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Cycle trace: - 순환 추적: - - - Schleifenablaufverfolgung: - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4150: Must initialize the console logger using the initialize method before using ApplyParameter - MSB4150: ApplyParameter를 사용하기 전에 initialize 메서드를 사용하여 콘솔 로거를 초기화해야 합니다. - {StrBegin="MSB4150: "} - - MSB4150: Die Konsolenprotokollierung muss vor der Verwendung von ApplyParameter mithilfe der Initialisierungsmethode initialisiert werden. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4151: An error occurred while building project "{0}", target "{1}". Please see innerException for detailed information. - MSB4151: 프로젝트 "{0}", 대상 "{1}"을(를) 빌드하는 동안 오류가 발생했습니다. 자세한 정보는 innerException을 참조하십시오. - {StrBegin="MSB4151: "} - - MSB4151: Fehler beim Erstellen von Projekt "{0}", Ziel "{1}". Ausführliche Informationen finden Sie in der innerException. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB4152: An error occurred on the child node "{0}" and could not be passed to the parent node. {1} - MSB4152: 자식 노드 "{0}"에서 오류가 발생했지만 부모 노드로 전달할 수 없습니다. {1} - {StrBegin="MSB4152: "} - - MSB4152: Fehler im untergeordneten Knoten "{0}", der nicht an den übergeordneten Knoten übergeben werden konnte. {1} - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4153: A call is made on an inactive IBuildEngine interface corresponding to a task that already finished execution. - MSB4153: 이미 실행이 끝난 작업에 해당하는 비활성 IBuildEngine 인터페이스를 호출했습니다. - {StrBegin="MSB4153: "} - - MSB4153: Eine inaktive IBuildEngine-Schnittstelle wird aufgerufen, der eine Aufgabe entspricht, deren Ausführung bereits abgeschlossen wurde. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - MSB4154: A forwarding logger is attempting to forward BuildFinished event - MSB4154: 전달 로거가 BuildFinished 이벤트를 전달하려고 합니다. - {StrBegin="MSB4154: "} - - MSB4154: Eine weiterleitende Protokollierung versucht, das BuildFinished-Ereignis weiterzuleiten. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4155: There was an error while communicating with a node. - MSB4155: 노드와 통신하는 동안 오류가 발생했습니다. - {StrBegin="MSB4155: "} - - MSB4155: Fehler bei der Kommunikation mit einem Knoten. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB1021: Cannot create an instance of the logger - {0}. - MSB1021: 로거의 인스턴스를 만들 수 없습니다. {0}. - {StrBegin="MSB1021: "}The error code for this message is duplicated from MSBuild.exe. - - MSB1021: Eine Instanz der Protokollierung kann nicht erstellt werden - {0}. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB1020: The logger {0} was not found. Check the following: 1.) The logger name specified is the same as the name of the logger class. 2.) The logger class is "public" and implements the Microsoft.Build.Framework.ILogger interface. 3.) The path to the logger assembly is correct, or the logger can be loaded using only the assembly name provided. - MSB1020: {0} 로거를 찾을 수 없습니다. 다음을 수행하십시오. 1) 지정한 로거 이름이 로거 클래스 이름과 같은지 확인합니다. 2) 로거 클래스가 "public"이고 Microsoft.Build.Framework.ILogger 인터페이스를 구현하는지 확인합니다. 3) 로거 어셈블리의 경로가 올바른지 또는 지정한 어셈블리 이름만 사용하여 로거를 로드할 수 있는지 확인합니다. - {StrBegin="MSB1020: "}The error code for this message is duplicated from MSBuild.exe. - - MSB1020: Die Protokollierung {0} wurde nicht gefunden. Überprüfen Sie Folgendes: 1.) Der angegebene Name der Protokollierung ist mit dem Namen der Protokollierungsklasse identisch. 2.) Die Protokollierungsklasse ist "public" und implementiert die Microsoft.Build.Framework.ILogger-Schnittstelle. 3.) Der Pfad zur Protokollierungsassembly ist richtig, bzw. die Protokollierung kann alleine mithilfe des angegebenen Assemblynamens geladen werden. - - fuzzyMatch="101" wordcount="57" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4156: A forwarding logger is attempting to forward BuildStarted event - MSB4156: 전달 로거가 BuildStarted 이벤트를 전달하려고 합니다. - {StrBegin="MSB4156: "} - - MSB4156: Eine weiterleitende Protokollierung versucht, das BuildStarted-Ereignis weiterzuleiten. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - "{0}" ({1} target) ({2}) -> - "{0}"({1} 대상)({2}) -> - - - "{0}" ({1} target) ({2}) -> - - fuzzyMatch="15" wordcount="5" adjWordcount="4.25" curWordcount="4.25" - - - "{0}" (default target) ({1}) -> - "{0}"(기본 대상)({1})-> - - - "{0}" (Standardziel) ({1}) -> - - fuzzyMatch="15" wordcount="5" adjWordcount="4.25" curWordcount="4.25" - - - {0} {1,5} - {0} {1,5} - - - {0} {1,5} - - fuzzyMatch="15" wordcount="2" adjWordcount="1.7" curWordcount="1.7" - - - Project "{0}" on node {1} ({2} target(s)). - {1} 노드의 "{0}" 프로젝트({2} 대상)입니다. - - - Projekt "{0}" auf Knoten "{1}", {2} Ziel(e). - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Project "{0}" on node {1} (default targets). - {1} 노드의 "{0}" 프로젝트(기본 대상)입니다. - - - Projekt "{0}" auf Knoten "{1}" (Standardziele). - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Project "{0}" ({1}) is building "{2}" ({3}) on node {4} ({5} target(s)). - "{0}"({1}) 프로젝트가 {4} 노드에서 "{2}"({3})을(를) 빌드하고 있습니다({5} 대상). - - - Das Projekt "{0}" ({1}) erstellt "{2}" ({3}) auf Knoten "{4}", {5} Ziel(e). - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Project "{0}" ({1}) is building "{2}" ({3}) on node {4} (default targets). - "{0}"({1}) 프로젝트가 {4} 노드에서 "{2}"({3})을(를) 빌드하고 있습니다(기본 대상). - - - Das Projekt "{0}" ({1}) erstellt "{2}" ({3}) auf Knoten "{4}" (Standardziele). - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - ({0} target) -> - ({0} 대상) -> - - - ({0} Ziel) -> - - fuzzyMatch="15" wordcount="3" adjWordcount="2.55" curWordcount="2.55" - - - MSB4157: The array of project files needs to contain at least one value. - MSB4157: 프로젝트 파일 배열에는 값이 적어도 하나는 있어야 합니다. - {StrBegin="MSB4157: "} - - MSB4157: Das Array der Projektdateien muss mindestens einen Wert enthalten. - - fuzzyMatch="15" wordcount="13" adjWordcount="11.05" curWordcount="11.05" - - - MSB4158: The project file name at element {0} is empty. - MSB4158: {0} 요소의 프로젝트 파일 이름이 비어 있습니다. - {StrBegin="MSB4158: "} - - MSB4158: Der Projektdateiname bei Element {0} ist leer. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - The property "{0}" with value "{1}" is being overridden by another batch. The property is now: "{2}" - 값이 "{1}"인 "{0}" 속성을 다른 일괄 처리에서 재정의하고 있습니다. 속성은 이제 "{2}"입니다. - - - Die Eigenschaft "{0}" mit dem Wert "{1}" wird von einem anderen Batch überschrieben. Die Eigenschaft ist jetzt: "{2}" - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - Please see inner exception for error information. - 오류 정보는 내부 예외를 참조하십시오. - - - Fehlerinformationen finden Sie in der internen Ausnahme. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Event type "{0}" was expected to be serializable. The event was not serializable and has been ignored. - "{0}" 이벤트 형식은 serialize할 수 있어야 합니다. 이 이벤트는 serialize할 수 없으므로 무시되었습니다. - - - Es wurde erwartet, dass der Typ "{0}" serialisierbar ist. Das Ereignis war nicht serialisierbar und wurde ignoriert. - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - The log file path cannot be null or empty. - 로그 파일 경로는 null이거나 비어 있을 수 없습니다. - - - Der Protokolldateipfad darf nicht NULL oder leer sein. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4161: Project "{0}" was loaded and unloaded during the current build. Reloading a project during the build can result in errors or an inconsistent build state. Either avoid unloading project "{0}" or cache the evaluation results of target(s) "{1}" before unloading the project. - MSB4161: 현재 빌드를 실행하는 동안 "{0}" 프로젝트를 로드 및 언로드했습니다. 빌드하는 동안 프로젝트를 다시 로드하면 오류가 발생하거나 빌드 상태가 일치하지 않을 수 있습니다. "{0}" 프로젝트를 언로드하지 않거나 프로젝트를 언로드하기 전에 대상 "{1}"의 계산 결과를 캐시하십시오. - {StrBegin="MSB4161: "} - - MSB4161: Das Projekt "{0}" wurde während der aktuellen Erstellung geladen und entladen. Das erneute Laden eines Projekts während der Erstellung kann zu Fehlern oder einem nicht konsistenten Buildzustand führen. Vermeiden Sie entweder das Entladen des Projekts "{0}", oder speichern Sie die Auswertungsergebnisse der Ziele "{1}" vor dem Entladen des Projekts im Cache. - - fuzzyMatch="101" wordcount="43" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - [default] - [기본값] - - - [Standard] - - fuzzyMatch="100" wordcount="1" adjWordcount="0.25" curWordcount="0.25" tmLabel="N''" - - -
-
\ No newline at end of file diff --git a/src/Deprecated/Engine/Resources/xlf/Strings.pl.xlf b/src/Deprecated/Engine/Resources/xlf/Strings.pl.xlf deleted file mode 100644 index 70cfb09c3e4..00000000000 --- a/src/Deprecated/Engine/Resources/xlf/Strings.pl.xlf +++ /dev/null @@ -1,2674 +0,0 @@ - - - -
- - 4013 - 1176.8 - 1176.8 - 0 - 0 - - - 0 - 981 - 2334 - 0 - 0 - 698 - 0 - -
- - - MSB4001: The "{0}" task has more than one parameter called "{1}". - MSB4001: Zadanie „{0}” zawiera więcej niż jeden parametr o nazwie „{1}”. - {StrBegin="MSB4001: "}UE: This message is shown when a task has more than one .NET property with the same name -- it's unclear which of - those properties the task wants to use as a parameter in project files. - - MSB4001: Die {0}-Aufgabe enthält mehrere Parameter mit dem Namen "{1}". - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4081: The value "{0}" of the "ItemName" attribute in element <Output> contains an "@" character. If you intended to use an item name then remove the @( ) around the item name. - MSB4081: Wartość „{0}” atrybutu „ItemName” w elemencie <Output> zawiera znak „@”. Jeżeli zamierzasz użyć nazwy elementu, usuń znaki @( ) znajdujące się po obu stronach tej nazwy. - {StrBegin="MSB4081: "}UE: This message is shown when an output tag has an itemname that contains an @. They probably typed @(foo) instead of foo in the ItemName.LOCALIZATION: Output and ItemName should not be localized. - - MSB4081: Der Wert "{0}" "ItemName-Attribut im Element < Output > enthält ein" @"Zeichen. Soll ein Elementname verwenden und entfernen dann die @ (), um den Namen des Elements. - - fuzzyMatch="15" wordcount="30" adjWordcount="25.5" curWordcount="25.5" - - - MSB4002: There was a failure retrieving the attributes for parameters in the "{0}" task. {1} - MSB4002: Wystąpił błąd podczas pobierania atrybutów dla parametrów w zadaniu „{0}”. {1} - {StrBegin="MSB4002: "}UE: This message is shown when the .NET attributes that a task's .NET properties are decorated with, cannot be - retrieved -- this is typically because the .NET classes that define the .NET attributes cannot be loaded because the assembly - they are defined in cannot be found, or the classes themselves cannot be found. - - MSB4002: Fehler beim Abrufen der Attribute für Parameter in der {0}-Aufgabe. {1} - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - MSB4003: "{0}" is a reserved attribute of the <{1}> element, and must be spelled with the correct casing. This attribute cannot be used as a parameter to the "{2}" task. - MSB4003: „{0}” jest zastrzeżonym atrybutem elementu <{1}> i podczas jego wpisywania należy używać poprawnej wielkości liter. Tego atrybutu nie można używać jako parametru dla zadania „{2}”. - {StrBegin="MSB4003: "}UE: Tasks are not allowed to use incorrect case for reserved attributes on the task nodes e.g. "continueonerror" - instead of the "ContinueOnError". - - MSB4003: "{0}" ist ein reserviertes Attribut der <{1}>-Element und mit der richtigen Groß-/Kleinschreibung geschrieben werden muss. Dieses Attribut kann nicht verwendet werden, als Parameter an die "{2}" Aufgabe. - - fuzzyMatch="15" wordcount="31" adjWordcount="26.35" curWordcount="26.35" - - - The "REQUESTBATCHSIZE" must be a number greater than 1. "{0}" is an invalid value. The value 10 will be used instead. - Wartość „REQUESTBATCHSIZE” musi być liczbą większą od 1. „{0}” to nieprawidłowa wartość. Zamiast niej zostanie użyta wartość równa 10. - The name "REQUESTBATCHSIZE" is an environment variable - - Die "REQUESTBATCHSIZE" muss eine Zahl größer als 1 sein. "{0}" ist ein ungültiger Wert. Der Wert 10 wird stattdessen verwendet. - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - Build completed in {0}. - Czas wykonania kompilacji: {0}. - - - Das Erstellen wurde in {0} beendet. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - Build FAILED. - Kompilacja NIE POWIODŁA SIĘ. - - - Fehler beim Buildvorgang. - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Build succeeded. - Kompilacja powiodła się. - - - Buildvorgang erfolgreich. - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Build started. - Kompilacja rozpoczęła się. - - - Der Buildvorgang wurde gestartet. - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Build started {0}. - Kompilacja rozpoczęła się {0}. - - - Der Buildvorgang wurde am {0} gestartet. - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Building target "{0}" completely. - Ukończono kompilowanie elementu docelowego „{0}”. - {0} is the name of the target. - - Das Ziel "{0}" wird vollständig erstellt. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - No input files were specified. - Nie określono plików wejściowych. - - - Es wurden keine Eingabedateien angegeben. - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Input file "{0}" is newer than output file "{1}". - Plik wejściowy „{0}” jest nowszy niż plik wyjściowy „{1}”. - {0} and {1} are filenames on disk. - - Die Eingabedatei "{0}" ist neuer als die Ausgabedatei "{1}". - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - Output file "{0}" does not exist. - Plik wyjściowy „{0}” nie istnieje. - {0} is a filename on disk. - - Die Ausgabedatei "{0}" ist nicht vorhanden. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Input file "{0}" does not exist. - Plik wejściowy „{0}” nie istnieje. - {0} is a filename on disk. - - Die Eingabedatei "{0}" ist nicht vorhanden. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Building target "{0}" partially, because some output files are out of date with respect to their input files. - Trwa częściowe kompilowanie elementu docelowego „{0}”, ponieważ niektóre pliki wyjściowe są nieaktualne w porównaniu z plikami wejściowymi. - {0} is the name of the target. - - Das Ziel "{0}" wird teilweise erstellt, da einige Ausgabedateien hinsichtlich ihrer Eingabedateien veraltet sind. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - [{0}: Input={1}, Output={2}] Input file is newer than output file. - [{0}: Wejście={1}, Wyjście={2}] Plik wejściowy jest nowszy niż plik wyjściowy. - {0} is the name of an MSBuild item. {1} and {2} are filenames on disk. - - [{0}: Eingabe={1}, Ausgabe={2}] Die Eingabedatei ist neuer als die Ausgabedatei. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - [{0}: Input={1}, Output={2}] Output file does not exist. - [{0}: Wejście={1}, Wyjście={2}] Plik wyjściowy nie istnieje. - {0} is the name of an MSBuild item. {1} and {2} are filenames on disk. - - [{0}: Eingabe={1}, Ausgabe={2}] Die Ausgabedatei ist nicht vorhanden. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - [{0}: Input={1}, Output={2}] Input file does not exist. - [{0}: Wejście={1}, Wyjście={2}] Plik wejściowy nie istnieje. - {0} is the name of an MSBuild item. {1} and {2} are filenames on disk. - - [{0}: Eingabe={1}, Ausgabe={2}] Die Eingabedatei ist nicht vorhanden. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - The attribute "{0}" is a known MSBuild attribute, and cannot be accessed using this method. - Atrybut „{0}” jest znanym atrybutem programu MSBuild i nie można uzyskać do niego dostępu przy użyciu tej metody. - - - Das {0}-Attribut ist ein bekanntes MSBuild-Attribut, auf das mithilfe dieser Methode nicht zugegriffen werden kann. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - Properties in persisted property groups cannot be accessed by name. - Do właściwości znajdujących się w grupach właściwości trwałych nie można uzyskać dostępu przy użyciu ich nazw. - - - Auf Eigenschaften in persistenten Eigenschaftengruppen ist kein Zugriff über den Namen möglich. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4023: Cannot evaluate the item metadata "%({0})". {1} - MSB4023: Nie można ocenić metadanych elementu „%({0})”. {1} - {StrBegin="MSB4023: "}UE: This message is shown when the value of an item metadata cannot be computed for some reason e.g. trying to apply - %(RootDir) to an item-spec that's not a valid path, would result in this error. - LOCALIZATION: "{1}" is a localized message explaining the problem. - - MSB4023: Elementmetadaten "%({0})" können nicht ausgewertet werden. {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Cannot execute a task not associated with a project object. - Nie można wykonać zadania nieskojarzonego z obiektem projektu. - - - Eine Aufgabe, die keinem Projektobjekt zugeordnet ist, kann nicht ausgeführt werden. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - The cache entry has already been set to a different value and cannot be modified. - Wpis pamięci podręcznej został już ustawiony na inną wartość i nie można go zmodyfikować. - - - Der Cacheeintrag wurde bereits auf einen anderen Wert festgelegt und kann nicht geändert werden. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - The "{0}" property comes from an environment variable, and cannot be modified. - Właściwość „{0}” pochodzi ze zmiennej środowiskowej i nie można jej modyfikować. - - - Die {0}-Eigenschaft stammt aus einer Umgebungsvariablen und kann nicht geändert werden. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - The "{0}" property is a global property, and cannot be modified through an evaluated property group. Use "{1}" instead. - Wartość „{0}” jest wartością globalną i nie można jej modyfikować za pomocą grupy właściwości szacowanych. Zamiast niej użyj „{1}”. - - - Die {0}-Eigenschaft ist eine globale Eigenschaft und kann nicht über eine ausgewertete Eigenschaftengruppe geändert werden. Verwenden Sie stattdessen {1}. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - Modifying the XML of an imported project file is not allowed. Open that project file directly. - Modyfikowanie kodu XML zaimportowanego pliku projektu jest niedozwolone. Należy otworzyć plik projektu bezpośrednio. - - - Der XML-Code einer importierten Projektdatei darf nicht geändert werden. Öffnen Sie diese Projektdatei direkt. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB4117: The "{0}" item name is reserved, and cannot be used. - MSB4117: Nazwa elementu „{0}” jest zastrzeżona i nie można jej używać. - {StrBegin="MSB4117: "}UE: This message is shown when the user tries to redefine one of the reserved MSBuild items e.g. @(Choose) - - MSB4117: Der Elementname "{0}" ist reserviert und kann nicht verwendet werden. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4118: The "{0}" item metadata name is reserved, and cannot be used. - MSB4118: Nazwa metadanych elementu „{0}” jest zastrzeżona i nie można jej używać. - {StrBegin="MSB4118: "}UE: This message is shown when the user tries to redefine one of the reserved MSBuild items e.g. @(Choose) - - MSB4118: Der Elementmetadatenname "{0}" ist reserviert und kann nicht verwendet werden. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4004: The "{0}" property is reserved, and cannot be modified. - MSB4004: Właściwość „{0}” jest zastrzeżona i nie można jej modyfikować. - {StrBegin="MSB4004: "}UE: This message is shown when the user tries to redefine one of the reserved MSBuild properties e.g. $(MSBuildProjectFile) - - MSB4004: Die {0}-Eigenschaft ist reserviert und kann nicht geändert werden. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4094: "{0}" is an invalid value for the "{1}" parameter of the "{3}" task. Multiple items cannot be passed into a parameter of type "{2}". - MSB4094: „{0}” jest nieprawidłową wartością parametru „{1}” zadania „{3}”. Nie można przekazać wielu elementów do parametru typu „{2}”. - {StrBegin="MSB4094: "} - UE: This error is shown when a project tries to pass multiple items into a task parameter of type ITaskItem (singular). - - - MSB4094: "{0}" ist ein ungültiger Wert für den "{1}"-Parameter der "{3}"-Aufgabe. Mehrere Elemente können nicht in einen Parameter vom Typ "{2}" übergeben werden. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4115: The "{0}" function only accepts a scalar value, but its argument "{1}" evaluates to "{2}" which is not a scalar value. - MSB4115: Funkcja „{0}” akceptuje tylko wartość skalarną, ale jej argument „{1}” jest obliczany do wartości „{2}” — nie jest to wartość skalarna. - {StrBegin="MSB4115: "} - UE: This error is shown when a project tries to pass multiple items into a function in a conditional expression, that can only accept a scalar value (such as the "exists()" function). - - - MSB4115: Die "{0}"-Funktion nimmt nur einen Skalarwert an, ihr "{1}"-Argument wird jedoch zu "{2}" ausgewertet, bei dem es sich nicht um einen Skalarwert handelt. - - fuzzyMatch="100" wordcount="22" adjWordcount="5.5" curWordcount="5.5" tmLabel="N''" - - - The task is currently associated with a project object, and should not be added to a different one. - Zadanie jest obecnie skojarzone z obiektem projektu i nie należy go dodawać do innego obiektu. - - - Die Aufgabe ist derzeit einem Projektobjekt zugeordnet und sollte zu keinem anderen Projektobjekt hinzugefügt werden. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - MSB4095: The item metadata %({0}) is being referenced without an item name. Specify the item name by using %(itemname.{0}). - MSB4095: Metadane elementu %({0}) występują w odwołaniu bez nazwy elementu. Określ nazwę elementu, używając parametru %(itemname.{0}). - {StrBegin="MSB4095: "} - - MSB4095: Auf die %({0})-Elementmetadaten wird ohne einen Elementnamen verwiesen. Geben Sie den Namen mithilfe von %(itemname.{0}) an. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - The task is not associated with the specified target element collection, and should not be removed from it. - Zadanie nie jest skojarzone z określoną kolekcją elementów docelowych i nie należy go z niej usuwać. - - - Die Aufgabe ist nicht der angegebenen Auflistung von Zielelementen zugeordnet und sollte nicht daraus entfernt werden. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - MSB4005: The current working directory could not be restored to {0}. {1} - MSB4005: Bieżącego katalogu roboczego nie można przywrócić do {0}. {1} - {StrBegin="MSB4005: "}UE: This message is shown when the current working directory cannot be reset after a build. "{1}" contains a message explaining why. - LOCALIZATION: "{1}" is a message from an CLR/FX exception and is already localized. - - MSB4005: Das aktuelle Arbeitsverzeichnis konnte unter {0} nicht wiederhergestellt werden. {1} - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Cannot set a condition on an object not represented by an XML element in the project file. - Nie można ustawić warunku w obiekcie, który nie jest reprezentowany przez element XML w pliku projektu. - - - Eine Bedingung kann nicht für ein Objekt festgelegt werden, wenn das Objekt nicht von einem XML-Element in der Projektdatei repräsentiert wird. - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - Cannot set ContinueOnError on an object not represented by an XML element in the project file. - Nie można ustawić elementu ContinueOnError w obiekcie, który nie jest reprezentowany przez element XML w pliku projektu. - - - Das ContinueOnError-Attribut kann nicht für ein Objekt festgelegt werden, wenn das Objekt nicht von einem XML-Element in der Projektdatei repräsentiert wird. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB4134: DefaultToolsVersion cannot be set after a project has been loaded into the Engine. - MSB4134: Nie można ustawić wartości DefaultToolsVersion po załadowaniu projektu do aparatu. - {StrBegin="MSB4134: "} - - MSB4134: DefaultToolsVersion darf nicht festgelegt werden, nachdem ein Projekt in das Modul geladen wurde. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - Assigning the "{0}" attribute on an item that has been evaluated is not allowed. This operation is only allowed on the original persisted item that came directly from the project file. - Przypisanie atrybutu „{0}” do elementu, który został oszacowany, jest niedozwolone. Ta operacja jest dozwolona tylko w oryginalnym elemencie trwałym, który pochodzi bezpośrednio z pliku projektu. - - - Das {0}-Attribut darf nicht einem Element zugewiesen werden, das ausgewertet wurde. Dieser Vorgang ist nur für das ursprüngliche persistente Element zulässig, das direkt aus der Projektdatei stammt. - - fuzzyMatch="101" wordcount="31" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Assigning the "{0}" attribute of a virtual item is not allowed. - Przypisanie atrybutu „{0}” elementu wirtualnego jest niedozwolone. - - - Das Zuweisen des {0}-Attributs eines virtuellen Elements ist nicht zulässig. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - A property cannot be set while building. - Podczas kompilowania nie można ustawić właściwości. - - - Eine Eigenschaft kann nicht während des Erstellens festgelegt werden. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - A property cannot be set to null. - Właściwości nie można ustawić na zero. - - - Eine Eigenschaft kann nicht auf NULL festgelegt werden. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Cannot get or set parameters on a task not associated with a project object. - Nie można pobrać ani ustawić parametrów w zadaniu, które nie jest skojarzone z obiektem projektu. - - - Parameter für eine Aufgabe können nicht abgefragt oder festgelegt werden, wenn die Aufgabe keinem Projektobjekt zugeordnet ist. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4162: <{0}> is not valid. Child elements are not allowed below a item remove element. - MSB4162: Element <{0}> jest nieprawidłowy. Elementy podrzędne są niedozwolone pod elementem usuwania. - {StrBegin="MSB4162: "} - - MSB4162: <{0}> ist ungültig. Untergeordnete Elemente dürfen nicht unter einem Element Element entfernen. - - fuzzyMatch="15" wordcount="16" adjWordcount="13.6" curWordcount="13.6" - - - MSB4166: Child node "{0}" exited prematurely. Shutting down. - MSB4166: Działanie węzła podrzędnego „{0}” zostało przedwcześnie zakończone. Zamykanie. - {StrBegin="MSB4166: "} - - MSB4166: Der untergeordnete Knoten "{0}" wurde vorzeitig beendet. Herunterfahren. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4085: A <Choose> must contain at least one <When>. - MSB4085: Element <Choose> musi zawierać co najmniej jeden element <When>. - {StrBegin="MSB4085: "} - - MSB4085: < auswählen > muss mindestens < Wenn >. - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB4114: <Choose> elements cannot be nested more than {0} levels deep. - MSB4114: Elementy <Choose> nie mogą być zagnieżdżone na poziomie głębszym niż {0}. - {StrBegin="MSB4114: "}UE: This message appears if the project file contains unreasonably nested Choose elements. - LOCALIZATION: Do not localize "Choose" as it is an XML element name. - - MSB4114: < auswählen > Elemente können nicht geschachtelt werden mehr als {0} Ebenen. - - fuzzyMatch="15" wordcount="12" adjWordcount="10.2" curWordcount="10.2" - - - MSB4006: There is a circular dependency in the target dependency graph involving target "{0}". - MSB4006: Istnieje zależność cykliczna na wykresie zależności elementu docelowego, obejmująca element docelowy „{0}”. - {StrBegin="MSB4006: "}UE: This message is shown when the build engine detects a target referenced in a circular manner -- a project cannot - request a target to build itself (perhaps via a chain of other targets). - - MSB4006: Im Zielabhängigkeitsdiagramm besteht eine Ringabhängigkeit im Zusammenhang mit dem Ziel "{0}". - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4086: A numeric comparison was attempted on "{1}" that evaluates to "{2}" instead of a number, in condition "{0}". - MSB4086: Podjęto próbę numerycznego porównania w elemencie „{1}”, który został oszacowany jako „{2}”, a nie jako liczba w warunku „{0}”. - {StrBegin="MSB4086: "} - - MSB4086: Es wurde versucht, einen numerischen Vergleich für "{1}" auszuführen, der zu "{2}" anstatt zu einer Zahl in Bedingung "{0}" ausgewertet wird. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4007: The clause "{0}", specified in the "{1}" attribute is invalid. - MSB4007: Klauzula „{0}” określona w atrybucie „{1}” jest nieprawidłowa. - {StrBegin="MSB4007: "}UE: This message is shown when the Condition on an element is invalid in some way -- e.g. syntax error, unrecognized operator. - - MSB4007: Die im {1}-Attribut festgelegte {0}-Klausel ist ungültig. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4130: The condition "{0}" may have been evaluated incorrectly in an earlier version of MSBuild. Please verify that the order of the AND and OR clauses is written as intended. To avoid this warning, add parentheses to make the evaluation order explicit. - MSB4130: Warunek „{0}” mógł zostać oszacowany niepoprawnie we wcześniejszej wersji programu MSBuild. Sprawdź, czy klauzule AND i OR są zapisane w zamierzonej kolejności. Aby uniknąć tego ostrzeżenia, dodaj nawiasy w celu jawnego określenia kolejności szacowania. - {StrBegin="MSB4130: "} - - MSB4130: Die Bedingung "{0}" ist in einer früheren Version von MSBuild möglicherweise fehlerhaft ausgewertet worden. Stellen Sie sicher, dass die AND- und OR-Klauseln in der beabsichtigten Reihenfolge stehen. Damit diese Warnung nicht angezeigt wird, fügen Sie Klammern hinzu, um die Auswertungsreihenfolge explizit anzugeben. - - fuzzyMatch="101" wordcount="42" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4087: Specified condition "{0}" does not evaluate to a boolean. - MSB4087: Określony warunek „{0}” nie jest szacowany jako wartość logiczna. - {StrBegin="MSB4087: "} - - MSB4087: Die angegebene {0}-Bedingung wird nicht zu einem booleschen Wert ausgewertet. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4113: Specified condition "{0}" evaluates to "{1}" instead of a boolean. - MSB4113: Określony warunek „{0}” jest szacowany jako „{1}”, a nie jako wartość logiczna. - {StrBegin="MSB4113: "} - - MSB4113: Die angegebene Bedingung {0} wird zu {1} statt zu einem booleschen Wert ausgewertet. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - {0}, line {1} - {0}, wiersz {1} - - - {0}, Zeile {1} - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - MSB4136: Error reading the toolset information from the configuration file "{0}". {1} - MSB4136: Błąd podczas odczytu informacji o zestawie narzędzi z pliku konfiguracji „{0}”. {1} - {StrBegin="MSB4136: "} - - MSB4136: Fehler beim Lesen der Toolsetinformationen aus der Konfigurationsdatei "{0}". {1} - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4008: A conflicting assembly for the task assembly "{0}" has been found at "{1}". - MSB4008: Zestaw, który wywołuje konflikt z zestawem zadania „{0}”, został znaleziony w „{1}”. - {StrBegin="MSB4008: "}UE: This message is shown when the type/class of a task cannot be resolved uniquely from a single assembly. - - MSB4008: Eine mit der Aufgabenassembly "{0}" in Konflikt stehende Assembly wurde in "{1}" gefunden. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4142: MSBuildToolsPath is not the same as MSBuildBinPath for the ToolsVersion "{0}" defined at "{1}". If both are present they must have the same value. - MSB4142: Parametr MSBuildToolsPath różni się od parametru MSBuildBinPath dla wartości ToolsVersion „{0}” zdefiniowanej w „{1}”. Jeśli oba parametry są obecne, muszą mieć taką samą wartość. - {StrBegin="MSB4142: "} - - MSB4142: MSBuildToolsPath ist nicht identisch mit MSBuildBinPath für die bei "{1}" definierte ToolsVersion {0}. Wenn beide Pfade vorhanden sind, müssen sie identische Werte haben. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4097: The element <{0}> beneath element <{1}> may not have a custom XML namespace. - MSB4097: Element <{0}> znajdujący się pod elementem <{1}> może nie mieć niestandardowej przestrzeni nazw XML. - {StrBegin="MSB4097: "} - - MSB4097: Das Element <{0}> unter Element <{1}> möglicherweise keinen benutzerdefinierten XML-Namespace. - - fuzzyMatch="15" wordcount="16" adjWordcount="13.6" curWordcount="13.6" - - - MSB4009: The default tasks file could not be successfully loaded. {0} - MSB4009: Nie można pomyślnie załadować pliku zadań domyślnych. {0} - {StrBegin="MSB4009: "}UE: This message is shown when one of the default tasks file (*.tasks) located alongside the MSBuild binaries cannot - be opened/parsed. "{0}" contains a message explaining why. The filename itself is not part of the message but is provided - separately to loggers. - LOCALIZATION: "{0}" is a message from some FX method and is already localized. - - MSB4009: Die Standardaufgabendatei konnte nicht geladen werden. {0} - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4010: The "{0}" files could not be successfully loaded from their expected location "{1}". Default tasks will not be available. {2} - MSB4010: Nie można pomyślnie załadować plików „{0}” z ich oczekiwanej lokalizacji „{1}”. Zadania domyślne będą niedostępne. {2} - {StrBegin="MSB4010: "}UE: This message is shown when the default tasks files that are located alongside the MSBuild binaries cannot be - found, either because they don't exist, or because of lack of permissions. "{2}" contains a message explaining why. - LOCALIZATION: "{2}" is a message from some FX method and is already localized. - - MSB4010: Die {0}-Dateien konnten nicht vom erwarteten Speicherplatz "{1}" geladen werden. Standardaufgaben sind nicht verfügbar. {2} - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - MSB4140: Default tools version is specified in neither the registry nor the configuration file. - MSB4140: Nie określono domyślnej wersji narzędzi ani w rejestrze, ani w pliku konfiguracji. - {StrBegin="MSB4140: "} - - MSB4140: Die Standardtoolsversion ist weder in der Registrierung noch in der Konfigurationsdatei angegeben. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4133: A default tools version "{0}" was specified, but its definition could not be found. - MSB4133: Określono domyślną wersję narzędzi „{0}”, ale nie można odnaleźć jej definicji. - {StrBegin="MSB4133: "} - - MSB4133: Eine Standardtoolsversion "{0}" wurde angegeben, aber ihre Definition konnte nicht gefunden werden. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - MSB4080: The value "{0}" of the "PropertyName" attribute in element <Output> contains a "$" character. If you intended to use a property name then remove the $( ) around the property name. - MSB4080: Wartość „{0}” atrybutu „PropertyName” w elemencie <Output> zawiera znak „$”. Jeżeli zamierzasz użyć nazwy właściwości, usuń znaki $( ) otaczające tę nazwę. - {StrBegin="MSB4080: "}UE: This message is shown when an output tag has an property name that contains an $. They probably typed $(foo) instead of foo in the PropertyName. LOCALIZATION: Output and PropertyName should not be localized. - - MSB4080: Der Wert "{0}" "PropertyName-Attribut im Element < Output >"$"-Zeichen enthält. Wenn Sie auf einen Eigenschaftennamen verwenden und entfernen Sie anschließend die ($), um den Eigenschaftennamen. - - fuzzyMatch="15" wordcount="32" adjWordcount="27.2" curWordcount="27.2" - - - MSB4011: There is a circular reference involving the import of file "{0}". This file may have been imported more than once, or you may have attempted to import the main project file. All except the first instance of this file will be ignored. - MSB4011: Istnieje odwołanie cykliczne obejmujące importowanie pliku „{0}”. Ten plik mógł zostać zaimportowany więcej niż jeden raz lub mogła nastąpić próba zaimportowania głównego pliku projektu. Wszystkie wystąpienia tego pliku poza pierwszym zostaną zignorowane. - {StrBegin="MSB4011: "} - - MSB4011: Es besteht eine Ringabhängigkeit im Zusammenhang mit dem Import der Datei {0}. Diese Datei wurde unter Umständen mehrmals importiert, oder es wurde versucht, die Hauptprojektdatei zu importieren. Alle außer der ersten Instanz dieser Datei werden ignoriert. - - fuzzyMatch="101" wordcount="43" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4079: The <ProjectExtensions> element occurs more than once. - MSB4079: Element <ProjectExtensions> występuje więcej niż raz. - {StrBegin="MSB4079: "} - - MSB4079: Das Element < ProjectExtensions > tritt mehr als einmal. - - fuzzyMatch="15" wordcount="9" adjWordcount="7.65" curWordcount="7.65" - - - MSB4012: The expression "{0}" cannot be used in this context. Item lists cannot be concatenated with other strings where an item list is expected. Use a semicolon to separate multiple item lists. - MSB4012: Wyrażenia „{0}” nie można użyć w tym kontekście. Listy elementów nie można połączyć z innymi ciągami, gdy oczekiwana jest lista elementów. Użyj średnika, aby rozdzielić wiele list elementów. - {StrBegin="MSB4012: "}UE: This message is shown when the user does not properly specify an item list when an item list is expected - e.g. "badprefix@(foo)badsuffix" instead of "prefix; @(foo); suffix" - - MSB4012: Der Ausdruck {0} kann in diesem Kontext nicht verwendet werden. Elementlisten können nicht mit anderen Zeichenfolgen verkettet werden, wenn eine Elementliste erwartet wird. Verwenden Sie ein Semikolon, um mehrere Elementlisten voneinander zu trennen. - - fuzzyMatch="101" wordcount="32" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Need to specify the project file name. - Należy określić nazwę pliku projektu. - UE: This message is shown when the user calls into the engine to build a project without specifying a filename. - - Geben Sie den Projektdateinamen an. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - end of input - koniec danych wejściowych - This is the name of the "EndOfInput" token. It is displayed in quotes as the - unexpected char or token when the end of a conditional was unexpectedly reached. - - Ende der Eingabe - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - The previous error was converted to a warning because the task was called with ContinueOnError=true. - Poprzedni błąd został przekonwertowany na ostrzeżenie, ponieważ zadanie było wywołane przy użyciu parametru ContinueOnError=true. - - - Der vorherige Fehler wurde in eine Warnung umgewandelt, da die Aufgabe mit ContinueOnError=true aufgerufen wurde. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - {0} Error(s) - Liczba błędów: {0} - - - {0} Fehler - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4159: Error creating the toolset "{0}". {1} - MSB4159: Błąd podczas tworzenia zestawu narzędzi „{0}”. {1} - {StrBegin="MSB4159: "} - - MSB4159: Fehler beim Erstellen des Toolsets "{0}". {1} - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4146: Cannot evaluate the property expression "{0}" found at "{1}". {2} - MSB4146: Nie można oszacować wyrażenia właściwości „{0}” znalezionego w „{1}”. {2} - {StrBegin="MSB4146: "} - - MSB4146: Der bei "{1}" gefundene Eigenschaftsausdruck "{0}" kann nicht ausgewertet werden. {2} - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - The <{0}> tag is no longer supported as a child of the <Project> element. Place this tag within a target, and add the name of the target to the "InitialTargets" attribute of the <Project> element. - Tag <{0}> nie jest już obsługiwany jako element podrzędny elementu <Project>. Umieść ten tag w elemencie docelowym i dodaj nazwę elementu docelowego do atrybutu „InitialTargets” elementu <Project>. - - - Das <{0}>-Tag nicht als untergeordnetes Element des < Project >-Elements unterstützt. Platzieren Sie dieses Tag in einem Ziel und fügen Sie den Namen des Ziels InitialTargets-Attribut des < Project >-Elements hinzu. - - fuzzyMatch="15" wordcount="38" adjWordcount="32.3" curWordcount="32.3" - - - MSB4100: Expected "{0}" to evaluate to a boolean instead of "{1}", in condition "{2}". - MSB4100: Oczekiwano, że element „{0}” zostanie oszacowany jako wartość logiczna, a nie jako „{1}” w warunku „{2}”. - {StrBegin="MSB4100: "} - - MSB4100: Das Ergebnis der Auswertung von {0} war {1}, es wurde jedoch ein boolescher Wert in der {2}-Bedingung erwartet. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4028: The "{0}" task's outputs could not be retrieved from the "{1}" parameter. {2} - MSB4028: Nie można pobrać danych wyjściowych zadania „{0}” z parametru „{1}”. {2} - {StrBegin="MSB4028: "} - - MSB4028: Die Ausgaben der {0}-Aufgabe konnten nicht aus dem {1}-Parameter abgerufen werden. {2} - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4014: The build was aborted because of an internal failure. - MSB4014: Kompilowanie zostało przerwane z powodu błędu wewnętrznego. - {StrBegin="MSB4014: "}UE: This message is shown when an unhandled exception terminates the build. The cause is most likely a programming - error in the build engine. - - MSB4014: Das Erstellen wurde aufgrund eines internen Fehlers abgebrochen. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4015: The build was aborted because the "{0}" logger failed unexpectedly during shutdown. - MSB4015: Kompilowanie zostało przerwane, ponieważ rejestrator „{0}” uległ nieoczekiwanej awarii podczas zamykania. - {StrBegin="MSB4015: "}UE: This message is used for a special exception that is thrown when a logger fails while shutting down (most likely - because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a special - exception to abort the build. - - MSB4015: Das Erstellen wurde abgebrochen, da für die {0}-Protokollierung beim Herunterfahren ein unerwarteter Fehler aufgetreten ist. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4016: The build was aborted because the "{0}" logger failed unexpectedly during initialization. - MSB4016: Przerwano kompilowanie, ponieważ rejestrator „{0}” uległ nieoczekiwanej awarii w czasie inicjowania. - {StrBegin="MSB4016: "}UE: This message is used for a special exception that is thrown when a logger fails while initializing itself (most - likely because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a - special exception to abort the build. - - MSB4016: Das Erstellen wurde abgebrochen, da für die {0}-Protokollierung bei der Initialisierung ein unerwarteter Fehler aufgetreten ist. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4017: The build was aborted because of an unexpected logger failure. - MSB4017: Kompilowanie zostało przerwane z powodu nieoczekiwanej awarii rejestratora. - {StrBegin="MSB4017: "}UE: This message is used for a special exception that is thrown when a logger fails while logging an event (most - likely because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a - special exception to abort the build. - - MSB4017: Das Erstellen wurde wegen eines unerwarteten Protokollierungsfehlers abgebrochen. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4018: The "{0}" task failed unexpectedly. - MSB4018: Nastąpiło nieoczekiwane niepowodzenie zadania „{0}”. - {StrBegin="MSB4018: "}UE: This message is shown when a task terminates because of an unhandled exception. The cause is most likely a - programming error in the task; however, it is also possible that the unhandled exception originated in the engine, and was - surfaced through the task when the task called into the engine. - - MSB4018: Unerwarteter Fehler bei der {0}-Aufgabe. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4165: Failed to receive a response from the child node "{0}" in the timeout period "{1}" ms. Shutting down. - MSB4165: Nie można odebrać odpowiedzi od węzła podrzędnego „{0}” w ciągu limitu czasu wynoszącego „{1}” ms. Zamykanie. - {StrBegin="MSB4165: "} - - MSB4165: Vom untergeordneten Knoten "{0}" wurde innerhalb des Zeitlimits von "{1}" ms keine Antwort empfangen. Herunterfahren. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4088: Condition "{0}" is improperly constructed. - MSB4088: Warunek „{0}” jest nieprawidłowo skonstruowany. - {StrBegin="MSB4088: "} - - MSB4088: Die {0}-Bedingung ist falsch konstruiert. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4105: Found an unexpected character '{2}' at position {1} in condition "{0}". Did you intend to use "=="? - MSB4105: Znaleziono nieoczekiwany znak „{2}” w położeniu {1} w warunku „{0}”. Czy miały być użyte znaki „==”? - {StrBegin="MSB4105: "} - - MSB4105: Ein unerwartetes Zeichen {2} wurde an Position {1} in der {0}-Bedingung gefunden. Wollten Sie "==" verwenden? - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - MSB4106: Expected an item list at position {1} in condition "{0}". Did you forget the closing parenthesis? - MSB4106: Oczekiwano listy elementów w położeniu {1} w warunku „{0}”. Czy nie brakuje nawiasu zamykającego? - {StrBegin="MSB4106: "} - - MSB4106: Eine Elementliste wurde an Position {1} in Bedingung {0} erwartet. Haben Sie die schließende Klammer vergessen? - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - MSB4107: Expected an item list at position {1} in condition "{0}". Did you forget the opening parenthesis after the '@'? To use a literal '@', use '%40' instead. - MSB4107: Oczekiwano listy elementów w położeniu {1} w warunku „{0}”. Czy nie brakuje nawiasu zamykającego po znaku „@”? Aby użyć literału „@”, użyj zamiast niego zapisu „%40”. - {StrBegin="MSB4107: "} - - MSB4107: Eine Elementliste wurde an Position {1} in Bedingung {0} erwartet. Haben Sie die öffnende Klammer hinter dem Zeichen "@" vergessen? Wenn Sie ein literales "@" verwenden möchten, geben Sie "%40" ein. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4108: Expected an item list at position {1} in condition "{0}". Did you forget to close a quote inside the item list expression? - MSB4108: Oczekiwano listy elementów w położeniu {1} w warunku „{0}”. Czy cudzysłów wewnątrz wyrażenia listy elementów został zamknięty? - {StrBegin="MSB4108: "} - - MSB4108: Eine Elementliste wurde an Position {1} in Bedingung {0} erwartet. Haben Sie das schließende Anführungszeichen innerhalb des Elementlistenausdrucks vergessen? - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - MSB4109: Expected a property at position {1} in condition "{0}". Did you forget the closing parenthesis? - MSB4109: Oczekiwano właściwości w położeniu {1} w warunku „{0}”. Czy nie brakuje nawiasu zamykającego? - {StrBegin="MSB4109: "} - - MSB4109: Eine Eigenschaft wurde an Position {1} in Bedingung {0} erwartet. Haben Sie die schließende Klammer vergessen? - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB4110: Expected a property at position {1} in condition "{0}". Did you forget the opening parenthesis after the '$'? To use a literal '$', use '%24' instead. - MSB4110: Oczekiwano właściwości w położeniu {1} w warunku „{0}”. Czy nie brakuje nawiasu zamykającego po znaku „$”? Aby użyć literału „$”, użyj zamiast niego zapisu „%24”. - {StrBegin="MSB4110: "} - - MSB4110: Eine Eigenschaft wurde an Position {1} in Bedingung {0} erwartet. Haben Sie die öffnende Klammer hinter dem Zeichen "$" vergessen? Wenn Sie eine literales "$" verwenden möchten, geben Sie "%24" ein. - - fuzzyMatch="101" wordcount="27" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4101: Expected a closing quote after position {1} in condition "{0}". - MSB4101: Oczekiwano cudzysłowu zamykającego po położeniu {1} w warunku „{0}”. - {StrBegin="MSB4101: "} - - MSB4101: Es wurde ein schließendes Anführungszeichen hinter Position {1} in Bedingung {0} erwartet. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4019: The imported project "{0}" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. - MSB4019: Nie można odnaleźć zaimportowanego projektu „{0}”. Upewnij się, że ścieżka w deklaracji <Import> jest poprawna oraz że plik istnieje na dysku. - {StrBegin="MSB4019: "}LOCALIZATION: <Import> should not be localized. - - MSB4019: Das importierte Projekt "{0}" wurde nicht gefunden. Bestätigen Sie den Pfad in der Deklaration < Import > und die Datei auf dem Datenträger vorhanden ist. - - fuzzyMatch="15" wordcount="26" adjWordcount="22.1" curWordcount="22.1" - - - MSB4089: Incorrect number of arguments to function in condition "{0}". Found {1} argument(s) when expecting {2}. - MSB4089: Niepoprawna liczba argumentów dla funkcji w warunku „{0}”. Znaleziono następującą liczbę argumentów: {1}. Oczekiwano następującej liczby argumentów: {2}. - {StrBegin="MSB4089: "} - - MSB4089: Falsche Anzahl von Argumenten für eine Funktion in der Bedingung "{0}". {1} Argument(e) gefunden, obwohl {2} erwartet wurde(n). - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - The "{0}" object specified does not belong to the correct "{1}" object. - Określony obiekt „{0}” nie należy do poprawnego obiektu „{1}”. - - - Das angegebene {0}-Objekt gehört nicht zum korrekten {1}-Objekt. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4020: The value "{0}" of the "{1}" attribute in element <{2}> is invalid. - MSB4020: Wartość „{0}” atrybutu „{1}” w elemencie <{2}> jest nieprawidłowa. - {StrBegin="MSB4020: "}UE: This is a generic message that is displayed when we find a project element with an incorrect value for one of its - attributes e.g. <Import Project=""> -- the value of Project should not be an empty string. - - MSB4020: Der Wert "{0}" von der "{1}" Attribut im Element <{2}> ist ungültig. - - fuzzyMatch="15" wordcount="14" adjWordcount="11.9" curWordcount="11.9" - - - MSB4102: The value "{0}" of the "{1}" attribute in element <{2}> is invalid. {3} - MSB4102: Wartość „{0}” atrybutu „{1}” w elemencie <{2}> jest nieprawidłowa. {3} - {StrBegin="MSB4102: "}UE: This is a generic message that is displayed when we find a project element with an incorrect value for one of its - attributes. At the end of the message we show the exception text we got trying to use the value. - - MSB4102: Der Wert "{0}" von der "{1}" Attribut im Element <{2}> ist ungültig. {3} - - fuzzyMatch="15" wordcount="15" adjWordcount="12.75" curWordcount="12.75" - - - MSB4021: The "ContinueOnError" attribute of the "{0}" task is not valid. {1} - MSB4021: Atrybut „ContinueOnError” zadania „{0}” jest nieprawidłowy. {1} - {StrBegin="MSB4021: "}LOCALIZATION: "ContinueOnError" should not be localized. "{1}" is a message from another exception explaining the problem. - - MSB4021: Das ContinueOnError-Attribut für die {0}-Aufgabe ist ungültig. {1} - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4139: Invalid value for default ToolsVersion is specified in registry key "{0}". - MSB4139: Określono nieprawidłową wartość domyślnego parametru ToolsVersion w kluczu rejestru „{0}”. - {StrBegin="MSB4139: "} - - MSB4139: Im Registrierungsschlüssel "{0}" ist ein ungültiger Wert für die Standard-ToolsVersion angegeben. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4022: The result "{0}" of evaluating the value "{1}" of the "{2}" attribute in element <{3}> is not valid. - MSB4022: Wynik „{0}” szacowania wartości „{1}” atrybutu „{2}” w elemencie <{3}> jest nieprawidłowy. - {StrBegin="MSB4022: "}UE: This message is shown when the engine is checking the correctness of the value (after evaluating embedded - properties/items) assigned to an XML attribute of an XML element in the project file. - - MSB4022: Das Ergebnis "{0}"der Auswertung des Werts"{1}" von der "{2}" Attribut im Element <{3}> ist ungültig. - - fuzzyMatch="15" wordcount="20" adjWordcount="17" curWordcount="17" - - - "{0}" is not a valid event category. To raise a custom event, use the "{1}" category. - „{0}” nie jest prawidłową kategorią zdarzenia. Aby wywołać zdarzenie niestandardowe, użyj kategorii „{1}”. - - - {0} ist keine gültige Ereigniskategorie. Verwenden Sie die {1}-Kategorie, um ein benutzerdefiniertes Ereignis auszulösen. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - "{0}" is not a valid importance level for events. - „{0}” nie jest prawidłowym poziomem ważności zdarzeń. - - - {0} ist kein gültiger Wert für die Bedeutung eines Ereignisses. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4104: Failed to write to log file "{0}". {1} - MSB4104: Nie można zapisać w pliku dziennika „{0}”. {1} - {StrBegin="MSB4104: "}UE: This is shown when the File Logger can't create or write to the file it was instructed to log to. - - MSB4104: Fehler beim Schreiben in die Protokollierungsdatei "{0}". {1} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4024: The imported project file could not be loaded. {0} - MSB4024: Nie można załadować zaimportowanego pliku projektu. {0} - {StrBegin="MSB4024: "}UE: This message is shown when an imported project file cannot be loaded because of incorrect XML. The project - filename is not part of the message because it is provided separately to loggers. - LOCALIZATION: {0} is a localized message from the CLR/FX explaining why the project is invalid. - - MSB4024: Die importierte Projektdatei konnte nicht geladen werden. {0} - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - Operation invalid for a persisted item group. - Operacja nieprawidłowa dla grupy elementów trwałych. - - - Ungültiger Vorgang für eine persistente Elementgruppe. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Operation invalid for a virtual item group. - Operacja nieprawidłowa dla grupy elementów wirtualnych. - - - Ungültiger Vorgang für eine virtuelle Elementgruppe. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4071: The value Importance="{0}" in the <Message> element is invalid. Valid values are: High, Normal and Low. - MSB4071: Wartość Importance=„{0}” w elemencie <Message> jest nieprawidłowa. Prawidłowe wartości: High, Normal i Low. - {StrBegin="MSB4071: "}UE: This message is shown when a user specifies a value for the importance attribute of Message which is not valid. - The importance enumeration is: High, Normal and Low. Specifying any other importance will result in this message being shown - LOCALIZATION: "Importance" should not be localized. - "Message" should not be localized. - High should not be localized. - Normal should not be localized. - Low should not be localized. - - MSB4071: Der Wert Importance = "{0}" in < Nachricht > Element ist ungültig. Gültige Werte sind: hoch, Normal und niedrig. - - fuzzyMatch="15" wordcount="18" adjWordcount="15.3" curWordcount="15.3" - - - MSB4025: The project file could not be loaded. {0} - MSB4025: Nie można załadować pliku projektu. {0} - {StrBegin="MSB4025: "}UE: This message is shown when the project file given to the engine cannot be loaded because the filename/path is - invalid, or due to lack of permissions, or incorrect XML. The project filename is not part of the message because it is - provided separately to loggers. - LOCALIZATION: {0} is a localized message from the CLR/FX explaining why the project is invalid. - - MSB4025: Die Projektdatei konnte nicht geladen werden. {0} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4147: The property "{0}" at "{1}" is invalid. {2} - MSB4147: Właściwość „{0}” w „{1}” jest nieprawidłowa. {2} - {StrBegin="MSB4147: "} - - MSB4147: Die {0}-Eigenschaft bei "{1}" ist ungültig. {2} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - "{0}" is an invalid "ProjectFileEncoding" value. - „{0}” jest nieprawidłową wartością parametru „ProjectFileEncoding”. - LOCALIZATION: "ProjectFileEncoding" should not be localized. - - {0} ist ein ungültiger ProjectFileEncoding-Wert. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4143: The expression "{0}" cannot be evaluated. {1} - MSB4143: Nie można oszacować wyrażenia „{0}”. {1} - {StrBegin="MSB4143: "} - UE: This message is shown when the user attempts to provide an expression like "$(Registry:HKEY_LOCAL_MACHINE\Software\Vendor\Tools@TaskLocation)" - LOCALIZATION: "{0}" is the expression that was bad. "{1}" is a message from an FX exception that describes why the expression is bad. - - - MSB4143: Der Ausdruck "{0}" kann nicht ausgewertet werden. {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4184: The expression "{0}" cannot be evaluated. {1} - MSB4184: Nie można ocenić wyrażenia „{0}”. {1} - {StrBegin="MSB4184: "} - Single quotes as the expression will typically have double quotes in it. - UE: This message is shown when the user attempts to provide an expression like "$(SomeProperty.ToLower())" - LOCALIZATION: "{0}" is the expression that was bad. "{1}" is a message from an FX exception that describes why the expression is bad. - - - MSB4184: Der Ausdruck "{0}" kann nicht ausgewertet werden. {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4185: The function "{0}" on type "{1}" has not been enabled for execution. - MSB4185: Funkcja „{0}” w typie „{1}” nie została włączona do wykonania. - {StrBegin="MSB4185: "} - UE: This message is shown when the user attempts to provide an expression like "$([System.DateTime]::Now)", but the expression has not been enabled - LOCALIZATION: "{0}" is the static function name, "{1}" is the .NET Framework type name - - - MSB4185: Die {0}-Funktion für den {1}-Typ wurde nicht für die Ausführung aktiviert. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4186: Invalid static method invocation syntax: "{0}". Static method invocation should be of the form: $([FullTypeName]::Method()), e.g. $([System.IO.Path]::Combine(`a`, `b`)) - MSB4186: Nieprawidłowa składnia wywołania metody statycznej: {0}. Wywołanie metody statycznej powinno mieć postać: $([PełnaNazwaTypu]::Metoda()), np. $([System.IO.Path]::Combine(`a`, `b`)) - {StrBegin="MSB4186: "} - UE: This message is shown when the user attempts to call a static method on a type, but has used the incorrect syntax - LOCALIZATION: "{0}" is the function expression which is in error - - - MSB4186: Ungültige Aufrufsyntax für statische Methode: "{0}". Für den Aufruf statischer Methoden muss folgendes Format verwendet werden: $([vollständiger Typname]::Methode()), z. B. $([System.IO.Path]::Combine(`a`, `b`)) - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4070: The schema "{0}" is not valid. {1} - MSB4070: Schemat „{0}” jest nieprawidłowy. {1} - {StrBegin="MSB4070: "}UE: This message is shown when the schema file provided for the validation of a project is itself not valid. - LOCALIZATION: "{0}" is the schema file path. "{1}" is a message from an FX exception that describes why the schema file is bad. - - MSB4070: Das Schema "{0}" ist nicht gültig. {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4026: The "{0}={1}" parameter for the "{2}" task is invalid. - MSB4026: Parametr „{0}={1}” zadania „{2}” jest nieprawidłowy. - {StrBegin="MSB4026: "}UE: This message is displayed when a task has an invalid parameter that cannot be initialized. - - MSB4026: Der {0}={1}-Parameter für die {2}-Aufgabe ist ungültig. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4027: The "{0}" task generated invalid items from the "{1}" output parameter. {2} - MSB4027: Zadanie „{0}” wygenerowało nieprawidłowe elementy na podstawie parametru wyjściowego „{1}”. {2} - {StrBegin="MSB4027: "} - - MSB4027: Die {0}-Aufgabe generierte ungültige Elemente aus dem {1}-Ausgabeparameter. {2} - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4029: The "{0}" task has an invalid output specification. The "TaskParameter" attribute is required, and either the "ItemName" or "PropertyName" attribute must be specified (but not both). - MSB4029: Zadanie „{0}” ma nieprawidłową specyfikację wyjściową. Atrybut „TaskParameter” jest wymagany i należy określić atrybut „ItemName” lub „PropertyName” (ale nie oba te atrybuty). - {StrBegin="MSB4029: "}LOCALIZATION: "TaskParameter", "ItemName" and "PropertyName" should not be localized. - - MSB4029: Die {0}-Aufgabe enthält eine ungültige Ausgabespezifikation. Das TaskParameter-Attribut ist erforderlich, und es muss entweder das ItemName- oder PropertyName-Attribut angegeben werden (jedoch nicht beide). - - fuzzyMatch="101" wordcount="27" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4030: "{0}" is an invalid value for the "{1}" parameter of the "{3}" task. The "{1}" parameter is of type "{2}". - MSB4030: Wartość „{0}” jest nieprawidłową wartością parametru „{1}” zadania „{3}”. Parametr „{1}” ma typ „{2}”. - {StrBegin="MSB4030: "}UE: This error is shown when a type mis-match occurs between the value assigned to task parameter in the project file - and the type of the .NET property that corresponds to the task parameter. For example, if an int task parameter called "Count" - is assigned the value "x", this error would be displayed: <MyTask Count="x" /> - - MSB4030: "{0}" ist ein ungültiger Wert für den {1}-Parameter der {3}-Aufgabe. Der {1}-Parameter ist vom Typ "{2}". - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - MSB4137: Invalid value specified in the configuration file at "{0}". Property name or tools version name is an empty string. - MSB4137: Określono nieprawidłową wartość w pliku konfiguracji w „{0}”. Nazwa właściwości lub nazwa wersji narzędzi jest pustym ciągiem. - {StrBegin="MSB4137: "} - - MSB4137: In der Konfigurationsdatei ist bei "{0}" ein ungültiger Wert angegeben. Der Eigenschaftenname oder der Toolsversionname ist eine leere Zeichenfolge. - - fuzzyMatch="100" wordcount="20" adjWordcount="5" curWordcount="5" tmLabel="N''" - - - MSB4103: "{0}" is not a valid logger verbosity level. - MSB4103: „{0}” nie jest prawidłowym poziomem szczegółowości rejestratora. - {StrBegin="MSB4103: "} - - MSB4103: "{0}" ist kein gültiger Ausführlichkeitsgrad für die Protokollierung. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4163: <ItemDefinitionGroup> is not allowed inside a target. - MSB4163: Wartość <ItemDefinitionGroup> jest niedozwolona wewnątrz elementu docelowego. - {StrBegin="MSB4163: "} - - MSB4163: < ItemDefinitionGroup > ist in einem Ziel nicht zulässig. - - fuzzyMatch="15" wordcount="9" adjWordcount="7.65" curWordcount="7.65" - - - The specified item does not belong to the current item group. - Określony element nie należy do bieżącej grupy elementów. - - - Das angegebene Element gehört nicht zu der aktuellen Elementgruppe. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4096: The item "{0}" in item list "{1}" does not define a value for metadata "{2}". In order to use this metadata, either qualify it by specifying %({1}.{2}), or ensure that all items in this list define a value for this metadata. - MSB4096: Element „{0}” na liście elementów „{1}” nie definiuje wartości metadanych „{2}”. Aby używać tych metadanych, zakwalifikuj je, określając parametr %({1}.{2}), lub upewnij się, że wszystkie elementy na tej liście określają wartość tych metadanych. - {StrBegin="MSB4096: "} - - MSB4096: Das Element "{0}" in der Elementliste "{1}" definiert keinen Wert für die {2}-Metadaten. Wenn Sie diese Metadaten verwenden möchten, qualifizieren Sie sie, indem Sie %({1}.{2}) angeben, oder vergewissern Sie sich, dass alle Elemente in der Liste einen Wert für diese Metadaten definieren. - - fuzzyMatch="101" wordcount="42" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4099: A reference to an item list at position {1} is not allowed in this condition "{0}". - MSB4099: Odwołanie do listy elementów wymienione w położeniu {1} jest niedozwolone w tym warunku „{0}”. - {StrBegin="MSB4099: "} - - MSB4099: Ein Verweis auf eine Elementliste an Position {1} ist in dieser {0}-Bedingung nicht zulässig. - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - MSB4033: "{0}" is a reserved item metadata, and cannot be redefined as a custom metadata on the item. - MSB4033: Element „{0}” stanowi zastrzeżone metadane elementu i nie można go ponownie zdefiniować jako metadanych niestandardowych w elemencie. - {StrBegin="MSB4033: "} - - MSB4033: "{0}" sind reservierte Elementmetadaten und können nicht als benutzerdefinierte Metadaten für das Element neu definiert werden. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - An InternalLoggerException can only be thrown by the MSBuild engine. The public constructors of this class cannot be used to create an instance of the exception. - Wyjątek InternalLoggerException może być zgłoszony tylko przez aparat MSBuild. Publicznych konstruktorów tej klasy nie można użyć do utworzenia wystąpienia wyjątku. - UE: This message is shown when a user tries to instantiate a special exception called InternalLoggerException through the OM -- - only the engine is allowed to create and throw this exception. - LOCALIZATION: "InternalLoggerException" and "MSBuild" should not be localized. - - Eine InternalLoggerException kann nur durch das MSBuild-Modul ausgelöst werden. Die öffentlichen Konstruktoren dieser Klasse können nicht verwendet werden, um eine Instanz der Ausnahme zu erstellen. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Initial Items: - Elementy początkowe: - - - Ursprüngliche Elemente: - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4083: Expected a Condition attribute on element "{0}". - MSB4083: Oczekiwany atrybut Condition w elemencie „{0}”. - {StrBegin="MSB4083: "} - - MSB4083: Es wurde ein Bedingungsattribut für das {0}-Element erwartet. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4164: The value "{0}" of metadata "{1}" contains an item list expression. Item list expressions are not allowed on default metadata values. - MSB4164: Wartość „{0}” metadanych „{1}” zawiera wyrażenie listy elementów. Stosowanie wyrażeń list elementów w domyślnych wartościach metadanych jest niedozwolone. - {StrBegin="MSB4164: "} - - MSB4164: Der Wert "{0}" der {1}-Metadaten enthält einen Elementlistenausdruck. Elementlistenausdrücke sind nicht als Standardwerte für Metadaten zulässig. - - fuzzyMatch="100" wordcount="22" adjWordcount="5.5" curWordcount="5.5" tmLabel="N''" - - - MSBuild is expecting a valid "{0}" object. - Program MSBuild oczekuje prawidłowego obiektu „{0}”. - - - MSBuild erwartet ein gültiges {0}-Objekt. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4035: The required attribute "{0}" is missing from element <{1}>. - MSB4035: Brak wymaganego atrybutu „{0}” w elemencie <{1}>. - {StrBegin="MSB4035: "}UE: This message is shown when a user leaves off a required attribute from a project element - e.g. <UsingTask AssemblyName="foo"> -- this is missing the "TaskName" attribute. - - MSB4035: Das erforderliche Attribut "{0}"-Element fehlt <{1}>. - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB4036: The "{0}" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "{1}" directory. - MSB4036: Nie można odnaleźć zadania „{0}”. Sprawdź, czy: 1) Nazwa zadania w pliku projektu jest taka sama, jak nazwa klasy zadania. 2) Klasą zadania jest „public” i implementuje ona interfejs Microsoft.Build.Framework.ITask. 3) Zadanie jest poprawnie zadeklarowane za pomocą parametru <UsingTask> w pliku projektu lub w plikach *.tasks zlokalizowanych w katalogu „{1}”. - {StrBegin="MSB4036: "}LOCALIZATION: <UsingTask> and "*.tasks" should not be localized. - - MSB4036: Die "{0}" Task wurde nicht gefunden. Überprüfen Sie Folgendes: 1.) der Name der Aufgabe in der Projektdatei entspricht dem Namen der Aufgabenklasse. 2) die Aufgabenklasse ist "public" und implementiert die Microsoft.Build.Framework.ITask-Schnittstelle. 3) die Aufgabe korrekt mit < UsingTask > deklariert, in der Projektdatei oder in den Tasks-Dateien der "{1}" Verzeichnis. - - fuzzyMatch="15" wordcount="64" adjWordcount="54.4" curWordcount="54.4" - - - MSB4141: MSBuildToolsPath is not specified for the ToolsVersion "{0}" defined at "{1}", or the value specified evaluates to the empty string. - MSB4141: Nie określono parametru MSBuildToolsPath dla wartości ToolsVersion „{0}” zdefiniowanej w elemencie „{1}” lub określona wartość jest szacowana jako ciąg pusty. - {StrBegin="MSB4141: "} - - MSB4141: MSBuildToolsPath ist für die bei "{1}" definierte ToolsVersion {0} nicht angegeben, oder der angegebene Wert wird zu einer leeren Zeichenfolge ausgewertet. - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - MSB4031: The "MSBuildVersion" attribute is deprecated. If the project is authored in the MSBuild 2003 format, please remove the attribute from the <Project> tag. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format. - MSB4031: Atrybut „MSBuildVersion” jest przestarzały. Jeżeli projekt został utworzony w formacie programu MSBuild 2003, usuń atrybut z tagu <Project>. Jeżeli projekt został utworzony w starym formacie 1.0 lub 1.2, przekonwertuj go na format programu MSBuild 2003. - {StrBegin="MSB4031: "}UE: This message is shown for projects that still contain the "MSBuildVersion" attribute in their <Project> - tag. We no longer need this attribute because the project's XML namespace (i.e. the "xmlns" attribute) gives us all the - version information we need. - LOCALIZATION: "MSBuild", "MSBuildVersion" and <Project> should not be localized. - - MSB4031: Das Attribut "MSBuildVersion" ist veraltet. Wenn das Projekt im Format MSBuild 2003 erstellt wurde, entfernen Sie das Attribut aus dem Tag < Project >. Wenn das Projekt im alten Format 1.0 oder 1.2 erstellt wurde, konvertieren Sie es in das MSBuild 2003-Format. - - fuzzyMatch="15" wordcount="45" adjWordcount="38.25" curWordcount="38.25" - - - MSB4144: Multiple definitions were found for the toolset "{0}". - MSB4144: Odnaleziono wiele definicji dla zestawu narzędzi „{0}”. - {StrBegin="MSB4144: "} - - MSB4144: Für das Toolset wurden mehrere Definitionen gefunden "{0}". - - fuzzyMatch="15" wordcount="9" adjWordcount="7.65" curWordcount="7.65" - - - MSB4145: Multiple definitions were found for the property "{0}". - MSB4145: Odnaleziono wiele definicji dla właściwości „{0}”. - {StrBegin="MSB4145: "} - - MSB4145: Für die {0}-Eigenschaft wurden mehrere Definitionen gefunden. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4082: Choose has more than one <Otherwise> element. - MSB4082: Element Choose ma więcej niż jeden element <Otherwise>. - {StrBegin="MSB4082: "} - - MSB4082: Wählen Sie mehrere < Otherwise >-Element enthält. - - fuzzyMatch="15" wordcount="9" adjWordcount="7.65" curWordcount="7.65" - - - This method is only valid for persisted <{0}> elements. - Ta metoda jest prawidłowa tylko dla trwałych elementów <{0}>. - - - Diese Methode ist nur gültig für beibehalten <{0}> Elemente. - - fuzzyMatch="15" wordcount="10" adjWordcount="8.5" curWordcount="8.5" - - - This method is only valid for virtual property groups, not <{0}> elements. - Ta metoda jest prawidłowa tylko dla grup właściwości wirtualnych, a nie dla elementów <{0}>. - - - Diese Methode gilt nur für virtuelle Eigenschaftengruppen nicht <{0}> Elemente. - - fuzzyMatch="15" wordcount="13" adjWordcount="11.05" curWordcount="11.05" - - - MSB4038: The element <{0}> must be last under element <{1}>. Found element <{2}> instead. - MSB4038: Element <{0}> musi być ostatnim elementem pod elementem <{1}>. Zamiast niego znaleziono element <{2}>. - {StrBegin="MSB4038: "} - - MSB4038: Das Element <{0}> muss unter Element <{1}>. Element wurde gefunden <{2}> statt. - - fuzzyMatch="15" wordcount="17" adjWordcount="14.45" curWordcount="14.45" - - - MSB4138: Non-string data was specified at the registry location "{0}". - MSB4138: Określono dane inne niż ciąg w lokalizacji rejestru „{0}”. - {StrBegin="MSB4138: "} - - MSB4138: Am Registrierungsspeicherort "{0}" wurden Daten angegeben, die keine Zeichenfolge sind. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4039: No "{0}" element was found in the project file. - MSB4039: W pliku projektu nie odnaleziono elementu „{0}”. - {StrBegin="MSB4039: "} - - MSB4039: Das {0}-Element wurde in der Projektdatei nicht gefunden. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4040: There is no target in the project. - MSB4040: Brak elementu docelowego w projekcie. - {StrBegin="MSB4040: "} - - MSB4040: Das Projekt enthält kein Ziel. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Removing the "{0}" attribute of an item is not allowed. - Usunięcie atrybutu „{0}” z elementu jest niedozwolone. - - - Das Löschen des {0}-Attributs eines Elements ist nicht zulässig. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - The object passed in is not part of the project. - Przekazany obiekt nie jest częścią projektu. - - - Das übergebene Objekt ist nicht Teil des Projekts. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - Overriding target "{0}" in project "{1}" with target "{2}" from project "{3}". - Zastępowanie elementu docelowego „{0}” w projekcie „{1}” elementem docelowym „{2}” z projektu „{3}”. - - - Das Ziel "{0}" im Projekt "{1}" wird durch das Ziel "{2}" aus dem Projekt "{3}" außer Kraft gesetzt. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4167: The parent process unexpectedly exited. Shutting down child node "{0}". - MSB4167: Proces nadrzędny został nieoczekiwanie zakończony. Zamykanie węzła podrzędnego „{0}”. - {StrBegin="MSB4167: "} - - MSB4167: Der übergeordnete Prozess wurde unerwartet beendet. Der untergeordnete Knoten "{0}" wird heruntergefahren. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - {0} ms {1} {2} calls - {0} ms {1} — wywołań: {2} - - - {0} ms {1} {2} Aufrufe - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - (* = timing was not recorded because of reentrancy) - (* = nie zarejestrowano chronometrażu z powodu ponownego rozpoczęcia) - - - (* = Zeit wurde aufgrund des erneuten Eintretens nicht aufgezeichnet) - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - This project object has been unloaded from the MSBuild engine and is no longer valid. - Ten obiekt projektu został zwolniony z aparatu MSBuild i nie jest już prawidłowy. - - - Dieses Projektobjekt wurde aus dem MSBuild-Modul entladen und ist nicht mehr gültig. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - The project file "{0}" was not found. - Nie można odnaleźć pliku projektu „{0}”. - UE: This message is shown when the user calls into the OM to build a project that doesn't exist on disk. - - Die Projektdatei "{0}" wurde nicht gefunden. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Done building project "{0}" -- FAILED. - Kompilowanie projektu „{0}” wykonane — NIEPOWODZENIE. - - - Die Erstellung des Projekts "{0}" ist abgeschlossen – FEHLER. - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Done building project "{0}". - Kompilowanie projektu „{0}” wykonane. - - - Die Erstellung des Projekts "{0}" ist abgeschlossen. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - MSB4041: The default XML namespace of the project must be the MSBuild XML namespace. If the project is authored in the MSBuild 2003 format, please add xmlns="{0}" to the <Project> element. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format. - MSB4041: Domyślna przestrzeń nazw XML projektu musi być obszarem nazw XML programu MSBuild. Jeżeli projekt został utworzony w formacie programu MSBuild 2003, dodaj parametr xmlns=„{0}” do elementu <Project>. Jeżeli projekt został utworzony w starym formacie 1.0 lub 1.2, przekonwertuj go na format programu MSBuild 2003. - {StrBegin="MSB4041: "}UE: This is a Beta 1 message only. - LOCALIZATION: <Project>, "MSBuild" and "xmlns" should not be localized. - - MSB4041: Der XML-Standardnamespace des Projekts muss MSBuild XML-Namespace. Wenn das Projekt im Format MSBuild 2003 erstellt wurde, fügen Sie Xmlns = "{0}" < Project >-Element. Wenn das Projekt im alten Format 1.0 oder 1.2 erstellt wurde, konvertieren Sie es in das MSBuild 2003-Format. - - fuzzyMatch="15" wordcount="52" adjWordcount="44.2" curWordcount="44.2" - - - Project Performance Summary: - Podsumowanie wydajności projektu: - - - Leistungszusammenfassung für das Projekt: - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - MSB4042: Stopping because of syntax errors in project file. - MSB4042: Zatrzymywanie z powodu błędów składni w pliku projektu. - {StrBegin="MSB4042: "} - - MSB4042: Prozess aufgrund von Syntaxfehlern in der Projektdatei angehalten. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - Project "{0}" is building "{1}" ({2} target(s)): - Projekt „{0}” kompiluje „{1}” (elementy docelowe: {2}): - - - Das Projekt {0} erstellt {1} ({2} Ziel(e)): - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Project "{0}" is building "{1}" (default targets): - Projekt „{0}” kompiluje „{1}” (domyślne elementy docelowe): - - - Das Projekt "{0}" erstellt "{1}" (Standardziele): - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Project "{0}" ({1} target(s)): - Projekt „{0}” (elementy docelowe: {1}): - - - Projekt "{0}", {1} Ziel(e): - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - Project "{0}" (default targets): - Projekt „{0}” (domyślne elementy docelowe): - - - Projekt "{0}" (Standardziele): - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - Done Building Project "{0}" ({1} target(s)). - Kompilowanie projektu „{0}” wykonane (elementy docelowe: {1}). - - - Die Erstellung von Projekt "{0}" ist abgeschlossen ({1} Ziel(e)). - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Done Building Project "{0}" (default targets). - Kompilowanie projektu „{0}” wykonane (domyślne elementy docelowe). - - - Die Erstellung von Projekt "{0}" ist abgeschlossen (Standardziele). - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Done Building Project "{0}" ({1} target(s)) -- FAILED. - Kompilowanie projektu „{0}” wykonane (elementy docelowe: {1}) — NIEPOWODZENIE. - - - Die Erstellung des Projekts "{0}" ist abgeschlossen, {1} Ziel(e) -- FEHLER. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Done Building Project "{0}" (default targets) -- FAILED. - Kompilowanie projektu „{0}” wykonane (domyślne elementy docelowe) — NIEPOWODZENIE. - - - Die Erstellung von Projekt "{0}" ist abgeschlossen (Standardziele) -- FEHLER. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4075: The project file must be opened in the Visual Studio IDE and converted to the latest version before it can be built by MSBuild. - MSB4075: Plik projektu należy otworzyć w programie Visual Studio IDE i przekonwertować na najnowszą wersję, zanim będzie można go skompilować przy użyciu programu MSBuild. - {StrBegin="MSB4075: "} - - MSB4075: Die Projektdatei muss in der Visual Studio IDE geöffnet und in ein aktuelles Versionsformat gebracht werden, bevor sie mit MSBuild erstellt werden kann. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4192: The project file "{0}" is in the ".vcproj" file format, which MSBuild no longer supports. Please convert the project by opening it in the Visual Studio IDE or running the conversion tool, or use MSBuild 3.5 or earlier to build it. - MSB4192: Plik projektu „{0}” ma format „.vcproj”, którego program MSBuild już nie obsługuje. Przekonwertuj projekt, otwierając go w programie Visual Studio IDE lub uruchamiając narzędzie do konwersji, albo użyj programu MSBuild w wersji 3.5 lub starszej do skompilowania go. - {StrBegin="MSB4192: "} LOC: ".vcproj" should not be localized - - MSB4192: Die Projektdatei "{0}" ist im VSPROJ-Dateiformat gespeichert, das nicht mehr von MSBuild unterstützt wird. Konvertieren Sie das Projekt, indem Sie es in der Visual Studio IDE öffnen oder das Konvertierungstool ausführen, oder verwenden Sie MSBuild 3.5 oder früher zum Erstellen des Projekts. - - fuzzyMatch="101" wordcount="42" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - The specified property does not belong to the current property group. - Określona właściwość nie należy do bieżącej grupy właściwości. - - - Die angegebene Eigenschaft gehört nicht zu der aktuellen Eigenschaftengruppe. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - Initial Properties: - Właściwości początkowe: - - - Ursprüngliche Eigenschaften: - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4148: The name of a property stored under the registry key "{0}" has zero length. - MSB4148: Nazwa właściwości przechowywana w kluczu rejestru „{0}” ma zerową długość. - {StrBegin="MSB4148: "} - - MSB4148: Der Name einer unter dem Registrierungsschlüssel "{0}" gespeicherten Eigenschaft hat eine Länge von Null. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - The property names in the indexer and the "{0}" object do not match. - Nazwy właściwości w indeksatorze i obiekcie „{0}” nie pasują do siebie. - - - Die Eigenschaftennamen im Indexer und das {0}-Objekt stimmen nicht überein. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4043: The item metadata reference "{0}" is invalid because it is qualified with an item name. Item metadata referenced in transforms do not need to be qualified, because the item name is automatically deduced from the items being transformed. Change "{0}" to "%({1})". - MSB4043: Odwołanie do metadanych elementu „{0}” jest nieprawidłowe, ponieważ jest zakwalifikowane przy użyciu nazwy elementu. Metadane elementu wskazywane w przekształceniach nie muszą być kwalifikowane, ponieważ nazwa elementu jest automatycznie ustalana na podstawie przekształcanych elementów. Zmień „{0}” na „%({1})”. - {StrBegin="MSB4043: "}UE: This message is shown when the user does something like this: @(foo->'%(foo.metadata)'). There is no need to specify - "foo.metadata", because "foo" is automatically deduced. In corollary, "bar.metadata" is not allowed either, where "bar" is a different - item list type. - - MSB4043: Der Elementmetadatenverweis "{0}" ist ungültig, da er mit einem Elementnamen qualifiziert ist. Elementmetadaten, auf die bei Transformationen verwiesen wird, müssen nicht qualifiziert werden, da der Elementname automatisch aus den transformierten Elementen abgeleitet wird. Ändern Sie "{0}" in "%({1})". - - fuzzyMatch="101" wordcount="43" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4135: Error reading the toolset information from the registry location "{0}". {1} - MSB4135: Błąd podczas odczytu informacji o zestawie narzędzi z lokalizacji rejestru „{0}”. {1} - {StrBegin="MSB4135: "} - - MSB4135: Fehler beim Lesen der Toolsetinformationen am Registrierungsspeicherort "{0}". {1} - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4044: The "{0}" task was not given a value for the required parameter "{1}". - MSB4044: Zadaniu „{0}” nie nadano wartości dla wymaganego parametru „{1}”. - {StrBegin="MSB4044: "}UE: This message is shown when a task parameter designated as "required" is not set in the project file. - - MSB4044: Die {0}-Aufgabe hat keinen Wert für den erforderlichen {1}-Parameter erhalten. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - Validating project using schema file "{0}". - Walidacja projektu za pomocą pliku schematu „{0}”. - LOCALIZATION: "{0}" is the location of the schema file. - - Das Projekt wird anhand der Schemadatei "{0}" überprüft. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4045: Project is not valid. {0} - MSB4045: Projekt jest nieprawidłowy. {0} - {StrBegin="MSB4045: "}UE: This error is shown when the user asks his project to be validated against a schema (/val switch for - MSBuild.exe), and the project has errors. "{0}" contains a message explaining the problem. - LOCALIZATION: "{0}" is a message from the System.XML schema validator and is already localized. - - MSB4045: Ungültiges Projekt. {0} - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4112: The targets in this project have been disabled by the host and therefore cannot be built at this time. This may have been done for security reasons. To enable the targets, the host must set Project.BuildEnabled to "true". - MSB4112: Elementy docelowe tego projektu zostały wyłączone przez hosta i dlatego nie można ich teraz skompilować. Ta czynność mogła zostać wykonana ze względów bezpieczeństwa. Aby włączyć elementy docelowe, host musi ustawić parametr Project.BuildEnabled na wartość „true”. - {StrBegin="MSB4112: "} - - MSB4112: Die Ziele in diesem Projekt wurden vom Host deaktiviert und können aus diesem Grund derzeit nicht erstellt werden. Die Deaktivierung wurde wahrscheinlich aus Sicherheitsgründen durchgeführt. Wenn Sie die Ziele aktivieren möchten, muss der Host Project.BuildEnabled auf "true" festlegen. - - fuzzyMatch="101" wordcount="39" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4093: The "{0}" parameter of the "{1}" task cannot be written to because it does not have a "set" accessor. - MSB4093: Nie można zapisać parametru „{0}” zadania „{1}”, ponieważ nie ma metody dostępu „set”. - {StrBegin="MSB4093: "}UE: This error is shown when a project tries to assign a value to a task parameter that does not have a "set" - accessor on the corresponding .NET property on the task class. - - MSB4093: In den {0}-Parameter der {1}-Aufgabe kann nicht geschrieben werden, da er keinen set-Accessor besitzt. - - fuzzyMatch="100" wordcount="20" adjWordcount="5" curWordcount="5" tmLabel="N''" - - - A shallow clone of this object cannot be created. - Nie można utworzyć pobieżnego klona tego obiektu. - - - Ein unechter Klon dieses Objekts kann nicht erstellt werden. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - Skipping target "{0}" because it has no inputs. - Pomijanie elementu docelowego „{0}”, ponieważ nie zawiera on wejść. - - - Das {0}-Ziel wird übersprungen, da es keine Eingaben besitzt. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Though the target has declared its inputs, the input specification only references empty properties and/or empty item lists. - Mimo że element docelowy ma zadeklarowane wejścia, specyfikacja wejściowa odwołuje się tylko do pustych właściwości i/lub pustych list elementów. - - - Obwohl das Ziel seine Eingaben deklariert hat, verweist die Eingabespezifikation nur auf leere Eigenschaften und/oder leere Elementlisten. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - Skipping target "{0}" because it has no outputs. - Pomijanie elementu docelowego „{0}”, ponieważ nie zawiera on danych wyjściowych. - - - Das Ziel "{0}" wird übersprungen, da es keine Ausgaben enthält. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Though the target has declared its outputs, the output specification only references empty properties and/or empty item lists. - Mimo że element docelowy ma zadeklarowane wyjścia, specyfikacja wyjściowa odwołuje się tylko do pustych właściwości i/lub pustych list elementów. - - - Obwohl das Ziel seine Ausgaben deklariert hat, verweist die Ausgabespezifikation nur auf leere Eigenschaften und/oder leere Elementlisten. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - Skipping target "{0}" because all output files are up-to-date with respect to the input files. - Pomijanie elementu docelowego „{0}”, ponieważ wszystkie pliki wyjściowe są aktualne w porównaniu z plikami wejściowymi. - - - Das Ziel "{0}" wird übersprungen, da alle Ausgabedateien hinsichtlich der Eingabedateien aktuell sind. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - Input files: {0} - Pliki wejściowe: {0} - {0} is a semicolon-separated list of filenames. - - Eingabedateien: {0} - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Output files: {0} - Pliki wyjściowe: {0} - {0} is a semicolon-separated list of filenames. - - Ausgabedateien: {0} - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Building solution configuration "{0}". - Tworzenie konfiguracji rozwiązania „{0}”. - UE: This is not an error, so doesn't need an error code. - - Die Projektmappenkonfiguration "{0}" wird erstellt. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - Using solution cache file "{0}" for configuration "{1}" and tools version "{2}". - Używanie pliku pamięci podręcznej rozwiązań „{0}” dla konfiguracji „{1}” i wersji narzędzi „{2}”. - UE: This is not an error, so doesn't need an error code. - - Die Projektmappen-Cachedatei "{0}" wird für die Konfiguration "{1}" und die Toolsversion "{2}" verwendet. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Failed to read solution cache file "{0}". {1} Using solution file directly. - Nie można odczytać pliku pamięci podręcznej rozwiązań „{0}”. {1} Używanie pliku rozwiązań w sposób bezpośredni. - UE: This is not a true error, so doesn't need an error code. - - Fehler beim Lesen der Projektmappen-Cachedatei "{0}". {1} Projektmappendatei wird direkt verwendet. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Failed to write solution cache file "{0}". {1} - Nie można zapisać pliku pamięci podręcznej rozwiązań „{0}”. {1} - UE: This is not a true error, so doesn't need an error code. - - Fehler beim Schreiben der Projektmappen-Cachedatei "{0}". {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Solution cache file was created for a "{0}" value of "{1}" but the current value is "{2}". Refreshing cache file. - Plik pamięci podręcznej rozwiązań został utworzony dla wartości „{0}” równej „{1}”, ale bieżąca wartość jest równa „{2}”. Odświeżanie pliku pamięci podręcznej. - UE: This is not an error, so doesn't need an error code. - - Die Projektmappen-Cachedatei wurde für den {0}-Wert "{1}" erstellt, aber der aktuelle Wert ist "{2}". Cachedatei wird aktualisiert. - - fuzzyMatch="100" wordcount="20" adjWordcount="5" curWordcount="5" tmLabel="N''" - - - Solution cache file has an internal version number "{0}" but the current value is "{1}". Refreshing cache file. - Plik pamięci podręcznej rozwiązań ma wewnętrzny numer wersji „{0}”, ale bieżącą wartością jest „{1}”. Odświeżanie pliku pamięci podręcznej. - UE: This is not an error, so doesn't need an error code. - - Die Projektmappen-Cachedatei hat die interne Versionsnummer "{0}", der aktuelle Wert ist aber "{1}". Cachedatei wird aktualisiert. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - Solution cache file is out of date. Refreshing cache file. {0} - Plik pamięci podręcznej rozwiązań jest nieaktualny. Odświeżanie pliku pamięci podręcznej. {0} - UE: This is not an error, so doesn't need an error code. - - Die Projektmappen-Cachedatei ist veraltet. Cachedatei wird aktualisiert. {0} - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4160: A circular dependency involving project "{0}" has been detected. - MSB4160: Wykryto zależność cykliczną z udziałem projektu „{0}”. - {StrBegin="MSB4160: "} - - MSB4160: Eine Ringabhängigkeit im Zusammenhang mit dem Projekt "{0}" wurde erkannt. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4126: The specified solution configuration "{0}" is invalid. Please specify a valid solution configuration using the Configuration and Platform properties (e.g. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU") or leave those properties blank to use the default solution configuration. - MSB4126: Określona konfiguracja rozwiązania „{0}” jest nieprawidłowa. Określ prawidłową konfigurację rozwiązania przy użyciu właściwości Configuration i Platform (np. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU") lub pozostaw te właściwości puste, aby użyć domyślnej konfiguracji rozwiązania. - {StrBegin="MSB4126: "}UE: The solution filename is provided separately to loggers. - - MSB4126: Die angegebene Projektmappenkonfiguration "{0}" ist ungültig. Geben Sie mithilfe der Konfigurations- und Plattformeigenschaften eine gültige Projektmappenkonfiguration an (z. B. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU"), oder lassen Sie diese Eigenschaften leer, sodass die Standardprojektmappenkonfiguration verwendet wird. - - fuzzyMatch="101" wordcount="37" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4046: Error reading project file "{0}": {1} - MSB4046: Błąd podczas odczytu pliku projektu „{0}”: {1} - {StrBegin="MSB4046: "} - - MSB4046: Fehler beim Lesen der Projektdatei "{0}": {1} - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4125: The project file name "{0}" is invalid. {1} - MSB4125: Nazwa pliku projektu „{0}” jest nieprawidłowa. {1} - {StrBegin="MSB4125: "}UE: The solution filename is provided separately to loggers. - - MSB4125: Der Projektdateiname "{0}" ist ungültig. {1} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4051: Project {0} is referencing a project with GUID {1}, but a project with this GUID was not found in the .SLN file. - MSB4051: Projekt {0} odwołuje się do projektu o identyfikatorze GUID {1}, ale projekt o tym identyfikatorze GUID nie został odnaleziony w pliku SLN. - {StrBegin="MSB4051: "}UE: The solution filename is provided separately to loggers. - - MSB4051: Das Projekt "{0}" verweist auf ein Projekt mit der GUID {1}, in der SLN-Datei wurde jedoch kein Projekt mit dieser GUID gefunden. - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - MSB4078: The project file "{0}" is not supported by MSBuild and cannot be built. - MSB4078: Plik projektu „{0}” nie jest obsługiwany przez program MSBuild i nie można go skompilować. - {StrBegin="MSB4078: "} - - MSB4078: Die Projektdatei "{0}" wird nicht von MSBuild unterstützt und kann nicht erstellt werden. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4054: The solution file must be opened in the Visual Studio IDE and converted to the latest version before it can be built by MSBuild. - MSB4054: Plik rozwiązania należy otworzyć w programie Visual Studio IDE i przekonwertować na najnowszą wersję, zanim będzie go można skompilować za pomocą programu MSBuild. - {StrBegin="MSB4054: "}UE: The solution filename is provided separately to loggers. - - MSB4054: Die Projektmappendatei muss in der Visual Studio IDE geöffnet und in die neuste Version konvertiert werden, bevor sie mit MSBuild erstellt werden kann. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4121: The project configuration for project "{0}" was not specified in the solution file for the solution configuration "{1}". - MSB4121: Konfiguracja projektu „{0}” nie została określona w pliku rozwiązania dla konfiguracji rozwiązania „{1}”. - {StrBegin="MSB4121: "} - - MSB4121: Die Projektkonfiguration für das Projekt "{0}" wurde nicht in der Projektmappendatei für die Projektmappenkonfiguration "{1}" angegeben. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - The project "{0}" is not selected for building in solution configuration "{1}". - Projekt „{0}” nie został wybrany do skompilowania w konfiguracji rozwiązania „{1}”. - - UE: This is not an error, so doesn't need an error code. - - - Das Projekt "{0}" ist in der Projektmappenkonfiguration "{1}" nicht zum Erstellen ausgewählt. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4122: Scanning project dependencies for project "{0}" failed. {1} - MSB4122: Skanowanie zależności projektu „{0}” nie powiodło się. {1} - {StrBegin="MSB4122: "} - - MSB4122: Fehler beim Überprüfen der Projektabhängigkeiten für Projekt "{0}". {1} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4149: The tools version "{0}" of the solution does not support building projects with a different tools version. - MSB4149: Wersja narzędzi „{0}” rozwiązania nie obsługuje kompilowania projektów przy użyciu innej wersji narzędzi. - {StrBegin="MSB4149: "} - - MSB4149: Die Toolsversion {0} der Projektmappe unterstützt das Erstellen von Projekten mit unterschiedlichen Toolsversionen nicht. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - Web projects do not support the "Clean" target. Continuing with remaining projects ... - Projekty sieci Web nie obsługują elementu docelowego „Clean”. Trwa kontynuowanie pozostałych projektów... - UE: This is not an error, so doesn't need an error code. - LOCALIZATION: Do not localize "Clean". - - Webprojekte unterstützen das Clean-Ziel nicht. Verbleibende Projekte werden fortgesetzt... - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Web projects do not support the "Publish" target. Continuing with remaining projects ... - Projekty internetowe nie obsługują elementu docelowego „Publish”. Trwa kontynuowanie pozostałych projektów... - UE: This is not an error, so doesn't need an error code. - LOCALIZATION: Do not localize "Publish". - - Webprojekte unterstützen das Publish-Ziel nicht. Verbleibende Projekte werden fortgesetzt... - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Skipping because the "$(AspNetConfiguration)" configuration is not supported for this web project. You can use the AspNetConfiguration property to override the configuration used for building web projects, by adding /p:AspNetConfiguration=<value> to the command line. Currently web projects only support Debug and Release configurations. - Trwa pomijanie, ponieważ konfiguracja „$(AspNetConfiguration)” nie jest obsługiwana w tym projekcie sieci Web. Można za pomocą właściwości AspNetConfiguration przesłonić konfigurację używaną do tworzenia projektów sieci Web, dodając parametr /p:AspNetConfiguration=<value> do wiersza polecenia. Obecnie projekty sieci Web obsługują tylko konfiguracje Debug i Release. - - UE: This is not an error, so doesn't need an error code. - LOCALIZATION: Do NOT localize "AspNetConfiguration", "Debug", "Release". - - - Da der "$(AspNetConfiguration)" Konfiguration für dieses Webprojekt nicht unterstützt. Verwenden die AspNetConfiguration-Eigenschaft die Konfiguration zum Erstellen von Webprojekten hinzufügen/p: AspNetConfiguration überschreiben = < Wert > in der Befehlszeile. Aktuell unterstützen Webprojekte nur Debug- und Releasekonfigurationen. - - fuzzyMatch="15" wordcount="44" adjWordcount="37.4" curWordcount="37.4" - - - MSB4076: VC projects do not support the "Publish" target. - MSB4076: Projekty VC nie obsługują elementu docelowego „Publish”. - {StrBegin="MSB4076: "}LOCALIZATION: Do not localize "Publish". - - MSB4076: VC-Projekte unterstützen nicht das Publish-Ziel. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4098: MSBuild is invoking VCBuild to build this project. Project-to-project references between VC++ projects (.VCPROJ) and C#/VB/VJ# projects (.CSPROJ, .VBPROJ, .VJSPROJ) are not supported by the command-line build systems when building stand-alone VC++ projects. Projects that contain such project-to-project references will fail to build. Please build the solution file containing this project instead. - MSB4098: Program MSBuild wywołuje program VCBuild w celu skompilowania tego projektu. Odwołania między projektami VC++ (VCPROJ) a projektami C#/VB/VJ# (CSPROJ, VBPROJ, VJSPROJ) nie są obsługiwane przez systemy z wierszem polecenia podczas tworzenia autonomicznych projektów VC++. Projekty zawierające takie odwołania nie będą kompilowane. Zamiast tego skompiluj plik rozwiązania zawierający ten projekt. - {StrBegin="MSB4098: "} - - MSB4098: MSBuild ruft zum Erstellen dieses Projekts VCBuild auf. Interprojektverweise zwischen VC++-Projekten (.VCPROJ) und C#-/VB-/VJ#-Projekten (.CSPROJ, .VBPROJ, .VJSPROJ) werden beim Erstellen eigenständiger VC++-Projekte von den Befehlszeilen-Buildsystemen nicht unterstützt. Projekte, die solche Interprojektverweise enthalten, werden nicht erstellt. Erstellen Sie stattdessen die Projektmappendatei, die dieses Projekt enthält. - - fuzzyMatch="101" wordcount="53" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4056: The MSBuild engine must be called on a single-threaded-apartment. Current threading model is "{0}". Proceeding, but some tasks may not function correctly. - MSB4056: Aparat MSBuild należy wywołać w apartamencie wątku pojedynczego. Bieżący model wątkowości to „{0}”. Nastąpi kontynuacja, ale niektóre zadania mogą nie działać poprawnie. - {StrBegin="MSB4056: "} - - MSB4056: Das MSBuild-Modul muss in einem Singlethread-Apartment aufgerufen werden. Das aktuelle Threadmodell ist {0}. Der Vorgang wird fortgesetzt, aber einige Aufgaben werden möglicherweise nicht ordnungsgemäß ausgeführt. - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - Schema validation - Walidacja schematu - UE: this fragment is used to describe errors that are caused by schema validation. For example, if a normal error is - displayed like this: "MSBUILD : error MSB0000: This is an error.", then an error from schema validation would look like this: - "MSBUILD : Schema validation error MSB0000: This is an error." - LOCALIZATION: This fragment needs to be localized. - - Schemavalidierung - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Target "{0}" skipped. Previously built unsuccessfully. - Pominięto element docelowy „{0}”. Wcześniejsza kompilacja nie powiodła się. - - - Das Ziel "{0}" wurde übersprungen. Die vorherige Erstellung war nicht erfolgreich. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Target "{0}" skipped. Previously built successfully. - Pominięto element docelowy „{0}”. Wcześniejsza kompilacja powiodła się. - - - Das Ziel "{0}" wurde übersprungen. Die vorherige Erstellung war erfolgreich. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4116: The condition "{1}" on the "{0}" target has a reference to item metadata. References to item metadata are not allowed in target conditions unless they are part of an item transform. - MSB4116: Warunek „{1}” w elemencie docelowym „{0}” zawiera odwołanie do metadanych elementu. Odwołania do metadanych elementu nie są dozwolone w warunkach elementów docelowych, o ile nie są częścią przekształcenia elementu. - {StrBegin="MSB4116: "} - - MSB4116: Die Bedingung "{1}" des {0}-Ziels enthält einen Verweis auf Elementmetadaten. Verweise auf Elementmetadaten sind in Zielbedingungen nicht zulässig, es sei denn, sie sind Teil einer Elementtransformation. - - fuzzyMatch="101" wordcount="32" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4057: The target "{0}" does not exist in the project. - MSB4057: Element docelowy „{0}” nie istnieje w projekcie. - {StrBegin="MSB4057: "} - - MSB4057: Das Ziel "{0}" ist im Projekt nicht vorhanden. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - Done building target "{0}" in project "{1}" -- FAILED. - Wykonano kompilowanie elementu docelowego „{0}” w projekcie „{1}” — NIEPOWODZENIE. - - - Erstellen des {0}-Ziels in Projekt {1} beendet - Fehler beim Erstellen. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Done building target "{0}" in project "{1}". - Wykonano kompilowanie elementu docelowego „{0}” w projekcie „{1}”. - - - Die Erstellung des Ziels "{0}" im Projekt "{1}" ist abgeschlossen. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - {0}: (TargetId:{1}) - {0}: (identyfikator elementu docelowego: {1}) - - - {0}: (Ziel-ID:{1}) - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4058: The "{0}" target is missing its output specification. If a target declares inputs, it must also declare outputs. - MSB4058: W elemencie docelowym „{0}” brakuje specyfikacji wyjściowej. Jeśli element docelowy deklaruje dane wejściowe, musi również deklarować dane wyjściowe. - {StrBegin="MSB4058: "} - - MSB4058: Das {0}-Ziel enthält keine Ausgabespezifikation. Wenn ein Ziel Eingaben deklariert, muss es auch Ausgaben deklarieren. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4168: The item "{0}" of type "{1}" does not define a value for the metadata in the expression "{2}". This expression is used in the target output for target "{3}". If a target declares outputs that are transforms, all items in the transform must have a value for the metadata in the transform. - MSB4168: Element „{0}” typu „{1}” nie definiuje wartości metadanych w wyrażeniu „{2}”. To wyrażenie jest używane w danych wyjściowych elementu docelowego „{3}”. Jeśli element docelowy deklaruje dane wyjściowe, które są przekształceniami, wszystkie elementy w przekształceniu muszą mieć wartość odpowiadające metadanym w przekształceniu. - {StrBegin="MSB4168: "} - - MSB4168: Das Element "{0}" vom Typ "{1}" definiert keinen Wert für die Metadaten im Ausdruck "{2}". Dieser Ausdruck wird in der Zielausgabe für "{3}" verwendet. Wenn ein Ziel Ausgaben deklariert, bei denen es sich um Transformationen handelt, müssen alle Elemente in der Transformation einen Wert für die in der Transformation enthaltenen Metadaten aufweisen. - - fuzzyMatch="101" wordcount="53" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Target Performance Summary: - Podsumowanie wydajności elementu docelowego: - - - Leistungszusammenfassung für das Ziel: - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Target "{0}" skipped, due to false condition; ({1}) was evaluated as ({2}). - Pominięto element docelowy „{0}” z powodu fałszywego warunku; ({1}) oszacowano jako ({2}). - - - Das Ziel "{0}" wurde übersprungen, da die Bedingung "false" war . ({1}) wurde als ({2}) ausgewertet. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Target "{0}" in project "{1}" - Element docelowy „{0}” w projekcie „{1}” - - - {0}-Ziel in {1}-Projekt. - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Target {0}: - Element docelowy {0}: - - - Ziel "{0}": - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Target "{0}" in file "{1}": - Element docelowy „{0}” w pliku „{1}”: - - - Ziel "{0}" in Datei "{1}": - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Build continuing because "{0}" on the task "{1}" is set to "{2}". - Kompilowanie jest kontynuowane, ponieważ parametr „{0}” w zadaniu „{1}” jest ustawiony na „{2}”. - - - Der Buildvorgang wird fortgesetzt, da {0} in der {1}-Aufgabe auf "{2}" festgelegt ist. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Target {0} from project "{1}": - Element docelowy {0} z projektu „{1}”: - - - Ziel "{0}" aus Projekt "{1}": - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Target "{0}" in file "{1}" from project "{2}": - Element docelowy „{0}” w pliku „{1}” z projektu „{2}”: - - - Ziel "{0}" in Datei "{1}" aus Projekt "{2}": - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4060: The "{0}" task has been declared or used incorrectly, or failed during construction. Check the spelling of the task name and the assembly name. - MSB4060: Zadanie „{0}” zostało niepoprawnie zadeklarowane lub użyte albo jego tworzenie zakończyło się niepowodzeniem. Sprawdź pisownię nazwy zadania i nazwy zestawu. - {StrBegin="MSB4060: "} - - MSB4060: Die {0}-Aufgabe wurde falsch deklariert, falsch verwendet oder konnte bei der Erstellung nicht ausgeführt werden. Überprüfen Sie die Schreibweise des Aufgaben- und des Assemblynamens. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4077: The "{0}" task has been marked with the attribute LoadInSeparateAppDomain, but does not derive from MarshalByRefObject. Check that the task derives from MarshalByRefObject or AppDomainIsolatedTask. - MSB4077: Zadanie „{0}” zostało oznaczone atrybutem LoadInSeparateAppDomain, ale nie pochodzi od obiektu MarshalByRefObject. Sprawdź, czy zadanie pochodzi od obiektu MarshalByRefObject lub zadania AppDomainIsolatedTask. - {StrBegin="MSB4077: "}LOCALIZATION: <LoadInSeparateAppDomain>, <MarshalByRefObject>, <AppDomainIsolatedTask> should not be localized. - - MSB4077: Die Aufgabe "{0}" wurde mit dem LoadInSeparateAppDomain-Attribut markiert, ist jedoch nicht von MarshalByRefObject abgeleitet. Stellen Sie sicher, dass die Aufgabe von MarshalByRefObject oder AppDomainIsolatedTask abgeleitet wird. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Done executing task "{0}" -- FAILED. - Wykonywanie zadania „{0}” zakończone — NIEPOWODZENIE. - - - Die Ausführung von Task "{0}" wurde beendet – FEHLER. - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Done executing task "{0}". - Wykonywanie zadania „{0}” zakończone. - - - Die Ausführung von Task "{0}" wurde beendet. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - {0} (TaskId:{1}) - {0}: (identyfikator zadania: {1}) - - - {0} (Aufgaben-ID: {1}) - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Using "{0}" task from assembly "{1}". - Używanie zadania „{0}” z zestawu „{1}”. - UE: This informational message helps users determine which assemblies their tasks were loaded from. - - Die {0}-Aufgabe aus der {1}-Assembly wird verwendet. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4061: The "{0}" task could not be instantiated from the assembly "{1}". {2} - MSB4061: Nie można utworzyć wystąpienia zadania „{0}” na podstawie zestawu „{1}”. {2} - {StrBegin="MSB4061: "}LOCALIZATION: "{2}" is a localized message from a CLR/FX exception. - - MSB4061: Die {0}-Aufgabe konnte nicht aus der {1}-Assembly instanziiert werden. {2} - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4127: The "{0}" task could not be instantiated from the assembly "{1}". Please verify the task assembly has been built using the same version of the Microsoft.Build.Framework assembly as the one installed on your computer and that your host application is not missing a binding redirect for Microsoft.Build.Framework. {2} - MSB4127: Nie można utworzyć wystąpienia zadania „{0}” na podstawie zestawu „{1}”. Sprawdź, czy zestaw zadania został utworzony za pomocą tej samej wersji zestawu Microsoft.Build.Framework co zainstalowana na komputerze oraz czy w aplikacji hosta nie brakuje przekierowania powiązania dla zestawu Microsoft.Build.Framework. {2} - {StrBegin="MSB4127: "}UE: This message is a specialized version of the TaskInstantiationFailureError message and can probably reuse some of its docs. - LOCALIZATION: "{2}" is a localized message from a CLR/FX exception. Also, Microsoft.Build.Framework should not be localized - - MSB4127: Die "{0}"-Aufgabe konnte nicht aus der "{1}"-Assembly instanziiert werden. Überprüfen Sie, ob die Aufgabenassembly mit der gleichen Version der Microsoft.Build.Framework-Assembly erstellt wurde, die auf Ihrem Computer installiert ist, und dass Ihrer Hostanwendung kein BindingRedirect-Eintrag für Microsoft.Build.Framework fehlt. {2} - - fuzzyMatch="101" wordcount="49" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4062: The "{0}" task could not be loaded from the assembly {1}. {2} Confirm that the <UsingTask> declaration is correct, and that the assembly and all its dependencies are available. - MSB4062: Nie można załadować zadania „{0}” z zestawu {1}. {2} Upewnij się, że deklaracja <UsingTask> jest poprawna oraz że zestaw i wszystkie jego zależności są dostępne. - {StrBegin="MSB4062: "}UE: This message is shown when a task cannot be loaded from its assembly for various reasons e.g. corrupt assembly, - invalid task declaration, disk error, etc. "{2}" contains a message explaining what happened. - LOCALIZATION: "{2}" is a message from the CLR loader and is already localized. Also, <UsingTask> should not be localized. - - MSB4062: Die "{0}" Vorgang konnte nicht aus der Assembly geladen werden {1}. {2} Bestätigen < UsingTask > Erklärung richtig ist und die Assembly und die zugehörigen Dateien verfügbar sind. - - fuzzyMatch="15" wordcount="31" adjWordcount="26.35" curWordcount="26.35" - - - MSB4063: The "{0}" task could not be initialized with its input parameters. {1} - MSB4063: Nie można zainicjować zadania „{0}” przy użyciu jego parametrów wejściowych. {1} - {StrBegin="MSB4063: "} - - MSB4063: Die "{0}"-Aufgabe konnte nicht mit ihren Eingabeparametern initialisiert werden. {1} - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - Task Performance Summary: - Podsumowanie wydajności zadania: - - - Leistungszusammenfassung für die Aufgabe: - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Task "{0}" skipped, due to false condition; ({1}) was evaluated as ({2}). - Pominięto zadanie „{0}” z powodu fałszywego warunku; ({1}) oszacowano jako ({2}). - - - Die {0}-Aufgabe wurde übersprungen, da die Bedingung "false" war . ({1}) wurde als ({2}) ausgewertet. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Task "{0}" - Zadanie „{0}” - - - Task "{0}" - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Time Elapsed {0} - Czas, który upłynął: {0} - - - Verstrichene Zeit {0} - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Building with tools version "{0}". - Kompilowanie przy użyciu wersji narzędzi „{0}”. - - - Erstellung mit der Toolsversion "{0}". - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Project file contains ToolsVersion="{0}". This toolset is unknown or missing. You may be able to resolve this by installing the appropriate .NET Framework for this toolset. Treating the project as if it had ToolsVersion="4.0". - Plik projektu zawiera atrybut ToolsVersion="{0}". Ten zestaw narzędzi jest nieznany lub nieobecny. Być może problem uda się rozwiązać przez zainstalowanie wersji oprogramowania .NET Framework odpowiedniej dla tego zestawu narzędzi. Projekt zostanie potraktowany tak, jakby zawierał parametr ToolsVersion="4.0". - - - Die Projektdatei enthält ToolsVersion="{0}". Dieses Toolset ist nicht bekannt oder nicht vorhanden. Sie können das Problem möglicherweise beheben, indem Sie das entsprechende .NET Framework für dieses Toolset installieren. Das Projekt wird behandelt als enthielte es ToolsVersion="4.0". - - fuzzyMatch="101" wordcount="34" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Deferred Messages - Komunikaty odłożone - - - Zurückgestellte Meldungen - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Some messages did not display because they were not associated with any ProjectStarted events. Use diagnostic verbosity to view these messages. - Niektóre komunikaty nie zostały wyświetlone, ponieważ nie były skojarzone z żadnymi zdarzeniami ProjectStarted. Aby wyświetlić te komunikaty, użyj poziomu szczegółowości diagnostic. - - - Einige Meldungen wurden nicht angezeigt, weil sie keinem ProjectStarted-Ereignis zugeordnet sind. Verwenden Sie den Ausführlichkeitsgrad "diagnostic", um diese Meldungen anzuzeigen. - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - MSB4090: Found an unexpected character '{2}' at position {1} in condition "{0}". - MSB4090: Znaleziono nieoczekiwany znak „{2}” w położeniu {1} w warunku „{0}”. - {StrBegin="MSB4090: "} - - MSB4090: Das unerwartete Zeichen {2} wurde an Position {1} in der {0}-Bedingung gefunden. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4091: Found a call to an undefined function "{1}" in condition "{0}". - MSB4091: Znaleziono wywołanie niezdefiniowanej funkcji „{1}” w warunku „{0}”. - {StrBegin="MSB4091: "} - - MSB4091: Aufruf zu einer undefinierten Funktion "{1}" in Bedingung "{0}" gefunden. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4064: The "{0}" parameter is not supported by the "{1}" task. Verify the parameter exists on the task, and it is a settable public instance property. - MSB4064: Parametr „{0}” nie jest obsługiwany przez zadanie „{1}”. Sprawdź, czy parametr istnieje w zadaniu i czy jest właściwością wystąpienia publicznego, którą można ustawić. - {StrBegin="MSB4064: "} - - MSB4064: Der {0}-Parameter wird von der {1}-Aufgabe nicht unterstützt. Vergewissern Sie sich, dass der Parameter in der Aufgabe vorhanden ist und es sich um eine festlegbare öffentliche Instanzeigenschaft handelt. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4131: The "{0}" parameter is not supported by the "{1}" task. Verify the parameter exists on the task, and it is a gettable public instance property. - MSB4131: Parametr „{0}” nie jest obsługiwany przez zadanie „{1}”. Sprawdź, czy parametr istnieje w zadaniu i czy jest właściwością wystąpienia publicznego, którą można pobrać. - {StrBegin="MSB4131: "} - - MSB4131: Der {0}-Parameter wird von der {1}-Aufgabe nicht unterstützt. Vergewissern Sie sich, dass der Parameter in der Aufgabe vorhanden ist und es sich um eine abrufbare öffentliche Instanzeigenschaft handelt. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4092: An unexpected token "{1}" was found at character position {2} in condition "{0}". - MSB4092: Znaleziono nieoczekiwany token „{1}” w położeniu znaku {2} w warunku „{0}”. - {StrBegin="MSB4092: "} - - MSB4092: Ein unerwartetes Token "{1}" wurde an Zeichenposition "{2}" in Bedingung "{0}" gefunden. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4065: The "{0}" parameter is not marked for output by the "{1}" task. - MSB4065: Parametr „{0}” nie został oznaczony do wyprowadzenia przez zadanie „{1}”. - {StrBegin="MSB4065: "} - - MSB4065: Der {0}-Parameter ist nicht für die Ausgabe durch die {1}-Aufgabe markiert. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4066: The attribute "{0}" in element <{1}> is unrecognized. - MSB4066: Atrybut „{0}” w elemencie <{1}> nie został rozpoznany. - {StrBegin="MSB4066: "} - - MSB4066: Das Attribut "{0}" im Element <{1}> wurde nicht erkannt. - - fuzzyMatch="15" wordcount="10" adjWordcount="8.5" curWordcount="8.5" - - - MSB4067: The element <{0}> beneath element <{1}> is unrecognized. - MSB4067: Element <{0}> znajdujący się pod elementem <{1}> nie został rozpoznany. - {StrBegin="MSB4067: "} - - MSB4067: Das Element <{0}> unter Element <{1}> wurde nicht erkannt. - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB4068: The element <{0}> is unrecognized, or not supported in this context. - MSB4068: Element <{0}> nie został rozpoznany lub jest nieobsługiwany w tym kontekście. - {StrBegin="MSB4068: "} - - MSB4068: Das Element <{0}> ist unbekannt oder in diesem Kontext nicht unterstützt. - - fuzzyMatch="15" wordcount="13" adjWordcount="11.05" curWordcount="11.05" - - - MSB4132: The tools version "{0}" is unrecognized. - MSB4132: Wersja narzędzi „{0}” nie została rozpoznana. - {StrBegin="MSB4132: "} - - MSB4132: Die Toolsversion "{0}" ist unbekannt. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4069: The "{0}" type of the "{1}" parameter of the "{2}" task is not supported by MSBuild. - MSB4069: Typ „{0}” parametru „{1}” zadania „{2}” nie jest obsługiwany przez program MSBuild. - {StrBegin="MSB4069: "}LOCALIZATION: "MSBuild" should not be localized. - - MSB4069: Der {0}-Typ des {1}-Parameters der {2}-Aufgabe wird von MSBuild nicht unterstützt. - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - MSB4072: A <{0}> element must contain either the "{1}" attribute or the "{2}" attribute (but not both). - MSB4072: Element <{0}> musi zawierać atrybut „{1}” lub „{2}” (ale nie oba te atrybuty). - {StrBegin="MSB4072: "} - - MSB4072: Ein <{0}>-Element muss entweder die "{1}" Attribut oder "{2}" Attribut (jedoch nicht beide). - - fuzzyMatch="15" wordcount="18" adjWordcount="15.3" curWordcount="15.3" - - - {0} Warning(s) - Ostrzeżenia: {0} - - - {0} Warnung(en) - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4084: A <When> element may not follow an <Otherwise> element in a <Choose>. - MSB4084: Element <When> nie może następować po elemencie <Otherwise> w elemencie <Choose>. - {StrBegin="MSB4084: "} - - MSB4084: A < >-Element kein Element < Otherwise > < auswählen > folgen. - - fuzzyMatch="15" wordcount="16" adjWordcount="13.6" curWordcount="13.6" - - - Target Name: "{0}" Project Name: "{1}" - Nazwa elementu docelowego: „{0}”, nazwa projektu: „{1}” - - - Zielname: "{0}" Projektname: "{1}" - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Cycle trace: - Ślad cyklu: - - - Schleifenablaufverfolgung: - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4150: Must initialize the console logger using the initialize method before using ApplyParameter - MSB4150: Przed użyciem metody ApplyParameter należy zainicjować rejestratora konsoli za pomocą metody inicjującej. - {StrBegin="MSB4150: "} - - MSB4150: Die Konsolenprotokollierung muss vor der Verwendung von ApplyParameter mithilfe der Initialisierungsmethode initialisiert werden. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4151: An error occurred while building project "{0}", target "{1}". Please see innerException for detailed information. - MSB4151: Wystąpił błąd podczas kompilowania projektu „{0}”, element docelowy „{1}”. Aby uzyskać szczegółowe informacje, zobacz innerException. - {StrBegin="MSB4151: "} - - MSB4151: Fehler beim Erstellen von Projekt "{0}", Ziel "{1}". Ausführliche Informationen finden Sie in der innerException. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB4152: An error occurred on the child node "{0}" and could not be passed to the parent node. {1} - MSB4152: Wystąpił błąd w węźle podrzędnym „{0}” i nie można przekazać go do węzła nadrzędnego. {1} - {StrBegin="MSB4152: "} - - MSB4152: Fehler im untergeordneten Knoten "{0}", der nicht an den übergeordneten Knoten übergeben werden konnte. {1} - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4153: A call is made on an inactive IBuildEngine interface corresponding to a task that already finished execution. - MSB4153: Wywołano nieaktywny interfejs IBuildEngine odpowiadający zadaniu, którego wykonywanie już się zakończyło. - {StrBegin="MSB4153: "} - - MSB4153: Eine inaktive IBuildEngine-Schnittstelle wird aufgerufen, der eine Aufgabe entspricht, deren Ausführung bereits abgeschlossen wurde. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - MSB4154: A forwarding logger is attempting to forward BuildFinished event - MSB4154: Rejestrator przekazujący próbuje przesłać dalej zdarzenie BuildFinished - {StrBegin="MSB4154: "} - - MSB4154: Eine weiterleitende Protokollierung versucht, das BuildFinished-Ereignis weiterzuleiten. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4155: There was an error while communicating with a node. - MSB4155: Wystąpił błąd podczas komunikacji z węzłem. - {StrBegin="MSB4155: "} - - MSB4155: Fehler bei der Kommunikation mit einem Knoten. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB1021: Cannot create an instance of the logger - {0}. - MSB1021: Nie można utworzyć wystąpienia rejestratora — {0}. - {StrBegin="MSB1021: "}The error code for this message is duplicated from MSBuild.exe. - - MSB1021: Eine Instanz der Protokollierung kann nicht erstellt werden - {0}. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB1020: The logger {0} was not found. Check the following: 1.) The logger name specified is the same as the name of the logger class. 2.) The logger class is "public" and implements the Microsoft.Build.Framework.ILogger interface. 3.) The path to the logger assembly is correct, or the logger can be loaded using only the assembly name provided. - MSB1020: Nie można odnaleźć rejestratora {0}. Sprawdź, czy: 1) Określona nazwa rejestratora jest taka sama, jak nazwa klasy rejestratora. 2) Klasą rejestratora jest „public” i czy implementuje ona interfejs Microsoft.Build.Framework.ILogger. 3) Ścieżka do zestawu rejestratora jest poprawna lub rejestrator można załadować przy użyciu tylko podanej nazwy zestawu. - {StrBegin="MSB1020: "}The error code for this message is duplicated from MSBuild.exe. - - MSB1020: Die Protokollierung {0} wurde nicht gefunden. Überprüfen Sie Folgendes: 1.) Der angegebene Name der Protokollierung ist mit dem Namen der Protokollierungsklasse identisch. 2.) Die Protokollierungsklasse ist "public" und implementiert die Microsoft.Build.Framework.ILogger-Schnittstelle. 3.) Der Pfad zur Protokollierungsassembly ist richtig, bzw. die Protokollierung kann alleine mithilfe des angegebenen Assemblynamens geladen werden. - - fuzzyMatch="101" wordcount="57" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4156: A forwarding logger is attempting to forward BuildStarted event - MSB4156: Rejestrator przekazujący próbuje przesłać dalej zdarzenie BuildStarted - {StrBegin="MSB4156: "} - - MSB4156: Eine weiterleitende Protokollierung versucht, das BuildStarted-Ereignis weiterzuleiten. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - "{0}" ({1} target) ({2}) -> - „{0}” (element docelowy {1}) ({2}) -> - - - "{0}" ({1} target) ({2}) -> - - fuzzyMatch="15" wordcount="5" adjWordcount="4.25" curWordcount="4.25" - - - "{0}" (default target) ({1}) -> - „{0}” (domyślny element docelowy) ({1})-> - - - "{0}" (Standardziel) ({1}) -> - - fuzzyMatch="15" wordcount="5" adjWordcount="4.25" curWordcount="4.25" - - - {0} {1,5} - {0} {1,5} - - - {0} {1,5} - - fuzzyMatch="15" wordcount="2" adjWordcount="1.7" curWordcount="1.7" - - - Project "{0}" on node {1} ({2} target(s)). - Projekt „{0}” w węźle {1} (elementy docelowe: {2}). - - - Projekt "{0}" auf Knoten "{1}", {2} Ziel(e). - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Project "{0}" on node {1} (default targets). - Projekt „{0}” w węźle {1} (domyślne elementy docelowe). - - - Projekt "{0}" auf Knoten "{1}" (Standardziele). - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Project "{0}" ({1}) is building "{2}" ({3}) on node {4} ({5} target(s)). - Projekt „{0}” ({1}) kompiluje „{2}” ({3}) w węźle {4} (elementy docelowe: {5}). - - - Das Projekt "{0}" ({1}) erstellt "{2}" ({3}) auf Knoten "{4}", {5} Ziel(e). - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Project "{0}" ({1}) is building "{2}" ({3}) on node {4} (default targets). - Projekt „{0}” ({1}) kompiluje „{2}” ({3}) w węźle {4} (domyślne elementy docelowe). - - - Das Projekt "{0}" ({1}) erstellt "{2}" ({3}) auf Knoten "{4}" (Standardziele). - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - ({0} target) -> - (element docelowy {0}) -> - - - ({0} Ziel) -> - - fuzzyMatch="15" wordcount="3" adjWordcount="2.55" curWordcount="2.55" - - - MSB4157: The array of project files needs to contain at least one value. - MSB4157: Tablica plików projektu musi zawierać co najmniej jedną wartość. - {StrBegin="MSB4157: "} - - MSB4157: Das Array der Projektdateien muss mindestens einen Wert enthalten. - - fuzzyMatch="15" wordcount="13" adjWordcount="11.05" curWordcount="11.05" - - - MSB4158: The project file name at element {0} is empty. - MSB4158: Nazwa pliku projektu w elemencie {0} jest pusta. - {StrBegin="MSB4158: "} - - MSB4158: Der Projektdateiname bei Element {0} ist leer. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - The property "{0}" with value "{1}" is being overridden by another batch. The property is now: "{2}" - Właściwość „{0}” o wartości „{1}” jest zastępowana przez inny proces wsadowy. Obecnie właściwość to „{2}”. - - - Die Eigenschaft "{0}" mit dem Wert "{1}" wird von einem anderen Batch überschrieben. Die Eigenschaft ist jetzt: "{2}" - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - Please see inner exception for error information. - Aby uzyskać informacje o błędzie, zobacz wyjątek wewnętrzny. - - - Fehlerinformationen finden Sie in der internen Ausnahme. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Event type "{0}" was expected to be serializable. The event was not serializable and has been ignored. - Typ zdarzenia „{0}” miał być możliwy do serializacji. Serializacja zdarzenia nie była możliwa i element został zignorowany. - - - Es wurde erwartet, dass der Typ "{0}" serialisierbar ist. Das Ereignis war nicht serialisierbar und wurde ignoriert. - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - The log file path cannot be null or empty. - Ścieżka pliku dziennika nie może być zerowa ani pusta. - - - Der Protokolldateipfad darf nicht NULL oder leer sein. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4161: Project "{0}" was loaded and unloaded during the current build. Reloading a project during the build can result in errors or an inconsistent build state. Either avoid unloading project "{0}" or cache the evaluation results of target(s) "{1}" before unloading the project. - MSB4161: Projekt „{0}” został załadowany i zwolniony podczas bieżącej kompilacji. Ponowne załadowanie projektu podczas kompilacji może spowodować błędy lub niespójny stan kompilacji. Unikaj zwalniania projektu „{0}” lub zachowaj w pamięci podręcznej wyniki szacowania elementów docelowych „{1}” przed zwolnieniem projektu. - {StrBegin="MSB4161: "} - - MSB4161: Das Projekt "{0}" wurde während der aktuellen Erstellung geladen und entladen. Das erneute Laden eines Projekts während der Erstellung kann zu Fehlern oder einem nicht konsistenten Buildzustand führen. Vermeiden Sie entweder das Entladen des Projekts "{0}", oder speichern Sie die Auswertungsergebnisse der Ziele "{1}" vor dem Entladen des Projekts im Cache. - - fuzzyMatch="101" wordcount="43" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - [default] - [domyślne] - - - [Standard] - - fuzzyMatch="100" wordcount="1" adjWordcount="0.25" curWordcount="0.25" tmLabel="N''" - - -
-
\ No newline at end of file diff --git a/src/Deprecated/Engine/Resources/xlf/Strings.pt-BR.xlf b/src/Deprecated/Engine/Resources/xlf/Strings.pt-BR.xlf deleted file mode 100644 index 7a3f61619d2..00000000000 --- a/src/Deprecated/Engine/Resources/xlf/Strings.pt-BR.xlf +++ /dev/null @@ -1,2674 +0,0 @@ - - - -
- - 4013 - 1176.8 - 1176.8 - 0 - 0 - - - 0 - 981 - 2334 - 0 - 0 - 698 - 0 - -
- - - MSB4001: The "{0}" task has more than one parameter called "{1}". - MSB4001: A tarefa "{0}" tem mais de um parâmetro denominado "{1}". - {StrBegin="MSB4001: "}UE: This message is shown when a task has more than one .NET property with the same name -- it's unclear which of - those properties the task wants to use as a parameter in project files. - - MSB4001: Die {0}-Aufgabe enthält mehrere Parameter mit dem Namen "{1}". - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4081: The value "{0}" of the "ItemName" attribute in element <Output> contains an "@" character. If you intended to use an item name then remove the @( ) around the item name. - MSB4081: O valor "{0}" do atributo "ItemName" no elemento <Output> contém um caractere "@". Se você pretende usar um nome de item, remova o caractere @( ) em torno do nome de item. - {StrBegin="MSB4081: "}UE: This message is shown when an output tag has an itemname that contains an @. They probably typed @(foo) instead of foo in the ItemName.LOCALIZATION: Output and ItemName should not be localized. - - MSB4081: Der Wert "{0}" "ItemName-Attribut im Element < Output > enthält ein" @"Zeichen. Soll ein Elementname verwenden und entfernen dann die @ (), um den Namen des Elements. - - fuzzyMatch="15" wordcount="30" adjWordcount="25.5" curWordcount="25.5" - - - MSB4002: There was a failure retrieving the attributes for parameters in the "{0}" task. {1} - MSB4002: Houve uma falha ao recuperar os atributos dos parâmetros na tarefa "{0}". {1} - {StrBegin="MSB4002: "}UE: This message is shown when the .NET attributes that a task's .NET properties are decorated with, cannot be - retrieved -- this is typically because the .NET classes that define the .NET attributes cannot be loaded because the assembly - they are defined in cannot be found, or the classes themselves cannot be found. - - MSB4002: Fehler beim Abrufen der Attribute für Parameter in der {0}-Aufgabe. {1} - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - MSB4003: "{0}" is a reserved attribute of the <{1}> element, and must be spelled with the correct casing. This attribute cannot be used as a parameter to the "{2}" task. - MSB4003: "{0}" é um atributo reservado do elemento <{1}> e deve ser escrito com o uso correto de maiúsculas e minúsculas. Esse atributo não pode ser usado como um parâmetro da tarefa "{2}". - {StrBegin="MSB4003: "}UE: Tasks are not allowed to use incorrect case for reserved attributes on the task nodes e.g. "continueonerror" - instead of the "ContinueOnError". - - MSB4003: "{0}" ist ein reserviertes Attribut der <{1}>-Element und mit der richtigen Groß-/Kleinschreibung geschrieben werden muss. Dieses Attribut kann nicht verwendet werden, als Parameter an die "{2}" Aufgabe. - - fuzzyMatch="15" wordcount="31" adjWordcount="26.35" curWordcount="26.35" - - - The "REQUESTBATCHSIZE" must be a number greater than 1. "{0}" is an invalid value. The value 10 will be used instead. - O "REQUESTBATCHSIZE" deve ser um número maior do que 1. "{0}" é um valor inválido. O valor 10 será usado. - The name "REQUESTBATCHSIZE" is an environment variable - - Die "REQUESTBATCHSIZE" muss eine Zahl größer als 1 sein. "{0}" ist ein ungültiger Wert. Der Wert 10 wird stattdessen verwendet. - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - Build completed in {0}. - Compilação concluída em {0}. - - - Das Erstellen wurde in {0} beendet. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - Build FAILED. - FALHA da compilação. - - - Fehler beim Buildvorgang. - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Build succeeded. - Compilação com êxito. - - - Buildvorgang erfolgreich. - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Build started. - Compilação iniciada. - - - Der Buildvorgang wurde gestartet. - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Build started {0}. - Compilação de {0} iniciada. - - - Der Buildvorgang wurde am {0} gestartet. - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Building target "{0}" completely. - Compilação de destino "{0}" concluída. - {0} is the name of the target. - - Das Ziel "{0}" wird vollständig erstellt. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - No input files were specified. - Não há arquivos de entrada especificados. - - - Es wurden keine Eingabedateien angegeben. - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Input file "{0}" is newer than output file "{1}". - O arquivo de entrada "{0}" é mais recente do que o arquivo de saída "{1}". - {0} and {1} are filenames on disk. - - Die Eingabedatei "{0}" ist neuer als die Ausgabedatei "{1}". - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - Output file "{0}" does not exist. - O arquivo de saída "{0}" não existe. - {0} is a filename on disk. - - Die Ausgabedatei "{0}" ist nicht vorhanden. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Input file "{0}" does not exist. - O arquivo de entrada "{0}" não existe. - {0} is a filename on disk. - - Die Eingabedatei "{0}" ist nicht vorhanden. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Building target "{0}" partially, because some output files are out of date with respect to their input files. - Compilando o destino "{0}" parcialmente, pois alguns arquivos de saída estão desatualizados em relação aos arquivos de entrada. - {0} is the name of the target. - - Das Ziel "{0}" wird teilweise erstellt, da einige Ausgabedateien hinsichtlich ihrer Eingabedateien veraltet sind. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - [{0}: Input={1}, Output={2}] Input file is newer than output file. - [{0}: Input={1}, Output={2}] O arquivo de entrada é mais recente do que o arquivo de saída. - {0} is the name of an MSBuild item. {1} and {2} are filenames on disk. - - [{0}: Eingabe={1}, Ausgabe={2}] Die Eingabedatei ist neuer als die Ausgabedatei. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - [{0}: Input={1}, Output={2}] Output file does not exist. - [{0}: Input={1}, Output={2}] O arquivo de saída não existe. - {0} is the name of an MSBuild item. {1} and {2} are filenames on disk. - - [{0}: Eingabe={1}, Ausgabe={2}] Die Ausgabedatei ist nicht vorhanden. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - [{0}: Input={1}, Output={2}] Input file does not exist. - [{0}: Input={1}, Output={2}] O arquivo de entrada não existe. - {0} is the name of an MSBuild item. {1} and {2} are filenames on disk. - - [{0}: Eingabe={1}, Ausgabe={2}] Die Eingabedatei ist nicht vorhanden. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - The attribute "{0}" is a known MSBuild attribute, and cannot be accessed using this method. - O atributo "{0}" é conhecido como atributo do MSBuild, e não pode ser acessado com este método. - - - Das {0}-Attribut ist ein bekanntes MSBuild-Attribut, auf das mithilfe dieser Methode nicht zugegriffen werden kann. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - Properties in persisted property groups cannot be accessed by name. - As propriedades em grupos de propriedades persistentes não podem ser acessadas pelo nome. - - - Auf Eigenschaften in persistenten Eigenschaftengruppen ist kein Zugriff über den Namen möglich. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4023: Cannot evaluate the item metadata "%({0})". {1} - MSB4023: Não é possível avaliar o metadados do item "%({0})". {1} - {StrBegin="MSB4023: "}UE: This message is shown when the value of an item metadata cannot be computed for some reason e.g. trying to apply - %(RootDir) to an item-spec that's not a valid path, would result in this error. - LOCALIZATION: "{1}" is a localized message explaining the problem. - - MSB4023: Elementmetadaten "%({0})" können nicht ausgewertet werden. {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Cannot execute a task not associated with a project object. - Não é possível executar uma tarefa que não esteja associada a um objeto de projeto. - - - Eine Aufgabe, die keinem Projektobjekt zugeordnet ist, kann nicht ausgeführt werden. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - The cache entry has already been set to a different value and cannot be modified. - A entrada do cache já foi definida em um valor diferente e não pode ser modificada. - - - Der Cacheeintrag wurde bereits auf einen anderen Wert festgelegt und kann nicht geändert werden. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - The "{0}" property comes from an environment variable, and cannot be modified. - A propriedade "{0}" vem de uma variável de ambiente e não pode ser modificada. - - - Die {0}-Eigenschaft stammt aus einer Umgebungsvariablen und kann nicht geändert werden. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - The "{0}" property is a global property, and cannot be modified through an evaluated property group. Use "{1}" instead. - A propriedade "{0}" é global e não pode ser modificada através de um grupo de propriedades avaliadas. Use "{1}". - - - Die {0}-Eigenschaft ist eine globale Eigenschaft und kann nicht über eine ausgewertete Eigenschaftengruppe geändert werden. Verwenden Sie stattdessen {1}. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - Modifying the XML of an imported project file is not allowed. Open that project file directly. - Não é permitido modificar o XML de um arquivo de projeto importado. Abra o arquivo de projeto diretamente. - - - Der XML-Code einer importierten Projektdatei darf nicht geändert werden. Öffnen Sie diese Projektdatei direkt. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB4117: The "{0}" item name is reserved, and cannot be used. - MSB4117: O nome de item "{0}" é reservado e não pode ser usado. - {StrBegin="MSB4117: "}UE: This message is shown when the user tries to redefine one of the reserved MSBuild items e.g. @(Choose) - - MSB4117: Der Elementname "{0}" ist reserviert und kann nicht verwendet werden. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4118: The "{0}" item metadata name is reserved, and cannot be used. - MSB4118: O nome de metadados de item "{0}" é reservado e não pode ser usado. - {StrBegin="MSB4118: "}UE: This message is shown when the user tries to redefine one of the reserved MSBuild items e.g. @(Choose) - - MSB4118: Der Elementmetadatenname "{0}" ist reserviert und kann nicht verwendet werden. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4004: The "{0}" property is reserved, and cannot be modified. - MSB4004: A propriedade "{0}" é reservada e não pode ser modificada. - {StrBegin="MSB4004: "}UE: This message is shown when the user tries to redefine one of the reserved MSBuild properties e.g. $(MSBuildProjectFile) - - MSB4004: Die {0}-Eigenschaft ist reserviert und kann nicht geändert werden. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4094: "{0}" is an invalid value for the "{1}" parameter of the "{3}" task. Multiple items cannot be passed into a parameter of type "{2}". - MSB4094: "{0}" é um valor inválido para o parâmetro "{1}" da tarefa "{3}". Não é possível passar vários itens para um parâmetro do tipo "{2}". - {StrBegin="MSB4094: "} - UE: This error is shown when a project tries to pass multiple items into a task parameter of type ITaskItem (singular). - - - MSB4094: "{0}" ist ein ungültiger Wert für den "{1}"-Parameter der "{3}"-Aufgabe. Mehrere Elemente können nicht in einen Parameter vom Typ "{2}" übergeben werden. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4115: The "{0}" function only accepts a scalar value, but its argument "{1}" evaluates to "{2}" which is not a scalar value. - MSB4115: A função "{0}" aceita somente um valor escalar, mas seu argumento "{1}" é avaliado como "{2}", que não é um valor escalar. - {StrBegin="MSB4115: "} - UE: This error is shown when a project tries to pass multiple items into a function in a conditional expression, that can only accept a scalar value (such as the "exists()" function). - - - MSB4115: Die "{0}"-Funktion nimmt nur einen Skalarwert an, ihr "{1}"-Argument wird jedoch zu "{2}" ausgewertet, bei dem es sich nicht um einen Skalarwert handelt. - - fuzzyMatch="100" wordcount="22" adjWordcount="5.5" curWordcount="5.5" tmLabel="N''" - - - The task is currently associated with a project object, and should not be added to a different one. - A tarefa já está associada a um objeto de projeto e não deve ser adicionada a um outro diferente. - - - Die Aufgabe ist derzeit einem Projektobjekt zugeordnet und sollte zu keinem anderen Projektobjekt hinzugefügt werden. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - MSB4095: The item metadata %({0}) is being referenced without an item name. Specify the item name by using %(itemname.{0}). - MSB4095: Os metadados de item %({0}) estão sendo usados como referência sem um nome de item. Especifique o nome de item usando %(itemname.{0}). - {StrBegin="MSB4095: "} - - MSB4095: Auf die %({0})-Elementmetadaten wird ohne einen Elementnamen verwiesen. Geben Sie den Namen mithilfe von %(itemname.{0}) an. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - The task is not associated with the specified target element collection, and should not be removed from it. - A tarefa não está associada a uma coleção de elementos de destino especificada e não deve ser removida. - - - Die Aufgabe ist nicht der angegebenen Auflistung von Zielelementen zugeordnet und sollte nicht daraus entfernt werden. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - MSB4005: The current working directory could not be restored to {0}. {1} - MSB4005: O diretório de trabalho atual não pôde ser restaurado para {0}. {1} - {StrBegin="MSB4005: "}UE: This message is shown when the current working directory cannot be reset after a build. "{1}" contains a message explaining why. - LOCALIZATION: "{1}" is a message from an CLR/FX exception and is already localized. - - MSB4005: Das aktuelle Arbeitsverzeichnis konnte unter {0} nicht wiederhergestellt werden. {1} - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Cannot set a condition on an object not represented by an XML element in the project file. - Não é possível definir uma condição em um objeto que não esteja representado por um elemento XML no arquivo de projeto. - - - Eine Bedingung kann nicht für ein Objekt festgelegt werden, wenn das Objekt nicht von einem XML-Element in der Projektdatei repräsentiert wird. - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - Cannot set ContinueOnError on an object not represented by an XML element in the project file. - Não é possível definir ContinueOnError em um objeto que não esteja representado por um elemento XML no arquivo de projeto. - - - Das ContinueOnError-Attribut kann nicht für ein Objekt festgelegt werden, wenn das Objekt nicht von einem XML-Element in der Projektdatei repräsentiert wird. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB4134: DefaultToolsVersion cannot be set after a project has been loaded into the Engine. - MSB4134: DefaultToolsVersion não pode ser definido depois que um projeto foi carregado no Engine. - {StrBegin="MSB4134: "} - - MSB4134: DefaultToolsVersion darf nicht festgelegt werden, nachdem ein Projekt in das Modul geladen wurde. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - Assigning the "{0}" attribute on an item that has been evaluated is not allowed. This operation is only allowed on the original persisted item that came directly from the project file. - A atribuição do atributo "{0}" em um item que foi avaliado não é permitida. Essa operação somente é permitida no item persistente original que veio diretamente do arquivo de projeto. - - - Das {0}-Attribut darf nicht einem Element zugewiesen werden, das ausgewertet wurde. Dieser Vorgang ist nur für das ursprüngliche persistente Element zulässig, das direkt aus der Projektdatei stammt. - - fuzzyMatch="101" wordcount="31" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Assigning the "{0}" attribute of a virtual item is not allowed. - A atribuição do atributo "{0}" de um item virtual não é permitida. - - - Das Zuweisen des {0}-Attributs eines virtuellen Elements ist nicht zulässig. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - A property cannot be set while building. - Não é possível definir uma propriedade durante a compilação. - - - Eine Eigenschaft kann nicht während des Erstellens festgelegt werden. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - A property cannot be set to null. - Não é possível definir uma propriedade como nula. - - - Eine Eigenschaft kann nicht auf NULL festgelegt werden. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Cannot get or set parameters on a task not associated with a project object. - Não é possível obter nem definir parâmetros em uma tarefa não associada a um objeto de projeto. - - - Parameter für eine Aufgabe können nicht abgefragt oder festgelegt werden, wenn die Aufgabe keinem Projektobjekt zugeordnet ist. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4162: <{0}> is not valid. Child elements are not allowed below a item remove element. - MSB4162: <{0}> não é válido. Elementos filho não são permitidos abaixo de um elemento de remoção de itens. - {StrBegin="MSB4162: "} - - MSB4162: <{0}> ist ungültig. Untergeordnete Elemente dürfen nicht unter einem Element Element entfernen. - - fuzzyMatch="15" wordcount="16" adjWordcount="13.6" curWordcount="13.6" - - - MSB4166: Child node "{0}" exited prematurely. Shutting down. - MSB4166: o nó filho "{0}" foi encerrado prematuramente. Desligando. - {StrBegin="MSB4166: "} - - MSB4166: Der untergeordnete Knoten "{0}" wurde vorzeitig beendet. Herunterfahren. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4085: A <Choose> must contain at least one <When>. - MSB4085: Um <Choose> deve conter pelo menos um <When>. - {StrBegin="MSB4085: "} - - MSB4085: < auswählen > muss mindestens < Wenn >. - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB4114: <Choose> elements cannot be nested more than {0} levels deep. - MSB4114: Os elementos <Choose> não podem ser aninhados a mais de {0} níveis de profundidade. - {StrBegin="MSB4114: "}UE: This message appears if the project file contains unreasonably nested Choose elements. - LOCALIZATION: Do not localize "Choose" as it is an XML element name. - - MSB4114: < auswählen > Elemente können nicht geschachtelt werden mehr als {0} Ebenen. - - fuzzyMatch="15" wordcount="12" adjWordcount="10.2" curWordcount="10.2" - - - MSB4006: There is a circular dependency in the target dependency graph involving target "{0}". - MSB4006: Há uma dependência circular no elemento gráfico de dependência circular de destino envolvendo o destino "{0}". - {StrBegin="MSB4006: "}UE: This message is shown when the build engine detects a target referenced in a circular manner -- a project cannot - request a target to build itself (perhaps via a chain of other targets). - - MSB4006: Im Zielabhängigkeitsdiagramm besteht eine Ringabhängigkeit im Zusammenhang mit dem Ziel "{0}". - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4086: A numeric comparison was attempted on "{1}" that evaluates to "{2}" instead of a number, in condition "{0}". - MSB4086: Houve uma tentativa de comparação numérica em "{1}", que é avaliada como "{2}" em vez de um número, na condição "{0}". - {StrBegin="MSB4086: "} - - MSB4086: Es wurde versucht, einen numerischen Vergleich für "{1}" auszuführen, der zu "{2}" anstatt zu einer Zahl in Bedingung "{0}" ausgewertet wird. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4007: The clause "{0}", specified in the "{1}" attribute is invalid. - MSB4007: A cláusula "{0}", especificada no atributo "{1}" é inválida. - {StrBegin="MSB4007: "}UE: This message is shown when the Condition on an element is invalid in some way -- e.g. syntax error, unrecognized operator. - - MSB4007: Die im {1}-Attribut festgelegte {0}-Klausel ist ungültig. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4130: The condition "{0}" may have been evaluated incorrectly in an earlier version of MSBuild. Please verify that the order of the AND and OR clauses is written as intended. To avoid this warning, add parentheses to make the evaluation order explicit. - MSB4130: A condição "{0}" pode ter sido avaliada incorretamente em uma versão anterior do MSBuild. Verifique se a ordem das cláusulas AND e OR está gravada da forma desejada. Para evitar este aviso, adicione parênteses para tornar explícita a ordem da avaliação. - {StrBegin="MSB4130: "} - - MSB4130: Die Bedingung "{0}" ist in einer früheren Version von MSBuild möglicherweise fehlerhaft ausgewertet worden. Stellen Sie sicher, dass die AND- und OR-Klauseln in der beabsichtigten Reihenfolge stehen. Damit diese Warnung nicht angezeigt wird, fügen Sie Klammern hinzu, um die Auswertungsreihenfolge explizit anzugeben. - - fuzzyMatch="101" wordcount="42" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4087: Specified condition "{0}" does not evaluate to a boolean. - MSB4087: A condição especificada "{0}" não é avaliada como booliana. - {StrBegin="MSB4087: "} - - MSB4087: Die angegebene {0}-Bedingung wird nicht zu einem booleschen Wert ausgewertet. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4113: Specified condition "{0}" evaluates to "{1}" instead of a boolean. - MSB4113: A condição especificada "{0}" é avaliada como "{1}" em vez de booliana. - {StrBegin="MSB4113: "} - - MSB4113: Die angegebene Bedingung {0} wird zu {1} statt zu einem booleschen Wert ausgewertet. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - {0}, line {1} - {0}, linha {1} - - - {0}, Zeile {1} - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - MSB4136: Error reading the toolset information from the configuration file "{0}". {1} - MSB4136: Erro ao ler as informações do conjunto de ferramentas no arquivo de configuração "{0}". {1} - {StrBegin="MSB4136: "} - - MSB4136: Fehler beim Lesen der Toolsetinformationen aus der Konfigurationsdatei "{0}". {1} - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4008: A conflicting assembly for the task assembly "{0}" has been found at "{1}". - MSB4008: Foi encontrado um assembly conflitante no assembly da tarefa "{0}" em "{1}". - {StrBegin="MSB4008: "}UE: This message is shown when the type/class of a task cannot be resolved uniquely from a single assembly. - - MSB4008: Eine mit der Aufgabenassembly "{0}" in Konflikt stehende Assembly wurde in "{1}" gefunden. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4142: MSBuildToolsPath is not the same as MSBuildBinPath for the ToolsVersion "{0}" defined at "{1}". If both are present they must have the same value. - MSB4142: MSBuildToolsPath não é o mesmo que MSBuildBinPath para ToolsVersion"{0}" definido em "{1}". Se ambos estiverem presentes, deverão ter o mesmo valor. - {StrBegin="MSB4142: "} - - MSB4142: MSBuildToolsPath ist nicht identisch mit MSBuildBinPath für die bei "{1}" definierte ToolsVersion {0}. Wenn beide Pfade vorhanden sind, müssen sie identische Werte haben. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4097: The element <{0}> beneath element <{1}> may not have a custom XML namespace. - MSB4097: Talvez o elemento <{0}> abaixo do elemento <{1}> não tenha um namespace XML personalizado. - {StrBegin="MSB4097: "} - - MSB4097: Das Element <{0}> unter Element <{1}> möglicherweise keinen benutzerdefinierten XML-Namespace. - - fuzzyMatch="15" wordcount="16" adjWordcount="13.6" curWordcount="13.6" - - - MSB4009: The default tasks file could not be successfully loaded. {0} - MSB4009: O arquivo de tarefas padrão não foi carregado com êxito. {0} - {StrBegin="MSB4009: "}UE: This message is shown when one of the default tasks file (*.tasks) located alongside the MSBuild binaries cannot - be opened/parsed. "{0}" contains a message explaining why. The filename itself is not part of the message but is provided - separately to loggers. - LOCALIZATION: "{0}" is a message from some FX method and is already localized. - - MSB4009: Die Standardaufgabendatei konnte nicht geladen werden. {0} - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4010: The "{0}" files could not be successfully loaded from their expected location "{1}". Default tasks will not be available. {2} - MSB4010: Os arquivos "{0}" não foram carregados com êxito da localização esperada "{1}". As tarefas padrão não estarão disponíveis. {2} - {StrBegin="MSB4010: "}UE: This message is shown when the default tasks files that are located alongside the MSBuild binaries cannot be - found, either because they don't exist, or because of lack of permissions. "{2}" contains a message explaining why. - LOCALIZATION: "{2}" is a message from some FX method and is already localized. - - MSB4010: Die {0}-Dateien konnten nicht vom erwarteten Speicherplatz "{1}" geladen werden. Standardaufgaben sind nicht verfügbar. {2} - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - MSB4140: Default tools version is specified in neither the registry nor the configuration file. - MSB4140: A versão das ferramentas padrão não está especifica no registro nem no arquivo de configuração. - {StrBegin="MSB4140: "} - - MSB4140: Die Standardtoolsversion ist weder in der Registrierung noch in der Konfigurationsdatei angegeben. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4133: A default tools version "{0}" was specified, but its definition could not be found. - MSB4133: Uma versão das ferramentas padrão "{0}" estava especificada, mas não foi possível localizar a sua definição. - {StrBegin="MSB4133: "} - - MSB4133: Eine Standardtoolsversion "{0}" wurde angegeben, aber ihre Definition konnte nicht gefunden werden. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - MSB4080: The value "{0}" of the "PropertyName" attribute in element <Output> contains a "$" character. If you intended to use a property name then remove the $( ) around the property name. - MSB4080: O valor "{0}" do atributo "PropertyName" no elemento <Output> contém um caractere "$". Se você pretende usar um nome de propriedade, remova o caractere $( ) em torno do nome de propriedade. - {StrBegin="MSB4080: "}UE: This message is shown when an output tag has an property name that contains an $. They probably typed $(foo) instead of foo in the PropertyName. LOCALIZATION: Output and PropertyName should not be localized. - - MSB4080: Der Wert "{0}" "PropertyName-Attribut im Element < Output >"$"-Zeichen enthält. Wenn Sie auf einen Eigenschaftennamen verwenden und entfernen Sie anschließend die ($), um den Eigenschaftennamen. - - fuzzyMatch="15" wordcount="32" adjWordcount="27.2" curWordcount="27.2" - - - MSB4011: There is a circular reference involving the import of file "{0}". This file may have been imported more than once, or you may have attempted to import the main project file. All except the first instance of this file will be ignored. - MSB4011: Há uma referência circular envolvendo a importação do arquivo "{0}". Talvez esse arquivo tenha sido importado mais de uma vez, ou você tenha tentado importar o arquivo de projeto principal. Todas as instâncias, exceto a primeira, desse arquivo serão ignoradas. - {StrBegin="MSB4011: "} - - MSB4011: Es besteht eine Ringabhängigkeit im Zusammenhang mit dem Import der Datei {0}. Diese Datei wurde unter Umständen mehrmals importiert, oder es wurde versucht, die Hauptprojektdatei zu importieren. Alle außer der ersten Instanz dieser Datei werden ignoriert. - - fuzzyMatch="101" wordcount="43" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4079: The <ProjectExtensions> element occurs more than once. - MSB4079: O elemento <ProjectExtensions> ocorre mais de uma vez. - {StrBegin="MSB4079: "} - - MSB4079: Das Element < ProjectExtensions > tritt mehr als einmal. - - fuzzyMatch="15" wordcount="9" adjWordcount="7.65" curWordcount="7.65" - - - MSB4012: The expression "{0}" cannot be used in this context. Item lists cannot be concatenated with other strings where an item list is expected. Use a semicolon to separate multiple item lists. - MSB4012: A expressão "{0}" não pode ser usada neste contexto. As listas de itens não podem ser concatenadas com outras cadeias de caracteres em que uma lista de itens é esperada. Use ponto e vírgula para separar várias listas de itens. - {StrBegin="MSB4012: "}UE: This message is shown when the user does not properly specify an item list when an item list is expected - e.g. "badprefix@(foo)badsuffix" instead of "prefix; @(foo); suffix" - - MSB4012: Der Ausdruck {0} kann in diesem Kontext nicht verwendet werden. Elementlisten können nicht mit anderen Zeichenfolgen verkettet werden, wenn eine Elementliste erwartet wird. Verwenden Sie ein Semikolon, um mehrere Elementlisten voneinander zu trennen. - - fuzzyMatch="101" wordcount="32" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Need to specify the project file name. - É necessário especificar o nome de arquivo de projeto. - UE: This message is shown when the user calls into the engine to build a project without specifying a filename. - - Geben Sie den Projektdateinamen an. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - end of input - fim de entrada - This is the name of the "EndOfInput" token. It is displayed in quotes as the - unexpected char or token when the end of a conditional was unexpectedly reached. - - Ende der Eingabe - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - The previous error was converted to a warning because the task was called with ContinueOnError=true. - O erro anterior foi convertido em aviso porque a tarefa foi chamada com ContinueOnError=true. - - - Der vorherige Fehler wurde in eine Warnung umgewandelt, da die Aufgabe mit ContinueOnError=true aufgerufen wurde. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - {0} Error(s) - {0} Erro(s) - - - {0} Fehler - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4159: Error creating the toolset "{0}". {1} - MSB4159: Erro ao criar o conjunto de ferramentas "{0}". {1} - {StrBegin="MSB4159: "} - - MSB4159: Fehler beim Erstellen des Toolsets "{0}". {1} - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4146: Cannot evaluate the property expression "{0}" found at "{1}". {2} - MSB4146: Não é possível avaliar a expressão de propriedade "{0}" encontrada em "{1}". {2} - {StrBegin="MSB4146: "} - - MSB4146: Der bei "{1}" gefundene Eigenschaftsausdruck "{0}" kann nicht ausgewertet werden. {2} - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - The <{0}> tag is no longer supported as a child of the <Project> element. Place this tag within a target, and add the name of the target to the "InitialTargets" attribute of the <Project> element. - Não há mais suporte para a marca <{0}> como filho do elemento <Project>. Posicione essa marca dentro de um destino e adicione o nome do destino ao atributo "InitialTargets" do elemento <Project>. - - - Das <{0}>-Tag nicht als untergeordnetes Element des < Project >-Elements unterstützt. Platzieren Sie dieses Tag in einem Ziel und fügen Sie den Namen des Ziels InitialTargets-Attribut des < Project >-Elements hinzu. - - fuzzyMatch="15" wordcount="38" adjWordcount="32.3" curWordcount="32.3" - - - MSB4100: Expected "{0}" to evaluate to a boolean instead of "{1}", in condition "{2}". - MSB4100: "{0}" esperado para ser avaliado como booliano em vez de "{1}", na condição "{2}". - {StrBegin="MSB4100: "} - - MSB4100: Das Ergebnis der Auswertung von {0} war {1}, es wurde jedoch ein boolescher Wert in der {2}-Bedingung erwartet. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4028: The "{0}" task's outputs could not be retrieved from the "{1}" parameter. {2} - MSB4028: As saídas da tarefa "{0}" não foram recuperadas a partir do parâmetro "{1}". {2} - {StrBegin="MSB4028: "} - - MSB4028: Die Ausgaben der {0}-Aufgabe konnten nicht aus dem {1}-Parameter abgerufen werden. {2} - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4014: The build was aborted because of an internal failure. - MSB4014: A compilação foi cancelada devido a um erro interno. - {StrBegin="MSB4014: "}UE: This message is shown when an unhandled exception terminates the build. The cause is most likely a programming - error in the build engine. - - MSB4014: Das Erstellen wurde aufgrund eines internen Fehlers abgebrochen. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4015: The build was aborted because the "{0}" logger failed unexpectedly during shutdown. - MSB4015: A compilação foi cancelada devido à falha inesperada do agente de log "{0}" durante o encerramento. - {StrBegin="MSB4015: "}UE: This message is used for a special exception that is thrown when a logger fails while shutting down (most likely - because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a special - exception to abort the build. - - MSB4015: Das Erstellen wurde abgebrochen, da für die {0}-Protokollierung beim Herunterfahren ein unerwarteter Fehler aufgetreten ist. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4016: The build was aborted because the "{0}" logger failed unexpectedly during initialization. - MSB4016: A compilação foi cancelada devido à falha inesperada do agente de log "{0}" durante a inicialização. - {StrBegin="MSB4016: "}UE: This message is used for a special exception that is thrown when a logger fails while initializing itself (most - likely because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a - special exception to abort the build. - - MSB4016: Das Erstellen wurde abgebrochen, da für die {0}-Protokollierung bei der Initialisierung ein unerwarteter Fehler aufgetreten ist. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4017: The build was aborted because of an unexpected logger failure. - MSB4017: A compilação foi cancelada devido à falha inesperada do agente de log. - {StrBegin="MSB4017: "}UE: This message is used for a special exception that is thrown when a logger fails while logging an event (most - likely because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a - special exception to abort the build. - - MSB4017: Das Erstellen wurde wegen eines unerwarteten Protokollierungsfehlers abgebrochen. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4018: The "{0}" task failed unexpectedly. - MSB4018: Falha inesperada da tarefa "{0}". - {StrBegin="MSB4018: "}UE: This message is shown when a task terminates because of an unhandled exception. The cause is most likely a - programming error in the task; however, it is also possible that the unhandled exception originated in the engine, and was - surfaced through the task when the task called into the engine. - - MSB4018: Unerwarteter Fehler bei der {0}-Aufgabe. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4165: Failed to receive a response from the child node "{0}" in the timeout period "{1}" ms. Shutting down. - MSB4165: falha ao receber uma resposta do nó filho"{0}" no período de tempo limite "{1}" ms. Desligando. - {StrBegin="MSB4165: "} - - MSB4165: Vom untergeordneten Knoten "{0}" wurde innerhalb des Zeitlimits von "{1}" ms keine Antwort empfangen. Herunterfahren. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4088: Condition "{0}" is improperly constructed. - MSB4088: A condição "{0}" foi construída de modo inadequado. - {StrBegin="MSB4088: "} - - MSB4088: Die {0}-Bedingung ist falsch konstruiert. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4105: Found an unexpected character '{2}' at position {1} in condition "{0}". Did you intend to use "=="? - MSB4105: Caractere "{2}" inesperado na posição {1} da condição "{0}". Você pretendia usar "=="? - {StrBegin="MSB4105: "} - - MSB4105: Ein unerwartetes Zeichen {2} wurde an Position {1} in der {0}-Bedingung gefunden. Wollten Sie "==" verwenden? - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - MSB4106: Expected an item list at position {1} in condition "{0}". Did you forget the closing parenthesis? - MSB4106: Lista de itens esperada na posição {1} da condição "{0}". Você se esqueceu de inserir o parêntese de fechamento? - {StrBegin="MSB4106: "} - - MSB4106: Eine Elementliste wurde an Position {1} in Bedingung {0} erwartet. Haben Sie die schließende Klammer vergessen? - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - MSB4107: Expected an item list at position {1} in condition "{0}". Did you forget the opening parenthesis after the '@'? To use a literal '@', use '%40' instead. - MSB4107: Lista de itens esperada na posição {1} da condição "{0}". Você se esqueceu de inserir o parêntese de abertura depois de "@"? Para usar "@" literal, use "%40". - {StrBegin="MSB4107: "} - - MSB4107: Eine Elementliste wurde an Position {1} in Bedingung {0} erwartet. Haben Sie die öffnende Klammer hinter dem Zeichen "@" vergessen? Wenn Sie ein literales "@" verwenden möchten, geben Sie "%40" ein. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4108: Expected an item list at position {1} in condition "{0}". Did you forget to close a quote inside the item list expression? - MSB4108: Lista de itens esperada na posição {1} da condição "{0}". Você se esqueceu de fechar aspas dentro da expressão da lista de itens? - {StrBegin="MSB4108: "} - - MSB4108: Eine Elementliste wurde an Position {1} in Bedingung {0} erwartet. Haben Sie das schließende Anführungszeichen innerhalb des Elementlistenausdrucks vergessen? - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - MSB4109: Expected a property at position {1} in condition "{0}". Did you forget the closing parenthesis? - MSB4109: Propriedade esperada na posição {1} da condição "{0}". Você se esqueceu de inserir o parêntese de fechamento? - {StrBegin="MSB4109: "} - - MSB4109: Eine Eigenschaft wurde an Position {1} in Bedingung {0} erwartet. Haben Sie die schließende Klammer vergessen? - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB4110: Expected a property at position {1} in condition "{0}". Did you forget the opening parenthesis after the '$'? To use a literal '$', use '%24' instead. - MSB4110: Propriedade esperada na posição {1} da condição "{0}". Você se esqueceu de inserir o parêntese de abertura depois do caractere "$"? Para usar um "$" literal, use "%24". - {StrBegin="MSB4110: "} - - MSB4110: Eine Eigenschaft wurde an Position {1} in Bedingung {0} erwartet. Haben Sie die öffnende Klammer hinter dem Zeichen "$" vergessen? Wenn Sie eine literales "$" verwenden möchten, geben Sie "%24" ein. - - fuzzyMatch="101" wordcount="27" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4101: Expected a closing quote after position {1} in condition "{0}". - MSB4101: Aspas de fechamento esperadas depois da posição {1} da condição "{0}". - {StrBegin="MSB4101: "} - - MSB4101: Es wurde ein schließendes Anführungszeichen hinter Position {1} in Bedingung {0} erwartet. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4019: The imported project "{0}" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. - MSB4019: O projeto "{0}" importado não foi encontrado. Confirme se o caminho na declaração <Import> está correto e se o arquivo existe no disco. - {StrBegin="MSB4019: "}LOCALIZATION: <Import> should not be localized. - - MSB4019: Das importierte Projekt "{0}" wurde nicht gefunden. Bestätigen Sie den Pfad in der Deklaration < Import > und die Datei auf dem Datenträger vorhanden ist. - - fuzzyMatch="15" wordcount="26" adjWordcount="22.1" curWordcount="22.1" - - - MSB4089: Incorrect number of arguments to function in condition "{0}". Found {1} argument(s) when expecting {2}. - MSB4089: Número incorreto de argumentos da função da condição "{0}". Encontrado(s) {1} argumento(s), mas esperava(m)-se {2}. - {StrBegin="MSB4089: "} - - MSB4089: Falsche Anzahl von Argumenten für eine Funktion in der Bedingung "{0}". {1} Argument(e) gefunden, obwohl {2} erwartet wurde(n). - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - The "{0}" object specified does not belong to the correct "{1}" object. - O objeto "{0}" especificado não pertence ao objeto "{1}" correto. - - - Das angegebene {0}-Objekt gehört nicht zum korrekten {1}-Objekt. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4020: The value "{0}" of the "{1}" attribute in element <{2}> is invalid. - MSB4020: O valor "{0}" do atributo "{1}" no elemento <{2}> é inválido. - {StrBegin="MSB4020: "}UE: This is a generic message that is displayed when we find a project element with an incorrect value for one of its - attributes e.g. <Import Project=""> -- the value of Project should not be an empty string. - - MSB4020: Der Wert "{0}" von der "{1}" Attribut im Element <{2}> ist ungültig. - - fuzzyMatch="15" wordcount="14" adjWordcount="11.9" curWordcount="11.9" - - - MSB4102: The value "{0}" of the "{1}" attribute in element <{2}> is invalid. {3} - MSB4102: O valor "{0}" do atributo "{1}" no elemento <{2}> é inválido. {3} - {StrBegin="MSB4102: "}UE: This is a generic message that is displayed when we find a project element with an incorrect value for one of its - attributes. At the end of the message we show the exception text we got trying to use the value. - - MSB4102: Der Wert "{0}" von der "{1}" Attribut im Element <{2}> ist ungültig. {3} - - fuzzyMatch="15" wordcount="15" adjWordcount="12.75" curWordcount="12.75" - - - MSB4021: The "ContinueOnError" attribute of the "{0}" task is not valid. {1} - MSB4021: O atributo "ContinueOnError" da tarefa "{0}" não é válido. {1} - {StrBegin="MSB4021: "}LOCALIZATION: "ContinueOnError" should not be localized. "{1}" is a message from another exception explaining the problem. - - MSB4021: Das ContinueOnError-Attribut für die {0}-Aufgabe ist ungültig. {1} - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4139: Invalid value for default ToolsVersion is specified in registry key "{0}". - MSB4139: Um valor inválido de ToolsVersion padrão está especificado na chave do Registro"{0}". - {StrBegin="MSB4139: "} - - MSB4139: Im Registrierungsschlüssel "{0}" ist ein ungültiger Wert für die Standard-ToolsVersion angegeben. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4022: The result "{0}" of evaluating the value "{1}" of the "{2}" attribute in element <{3}> is not valid. - MSB4022: O resultado "{0}" da avaliação do valor "{1}" do atributo "{2}" no elemento <{3}> não é válido. - {StrBegin="MSB4022: "}UE: This message is shown when the engine is checking the correctness of the value (after evaluating embedded - properties/items) assigned to an XML attribute of an XML element in the project file. - - MSB4022: Das Ergebnis "{0}"der Auswertung des Werts"{1}" von der "{2}" Attribut im Element <{3}> ist ungültig. - - fuzzyMatch="15" wordcount="20" adjWordcount="17" curWordcount="17" - - - "{0}" is not a valid event category. To raise a custom event, use the "{1}" category. - "{0}" não é uma categoria de evento válida. Para elevar um evento personalizado, use a categoria "{1}". - - - {0} ist keine gültige Ereigniskategorie. Verwenden Sie die {1}-Kategorie, um ein benutzerdefiniertes Ereignis auszulösen. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - "{0}" is not a valid importance level for events. - "{0}" não é um nível de importância válido para eventos. - - - {0} ist kein gültiger Wert für die Bedeutung eines Ereignisses. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4104: Failed to write to log file "{0}". {1} - MSB4104: Falha ao gravar no arquivo de log "{0}". {1} - {StrBegin="MSB4104: "}UE: This is shown when the File Logger can't create or write to the file it was instructed to log to. - - MSB4104: Fehler beim Schreiben in die Protokollierungsdatei "{0}". {1} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4024: The imported project file could not be loaded. {0} - MSB4024: O arquivo de projeto importado não foi carregado. {0} - {StrBegin="MSB4024: "}UE: This message is shown when an imported project file cannot be loaded because of incorrect XML. The project - filename is not part of the message because it is provided separately to loggers. - LOCALIZATION: {0} is a localized message from the CLR/FX explaining why the project is invalid. - - MSB4024: Die importierte Projektdatei konnte nicht geladen werden. {0} - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - Operation invalid for a persisted item group. - Operação inválida para um grupo de itens persistentes. - - - Ungültiger Vorgang für eine persistente Elementgruppe. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Operation invalid for a virtual item group. - Operação inválida para um grupo de itens virtuais. - - - Ungültiger Vorgang für eine virtuelle Elementgruppe. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4071: The value Importance="{0}" in the <Message> element is invalid. Valid values are: High, Normal and Low. - MSB4071: O valor Importance="{0}" no elemento <Message> é inválido. Os valores válidos são: High, Normal e Low. - {StrBegin="MSB4071: "}UE: This message is shown when a user specifies a value for the importance attribute of Message which is not valid. - The importance enumeration is: High, Normal and Low. Specifying any other importance will result in this message being shown - LOCALIZATION: "Importance" should not be localized. - "Message" should not be localized. - High should not be localized. - Normal should not be localized. - Low should not be localized. - - MSB4071: Der Wert Importance = "{0}" in < Nachricht > Element ist ungültig. Gültige Werte sind: hoch, Normal und niedrig. - - fuzzyMatch="15" wordcount="18" adjWordcount="15.3" curWordcount="15.3" - - - MSB4025: The project file could not be loaded. {0} - MSB4025: Não foi possível carregar o arquivo de projeto. {0} - {StrBegin="MSB4025: "}UE: This message is shown when the project file given to the engine cannot be loaded because the filename/path is - invalid, or due to lack of permissions, or incorrect XML. The project filename is not part of the message because it is - provided separately to loggers. - LOCALIZATION: {0} is a localized message from the CLR/FX explaining why the project is invalid. - - MSB4025: Die Projektdatei konnte nicht geladen werden. {0} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4147: The property "{0}" at "{1}" is invalid. {2} - MSB4147: A propriedade "{0}" em "{1}" não é válida. {2} - {StrBegin="MSB4147: "} - - MSB4147: Die {0}-Eigenschaft bei "{1}" ist ungültig. {2} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - "{0}" is an invalid "ProjectFileEncoding" value. - "{0}" é um valor "ProjectFileEncoding" inválido. - LOCALIZATION: "ProjectFileEncoding" should not be localized. - - {0} ist ein ungültiger ProjectFileEncoding-Wert. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4143: The expression "{0}" cannot be evaluated. {1} - MSB4143: A expressão "{0}" não pode ser avaliada. {1} - {StrBegin="MSB4143: "} - UE: This message is shown when the user attempts to provide an expression like "$(Registry:HKEY_LOCAL_MACHINE\Software\Vendor\Tools@TaskLocation)" - LOCALIZATION: "{0}" is the expression that was bad. "{1}" is a message from an FX exception that describes why the expression is bad. - - - MSB4143: Der Ausdruck "{0}" kann nicht ausgewertet werden. {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4184: The expression "{0}" cannot be evaluated. {1} - MSB4184: A expressão "({0})" não pode ser avaliada. {1} - {StrBegin="MSB4184: "} - Single quotes as the expression will typically have double quotes in it. - UE: This message is shown when the user attempts to provide an expression like "$(SomeProperty.ToLower())" - LOCALIZATION: "{0}" is the expression that was bad. "{1}" is a message from an FX exception that describes why the expression is bad. - - - MSB4184: Der Ausdruck "{0}" kann nicht ausgewertet werden. {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4185: The function "{0}" on type "{1}" has not been enabled for execution. - MSB4185: A função "{0}" no tipo "{1}" não foi habilitada para execução. - {StrBegin="MSB4185: "} - UE: This message is shown when the user attempts to provide an expression like "$([System.DateTime]::Now)", but the expression has not been enabled - LOCALIZATION: "{0}" is the static function name, "{1}" is the .NET Framework type name - - - MSB4185: Die {0}-Funktion für den {1}-Typ wurde nicht für die Ausführung aktiviert. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4186: Invalid static method invocation syntax: "{0}". Static method invocation should be of the form: $([FullTypeName]::Method()), e.g. $([System.IO.Path]::Combine(`a`, `b`)) - MSB4186: Sintaxe de invocação de método estático inválida: "({0})". A invocação de método estático deve estar no formato: $([FullTypeName]::Method()), por exemplo, $([System.IO.Path]::Combine(`a`, `b`)) - {StrBegin="MSB4186: "} - UE: This message is shown when the user attempts to call a static method on a type, but has used the incorrect syntax - LOCALIZATION: "{0}" is the function expression which is in error - - - MSB4186: Ungültige Aufrufsyntax für statische Methode: "{0}". Für den Aufruf statischer Methoden muss folgendes Format verwendet werden: $([vollständiger Typname]::Methode()), z. B. $([System.IO.Path]::Combine(`a`, `b`)) - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4070: The schema "{0}" is not valid. {1} - MSB4070: O esquema "{0}" não é válido. {1} - {StrBegin="MSB4070: "}UE: This message is shown when the schema file provided for the validation of a project is itself not valid. - LOCALIZATION: "{0}" is the schema file path. "{1}" is a message from an FX exception that describes why the schema file is bad. - - MSB4070: Das Schema "{0}" ist nicht gültig. {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4026: The "{0}={1}" parameter for the "{2}" task is invalid. - MSB4026: O parâmetro "{0}={1}" da tarefa "{2}" é inválido. - {StrBegin="MSB4026: "}UE: This message is displayed when a task has an invalid parameter that cannot be initialized. - - MSB4026: Der {0}={1}-Parameter für die {2}-Aufgabe ist ungültig. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4027: The "{0}" task generated invalid items from the "{1}" output parameter. {2} - MSB4027: A tarefa "{0}" gerou itens inválidos a partir do parâmetro de saída "{1}". {2} - {StrBegin="MSB4027: "} - - MSB4027: Die {0}-Aufgabe generierte ungültige Elemente aus dem {1}-Ausgabeparameter. {2} - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4029: The "{0}" task has an invalid output specification. The "TaskParameter" attribute is required, and either the "ItemName" or "PropertyName" attribute must be specified (but not both). - MSB4029: A tarefa "{0}" tem uma especificação de saída inválida. O atributo "TaskParameter" é obrigatório e o atributo "ItemName" ou "PropertyName" deve ser especificado (mas não os dois). - {StrBegin="MSB4029: "}LOCALIZATION: "TaskParameter", "ItemName" and "PropertyName" should not be localized. - - MSB4029: Die {0}-Aufgabe enthält eine ungültige Ausgabespezifikation. Das TaskParameter-Attribut ist erforderlich, und es muss entweder das ItemName- oder PropertyName-Attribut angegeben werden (jedoch nicht beide). - - fuzzyMatch="101" wordcount="27" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4030: "{0}" is an invalid value for the "{1}" parameter of the "{3}" task. The "{1}" parameter is of type "{2}". - MSB4030: "{0}" é um valor inválido para o parâmetro "{1}" da tarefa "{3}". O parâmetro "{1}" é do tipo "{2}". - {StrBegin="MSB4030: "}UE: This error is shown when a type mis-match occurs between the value assigned to task parameter in the project file - and the type of the .NET property that corresponds to the task parameter. For example, if an int task parameter called "Count" - is assigned the value "x", this error would be displayed: <MyTask Count="x" /> - - MSB4030: "{0}" ist ein ungültiger Wert für den {1}-Parameter der {3}-Aufgabe. Der {1}-Parameter ist vom Typ "{2}". - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - MSB4137: Invalid value specified in the configuration file at "{0}". Property name or tools version name is an empty string. - MSB4137: Valor inválido especificado no arquivo de configuração em "{0}". O nome da propriedade ou o nome da versão das ferramentas é uma cadeia de caracteres vazia. - {StrBegin="MSB4137: "} - - MSB4137: In der Konfigurationsdatei ist bei "{0}" ein ungültiger Wert angegeben. Der Eigenschaftenname oder der Toolsversionname ist eine leere Zeichenfolge. - - fuzzyMatch="100" wordcount="20" adjWordcount="5" curWordcount="5" tmLabel="N''" - - - MSB4103: "{0}" is not a valid logger verbosity level. - MSB4103: "{0}" não é um nível de detalhamento de agente de log válido. - {StrBegin="MSB4103: "} - - MSB4103: "{0}" ist kein gültiger Ausführlichkeitsgrad für die Protokollierung. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4163: <ItemDefinitionGroup> is not allowed inside a target. - MSB4163: <ItemDefinitionGroup> não permitido em um destino. - {StrBegin="MSB4163: "} - - MSB4163: < ItemDefinitionGroup > ist in einem Ziel nicht zulässig. - - fuzzyMatch="15" wordcount="9" adjWordcount="7.65" curWordcount="7.65" - - - The specified item does not belong to the current item group. - O item especificado não pertence ao grupo de itens atual. - - - Das angegebene Element gehört nicht zu der aktuellen Elementgruppe. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4096: The item "{0}" in item list "{1}" does not define a value for metadata "{2}". In order to use this metadata, either qualify it by specifying %({1}.{2}), or ensure that all items in this list define a value for this metadata. - MSB4096: O item "{0}" na lista de itens "{1}" não define um valor dos metadados "{2}". Para usar esses metadados, qualifique-os especificando %({1}.{2}) ou assegure-se de que todos os itens na lista apresentem um valor definido para esses metadados. - {StrBegin="MSB4096: "} - - MSB4096: Das Element "{0}" in der Elementliste "{1}" definiert keinen Wert für die {2}-Metadaten. Wenn Sie diese Metadaten verwenden möchten, qualifizieren Sie sie, indem Sie %({1}.{2}) angeben, oder vergewissern Sie sich, dass alle Elemente in der Liste einen Wert für diese Metadaten definieren. - - fuzzyMatch="101" wordcount="42" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4099: A reference to an item list at position {1} is not allowed in this condition "{0}". - MSB4099: Não é permitida uma referência a uma lista de itens na posição {1} da condição "{0}". - {StrBegin="MSB4099: "} - - MSB4099: Ein Verweis auf eine Elementliste an Position {1} ist in dieser {0}-Bedingung nicht zulässig. - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - MSB4033: "{0}" is a reserved item metadata, and cannot be redefined as a custom metadata on the item. - MSB4033: "{0}" são metadados de item reservado e não pode ser redefinido como metadados personalizado no item. - {StrBegin="MSB4033: "} - - MSB4033: "{0}" sind reservierte Elementmetadaten und können nicht als benutzerdefinierte Metadaten für das Element neu definiert werden. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - An InternalLoggerException can only be thrown by the MSBuild engine. The public constructors of this class cannot be used to create an instance of the exception. - InternalLoggerException pode ser acionado somente pelo mecanismo MSBuild. Os construtores públicos desta classe não podem ser usados para criar uma instância da exceção. - UE: This message is shown when a user tries to instantiate a special exception called InternalLoggerException through the OM -- - only the engine is allowed to create and throw this exception. - LOCALIZATION: "InternalLoggerException" and "MSBuild" should not be localized. - - Eine InternalLoggerException kann nur durch das MSBuild-Modul ausgelöst werden. Die öffentlichen Konstruktoren dieser Klasse können nicht verwendet werden, um eine Instanz der Ausnahme zu erstellen. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Initial Items: - Itens iniciais: - - - Ursprüngliche Elemente: - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4083: Expected a Condition attribute on element "{0}". - MSB4083: Esperado atributo Condition no elemento "{0}". - {StrBegin="MSB4083: "} - - MSB4083: Es wurde ein Bedingungsattribut für das {0}-Element erwartet. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4164: The value "{0}" of metadata "{1}" contains an item list expression. Item list expressions are not allowed on default metadata values. - MSB4164: O valor "{0}" dos metadados "{1}" contém uma expressão de lista de itens. Essas expressões não são permitidas em valores de metadados padrão. - {StrBegin="MSB4164: "} - - MSB4164: Der Wert "{0}" der {1}-Metadaten enthält einen Elementlistenausdruck. Elementlistenausdrücke sind nicht als Standardwerte für Metadaten zulässig. - - fuzzyMatch="100" wordcount="22" adjWordcount="5.5" curWordcount="5.5" tmLabel="N''" - - - MSBuild is expecting a valid "{0}" object. - O MSBuild está esperando um objeto "{0}" válido. - - - MSBuild erwartet ein gültiges {0}-Objekt. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4035: The required attribute "{0}" is missing from element <{1}>. - MSB4035: O atributo "{0}" obrigatório não tem o elemento <{1}>. - {StrBegin="MSB4035: "}UE: This message is shown when a user leaves off a required attribute from a project element - e.g. <UsingTask AssemblyName="foo"> -- this is missing the "TaskName" attribute. - - MSB4035: Das erforderliche Attribut "{0}"-Element fehlt <{1}>. - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB4036: The "{0}" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "{1}" directory. - MSB4036: A tarefa "{0}" não foi encontrada. Verifique se: 1.) O nome da tarefa no arquivo de projeto é o mesmo nome da classe da tarefa. 2.) A classe da tarefa é "public" e implementa a interface Microsoft.Build.Framework.ITask. 3.) A tarefa está declarada corretamente com <UsingTask> no arquivo de projeto ou nos arquivos *.tasks localizados no diretório "{1}". - {StrBegin="MSB4036: "}LOCALIZATION: <UsingTask> and "*.tasks" should not be localized. - - MSB4036: Die "{0}" Task wurde nicht gefunden. Überprüfen Sie Folgendes: 1.) der Name der Aufgabe in der Projektdatei entspricht dem Namen der Aufgabenklasse. 2) die Aufgabenklasse ist "public" und implementiert die Microsoft.Build.Framework.ITask-Schnittstelle. 3) die Aufgabe korrekt mit < UsingTask > deklariert, in der Projektdatei oder in den Tasks-Dateien der "{1}" Verzeichnis. - - fuzzyMatch="15" wordcount="64" adjWordcount="54.4" curWordcount="54.4" - - - MSB4141: MSBuildToolsPath is not specified for the ToolsVersion "{0}" defined at "{1}", or the value specified evaluates to the empty string. - MSB4141: MSBuildToolsPath não está especificado para a ToolsVersion "{0}" definida em "{1}" ou o valor especificado resulta na cadeia de caracteres vazia. - {StrBegin="MSB4141: "} - - MSB4141: MSBuildToolsPath ist für die bei "{1}" definierte ToolsVersion {0} nicht angegeben, oder der angegebene Wert wird zu einer leeren Zeichenfolge ausgewertet. - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - MSB4031: The "MSBuildVersion" attribute is deprecated. If the project is authored in the MSBuild 2003 format, please remove the attribute from the <Project> tag. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format. - MSB4031: O atributo "MSBuildVersion" foi preterido. Se o projeto tiver sido criado no formato MSBuild 2003, remova o atributo da marcação de <Project>. Se o projeto tiver sido criado nos antigos formatos 1.0 ou 1.2, converta-o no formato MSBuild 2003. - {StrBegin="MSB4031: "}UE: This message is shown for projects that still contain the "MSBuildVersion" attribute in their <Project> - tag. We no longer need this attribute because the project's XML namespace (i.e. the "xmlns" attribute) gives us all the - version information we need. - LOCALIZATION: "MSBuild", "MSBuildVersion" and <Project> should not be localized. - - MSB4031: Das Attribut "MSBuildVersion" ist veraltet. Wenn das Projekt im Format MSBuild 2003 erstellt wurde, entfernen Sie das Attribut aus dem Tag < Project >. Wenn das Projekt im alten Format 1.0 oder 1.2 erstellt wurde, konvertieren Sie es in das MSBuild 2003-Format. - - fuzzyMatch="15" wordcount="45" adjWordcount="38.25" curWordcount="38.25" - - - MSB4144: Multiple definitions were found for the toolset "{0}". - MSB4144: Várias definições foram encontradas para o conjunto de ferramentas "{0}". - {StrBegin="MSB4144: "} - - MSB4144: Für das Toolset wurden mehrere Definitionen gefunden "{0}". - - fuzzyMatch="15" wordcount="9" adjWordcount="7.65" curWordcount="7.65" - - - MSB4145: Multiple definitions were found for the property "{0}". - MSB4145: Várias definições foram encontradas para a propriedade "{0}". - {StrBegin="MSB4145: "} - - MSB4145: Für die {0}-Eigenschaft wurden mehrere Definitionen gefunden. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4082: Choose has more than one <Otherwise> element. - MSB4082: Choose tem mais de um elemento <Otherwise>. - {StrBegin="MSB4082: "} - - MSB4082: Wählen Sie mehrere < Otherwise >-Element enthält. - - fuzzyMatch="15" wordcount="9" adjWordcount="7.65" curWordcount="7.65" - - - This method is only valid for persisted <{0}> elements. - Este método é válido somente para elementos <{0}> persistentes. - - - Diese Methode ist nur gültig für beibehalten <{0}> Elemente. - - fuzzyMatch="15" wordcount="10" adjWordcount="8.5" curWordcount="8.5" - - - This method is only valid for virtual property groups, not <{0}> elements. - Este método é válido somente para grupos de propriedades virtuais, não para elementos <{0}>. - - - Diese Methode gilt nur für virtuelle Eigenschaftengruppen nicht <{0}> Elemente. - - fuzzyMatch="15" wordcount="13" adjWordcount="11.05" curWordcount="11.05" - - - MSB4038: The element <{0}> must be last under element <{1}>. Found element <{2}> instead. - MSB4038: O elemento <{0}> deve ser o último sob o elemento <{1}>. Encontrado o elemento <{2}>. - {StrBegin="MSB4038: "} - - MSB4038: Das Element <{0}> muss unter Element <{1}>. Element wurde gefunden <{2}> statt. - - fuzzyMatch="15" wordcount="17" adjWordcount="14.45" curWordcount="14.45" - - - MSB4138: Non-string data was specified at the registry location "{0}". - MSB4138: Dados que não são de cadeia de caracteres foram especificados no local do Registro "{0}". - {StrBegin="MSB4138: "} - - MSB4138: Am Registrierungsspeicherort "{0}" wurden Daten angegeben, die keine Zeichenfolge sind. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4039: No "{0}" element was found in the project file. - MSB4039: Não foi encontrado nenhum elemento "{0}" no arquivo de projeto. - {StrBegin="MSB4039: "} - - MSB4039: Das {0}-Element wurde in der Projektdatei nicht gefunden. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4040: There is no target in the project. - MSB4040: Não há destino no projeto. - {StrBegin="MSB4040: "} - - MSB4040: Das Projekt enthält kein Ziel. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Removing the "{0}" attribute of an item is not allowed. - Não é permitido remover o atributo "{0}" de um item. - - - Das Löschen des {0}-Attributs eines Elements ist nicht zulässig. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - The object passed in is not part of the project. - O objeto passado não é parte do projeto. - - - Das übergebene Objekt ist nicht Teil des Projekts. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - Overriding target "{0}" in project "{1}" with target "{2}" from project "{3}". - Substituindo o destino "{0}" no projeto "{1}" pelo destino "{2}" do projeto "{3}". - - - Das Ziel "{0}" im Projekt "{1}" wird durch das Ziel "{2}" aus dem Projekt "{3}" außer Kraft gesetzt. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4167: The parent process unexpectedly exited. Shutting down child node "{0}". - MSB4167: o processo pai foi encerrado inesperadamente. Desligando o nó filho "{0}". - {StrBegin="MSB4167: "} - - MSB4167: Der übergeordnete Prozess wurde unerwartet beendet. Der untergeordnete Knoten "{0}" wird heruntergefahren. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - {0} ms {1} {2} calls - {0} ms {1} {2} chamadas - - - {0} ms {1} {2} Aufrufe - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - (* = timing was not recorded because of reentrancy) - (* = o tempo não foi gravado devido à reentrância) - - - (* = Zeit wurde aufgrund des erneuten Eintretens nicht aufgezeichnet) - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - This project object has been unloaded from the MSBuild engine and is no longer valid. - Este objeto de projeto foi descarregado do mecanismo MSBuild e não é mais válido. - - - Dieses Projektobjekt wurde aus dem MSBuild-Modul entladen und ist nicht mehr gültig. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - The project file "{0}" was not found. - O arquivo de projeto "{0}" não foi encontrado. - UE: This message is shown when the user calls into the OM to build a project that doesn't exist on disk. - - Die Projektdatei "{0}" wurde nicht gefunden. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Done building project "{0}" -- FAILED. - Projeto de compilação pronto "{0}" -- FALHA. - - - Die Erstellung des Projekts "{0}" ist abgeschlossen – FEHLER. - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Done building project "{0}". - Projeto de compilação pronto "{0}". - - - Die Erstellung des Projekts "{0}" ist abgeschlossen. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - MSB4041: The default XML namespace of the project must be the MSBuild XML namespace. If the project is authored in the MSBuild 2003 format, please add xmlns="{0}" to the <Project> element. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format. - MSB4041: Namespace XML padrão do projeto deve ser namespace XML do MSBuild. Se o projeto tiver sido criado no formato do MSBuild 2003, adicione xmlns="{0}" ao elemento <Project>. Se o projeto foi criado nos antigos formatos 1.0 ou 1.2, converta-o no formato do MSBuild 2003. - {StrBegin="MSB4041: "}UE: This is a Beta 1 message only. - LOCALIZATION: <Project>, "MSBuild" and "xmlns" should not be localized. - - MSB4041: Der XML-Standardnamespace des Projekts muss MSBuild XML-Namespace. Wenn das Projekt im Format MSBuild 2003 erstellt wurde, fügen Sie Xmlns = "{0}" < Project >-Element. Wenn das Projekt im alten Format 1.0 oder 1.2 erstellt wurde, konvertieren Sie es in das MSBuild 2003-Format. - - fuzzyMatch="15" wordcount="52" adjWordcount="44.2" curWordcount="44.2" - - - Project Performance Summary: - Resumo do Desempenho do Projeto: - - - Leistungszusammenfassung für das Projekt: - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - MSB4042: Stopping because of syntax errors in project file. - MSB4042: Parada devido a erros de sintaxe no arquivo de projeto. - {StrBegin="MSB4042: "} - - MSB4042: Prozess aufgrund von Syntaxfehlern in der Projektdatei angehalten. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - Project "{0}" is building "{1}" ({2} target(s)): - O projeto "{0}" está compilando "{1}" ({2} destino(s)): - - - Das Projekt {0} erstellt {1} ({2} Ziel(e)): - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Project "{0}" is building "{1}" (default targets): - O projeto "{0}" está compilando "{1}" (destinos padrão): - - - Das Projekt "{0}" erstellt "{1}" (Standardziele): - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Project "{0}" ({1} target(s)): - Projeto "{0}" ({1} destino(s)): - - - Projekt "{0}", {1} Ziel(e): - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - Project "{0}" (default targets): - Projeto "{0}" (destinos padrão): - - - Projekt "{0}" (Standardziele): - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - Done Building Project "{0}" ({1} target(s)). - Projeto de compilação pronto "{0}" ({1} destino(s)). - - - Die Erstellung von Projekt "{0}" ist abgeschlossen ({1} Ziel(e)). - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Done Building Project "{0}" (default targets). - Projeto de compilação pronto "{0}" (destinos padrão). - - - Die Erstellung von Projekt "{0}" ist abgeschlossen (Standardziele). - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Done Building Project "{0}" ({1} target(s)) -- FAILED. - Projeto de compilação pronto "{0}" ({1} destino(s)) -- FALHA. - - - Die Erstellung des Projekts "{0}" ist abgeschlossen, {1} Ziel(e) -- FEHLER. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Done Building Project "{0}" (default targets) -- FAILED. - Projeto de compilação pronto "{0}" (destinos padrão) -- FALHA. - - - Die Erstellung von Projekt "{0}" ist abgeschlossen (Standardziele) -- FEHLER. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4075: The project file must be opened in the Visual Studio IDE and converted to the latest version before it can be built by MSBuild. - MSB4075: O arquivo de projeto deve ser aberto no ambiente de desenvolvimento integrado (IDE) do Visual Studio e convertido na versão mais recente antes de ser compilado pelo MSBuild. - {StrBegin="MSB4075: "} - - MSB4075: Die Projektdatei muss in der Visual Studio IDE geöffnet und in ein aktuelles Versionsformat gebracht werden, bevor sie mit MSBuild erstellt werden kann. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4192: The project file "{0}" is in the ".vcproj" file format, which MSBuild no longer supports. Please convert the project by opening it in the Visual Studio IDE or running the conversion tool, or use MSBuild 3.5 or earlier to build it. - MSB4192: O arquivo de projeto "{0}" está no formato de arquivo ".vcproj", ao qual o MSBuild não dá mais suporte. Converta o projeto abrindo-o no IDE do Visual Studio ou executando a ferramenta de conversão ou use o MSBuild 3.5 ou anterior para compilá-lo. - {StrBegin="MSB4192: "} LOC: ".vcproj" should not be localized - - MSB4192: Die Projektdatei "{0}" ist im VSPROJ-Dateiformat gespeichert, das nicht mehr von MSBuild unterstützt wird. Konvertieren Sie das Projekt, indem Sie es in der Visual Studio IDE öffnen oder das Konvertierungstool ausführen, oder verwenden Sie MSBuild 3.5 oder früher zum Erstellen des Projekts. - - fuzzyMatch="101" wordcount="42" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - The specified property does not belong to the current property group. - A propriedade especificada não pertence ao grupo de propriedades atual. - - - Die angegebene Eigenschaft gehört nicht zu der aktuellen Eigenschaftengruppe. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - Initial Properties: - Propriedades iniciais: - - - Ursprüngliche Eigenschaften: - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4148: The name of a property stored under the registry key "{0}" has zero length. - MSB4148: O nome de uma propriedade armazenada na chave do Registro "{0}" tem comprimento zero. - {StrBegin="MSB4148: "} - - MSB4148: Der Name einer unter dem Registrierungsschlüssel "{0}" gespeicherten Eigenschaft hat eine Länge von Null. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - The property names in the indexer and the "{0}" object do not match. - Os nomes de propriedade no indexador e o objeto "{0}" não são correspondentes. - - - Die Eigenschaftennamen im Indexer und das {0}-Objekt stimmen nicht überein. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4043: The item metadata reference "{0}" is invalid because it is qualified with an item name. Item metadata referenced in transforms do not need to be qualified, because the item name is automatically deduced from the items being transformed. Change "{0}" to "%({1})". - MSB4043: A referência aos metadados de item "{0}" é inválida porque está qualificada com um nome de item. Os metadados de item referenciados nas transformações não precisam ser qualificados porque o nome do item é deduzido automaticamente com base nos itens sendo transformados. Altere "{0}" para "%({1})". - {StrBegin="MSB4043: "}UE: This message is shown when the user does something like this: @(foo->'%(foo.metadata)'). There is no need to specify - "foo.metadata", because "foo" is automatically deduced. In corollary, "bar.metadata" is not allowed either, where "bar" is a different - item list type. - - MSB4043: Der Elementmetadatenverweis "{0}" ist ungültig, da er mit einem Elementnamen qualifiziert ist. Elementmetadaten, auf die bei Transformationen verwiesen wird, müssen nicht qualifiziert werden, da der Elementname automatisch aus den transformierten Elementen abgeleitet wird. Ändern Sie "{0}" in "%({1})". - - fuzzyMatch="101" wordcount="43" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4135: Error reading the toolset information from the registry location "{0}". {1} - MSB4135: Erro ao ler as informações do conjunto de ferramentas no local do Registro "{0}". {1} - {StrBegin="MSB4135: "} - - MSB4135: Fehler beim Lesen der Toolsetinformationen am Registrierungsspeicherort "{0}". {1} - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4044: The "{0}" task was not given a value for the required parameter "{1}". - MSB4044: A tarefa "{0}" não recebeu um valor para o parâmetro obrigatório "{1}". - {StrBegin="MSB4044: "}UE: This message is shown when a task parameter designated as "required" is not set in the project file. - - MSB4044: Die {0}-Aufgabe hat keinen Wert für den erforderlichen {1}-Parameter erhalten. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - Validating project using schema file "{0}". - Validando o projeto com o arquivo de esquema "{0}". - LOCALIZATION: "{0}" is the location of the schema file. - - Das Projekt wird anhand der Schemadatei "{0}" überprüft. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4045: Project is not valid. {0} - MSB4045: o projeto não é válido. {0} - {StrBegin="MSB4045: "}UE: This error is shown when the user asks his project to be validated against a schema (/val switch for - MSBuild.exe), and the project has errors. "{0}" contains a message explaining the problem. - LOCALIZATION: "{0}" is a message from the System.XML schema validator and is already localized. - - MSB4045: Ungültiges Projekt. {0} - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4112: The targets in this project have been disabled by the host and therefore cannot be built at this time. This may have been done for security reasons. To enable the targets, the host must set Project.BuildEnabled to "true". - MSB4112: Os destinos neste projeto foram desabilitados pelo host e, portanto, não podem ser compilados neste momento. Esse procedimento deve ter sido executado por questão de segurança. Para habilitar os destinos, o host deve definir Project.BuildEnabled como "true". - {StrBegin="MSB4112: "} - - MSB4112: Die Ziele in diesem Projekt wurden vom Host deaktiviert und können aus diesem Grund derzeit nicht erstellt werden. Die Deaktivierung wurde wahrscheinlich aus Sicherheitsgründen durchgeführt. Wenn Sie die Ziele aktivieren möchten, muss der Host Project.BuildEnabled auf "true" festlegen. - - fuzzyMatch="101" wordcount="39" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4093: The "{0}" parameter of the "{1}" task cannot be written to because it does not have a "set" accessor. - MSB4093: O parâmetro "{0}" da tarefa "{1}" não pode ser gravado porque não tem um acessador "set". - {StrBegin="MSB4093: "}UE: This error is shown when a project tries to assign a value to a task parameter that does not have a "set" - accessor on the corresponding .NET property on the task class. - - MSB4093: In den {0}-Parameter der {1}-Aufgabe kann nicht geschrieben werden, da er keinen set-Accessor besitzt. - - fuzzyMatch="100" wordcount="20" adjWordcount="5" curWordcount="5" tmLabel="N''" - - - A shallow clone of this object cannot be created. - Não é possível criar clone superficial deste objeto. - - - Ein unechter Klon dieses Objekts kann nicht erstellt werden. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - Skipping target "{0}" because it has no inputs. - Ignorando o destino "{0}" porque ele não tem entradas. - - - Das {0}-Ziel wird übersprungen, da es keine Eingaben besitzt. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Though the target has declared its inputs, the input specification only references empty properties and/or empty item lists. - Embora o destino tenha declarado suas entradas, a especificação da entrada faz referência somente às propriedades e/ou listas de itens vazias. - - - Obwohl das Ziel seine Eingaben deklariert hat, verweist die Eingabespezifikation nur auf leere Eigenschaften und/oder leere Elementlisten. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - Skipping target "{0}" because it has no outputs. - Ignorando o destino "{0}" porque ele não tem saídas. - - - Das Ziel "{0}" wird übersprungen, da es keine Ausgaben enthält. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Though the target has declared its outputs, the output specification only references empty properties and/or empty item lists. - Embora o destino tenha declarado suas saídas, a especificação da saída faz referência somente às propriedades e/ou listas de itens vazias. - - - Obwohl das Ziel seine Ausgaben deklariert hat, verweist die Ausgabespezifikation nur auf leere Eigenschaften und/oder leere Elementlisten. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - Skipping target "{0}" because all output files are up-to-date with respect to the input files. - Ignorando o destino "{0}" porque todos os arquivos de saída estão atualizados em relação aos arquivos de entrada. - - - Das Ziel "{0}" wird übersprungen, da alle Ausgabedateien hinsichtlich der Eingabedateien aktuell sind. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - Input files: {0} - Arquivos de entrada: {0} - {0} is a semicolon-separated list of filenames. - - Eingabedateien: {0} - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Output files: {0} - Arquivos de saída: {0} - {0} is a semicolon-separated list of filenames. - - Ausgabedateien: {0} - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Building solution configuration "{0}". - Compilando a configuração de solução "{0}". - UE: This is not an error, so doesn't need an error code. - - Die Projektmappenkonfiguration "{0}" wird erstellt. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - Using solution cache file "{0}" for configuration "{1}" and tools version "{2}". - Usando o arquivo de cache de solução "{0}" para a configuração "{1}" e a versão das ferramentas "{2}". - UE: This is not an error, so doesn't need an error code. - - Die Projektmappen-Cachedatei "{0}" wird für die Konfiguration "{1}" und die Toolsversion "{2}" verwendet. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Failed to read solution cache file "{0}". {1} Using solution file directly. - Falha ao ler o arquivo de cache de solução "{0}". {1} Usando o arquivo de solução diretamente. - UE: This is not a true error, so doesn't need an error code. - - Fehler beim Lesen der Projektmappen-Cachedatei "{0}". {1} Projektmappendatei wird direkt verwendet. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Failed to write solution cache file "{0}". {1} - Falha ao gravar o arquivo de cache de solução "{0}". {1} - UE: This is not a true error, so doesn't need an error code. - - Fehler beim Schreiben der Projektmappen-Cachedatei "{0}". {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Solution cache file was created for a "{0}" value of "{1}" but the current value is "{2}". Refreshing cache file. - O arquivo de cache de solução foi criado para um valor "{0}" de "{1}", mas o valor atual é "{2}". Atualizando o arquivo de cache. - UE: This is not an error, so doesn't need an error code. - - Die Projektmappen-Cachedatei wurde für den {0}-Wert "{1}" erstellt, aber der aktuelle Wert ist "{2}". Cachedatei wird aktualisiert. - - fuzzyMatch="100" wordcount="20" adjWordcount="5" curWordcount="5" tmLabel="N''" - - - Solution cache file has an internal version number "{0}" but the current value is "{1}". Refreshing cache file. - O arquivo de cache de solução possui um número de versão interno "{0}", mas o valor atual é "{1}". Atualizando o arquivo de cache. - UE: This is not an error, so doesn't need an error code. - - Die Projektmappen-Cachedatei hat die interne Versionsnummer "{0}", der aktuelle Wert ist aber "{1}". Cachedatei wird aktualisiert. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - Solution cache file is out of date. Refreshing cache file. {0} - O arquivo de cache de solução está desatualizado. Atualizando o arquivo de cache. {0} - UE: This is not an error, so doesn't need an error code. - - Die Projektmappen-Cachedatei ist veraltet. Cachedatei wird aktualisiert. {0} - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4160: A circular dependency involving project "{0}" has been detected. - MSB4160: Foi detectada uma dependência circular envolvendo o projeto "{0}". - {StrBegin="MSB4160: "} - - MSB4160: Eine Ringabhängigkeit im Zusammenhang mit dem Projekt "{0}" wurde erkannt. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4126: The specified solution configuration "{0}" is invalid. Please specify a valid solution configuration using the Configuration and Platform properties (e.g. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU") or leave those properties blank to use the default solution configuration. - MSB4126: A configuração da solução especificada "{0}" é inválida. Especifique uma configuração de solução válida com as propriedades Configuration e Platform (por exemplo, MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Qualquer CPU") ou deixe essas propriedades em branco para usar a configuração de solução padrão. - {StrBegin="MSB4126: "}UE: The solution filename is provided separately to loggers. - - MSB4126: Die angegebene Projektmappenkonfiguration "{0}" ist ungültig. Geben Sie mithilfe der Konfigurations- und Plattformeigenschaften eine gültige Projektmappenkonfiguration an (z. B. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU"), oder lassen Sie diese Eigenschaften leer, sodass die Standardprojektmappenkonfiguration verwendet wird. - - fuzzyMatch="101" wordcount="37" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4046: Error reading project file "{0}": {1} - MSB4046: Erro ao ler o arquivo de projeto "{0}": {1} - {StrBegin="MSB4046: "} - - MSB4046: Fehler beim Lesen der Projektdatei "{0}": {1} - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4125: The project file name "{0}" is invalid. {1} - MSB4125: O nome de arquivo de projeto "{0}" é inválido. {1} - {StrBegin="MSB4125: "}UE: The solution filename is provided separately to loggers. - - MSB4125: Der Projektdateiname "{0}" ist ungültig. {1} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4051: Project {0} is referencing a project with GUID {1}, but a project with this GUID was not found in the .SLN file. - MSB4051: O projeto {0} está usando como referência um projeto com GUID {1}, mas o projeto com essa GUID não foi encontrado no arquivo .SLN. - {StrBegin="MSB4051: "}UE: The solution filename is provided separately to loggers. - - MSB4051: Das Projekt "{0}" verweist auf ein Projekt mit der GUID {1}, in der SLN-Datei wurde jedoch kein Projekt mit dieser GUID gefunden. - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - MSB4078: The project file "{0}" is not supported by MSBuild and cannot be built. - MSB4078: O MSBuild não dá suporte ao arquivo de projeto "{0}"; não é possível compilá-lo. - {StrBegin="MSB4078: "} - - MSB4078: Die Projektdatei "{0}" wird nicht von MSBuild unterstützt und kann nicht erstellt werden. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4054: The solution file must be opened in the Visual Studio IDE and converted to the latest version before it can be built by MSBuild. - MSB4054: O arquivo de solução deve ser aberto no IDE do Visual Studio e convertido na versão mais recente antes de ser compilado pelo MSBuild. - {StrBegin="MSB4054: "}UE: The solution filename is provided separately to loggers. - - MSB4054: Die Projektmappendatei muss in der Visual Studio IDE geöffnet und in die neuste Version konvertiert werden, bevor sie mit MSBuild erstellt werden kann. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4121: The project configuration for project "{0}" was not specified in the solution file for the solution configuration "{1}". - MSB4121: A configuração do projeto "{0}" não foi especificada no arquivo de solução da configuração de solução "{1}". - {StrBegin="MSB4121: "} - - MSB4121: Die Projektkonfiguration für das Projekt "{0}" wurde nicht in der Projektmappendatei für die Projektmappenkonfiguration "{1}" angegeben. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - The project "{0}" is not selected for building in solution configuration "{1}". - O projeto "{0}" não está selecionado para compilação na configuração de solução "{1}". - - UE: This is not an error, so doesn't need an error code. - - - Das Projekt "{0}" ist in der Projektmappenkonfiguration "{1}" nicht zum Erstellen ausgewählt. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4122: Scanning project dependencies for project "{0}" failed. {1} - MSB4122: Falha no exame das dependências do projeto "{0}". {1} - {StrBegin="MSB4122: "} - - MSB4122: Fehler beim Überprüfen der Projektabhängigkeiten für Projekt "{0}". {1} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4149: The tools version "{0}" of the solution does not support building projects with a different tools version. - MSB4149: A versão das ferramentas "{0}" da solução não dá suporte à compilação de projetos com outra versão das ferramentas. - {StrBegin="MSB4149: "} - - MSB4149: Die Toolsversion {0} der Projektmappe unterstützt das Erstellen von Projekten mit unterschiedlichen Toolsversionen nicht. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - Web projects do not support the "Clean" target. Continuing with remaining projects ... - Os projetos da Web não dão suporte ao destino "Clean". Prosseguindo com os projetos restantes... - UE: This is not an error, so doesn't need an error code. - LOCALIZATION: Do not localize "Clean". - - Webprojekte unterstützen das Clean-Ziel nicht. Verbleibende Projekte werden fortgesetzt... - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Web projects do not support the "Publish" target. Continuing with remaining projects ... - Os projetos Web não dão suporte ao destino "Publish". Prosseguindo com os projetos restantes... - UE: This is not an error, so doesn't need an error code. - LOCALIZATION: Do not localize "Publish". - - Webprojekte unterstützen das Publish-Ziel nicht. Verbleibende Projekte werden fortgesetzt... - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Skipping because the "$(AspNetConfiguration)" configuration is not supported for this web project. You can use the AspNetConfiguration property to override the configuration used for building web projects, by adding /p:AspNetConfiguration=<value> to the command line. Currently web projects only support Debug and Release configurations. - Ignorando porque a configuração "$(AspNetConfiguration)" não dá suporte a este projeto da Web. Você pode usar a propriedade AspNetConfiguration para substituir a configuração usada na compilação de projetos da Web adicionando /p:AspNetConfiguration=<valor> à linha de comando. Os projetos da Web atuais dão suporte somente às configurações Debug e Release. - - UE: This is not an error, so doesn't need an error code. - LOCALIZATION: Do NOT localize "AspNetConfiguration", "Debug", "Release". - - - Da der "$(AspNetConfiguration)" Konfiguration für dieses Webprojekt nicht unterstützt. Verwenden die AspNetConfiguration-Eigenschaft die Konfiguration zum Erstellen von Webprojekten hinzufügen/p: AspNetConfiguration überschreiben = < Wert > in der Befehlszeile. Aktuell unterstützen Webprojekte nur Debug- und Releasekonfigurationen. - - fuzzyMatch="15" wordcount="44" adjWordcount="37.4" curWordcount="37.4" - - - MSB4076: VC projects do not support the "Publish" target. - MSB4076: Os projetos de VC não fornecem suporte ao destino "Publish". - {StrBegin="MSB4076: "}LOCALIZATION: Do not localize "Publish". - - MSB4076: VC-Projekte unterstützen nicht das Publish-Ziel. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4098: MSBuild is invoking VCBuild to build this project. Project-to-project references between VC++ projects (.VCPROJ) and C#/VB/VJ# projects (.CSPROJ, .VBPROJ, .VJSPROJ) are not supported by the command-line build systems when building stand-alone VC++ projects. Projects that contain such project-to-project references will fail to build. Please build the solution file containing this project instead. - MSB4098: O MSBuild está chamando o VCBuild para compilar este projeto. Não há suporte para as referências projeto-a-projeto entre os projetos do VC++ (.VCPROJ) e dos C#/VB/VJ# (.CSPROJ, .VBPROJ, .VJSPROJ) em sistemas de linha de comando, durante a compilação de projetos autônomos do VC++. Os projetos que contêm essas referências projeto-a-projeto não serão compilados. Compile o arquivo de solução que contém este projeto. - {StrBegin="MSB4098: "} - - MSB4098: MSBuild ruft zum Erstellen dieses Projekts VCBuild auf. Interprojektverweise zwischen VC++-Projekten (.VCPROJ) und C#-/VB-/VJ#-Projekten (.CSPROJ, .VBPROJ, .VJSPROJ) werden beim Erstellen eigenständiger VC++-Projekte von den Befehlszeilen-Buildsystemen nicht unterstützt. Projekte, die solche Interprojektverweise enthalten, werden nicht erstellt. Erstellen Sie stattdessen die Projektmappendatei, die dieses Projekt enthält. - - fuzzyMatch="101" wordcount="53" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4056: The MSBuild engine must be called on a single-threaded-apartment. Current threading model is "{0}". Proceeding, but some tasks may not function correctly. - MSB4056: O mecanismo MSBuild deve ser chamado em um STA (single-threaded-apartment). O modelo Threading é "{0}". Prosseguindo, mas talvez algumas tarefas não funcionem corretamente. - {StrBegin="MSB4056: "} - - MSB4056: Das MSBuild-Modul muss in einem Singlethread-Apartment aufgerufen werden. Das aktuelle Threadmodell ist {0}. Der Vorgang wird fortgesetzt, aber einige Aufgaben werden möglicherweise nicht ordnungsgemäß ausgeführt. - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - Schema validation - Validação de esquema - UE: this fragment is used to describe errors that are caused by schema validation. For example, if a normal error is - displayed like this: "MSBUILD : error MSB0000: This is an error.", then an error from schema validation would look like this: - "MSBUILD : Schema validation error MSB0000: This is an error." - LOCALIZATION: This fragment needs to be localized. - - Schemavalidierung - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Target "{0}" skipped. Previously built unsuccessfully. - Destino "{0}" ignorado. Compilado anteriormente sem êxito. - - - Das Ziel "{0}" wurde übersprungen. Die vorherige Erstellung war nicht erfolgreich. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Target "{0}" skipped. Previously built successfully. - Destino "{0}" ignorado. Compilado anteriormente com êxito. - - - Das Ziel "{0}" wurde übersprungen. Die vorherige Erstellung war erfolgreich. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4116: The condition "{1}" on the "{0}" target has a reference to item metadata. References to item metadata are not allowed in target conditions unless they are part of an item transform. - MSB4116: A condição "{1}" no destino "{0}" tem uma referência aos metadados de item. Não são permitidas referências a metadados de item nas condições de destino, a menos que façam parte de uma transformação de item. - {StrBegin="MSB4116: "} - - MSB4116: Die Bedingung "{1}" des {0}-Ziels enthält einen Verweis auf Elementmetadaten. Verweise auf Elementmetadaten sind in Zielbedingungen nicht zulässig, es sei denn, sie sind Teil einer Elementtransformation. - - fuzzyMatch="101" wordcount="32" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4057: The target "{0}" does not exist in the project. - MSB4057: O destino "{0}" não existe no projeto. - {StrBegin="MSB4057: "} - - MSB4057: Das Ziel "{0}" ist im Projekt nicht vorhanden. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - Done building target "{0}" in project "{1}" -- FAILED. - Destino de compilação pronto "{0}" no projeto "{1}" -- FALHA. - - - Erstellen des {0}-Ziels in Projekt {1} beendet - Fehler beim Erstellen. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Done building target "{0}" in project "{1}". - Destino de compilação pronto"{0}" no projeto "{1}". - - - Die Erstellung des Ziels "{0}" im Projekt "{1}" ist abgeschlossen. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - {0}: (TargetId:{1}) - {0}: (TargetId:{1}) - - - {0}: (Ziel-ID:{1}) - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4058: The "{0}" target is missing its output specification. If a target declares inputs, it must also declare outputs. - MSB4058: O destino "{0}" não tem a especificação de saída. Se o destino declarar as entradas, também deverá declarar as saídas. - {StrBegin="MSB4058: "} - - MSB4058: Das {0}-Ziel enthält keine Ausgabespezifikation. Wenn ein Ziel Eingaben deklariert, muss es auch Ausgaben deklarieren. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4168: The item "{0}" of type "{1}" does not define a value for the metadata in the expression "{2}". This expression is used in the target output for target "{3}". If a target declares outputs that are transforms, all items in the transform must have a value for the metadata in the transform. - MSB4168: o item "{0}" do tipo "{1}" não define um valor para os metadados na expressão "{2}". Essa expressão foi usada na saída de destino de "{3}". Se um destino declarar saídas que sejam transformações, todos os itens na transformação deverão ter um valor para os metadados na transformação. - {StrBegin="MSB4168: "} - - MSB4168: Das Element "{0}" vom Typ "{1}" definiert keinen Wert für die Metadaten im Ausdruck "{2}". Dieser Ausdruck wird in der Zielausgabe für "{3}" verwendet. Wenn ein Ziel Ausgaben deklariert, bei denen es sich um Transformationen handelt, müssen alle Elemente in der Transformation einen Wert für die in der Transformation enthaltenen Metadaten aufweisen. - - fuzzyMatch="101" wordcount="53" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Target Performance Summary: - Resumo do Desempenho do Destino: - - - Leistungszusammenfassung für das Ziel: - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Target "{0}" skipped, due to false condition; ({1}) was evaluated as ({2}). - Destino "{0}" ignorado devido à condição falsa; ({1}) foi avaliado como ({2}). - - - Das Ziel "{0}" wurde übersprungen, da die Bedingung "false" war . ({1}) wurde als ({2}) ausgewertet. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Target "{0}" in project "{1}" - Destino "{0}" no projeto "{1}" - - - {0}-Ziel in {1}-Projekt. - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Target {0}: - Destino {0}: - - - Ziel "{0}": - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Target "{0}" in file "{1}": - Destino "{0}" no arquivo "{1}": - - - Ziel "{0}" in Datei "{1}": - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Build continuing because "{0}" on the task "{1}" is set to "{2}". - A compilação continua porque "{0}" na tarefa "{1}" está definido como "{2}". - - - Der Buildvorgang wird fortgesetzt, da {0} in der {1}-Aufgabe auf "{2}" festgelegt ist. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Target {0} from project "{1}": - Destino {0} do projeto "{1}": - - - Ziel "{0}" aus Projekt "{1}": - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Target "{0}" in file "{1}" from project "{2}": - Destino "{0}" no arquivo "{1}" do projeto "{2}": - - - Ziel "{0}" in Datei "{1}" aus Projekt "{2}": - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4060: The "{0}" task has been declared or used incorrectly, or failed during construction. Check the spelling of the task name and the assembly name. - MSB4060: A tarefa "{0}" foi declarada ou usada incorretamente ou ocorreu falha durante a construção. Verifique se os nomes da tarefa e do assembly estão escritos corretamente. - {StrBegin="MSB4060: "} - - MSB4060: Die {0}-Aufgabe wurde falsch deklariert, falsch verwendet oder konnte bei der Erstellung nicht ausgeführt werden. Überprüfen Sie die Schreibweise des Aufgaben- und des Assemblynamens. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4077: The "{0}" task has been marked with the attribute LoadInSeparateAppDomain, but does not derive from MarshalByRefObject. Check that the task derives from MarshalByRefObject or AppDomainIsolatedTask. - MSB4077: A tarefa "{0}" foi marcada com o atributo LoadInSeparateAppDomain, mas não é derivada de MarshalByRefObject. Verifique se a tarefa é derivada de MarshalByRefObject ou de AppDomainIsolatedTask. - {StrBegin="MSB4077: "}LOCALIZATION: <LoadInSeparateAppDomain>, <MarshalByRefObject>, <AppDomainIsolatedTask> should not be localized. - - MSB4077: Die Aufgabe "{0}" wurde mit dem LoadInSeparateAppDomain-Attribut markiert, ist jedoch nicht von MarshalByRefObject abgeleitet. Stellen Sie sicher, dass die Aufgabe von MarshalByRefObject oder AppDomainIsolatedTask abgeleitet wird. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Done executing task "{0}" -- FAILED. - Tarefa em execução pronta "{0}" -- FALHA. - - - Die Ausführung von Task "{0}" wurde beendet – FEHLER. - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Done executing task "{0}". - Tarefa em execução pronta "{0}". - - - Die Ausführung von Task "{0}" wurde beendet. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - {0} (TaskId:{1}) - {0} (TaskId:{1}) - - - {0} (Aufgaben-ID: {1}) - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Using "{0}" task from assembly "{1}". - Usando a tarefa "{0}" do assembly "{1}". - UE: This informational message helps users determine which assemblies their tasks were loaded from. - - Die {0}-Aufgabe aus der {1}-Assembly wird verwendet. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4061: The "{0}" task could not be instantiated from the assembly "{1}". {2} - MSB4061: A tarefa "{0}" não foi iniciada do assembly "{1}". {2} - {StrBegin="MSB4061: "}LOCALIZATION: "{2}" is a localized message from a CLR/FX exception. - - MSB4061: Die {0}-Aufgabe konnte nicht aus der {1}-Assembly instanziiert werden. {2} - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4127: The "{0}" task could not be instantiated from the assembly "{1}". Please verify the task assembly has been built using the same version of the Microsoft.Build.Framework assembly as the one installed on your computer and that your host application is not missing a binding redirect for Microsoft.Build.Framework. {2} - MSB4127: A tarefa "{0}" não foi iniciada do assembly "{1}". Verifique se o assembly da tarefa foi compilado com a mesma versão de assembly do Microsoft.Build.Framework instalada em seu computador e se não está faltando um redirecionamento de associação para o Microsoft.Build.Framework no aplicativo host. {2} - {StrBegin="MSB4127: "}UE: This message is a specialized version of the TaskInstantiationFailureError message and can probably reuse some of its docs. - LOCALIZATION: "{2}" is a localized message from a CLR/FX exception. Also, Microsoft.Build.Framework should not be localized - - MSB4127: Die "{0}"-Aufgabe konnte nicht aus der "{1}"-Assembly instanziiert werden. Überprüfen Sie, ob die Aufgabenassembly mit der gleichen Version der Microsoft.Build.Framework-Assembly erstellt wurde, die auf Ihrem Computer installiert ist, und dass Ihrer Hostanwendung kein BindingRedirect-Eintrag für Microsoft.Build.Framework fehlt. {2} - - fuzzyMatch="101" wordcount="49" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4062: The "{0}" task could not be loaded from the assembly {1}. {2} Confirm that the <UsingTask> declaration is correct, and that the assembly and all its dependencies are available. - MSB4062: A tarefa "{0}" não foi carregada do assembly {1}. {2} Confirme se a declaração <UsingTask> está correta, e se o assembly e suas dependências estão disponíveis. - {StrBegin="MSB4062: "}UE: This message is shown when a task cannot be loaded from its assembly for various reasons e.g. corrupt assembly, - invalid task declaration, disk error, etc. "{2}" contains a message explaining what happened. - LOCALIZATION: "{2}" is a message from the CLR loader and is already localized. Also, <UsingTask> should not be localized. - - MSB4062: Die "{0}" Vorgang konnte nicht aus der Assembly geladen werden {1}. {2} Bestätigen < UsingTask > Erklärung richtig ist und die Assembly und die zugehörigen Dateien verfügbar sind. - - fuzzyMatch="15" wordcount="31" adjWordcount="26.35" curWordcount="26.35" - - - MSB4063: The "{0}" task could not be initialized with its input parameters. {1} - MSB4063: A tarefa "{0}" não foi iniciada com os seus parâmetros de entrada. {1} - {StrBegin="MSB4063: "} - - MSB4063: Die "{0}"-Aufgabe konnte nicht mit ihren Eingabeparametern initialisiert werden. {1} - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - Task Performance Summary: - Resumo do Desempenho da Tarefa: - - - Leistungszusammenfassung für die Aufgabe: - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Task "{0}" skipped, due to false condition; ({1}) was evaluated as ({2}). - A tarefa "{0}" foi ignorada devido a condição falsa; ({1}) foi avaliado como ({2}). - - - Die {0}-Aufgabe wurde übersprungen, da die Bedingung "false" war . ({1}) wurde als ({2}) ausgewertet. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Task "{0}" - Tarefa "{0}" - - - Task "{0}" - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Time Elapsed {0} - Tempo Decorrido {0} - - - Verstrichene Zeit {0} - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Building with tools version "{0}". - Compilando com a versão das ferramentas "{0}". - - - Erstellung mit der Toolsversion "{0}". - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Project file contains ToolsVersion="{0}". This toolset is unknown or missing. You may be able to resolve this by installing the appropriate .NET Framework for this toolset. Treating the project as if it had ToolsVersion="4.0". - O arquivo de projeto contém ToolsVersion="{0}". Esse conjunto de ferramentas é desconhecido ou está ausente. Talvez seja possível resolver isso instalando o .NET Framework apropriado para esse conjunto de ferramentas. Tratando o projeto como se tivesse ToolsVersion="4.0". - - - Die Projektdatei enthält ToolsVersion="{0}". Dieses Toolset ist nicht bekannt oder nicht vorhanden. Sie können das Problem möglicherweise beheben, indem Sie das entsprechende .NET Framework für dieses Toolset installieren. Das Projekt wird behandelt als enthielte es ToolsVersion="4.0". - - fuzzyMatch="101" wordcount="34" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Deferred Messages - Mensagens adiadas - - - Zurückgestellte Meldungen - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Some messages did not display because they were not associated with any ProjectStarted events. Use diagnostic verbosity to view these messages. - Algumas mensagens não foram exibidas porque não estavam associadas a nenhum evento ProjectStarted. Use o detalhamento de diagnóstico para exibir essas mensagens. - - - Einige Meldungen wurden nicht angezeigt, weil sie keinem ProjectStarted-Ereignis zugeordnet sind. Verwenden Sie den Ausführlichkeitsgrad "diagnostic", um diese Meldungen anzuzeigen. - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - MSB4090: Found an unexpected character '{2}' at position {1} in condition "{0}". - MSB4090: Encontrado um caractere "{2}" inesperado na posição {1} da condição "{0}". - {StrBegin="MSB4090: "} - - MSB4090: Das unerwartete Zeichen {2} wurde an Position {1} in der {0}-Bedingung gefunden. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4091: Found a call to an undefined function "{1}" in condition "{0}". - MSB4091: Encontrada uma chamada para uma função não definida "{1}" da condição "{0}". - {StrBegin="MSB4091: "} - - MSB4091: Aufruf zu einer undefinierten Funktion "{1}" in Bedingung "{0}" gefunden. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4064: The "{0}" parameter is not supported by the "{1}" task. Verify the parameter exists on the task, and it is a settable public instance property. - MSB4064: O parâmetro "{0}" não tem suporte na tarefa "{1}". Verifique se o parâmetro existe na tarefa e se ele é uma propriedade de instância pública que pode ser definida. - {StrBegin="MSB4064: "} - - MSB4064: Der {0}-Parameter wird von der {1}-Aufgabe nicht unterstützt. Vergewissern Sie sich, dass der Parameter in der Aufgabe vorhanden ist und es sich um eine festlegbare öffentliche Instanzeigenschaft handelt. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4131: The "{0}" parameter is not supported by the "{1}" task. Verify the parameter exists on the task, and it is a gettable public instance property. - MSB4131: O parâmetro "{0}" não tem suporte na tarefa "{1}". Verifique se o parâmetro existe na tarefa e se é uma propriedade de instância pública que pode ser obtida. - {StrBegin="MSB4131: "} - - MSB4131: Der {0}-Parameter wird von der {1}-Aufgabe nicht unterstützt. Vergewissern Sie sich, dass der Parameter in der Aufgabe vorhanden ist und es sich um eine abrufbare öffentliche Instanzeigenschaft handelt. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4092: An unexpected token "{1}" was found at character position {2} in condition "{0}". - MSB4092: Um token "{1}" inesperado foi encontrado na posição de caractere {2} da condição "{0}". - {StrBegin="MSB4092: "} - - MSB4092: Ein unerwartetes Token "{1}" wurde an Zeichenposition "{2}" in Bedingung "{0}" gefunden. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4065: The "{0}" parameter is not marked for output by the "{1}" task. - MSB4065: O parâmetro "{0}" não é marcado para saída pela tarefa "{1}". - {StrBegin="MSB4065: "} - - MSB4065: Der {0}-Parameter ist nicht für die Ausgabe durch die {1}-Aufgabe markiert. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4066: The attribute "{0}" in element <{1}> is unrecognized. - MSB4066: O atributo "{0}" no elemento <{1}> não é reconhecido. - {StrBegin="MSB4066: "} - - MSB4066: Das Attribut "{0}" im Element <{1}> wurde nicht erkannt. - - fuzzyMatch="15" wordcount="10" adjWordcount="8.5" curWordcount="8.5" - - - MSB4067: The element <{0}> beneath element <{1}> is unrecognized. - MSB4067: O elemento <{0}> abaixo do elemento <{1}> não é reconhecido. - {StrBegin="MSB4067: "} - - MSB4067: Das Element <{0}> unter Element <{1}> wurde nicht erkannt. - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB4068: The element <{0}> is unrecognized, or not supported in this context. - MSB4068: O elemento <{0}> não é reconhecido, ou não há suporte para ele no contexto. - {StrBegin="MSB4068: "} - - MSB4068: Das Element <{0}> ist unbekannt oder in diesem Kontext nicht unterstützt. - - fuzzyMatch="15" wordcount="13" adjWordcount="11.05" curWordcount="11.05" - - - MSB4132: The tools version "{0}" is unrecognized. - MSB4132: A versão das ferramentas "{0}" não é reconhecida. - {StrBegin="MSB4132: "} - - MSB4132: Die Toolsversion "{0}" ist unbekannt. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4069: The "{0}" type of the "{1}" parameter of the "{2}" task is not supported by MSBuild. - MSB4069: Não há suporte no MSBuild para o tipo "{0}" do parâmetro "{1}" da tarefa "{2}". - {StrBegin="MSB4069: "}LOCALIZATION: "MSBuild" should not be localized. - - MSB4069: Der {0}-Typ des {1}-Parameters der {2}-Aufgabe wird von MSBuild nicht unterstützt. - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - MSB4072: A <{0}> element must contain either the "{1}" attribute or the "{2}" attribute (but not both). - MSB4072: Um elemento <{0}> deve conter o atributo "{1}" ou "{2}" (mas não os dois). - {StrBegin="MSB4072: "} - - MSB4072: Ein <{0}>-Element muss entweder die "{1}" Attribut oder "{2}" Attribut (jedoch nicht beide). - - fuzzyMatch="15" wordcount="18" adjWordcount="15.3" curWordcount="15.3" - - - {0} Warning(s) - {0} Aviso(s) - - - {0} Warnung(en) - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4084: A <When> element may not follow an <Otherwise> element in a <Choose>. - MSB4084: O elemento <When> não acompanha um elemento <Otherwise> em <Choose>. - {StrBegin="MSB4084: "} - - MSB4084: A < >-Element kein Element < Otherwise > < auswählen > folgen. - - fuzzyMatch="15" wordcount="16" adjWordcount="13.6" curWordcount="13.6" - - - Target Name: "{0}" Project Name: "{1}" - Nome de destino: "{0}" Nome do projeto: "{1}" - - - Zielname: "{0}" Projektname: "{1}" - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Cycle trace: - Rastreamento de ciclo: - - - Schleifenablaufverfolgung: - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4150: Must initialize the console logger using the initialize method before using ApplyParameter - MSB4150: É necessário iniciar o agente de log do console com o método de inicialização antes de usar ApplyParameter - {StrBegin="MSB4150: "} - - MSB4150: Die Konsolenprotokollierung muss vor der Verwendung von ApplyParameter mithilfe der Initialisierungsmethode initialisiert werden. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4151: An error occurred while building project "{0}", target "{1}". Please see innerException for detailed information. - MSB4151: Ocorreu um erro ao compilar o projeto "{0}", destino "{1}". Consulte innerException para obter informações detalhadas. - {StrBegin="MSB4151: "} - - MSB4151: Fehler beim Erstellen von Projekt "{0}", Ziel "{1}". Ausführliche Informationen finden Sie in der innerException. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB4152: An error occurred on the child node "{0}" and could not be passed to the parent node. {1} - MSB4152: erro no nó filho "{0}" e não foi possível transferi-lo ao nó pai. {1} - {StrBegin="MSB4152: "} - - MSB4152: Fehler im untergeordneten Knoten "{0}", der nicht an den übergeordneten Knoten übergeben werden konnte. {1} - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4153: A call is made on an inactive IBuildEngine interface corresponding to a task that already finished execution. - MSB4153: É efetuada uma chamada em uma interface inativa do IBuildEngine correspondente a uma tarefa cuja execução já foi finalizada. - {StrBegin="MSB4153: "} - - MSB4153: Eine inaktive IBuildEngine-Schnittstelle wird aufgerufen, der eine Aufgabe entspricht, deren Ausführung bereits abgeschlossen wurde. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - MSB4154: A forwarding logger is attempting to forward BuildFinished event - MSB4154: Um agente de log de encaminhamento está tentando encaminhar um evento BuildFinished - {StrBegin="MSB4154: "} - - MSB4154: Eine weiterleitende Protokollierung versucht, das BuildFinished-Ereignis weiterzuleiten. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4155: There was an error while communicating with a node. - MSB4155: Houve um erro ao estabelecer comunicação com um nó. - {StrBegin="MSB4155: "} - - MSB4155: Fehler bei der Kommunikation mit einem Knoten. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB1021: Cannot create an instance of the logger - {0}. - MSB1021: Não é possível criar uma instância do agente de log - {0}. - {StrBegin="MSB1021: "}The error code for this message is duplicated from MSBuild.exe. - - MSB1021: Eine Instanz der Protokollierung kann nicht erstellt werden - {0}. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB1020: The logger {0} was not found. Check the following: 1.) The logger name specified is the same as the name of the logger class. 2.) The logger class is "public" and implements the Microsoft.Build.Framework.ILogger interface. 3.) The path to the logger assembly is correct, or the logger can be loaded using only the assembly name provided. - MSB1020: O agente de log {0} não foi encontrado. Verifique o seguinte: 1.) O nome do agente de log especificado é igual ao nome da classe do agente de log. 2.) A classe do agente de log é "public" e implementa a interface Microsoft.Build.Framework.ILogger. 3.) O caminho para o assembly do agente de log está correto ou se é possível carregar o agente de log somente com o nome do assembly fornecido. - {StrBegin="MSB1020: "}The error code for this message is duplicated from MSBuild.exe. - - MSB1020: Die Protokollierung {0} wurde nicht gefunden. Überprüfen Sie Folgendes: 1.) Der angegebene Name der Protokollierung ist mit dem Namen der Protokollierungsklasse identisch. 2.) Die Protokollierungsklasse ist "public" und implementiert die Microsoft.Build.Framework.ILogger-Schnittstelle. 3.) Der Pfad zur Protokollierungsassembly ist richtig, bzw. die Protokollierung kann alleine mithilfe des angegebenen Assemblynamens geladen werden. - - fuzzyMatch="101" wordcount="57" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4156: A forwarding logger is attempting to forward BuildStarted event - MSB4156: Um agente de log de encaminhamento está tentando encaminhar um evento BuildStarted - {StrBegin="MSB4156: "} - - MSB4156: Eine weiterleitende Protokollierung versucht, das BuildStarted-Ereignis weiterzuleiten. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - "{0}" ({1} target) ({2}) -> - "{0}" ({1} destino) ({2}) -> - - - "{0}" ({1} target) ({2}) -> - - fuzzyMatch="15" wordcount="5" adjWordcount="4.25" curWordcount="4.25" - - - "{0}" (default target) ({1}) -> - "{0}" (destino padrão) ({1}) -> - - - "{0}" (Standardziel) ({1}) -> - - fuzzyMatch="15" wordcount="5" adjWordcount="4.25" curWordcount="4.25" - - - {0} {1,5} - {0} {1,5} - - - {0} {1,5} - - fuzzyMatch="15" wordcount="2" adjWordcount="1.7" curWordcount="1.7" - - - Project "{0}" on node {1} ({2} target(s)). - Projeto "{0}" no nó {1} ({2} destino(s)). - - - Projekt "{0}" auf Knoten "{1}", {2} Ziel(e). - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Project "{0}" on node {1} (default targets). - Projeto "{0}" no nó {1} (destinos padrão). - - - Projekt "{0}" auf Knoten "{1}" (Standardziele). - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Project "{0}" ({1}) is building "{2}" ({3}) on node {4} ({5} target(s)). - O projeto "{0}" ({1}) está compilando "{2}" ({3}) no nó {4} ({5} destino(s)). - - - Das Projekt "{0}" ({1}) erstellt "{2}" ({3}) auf Knoten "{4}", {5} Ziel(e). - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Project "{0}" ({1}) is building "{2}" ({3}) on node {4} (default targets). - O projeto "{0}" ({1}) está compilando "{2}" ({3}) no nó {4} (destinos padrão). - - - Das Projekt "{0}" ({1}) erstellt "{2}" ({3}) auf Knoten "{4}" (Standardziele). - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - ({0} target) -> - ({0} destino) -> - - - ({0} Ziel) -> - - fuzzyMatch="15" wordcount="3" adjWordcount="2.55" curWordcount="2.55" - - - MSB4157: The array of project files needs to contain at least one value. - MSB4157: A matriz dos arquivos do projeto precisa conter, ao menos, um valor. - {StrBegin="MSB4157: "} - - MSB4157: Das Array der Projektdateien muss mindestens einen Wert enthalten. - - fuzzyMatch="15" wordcount="13" adjWordcount="11.05" curWordcount="11.05" - - - MSB4158: The project file name at element {0} is empty. - MSB4158: O nome do arquivo do projeto no elemento {0} está em branco. - {StrBegin="MSB4158: "} - - MSB4158: Der Projektdateiname bei Element {0} ist leer. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - The property "{0}" with value "{1}" is being overridden by another batch. The property is now: "{2}" - A propriedade "{0}" com o valor "{1}" está sendo substituída por outro lote. Agora, a propriedade é: "{2}" - - - Die Eigenschaft "{0}" mit dem Wert "{1}" wird von einem anderen Batch überschrieben. Die Eigenschaft ist jetzt: "{2}" - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - Please see inner exception for error information. - Consulte a exceção interna para obter informações do erro. - - - Fehlerinformationen finden Sie in der internen Ausnahme. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Event type "{0}" was expected to be serializable. The event was not serializable and has been ignored. - Esperava-se que o tipo de evento "{0}" fosse serializado. O evento não era serializado e foi ignorado. - - - Es wurde erwartet, dass der Typ "{0}" serialisierbar ist. Das Ereignis war nicht serialisierbar und wurde ignoriert. - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - The log file path cannot be null or empty. - O caminho do arquivo de log não pode ser nulo nem ficar em branco. - - - Der Protokolldateipfad darf nicht NULL oder leer sein. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4161: Project "{0}" was loaded and unloaded during the current build. Reloading a project during the build can result in errors or an inconsistent build state. Either avoid unloading project "{0}" or cache the evaluation results of target(s) "{1}" before unloading the project. - MSB4161: O projeto "{0}" foi carregado e descarregado durante a compilação atual. Recarregar um projeto durante a compilação pode resultar em erros ou em um estado de compilação inconsistente. Evite descarregar o projeto "{0}" ou, antes de descarregá-lo, armazene em cache os resultados da avaliação do(s) destino(s) "{1}". - {StrBegin="MSB4161: "} - - MSB4161: Das Projekt "{0}" wurde während der aktuellen Erstellung geladen und entladen. Das erneute Laden eines Projekts während der Erstellung kann zu Fehlern oder einem nicht konsistenten Buildzustand führen. Vermeiden Sie entweder das Entladen des Projekts "{0}", oder speichern Sie die Auswertungsergebnisse der Ziele "{1}" vor dem Entladen des Projekts im Cache. - - fuzzyMatch="101" wordcount="43" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - [default] - [padrão] - - - [Standard] - - fuzzyMatch="100" wordcount="1" adjWordcount="0.25" curWordcount="0.25" tmLabel="N''" - - -
-
\ No newline at end of file diff --git a/src/Deprecated/Engine/Resources/xlf/Strings.ru.xlf b/src/Deprecated/Engine/Resources/xlf/Strings.ru.xlf deleted file mode 100644 index 14c6ab53128..00000000000 --- a/src/Deprecated/Engine/Resources/xlf/Strings.ru.xlf +++ /dev/null @@ -1,2674 +0,0 @@ - - - -
- - 4013 - 1176.8 - 1176.8 - 0 - 0 - - - 0 - 981 - 2334 - 0 - 0 - 698 - 0 - -
- - - MSB4001: The "{0}" task has more than one parameter called "{1}". - MSB4001: у задачи "{0}" несколько параметров "{1}". - {StrBegin="MSB4001: "}UE: This message is shown when a task has more than one .NET property with the same name -- it's unclear which of - those properties the task wants to use as a parameter in project files. - - MSB4001: Die {0}-Aufgabe enthält mehrere Parameter mit dem Namen "{1}". - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4081: The value "{0}" of the "ItemName" attribute in element <Output> contains an "@" character. If you intended to use an item name then remove the @( ) around the item name. - MSB4081: значение "{0}" атрибута ItemName в элементе <Output> содержит знак "@". Если вы хотите использовать имя элемента, удалите символы @( ) с двух сторон имени элемента. - {StrBegin="MSB4081: "}UE: This message is shown when an output tag has an itemname that contains an @. They probably typed @(foo) instead of foo in the ItemName.LOCALIZATION: Output and ItemName should not be localized. - - MSB4081: Der Wert "{0}" "ItemName-Attribut im Element < Output > enthält ein" @"Zeichen. Soll ein Elementname verwenden und entfernen dann die @ (), um den Namen des Elements. - - fuzzyMatch="15" wordcount="30" adjWordcount="25.5" curWordcount="25.5" - - - MSB4002: There was a failure retrieving the attributes for parameters in the "{0}" task. {1} - MSB4002: не удалось получить атрибуты для параметров в задаче "{0}". {1} - {StrBegin="MSB4002: "}UE: This message is shown when the .NET attributes that a task's .NET properties are decorated with, cannot be - retrieved -- this is typically because the .NET classes that define the .NET attributes cannot be loaded because the assembly - they are defined in cannot be found, or the classes themselves cannot be found. - - MSB4002: Fehler beim Abrufen der Attribute für Parameter in der {0}-Aufgabe. {1} - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - MSB4003: "{0}" is a reserved attribute of the <{1}> element, and must be spelled with the correct casing. This attribute cannot be used as a parameter to the "{2}" task. - MSB4003: "{0}" — это зарезервированный атрибут элемента <{1}>, и знаки его имени должны быть написаны в нужном регистре. Этот атрибут не может быть использован как параметр для задачи "{2}". - {StrBegin="MSB4003: "}UE: Tasks are not allowed to use incorrect case for reserved attributes on the task nodes e.g. "continueonerror" - instead of the "ContinueOnError". - - MSB4003: "{0}" ist ein reserviertes Attribut der <{1}>-Element und mit der richtigen Groß-/Kleinschreibung geschrieben werden muss. Dieses Attribut kann nicht verwendet werden, als Parameter an die "{2}" Aufgabe. - - fuzzyMatch="15" wordcount="31" adjWordcount="26.35" curWordcount="26.35" - - - The "REQUESTBATCHSIZE" must be a number greater than 1. "{0}" is an invalid value. The value 10 will be used instead. - Значение "REQUESTBATCHSIZE" должно быть больше 1. "{0}" является недопустимым значением. Будет использовано значение 10. - The name "REQUESTBATCHSIZE" is an environment variable - - Die "REQUESTBATCHSIZE" muss eine Zahl größer als 1 sein. "{0}" ist ein ungültiger Wert. Der Wert 10 wird stattdessen verwendet. - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - Build completed in {0}. - Время сборки: {0}. - - - Das Erstellen wurde in {0} beendet. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - Build FAILED. - Ошибка сборки. - - - Fehler beim Buildvorgang. - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Build succeeded. - Сборка успешно завершена. - - - Buildvorgang erfolgreich. - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Build started. - Сборка начата. - - - Der Buildvorgang wurde gestartet. - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Build started {0}. - Сборка начата {0}. - - - Der Buildvorgang wurde am {0} gestartet. - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Building target "{0}" completely. - Полная сборка целевого объекта "{0}". - {0} is the name of the target. - - Das Ziel "{0}" wird vollständig erstellt. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - No input files were specified. - Входные файлы не заданы. - - - Es wurden keine Eingabedateien angegeben. - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Input file "{0}" is newer than output file "{1}". - Входной файл "{0}" новее выходного файла "{1}". - {0} and {1} are filenames on disk. - - Die Eingabedatei "{0}" ist neuer als die Ausgabedatei "{1}". - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - Output file "{0}" does not exist. - Выходной файл "{0}" не существует. - {0} is a filename on disk. - - Die Ausgabedatei "{0}" ist nicht vorhanden. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Input file "{0}" does not exist. - Входной файл "{0}" не существует. - {0} is a filename on disk. - - Die Eingabedatei "{0}" ist nicht vorhanden. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Building target "{0}" partially, because some output files are out of date with respect to their input files. - Частичное создание целевого объекта "{0}", так как некоторые выходные файлы устарели по отношению к входным. - {0} is the name of the target. - - Das Ziel "{0}" wird teilweise erstellt, da einige Ausgabedateien hinsichtlich ihrer Eingabedateien veraltet sind. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - [{0}: Input={1}, Output={2}] Input file is newer than output file. - [{0}: Входной={1}, Выходной={2}] Входной файл новее выходного. - {0} is the name of an MSBuild item. {1} and {2} are filenames on disk. - - [{0}: Eingabe={1}, Ausgabe={2}] Die Eingabedatei ist neuer als die Ausgabedatei. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - [{0}: Input={1}, Output={2}] Output file does not exist. - [{0}: Входной={1}, Выходной={2}] Выходной файл не существует. - {0} is the name of an MSBuild item. {1} and {2} are filenames on disk. - - [{0}: Eingabe={1}, Ausgabe={2}] Die Ausgabedatei ist nicht vorhanden. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - [{0}: Input={1}, Output={2}] Input file does not exist. - [{0}: Входной={1}, Выходной={2}] Входной файл не существует. - {0} is the name of an MSBuild item. {1} and {2} are filenames on disk. - - [{0}: Eingabe={1}, Ausgabe={2}] Die Eingabedatei ist nicht vorhanden. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - The attribute "{0}" is a known MSBuild attribute, and cannot be accessed using this method. - Атрибут "{0}" — это известный атрибут MSBuild, и обращение к нему с помощью этого метода невозможно. - - - Das {0}-Attribut ist ein bekanntes MSBuild-Attribut, auf das mithilfe dieser Methode nicht zugegriffen werden kann. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - Properties in persisted property groups cannot be accessed by name. - К свойствам в постоянных группах свойств нельзя обращаться по имени. - - - Auf Eigenschaften in persistenten Eigenschaftengruppen ist kein Zugriff über den Namen möglich. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4023: Cannot evaluate the item metadata "%({0})". {1} - MSB4023: не удается вычислить метаданные элемента "%({0})". {1} - {StrBegin="MSB4023: "}UE: This message is shown when the value of an item metadata cannot be computed for some reason e.g. trying to apply - %(RootDir) to an item-spec that's not a valid path, would result in this error. - LOCALIZATION: "{1}" is a localized message explaining the problem. - - MSB4023: Elementmetadaten "%({0})" können nicht ausgewertet werden. {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Cannot execute a task not associated with a project object. - Невозможно выполнить задачу, не связанную с объектом проекта. - - - Eine Aufgabe, die keinem Projektobjekt zugeordnet ist, kann nicht ausgeführt werden. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - The cache entry has already been set to a different value and cannot be modified. - Для записи кэша уже задано другое значение, которое не может быть изменено. - - - Der Cacheeintrag wurde bereits auf einen anderen Wert festgelegt und kann nicht geändert werden. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - The "{0}" property comes from an environment variable, and cannot be modified. - Свойство "{0}" извлекается из переменной окружения и не может быть изменено. - - - Die {0}-Eigenschaft stammt aus einer Umgebungsvariablen und kann nicht geändert werden. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - The "{0}" property is a global property, and cannot be modified through an evaluated property group. Use "{1}" instead. - "{0}" — это глобальное свойство. Изменить его с помощью вычисленной группы свойств невозможно. Используйте вместо этого "{1}". - - - Die {0}-Eigenschaft ist eine globale Eigenschaft und kann nicht über eine ausgewertete Eigenschaftengruppe geändert werden. Verwenden Sie stattdessen {1}. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - Modifying the XML of an imported project file is not allowed. Open that project file directly. - Изменение импортного файла XML недопустимо. Откройте этот файл проекта как есть. - - - Der XML-Code einer importierten Projektdatei darf nicht geändert werden. Öffnen Sie diese Projektdatei direkt. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB4117: The "{0}" item name is reserved, and cannot be used. - MSB4117: "{0}" — зарезервированное имя элемента и не может использоваться. - {StrBegin="MSB4117: "}UE: This message is shown when the user tries to redefine one of the reserved MSBuild items e.g. @(Choose) - - MSB4117: Der Elementname "{0}" ist reserviert und kann nicht verwendet werden. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4118: The "{0}" item metadata name is reserved, and cannot be used. - MSB4118: имя метаданных элемента "{0}" зарезервировано и не может использоваться. - {StrBegin="MSB4118: "}UE: This message is shown when the user tries to redefine one of the reserved MSBuild items e.g. @(Choose) - - MSB4118: Der Elementmetadatenname "{0}" ist reserviert und kann nicht verwendet werden. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4004: The "{0}" property is reserved, and cannot be modified. - MSB4004: свойство "{0}" зарезервировано и не может быть изменено. - {StrBegin="MSB4004: "}UE: This message is shown when the user tries to redefine one of the reserved MSBuild properties e.g. $(MSBuildProjectFile) - - MSB4004: Die {0}-Eigenschaft ist reserviert und kann nicht geändert werden. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4094: "{0}" is an invalid value for the "{1}" parameter of the "{3}" task. Multiple items cannot be passed into a parameter of type "{2}". - MSB4094: "{0}" — недопустимое значение для параметра "{1}" задачи "{3}". Передача нескольких элементов в параметр типа "{2}" невозможна. - {StrBegin="MSB4094: "} - UE: This error is shown when a project tries to pass multiple items into a task parameter of type ITaskItem (singular). - - - MSB4094: "{0}" ist ein ungültiger Wert für den "{1}"-Parameter der "{3}"-Aufgabe. Mehrere Elemente können nicht in einen Parameter vom Typ "{2}" übergeben werden. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4115: The "{0}" function only accepts a scalar value, but its argument "{1}" evaluates to "{2}" which is not a scalar value. - MSB4115: функция "{0}" принимает только скалярное значение, но ее аргумент "{1}" равен "{2}", что не является скалярным значением. - {StrBegin="MSB4115: "} - UE: This error is shown when a project tries to pass multiple items into a function in a conditional expression, that can only accept a scalar value (such as the "exists()" function). - - - MSB4115: Die "{0}"-Funktion nimmt nur einen Skalarwert an, ihr "{1}"-Argument wird jedoch zu "{2}" ausgewertet, bei dem es sich nicht um einen Skalarwert handelt. - - fuzzyMatch="100" wordcount="22" adjWordcount="5.5" curWordcount="5.5" tmLabel="N''" - - - The task is currently associated with a project object, and should not be added to a different one. - Задача уже связана с одним объектом PROJECT и не может быть добавлена в другой. - - - Die Aufgabe ist derzeit einem Projektobjekt zugeordnet und sollte zu keinem anderen Projektobjekt hinzugefügt werden. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - MSB4095: The item metadata %({0}) is being referenced without an item name. Specify the item name by using %(itemname.{0}). - MSB4095: ссылка на метаданные элемента %({0}) не содержит имени элемента. Укажите имя элемента с помощью %(itemname.{0}). - {StrBegin="MSB4095: "} - - MSB4095: Auf die %({0})-Elementmetadaten wird ohne einen Elementnamen verwiesen. Geben Sie den Namen mithilfe von %(itemname.{0}) an. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - The task is not associated with the specified target element collection, and should not be removed from it. - Задача не связана с указанным набором задач элемента TARGET и не должна удаляться из него. - - - Die Aufgabe ist nicht der angegebenen Auflistung von Zielelementen zugeordnet und sollte nicht daraus entfernt werden. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - MSB4005: The current working directory could not be restored to {0}. {1} - MSB4005: сделать {0} текущим рабочим каталогом невозможно. {1} - {StrBegin="MSB4005: "}UE: This message is shown when the current working directory cannot be reset after a build. "{1}" contains a message explaining why. - LOCALIZATION: "{1}" is a message from an CLR/FX exception and is already localized. - - MSB4005: Das aktuelle Arbeitsverzeichnis konnte unter {0} nicht wiederhergestellt werden. {1} - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Cannot set a condition on an object not represented by an XML element in the project file. - Невозможно задать условие для объекта, не представленного элементом XML в файле проекта. - - - Eine Bedingung kann nicht für ein Objekt festgelegt werden, wenn das Objekt nicht von einem XML-Element in der Projektdatei repräsentiert wird. - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - Cannot set ContinueOnError on an object not represented by an XML element in the project file. - Невозможно задать атрибут ContinueOnError для объекта, не представленного элементом XML в файле проекта. - - - Das ContinueOnError-Attribut kann nicht für ein Objekt festgelegt werden, wenn das Objekt nicht von einem XML-Element in der Projektdatei repräsentiert wird. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB4134: DefaultToolsVersion cannot be set after a project has been loaded into the Engine. - MSB4134: не удается задать DefaultToolsVersion после загрузки проекта в Модуль. - {StrBegin="MSB4134: "} - - MSB4134: DefaultToolsVersion darf nicht festgelegt werden, nachdem ein Projekt in das Modul geladen wurde. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - Assigning the "{0}" attribute on an item that has been evaluated is not allowed. This operation is only allowed on the original persisted item that came directly from the project file. - Присвоение атрибута "{0}" вычисленному элементу недопустимо. Этот оператор можно использовать только для постоянного элемента данных, полученного прямо из файла проекта. - - - Das {0}-Attribut darf nicht einem Element zugewiesen werden, das ausgewertet wurde. Dieser Vorgang ist nur für das ursprüngliche persistente Element zulässig, das direkt aus der Projektdatei stammt. - - fuzzyMatch="101" wordcount="31" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Assigning the "{0}" attribute of a virtual item is not allowed. - Присвоение атрибута "{0}" виртуальному элементу недопустимо. - - - Das Zuweisen des {0}-Attributs eines virtuellen Elements ist nicht zulässig. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - A property cannot be set while building. - Назначить свойство во время сборки невозможно. - - - Eine Eigenschaft kann nicht während des Erstellens festgelegt werden. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - A property cannot be set to null. - Задать пустое свойство невозможно. - - - Eine Eigenschaft kann nicht auf NULL festgelegt werden. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Cannot get or set parameters on a task not associated with a project object. - Чтение и запись параметров для задачи, не связанной с объектом PROJECT, невозможны. - - - Parameter für eine Aufgabe können nicht abgefragt oder festgelegt werden, wenn die Aufgabe keinem Projektobjekt zugeordnet ist. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4162: <{0}> is not valid. Child elements are not allowed below a item remove element. - MSB4162: недопустимый элемент <{0}>. Не допускается использование дочерних элементов ниже элемента удаления а. - {StrBegin="MSB4162: "} - - MSB4162: <{0}> ist ungültig. Untergeordnete Elemente dürfen nicht unter einem Element Element entfernen. - - fuzzyMatch="15" wordcount="16" adjWordcount="13.6" curWordcount="13.6" - - - MSB4166: Child node "{0}" exited prematurely. Shutting down. - MSB4166: произошел преждевременный выход дочернего узла "{0}". Идет завершение работы. - {StrBegin="MSB4166: "} - - MSB4166: Der untergeordnete Knoten "{0}" wurde vorzeitig beendet. Herunterfahren. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4085: A <Choose> must contain at least one <When>. - MSB4085: элемент <Choose> должен содержать по меньшей мере один элемент <When>. - {StrBegin="MSB4085: "} - - MSB4085: < auswählen > muss mindestens < Wenn >. - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB4114: <Choose> elements cannot be nested more than {0} levels deep. - MSB4114: уровень вложения элемента <Choose> не может превышать {0}. - {StrBegin="MSB4114: "}UE: This message appears if the project file contains unreasonably nested Choose elements. - LOCALIZATION: Do not localize "Choose" as it is an XML element name. - - MSB4114: < auswählen > Elemente können nicht geschachtelt werden mehr als {0} Ebenen. - - fuzzyMatch="15" wordcount="12" adjWordcount="10.2" curWordcount="10.2" - - - MSB4006: There is a circular dependency in the target dependency graph involving target "{0}". - MSB4006: круговая зависимость между целями в графике зависимостей для цели "{0}". - {StrBegin="MSB4006: "}UE: This message is shown when the build engine detects a target referenced in a circular manner -- a project cannot - request a target to build itself (perhaps via a chain of other targets). - - MSB4006: Im Zielabhängigkeitsdiagramm besteht eine Ringabhängigkeit im Zusammenhang mit dem Ziel "{0}". - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4086: A numeric comparison was attempted on "{1}" that evaluates to "{2}" instead of a number, in condition "{0}". - MSB4086: в условии "{0}" была попытка числового сравнения выражения "{1}", равного не числу, а "{2}". - {StrBegin="MSB4086: "} - - MSB4086: Es wurde versucht, einen numerischen Vergleich für "{1}" auszuführen, der zu "{2}" anstatt zu einer Zahl in Bedingung "{0}" ausgewertet wird. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4007: The clause "{0}", specified in the "{1}" attribute is invalid. - MSB4007: предложение "{0}" в атрибуте "{1}" недействительно. - {StrBegin="MSB4007: "}UE: This message is shown when the Condition on an element is invalid in some way -- e.g. syntax error, unrecognized operator. - - MSB4007: Die im {1}-Attribut festgelegte {0}-Klausel ist ungültig. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4130: The condition "{0}" may have been evaluated incorrectly in an earlier version of MSBuild. Please verify that the order of the AND and OR clauses is written as intended. To avoid this warning, add parentheses to make the evaluation order explicit. - MSB4130: возможно, условие "{0}" было неправильно вычислено в более ранней версии MSBuild. Убедитесь, что порядок предложений AND и OR записан верно. Чтобы избежать появления данного предупреждения, добавьте круглые скобки для задания явного порядка вычисления. - {StrBegin="MSB4130: "} - - MSB4130: Die Bedingung "{0}" ist in einer früheren Version von MSBuild möglicherweise fehlerhaft ausgewertet worden. Stellen Sie sicher, dass die AND- und OR-Klauseln in der beabsichtigten Reihenfolge stehen. Damit diese Warnung nicht angezeigt wird, fügen Sie Klammern hinzu, um die Auswertungsreihenfolge explizit anzugeben. - - fuzzyMatch="101" wordcount="42" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4087: Specified condition "{0}" does not evaluate to a boolean. - MSB4087: результат вычисления указанного условия "{0}" не является логическим значением. - {StrBegin="MSB4087: "} - - MSB4087: Die angegebene {0}-Bedingung wird nicht zu einem booleschen Wert ausgewertet. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4113: Specified condition "{0}" evaluates to "{1}" instead of a boolean. - MSB4113: результат вычисления условия "{0}" равен "{1}", а не логическому значению. - {StrBegin="MSB4113: "} - - MSB4113: Die angegebene Bedingung {0} wird zu {1} statt zu einem booleschen Wert ausgewertet. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - {0}, line {1} - {0}, строка {1} - - - {0}, Zeile {1} - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - MSB4136: Error reading the toolset information from the configuration file "{0}". {1} - MSB4136: ошибка считывания сведений о наборе инструментов из файла конфигурации "{0}". {1} - {StrBegin="MSB4136: "} - - MSB4136: Fehler beim Lesen der Toolsetinformationen aus der Konfigurationsdatei "{0}". {1} - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4008: A conflicting assembly for the task assembly "{0}" has been found at "{1}". - MSB4008: в "{1}" обнаружена сборка, конфликтующая со сборкой задачи "{0}". - {StrBegin="MSB4008: "}UE: This message is shown when the type/class of a task cannot be resolved uniquely from a single assembly. - - MSB4008: Eine mit der Aufgabenassembly "{0}" in Konflikt stehende Assembly wurde in "{1}" gefunden. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4142: MSBuildToolsPath is not the same as MSBuildBinPath for the ToolsVersion "{0}" defined at "{1}". If both are present they must have the same value. - MSB4142: MSBuildToolsPath не соответствует MSBuildBinPath для ToolsVersion "{0}", определенной в "{1}". Если установлены оба пути, они должны иметь одинаковое значение. - {StrBegin="MSB4142: "} - - MSB4142: MSBuildToolsPath ist nicht identisch mit MSBuildBinPath für die bei "{1}" definierte ToolsVersion {0}. Wenn beide Pfade vorhanden sind, müssen sie identische Werte haben. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4097: The element <{0}> beneath element <{1}> may not have a custom XML namespace. - MSB4097: элемент <{0}> в элементе <{1}> не может иметь пользовательского пространства имен XML. - {StrBegin="MSB4097: "} - - MSB4097: Das Element <{0}> unter Element <{1}> möglicherweise keinen benutzerdefinierten XML-Namespace. - - fuzzyMatch="15" wordcount="16" adjWordcount="13.6" curWordcount="13.6" - - - MSB4009: The default tasks file could not be successfully loaded. {0} - MSB4009: не удалось успешно загрузить файл задач. {0} - {StrBegin="MSB4009: "}UE: This message is shown when one of the default tasks file (*.tasks) located alongside the MSBuild binaries cannot - be opened/parsed. "{0}" contains a message explaining why. The filename itself is not part of the message but is provided - separately to loggers. - LOCALIZATION: "{0}" is a message from some FX method and is already localized. - - MSB4009: Die Standardaufgabendatei konnte nicht geladen werden. {0} - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4010: The "{0}" files could not be successfully loaded from their expected location "{1}". Default tasks will not be available. {2} - MSB4010: не удалось успешно загрузить файлы "{0}" из папки "{1}", где они должны были находиться. Задачи по умолчанию будут недоступны. {2} - {StrBegin="MSB4010: "}UE: This message is shown when the default tasks files that are located alongside the MSBuild binaries cannot be - found, either because they don't exist, or because of lack of permissions. "{2}" contains a message explaining why. - LOCALIZATION: "{2}" is a message from some FX method and is already localized. - - MSB4010: Die {0}-Dateien konnten nicht vom erwarteten Speicherplatz "{1}" geladen werden. Standardaufgaben sind nicht verfügbar. {2} - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - MSB4140: Default tools version is specified in neither the registry nor the configuration file. - MSB4140: версия инструментов по умолчанию не указана ни в регистре, ни в файле конфигурации. - {StrBegin="MSB4140: "} - - MSB4140: Die Standardtoolsversion ist weder in der Registrierung noch in der Konfigurationsdatei angegeben. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4133: A default tools version "{0}" was specified, but its definition could not be found. - MSB4133: версия инструментов по умолчанию "{0}" указана, но не удалось найти ее определение. - {StrBegin="MSB4133: "} - - MSB4133: Eine Standardtoolsversion "{0}" wurde angegeben, aber ihre Definition konnte nicht gefunden werden. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - MSB4080: The value "{0}" of the "PropertyName" attribute in element <Output> contains a "$" character. If you intended to use a property name then remove the $( ) around the property name. - MSB4080: значение "{0}" атрибута PropertyName в элементе <Output> содержит знак "$". Если вы хотите использовать имя свойства, удалите $( ) с двух сторон имени свойства. - {StrBegin="MSB4080: "}UE: This message is shown when an output tag has an property name that contains an $. They probably typed $(foo) instead of foo in the PropertyName. LOCALIZATION: Output and PropertyName should not be localized. - - MSB4080: Der Wert "{0}" "PropertyName-Attribut im Element < Output >"$"-Zeichen enthält. Wenn Sie auf einen Eigenschaftennamen verwenden und entfernen Sie anschließend die ($), um den Eigenschaftennamen. - - fuzzyMatch="15" wordcount="32" adjWordcount="27.2" curWordcount="27.2" - - - MSB4011: There is a circular reference involving the import of file "{0}". This file may have been imported more than once, or you may have attempted to import the main project file. All except the first instance of this file will be ignored. - MSB4011: для импорта файла "{0}" существуют круговые ссылки. Файл мог быть импортирован несколько раз, или вы пытались импортировать основной файл проекта. Все, кроме первого экземпляра этого файла, будет пропущено. - {StrBegin="MSB4011: "} - - MSB4011: Es besteht eine Ringabhängigkeit im Zusammenhang mit dem Import der Datei {0}. Diese Datei wurde unter Umständen mehrmals importiert, oder es wurde versucht, die Hauptprojektdatei zu importieren. Alle außer der ersten Instanz dieser Datei werden ignoriert. - - fuzzyMatch="101" wordcount="43" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4079: The <ProjectExtensions> element occurs more than once. - MSB4079: элемент <ProjectExtensions> встречается несколько раз. - {StrBegin="MSB4079: "} - - MSB4079: Das Element < ProjectExtensions > tritt mehr als einmal. - - fuzzyMatch="15" wordcount="9" adjWordcount="7.65" curWordcount="7.65" - - - MSB4012: The expression "{0}" cannot be used in this context. Item lists cannot be concatenated with other strings where an item list is expected. Use a semicolon to separate multiple item lists. - MSB4012: выражение "{0}" нельзя использовать в этом контексте. Списки элементов не могут объединяться с другими строками, которые должны содержать список элементов. Списки элементов должны разделяться точкой с запятой (;). - {StrBegin="MSB4012: "}UE: This message is shown when the user does not properly specify an item list when an item list is expected - e.g. "badprefix@(foo)badsuffix" instead of "prefix; @(foo); suffix" - - MSB4012: Der Ausdruck {0} kann in diesem Kontext nicht verwendet werden. Elementlisten können nicht mit anderen Zeichenfolgen verkettet werden, wenn eine Elementliste erwartet wird. Verwenden Sie ein Semikolon, um mehrere Elementlisten voneinander zu trennen. - - fuzzyMatch="101" wordcount="32" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Need to specify the project file name. - Необходимо указать имя файла проекта. - UE: This message is shown when the user calls into the engine to build a project without specifying a filename. - - Geben Sie den Projektdateinamen an. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - end of input - конец входных данных - This is the name of the "EndOfInput" token. It is displayed in quotes as the - unexpected char or token when the end of a conditional was unexpectedly reached. - - Ende der Eingabe - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - The previous error was converted to a warning because the task was called with ContinueOnError=true. - Предыдущая ошибка преобразована в предупреждение, так как задача вызывалась с атрибутом ContinueOnError=true. - - - Der vorherige Fehler wurde in eine Warnung umgewandelt, da die Aufgabe mit ContinueOnError=true aufgerufen wurde. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - {0} Error(s) - Ошибок: {0} - - - {0} Fehler - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4159: Error creating the toolset "{0}". {1} - MSB4159: ошибка при создании набора инструментов "{0}". {1} - {StrBegin="MSB4159: "} - - MSB4159: Fehler beim Erstellen des Toolsets "{0}". {1} - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4146: Cannot evaluate the property expression "{0}" found at "{1}". {2} - MSB4146: не удается оценить выражение свойства "{0}", найденное в "{1}". {2} - {StrBegin="MSB4146: "} - - MSB4146: Der bei "{1}" gefundene Eigenschaftsausdruck "{0}" kann nicht ausgewertet werden. {2} - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - The <{0}> tag is no longer supported as a child of the <Project> element. Place this tag within a target, and add the name of the target to the "InitialTargets" attribute of the <Project> element. - Тег <{0}> уже не поддерживается как дочерний элемент <Project>. Включите этот тег в цель и добавьте имя цели в атрибут InitialTargets элемента <Project>. - - - Das <{0}>-Tag nicht als untergeordnetes Element des < Project >-Elements unterstützt. Platzieren Sie dieses Tag in einem Ziel und fügen Sie den Namen des Ziels InitialTargets-Attribut des < Project >-Elements hinzu. - - fuzzyMatch="15" wordcount="38" adjWordcount="32.3" curWordcount="32.3" - - - MSB4100: Expected "{0}" to evaluate to a boolean instead of "{1}", in condition "{2}". - MSB4100: в условии "{2}" результат вычисления "{0}" должен быть логическим выражением, а не "{1}". - {StrBegin="MSB4100: "} - - MSB4100: Das Ergebnis der Auswertung von {0} war {1}, es wurde jedoch ein boolescher Wert in der {2}-Bedingung erwartet. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4028: The "{0}" task's outputs could not be retrieved from the "{1}" parameter. {2} - MSB4028: не удалось получить выходные спецификации задачи "{0}" из параметра "{1}". {2} - {StrBegin="MSB4028: "} - - MSB4028: Die Ausgaben der {0}-Aufgabe konnten nicht aus dem {1}-Parameter abgerufen werden. {2} - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4014: The build was aborted because of an internal failure. - MSB4014: сборка прервана из-за внутренней ошибки. - {StrBegin="MSB4014: "}UE: This message is shown when an unhandled exception terminates the build. The cause is most likely a programming - error in the build engine. - - MSB4014: Das Erstellen wurde aufgrund eines internen Fehlers abgebrochen. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4015: The build was aborted because the "{0}" logger failed unexpectedly during shutdown. - MSB4015: сборка прервана из-за непредвиденного сбоя в журнале событий "{0}" при завершении работы. - {StrBegin="MSB4015: "}UE: This message is used for a special exception that is thrown when a logger fails while shutting down (most likely - because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a special - exception to abort the build. - - MSB4015: Das Erstellen wurde abgebrochen, da für die {0}-Protokollierung beim Herunterfahren ein unerwarteter Fehler aufgetreten ist. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4016: The build was aborted because the "{0}" logger failed unexpectedly during initialization. - MSB4016: сборка прервана из-за непредвиденного сбоя в журнале событий "{0}" во время инициализации. - {StrBegin="MSB4016: "}UE: This message is used for a special exception that is thrown when a logger fails while initializing itself (most - likely because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a - special exception to abort the build. - - MSB4016: Das Erstellen wurde abgebrochen, da für die {0}-Protokollierung bei der Initialisierung ein unerwarteter Fehler aufgetreten ist. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4017: The build was aborted because of an unexpected logger failure. - MSB4017: сборка прервана из-за непредвиденного сбоя в журнале событий. - {StrBegin="MSB4017: "}UE: This message is used for a special exception that is thrown when a logger fails while logging an event (most - likely because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a - special exception to abort the build. - - MSB4017: Das Erstellen wurde wegen eines unerwarteten Protokollierungsfehlers abgebrochen. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4018: The "{0}" task failed unexpectedly. - MSB4018: непредвиденная ошибка при выполнении задачи "{0}". - {StrBegin="MSB4018: "}UE: This message is shown when a task terminates because of an unhandled exception. The cause is most likely a - programming error in the task; however, it is also possible that the unhandled exception originated in the engine, and was - surfaced through the task when the task called into the engine. - - MSB4018: Unerwarteter Fehler bei der {0}-Aufgabe. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4165: Failed to receive a response from the child node "{0}" in the timeout period "{1}" ms. Shutting down. - MSB4165: не удалось получить ответ от дочернего узла "{0}" до истечения периода ожидания ("{1}" мсек.). Идет завершение работы. - {StrBegin="MSB4165: "} - - MSB4165: Vom untergeordneten Knoten "{0}" wurde innerhalb des Zeitlimits von "{1}" ms keine Antwort empfangen. Herunterfahren. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4088: Condition "{0}" is improperly constructed. - MSB4088: неправильное условие "{0}". - {StrBegin="MSB4088: "} - - MSB4088: Die {0}-Bedingung ist falsch konstruiert. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4105: Found an unexpected character '{2}' at position {1} in condition "{0}". Did you intend to use "=="? - MSB4105: неожиданный символ "{2}" в позиции {1} условия "{0}". Возможно, имеется в виду "==". - {StrBegin="MSB4105: "} - - MSB4105: Ein unerwartetes Zeichen {2} wurde an Position {1} in der {0}-Bedingung gefunden. Wollten Sie "==" verwenden? - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - MSB4106: Expected an item list at position {1} in condition "{0}". Did you forget the closing parenthesis? - MSB4106: в позиции {1} условия "{0}" ожидался список элементов. Возможно, отсутствует закрывающая круглая скобка. - {StrBegin="MSB4106: "} - - MSB4106: Eine Elementliste wurde an Position {1} in Bedingung {0} erwartet. Haben Sie die schließende Klammer vergessen? - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - MSB4107: Expected an item list at position {1} in condition "{0}". Did you forget the opening parenthesis after the '@'? To use a literal '@', use '%40' instead. - MSB4107: в позиции {1} условия "{0}" ожидался список элементов. Возможно, отсутствует открывающая круглая скобка после "@". Если требуется литерал "@", используйте "%40". - {StrBegin="MSB4107: "} - - MSB4107: Eine Elementliste wurde an Position {1} in Bedingung {0} erwartet. Haben Sie die öffnende Klammer hinter dem Zeichen "@" vergessen? Wenn Sie ein literales "@" verwenden möchten, geben Sie "%40" ein. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4108: Expected an item list at position {1} in condition "{0}". Did you forget to close a quote inside the item list expression? - MSB4108: в позиции {1} условия "{0}" ожидался список элементов. Возможно, не закрыты кавычки в выражении списка элементов. - {StrBegin="MSB4108: "} - - MSB4108: Eine Elementliste wurde an Position {1} in Bedingung {0} erwartet. Haben Sie das schließende Anführungszeichen innerhalb des Elementlistenausdrucks vergessen? - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - MSB4109: Expected a property at position {1} in condition "{0}". Did you forget the closing parenthesis? - MSB4109: в позиции {1} условия "{0}" ожидалось свойство. Возможно, отсутствует закрывающая круглая скобка. - {StrBegin="MSB4109: "} - - MSB4109: Eine Eigenschaft wurde an Position {1} in Bedingung {0} erwartet. Haben Sie die schließende Klammer vergessen? - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB4110: Expected a property at position {1} in condition "{0}". Did you forget the opening parenthesis after the '$'? To use a literal '$', use '%24' instead. - MSB4110: в позиции {1} условия "{0}" ожидалось свойство. Возможно, отсутствует открывающая круглая скобка после "$". Если требуется литерал "$", используйте "%24". - {StrBegin="MSB4110: "} - - MSB4110: Eine Eigenschaft wurde an Position {1} in Bedingung {0} erwartet. Haben Sie die öffnende Klammer hinter dem Zeichen "$" vergessen? Wenn Sie eine literales "$" verwenden möchten, geben Sie "%24" ein. - - fuzzyMatch="101" wordcount="27" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4101: Expected a closing quote after position {1} in condition "{0}". - MSB4101: после позиции {1} в условии "{0}" должна быть закрывающая кавычка. - {StrBegin="MSB4101: "} - - MSB4101: Es wurde ein schließendes Anführungszeichen hinter Position {1} in Bedingung {0} erwartet. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4019: The imported project "{0}" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. - MSB4019: импортированный проект "{0}" не обнаружен. Проверьте путь в объявлении <Import> и наличие файла на диске. - {StrBegin="MSB4019: "}LOCALIZATION: <Import> should not be localized. - - MSB4019: Das importierte Projekt "{0}" wurde nicht gefunden. Bestätigen Sie den Pfad in der Deklaration < Import > und die Datei auf dem Datenträger vorhanden ist. - - fuzzyMatch="15" wordcount="26" adjWordcount="22.1" curWordcount="22.1" - - - MSB4089: Incorrect number of arguments to function in condition "{0}". Found {1} argument(s) when expecting {2}. - MSB4089: неправильное число аргументов для функции в условии "{0}". Найдено аргументов: {1}, ожидалось: {2}. - {StrBegin="MSB4089: "} - - MSB4089: Falsche Anzahl von Argumenten für eine Funktion in der Bedingung "{0}". {1} Argument(e) gefunden, obwohl {2} erwartet wurde(n). - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - The "{0}" object specified does not belong to the correct "{1}" object. - Указанный объект "{0}" не принадлежит правильному объекту "{1}". - - - Das angegebene {0}-Objekt gehört nicht zum korrekten {1}-Objekt. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4020: The value "{0}" of the "{1}" attribute in element <{2}> is invalid. - MSB4020: значение "{0}" атрибута "{1}" в элементе <{2}> недопустимо. - {StrBegin="MSB4020: "}UE: This is a generic message that is displayed when we find a project element with an incorrect value for one of its - attributes e.g. <Import Project=""> -- the value of Project should not be an empty string. - - MSB4020: Der Wert "{0}" von der "{1}" Attribut im Element <{2}> ist ungültig. - - fuzzyMatch="15" wordcount="14" adjWordcount="11.9" curWordcount="11.9" - - - MSB4102: The value "{0}" of the "{1}" attribute in element <{2}> is invalid. {3} - MSB4102: значение "{0}" атрибута "{1}" в элементе <{2}> недопустимо. {3} - {StrBegin="MSB4102: "}UE: This is a generic message that is displayed when we find a project element with an incorrect value for one of its - attributes. At the end of the message we show the exception text we got trying to use the value. - - MSB4102: Der Wert "{0}" von der "{1}" Attribut im Element <{2}> ist ungültig. {3} - - fuzzyMatch="15" wordcount="15" adjWordcount="12.75" curWordcount="12.75" - - - MSB4021: The "ContinueOnError" attribute of the "{0}" task is not valid. {1} - MSB4021: недопустимый атрибут ContinueOnError для задачи "{0}". {1} - {StrBegin="MSB4021: "}LOCALIZATION: "ContinueOnError" should not be localized. "{1}" is a message from another exception explaining the problem. - - MSB4021: Das ContinueOnError-Attribut für die {0}-Aufgabe ist ungültig. {1} - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4139: Invalid value for default ToolsVersion is specified in registry key "{0}". - MSB4139: указано недопустимое значение ToolsVersion по умолчанию в разделе реестра "{0}". - {StrBegin="MSB4139: "} - - MSB4139: Im Registrierungsschlüssel "{0}" ist ein ungültiger Wert für die Standard-ToolsVersion angegeben. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4022: The result "{0}" of evaluating the value "{1}" of the "{2}" attribute in element <{3}> is not valid. - MSB4022: результат "{0}" вычисления значения "{1}" атрибута "{2}" в элементе <{3}> недопустим. - {StrBegin="MSB4022: "}UE: This message is shown when the engine is checking the correctness of the value (after evaluating embedded - properties/items) assigned to an XML attribute of an XML element in the project file. - - MSB4022: Das Ergebnis "{0}"der Auswertung des Werts"{1}" von der "{2}" Attribut im Element <{3}> ist ungültig. - - fuzzyMatch="15" wordcount="20" adjWordcount="17" curWordcount="17" - - - "{0}" is not a valid event category. To raise a custom event, use the "{1}" category. - "{0}" — недопустимая категория события. Для создания пользовательского события используйте категорию "{1}". - - - {0} ist keine gültige Ereigniskategorie. Verwenden Sie die {1}-Kategorie, um ein benutzerdefiniertes Ereignis auszulösen. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - "{0}" is not a valid importance level for events. - "{0}" — недопустимый уровень важности событий. - - - {0} ist kein gültiger Wert für die Bedeutung eines Ereignisses. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4104: Failed to write to log file "{0}". {1} - MSB4104: ошибка при записи в файл журнала "{0}". {1} - {StrBegin="MSB4104: "}UE: This is shown when the File Logger can't create or write to the file it was instructed to log to. - - MSB4104: Fehler beim Schreiben in die Protokollierungsdatei "{0}". {1} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4024: The imported project file could not be loaded. {0} - MSB4024: не удалось загрузить импортированный файл проекта. {0} - {StrBegin="MSB4024: "}UE: This message is shown when an imported project file cannot be loaded because of incorrect XML. The project - filename is not part of the message because it is provided separately to loggers. - LOCALIZATION: {0} is a localized message from the CLR/FX explaining why the project is invalid. - - MSB4024: Die importierte Projektdatei konnte nicht geladen werden. {0} - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - Operation invalid for a persisted item group. - Операция недопустима для постоянной группы элементов. - - - Ungültiger Vorgang für eine persistente Elementgruppe. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Operation invalid for a virtual item group. - Операция недопустима для виртуальной группы элементов. - - - Ungültiger Vorgang für eine virtuelle Elementgruppe. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4071: The value Importance="{0}" in the <Message> element is invalid. Valid values are: High, Normal and Low. - MSB4071: недопустимое значение Importance="{0}" в элементе <Message>. Допустимые значения: High, Normal и Low. - {StrBegin="MSB4071: "}UE: This message is shown when a user specifies a value for the importance attribute of Message which is not valid. - The importance enumeration is: High, Normal and Low. Specifying any other importance will result in this message being shown - LOCALIZATION: "Importance" should not be localized. - "Message" should not be localized. - High should not be localized. - Normal should not be localized. - Low should not be localized. - - MSB4071: Der Wert Importance = "{0}" in < Nachricht > Element ist ungültig. Gültige Werte sind: hoch, Normal und niedrig. - - fuzzyMatch="15" wordcount="18" adjWordcount="15.3" curWordcount="15.3" - - - MSB4025: The project file could not be loaded. {0} - MSB4025: не удалось загрузить файл проекта. {0} - {StrBegin="MSB4025: "}UE: This message is shown when the project file given to the engine cannot be loaded because the filename/path is - invalid, or due to lack of permissions, or incorrect XML. The project filename is not part of the message because it is - provided separately to loggers. - LOCALIZATION: {0} is a localized message from the CLR/FX explaining why the project is invalid. - - MSB4025: Die Projektdatei konnte nicht geladen werden. {0} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4147: The property "{0}" at "{1}" is invalid. {2} - MSB4147: недопустимое свойство "{0}" в "{1}". {2} - {StrBegin="MSB4147: "} - - MSB4147: Die {0}-Eigenschaft bei "{1}" ist ungültig. {2} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - "{0}" is an invalid "ProjectFileEncoding" value. - "{0}" — недопустимое значение ProjectFileEncoding". - LOCALIZATION: "ProjectFileEncoding" should not be localized. - - {0} ist ein ungültiger ProjectFileEncoding-Wert. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4143: The expression "{0}" cannot be evaluated. {1} - MSB4143: не удается оценить выражение "{0}". {1} - {StrBegin="MSB4143: "} - UE: This message is shown when the user attempts to provide an expression like "$(Registry:HKEY_LOCAL_MACHINE\Software\Vendor\Tools@TaskLocation)" - LOCALIZATION: "{0}" is the expression that was bad. "{1}" is a message from an FX exception that describes why the expression is bad. - - - MSB4143: Der Ausdruck "{0}" kann nicht ausgewertet werden. {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4184: The expression "{0}" cannot be evaluated. {1} - MSB4184: не удается вычислить выражение "{0}". {1} - {StrBegin="MSB4184: "} - Single quotes as the expression will typically have double quotes in it. - UE: This message is shown when the user attempts to provide an expression like "$(SomeProperty.ToLower())" - LOCALIZATION: "{0}" is the expression that was bad. "{1}" is a message from an FX exception that describes why the expression is bad. - - - MSB4184: Der Ausdruck "{0}" kann nicht ausgewertet werden. {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4185: The function "{0}" on type "{1}" has not been enabled for execution. - MSB4185: выполнение функции "{0}" для типа "{1}" не было разрешено. - {StrBegin="MSB4185: "} - UE: This message is shown when the user attempts to provide an expression like "$([System.DateTime]::Now)", but the expression has not been enabled - LOCALIZATION: "{0}" is the static function name, "{1}" is the .NET Framework type name - - - MSB4185: Die {0}-Funktion für den {1}-Typ wurde nicht für die Ausführung aktiviert. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4186: Invalid static method invocation syntax: "{0}". Static method invocation should be of the form: $([FullTypeName]::Method()), e.g. $([System.IO.Path]::Combine(`a`, `b`)) - MSB4186: недопустимый синтаксис вызова статического метода: "{0}". Вызов статического метода должен иметь следующую форму: $([FullTypeName]::Method()), например: $([System.IO.Path]::Combine(`a`, `b`)) - {StrBegin="MSB4186: "} - UE: This message is shown when the user attempts to call a static method on a type, but has used the incorrect syntax - LOCALIZATION: "{0}" is the function expression which is in error - - - MSB4186: Ungültige Aufrufsyntax für statische Methode: "{0}". Für den Aufruf statischer Methoden muss folgendes Format verwendet werden: $([vollständiger Typname]::Methode()), z. B. $([System.IO.Path]::Combine(`a`, `b`)) - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4070: The schema "{0}" is not valid. {1} - MSB4070: недопустимая схема "{0}". {1} - {StrBegin="MSB4070: "}UE: This message is shown when the schema file provided for the validation of a project is itself not valid. - LOCALIZATION: "{0}" is the schema file path. "{1}" is a message from an FX exception that describes why the schema file is bad. - - MSB4070: Das Schema "{0}" ist nicht gültig. {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4026: The "{0}={1}" parameter for the "{2}" task is invalid. - MSB4026: нНедопустимый параметр "{0}={1}" для задачи "{2}". - {StrBegin="MSB4026: "}UE: This message is displayed when a task has an invalid parameter that cannot be initialized. - - MSB4026: Der {0}={1}-Parameter für die {2}-Aufgabe ist ungültig. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4027: The "{0}" task generated invalid items from the "{1}" output parameter. {2} - MSB4027: задача "{0}" сгенерировала недопустимые элементы на основе выходного параметра "{1}". {2} - {StrBegin="MSB4027: "} - - MSB4027: Die {0}-Aufgabe generierte ungültige Elemente aus dem {1}-Ausgabeparameter. {2} - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4029: The "{0}" task has an invalid output specification. The "TaskParameter" attribute is required, and either the "ItemName" or "PropertyName" attribute must be specified (but not both). - MSB4029: недопустимая спецификация вывода у задачи "{0}". Требуется атрибут TaskParameter, а также атрибут ItemName или PropertyName (но не оба). - {StrBegin="MSB4029: "}LOCALIZATION: "TaskParameter", "ItemName" and "PropertyName" should not be localized. - - MSB4029: Die {0}-Aufgabe enthält eine ungültige Ausgabespezifikation. Das TaskParameter-Attribut ist erforderlich, und es muss entweder das ItemName- oder PropertyName-Attribut angegeben werden (jedoch nicht beide). - - fuzzyMatch="101" wordcount="27" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4030: "{0}" is an invalid value for the "{1}" parameter of the "{3}" task. The "{1}" parameter is of type "{2}". - MSB4030: "{0}" — недопустимое значение для параметра "{1}" задачи "{3}". Параметр "{1}" относится к типу "{2}". - {StrBegin="MSB4030: "}UE: This error is shown when a type mis-match occurs between the value assigned to task parameter in the project file - and the type of the .NET property that corresponds to the task parameter. For example, if an int task parameter called "Count" - is assigned the value "x", this error would be displayed: <MyTask Count="x" /> - - MSB4030: "{0}" ist ein ungültiger Wert für den {1}-Parameter der {3}-Aufgabe. Der {1}-Parameter ist vom Typ "{2}". - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - MSB4137: Invalid value specified in the configuration file at "{0}". Property name or tools version name is an empty string. - MSB4137: указано недопустимое значение в файле конфигурации в "{0}". Имя свойства или название версии инструментов является пустой строкой. - {StrBegin="MSB4137: "} - - MSB4137: In der Konfigurationsdatei ist bei "{0}" ein ungültiger Wert angegeben. Der Eigenschaftenname oder der Toolsversionname ist eine leere Zeichenfolge. - - fuzzyMatch="100" wordcount="20" adjWordcount="5" curWordcount="5" tmLabel="N''" - - - MSB4103: "{0}" is not a valid logger verbosity level. - MSB4103: "{0}" не является допустимым уровнем детализации средства ведения журнала. - {StrBegin="MSB4103: "} - - MSB4103: "{0}" ist kein gültiger Ausführlichkeitsgrad für die Protokollierung. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4163: <ItemDefinitionGroup> is not allowed inside a target. - MSB4163: <ItemDefinitionGroup> не допускается внутри конечного объекта. - {StrBegin="MSB4163: "} - - MSB4163: < ItemDefinitionGroup > ist in einem Ziel nicht zulässig. - - fuzzyMatch="15" wordcount="9" adjWordcount="7.65" curWordcount="7.65" - - - The specified item does not belong to the current item group. - Указанный элемент не принадлежит текущей группе элементов. - - - Das angegebene Element gehört nicht zu der aktuellen Elementgruppe. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4096: The item "{0}" in item list "{1}" does not define a value for metadata "{2}". In order to use this metadata, either qualify it by specifying %({1}.{2}), or ensure that all items in this list define a value for this metadata. - MSB4096: элемент "{0}" в списке элементов "{1}" не указывает значение для метаданных "{2}". Чтобы использовать эти метаданные, необходимо указать их путем задания %({1}.{2}), либо все элементы в списке должны указывать значение для этих метаданных. - {StrBegin="MSB4096: "} - - MSB4096: Das Element "{0}" in der Elementliste "{1}" definiert keinen Wert für die {2}-Metadaten. Wenn Sie diese Metadaten verwenden möchten, qualifizieren Sie sie, indem Sie %({1}.{2}) angeben, oder vergewissern Sie sich, dass alle Elemente in der Liste einen Wert für diese Metadaten definieren. - - fuzzyMatch="101" wordcount="42" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4099: A reference to an item list at position {1} is not allowed in this condition "{0}". - MSB4099: в этом условии "{0}" ссылка на список элементов в позиции {1} не допускается. - {StrBegin="MSB4099: "} - - MSB4099: Ein Verweis auf eine Elementliste an Position {1} ist in dieser {0}-Bedingung nicht zulässig. - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - MSB4033: "{0}" is a reserved item metadata, and cannot be redefined as a custom metadata on the item. - MSB4033: "{0}" — это зарезервированные метаданные элемента, которые не могут быть переопределены как пользовательские метаданные элемента. - {StrBegin="MSB4033: "} - - MSB4033: "{0}" sind reservierte Elementmetadaten und können nicht als benutzerdefinierte Metadaten für das Element neu definiert werden. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - An InternalLoggerException can only be thrown by the MSBuild engine. The public constructors of this class cannot be used to create an instance of the exception. - Исключение InternalLoggerException может быть вызвано только модулем MSBuild. Открытые конструкторы этого класса нельзя использовать для создания экземпляра исключения. - UE: This message is shown when a user tries to instantiate a special exception called InternalLoggerException through the OM -- - only the engine is allowed to create and throw this exception. - LOCALIZATION: "InternalLoggerException" and "MSBuild" should not be localized. - - Eine InternalLoggerException kann nur durch das MSBuild-Modul ausgelöst werden. Die öffentlichen Konstruktoren dieser Klasse können nicht verwendet werden, um eine Instanz der Ausnahme zu erstellen. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Initial Items: - Начальные элементы: - - - Ursprüngliche Elemente: - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4083: Expected a Condition attribute on element "{0}". - MSB4083: ожидается атрибут Condition элемента "{0}". - {StrBegin="MSB4083: "} - - MSB4083: Es wurde ein Bedingungsattribut für das {0}-Element erwartet. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4164: The value "{0}" of metadata "{1}" contains an item list expression. Item list expressions are not allowed on default metadata values. - MSB4164: значение "{0}" метаданных "{1}" содержит выражение списка элементов. Выражения списков элементов запрещены для значений метаданных по умолчанию. - {StrBegin="MSB4164: "} - - MSB4164: Der Wert "{0}" der {1}-Metadaten enthält einen Elementlistenausdruck. Elementlistenausdrücke sind nicht als Standardwerte für Metadaten zulässig. - - fuzzyMatch="100" wordcount="22" adjWordcount="5.5" curWordcount="5.5" tmLabel="N''" - - - MSBuild is expecting a valid "{0}" object. - Для MSBuild требуется допустимый объект "{0}". - - - MSBuild erwartet ein gültiges {0}-Objekt. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4035: The required attribute "{0}" is missing from element <{1}>. - MSB4035: у элемента <{1}> отсутствует обязательный атрибут "{0}". - {StrBegin="MSB4035: "}UE: This message is shown when a user leaves off a required attribute from a project element - e.g. <UsingTask AssemblyName="foo"> -- this is missing the "TaskName" attribute. - - MSB4035: Das erforderliche Attribut "{0}"-Element fehlt <{1}>. - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB4036: The "{0}" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "{1}" directory. - MSB4036: задача "{0}" не найдена. Проверьте следующее. 1. Имя задачи в файле проекта совпадает с именем класса задачи. 2. Класс задачи относится к категории "public" и реализует интерфейс Microsoft.Build.Framework.ITask. 3. Задача правильно объявлена с помощью <UsingTask> в файле проекта или в файлах с расширением TASKS в каталоге "{1}". - {StrBegin="MSB4036: "}LOCALIZATION: <UsingTask> and "*.tasks" should not be localized. - - MSB4036: Die "{0}" Task wurde nicht gefunden. Überprüfen Sie Folgendes: 1.) der Name der Aufgabe in der Projektdatei entspricht dem Namen der Aufgabenklasse. 2) die Aufgabenklasse ist "public" und implementiert die Microsoft.Build.Framework.ITask-Schnittstelle. 3) die Aufgabe korrekt mit < UsingTask > deklariert, in der Projektdatei oder in den Tasks-Dateien der "{1}" Verzeichnis. - - fuzzyMatch="15" wordcount="64" adjWordcount="54.4" curWordcount="54.4" - - - MSB4141: MSBuildToolsPath is not specified for the ToolsVersion "{0}" defined at "{1}", or the value specified evaluates to the empty string. - MSB4141: не указан путь MSBuildToolsPath для версии ToolsVersion "{0}", определенной в "{1}", или результатом вычисления указанного значения является пустая строка. - {StrBegin="MSB4141: "} - - MSB4141: MSBuildToolsPath ist für die bei "{1}" definierte ToolsVersion {0} nicht angegeben, oder der angegebene Wert wird zu einer leeren Zeichenfolge ausgewertet. - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - MSB4031: The "MSBuildVersion" attribute is deprecated. If the project is authored in the MSBuild 2003 format, please remove the attribute from the <Project> tag. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format. - MSB4031: атрибут MSBuildVersion устарел. Если проект создан в формате MSBuild 2003, удалите этот атрибут в теге <Project>. Если проект был создан в старом формате 1.0 или 1.2, преобразуйте его в формат MSBuild 2003. - {StrBegin="MSB4031: "}UE: This message is shown for projects that still contain the "MSBuildVersion" attribute in their <Project> - tag. We no longer need this attribute because the project's XML namespace (i.e. the "xmlns" attribute) gives us all the - version information we need. - LOCALIZATION: "MSBuild", "MSBuildVersion" and <Project> should not be localized. - - MSB4031: Das Attribut "MSBuildVersion" ist veraltet. Wenn das Projekt im Format MSBuild 2003 erstellt wurde, entfernen Sie das Attribut aus dem Tag < Project >. Wenn das Projekt im alten Format 1.0 oder 1.2 erstellt wurde, konvertieren Sie es in das MSBuild 2003-Format. - - fuzzyMatch="15" wordcount="45" adjWordcount="38.25" curWordcount="38.25" - - - MSB4144: Multiple definitions were found for the toolset "{0}". - MSB4144: для набора инструментов "{0}" найдено несколько определений. - {StrBegin="MSB4144: "} - - MSB4144: Für das Toolset wurden mehrere Definitionen gefunden "{0}". - - fuzzyMatch="15" wordcount="9" adjWordcount="7.65" curWordcount="7.65" - - - MSB4145: Multiple definitions were found for the property "{0}". - MSB4145: для свойства "{0}" найдено несколько определений. - {StrBegin="MSB4145: "} - - MSB4145: Für die {0}-Eigenschaft wurden mehrere Definitionen gefunden. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4082: Choose has more than one <Otherwise> element. - MSB4082: элемент Choose содержит несколько элементов <Otherwise>. - {StrBegin="MSB4082: "} - - MSB4082: Wählen Sie mehrere < Otherwise >-Element enthält. - - fuzzyMatch="15" wordcount="9" adjWordcount="7.65" curWordcount="7.65" - - - This method is only valid for persisted <{0}> elements. - Этот метод допустим только для постоянных элементов <{0}>. - - - Diese Methode ist nur gültig für beibehalten <{0}> Elemente. - - fuzzyMatch="15" wordcount="10" adjWordcount="8.5" curWordcount="8.5" - - - This method is only valid for virtual property groups, not <{0}> elements. - Этот метод допустим только для виртуальных групп свойств, а не для элементов <{0}>. - - - Diese Methode gilt nur für virtuelle Eigenschaftengruppen nicht <{0}> Elemente. - - fuzzyMatch="15" wordcount="13" adjWordcount="11.05" curWordcount="11.05" - - - MSB4038: The element <{0}> must be last under element <{1}>. Found element <{2}> instead. - MSB4038: последним в элементе <{1}> должен быть элемент <{0}>. Вместо этого обнаружен элемент <{2}>. - {StrBegin="MSB4038: "} - - MSB4038: Das Element <{0}> muss unter Element <{1}>. Element wurde gefunden <{2}> statt. - - fuzzyMatch="15" wordcount="17" adjWordcount="14.45" curWordcount="14.45" - - - MSB4138: Non-string data was specified at the registry location "{0}". - MSB4138: в разделе реестра "{0}" указаны нестроковые данные. - {StrBegin="MSB4138: "} - - MSB4138: Am Registrierungsspeicherort "{0}" wurden Daten angegeben, die keine Zeichenfolge sind. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4039: No "{0}" element was found in the project file. - MSB4039: элемент "{0}" не найден в файле проекта. - {StrBegin="MSB4039: "} - - MSB4039: Das {0}-Element wurde in der Projektdatei nicht gefunden. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4040: There is no target in the project. - MSB4040: в проекте нет целевого объекта. - {StrBegin="MSB4040: "} - - MSB4040: Das Projekt enthält kein Ziel. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Removing the "{0}" attribute of an item is not allowed. - Удаление атрибута "{0}" элемента запрещено. - - - Das Löschen des {0}-Attributs eines Elements ist nicht zulässig. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - The object passed in is not part of the project. - Переданный объект не является частью проекта. - - - Das übergebene Objekt ist nicht Teil des Projekts. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - Overriding target "{0}" in project "{1}" with target "{2}" from project "{3}". - Переопределение целевого объекта "{0}" в проекте "{1}" целевым объект "{2}" из проекта "{3}". - - - Das Ziel "{0}" im Projekt "{1}" wird durch das Ziel "{2}" aus dem Projekt "{3}" außer Kraft gesetzt. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4167: The parent process unexpectedly exited. Shutting down child node "{0}". - MSB4167: произошел преждевременный выход из родительского процесса. Идет завершение работы дочернего узла "{0}". - {StrBegin="MSB4167: "} - - MSB4167: Der übergeordnete Prozess wurde unerwartet beendet. Der untergeordnete Knoten "{0}" wird heruntergefahren. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - {0} ms {1} {2} calls - {0} мс вызовов {2} {1} - - - {0} ms {1} {2} Aufrufe - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - (* = timing was not recorded because of reentrancy) - (* = время не было записано из-за реентерабельности) - - - (* = Zeit wurde aufgrund des erneuten Eintretens nicht aufgezeichnet) - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - This project object has been unloaded from the MSBuild engine and is no longer valid. - Этот проект удален из модуля MSBuild и теперь недействителен. - - - Dieses Projektobjekt wurde aus dem MSBuild-Modul entladen und ist nicht mehr gültig. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - The project file "{0}" was not found. - Файл "{0}" не найден. - UE: This message is shown when the user calls into the OM to build a project that doesn't exist on disk. - - Die Projektdatei "{0}" wurde nicht gefunden. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Done building project "{0}" -- FAILED. - Сборка проекта "{0}" завершена с ошибкой. - - - Die Erstellung des Projekts "{0}" ist abgeschlossen – FEHLER. - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Done building project "{0}". - Сборка проекта "{0}" завершена. - - - Die Erstellung des Projekts "{0}" ist abgeschlossen. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - MSB4041: The default XML namespace of the project must be the MSBuild XML namespace. If the project is authored in the MSBuild 2003 format, please add xmlns="{0}" to the <Project> element. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format. - MSB4041: пространством имен XML по умолчанию для этого проекта должно быть пространством имен MSBuild XML. Если проект создан в формате MSBuild 2003, добавьте xmlns="{0}" в элемент <Project>. Если проект был создан в старом формате 1.0 или 1.2, преобразуйте его в формат MSBuild 2003. - {StrBegin="MSB4041: "}UE: This is a Beta 1 message only. - LOCALIZATION: <Project>, "MSBuild" and "xmlns" should not be localized. - - MSB4041: Der XML-Standardnamespace des Projekts muss MSBuild XML-Namespace. Wenn das Projekt im Format MSBuild 2003 erstellt wurde, fügen Sie Xmlns = "{0}" < Project >-Element. Wenn das Projekt im alten Format 1.0 oder 1.2 erstellt wurde, konvertieren Sie es in das MSBuild 2003-Format. - - fuzzyMatch="15" wordcount="52" adjWordcount="44.2" curWordcount="44.2" - - - Project Performance Summary: - Итоги по проекту: - - - Leistungszusammenfassung für das Projekt: - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - MSB4042: Stopping because of syntax errors in project file. - MSB4042: остановка из-за синтаксических ошибок в файле проекта. - {StrBegin="MSB4042: "} - - MSB4042: Prozess aufgrund von Syntaxfehlern in der Projektdatei angehalten. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - Project "{0}" is building "{1}" ({2} target(s)): - Проект "{0}" создает "{1}" (целевые объекты {2}): - - - Das Projekt {0} erstellt {1} ({2} Ziel(e)): - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Project "{0}" is building "{1}" (default targets): - Проект "{0}" создает "{1}" (целевые объекты по умолчанию): - - - Das Projekt "{0}" erstellt "{1}" (Standardziele): - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Project "{0}" ({1} target(s)): - Проект "{0}" (целевые объекты {1}): - - - Projekt "{0}", {1} Ziel(e): - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - Project "{0}" (default targets): - Проект "{0}" (целевые объекты по умолчанию): - - - Projekt "{0}" (Standardziele): - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - Done Building Project "{0}" ({1} target(s)). - Сборка проекта "{0}" завершена (целевые объекты {1}). - - - Die Erstellung von Projekt "{0}" ist abgeschlossen ({1} Ziel(e)). - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Done Building Project "{0}" (default targets). - Сборка проекта "{0}" завершена (целевые объекты по умолчанию). - - - Die Erstellung von Projekt "{0}" ist abgeschlossen (Standardziele). - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Done Building Project "{0}" ({1} target(s)) -- FAILED. - Сборка проекта "{0}" завершена (целевые объекты {1}) с ошибкой. - - - Die Erstellung des Projekts "{0}" ist abgeschlossen, {1} Ziel(e) -- FEHLER. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Done Building Project "{0}" (default targets) -- FAILED. - Сборка проекта "{0}" завершена (целевые объекты по умолчанию) с ошибкой. - - - Die Erstellung von Projekt "{0}" ist abgeschlossen (Standardziele) -- FEHLER. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4075: The project file must be opened in the Visual Studio IDE and converted to the latest version before it can be built by MSBuild. - MSB4075: файл проекта должен быть открыт в среде Visual Studio и преобразован в последнюю версию, прежде чем программа MSBuild сможет построить этот проект. - {StrBegin="MSB4075: "} - - MSB4075: Die Projektdatei muss in der Visual Studio IDE geöffnet und in ein aktuelles Versionsformat gebracht werden, bevor sie mit MSBuild erstellt werden kann. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4192: The project file "{0}" is in the ".vcproj" file format, which MSBuild no longer supports. Please convert the project by opening it in the Visual Studio IDE or running the conversion tool, or use MSBuild 3.5 or earlier to build it. - MSB4192: файл проекта "{0}" имеет формат VCPROJ, который больше не поддерживается MSBuild. Преобразуйте проект, открыв его в интегрированной среде разработки Visual Studio или запустив средство преобразования, либо используйте для его сборки MSBuild 3.5 или более ранней версии. - {StrBegin="MSB4192: "} LOC: ".vcproj" should not be localized - - MSB4192: Die Projektdatei "{0}" ist im VSPROJ-Dateiformat gespeichert, das nicht mehr von MSBuild unterstützt wird. Konvertieren Sie das Projekt, indem Sie es in der Visual Studio IDE öffnen oder das Konvertierungstool ausführen, oder verwenden Sie MSBuild 3.5 oder früher zum Erstellen des Projekts. - - fuzzyMatch="101" wordcount="42" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - The specified property does not belong to the current property group. - Указанное свойство не принадлежит текущей группе свойств. - - - Die angegebene Eigenschaft gehört nicht zu der aktuellen Eigenschaftengruppe. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - Initial Properties: - Начальные свойства: - - - Ursprüngliche Eigenschaften: - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4148: The name of a property stored under the registry key "{0}" has zero length. - MSB4148: имя свойства, сохраненное в разделе реестра "{0}", имеет нулевую длину. - {StrBegin="MSB4148: "} - - MSB4148: Der Name einer unter dem Registrierungsschlüssel "{0}" gespeicherten Eigenschaft hat eine Länge von Null. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - The property names in the indexer and the "{0}" object do not match. - Имена свойств в индексаторе не соответствуют объекту "{0}". - - - Die Eigenschaftennamen im Indexer und das {0}-Objekt stimmen nicht überein. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4043: The item metadata reference "{0}" is invalid because it is qualified with an item name. Item metadata referenced in transforms do not need to be qualified, because the item name is automatically deduced from the items being transformed. Change "{0}" to "%({1})". - MSB4043: ссылка на метаданные элемента "{0}" недопустима, так как в ней указано имя элемента. Нет необходимости определять имена метаданных элементов в ссылках в преобразованиях, так как имя элемента автоматически извлекается из преобразуемых элементов. Измените "{0}" на "%({1})". - {StrBegin="MSB4043: "}UE: This message is shown when the user does something like this: @(foo->'%(foo.metadata)'). There is no need to specify - "foo.metadata", because "foo" is automatically deduced. In corollary, "bar.metadata" is not allowed either, where "bar" is a different - item list type. - - MSB4043: Der Elementmetadatenverweis "{0}" ist ungültig, da er mit einem Elementnamen qualifiziert ist. Elementmetadaten, auf die bei Transformationen verwiesen wird, müssen nicht qualifiziert werden, da der Elementname automatisch aus den transformierten Elementen abgeleitet wird. Ändern Sie "{0}" in "%({1})". - - fuzzyMatch="101" wordcount="43" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4135: Error reading the toolset information from the registry location "{0}". {1} - MSB4135: ошибка считывания сведений о пакете инструментов из раздела реестра "{0}". {1} - {StrBegin="MSB4135: "} - - MSB4135: Fehler beim Lesen der Toolsetinformationen am Registrierungsspeicherort "{0}". {1} - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4044: The "{0}" task was not given a value for the required parameter "{1}". - MSB4044: для задачи "{0}" не было указано значение для обязательного параметра "{1}". - {StrBegin="MSB4044: "}UE: This message is shown when a task parameter designated as "required" is not set in the project file. - - MSB4044: Die {0}-Aufgabe hat keinen Wert für den erforderlichen {1}-Parameter erhalten. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - Validating project using schema file "{0}". - Идет проверка проекта с использованием файла схемы "{0}". - LOCALIZATION: "{0}" is the location of the schema file. - - Das Projekt wird anhand der Schemadatei "{0}" überprüft. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4045: Project is not valid. {0} - MSB4045: проект недействителен. {0} - {StrBegin="MSB4045: "}UE: This error is shown when the user asks his project to be validated against a schema (/val switch for - MSBuild.exe), and the project has errors. "{0}" contains a message explaining the problem. - LOCALIZATION: "{0}" is a message from the System.XML schema validator and is already localized. - - MSB4045: Ungültiges Projekt. {0} - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4112: The targets in this project have been disabled by the host and therefore cannot be built at this time. This may have been done for security reasons. To enable the targets, the host must set Project.BuildEnabled to "true". - MSB4112: целевые объекты в этом проекте отключены базовой средой, и их сборка сейчас невозможна. Это могло быть сделано по соображениям безопасности. Для включения целевых объектов базовая среда должна присвоить свойству Project.BuildEnabled значение true. - {StrBegin="MSB4112: "} - - MSB4112: Die Ziele in diesem Projekt wurden vom Host deaktiviert und können aus diesem Grund derzeit nicht erstellt werden. Die Deaktivierung wurde wahrscheinlich aus Sicherheitsgründen durchgeführt. Wenn Sie die Ziele aktivieren möchten, muss der Host Project.BuildEnabled auf "true" festlegen. - - fuzzyMatch="101" wordcount="39" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4093: The "{0}" parameter of the "{1}" task cannot be written to because it does not have a "set" accessor. - MSB4093: запись в параметр "{0}" задачи "{1}" невозможна из-за отсутствия метода доступа set. - {StrBegin="MSB4093: "}UE: This error is shown when a project tries to assign a value to a task parameter that does not have a "set" - accessor on the corresponding .NET property on the task class. - - MSB4093: In den {0}-Parameter der {1}-Aufgabe kann nicht geschrieben werden, da er keinen set-Accessor besitzt. - - fuzzyMatch="100" wordcount="20" adjWordcount="5" curWordcount="5" tmLabel="N''" - - - A shallow clone of this object cannot be created. - Создание пустого клона этого объекта невозможно. - - - Ein unechter Klon dieses Objekts kann nicht erstellt werden. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - Skipping target "{0}" because it has no inputs. - Целевой объект "{0}" пропускается из-за отсутствия входных данных. - - - Das {0}-Ziel wird übersprungen, da es keine Eingaben besitzt. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Though the target has declared its inputs, the input specification only references empty properties and/or empty item lists. - Хотя входные данные для целевого объекта объявлены, спецификация ввода содержит только ссылки на пустые свойства или пустые списки элементов. - - - Obwohl das Ziel seine Eingaben deklariert hat, verweist die Eingabespezifikation nur auf leere Eigenschaften und/oder leere Elementlisten. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - Skipping target "{0}" because it has no outputs. - Целевой объект "{0}" пропускается из-за отсутствия выходных файлов. - - - Das Ziel "{0}" wird übersprungen, da es keine Ausgaben enthält. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Though the target has declared its outputs, the output specification only references empty properties and/or empty item lists. - Хотя выходные данные для целевого объекта объявлены, спецификация вывода содержит только ссылки на пустые свойства или пустые списки элементов. - - - Obwohl das Ziel seine Ausgaben deklariert hat, verweist die Ausgabespezifikation nur auf leere Eigenschaften und/oder leere Elementlisten. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - Skipping target "{0}" because all output files are up-to-date with respect to the input files. - Целевой объект "{0}" пропускается, так как все выходные файлы актуальны по отношению к входным. - - - Das Ziel "{0}" wird übersprungen, da alle Ausgabedateien hinsichtlich der Eingabedateien aktuell sind. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - Input files: {0} - Входные файлы: {0} - {0} is a semicolon-separated list of filenames. - - Eingabedateien: {0} - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Output files: {0} - Выходные файлы: {0} - {0} is a semicolon-separated list of filenames. - - Ausgabedateien: {0} - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Building solution configuration "{0}". - Создание конфигурации решения "{0}". - UE: This is not an error, so doesn't need an error code. - - Die Projektmappenkonfiguration "{0}" wird erstellt. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - Using solution cache file "{0}" for configuration "{1}" and tools version "{2}". - Использование кэш-файла решения "{0}" для конфигурации "{1}" и набора средств версии "{2}". - UE: This is not an error, so doesn't need an error code. - - Die Projektmappen-Cachedatei "{0}" wird für die Konfiguration "{1}" und die Toolsversion "{2}" verwendet. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Failed to read solution cache file "{0}". {1} Using solution file directly. - Не удалось прочитать кэш-файл решения "{0}". {1} Файл решения используется напрямую. - UE: This is not a true error, so doesn't need an error code. - - Fehler beim Lesen der Projektmappen-Cachedatei "{0}". {1} Projektmappendatei wird direkt verwendet. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Failed to write solution cache file "{0}". {1} - Ошибка записи в кэш-файл решения "{0}". {1} - UE: This is not a true error, so doesn't need an error code. - - Fehler beim Schreiben der Projektmappen-Cachedatei "{0}". {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Solution cache file was created for a "{0}" value of "{1}" but the current value is "{2}". Refreshing cache file. - Кэш-файл решения создан для "{0}" со значением "{1}", однако текущее значение равно "{2}". Идет обновление кэш-файла. - UE: This is not an error, so doesn't need an error code. - - Die Projektmappen-Cachedatei wurde für den {0}-Wert "{1}" erstellt, aber der aktuelle Wert ist "{2}". Cachedatei wird aktualisiert. - - fuzzyMatch="100" wordcount="20" adjWordcount="5" curWordcount="5" tmLabel="N''" - - - Solution cache file has an internal version number "{0}" but the current value is "{1}". Refreshing cache file. - Файл кэша решения содержит внутренний номер версии "{0}", однако текущее значение составляет "{1}". Выполняется обновление файла кэша. - UE: This is not an error, so doesn't need an error code. - - Die Projektmappen-Cachedatei hat die interne Versionsnummer "{0}", der aktuelle Wert ist aber "{1}". Cachedatei wird aktualisiert. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - Solution cache file is out of date. Refreshing cache file. {0} - Файл кэша решения устарел. Выполняется обновление файла кэша. {0} - UE: This is not an error, so doesn't need an error code. - - Die Projektmappen-Cachedatei ist veraltet. Cachedatei wird aktualisiert. {0} - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4160: A circular dependency involving project "{0}" has been detected. - MSB4160: в проекте "{0}" выявлена циклическая зависимость. - {StrBegin="MSB4160: "} - - MSB4160: Eine Ringabhängigkeit im Zusammenhang mit dem Projekt "{0}" wurde erkannt. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4126: The specified solution configuration "{0}" is invalid. Please specify a valid solution configuration using the Configuration and Platform properties (e.g. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU") or leave those properties blank to use the default solution configuration. - MSB4126: указанная конфигурация решения "{0}" недопустима. Укажите допустимую конфигурацию решения с помощью свойств Configuration и Platform (например, MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU") или оставьте эти свойства пустыми, чтобы использовать конфигурацию решения по умолчанию. - {StrBegin="MSB4126: "}UE: The solution filename is provided separately to loggers. - - MSB4126: Die angegebene Projektmappenkonfiguration "{0}" ist ungültig. Geben Sie mithilfe der Konfigurations- und Plattformeigenschaften eine gültige Projektmappenkonfiguration an (z. B. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU"), oder lassen Sie diese Eigenschaften leer, sodass die Standardprojektmappenkonfiguration verwendet wird. - - fuzzyMatch="101" wordcount="37" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4046: Error reading project file "{0}": {1} - MSB4046: ошибка при чтении файла проекта "{0}": {1} - {StrBegin="MSB4046: "} - - MSB4046: Fehler beim Lesen der Projektdatei "{0}": {1} - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4125: The project file name "{0}" is invalid. {1} - MSB4125: имя файла проекта "{0}" недопустимо. {1} - {StrBegin="MSB4125: "}UE: The solution filename is provided separately to loggers. - - MSB4125: Der Projektdateiname "{0}" ist ungültig. {1} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4051: Project {0} is referencing a project with GUID {1}, but a project with this GUID was not found in the .SLN file. - MSB4051: проект {0} ссылается на проект с GUID {1}, но в файле .SLN нет проекта с таким идентификатором. - {StrBegin="MSB4051: "}UE: The solution filename is provided separately to loggers. - - MSB4051: Das Projekt "{0}" verweist auf ein Projekt mit der GUID {1}, in der SLN-Datei wurde jedoch kein Projekt mit dieser GUID gefunden. - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - MSB4078: The project file "{0}" is not supported by MSBuild and cannot be built. - MSB4078: файл проекта "{0}" не поддерживается программой MSBuild. Построение невозможно. - {StrBegin="MSB4078: "} - - MSB4078: Die Projektdatei "{0}" wird nicht von MSBuild unterstützt und kann nicht erstellt werden. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4054: The solution file must be opened in the Visual Studio IDE and converted to the latest version before it can be built by MSBuild. - MSB4054: решение должно быть открыто в среде Visual Studio IDE и преобразовано в последнюю версию, прежде чем программа MSBuild сможет выполнить построение. - {StrBegin="MSB4054: "}UE: The solution filename is provided separately to loggers. - - MSB4054: Die Projektmappendatei muss in der Visual Studio IDE geöffnet und in die neuste Version konvertiert werden, bevor sie mit MSBuild erstellt werden kann. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4121: The project configuration for project "{0}" was not specified in the solution file for the solution configuration "{1}". - MSB4121: конфигурация проекта для проекта "{0}" не была указана в файле решения для конфигурации решения "{1}". - {StrBegin="MSB4121: "} - - MSB4121: Die Projektkonfiguration für das Projekt "{0}" wurde nicht in der Projektmappendatei für die Projektmappenkonfiguration "{1}" angegeben. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - The project "{0}" is not selected for building in solution configuration "{1}". - Проект"{0}" не выбран для сборки в конфигурации решения "{1}". - - UE: This is not an error, so doesn't need an error code. - - - Das Projekt "{0}" ist in der Projektmappenkonfiguration "{1}" nicht zum Erstellen ausgewählt. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4122: Scanning project dependencies for project "{0}" failed. {1} - MSB4122: не удалось просмотреть межпроектные зависимости для проекта "{0}". {1} - {StrBegin="MSB4122: "} - - MSB4122: Fehler beim Überprüfen der Projektabhängigkeiten für Projekt "{0}". {1} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4149: The tools version "{0}" of the solution does not support building projects with a different tools version. - MSB4149: версия инструментов "{0}" решения не поддерживает проекты сборки с другой версией инструментов. - {StrBegin="MSB4149: "} - - MSB4149: Die Toolsversion {0} der Projektmappe unterstützt das Erstellen von Projekten mit unterschiedlichen Toolsversionen nicht. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - Web projects do not support the "Clean" target. Continuing with remaining projects ... - Веб-проекты не поддерживают целевой объект Clean. Выполняется обработка остальных проектов... - UE: This is not an error, so doesn't need an error code. - LOCALIZATION: Do not localize "Clean". - - Webprojekte unterstützen das Clean-Ziel nicht. Verbleibende Projekte werden fortgesetzt... - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Web projects do not support the "Publish" target. Continuing with remaining projects ... - Веб-проекты не поддерживают целевой объект Publish. Выполняется обработка остальных проектов... - UE: This is not an error, so doesn't need an error code. - LOCALIZATION: Do not localize "Publish". - - Webprojekte unterstützen das Publish-Ziel nicht. Verbleibende Projekte werden fortgesetzt... - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Skipping because the "$(AspNetConfiguration)" configuration is not supported for this web project. You can use the AspNetConfiguration property to override the configuration used for building web projects, by adding /p:AspNetConfiguration=<value> to the command line. Currently web projects only support Debug and Release configurations. - Интернет-проект пропускается, так как для него не поддерживается конфигурация "$(AspNetConfiguration)". Конфигурацию, используемую для создания интернет-проектов, можно изменить с помощью свойства AspNetConfiguration, добавив в командную строку /p:AspNetConfiguration=<значение>. Сейчас для интернет-проектов поддерживаются только конфигурации Debug и Release. - - UE: This is not an error, so doesn't need an error code. - LOCALIZATION: Do NOT localize "AspNetConfiguration", "Debug", "Release". - - - Da der "$(AspNetConfiguration)" Konfiguration für dieses Webprojekt nicht unterstützt. Verwenden die AspNetConfiguration-Eigenschaft die Konfiguration zum Erstellen von Webprojekten hinzufügen/p: AspNetConfiguration überschreiben = < Wert > in der Befehlszeile. Aktuell unterstützen Webprojekte nur Debug- und Releasekonfigurationen. - - fuzzyMatch="15" wordcount="44" adjWordcount="37.4" curWordcount="37.4" - - - MSB4076: VC projects do not support the "Publish" target. - MSB4076: VC-проекты не поддерживают цель "Publish". - {StrBegin="MSB4076: "}LOCALIZATION: Do not localize "Publish". - - MSB4076: VC-Projekte unterstützen nicht das Publish-Ziel. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4098: MSBuild is invoking VCBuild to build this project. Project-to-project references between VC++ projects (.VCPROJ) and C#/VB/VJ# projects (.CSPROJ, .VBPROJ, .VJSPROJ) are not supported by the command-line build systems when building stand-alone VC++ projects. Projects that contain such project-to-project references will fail to build. Please build the solution file containing this project instead. - MSB4098: MSBuild вызывает VCBuild для сборки проекта. При сборке автономных проектов VC++ перекрестные ссылки между проектами VC++ (.VCPROJ) и проектами C#/VB/VJ# (.CSPROJ, .VBPROJ, .VJSPROJ) не поддерживаются системами, управляемыми из командной строки. Сборка проектов, содержащих такие перекрестные ссылки, невозможна. Вместо этого создайте файл решения с этим проектом. - {StrBegin="MSB4098: "} - - MSB4098: MSBuild ruft zum Erstellen dieses Projekts VCBuild auf. Interprojektverweise zwischen VC++-Projekten (.VCPROJ) und C#-/VB-/VJ#-Projekten (.CSPROJ, .VBPROJ, .VJSPROJ) werden beim Erstellen eigenständiger VC++-Projekte von den Befehlszeilen-Buildsystemen nicht unterstützt. Projekte, die solche Interprojektverweise enthalten, werden nicht erstellt. Erstellen Sie stattdessen die Projektmappendatei, die dieses Projekt enthält. - - fuzzyMatch="101" wordcount="53" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4056: The MSBuild engine must be called on a single-threaded-apartment. Current threading model is "{0}". Proceeding, but some tasks may not function correctly. - MSB4056: модуль MSBuild должен вызываться в однопоточном контейнере (STA). Используемая модель потоков — "{0}". Обработка продолжается, но некоторые задачи могут выполняться неправильно. - {StrBegin="MSB4056: "} - - MSB4056: Das MSBuild-Modul muss in einem Singlethread-Apartment aufgerufen werden. Das aktuelle Threadmodell ist {0}. Der Vorgang wird fortgesetzt, aber einige Aufgaben werden möglicherweise nicht ordnungsgemäß ausgeführt. - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - Schema validation - Проверка схемы - UE: this fragment is used to describe errors that are caused by schema validation. For example, if a normal error is - displayed like this: "MSBUILD : error MSB0000: This is an error.", then an error from schema validation would look like this: - "MSBUILD : Schema validation error MSB0000: This is an error." - LOCALIZATION: This fragment needs to be localized. - - Schemavalidierung - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Target "{0}" skipped. Previously built unsuccessfully. - Целевой объект "{0}" пропущен. Предыдущая сборка неуспешна. - - - Das Ziel "{0}" wurde übersprungen. Die vorherige Erstellung war nicht erfolgreich. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Target "{0}" skipped. Previously built successfully. - Целевой объект "{0}" пропущен. Предыдущая сборка успешна. - - - Das Ziel "{0}" wurde übersprungen. Die vorherige Erstellung war erfolgreich. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4116: The condition "{1}" on the "{0}" target has a reference to item metadata. References to item metadata are not allowed in target conditions unless they are part of an item transform. - MSB4116: условие "{1}" для целевого объекта "{0}" содержит ссылку на метаданные элемента. Ссылки на метаданные в условиях для целевого объекта запрещены за исключением случаев, когда они являются частью преобразования элемента. - {StrBegin="MSB4116: "} - - MSB4116: Die Bedingung "{1}" des {0}-Ziels enthält einen Verweis auf Elementmetadaten. Verweise auf Elementmetadaten sind in Zielbedingungen nicht zulässig, es sei denn, sie sind Teil einer Elementtransformation. - - fuzzyMatch="101" wordcount="32" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4057: The target "{0}" does not exist in the project. - MSB4057: в проекте нет целевого объекта "{0}". - {StrBegin="MSB4057: "} - - MSB4057: Das Ziel "{0}" ist im Projekt nicht vorhanden. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - Done building target "{0}" in project "{1}" -- FAILED. - Сборка целевого объекта "{0}" в проекте "{1}" завершена с ошибкой. - - - Erstellen des {0}-Ziels in Projekt {1} beendet - Fehler beim Erstellen. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Done building target "{0}" in project "{1}". - Сборка целевого объекта "{0}" в проекте "{1}" завершена. - - - Die Erstellung des Ziels "{0}" im Projekt "{1}" ist abgeschlossen. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - {0}: (TargetId:{1}) - {0}: (идентификатор целевого объекта TargetId:{1}) - - - {0}: (Ziel-ID:{1}) - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4058: The "{0}" target is missing its output specification. If a target declares inputs, it must also declare outputs. - MSB4058: у целевого объекта "{0}" нет спецификации вывода. Если целевой объект объявляет ввод, он должен объявить и вывод. - {StrBegin="MSB4058: "} - - MSB4058: Das {0}-Ziel enthält keine Ausgabespezifikation. Wenn ein Ziel Eingaben deklariert, muss es auch Ausgaben deklarieren. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4168: The item "{0}" of type "{1}" does not define a value for the metadata in the expression "{2}". This expression is used in the target output for target "{3}". If a target declares outputs that are transforms, all items in the transform must have a value for the metadata in the transform. - MSB4168: элемент "{0}" типа "{1}" не определяет значение метаданных в выражении "{2}". Это выражение используется в выходных данных для целевого объекта "{3}". Если целевой объект объявляет выходные данные, представляющие собой преобразования, все элементы преобразования должны иметь соответствующие значения для метаданных преобразования. - {StrBegin="MSB4168: "} - - MSB4168: Das Element "{0}" vom Typ "{1}" definiert keinen Wert für die Metadaten im Ausdruck "{2}". Dieser Ausdruck wird in der Zielausgabe für "{3}" verwendet. Wenn ein Ziel Ausgaben deklariert, bei denen es sich um Transformationen handelt, müssen alle Elemente in der Transformation einen Wert für die in der Transformation enthaltenen Metadaten aufweisen. - - fuzzyMatch="101" wordcount="53" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Target Performance Summary: - Итоги по целям: - - - Leistungszusammenfassung für das Ziel: - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Target "{0}" skipped, due to false condition; ({1}) was evaluated as ({2}). - Целевой объект "{0}" пропущен из-за невыполненного условия; выражение ({1}) равно ({2}). - - - Das Ziel "{0}" wurde übersprungen, da die Bedingung "false" war . ({1}) wurde als ({2}) ausgewertet. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Target "{0}" in project "{1}" - Цель "{0}" в проекте "{1}" - - - {0}-Ziel in {1}-Projekt. - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Target {0}: - Целевой объект {0}: - - - Ziel "{0}": - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Target "{0}" in file "{1}": - Целевой объект "{0}" в файле "{1}": - - - Ziel "{0}" in Datei "{1}": - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Build continuing because "{0}" on the task "{1}" is set to "{2}". - Сборка продолжается, так как выражение "{0}" для задачи "{1}" равно "{2}". - - - Der Buildvorgang wird fortgesetzt, da {0} in der {1}-Aufgabe auf "{2}" festgelegt ist. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Target {0} from project "{1}": - Целевой объект {0} из проекта "{1}": - - - Ziel "{0}" aus Projekt "{1}": - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Target "{0}" in file "{1}" from project "{2}": - Целевой объект "{0}" в файле "{1}" из проекта "{2}": - - - Ziel "{0}" in Datei "{1}" aus Projekt "{2}": - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4060: The "{0}" task has been declared or used incorrectly, or failed during construction. Check the spelling of the task name and the assembly name. - MSB4060: задача "{0}" неправильно объявлена, неправильно использовалась или при ее сборке возникла ошибка. Проверьте правильность написания имени задачи и имени сборки. - {StrBegin="MSB4060: "} - - MSB4060: Die {0}-Aufgabe wurde falsch deklariert, falsch verwendet oder konnte bei der Erstellung nicht ausgeführt werden. Überprüfen Sie die Schreibweise des Aufgaben- und des Assemblynamens. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4077: The "{0}" task has been marked with the attribute LoadInSeparateAppDomain, but does not derive from MarshalByRefObject. Check that the task derives from MarshalByRefObject or AppDomainIsolatedTask. - MSB4077: задача "{0}" помечена атрибутом LoadInSeparateAppDomain, но получить ее из MarshalByRefObject невозможно. Проверьте, можно ли получить эту задачу из MarshalByRefObject или AppDomainIsolatedTask. - {StrBegin="MSB4077: "}LOCALIZATION: <LoadInSeparateAppDomain>, <MarshalByRefObject>, <AppDomainIsolatedTask> should not be localized. - - MSB4077: Die Aufgabe "{0}" wurde mit dem LoadInSeparateAppDomain-Attribut markiert, ist jedoch nicht von MarshalByRefObject abgeleitet. Stellen Sie sicher, dass die Aufgabe von MarshalByRefObject oder AppDomainIsolatedTask abgeleitet wird. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Done executing task "{0}" -- FAILED. - Выполнение задачи "{0}" завершено с ошибкой. - - - Die Ausführung von Task "{0}" wurde beendet – FEHLER. - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Done executing task "{0}". - Выполнение задачи "{0}" завершено. - - - Die Ausführung von Task "{0}" wurde beendet. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - {0} (TaskId:{1}) - {0} (Идентификатор задачи TaskId:{1}) - - - {0} (Aufgaben-ID: {1}) - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Using "{0}" task from assembly "{1}". - Используется задача "{0}" из сборки "{1}". - UE: This informational message helps users determine which assemblies their tasks were loaded from. - - Die {0}-Aufgabe aus der {1}-Assembly wird verwendet. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4061: The "{0}" task could not be instantiated from the assembly "{1}". {2} - MSB4061: не удалось создать экземпляр задачи "{0}" из сборки "{1}". {2} - {StrBegin="MSB4061: "}LOCALIZATION: "{2}" is a localized message from a CLR/FX exception. - - MSB4061: Die {0}-Aufgabe konnte nicht aus der {1}-Assembly instanziiert werden. {2} - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4127: The "{0}" task could not be instantiated from the assembly "{1}". Please verify the task assembly has been built using the same version of the Microsoft.Build.Framework assembly as the one installed on your computer and that your host application is not missing a binding redirect for Microsoft.Build.Framework. {2} - MSB4127: не удалось создать экземпляр задачи "{0}" из сборки "{1}". Сборка задачи должна быть построена с помощью версии сборки Microsoft.Build.Framework, которая установлена на компьютере, и в ведущем приложении должно быть указано перенаправление привязки для Microsoft.Build.Framework. {2} - {StrBegin="MSB4127: "}UE: This message is a specialized version of the TaskInstantiationFailureError message and can probably reuse some of its docs. - LOCALIZATION: "{2}" is a localized message from a CLR/FX exception. Also, Microsoft.Build.Framework should not be localized - - MSB4127: Die "{0}"-Aufgabe konnte nicht aus der "{1}"-Assembly instanziiert werden. Überprüfen Sie, ob die Aufgabenassembly mit der gleichen Version der Microsoft.Build.Framework-Assembly erstellt wurde, die auf Ihrem Computer installiert ist, und dass Ihrer Hostanwendung kein BindingRedirect-Eintrag für Microsoft.Build.Framework fehlt. {2} - - fuzzyMatch="101" wordcount="49" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4062: The "{0}" task could not be loaded from the assembly {1}. {2} Confirm that the <UsingTask> declaration is correct, and that the assembly and all its dependencies are available. - MSB4062: невозможно загрузить задачу "{0}" из сборки {1}. {2} Проверьте правильность объявления <UsingTask> и доступность сборки со всеми ее зависимостями. - {StrBegin="MSB4062: "}UE: This message is shown when a task cannot be loaded from its assembly for various reasons e.g. corrupt assembly, - invalid task declaration, disk error, etc. "{2}" contains a message explaining what happened. - LOCALIZATION: "{2}" is a message from the CLR loader and is already localized. Also, <UsingTask> should not be localized. - - MSB4062: Die "{0}" Vorgang konnte nicht aus der Assembly geladen werden {1}. {2} Bestätigen < UsingTask > Erklärung richtig ist und die Assembly und die zugehörigen Dateien verfügbar sind. - - fuzzyMatch="15" wordcount="31" adjWordcount="26.35" curWordcount="26.35" - - - MSB4063: The "{0}" task could not be initialized with its input parameters. {1} - MSB4063: не удалось инициализировать задачу "{0}" с его входными параметрами. {1} - {StrBegin="MSB4063: "} - - MSB4063: Die "{0}"-Aufgabe konnte nicht mit ihren Eingabeparametern initialisiert werden. {1} - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - Task Performance Summary: - Итоги по задачам: - - - Leistungszusammenfassung für die Aufgabe: - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Task "{0}" skipped, due to false condition; ({1}) was evaluated as ({2}). - Задача "{0}" пропущена из-за невыполненного условия; выражение ({1}) равно ({2}). - - - Die {0}-Aufgabe wurde übersprungen, da die Bedingung "false" war . ({1}) wurde als ({2}) ausgewertet. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Task "{0}" - Задача "{0}" - - - Task "{0}" - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Time Elapsed {0} - Прошло времени {0} - - - Verstrichene Zeit {0} - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Building with tools version "{0}". - Сборка с инструментами версии "{0}". - - - Erstellung mit der Toolsversion "{0}". - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Project file contains ToolsVersion="{0}". This toolset is unknown or missing. You may be able to resolve this by installing the appropriate .NET Framework for this toolset. Treating the project as if it had ToolsVersion="4.0". - Файл проекта содержит ToolsVersion="{0}". Данный набор инструментов является неизвестным или отсутствует. Для устранения этой ошибки можно установить для данного набора инструментов соответствующую версию .NET Framework. Считается, что проект содержит ToolsVersion="4.0". - - - Die Projektdatei enthält ToolsVersion="{0}". Dieses Toolset ist nicht bekannt oder nicht vorhanden. Sie können das Problem möglicherweise beheben, indem Sie das entsprechende .NET Framework für dieses Toolset installieren. Das Projekt wird behandelt als enthielte es ToolsVersion="4.0". - - fuzzyMatch="101" wordcount="34" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Deferred Messages - Отложенные сообщения - - - Zurückgestellte Meldungen - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Some messages did not display because they were not associated with any ProjectStarted events. Use diagnostic verbosity to view these messages. - Не удалось отобразить некоторые сообщения, так как они не связаны с какими-либо событиями ProjectStarted. Воспользуйтесь диагностическим уровнем детализации для просмотра этих сообщений. - - - Einige Meldungen wurden nicht angezeigt, weil sie keinem ProjectStarted-Ereignis zugeordnet sind. Verwenden Sie den Ausführlichkeitsgrad "diagnostic", um diese Meldungen anzuzeigen. - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - MSB4090: Found an unexpected character '{2}' at position {1} in condition "{0}". - MSB4090: неожиданный знак "{2}" в позиции {1} условия "{0}". - {StrBegin="MSB4090: "} - - MSB4090: Das unerwartete Zeichen {2} wurde an Position {1} in der {0}-Bedingung gefunden. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4091: Found a call to an undefined function "{1}" in condition "{0}". - MSB4091: вызов неопределенной функции "{1}" в условии "{0}". - {StrBegin="MSB4091: "} - - MSB4091: Aufruf zu einer undefinierten Funktion "{1}" in Bedingung "{0}" gefunden. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4064: The "{0}" parameter is not supported by the "{1}" task. Verify the parameter exists on the task, and it is a settable public instance property. - MSB4064: параметр "{0}" не поддерживается задачей "{1}". Убедитесь, что параметр существует в задаче и является открытым задаваемым свойством экземпляра. - {StrBegin="MSB4064: "} - - MSB4064: Der {0}-Parameter wird von der {1}-Aufgabe nicht unterstützt. Vergewissern Sie sich, dass der Parameter in der Aufgabe vorhanden ist und es sich um eine festlegbare öffentliche Instanzeigenschaft handelt. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4131: The "{0}" parameter is not supported by the "{1}" task. Verify the parameter exists on the task, and it is a gettable public instance property. - MSB4131: параметр "{0}" не поддерживается задачей "{1}". Убедитесь, что параметр существует в задаче и является открытым получаемым свойством экземпляра. - {StrBegin="MSB4131: "} - - MSB4131: Der {0}-Parameter wird von der {1}-Aufgabe nicht unterstützt. Vergewissern Sie sich, dass der Parameter in der Aufgabe vorhanden ist und es sich um eine abrufbare öffentliche Instanzeigenschaft handelt. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4092: An unexpected token "{1}" was found at character position {2} in condition "{0}". - MSB4092: неожиданный маркер "{1}" в позиции {2} условия "{0}". - {StrBegin="MSB4092: "} - - MSB4092: Ein unerwartetes Token "{1}" wurde an Zeichenposition "{2}" in Bedingung "{0}" gefunden. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4065: The "{0}" parameter is not marked for output by the "{1}" task. - MSB4065: параметр "{0}" не помечен для вывода задачей "{1}". - {StrBegin="MSB4065: "} - - MSB4065: Der {0}-Parameter ist nicht für die Ausgabe durch die {1}-Aufgabe markiert. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4066: The attribute "{0}" in element <{1}> is unrecognized. - MSB4066: нераспознанный атрибут "{0}" в элементе <{1}>. - {StrBegin="MSB4066: "} - - MSB4066: Das Attribut "{0}" im Element <{1}> wurde nicht erkannt. - - fuzzyMatch="15" wordcount="10" adjWordcount="8.5" curWordcount="8.5" - - - MSB4067: The element <{0}> beneath element <{1}> is unrecognized. - MSB4067: неопознанный элемент <{0}> в элементе <{1}>. - {StrBegin="MSB4067: "} - - MSB4067: Das Element <{0}> unter Element <{1}> wurde nicht erkannt. - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB4068: The element <{0}> is unrecognized, or not supported in this context. - MSB4068: элемент <{0}> не опознан или не поддерживается в этом контексте. - {StrBegin="MSB4068: "} - - MSB4068: Das Element <{0}> ist unbekannt oder in diesem Kontext nicht unterstützt. - - fuzzyMatch="15" wordcount="13" adjWordcount="11.05" curWordcount="11.05" - - - MSB4132: The tools version "{0}" is unrecognized. - MSB4132: версия инструментов "{0}" не распознана. - {StrBegin="MSB4132: "} - - MSB4132: Die Toolsversion "{0}" ist unbekannt. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4069: The "{0}" type of the "{1}" parameter of the "{2}" task is not supported by MSBuild. - MSB4069: тип "{0}" параметра "{1}" задачи "{2}" не поддерживается программой MSBuild. - {StrBegin="MSB4069: "}LOCALIZATION: "MSBuild" should not be localized. - - MSB4069: Der {0}-Typ des {1}-Parameters der {2}-Aufgabe wird von MSBuild nicht unterstützt. - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - MSB4072: A <{0}> element must contain either the "{1}" attribute or the "{2}" attribute (but not both). - MSB4072: элемент <{0}> должен содержать атрибут "{1}" или атрибут "{2}" (но не оба). - {StrBegin="MSB4072: "} - - MSB4072: Ein <{0}>-Element muss entweder die "{1}" Attribut oder "{2}" Attribut (jedoch nicht beide). - - fuzzyMatch="15" wordcount="18" adjWordcount="15.3" curWordcount="15.3" - - - {0} Warning(s) - Предупреждений: {0} - - - {0} Warnung(en) - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4084: A <When> element may not follow an <Otherwise> element in a <Choose>. - MSB4084: в <Choose> элемент <When> не может следовать за элементом <Otherwise>. - {StrBegin="MSB4084: "} - - MSB4084: A < >-Element kein Element < Otherwise > < auswählen > folgen. - - fuzzyMatch="15" wordcount="16" adjWordcount="13.6" curWordcount="13.6" - - - Target Name: "{0}" Project Name: "{1}" - Имя конечного объекта: "{0}" Имя проекта: "{1}" - - - Zielname: "{0}" Projektname: "{1}" - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Cycle trace: - Отслеживание цикла: - - - Schleifenablaufverfolgung: - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4150: Must initialize the console logger using the initialize method before using ApplyParameter - MSB4150: перед использованием параметра ApplyParameter необходимо инициализировать журнал консоли при помощи метода инициализации - {StrBegin="MSB4150: "} - - MSB4150: Die Konsolenprotokollierung muss vor der Verwendung von ApplyParameter mithilfe der Initialisierungsmethode initialisiert werden. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4151: An error occurred while building project "{0}", target "{1}". Please see innerException for detailed information. - MSB4151: ошибка при сборке проекта "{0}", целевой объект "{1}". Дополнительные сведения см. в описании внутреннего исключения innerException. - {StrBegin="MSB4151: "} - - MSB4151: Fehler beim Erstellen von Projekt "{0}", Ziel "{1}". Ausführliche Informationen finden Sie in der innerException. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB4152: An error occurred on the child node "{0}" and could not be passed to the parent node. {1} - MSB4152: ошибка в дочернем узле "{0}", который не удалось передать в родительский узел. {1} - {StrBegin="MSB4152: "} - - MSB4152: Fehler im untergeordneten Knoten "{0}", der nicht an den übergeordneten Knoten übergeben werden konnte. {1} - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4153: A call is made on an inactive IBuildEngine interface corresponding to a task that already finished execution. - MSB4153: выполнен вызов неактивного интерфейса IBuildEngine, который соответствует уже завершенной задаче. - {StrBegin="MSB4153: "} - - MSB4153: Eine inaktive IBuildEngine-Schnittstelle wird aufgerufen, der eine Aufgabe entspricht, deren Ausführung bereits abgeschlossen wurde. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - MSB4154: A forwarding logger is attempting to forward BuildFinished event - MSB4154: журнал перенаправления пытается передать событие BuildFinished - {StrBegin="MSB4154: "} - - MSB4154: Eine weiterleitende Protokollierung versucht, das BuildFinished-Ereignis weiterzuleiten. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4155: There was an error while communicating with a node. - MSB4155: произошла ошибка при обмене данными с узлом. - {StrBegin="MSB4155: "} - - MSB4155: Fehler bei der Kommunikation mit einem Knoten. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB1021: Cannot create an instance of the logger - {0}. - MSB1021: не удается создать экземпляр журнала - {0}. - {StrBegin="MSB1021: "}The error code for this message is duplicated from MSBuild.exe. - - MSB1021: Eine Instanz der Protokollierung kann nicht erstellt werden - {0}. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB1020: The logger {0} was not found. Check the following: 1.) The logger name specified is the same as the name of the logger class. 2.) The logger class is "public" and implements the Microsoft.Build.Framework.ILogger interface. 3.) The path to the logger assembly is correct, or the logger can be loaded using only the assembly name provided. - MSB1020: журнал {0} не найден. Проверьте следующее: 1.) Указанное имя журнала соответствует имени класса журнала. 2.) Класс средства ведения журнала является открытым и реализует интерфейс Microsoft.Build.Framework.ILogger. 3.) Правильность пути к сборке журнала или возможность загрузки журнала только при помощи предоставленного имени сборки. - {StrBegin="MSB1020: "}The error code for this message is duplicated from MSBuild.exe. - - MSB1020: Die Protokollierung {0} wurde nicht gefunden. Überprüfen Sie Folgendes: 1.) Der angegebene Name der Protokollierung ist mit dem Namen der Protokollierungsklasse identisch. 2.) Die Protokollierungsklasse ist "public" und implementiert die Microsoft.Build.Framework.ILogger-Schnittstelle. 3.) Der Pfad zur Protokollierungsassembly ist richtig, bzw. die Protokollierung kann alleine mithilfe des angegebenen Assemblynamens geladen werden. - - fuzzyMatch="101" wordcount="57" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4156: A forwarding logger is attempting to forward BuildStarted event - MSB4156: журнал перенаправления пытается передать событие BuildStarted - {StrBegin="MSB4156: "} - - MSB4156: Eine weiterleitende Protokollierung versucht, das BuildStarted-Ereignis weiterzuleiten. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - "{0}" ({1} target) ({2}) -> - "{0}" (целевой объект {1} ) ({2}) -> - - - "{0}" ({1} target) ({2}) -> - - fuzzyMatch="15" wordcount="5" adjWordcount="4.25" curWordcount="4.25" - - - "{0}" (default target) ({1}) -> - "{0}" (целевой объект по умолчанию) ({1}) -> - - - "{0}" (Standardziel) ({1}) -> - - fuzzyMatch="15" wordcount="5" adjWordcount="4.25" curWordcount="4.25" - - - {0} {1,5} - {0} {1,5} - - - {0} {1,5} - - fuzzyMatch="15" wordcount="2" adjWordcount="1.7" curWordcount="1.7" - - - Project "{0}" on node {1} ({2} target(s)). - Проект "{0}" в узле {1} (целевые объекты {2}). - - - Projekt "{0}" auf Knoten "{1}", {2} Ziel(e). - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Project "{0}" on node {1} (default targets). - Проект "{0}" в узле {1} (целевые объекты по умолчанию). - - - Projekt "{0}" auf Knoten "{1}" (Standardziele). - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Project "{0}" ({1}) is building "{2}" ({3}) on node {4} ({5} target(s)). - Проект "{0}" ({1}) выполняет сборку "{2}" ({3}) в узле {4} (целевые объекты {5}). - - - Das Projekt "{0}" ({1}) erstellt "{2}" ({3}) auf Knoten "{4}", {5} Ziel(e). - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Project "{0}" ({1}) is building "{2}" ({3}) on node {4} (default targets). - Проект "{0}" ({1}) выполняет сборку "{2}" ({3}) в узле {4} (целевые объекты по умолчанию). - - - Das Projekt "{0}" ({1}) erstellt "{2}" ({3}) auf Knoten "{4}" (Standardziele). - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - ({0} target) -> - (Целевой объект {0}) -> - - - ({0} Ziel) -> - - fuzzyMatch="15" wordcount="3" adjWordcount="2.55" curWordcount="2.55" - - - MSB4157: The array of project files needs to contain at least one value. - MSB4157: массив файлов проекта должен содержать хотя бы одно значение. - {StrBegin="MSB4157: "} - - MSB4157: Das Array der Projektdateien muss mindestens einen Wert enthalten. - - fuzzyMatch="15" wordcount="13" adjWordcount="11.05" curWordcount="11.05" - - - MSB4158: The project file name at element {0} is empty. - MSB4158: пустое имя файла проекта в элементе {0}. - {StrBegin="MSB4158: "} - - MSB4158: Der Projektdateiname bei Element {0} ist leer. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - The property "{0}" with value "{1}" is being overridden by another batch. The property is now: "{2}" - Свойство "{0}" со значением "{1}" переопределяется другим пакетом. Теперь свойство имеет значение "{2}" - - - Die Eigenschaft "{0}" mit dem Wert "{1}" wird von einem anderen Batch überschrieben. Die Eigenschaft ist jetzt: "{2}" - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - Please see inner exception for error information. - Сведения об ошибке см. в описании внутреннего исключения. - - - Fehlerinformationen finden Sie in der internen Ausnahme. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Event type "{0}" was expected to be serializable. The event was not serializable and has been ignored. - Ожидалось, что тип события "{0}" будет сериализуемым. Событие не было сериализуемым и было пропущено. - - - Es wurde erwartet, dass der Typ "{0}" serialisierbar ist. Das Ereignis war nicht serialisierbar und wurde ignoriert. - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - The log file path cannot be null or empty. - Путь к файлу журнала не может быть пустым или иметь значение NULL. - - - Der Protokolldateipfad darf nicht NULL oder leer sein. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4161: Project "{0}" was loaded and unloaded during the current build. Reloading a project during the build can result in errors or an inconsistent build state. Either avoid unloading project "{0}" or cache the evaluation results of target(s) "{1}" before unloading the project. - MSB4161: проект "{0}" загружен и выгружен в ходе текущей сборки. Перезагрузка проекта в ходе сборки может привести к возникновению ошибок или неправильному состоянию сборки. Избегайте выгрузки проекта "{0}" или заносите в кэш результаты вычислений конечных объектов "{1}" перед выгрузкой проекта. - {StrBegin="MSB4161: "} - - MSB4161: Das Projekt "{0}" wurde während der aktuellen Erstellung geladen und entladen. Das erneute Laden eines Projekts während der Erstellung kann zu Fehlern oder einem nicht konsistenten Buildzustand führen. Vermeiden Sie entweder das Entladen des Projekts "{0}", oder speichern Sie die Auswertungsergebnisse der Ziele "{1}" vor dem Entladen des Projekts im Cache. - - fuzzyMatch="101" wordcount="43" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - [default] - [по умолчанию] - - - [Standard] - - fuzzyMatch="100" wordcount="1" adjWordcount="0.25" curWordcount="0.25" tmLabel="N''" - - -
-
\ No newline at end of file diff --git a/src/Deprecated/Engine/Resources/xlf/Strings.tr.xlf b/src/Deprecated/Engine/Resources/xlf/Strings.tr.xlf deleted file mode 100644 index 1aa0c4c225b..00000000000 --- a/src/Deprecated/Engine/Resources/xlf/Strings.tr.xlf +++ /dev/null @@ -1,2674 +0,0 @@ - - - -
- - 4013 - 1176.8 - 1176.8 - 0 - 0 - - - 0 - 981 - 2334 - 0 - 0 - 698 - 0 - -
- - - MSB4001: The "{0}" task has more than one parameter called "{1}". - MSB4001: "{0}" görevinin "{1}" adında birden fazla parametresi var. - {StrBegin="MSB4001: "}UE: This message is shown when a task has more than one .NET property with the same name -- it's unclear which of - those properties the task wants to use as a parameter in project files. - - MSB4001: Die {0}-Aufgabe enthält mehrere Parameter mit dem Namen "{1}". - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4081: The value "{0}" of the "ItemName" attribute in element <Output> contains an "@" character. If you intended to use an item name then remove the @( ) around the item name. - MSB4081: <Output> öğesindeki "ItemName" özniteliğinin "{0}" değeri "@" karakteri içeriyor. Bir öğe adı kullanmayı amaçladıysanız, öğe adının yanındaki @( ) karakterini kaldırın. - {StrBegin="MSB4081: "}UE: This message is shown when an output tag has an itemname that contains an @. They probably typed @(foo) instead of foo in the ItemName.LOCALIZATION: Output and ItemName should not be localized. - - MSB4081: Der Wert "{0}" "ItemName-Attribut im Element < Output > enthält ein" @"Zeichen. Soll ein Elementname verwenden und entfernen dann die @ (), um den Namen des Elements. - - fuzzyMatch="15" wordcount="30" adjWordcount="25.5" curWordcount="25.5" - - - MSB4002: There was a failure retrieving the attributes for parameters in the "{0}" task. {1} - MSB4002: "{0}" görevindeki parametrelerin öznitelikleri alınırken hata oluştu. {1} - {StrBegin="MSB4002: "}UE: This message is shown when the .NET attributes that a task's .NET properties are decorated with, cannot be - retrieved -- this is typically because the .NET classes that define the .NET attributes cannot be loaded because the assembly - they are defined in cannot be found, or the classes themselves cannot be found. - - MSB4002: Fehler beim Abrufen der Attribute für Parameter in der {0}-Aufgabe. {1} - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - MSB4003: "{0}" is a reserved attribute of the <{1}> element, and must be spelled with the correct casing. This attribute cannot be used as a parameter to the "{2}" task. - MSB4003: "{0}", <{1}> öğesi için ayrılmış bir özniteliktir ve doğru büyük/küçük harf gösterimi kullanılarak yazılmalıdır. Bu öznitelik, "{2}" görevi için parametre olarak kullanılamaz. - {StrBegin="MSB4003: "}UE: Tasks are not allowed to use incorrect case for reserved attributes on the task nodes e.g. "continueonerror" - instead of the "ContinueOnError". - - MSB4003: "{0}" ist ein reserviertes Attribut der <{1}>-Element und mit der richtigen Groß-/Kleinschreibung geschrieben werden muss. Dieses Attribut kann nicht verwendet werden, als Parameter an die "{2}" Aufgabe. - - fuzzyMatch="15" wordcount="31" adjWordcount="26.35" curWordcount="26.35" - - - The "REQUESTBATCHSIZE" must be a number greater than 1. "{0}" is an invalid value. The value 10 will be used instead. - "REQUESTBATCHSIZE" değeri 1'den büyük bir sayı olmalıdır. "{0}" geçersiz bir değer. Bunun yerine 10 kullanılacak. - The name "REQUESTBATCHSIZE" is an environment variable - - Die "REQUESTBATCHSIZE" muss eine Zahl größer als 1 sein. "{0}" ist ein ungültiger Wert. Der Wert 10 wird stattdessen verwendet. - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - Build completed in {0}. - Oluşturma {0} süresinde tamamlandı. - - - Das Erstellen wurde in {0} beendet. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - Build FAILED. - Oluşturma BAŞARISIZ OLDU. - - - Fehler beim Buildvorgang. - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Build succeeded. - Oluşturma başarılı oldu. - - - Buildvorgang erfolgreich. - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Build started. - Oluşturma başlatıldı. - - - Der Buildvorgang wurde gestartet. - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Build started {0}. - Oluşturma başlatıldı: {0}. - - - Der Buildvorgang wurde am {0} gestartet. - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Building target "{0}" completely. - "{0}" hedefi tam olarak oluşturuluyor. - {0} is the name of the target. - - Das Ziel "{0}" wird vollständig erstellt. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - No input files were specified. - Giriş dosyası belirtilmedi. - - - Es wurden keine Eingabedateien angegeben. - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Input file "{0}" is newer than output file "{1}". - "{0}" giriş dosyası, "{1}" çıkış dosyasından daha yeni. - {0} and {1} are filenames on disk. - - Die Eingabedatei "{0}" ist neuer als die Ausgabedatei "{1}". - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - Output file "{0}" does not exist. - "{0}" çıkış dosyası yok. - {0} is a filename on disk. - - Die Ausgabedatei "{0}" ist nicht vorhanden. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Input file "{0}" does not exist. - "{0}" giriş dosyası yok. - {0} is a filename on disk. - - Die Eingabedatei "{0}" ist nicht vorhanden. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Building target "{0}" partially, because some output files are out of date with respect to their input files. - Bazı çıkış dosyaları, giriş dosyalarına göre güncel durumda olmadığından "{0}" hedefi kısmen oluşturuluyor. - {0} is the name of the target. - - Das Ziel "{0}" wird teilweise erstellt, da einige Ausgabedateien hinsichtlich ihrer Eingabedateien veraltet sind. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - [{0}: Input={1}, Output={2}] Input file is newer than output file. - [{0}: Giriş={1}, Çıkış={2}] Giriş dosyası çıkış dosyasından daha yeni. - {0} is the name of an MSBuild item. {1} and {2} are filenames on disk. - - [{0}: Eingabe={1}, Ausgabe={2}] Die Eingabedatei ist neuer als die Ausgabedatei. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - [{0}: Input={1}, Output={2}] Output file does not exist. - [{0}: Giriş={1}, Çıkış={2}] Çıkış dosyası yok. - {0} is the name of an MSBuild item. {1} and {2} are filenames on disk. - - [{0}: Eingabe={1}, Ausgabe={2}] Die Ausgabedatei ist nicht vorhanden. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - [{0}: Input={1}, Output={2}] Input file does not exist. - [{0}: Giriş={1}, Çıkış={2}] Giriş dosyası yok. - {0} is the name of an MSBuild item. {1} and {2} are filenames on disk. - - [{0}: Eingabe={1}, Ausgabe={2}] Die Eingabedatei ist nicht vorhanden. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - The attribute "{0}" is a known MSBuild attribute, and cannot be accessed using this method. - "{0}" özniteliği bilinen bir MSBuild özniteliğidir ve bu yöntem kullanılarak erişilemez. - - - Das {0}-Attribut ist ein bekanntes MSBuild-Attribut, auf das mithilfe dieser Methode nicht zugegriffen werden kann. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - Properties in persisted property groups cannot be accessed by name. - Kalıcı özellik gruplarındaki özelliklere adlarıyla erişilemez. - - - Auf Eigenschaften in persistenten Eigenschaftengruppen ist kein Zugriff über den Namen möglich. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4023: Cannot evaluate the item metadata "%({0})". {1} - MSB4023: "%({0})" öğe meta verisi değerlendirilemiyor. {1} - {StrBegin="MSB4023: "}UE: This message is shown when the value of an item metadata cannot be computed for some reason e.g. trying to apply - %(RootDir) to an item-spec that's not a valid path, would result in this error. - LOCALIZATION: "{1}" is a localized message explaining the problem. - - MSB4023: Elementmetadaten "%({0})" können nicht ausgewertet werden. {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Cannot execute a task not associated with a project object. - Proje nesnesiyle ilişkilendirilmemiş bir görev yürütülemez. - - - Eine Aufgabe, die keinem Projektobjekt zugeordnet ist, kann nicht ausgeführt werden. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - The cache entry has already been set to a different value and cannot be modified. - Önbellek girişi zaten farklı bir değere ayarlandı ve değiştirilemez. - - - Der Cacheeintrag wurde bereits auf einen anderen Wert festgelegt und kann nicht geändert werden. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - The "{0}" property comes from an environment variable, and cannot be modified. - "{0}" özelliği bir ortam değişkeninden geliyor ve değiştirilemez. - - - Die {0}-Eigenschaft stammt aus einer Umgebungsvariablen und kann nicht geändert werden. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - The "{0}" property is a global property, and cannot be modified through an evaluated property group. Use "{1}" instead. - "{0}" özelliği genel bir özelliktir ve değerlendirilmiş bir özellik grubu aracılığıyla değiştirilemez. Bunun yerine "{1}" kullanın. - - - Die {0}-Eigenschaft ist eine globale Eigenschaft und kann nicht über eine ausgewertete Eigenschaftengruppe geändert werden. Verwenden Sie stattdessen {1}. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - Modifying the XML of an imported project file is not allowed. Open that project file directly. - İçeri aktarılan proje dosyasının XML'sini değiştirmeye izin verilmez. İlgili proje dosyasını doğrudan açın. - - - Der XML-Code einer importierten Projektdatei darf nicht geändert werden. Öffnen Sie diese Projektdatei direkt. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB4117: The "{0}" item name is reserved, and cannot be used. - MSB4117: "{0}" öğe adı ayrılmış ve kullanılamaz. - {StrBegin="MSB4117: "}UE: This message is shown when the user tries to redefine one of the reserved MSBuild items e.g. @(Choose) - - MSB4117: Der Elementname "{0}" ist reserviert und kann nicht verwendet werden. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4118: The "{0}" item metadata name is reserved, and cannot be used. - MSB4118: "{0}" öğe meta verisi adı ayrılmış ve kullanılamaz. - {StrBegin="MSB4118: "}UE: This message is shown when the user tries to redefine one of the reserved MSBuild items e.g. @(Choose) - - MSB4118: Der Elementmetadatenname "{0}" ist reserviert und kann nicht verwendet werden. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4004: The "{0}" property is reserved, and cannot be modified. - MSB4004: "{0}" özelliği ayrılmış ve değiştirilemez. - {StrBegin="MSB4004: "}UE: This message is shown when the user tries to redefine one of the reserved MSBuild properties e.g. $(MSBuildProjectFile) - - MSB4004: Die {0}-Eigenschaft ist reserviert und kann nicht geändert werden. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4094: "{0}" is an invalid value for the "{1}" parameter of the "{3}" task. Multiple items cannot be passed into a parameter of type "{2}". - MSB4094: "{0}" değeri "{3}" görevinin "{1}" parametresi için geçersiz bir değer. "{2}" türündeki bir parametreye birden fazla öğe geçirilemez. - {StrBegin="MSB4094: "} - UE: This error is shown when a project tries to pass multiple items into a task parameter of type ITaskItem (singular). - - - MSB4094: "{0}" ist ein ungültiger Wert für den "{1}"-Parameter der "{3}"-Aufgabe. Mehrere Elemente können nicht in einen Parameter vom Typ "{2}" übergeben werden. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4115: The "{0}" function only accepts a scalar value, but its argument "{1}" evaluates to "{2}" which is not a scalar value. - MSB4115: "{0}" işlevi yalnızca skalar değer kabul eder, ancak "{1}" bağımsız değişkeni skalar değer olmayan "{2}" olarak değerlendiriliyor. - {StrBegin="MSB4115: "} - UE: This error is shown when a project tries to pass multiple items into a function in a conditional expression, that can only accept a scalar value (such as the "exists()" function). - - - MSB4115: Die "{0}"-Funktion nimmt nur einen Skalarwert an, ihr "{1}"-Argument wird jedoch zu "{2}" ausgewertet, bei dem es sich nicht um einen Skalarwert handelt. - - fuzzyMatch="100" wordcount="22" adjWordcount="5.5" curWordcount="5.5" tmLabel="N''" - - - The task is currently associated with a project object, and should not be added to a different one. - Görev bir proje nesnesiyle ilişkilendirilmiş durumda; farklı bir nesneye eklenmemelidir. - - - Die Aufgabe ist derzeit einem Projektobjekt zugeordnet und sollte zu keinem anderen Projektobjekt hinzugefügt werden. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - MSB4095: The item metadata %({0}) is being referenced without an item name. Specify the item name by using %(itemname.{0}). - MSB4095: %({0}) öğe meta verisine bir öğe adı olmadan başvuruluyor. Öğe adını %(itemname.{0}) kullanarak belirtin. - {StrBegin="MSB4095: "} - - MSB4095: Auf die %({0})-Elementmetadaten wird ohne einen Elementnamen verwiesen. Geben Sie den Namen mithilfe von %(itemname.{0}) an. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - The task is not associated with the specified target element collection, and should not be removed from it. - Görev, belirtilen hedef öğe koleksiyonuyla ilişkilendirilmemiş; buradan kaldırılmamalıdır. - - - Die Aufgabe ist nicht der angegebenen Auflistung von Zielelementen zugeordnet und sollte nicht daraus entfernt werden. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - MSB4005: The current working directory could not be restored to {0}. {1} - MSB4005: Geçerli çalışma dizini {0} öğesine geri döndürülemedi. {1} - {StrBegin="MSB4005: "}UE: This message is shown when the current working directory cannot be reset after a build. "{1}" contains a message explaining why. - LOCALIZATION: "{1}" is a message from an CLR/FX exception and is already localized. - - MSB4005: Das aktuelle Arbeitsverzeichnis konnte unter {0} nicht wiederhergestellt werden. {1} - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Cannot set a condition on an object not represented by an XML element in the project file. - Proje dosyasında bir XML öğesiyle gösterilmeyen nesne üzerinde koşul ayarlanamaz. - - - Eine Bedingung kann nicht für ein Objekt festgelegt werden, wenn das Objekt nicht von einem XML-Element in der Projektdatei repräsentiert wird. - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - Cannot set ContinueOnError on an object not represented by an XML element in the project file. - Proje dosyasında bir XML öğesiyle temsil edilmeyen nesne üzerinde ContinueOnError ayarlanamaz. - - - Das ContinueOnError-Attribut kann nicht für ein Objekt festgelegt werden, wenn das Objekt nicht von einem XML-Element in der Projektdatei repräsentiert wird. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB4134: DefaultToolsVersion cannot be set after a project has been loaded into the Engine. - MSB4134: Altyapı'ya proje yüklendikten sonra DefaultToolsVersion ayarlanamaz. - {StrBegin="MSB4134: "} - - MSB4134: DefaultToolsVersion darf nicht festgelegt werden, nachdem ein Projekt in das Modul geladen wurde. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - Assigning the "{0}" attribute on an item that has been evaluated is not allowed. This operation is only allowed on the original persisted item that came directly from the project file. - Değerlendirilmiş bir öğe üzerinde "{0}" özniteliğini atamaya izin verilmez. Bu işleme, doğrudan proje dosyasından gelen özgün kalıcı öğe üzerinde izin verilir. - - - Das {0}-Attribut darf nicht einem Element zugewiesen werden, das ausgewertet wurde. Dieser Vorgang ist nur für das ursprüngliche persistente Element zulässig, das direkt aus der Projektdatei stammt. - - fuzzyMatch="101" wordcount="31" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Assigning the "{0}" attribute of a virtual item is not allowed. - Sanal öğenin"{0}" özniteliğini atamaya izin verilmez. - - - Das Zuweisen des {0}-Attributs eines virtuellen Elements ist nicht zulässig. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - A property cannot be set while building. - Oluşturma sırasında özellik ayarlanamaz. - - - Eine Eigenschaft kann nicht während des Erstellens festgelegt werden. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - A property cannot be set to null. - Özellik null olarak ayarlanamaz. - - - Eine Eigenschaft kann nicht auf NULL festgelegt werden. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Cannot get or set parameters on a task not associated with a project object. - Bir proje nesnesiyle ilişkilendirilmemiş görev üzerinde parametre alınamaz veya ayarlanamaz. - - - Parameter für eine Aufgabe können nicht abgefragt oder festgelegt werden, wenn die Aufgabe keinem Projektobjekt zugeordnet ist. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4162: <{0}> is not valid. Child elements are not allowed below a item remove element. - MSB4162: <{0}> geçerli değil. Öğe kaldırma öğesi altında alt öğelere izin verilmez. - {StrBegin="MSB4162: "} - - MSB4162: <{0}> ist ungültig. Untergeordnete Elemente dürfen nicht unter einem Element Element entfernen. - - fuzzyMatch="15" wordcount="16" adjWordcount="13.6" curWordcount="13.6" - - - MSB4166: Child node "{0}" exited prematurely. Shutting down. - MSB4166: "{0}" alt düğümü beklenenden önce çıktı. Kapatılıyor. - {StrBegin="MSB4166: "} - - MSB4166: Der untergeordnete Knoten "{0}" wurde vorzeitig beendet. Herunterfahren. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4085: A <Choose> must contain at least one <When>. - MSB4085: Bir <Choose> en az bir <When> içermelidir. - {StrBegin="MSB4085: "} - - MSB4085: < auswählen > muss mindestens < Wenn >. - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB4114: <Choose> elements cannot be nested more than {0} levels deep. - MSB4114: <Choose> öğeleri {0} düzeyden daha fazla iç içe geçirilemez. - {StrBegin="MSB4114: "}UE: This message appears if the project file contains unreasonably nested Choose elements. - LOCALIZATION: Do not localize "Choose" as it is an XML element name. - - MSB4114: < auswählen > Elemente können nicht geschachtelt werden mehr als {0} Ebenen. - - fuzzyMatch="15" wordcount="12" adjWordcount="10.2" curWordcount="10.2" - - - MSB4006: There is a circular dependency in the target dependency graph involving target "{0}". - MSB4006: "{0}" hedefini içeren hedef bağımlılık grafiğinde döngüsel bağımlılık var. - {StrBegin="MSB4006: "}UE: This message is shown when the build engine detects a target referenced in a circular manner -- a project cannot - request a target to build itself (perhaps via a chain of other targets). - - MSB4006: Im Zielabhängigkeitsdiagramm besteht eine Ringabhängigkeit im Zusammenhang mit dem Ziel "{0}". - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4086: A numeric comparison was attempted on "{1}" that evaluates to "{2}" instead of a number, in condition "{0}". - MSB4086: "{0}" koşulunda sayı yerine "{2}" olarak değerlendirilen "{1}" üzerinde sayısal karşılaştırma denendi. - {StrBegin="MSB4086: "} - - MSB4086: Es wurde versucht, einen numerischen Vergleich für "{1}" auszuführen, der zu "{2}" anstatt zu einer Zahl in Bedingung "{0}" ausgewertet wird. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4007: The clause "{0}", specified in the "{1}" attribute is invalid. - MSB4007: "{1}" özniteliğinde belirtilen "{0}" yan tümcesi geçersiz. - {StrBegin="MSB4007: "}UE: This message is shown when the Condition on an element is invalid in some way -- e.g. syntax error, unrecognized operator. - - MSB4007: Die im {1}-Attribut festgelegte {0}-Klausel ist ungültig. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4130: The condition "{0}" may have been evaluated incorrectly in an earlier version of MSBuild. Please verify that the order of the AND and OR clauses is written as intended. To avoid this warning, add parentheses to make the evaluation order explicit. - MSB4130: "{0}" koşulu önceki bir MSBuild sürümünde hatalı bir biçimde değerlendirilmiş olabilir. AND ve OR yan tümcelerinin amaçlanan sırayla yazıldığını doğrulayın. Bu uyarıyı engellemek için parantez ekleyerek değerlendirme sırasını açık hale getirin. - {StrBegin="MSB4130: "} - - MSB4130: Die Bedingung "{0}" ist in einer früheren Version von MSBuild möglicherweise fehlerhaft ausgewertet worden. Stellen Sie sicher, dass die AND- und OR-Klauseln in der beabsichtigten Reihenfolge stehen. Damit diese Warnung nicht angezeigt wird, fügen Sie Klammern hinzu, um die Auswertungsreihenfolge explizit anzugeben. - - fuzzyMatch="101" wordcount="42" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4087: Specified condition "{0}" does not evaluate to a boolean. - MSB4087: Belirtilen "{0}" koşulu boole olarak değerlendirilmez. - {StrBegin="MSB4087: "} - - MSB4087: Die angegebene {0}-Bedingung wird nicht zu einem booleschen Wert ausgewertet. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4113: Specified condition "{0}" evaluates to "{1}" instead of a boolean. - MSB4113: Belirtilen "{0}" koşulu, boole yerine "{1}" olarak değerlendirilir. - {StrBegin="MSB4113: "} - - MSB4113: Die angegebene Bedingung {0} wird zu {1} statt zu einem booleschen Wert ausgewertet. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - {0}, line {1} - {0}, satır {1} - - - {0}, Zeile {1} - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - MSB4136: Error reading the toolset information from the configuration file "{0}". {1} - MSB4136: "{0}" yapılandırma dosyasından araç kümesi bilgilerini okuma hatası. {1} - {StrBegin="MSB4136: "} - - MSB4136: Fehler beim Lesen der Toolsetinformationen aus der Konfigurationsdatei "{0}". {1} - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4008: A conflicting assembly for the task assembly "{0}" has been found at "{1}". - MSB4008: "{0}" görev derlemesi için "{1}" konumunda çakışan derleme bulundu. - {StrBegin="MSB4008: "}UE: This message is shown when the type/class of a task cannot be resolved uniquely from a single assembly. - - MSB4008: Eine mit der Aufgabenassembly "{0}" in Konflikt stehende Assembly wurde in "{1}" gefunden. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4142: MSBuildToolsPath is not the same as MSBuildBinPath for the ToolsVersion "{0}" defined at "{1}". If both are present they must have the same value. - MSB4142: MSBuildToolsPath, "{1}" konumunda tanımlanan ToolsVersion "{0}" için MSBuildBinPath ile aynı değil. Her ikisi de varsa, bunların aynı değere sahip olması gerekir. - {StrBegin="MSB4142: "} - - MSB4142: MSBuildToolsPath ist nicht identisch mit MSBuildBinPath für die bei "{1}" definierte ToolsVersion {0}. Wenn beide Pfade vorhanden sind, müssen sie identische Werte haben. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4097: The element <{0}> beneath element <{1}> may not have a custom XML namespace. - MSB4097: <{1}> öğesinin altındaki <{0}> öğesi özel bir XML ad alanına sahip olmayabilir. - {StrBegin="MSB4097: "} - - MSB4097: Das Element <{0}> unter Element <{1}> möglicherweise keinen benutzerdefinierten XML-Namespace. - - fuzzyMatch="15" wordcount="16" adjWordcount="13.6" curWordcount="13.6" - - - MSB4009: The default tasks file could not be successfully loaded. {0} - MSB4009: Varsayılan görevler dosyası başarıyla yüklenemedi. {0} - {StrBegin="MSB4009: "}UE: This message is shown when one of the default tasks file (*.tasks) located alongside the MSBuild binaries cannot - be opened/parsed. "{0}" contains a message explaining why. The filename itself is not part of the message but is provided - separately to loggers. - LOCALIZATION: "{0}" is a message from some FX method and is already localized. - - MSB4009: Die Standardaufgabendatei konnte nicht geladen werden. {0} - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4010: The "{0}" files could not be successfully loaded from their expected location "{1}". Default tasks will not be available. {2} - MSB4010: "{0}" dosyaları, beklenen "{1}" konumundan başarıyla yüklenemedi. Varsayılan görevler kullanılamayacak. {2} - {StrBegin="MSB4010: "}UE: This message is shown when the default tasks files that are located alongside the MSBuild binaries cannot be - found, either because they don't exist, or because of lack of permissions. "{2}" contains a message explaining why. - LOCALIZATION: "{2}" is a message from some FX method and is already localized. - - MSB4010: Die {0}-Dateien konnten nicht vom erwarteten Speicherplatz "{1}" geladen werden. Standardaufgaben sind nicht verfügbar. {2} - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - MSB4140: Default tools version is specified in neither the registry nor the configuration file. - MSB4140: Varsayılan araçların sürümü ne kayıt defterinde ne de yapılandırma dosyasında belirtildi. - {StrBegin="MSB4140: "} - - MSB4140: Die Standardtoolsversion ist weder in der Registrierung noch in der Konfigurationsdatei angegeben. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4133: A default tools version "{0}" was specified, but its definition could not be found. - MSB4133: "{0}" varsayılan araçlar sürümü belirtildi, ancak bunun tanımı bulunamadı. - {StrBegin="MSB4133: "} - - MSB4133: Eine Standardtoolsversion "{0}" wurde angegeben, aber ihre Definition konnte nicht gefunden werden. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - MSB4080: The value "{0}" of the "PropertyName" attribute in element <Output> contains a "$" character. If you intended to use a property name then remove the $( ) around the property name. - MSB4080: <Output> öğesindeki "PropertyName" özniteliğinin "{0}" değeri "$" karakteri içeriyor. Özelik adı kullanmayı amaçlıyorsanız, özellik adının yanındaki $( ) karakterini kaldırın. - {StrBegin="MSB4080: "}UE: This message is shown when an output tag has an property name that contains an $. They probably typed $(foo) instead of foo in the PropertyName. LOCALIZATION: Output and PropertyName should not be localized. - - MSB4080: Der Wert "{0}" "PropertyName-Attribut im Element < Output >"$"-Zeichen enthält. Wenn Sie auf einen Eigenschaftennamen verwenden und entfernen Sie anschließend die ($), um den Eigenschaftennamen. - - fuzzyMatch="15" wordcount="32" adjWordcount="27.2" curWordcount="27.2" - - - MSB4011: There is a circular reference involving the import of file "{0}". This file may have been imported more than once, or you may have attempted to import the main project file. All except the first instance of this file will be ignored. - MSB4011: "{0}" dosyasını içeri aktarma işlemini içeren bir döngüsel başvuru var. Bu dosya bir kereden fazla içeri aktarılmış olabilir veya ana proje dosyasını içeri aktarmayı denemiş olabilirsiniz. Bu dosyanın ilk örneğinin dışındaki tüm örnekler yoksayılacak. - {StrBegin="MSB4011: "} - - MSB4011: Es besteht eine Ringabhängigkeit im Zusammenhang mit dem Import der Datei {0}. Diese Datei wurde unter Umständen mehrmals importiert, oder es wurde versucht, die Hauptprojektdatei zu importieren. Alle außer der ersten Instanz dieser Datei werden ignoriert. - - fuzzyMatch="101" wordcount="43" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4079: The <ProjectExtensions> element occurs more than once. - MSB4079: <ProjectExtensions> öğesi birden fazla yineleniyor. - {StrBegin="MSB4079: "} - - MSB4079: Das Element < ProjectExtensions > tritt mehr als einmal. - - fuzzyMatch="15" wordcount="9" adjWordcount="7.65" curWordcount="7.65" - - - MSB4012: The expression "{0}" cannot be used in this context. Item lists cannot be concatenated with other strings where an item list is expected. Use a semicolon to separate multiple item lists. - MSB4012: "{0}" ifadesi bu bağlamda kullanılamaz. Öğe listeleri bir öğe listesinin beklendiği diğer dizelerle birleştirilemez. Birden fazla öğe listesini ayırmak için noktalı virgül kullanın. - {StrBegin="MSB4012: "}UE: This message is shown when the user does not properly specify an item list when an item list is expected - e.g. "badprefix@(foo)badsuffix" instead of "prefix; @(foo); suffix" - - MSB4012: Der Ausdruck {0} kann in diesem Kontext nicht verwendet werden. Elementlisten können nicht mit anderen Zeichenfolgen verkettet werden, wenn eine Elementliste erwartet wird. Verwenden Sie ein Semikolon, um mehrere Elementlisten voneinander zu trennen. - - fuzzyMatch="101" wordcount="32" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Need to specify the project file name. - Proje dosyası adının belirtilmesi gerekir. - UE: This message is shown when the user calls into the engine to build a project without specifying a filename. - - Geben Sie den Projektdateinamen an. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - end of input - girişin sonu - This is the name of the "EndOfInput" token. It is displayed in quotes as the - unexpected char or token when the end of a conditional was unexpectedly reached. - - Ende der Eingabe - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - The previous error was converted to a warning because the task was called with ContinueOnError=true. - Görev ContinueOnError=true ile çağrıldığından, önceki hata uyarıya dönüştürüldü. - - - Der vorherige Fehler wurde in eine Warnung umgewandelt, da die Aufgabe mit ContinueOnError=true aufgerufen wurde. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - {0} Error(s) - {0} Hata - - - {0} Fehler - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4159: Error creating the toolset "{0}". {1} - MSB4159: "{0}" araç kümesini oluşturma hatası. {1} - {StrBegin="MSB4159: "} - - MSB4159: Fehler beim Erstellen des Toolsets "{0}". {1} - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4146: Cannot evaluate the property expression "{0}" found at "{1}". {2} - MSB4146: "{1}" konumunda bulunan "{0}" özellik ifadesi değerlendirilemiyor. {2} - {StrBegin="MSB4146: "} - - MSB4146: Der bei "{1}" gefundene Eigenschaftsausdruck "{0}" kann nicht ausgewertet werden. {2} - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - The <{0}> tag is no longer supported as a child of the <Project> element. Place this tag within a target, and add the name of the target to the "InitialTargets" attribute of the <Project> element. - <{0}> etiketi artık <Project> öğesinin alt öğesi olarak desteklenmiyor. Bu etiketi bir hedef içine yerleştirin ve hedefin adını <Project> öğesinin "InitialTargets" özniteliğine ekleyin. - - - Das <{0}>-Tag nicht als untergeordnetes Element des < Project >-Elements unterstützt. Platzieren Sie dieses Tag in einem Ziel und fügen Sie den Namen des Ziels InitialTargets-Attribut des < Project >-Elements hinzu. - - fuzzyMatch="15" wordcount="38" adjWordcount="32.3" curWordcount="32.3" - - - MSB4100: Expected "{0}" to evaluate to a boolean instead of "{1}", in condition "{2}". - MSB4100: "{0}" öğesinin "{2}" koşulunda "{1}" yerine boole olarak değerlendirilmesi bekleniyor. - {StrBegin="MSB4100: "} - - MSB4100: Das Ergebnis der Auswertung von {0} war {1}, es wurde jedoch ein boolescher Wert in der {2}-Bedingung erwartet. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4028: The "{0}" task's outputs could not be retrieved from the "{1}" parameter. {2} - MSB4028: "{0}" görevinin çıkışları "{1}" parametresinden alınamadı. {2} - {StrBegin="MSB4028: "} - - MSB4028: Die Ausgaben der {0}-Aufgabe konnten nicht aus dem {1}-Parameter abgerufen werden. {2} - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4014: The build was aborted because of an internal failure. - MSB4014: İç hata nedeniyle oluşturma durduruldu. - {StrBegin="MSB4014: "}UE: This message is shown when an unhandled exception terminates the build. The cause is most likely a programming - error in the build engine. - - MSB4014: Das Erstellen wurde aufgrund eines internen Fehlers abgebrochen. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4015: The build was aborted because the "{0}" logger failed unexpectedly during shutdown. - MSB4015: Kapatma sırasında "{0}" günlükçüsü beklenmedik bir biçimde başarısız olduğundan oluşturma durduruldu. - {StrBegin="MSB4015: "}UE: This message is used for a special exception that is thrown when a logger fails while shutting down (most likely - because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a special - exception to abort the build. - - MSB4015: Das Erstellen wurde abgebrochen, da für die {0}-Protokollierung beim Herunterfahren ein unerwarteter Fehler aufgetreten ist. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4016: The build was aborted because the "{0}" logger failed unexpectedly during initialization. - MSB4016: Başlatma sırasında "{0}" günlükçüsü beklenmedik bir biçimde başarısız olduğundan oluşturma durduruldu. - {StrBegin="MSB4016: "}UE: This message is used for a special exception that is thrown when a logger fails while initializing itself (most - likely because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a - special exception to abort the build. - - MSB4016: Das Erstellen wurde abgebrochen, da für die {0}-Protokollierung bei der Initialisierung ein unerwarteter Fehler aufgetreten ist. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4017: The build was aborted because of an unexpected logger failure. - MSB4017: Beklenmedik bir günlükçü hatası nedeniyle oluşturma durduruldu. - {StrBegin="MSB4017: "}UE: This message is used for a special exception that is thrown when a logger fails while logging an event (most - likely because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a - special exception to abort the build. - - MSB4017: Das Erstellen wurde wegen eines unerwarteten Protokollierungsfehlers abgebrochen. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4018: The "{0}" task failed unexpectedly. - MSB4018: "{0}" görevi beklenmedik biçimde başarısız oldu. - {StrBegin="MSB4018: "}UE: This message is shown when a task terminates because of an unhandled exception. The cause is most likely a - programming error in the task; however, it is also possible that the unhandled exception originated in the engine, and was - surfaced through the task when the task called into the engine. - - MSB4018: Unerwarteter Fehler bei der {0}-Aufgabe. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4165: Failed to receive a response from the child node "{0}" in the timeout period "{1}" ms. Shutting down. - MSB4165: "{0}" alt düğümünden "{1}" ms olan zaman aşımı süresi içinde yanıt alınamadı. Kapatılıyor. - {StrBegin="MSB4165: "} - - MSB4165: Vom untergeordneten Knoten "{0}" wurde innerhalb des Zeitlimits von "{1}" ms keine Antwort empfangen. Herunterfahren. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4088: Condition "{0}" is improperly constructed. - MSB4088: "{0}" koşulu hatalı oluşturulmuş. - {StrBegin="MSB4088: "} - - MSB4088: Die {0}-Bedingung ist falsch konstruiert. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4105: Found an unexpected character '{2}' at position {1} in condition "{0}". Did you intend to use "=="? - MSB4105: "{0}" koşulunda, '{1}' konumunda beklenmeyen {2} karakteri bulundu. "==" kullanmak mı istediniz? - {StrBegin="MSB4105: "} - - MSB4105: Ein unerwartetes Zeichen {2} wurde an Position {1} in der {0}-Bedingung gefunden. Wollten Sie "==" verwenden? - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - MSB4106: Expected an item list at position {1} in condition "{0}". Did you forget the closing parenthesis? - MSB4106: "{0}" koşulunda, {1} konumunda bir öğe listesi bekleniyordu. Parantezi kapatmayı mı unuttunuz? - {StrBegin="MSB4106: "} - - MSB4106: Eine Elementliste wurde an Position {1} in Bedingung {0} erwartet. Haben Sie die schließende Klammer vergessen? - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - MSB4107: Expected an item list at position {1} in condition "{0}". Did you forget the opening parenthesis after the '@'? To use a literal '@', use '%40' instead. - MSB4107: "{0}" koşulunda, {1} konumunda bir öğe listesi bekleniyordu. '@' sonrasında parantez açmayı mı unuttunuz? '@' sabit değerini kullanmak için '%40' kullanın. - {StrBegin="MSB4107: "} - - MSB4107: Eine Elementliste wurde an Position {1} in Bedingung {0} erwartet. Haben Sie die öffnende Klammer hinter dem Zeichen "@" vergessen? Wenn Sie ein literales "@" verwenden möchten, geben Sie "%40" ein. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4108: Expected an item list at position {1} in condition "{0}". Did you forget to close a quote inside the item list expression? - MSB4108: "{0}" koşulunda, {1} konumunda bir öğe listesi bekleniyordu. Öğe listesi ifadesinin içinde bir tırnağı kapatmayı mı unuttunuz? - {StrBegin="MSB4108: "} - - MSB4108: Eine Elementliste wurde an Position {1} in Bedingung {0} erwartet. Haben Sie das schließende Anführungszeichen innerhalb des Elementlistenausdrucks vergessen? - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - MSB4109: Expected a property at position {1} in condition "{0}". Did you forget the closing parenthesis? - MSB4109: "{0}" koşulunda, {1} konumunda bir özellik bekleniyordu. Parantezi kapatmayı mı unuttunuz? - {StrBegin="MSB4109: "} - - MSB4109: Eine Eigenschaft wurde an Position {1} in Bedingung {0} erwartet. Haben Sie die schließende Klammer vergessen? - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB4110: Expected a property at position {1} in condition "{0}". Did you forget the opening parenthesis after the '$'? To use a literal '$', use '%24' instead. - MSB4110: "{0}" koşulunda, {1} konumunda bir özellik bekleniyordu. '$' sonrasında parantez açmayı mı unuttunuz? '$' sabit değerini kullanmak için '%24' kullanın. - {StrBegin="MSB4110: "} - - MSB4110: Eine Eigenschaft wurde an Position {1} in Bedingung {0} erwartet. Haben Sie die öffnende Klammer hinter dem Zeichen "$" vergessen? Wenn Sie eine literales "$" verwenden möchten, geben Sie "%24" ein. - - fuzzyMatch="101" wordcount="27" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4101: Expected a closing quote after position {1} in condition "{0}". - MSB4101: "{0}" koşulunda {1} konumundan sonra bir kapatma tırnağı bekleniyor. - {StrBegin="MSB4101: "} - - MSB4101: Es wurde ein schließendes Anführungszeichen hinter Position {1} in Bedingung {0} erwartet. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4019: The imported project "{0}" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. - MSB4019: İçeri aktarılan "{0}" projesi bulunamadı. <Import> bildirimindeki yolun doğru olduğunu ve dosyanın diskte bulunduğunu doğrulayın. - {StrBegin="MSB4019: "}LOCALIZATION: <Import> should not be localized. - - MSB4019: Das importierte Projekt "{0}" wurde nicht gefunden. Bestätigen Sie den Pfad in der Deklaration < Import > und die Datei auf dem Datenträger vorhanden ist. - - fuzzyMatch="15" wordcount="26" adjWordcount="22.1" curWordcount="22.1" - - - MSB4089: Incorrect number of arguments to function in condition "{0}". Found {1} argument(s) when expecting {2}. - MSB4089: "{0}" koşulunda yanlış sayıda bağımsız değişken belirlendi. {2} bağımsız değişken beklenirken {1} bağımsız değişken bulundu. - {StrBegin="MSB4089: "} - - MSB4089: Falsche Anzahl von Argumenten für eine Funktion in der Bedingung "{0}". {1} Argument(e) gefunden, obwohl {2} erwartet wurde(n). - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - The "{0}" object specified does not belong to the correct "{1}" object. - Belirtilen "{0}" nesnesi doğru "{1}" nesnesine ait değil. - - - Das angegebene {0}-Objekt gehört nicht zum korrekten {1}-Objekt. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4020: The value "{0}" of the "{1}" attribute in element <{2}> is invalid. - MSB4020: <{2}> öğesindeki "{1}" özniteliğinin "{0}" değeri geçersiz. - {StrBegin="MSB4020: "}UE: This is a generic message that is displayed when we find a project element with an incorrect value for one of its - attributes e.g. <Import Project=""> -- the value of Project should not be an empty string. - - MSB4020: Der Wert "{0}" von der "{1}" Attribut im Element <{2}> ist ungültig. - - fuzzyMatch="15" wordcount="14" adjWordcount="11.9" curWordcount="11.9" - - - MSB4102: The value "{0}" of the "{1}" attribute in element <{2}> is invalid. {3} - MSB4102: <{2}> öğesindeki "{1}" özniteliğinin "{0}" değeri geçersiz. {3} - {StrBegin="MSB4102: "}UE: This is a generic message that is displayed when we find a project element with an incorrect value for one of its - attributes. At the end of the message we show the exception text we got trying to use the value. - - MSB4102: Der Wert "{0}" von der "{1}" Attribut im Element <{2}> ist ungültig. {3} - - fuzzyMatch="15" wordcount="15" adjWordcount="12.75" curWordcount="12.75" - - - MSB4021: The "ContinueOnError" attribute of the "{0}" task is not valid. {1} - MSB4021: "{0}" görevinin "ContinueOnError" özniteliği geçersiz. {1} - {StrBegin="MSB4021: "}LOCALIZATION: "ContinueOnError" should not be localized. "{1}" is a message from another exception explaining the problem. - - MSB4021: Das ContinueOnError-Attribut für die {0}-Aufgabe ist ungültig. {1} - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4139: Invalid value for default ToolsVersion is specified in registry key "{0}". - MSB4139: "{0}" kayıt defteri anahtarında varsayılan ToolsVersion için geçersiz değer belirtildi. - {StrBegin="MSB4139: "} - - MSB4139: Im Registrierungsschlüssel "{0}" ist ein ungültiger Wert für die Standard-ToolsVersion angegeben. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4022: The result "{0}" of evaluating the value "{1}" of the "{2}" attribute in element <{3}> is not valid. - MSB4022: <{3}> öğesindeki "{2}" özniteliğinin "{1}" değerini "{0}" olarak değerlendirme sonucu geçersiz. - {StrBegin="MSB4022: "}UE: This message is shown when the engine is checking the correctness of the value (after evaluating embedded - properties/items) assigned to an XML attribute of an XML element in the project file. - - MSB4022: Das Ergebnis "{0}"der Auswertung des Werts"{1}" von der "{2}" Attribut im Element <{3}> ist ungültig. - - fuzzyMatch="15" wordcount="20" adjWordcount="17" curWordcount="17" - - - "{0}" is not a valid event category. To raise a custom event, use the "{1}" category. - "{0}", geçerli bir olay kategorisi değil. Özel bir olay oluşturmak için "{1}" kategorisini kullanın. - - - {0} ist keine gültige Ereigniskategorie. Verwenden Sie die {1}-Kategorie, um ein benutzerdefiniertes Ereignis auszulösen. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - "{0}" is not a valid importance level for events. - "{0}", olaylar için geçerli bir önem düzeyi değil. - - - {0} ist kein gültiger Wert für die Bedeutung eines Ereignisses. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4104: Failed to write to log file "{0}". {1} - MSB4104: "{0}" günlük dosyasına yazılamadı. {1} - {StrBegin="MSB4104: "}UE: This is shown when the File Logger can't create or write to the file it was instructed to log to. - - MSB4104: Fehler beim Schreiben in die Protokollierungsdatei "{0}". {1} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4024: The imported project file could not be loaded. {0} - MSB4024: İçeri aktarılan proje dosyası yüklenemedi. {0} - {StrBegin="MSB4024: "}UE: This message is shown when an imported project file cannot be loaded because of incorrect XML. The project - filename is not part of the message because it is provided separately to loggers. - LOCALIZATION: {0} is a localized message from the CLR/FX explaining why the project is invalid. - - MSB4024: Die importierte Projektdatei konnte nicht geladen werden. {0} - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - Operation invalid for a persisted item group. - Kalıcı öğe grubu için işlem geçersiz. - - - Ungültiger Vorgang für eine persistente Elementgruppe. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Operation invalid for a virtual item group. - Sanal öğe grubu için işlem geçersiz. - - - Ungültiger Vorgang für eine virtuelle Elementgruppe. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4071: The value Importance="{0}" in the <Message> element is invalid. Valid values are: High, Normal and Low. - MSB4071: <Message> öğesindeki Importance="{0}" değeri geçersiz. Geçerli değerler şunlardır: High, Normal ve Low. - {StrBegin="MSB4071: "}UE: This message is shown when a user specifies a value for the importance attribute of Message which is not valid. - The importance enumeration is: High, Normal and Low. Specifying any other importance will result in this message being shown - LOCALIZATION: "Importance" should not be localized. - "Message" should not be localized. - High should not be localized. - Normal should not be localized. - Low should not be localized. - - MSB4071: Der Wert Importance = "{0}" in < Nachricht > Element ist ungültig. Gültige Werte sind: hoch, Normal und niedrig. - - fuzzyMatch="15" wordcount="18" adjWordcount="15.3" curWordcount="15.3" - - - MSB4025: The project file could not be loaded. {0} - MSB4025: Proje dosyası yüklenemedi. {0} - {StrBegin="MSB4025: "}UE: This message is shown when the project file given to the engine cannot be loaded because the filename/path is - invalid, or due to lack of permissions, or incorrect XML. The project filename is not part of the message because it is - provided separately to loggers. - LOCALIZATION: {0} is a localized message from the CLR/FX explaining why the project is invalid. - - MSB4025: Die Projektdatei konnte nicht geladen werden. {0} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4147: The property "{0}" at "{1}" is invalid. {2} - MSB4147: "{1}" konumundaki "{0}" özelliği geçersiz. {2} - {StrBegin="MSB4147: "} - - MSB4147: Die {0}-Eigenschaft bei "{1}" ist ungültig. {2} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - "{0}" is an invalid "ProjectFileEncoding" value. - "{0}", geçersiz bir "ProjectFileEncoding" değeridir. - LOCALIZATION: "ProjectFileEncoding" should not be localized. - - {0} ist ein ungültiger ProjectFileEncoding-Wert. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4143: The expression "{0}" cannot be evaluated. {1} - MSB4143: "{0}" ifadesi değerlendirilemiyor. {1} - {StrBegin="MSB4143: "} - UE: This message is shown when the user attempts to provide an expression like "$(Registry:HKEY_LOCAL_MACHINE\Software\Vendor\Tools@TaskLocation)" - LOCALIZATION: "{0}" is the expression that was bad. "{1}" is a message from an FX exception that describes why the expression is bad. - - - MSB4143: Der Ausdruck "{0}" kann nicht ausgewertet werden. {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4184: The expression "{0}" cannot be evaluated. {1} - MSB4184: "{0}" ifadesi değerlendirilemiyor. {1} - {StrBegin="MSB4184: "} - Single quotes as the expression will typically have double quotes in it. - UE: This message is shown when the user attempts to provide an expression like "$(SomeProperty.ToLower())" - LOCALIZATION: "{0}" is the expression that was bad. "{1}" is a message from an FX exception that describes why the expression is bad. - - - MSB4184: Der Ausdruck "{0}" kann nicht ausgewertet werden. {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4185: The function "{0}" on type "{1}" has not been enabled for execution. - MSB4185: "{1}" türü üzerindeki "{0}" işlevi yürütülmek üzere etkinleştirilmemiş. - {StrBegin="MSB4185: "} - UE: This message is shown when the user attempts to provide an expression like "$([System.DateTime]::Now)", but the expression has not been enabled - LOCALIZATION: "{0}" is the static function name, "{1}" is the .NET Framework type name - - - MSB4185: Die {0}-Funktion für den {1}-Typ wurde nicht für die Ausführung aktiviert. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4186: Invalid static method invocation syntax: "{0}". Static method invocation should be of the form: $([FullTypeName]::Method()), e.g. $([System.IO.Path]::Combine(`a`, `b`)) - MSB4186: Geçersiz statik yöntem çağırma sözdizimi: "{0}". Statik yöntem çağırma şu biçimde olmalıdır: $([TamTürAdı]::Yöntem()), örn. $([System.IO.Path]::Combine(`a`, `b`)) - {StrBegin="MSB4186: "} - UE: This message is shown when the user attempts to call a static method on a type, but has used the incorrect syntax - LOCALIZATION: "{0}" is the function expression which is in error - - - MSB4186: Ungültige Aufrufsyntax für statische Methode: "{0}". Für den Aufruf statischer Methoden muss folgendes Format verwendet werden: $([vollständiger Typname]::Methode()), z. B. $([System.IO.Path]::Combine(`a`, `b`)) - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4070: The schema "{0}" is not valid. {1} - MSB4070: "{0}" şeması geçerli değil. {1} - {StrBegin="MSB4070: "}UE: This message is shown when the schema file provided for the validation of a project is itself not valid. - LOCALIZATION: "{0}" is the schema file path. "{1}" is a message from an FX exception that describes why the schema file is bad. - - MSB4070: Das Schema "{0}" ist nicht gültig. {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4026: The "{0}={1}" parameter for the "{2}" task is invalid. - MSB4026: "{2}" görevi için "{0}={1}" parametresi geçersiz. - {StrBegin="MSB4026: "}UE: This message is displayed when a task has an invalid parameter that cannot be initialized. - - MSB4026: Der {0}={1}-Parameter für die {2}-Aufgabe ist ungültig. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4027: The "{0}" task generated invalid items from the "{1}" output parameter. {2} - MSB4027: "{0}" görevi, "{1}" çıkış parametresinden geçersiz öğeler üretti. {2} - {StrBegin="MSB4027: "} - - MSB4027: Die {0}-Aufgabe generierte ungültige Elemente aus dem {1}-Ausgabeparameter. {2} - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4029: The "{0}" task has an invalid output specification. The "TaskParameter" attribute is required, and either the "ItemName" or "PropertyName" attribute must be specified (but not both). - MSB4029: "{0}" görevinin çıkış belirtimi geçersiz. "TaskParameter" özniteliği gereklidir ve "ItemName" veya "PropertyName" özniteliği belirtilmelidir (ancak ikisi birden değil). - {StrBegin="MSB4029: "}LOCALIZATION: "TaskParameter", "ItemName" and "PropertyName" should not be localized. - - MSB4029: Die {0}-Aufgabe enthält eine ungültige Ausgabespezifikation. Das TaskParameter-Attribut ist erforderlich, und es muss entweder das ItemName- oder PropertyName-Attribut angegeben werden (jedoch nicht beide). - - fuzzyMatch="101" wordcount="27" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4030: "{0}" is an invalid value for the "{1}" parameter of the "{3}" task. The "{1}" parameter is of type "{2}". - MSB4030: "{0}" değeri "{3}" görevinin "{1}" parametresi için geçersiz bir değer. "{1}" parametresi "{2}" türünde. - {StrBegin="MSB4030: "}UE: This error is shown when a type mis-match occurs between the value assigned to task parameter in the project file - and the type of the .NET property that corresponds to the task parameter. For example, if an int task parameter called "Count" - is assigned the value "x", this error would be displayed: <MyTask Count="x" /> - - MSB4030: "{0}" ist ein ungültiger Wert für den {1}-Parameter der {3}-Aufgabe. Der {1}-Parameter ist vom Typ "{2}". - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - MSB4137: Invalid value specified in the configuration file at "{0}". Property name or tools version name is an empty string. - MSB4137: "{0}" konumundaki yapılandırma dosyasında geçersiz değer belirtildi. Özellik adı veya araç sürüm adı boş bir dizedir. - {StrBegin="MSB4137: "} - - MSB4137: In der Konfigurationsdatei ist bei "{0}" ein ungültiger Wert angegeben. Der Eigenschaftenname oder der Toolsversionname ist eine leere Zeichenfolge. - - fuzzyMatch="100" wordcount="20" adjWordcount="5" curWordcount="5" tmLabel="N''" - - - MSB4103: "{0}" is not a valid logger verbosity level. - MSB4103: "{0}", geçerli bir günlükçü ayrıntı düzeyi değil. - {StrBegin="MSB4103: "} - - MSB4103: "{0}" ist kein gültiger Ausführlichkeitsgrad für die Protokollierung. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4163: <ItemDefinitionGroup> is not allowed inside a target. - MSB4163: <ItemDefinitionGroup> hedef içinde kullanılamaz. - {StrBegin="MSB4163: "} - - MSB4163: < ItemDefinitionGroup > ist in einem Ziel nicht zulässig. - - fuzzyMatch="15" wordcount="9" adjWordcount="7.65" curWordcount="7.65" - - - The specified item does not belong to the current item group. - Belirtilen öğe, geçerli öğe grubuna ait değil. - - - Das angegebene Element gehört nicht zu der aktuellen Elementgruppe. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4096: The item "{0}" in item list "{1}" does not define a value for metadata "{2}". In order to use this metadata, either qualify it by specifying %({1}.{2}), or ensure that all items in this list define a value for this metadata. - MSB4096: "{1}" öğe listesindeki "{0}" öğesi "{2}" meta verileri için bir değer tanımlamıyor. Bu meta verileri kullanmak için %({1}.{2}) belirterek uygun duruma getirin veya bu listedeki tüm öğelerin bu meta veriler için bir değer tanımladığından emin olun. - {StrBegin="MSB4096: "} - - MSB4096: Das Element "{0}" in der Elementliste "{1}" definiert keinen Wert für die {2}-Metadaten. Wenn Sie diese Metadaten verwenden möchten, qualifizieren Sie sie, indem Sie %({1}.{2}) angeben, oder vergewissern Sie sich, dass alle Elemente in der Liste einen Wert für diese Metadaten definieren. - - fuzzyMatch="101" wordcount="42" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4099: A reference to an item list at position {1} is not allowed in this condition "{0}". - MSB4099: Bu "{0}" koşulunda, {1} konumundaki bir öğe listesine yönelik başvuruya izin verilmiyor. - {StrBegin="MSB4099: "} - - MSB4099: Ein Verweis auf eine Elementliste an Position {1} ist in dieser {0}-Bedingung nicht zulässig. - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - MSB4033: "{0}" is a reserved item metadata, and cannot be redefined as a custom metadata on the item. - MSB4033: "{0}", bir ayrılmış öğe meta verisidir; öğe üzerinde özel meta veri olarak yeniden tanımlanamaz. - {StrBegin="MSB4033: "} - - MSB4033: "{0}" sind reservierte Elementmetadaten und können nicht als benutzerdefinierte Metadaten für das Element neu definiert werden. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - An InternalLoggerException can only be thrown by the MSBuild engine. The public constructors of this class cannot be used to create an instance of the exception. - InternalLoggerException yalnızca MSBuild altyapısı tarafından oluşturulabilir. Bu sınıfın genel oluşturucuları, özel durumun bir örneğini oluşturmak için kullanılamaz. - UE: This message is shown when a user tries to instantiate a special exception called InternalLoggerException through the OM -- - only the engine is allowed to create and throw this exception. - LOCALIZATION: "InternalLoggerException" and "MSBuild" should not be localized. - - Eine InternalLoggerException kann nur durch das MSBuild-Modul ausgelöst werden. Die öffentlichen Konstruktoren dieser Klasse können nicht verwendet werden, um eine Instanz der Ausnahme zu erstellen. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Initial Items: - İlk Öğeler: - - - Ursprüngliche Elemente: - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4083: Expected a Condition attribute on element "{0}". - MSB4083: "{0}" öğesinde Condition özniteliği bekleniyor. - {StrBegin="MSB4083: "} - - MSB4083: Es wurde ein Bedingungsattribut für das {0}-Element erwartet. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4164: The value "{0}" of metadata "{1}" contains an item list expression. Item list expressions are not allowed on default metadata values. - MSB4164: "{1}" meta verisinin "{0}" değeri bir öğe listesi ifadesi içeriyor. Varsayılan meta veri değerlerinde öğe listesi ifadelerine izin verilmez. - {StrBegin="MSB4164: "} - - MSB4164: Der Wert "{0}" der {1}-Metadaten enthält einen Elementlistenausdruck. Elementlistenausdrücke sind nicht als Standardwerte für Metadaten zulässig. - - fuzzyMatch="100" wordcount="22" adjWordcount="5.5" curWordcount="5.5" tmLabel="N''" - - - MSBuild is expecting a valid "{0}" object. - MSBuild, geçerli bir "{0}" nesnesi bekliyor. - - - MSBuild erwartet ein gültiges {0}-Objekt. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4035: The required attribute "{0}" is missing from element <{1}>. - MSB4035: Gerekli "{0}" özniteliği <{1}> öğesinde yok. - {StrBegin="MSB4035: "}UE: This message is shown when a user leaves off a required attribute from a project element - e.g. <UsingTask AssemblyName="foo"> -- this is missing the "TaskName" attribute. - - MSB4035: Das erforderliche Attribut "{0}"-Element fehlt <{1}>. - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB4036: The "{0}" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "{1}" directory. - MSB4036: "{0}" görevi bulunamadı. Şunları denetleyin: 1.) Proje dosyasındaki görevin adı ile görev sınıfının adı aynı. 2.) Görev sınıfı "public" olarak tanımlanmış ve Microsoft.Build.Framework.ITask arabirimini uyguluyor. 3.) Görev, proje dosyasında veya "{1}" dizinindeki *.tasks dosyalarında <UsingTask> ile doğru biçimde bildirilmiş. - {StrBegin="MSB4036: "}LOCALIZATION: <UsingTask> and "*.tasks" should not be localized. - - MSB4036: Die "{0}" Task wurde nicht gefunden. Überprüfen Sie Folgendes: 1.) der Name der Aufgabe in der Projektdatei entspricht dem Namen der Aufgabenklasse. 2) die Aufgabenklasse ist "public" und implementiert die Microsoft.Build.Framework.ITask-Schnittstelle. 3) die Aufgabe korrekt mit < UsingTask > deklariert, in der Projektdatei oder in den Tasks-Dateien der "{1}" Verzeichnis. - - fuzzyMatch="15" wordcount="64" adjWordcount="54.4" curWordcount="54.4" - - - MSB4141: MSBuildToolsPath is not specified for the ToolsVersion "{0}" defined at "{1}", or the value specified evaluates to the empty string. - MSB4141: "{1}" konumunda tanımlanan ToolsVersion "{0}" için MSBuildToolsPath belirtilmedi veya belirtilen değer boş dize olarak değerlendiriliyor. - {StrBegin="MSB4141: "} - - MSB4141: MSBuildToolsPath ist für die bei "{1}" definierte ToolsVersion {0} nicht angegeben, oder der angegebene Wert wird zu einer leeren Zeichenfolge ausgewertet. - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - MSB4031: The "MSBuildVersion" attribute is deprecated. If the project is authored in the MSBuild 2003 format, please remove the attribute from the <Project> tag. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format. - MSB4031: "MSBuildVersion" özniteliği uygun bulunmadı. Proje, MSBuild 2003 biçiminde yazılmışsa, lütfen <Project> etiketinden özniteliği kaldırın. Proje eski 1.0 veya 1.2 biçiminde yazılmışsa, lütfen MSBuild 2003 biçimine dönüştürün. - {StrBegin="MSB4031: "}UE: This message is shown for projects that still contain the "MSBuildVersion" attribute in their <Project> - tag. We no longer need this attribute because the project's XML namespace (i.e. the "xmlns" attribute) gives us all the - version information we need. - LOCALIZATION: "MSBuild", "MSBuildVersion" and <Project> should not be localized. - - MSB4031: Das Attribut "MSBuildVersion" ist veraltet. Wenn das Projekt im Format MSBuild 2003 erstellt wurde, entfernen Sie das Attribut aus dem Tag < Project >. Wenn das Projekt im alten Format 1.0 oder 1.2 erstellt wurde, konvertieren Sie es in das MSBuild 2003-Format. - - fuzzyMatch="15" wordcount="45" adjWordcount="38.25" curWordcount="38.25" - - - MSB4144: Multiple definitions were found for the toolset "{0}". - MSB4144: "{0}" araç kümesi için birden çok tanım bulundu. - {StrBegin="MSB4144: "} - - MSB4144: Für das Toolset wurden mehrere Definitionen gefunden "{0}". - - fuzzyMatch="15" wordcount="9" adjWordcount="7.65" curWordcount="7.65" - - - MSB4145: Multiple definitions were found for the property "{0}". - MSB4145: "{0}" özelliği için birden çok tanım bulundu. - {StrBegin="MSB4145: "} - - MSB4145: Für die {0}-Eigenschaft wurden mehrere Definitionen gefunden. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4082: Choose has more than one <Otherwise> element. - MSB4082: Choose, birden fazla <Otherwise> öğesi içeriyor. - {StrBegin="MSB4082: "} - - MSB4082: Wählen Sie mehrere < Otherwise >-Element enthält. - - fuzzyMatch="15" wordcount="9" adjWordcount="7.65" curWordcount="7.65" - - - This method is only valid for persisted <{0}> elements. - Bu yöntem yalnızca <{0}> öğeleri için geçerlidir. - - - Diese Methode ist nur gültig für beibehalten <{0}> Elemente. - - fuzzyMatch="15" wordcount="10" adjWordcount="8.5" curWordcount="8.5" - - - This method is only valid for virtual property groups, not <{0}> elements. - Bu yöntem <{0}> öğeleri için değil, yalnızca sanal özellik grupları için geçerlidir. - - - Diese Methode gilt nur für virtuelle Eigenschaftengruppen nicht <{0}> Elemente. - - fuzzyMatch="15" wordcount="13" adjWordcount="11.05" curWordcount="11.05" - - - MSB4038: The element <{0}> must be last under element <{1}>. Found element <{2}> instead. - MSB4038: <{0}> öğesi, <{1}> öğesinin altındaki son öğe olmalıdır. Bunun yerine <{2}> öğesi bulundu. - {StrBegin="MSB4038: "} - - MSB4038: Das Element <{0}> muss unter Element <{1}>. Element wurde gefunden <{2}> statt. - - fuzzyMatch="15" wordcount="17" adjWordcount="14.45" curWordcount="14.45" - - - MSB4138: Non-string data was specified at the registry location "{0}". - MSB4138: "{0}" kayıt defteri konumunda dize olmayan veriler belirtildi. - {StrBegin="MSB4138: "} - - MSB4138: Am Registrierungsspeicherort "{0}" wurden Daten angegeben, die keine Zeichenfolge sind. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4039: No "{0}" element was found in the project file. - MSB4039: Proje dosyasında "{0}" öğesi bulunamadı. - {StrBegin="MSB4039: "} - - MSB4039: Das {0}-Element wurde in der Projektdatei nicht gefunden. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4040: There is no target in the project. - MSB4040: Projede hedef yok. - {StrBegin="MSB4040: "} - - MSB4040: Das Projekt enthält kein Ziel. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Removing the "{0}" attribute of an item is not allowed. - Bir öğenin "{0}" özniteliğini kaldırmaya izin verilmiyor. - - - Das Löschen des {0}-Attributs eines Elements ist nicht zulässig. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - The object passed in is not part of the project. - Geçirilen nesne, projenin parçası değil. - - - Das übergebene Objekt ist nicht Teil des Projekts. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - Overriding target "{0}" in project "{1}" with target "{2}" from project "{3}". - "{3}" projesindeki "{2}" hedefi kullanılarak "{1}" projesindeki "{0}" hedefinin üzerine yazılıyor. - - - Das Ziel "{0}" im Projekt "{1}" wird durch das Ziel "{2}" aus dem Projekt "{3}" außer Kraft gesetzt. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4167: The parent process unexpectedly exited. Shutting down child node "{0}". - MSB4167: Üst işlem beklenmeyen şekilde çıktı. "{0}"alt düğümü kapatılıyor. - {StrBegin="MSB4167: "} - - MSB4167: Der übergeordnete Prozess wurde unerwartet beendet. Der untergeordnete Knoten "{0}" wird heruntergefahren. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - {0} ms {1} {2} calls - {0} ms {1} {2} çağrı - - - {0} ms {1} {2} Aufrufe - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - (* = timing was not recorded because of reentrancy) - (* = yeniden giriş nedeniyle zamanlama kaydedilmedi) - - - (* = Zeit wurde aufgrund des erneuten Eintretens nicht aufgezeichnet) - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - This project object has been unloaded from the MSBuild engine and is no longer valid. - Bu proje nesnesi MSBuild altyapısından kaldırıldı, artık geçerli değil. - - - Dieses Projektobjekt wurde aus dem MSBuild-Modul entladen und ist nicht mehr gültig. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - The project file "{0}" was not found. - "{0}" proje dosyası bulunamadı. - UE: This message is shown when the user calls into the OM to build a project that doesn't exist on disk. - - Die Projektdatei "{0}" wurde nicht gefunden. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Done building project "{0}" -- FAILED. - "{0}" projesini oluşturma tamamlandı -- BAŞARISIZ OLDU. - - - Die Erstellung des Projekts "{0}" ist abgeschlossen – FEHLER. - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Done building project "{0}". - "{0}" projesini oluşturma tamamlandı. - - - Die Erstellung des Projekts "{0}" ist abgeschlossen. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - MSB4041: The default XML namespace of the project must be the MSBuild XML namespace. If the project is authored in the MSBuild 2003 format, please add xmlns="{0}" to the <Project> element. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format. - MSB4041: Projenin varsayılan XML ad alanı, MSBuild XML ad alanı olmalıdır. Proje MSBuild 2003 biçiminde yazılmışsa, lütfen <Project> öğesine xmlns="{0}" ifadesini ekleyin. Proje eski 1.0 veya 1.2 biçiminde yazılmışsa, lütfen MSBuild 2003 biçimine dönüştürün. - {StrBegin="MSB4041: "}UE: This is a Beta 1 message only. - LOCALIZATION: <Project>, "MSBuild" and "xmlns" should not be localized. - - MSB4041: Der XML-Standardnamespace des Projekts muss MSBuild XML-Namespace. Wenn das Projekt im Format MSBuild 2003 erstellt wurde, fügen Sie Xmlns = "{0}" < Project >-Element. Wenn das Projekt im alten Format 1.0 oder 1.2 erstellt wurde, konvertieren Sie es in das MSBuild 2003-Format. - - fuzzyMatch="15" wordcount="52" adjWordcount="44.2" curWordcount="44.2" - - - Project Performance Summary: - Proje Performansı Özeti: - - - Leistungszusammenfassung für das Projekt: - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - MSB4042: Stopping because of syntax errors in project file. - MSB4042: Proje dosyasındaki sözdizimi hataları nedeniyle durduruluyor. - {StrBegin="MSB4042: "} - - MSB4042: Prozess aufgrund von Syntaxfehlern in der Projektdatei angehalten. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - Project "{0}" is building "{1}" ({2} target(s)): - "{0}" projesi, "{1}" oluşturuyor ({2} hedef): - - - Das Projekt {0} erstellt {1} ({2} Ziel(e)): - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Project "{0}" is building "{1}" (default targets): - "{0}" projesi, "{1}" oluşturuyor (varsayılan hedefler): - - - Das Projekt "{0}" erstellt "{1}" (Standardziele): - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Project "{0}" ({1} target(s)): - "{0}" projesi ({1} hedef): - - - Projekt "{0}", {1} Ziel(e): - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - Project "{0}" (default targets): - "{0}" projesi (varsayılan hedefler): - - - Projekt "{0}" (Standardziele): - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - Done Building Project "{0}" ({1} target(s)). - "{0}" Projesini Oluşturma İşlemi Tamamlandı ({1} hedef). - - - Die Erstellung von Projekt "{0}" ist abgeschlossen ({1} Ziel(e)). - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Done Building Project "{0}" (default targets). - "{0}" Projesini Oluşturma İşlemi Tamamlandı (varsayılan hedefler). - - - Die Erstellung von Projekt "{0}" ist abgeschlossen (Standardziele). - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Done Building Project "{0}" ({1} target(s)) -- FAILED. - "{0}" Projesini Oluşturma İşlemi Tamamlandı ({1} hedef) -- BAŞARISIZ OLDU. - - - Die Erstellung des Projekts "{0}" ist abgeschlossen, {1} Ziel(e) -- FEHLER. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Done Building Project "{0}" (default targets) -- FAILED. - "{0}" Projesini Oluşturma İşlemi Tamamlandı (varsayılan hedefler) -- BAŞARISIZ OLDU. - - - Die Erstellung von Projekt "{0}" ist abgeschlossen (Standardziele) -- FEHLER. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4075: The project file must be opened in the Visual Studio IDE and converted to the latest version before it can be built by MSBuild. - MSB4075: Proje dosyası Visual Studio IDE'de açılmalıdır ve MSBuild tarafından oluşturulabilmesi için önce en son sürüme dönüştürülmelidir. - {StrBegin="MSB4075: "} - - MSB4075: Die Projektdatei muss in der Visual Studio IDE geöffnet und in ein aktuelles Versionsformat gebracht werden, bevor sie mit MSBuild erstellt werden kann. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4192: The project file "{0}" is in the ".vcproj" file format, which MSBuild no longer supports. Please convert the project by opening it in the Visual Studio IDE or running the conversion tool, or use MSBuild 3.5 or earlier to build it. - MSB4192: "{0}" proje dosyası MSBuild’in artık desteklemediği ".vcproj" dosya biçiminde. Lütfen projeyi Visual Studio IDE içinde açarak veya dönüştürme aracını kullanarak dönüştürün ya da derlemek için MSBuild 3.5 veya daha eski bir sürümü kullanın. - {StrBegin="MSB4192: "} LOC: ".vcproj" should not be localized - - MSB4192: Die Projektdatei "{0}" ist im VSPROJ-Dateiformat gespeichert, das nicht mehr von MSBuild unterstützt wird. Konvertieren Sie das Projekt, indem Sie es in der Visual Studio IDE öffnen oder das Konvertierungstool ausführen, oder verwenden Sie MSBuild 3.5 oder früher zum Erstellen des Projekts. - - fuzzyMatch="101" wordcount="42" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - The specified property does not belong to the current property group. - Belirtilen özellik geçerli özellik grubuna ait değil. - - - Die angegebene Eigenschaft gehört nicht zu der aktuellen Eigenschaftengruppe. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - Initial Properties: - İlk Öğeler: - - - Ursprüngliche Eigenschaften: - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4148: The name of a property stored under the registry key "{0}" has zero length. - MSB4148: "{0}" kayıt defteri anahtarının altında depolanan bir özelliğin adının uzunluğu sıfır. - {StrBegin="MSB4148: "} - - MSB4148: Der Name einer unter dem Registrierungsschlüssel "{0}" gespeicherten Eigenschaft hat eine Länge von Null. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - The property names in the indexer and the "{0}" object do not match. - Dizin oluşturucudaki özellik adları ve "{0}" nesnesi eşleşmiyor. - - - Die Eigenschaftennamen im Indexer und das {0}-Objekt stimmen nicht überein. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4043: The item metadata reference "{0}" is invalid because it is qualified with an item name. Item metadata referenced in transforms do not need to be qualified, because the item name is automatically deduced from the items being transformed. Change "{0}" to "%({1})". - MSB4043: Öğe meta veri başvurusu "{0}" bir öğe adıyla nitelendiğinden geçersiz. Öğe adı, dönüştürülmekte olan öğelerden otomatik olarak çıkarıldığı için dönüşümlerde başvurulan öğe meta verisinin nitelenmesi gerekmez. "{0}" değerini "%({1})" ile değiştirin. - {StrBegin="MSB4043: "}UE: This message is shown when the user does something like this: @(foo->'%(foo.metadata)'). There is no need to specify - "foo.metadata", because "foo" is automatically deduced. In corollary, "bar.metadata" is not allowed either, where "bar" is a different - item list type. - - MSB4043: Der Elementmetadatenverweis "{0}" ist ungültig, da er mit einem Elementnamen qualifiziert ist. Elementmetadaten, auf die bei Transformationen verwiesen wird, müssen nicht qualifiziert werden, da der Elementname automatisch aus den transformierten Elementen abgeleitet wird. Ändern Sie "{0}" in "%({1})". - - fuzzyMatch="101" wordcount="43" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4135: Error reading the toolset information from the registry location "{0}". {1} - MSB4135: "{0}" kayıt defteri konumundan araç kümesi bilgilerini okuma hatası. {1} - {StrBegin="MSB4135: "} - - MSB4135: Fehler beim Lesen der Toolsetinformationen am Registrierungsspeicherort "{0}". {1} - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4044: The "{0}" task was not given a value for the required parameter "{1}". - MSB4044: "{0}" görevine gerekli "{1}" parametresi için bir değer verilmedi. - {StrBegin="MSB4044: "}UE: This message is shown when a task parameter designated as "required" is not set in the project file. - - MSB4044: Die {0}-Aufgabe hat keinen Wert für den erforderlichen {1}-Parameter erhalten. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - Validating project using schema file "{0}". - "{0}" şema dosyası kullanılarak proje doğrulanıyor. - LOCALIZATION: "{0}" is the location of the schema file. - - Das Projekt wird anhand der Schemadatei "{0}" überprüft. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4045: Project is not valid. {0} - MSB4045: Proje geçerli değil. {0} - {StrBegin="MSB4045: "}UE: This error is shown when the user asks his project to be validated against a schema (/val switch for - MSBuild.exe), and the project has errors. "{0}" contains a message explaining the problem. - LOCALIZATION: "{0}" is a message from the System.XML schema validator and is already localized. - - MSB4045: Ungültiges Projekt. {0} - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4112: The targets in this project have been disabled by the host and therefore cannot be built at this time. This may have been done for security reasons. To enable the targets, the host must set Project.BuildEnabled to "true". - MSB4112: Bu projedeki hedefler konak tarafından devre dışı bırakıldı ve bu nedenle şu anda derlenemiyor. Bu işlem güvenlik nedeniyle yapılmış olabilir. Hedefleri etkinleştirmek için konakta Project.BuildEnabled değerinin "true" olarak ayarlanması gerekir. - {StrBegin="MSB4112: "} - - MSB4112: Die Ziele in diesem Projekt wurden vom Host deaktiviert und können aus diesem Grund derzeit nicht erstellt werden. Die Deaktivierung wurde wahrscheinlich aus Sicherheitsgründen durchgeführt. Wenn Sie die Ziele aktivieren möchten, muss der Host Project.BuildEnabled auf "true" festlegen. - - fuzzyMatch="101" wordcount="39" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4093: The "{0}" parameter of the "{1}" task cannot be written to because it does not have a "set" accessor. - MSB4093: "{1}" görevinin "{0}" parametresine, "set" erişimcisi bulunmadığından yazılamadı. - {StrBegin="MSB4093: "}UE: This error is shown when a project tries to assign a value to a task parameter that does not have a "set" - accessor on the corresponding .NET property on the task class. - - MSB4093: In den {0}-Parameter der {1}-Aufgabe kann nicht geschrieben werden, da er keinen set-Accessor besitzt. - - fuzzyMatch="100" wordcount="20" adjWordcount="5" curWordcount="5" tmLabel="N''" - - - A shallow clone of this object cannot be created. - Bu nesnenin basit kopyası oluşturulamıyor. - - - Ein unechter Klon dieses Objekts kann nicht erstellt werden. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - Skipping target "{0}" because it has no inputs. - Giriş içermediğinden "{0}" hedefi atlanıyor. - - - Das {0}-Ziel wird übersprungen, da es keine Eingaben besitzt. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Though the target has declared its inputs, the input specification only references empty properties and/or empty item lists. - Hedef, girişlerini belirtmiş olsa da, giriş belirtimi yalnızca boş özelliklere ve/veya boş öğe listelerine başvuruyor. - - - Obwohl das Ziel seine Eingaben deklariert hat, verweist die Eingabespezifikation nur auf leere Eigenschaften und/oder leere Elementlisten. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - Skipping target "{0}" because it has no outputs. - Çıkış içermediğinden "{0}" hedefi atlanıyor. - - - Das Ziel "{0}" wird übersprungen, da es keine Ausgaben enthält. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Though the target has declared its outputs, the output specification only references empty properties and/or empty item lists. - Hedef, çıkışlarını belirtmiş olsa da, çıkış belirtimi yalnızca boş özelliklere ve/veya boş öğe listelerine başvuruyor. - - - Obwohl das Ziel seine Ausgaben deklariert hat, verweist die Ausgabespezifikation nur auf leere Eigenschaften und/oder leere Elementlisten. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - Skipping target "{0}" because all output files are up-to-date with respect to the input files. - Tüm çıkış dosyaları, giriş dosyalarına göre güncel durumda olduğundan "{0}" hedefi atlanıyor. - - - Das Ziel "{0}" wird übersprungen, da alle Ausgabedateien hinsichtlich der Eingabedateien aktuell sind. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - Input files: {0} - Giriş dosyaları: {0} - {0} is a semicolon-separated list of filenames. - - Eingabedateien: {0} - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Output files: {0} - Çıkış dosyaları: {0} - {0} is a semicolon-separated list of filenames. - - Ausgabedateien: {0} - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Building solution configuration "{0}". - "{0}" çözüm yapılandırması oluşturuluyor. - UE: This is not an error, so doesn't need an error code. - - Die Projektmappenkonfiguration "{0}" wird erstellt. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - Using solution cache file "{0}" for configuration "{1}" and tools version "{2}". - "{1}" yapılandırması ve "{2}" araç sürümü için "{0}" çözüm önbelleği dosyası kullanılıyor. - UE: This is not an error, so doesn't need an error code. - - Die Projektmappen-Cachedatei "{0}" wird für die Konfiguration "{1}" und die Toolsversion "{2}" verwendet. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Failed to read solution cache file "{0}". {1} Using solution file directly. - "{0}" çözüm önbelleği dosyası okunamadı. {1} Çözüm dosyası doğrudan kullanılıyor. - UE: This is not a true error, so doesn't need an error code. - - Fehler beim Lesen der Projektmappen-Cachedatei "{0}". {1} Projektmappendatei wird direkt verwendet. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Failed to write solution cache file "{0}". {1} - "{0}" çözüm önbelleği dosyası yazılamadı. {1} - UE: This is not a true error, so doesn't need an error code. - - Fehler beim Schreiben der Projektmappen-Cachedatei "{0}". {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Solution cache file was created for a "{0}" value of "{1}" but the current value is "{2}". Refreshing cache file. - Değeri "{1}" olan "{0}" için bir çözüm önbelleği dosyası oluşturuldu, ancak geçerli değer "{2}". Önbellek dosyası yenileniyor. - UE: This is not an error, so doesn't need an error code. - - Die Projektmappen-Cachedatei wurde für den {0}-Wert "{1}" erstellt, aber der aktuelle Wert ist "{2}". Cachedatei wird aktualisiert. - - fuzzyMatch="100" wordcount="20" adjWordcount="5" curWordcount="5" tmLabel="N''" - - - Solution cache file has an internal version number "{0}" but the current value is "{1}". Refreshing cache file. - Çözüm önbelleği dosyasının iç sürüm numarası "{0}", ancak şu anki değer "{1}". Önbellek dosyası yenileniyor. - UE: This is not an error, so doesn't need an error code. - - Die Projektmappen-Cachedatei hat die interne Versionsnummer "{0}", der aktuelle Wert ist aber "{1}". Cachedatei wird aktualisiert. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - Solution cache file is out of date. Refreshing cache file. {0} - Çözüm önbelleği dosyası güncel değil. Önbellek dosyası yenileniyor. {0} - UE: This is not an error, so doesn't need an error code. - - Die Projektmappen-Cachedatei ist veraltet. Cachedatei wird aktualisiert. {0} - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4160: A circular dependency involving project "{0}" has been detected. - MSB4160: "{0}" projesini de içeren döngüsel bir bağımlılık algılandı. - {StrBegin="MSB4160: "} - - MSB4160: Eine Ringabhängigkeit im Zusammenhang mit dem Projekt "{0}" wurde erkannt. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4126: The specified solution configuration "{0}" is invalid. Please specify a valid solution configuration using the Configuration and Platform properties (e.g. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU") or leave those properties blank to use the default solution configuration. - MSB4126: Belirtilen "{0}" çözüm yapılandırması geçersiz. Lütfen Configuration ve Platform özelliklerini kullanarak geçerli bir çözüm yapılandırması belirtin (örn: MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU") veya varsayılan çözüm yapılandırmasını kullanmak için bu özellikleri boş bırakın. - {StrBegin="MSB4126: "}UE: The solution filename is provided separately to loggers. - - MSB4126: Die angegebene Projektmappenkonfiguration "{0}" ist ungültig. Geben Sie mithilfe der Konfigurations- und Plattformeigenschaften eine gültige Projektmappenkonfiguration an (z. B. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU"), oder lassen Sie diese Eigenschaften leer, sodass die Standardprojektmappenkonfiguration verwendet wird. - - fuzzyMatch="101" wordcount="37" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4046: Error reading project file "{0}": {1} - MSB4046: "{0}" proje dosyasını okuma hatası: {1} - {StrBegin="MSB4046: "} - - MSB4046: Fehler beim Lesen der Projektdatei "{0}": {1} - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4125: The project file name "{0}" is invalid. {1} - MSB4125: "{0}" proje dosyası adı geçersiz. {1} - {StrBegin="MSB4125: "}UE: The solution filename is provided separately to loggers. - - MSB4125: Der Projektdateiname "{0}" ist ungültig. {1} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4051: Project {0} is referencing a project with GUID {1}, but a project with this GUID was not found in the .SLN file. - MSB4051: {0} projesi GUID {1} ile bir projeye başvuruyor, ancak .SLN dosyasında bu GUID'yi içeren bir proje bulunamadı. - {StrBegin="MSB4051: "}UE: The solution filename is provided separately to loggers. - - MSB4051: Das Projekt "{0}" verweist auf ein Projekt mit der GUID {1}, in der SLN-Datei wurde jedoch kein Projekt mit dieser GUID gefunden. - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - MSB4078: The project file "{0}" is not supported by MSBuild and cannot be built. - MSB4078: "{0}" proje dosyası MSBuild tarafından desteklenmediğinden oluşturulamıyor. - {StrBegin="MSB4078: "} - - MSB4078: Die Projektdatei "{0}" wird nicht von MSBuild unterstützt und kann nicht erstellt werden. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4054: The solution file must be opened in the Visual Studio IDE and converted to the latest version before it can be built by MSBuild. - MSB4054: Çözüm dosyası Visual Studio IDE'de açılmalı ve MSBuild tarafından oluşturulabilmesi için önce en son sürüme dönüştürülmelidir. - {StrBegin="MSB4054: "}UE: The solution filename is provided separately to loggers. - - MSB4054: Die Projektmappendatei muss in der Visual Studio IDE geöffnet und in die neuste Version konvertiert werden, bevor sie mit MSBuild erstellt werden kann. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4121: The project configuration for project "{0}" was not specified in the solution file for the solution configuration "{1}". - MSB4121: "{0}" projesi için proje yapılandırması, "{1}" çözüm yapılandırmasının çözüm dosyasında belirtilmedi. - {StrBegin="MSB4121: "} - - MSB4121: Die Projektkonfiguration für das Projekt "{0}" wurde nicht in der Projektmappendatei für die Projektmappenkonfiguration "{1}" angegeben. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - The project "{0}" is not selected for building in solution configuration "{1}". - "{0}" projesi, "{1}" çözüm yapılandırmasında oluşturulmak üzere seçilmedi. - - UE: This is not an error, so doesn't need an error code. - - - Das Projekt "{0}" ist in der Projektmappenkonfiguration "{1}" nicht zum Erstellen ausgewählt. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4122: Scanning project dependencies for project "{0}" failed. {1} - MSB4122: "{0}" projesi için proje bağımlılıkları taranamadı. {1} - {StrBegin="MSB4122: "} - - MSB4122: Fehler beim Überprüfen der Projektabhängigkeiten für Projekt "{0}". {1} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4149: The tools version "{0}" of the solution does not support building projects with a different tools version. - MSB4149: Çözümün araçlar sürümü "{0}", projeleri farklı bir araçlar sürümüyle oluşturmayı desteklemiyor. - {StrBegin="MSB4149: "} - - MSB4149: Die Toolsversion {0} der Projektmappe unterstützt das Erstellen von Projekten mit unterschiedlichen Toolsversionen nicht. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - Web projects do not support the "Clean" target. Continuing with remaining projects ... - Web projeleri "Clean" hedefini desteklemez. Kalan projelerle devam ediliyor... - UE: This is not an error, so doesn't need an error code. - LOCALIZATION: Do not localize "Clean". - - Webprojekte unterstützen das Clean-Ziel nicht. Verbleibende Projekte werden fortgesetzt... - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Web projects do not support the "Publish" target. Continuing with remaining projects ... - Web projeleri "Publish" hedefini desteklemez. Kalan projelerle devam ediliyor... - UE: This is not an error, so doesn't need an error code. - LOCALIZATION: Do not localize "Publish". - - Webprojekte unterstützen das Publish-Ziel nicht. Verbleibende Projekte werden fortgesetzt... - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Skipping because the "$(AspNetConfiguration)" configuration is not supported for this web project. You can use the AspNetConfiguration property to override the configuration used for building web projects, by adding /p:AspNetConfiguration=<value> to the command line. Currently web projects only support Debug and Release configurations. - "$(AspNetConfiguration)" yapılandırması bu web projesi için desteklenmediğinden atlanıyor. Web projeleri oluşturmak için kullanılan yapılandırmayı geçersiz kılmak amacıyla, komut satırına /p:AspNetConfiguration=<değer> ekleyerek AspNetConfiguration özelliğini kullanabilirsiniz. Geçerli durumda web projeleri yalnızca Debug ve Release yapılandırmalarını desteklemektedir. - - UE: This is not an error, so doesn't need an error code. - LOCALIZATION: Do NOT localize "AspNetConfiguration", "Debug", "Release". - - - Da der "$(AspNetConfiguration)" Konfiguration für dieses Webprojekt nicht unterstützt. Verwenden die AspNetConfiguration-Eigenschaft die Konfiguration zum Erstellen von Webprojekten hinzufügen/p: AspNetConfiguration überschreiben = < Wert > in der Befehlszeile. Aktuell unterstützen Webprojekte nur Debug- und Releasekonfigurationen. - - fuzzyMatch="15" wordcount="44" adjWordcount="37.4" curWordcount="37.4" - - - MSB4076: VC projects do not support the "Publish" target. - MSB4076: VC projeleri "Publish" hedefini desteklemez. - {StrBegin="MSB4076: "}LOCALIZATION: Do not localize "Publish". - - MSB4076: VC-Projekte unterstützen nicht das Publish-Ziel. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4098: MSBuild is invoking VCBuild to build this project. Project-to-project references between VC++ projects (.VCPROJ) and C#/VB/VJ# projects (.CSPROJ, .VBPROJ, .VJSPROJ) are not supported by the command-line build systems when building stand-alone VC++ projects. Projects that contain such project-to-project references will fail to build. Please build the solution file containing this project instead. - MSB4098: MSBuild, bu projeyi oluşturmak için VCBuild'i çağırıyor. Bağımsız VC++ projeleri oluştururken, VC++ projeleri (.VCPROJ) ve C#/VB/VJ# projeleri (.CSPROJ, .VBPROJ, .VJSPROJ) arasında projeden projeye yapılan başvurular, komut satırı oluşturma sistemleri tarafından desteklenmez. Bu tür projeden projeye yapılan başvurular içeren projeler oluşturulamaz. Lütfen bu projeyi içeren çözüm dosyasını oluşturun. - {StrBegin="MSB4098: "} - - MSB4098: MSBuild ruft zum Erstellen dieses Projekts VCBuild auf. Interprojektverweise zwischen VC++-Projekten (.VCPROJ) und C#-/VB-/VJ#-Projekten (.CSPROJ, .VBPROJ, .VJSPROJ) werden beim Erstellen eigenständiger VC++-Projekte von den Befehlszeilen-Buildsystemen nicht unterstützt. Projekte, die solche Interprojektverweise enthalten, werden nicht erstellt. Erstellen Sie stattdessen die Projektmappendatei, die dieses Projekt enthält. - - fuzzyMatch="101" wordcount="53" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4056: The MSBuild engine must be called on a single-threaded-apartment. Current threading model is "{0}". Proceeding, but some tasks may not function correctly. - MSB4056: MSBuild altyapısı tek iş parçacığı grubunda çağrılmalıdır. "{0}", geçerli iş parçacığı oluşturma modelidir. İşlem devam ediyor, ancak bazı görevler doğru çalışmayabilir. - {StrBegin="MSB4056: "} - - MSB4056: Das MSBuild-Modul muss in einem Singlethread-Apartment aufgerufen werden. Das aktuelle Threadmodell ist {0}. Der Vorgang wird fortgesetzt, aber einige Aufgaben werden möglicherweise nicht ordnungsgemäß ausgeführt. - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - Schema validation - Şema doğrulama - UE: this fragment is used to describe errors that are caused by schema validation. For example, if a normal error is - displayed like this: "MSBUILD : error MSB0000: This is an error.", then an error from schema validation would look like this: - "MSBUILD : Schema validation error MSB0000: This is an error." - LOCALIZATION: This fragment needs to be localized. - - Schemavalidierung - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Target "{0}" skipped. Previously built unsuccessfully. - "{0}" hedefi atlandı. Önceden başarısız bir şekilde derlenmişti. - - - Das Ziel "{0}" wurde übersprungen. Die vorherige Erstellung war nicht erfolgreich. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Target "{0}" skipped. Previously built successfully. - "{0}" hedefi atlandı. Önceden başarılı bir şekilde derlenmişti. - - - Das Ziel "{0}" wurde übersprungen. Die vorherige Erstellung war erfolgreich. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4116: The condition "{1}" on the "{0}" target has a reference to item metadata. References to item metadata are not allowed in target conditions unless they are part of an item transform. - MSB4116: "{0}" hedefi üzerindeki "{1}" koşulu öğe meta verisine başvuruyor. Öğe meta verisine yönelik başvurular öğe dönüştürmenin parçası olmadığı sürece, bu başvurulara hedef koşullarında izin verilmez. - {StrBegin="MSB4116: "} - - MSB4116: Die Bedingung "{1}" des {0}-Ziels enthält einen Verweis auf Elementmetadaten. Verweise auf Elementmetadaten sind in Zielbedingungen nicht zulässig, es sei denn, sie sind Teil einer Elementtransformation. - - fuzzyMatch="101" wordcount="32" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4057: The target "{0}" does not exist in the project. - MSB4057: "{0}" hedefi projede yok. - {StrBegin="MSB4057: "} - - MSB4057: Das Ziel "{0}" ist im Projekt nicht vorhanden. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - Done building target "{0}" in project "{1}" -- FAILED. - "{1}" projesinde "{0}" hedefini oluşturma tamamlandı -- BAŞARISIZ OLDU. - - - Erstellen des {0}-Ziels in Projekt {1} beendet - Fehler beim Erstellen. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Done building target "{0}" in project "{1}". - "{1}" projesinde "{0}" hedefini oluşturma tamamlandı. - - - Die Erstellung des Ziels "{0}" im Projekt "{1}" ist abgeschlossen. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - {0}: (TargetId:{1}) - {0}: (TargetId:{1}) - - - {0}: (Ziel-ID:{1}) - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4058: The "{0}" target is missing its output specification. If a target declares inputs, it must also declare outputs. - MSB4058: "{0}" hedefinin çıktı belirtimi eksik. Bir hedef giriş bildiriyorsa aynı zamanda çıktı bildirmesi gerekir. - {StrBegin="MSB4058: "} - - MSB4058: Das {0}-Ziel enthält keine Ausgabespezifikation. Wenn ein Ziel Eingaben deklariert, muss es auch Ausgaben deklarieren. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4168: The item "{0}" of type "{1}" does not define a value for the metadata in the expression "{2}". This expression is used in the target output for target "{3}". If a target declares outputs that are transforms, all items in the transform must have a value for the metadata in the transform. - MSB4168: "{1}" türündeki "{0}" öğesi, "{2}" ifadesindeki meta veriler için bir değer tanımlamıyor. Bu ifade "{3}" hedefinin hedef çıkışında kullanılıyor. Bir hedef dönüşüm olan çıkışlar bildirirse, dönüşümdeki tüm öğelerin dönüşümdeki meta veriler için bir değere sahip olması gerekir. - {StrBegin="MSB4168: "} - - MSB4168: Das Element "{0}" vom Typ "{1}" definiert keinen Wert für die Metadaten im Ausdruck "{2}". Dieser Ausdruck wird in der Zielausgabe für "{3}" verwendet. Wenn ein Ziel Ausgaben deklariert, bei denen es sich um Transformationen handelt, müssen alle Elemente in der Transformation einen Wert für die in der Transformation enthaltenen Metadaten aufweisen. - - fuzzyMatch="101" wordcount="53" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Target Performance Summary: - Hedef Performans Özeti: - - - Leistungszusammenfassung für das Ziel: - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Target "{0}" skipped, due to false condition; ({1}) was evaluated as ({2}). - Yanlış koşul nedeniyle "{0}" hedefi atlandı; ({1}), ({2}) olarak değerlendirildi. - - - Das Ziel "{0}" wurde übersprungen, da die Bedingung "false" war . ({1}) wurde als ({2}) ausgewertet. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Target "{0}" in project "{1}" - "{1}" projesindeki "{0}" hedefi - - - {0}-Ziel in {1}-Projekt. - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Target {0}: - {0} hedefi: - - - Ziel "{0}": - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Target "{0}" in file "{1}": - "{1}" dosyasındaki "{0}" hedefi: - - - Ziel "{0}" in Datei "{1}": - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Build continuing because "{0}" on the task "{1}" is set to "{2}". - "{1}" görevindeki "{0}" öğesi "{2}" olarak ayarlandığından oluşturma devam ediyor. - - - Der Buildvorgang wird fortgesetzt, da {0} in der {1}-Aufgabe auf "{2}" festgelegt ist. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Target {0} from project "{1}": - "{1}" projesinden {0} hedefi: - - - Ziel "{0}" aus Projekt "{1}": - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Target "{0}" in file "{1}" from project "{2}": - "{2}" projesinin "{1}" dosyasındaki "{0}" hedefi: - - - Ziel "{0}" in Datei "{1}" aus Projekt "{2}": - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4060: The "{0}" task has been declared or used incorrectly, or failed during construction. Check the spelling of the task name and the assembly name. - MSB4060: "{0}" görevi hatalı bir biçimde bildirildi veya kullanıldı ya da oluşturma sırasında başarısız oldu. Görev adının ve bütünleştirilmiş kod adının doğru yazıldığından emin olun. - {StrBegin="MSB4060: "} - - MSB4060: Die {0}-Aufgabe wurde falsch deklariert, falsch verwendet oder konnte bei der Erstellung nicht ausgeführt werden. Überprüfen Sie die Schreibweise des Aufgaben- und des Assemblynamens. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4077: The "{0}" task has been marked with the attribute LoadInSeparateAppDomain, but does not derive from MarshalByRefObject. Check that the task derives from MarshalByRefObject or AppDomainIsolatedTask. - MSB4077: "{0}" görevi LoadInSeparateAppDomain özniteliğiyle işaretlenmiş, ancak MarshalByRefObject öğesinden türetilmiyor. Görevin MarshalByRefObject veya AppDomainIsolatedTask öğesinden türetildiğini denetleyin. - {StrBegin="MSB4077: "}LOCALIZATION: <LoadInSeparateAppDomain>, <MarshalByRefObject>, <AppDomainIsolatedTask> should not be localized. - - MSB4077: Die Aufgabe "{0}" wurde mit dem LoadInSeparateAppDomain-Attribut markiert, ist jedoch nicht von MarshalByRefObject abgeleitet. Stellen Sie sicher, dass die Aufgabe von MarshalByRefObject oder AppDomainIsolatedTask abgeleitet wird. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Done executing task "{0}" -- FAILED. - "{0}" görevini yürütme tamamlandı -- BAŞARISIZ OLDU. - - - Die Ausführung von Task "{0}" wurde beendet – FEHLER. - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Done executing task "{0}". - "{0}" görevini yürütme tamamlandı. - - - Die Ausführung von Task "{0}" wurde beendet. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - {0} (TaskId:{1}) - {0} (TaskId:{1}) - - - {0} (Aufgaben-ID: {1}) - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Using "{0}" task from assembly "{1}". - "{1}" derlemesindeki "{0}" görevi kullanılıyor. - UE: This informational message helps users determine which assemblies their tasks were loaded from. - - Die {0}-Aufgabe aus der {1}-Assembly wird verwendet. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4061: The "{0}" task could not be instantiated from the assembly "{1}". {2} - MSB4061: "{1}" derlemesindeki "{0}" görevinin örneği oluşturulamadı. {2} - {StrBegin="MSB4061: "}LOCALIZATION: "{2}" is a localized message from a CLR/FX exception. - - MSB4061: Die {0}-Aufgabe konnte nicht aus der {1}-Assembly instanziiert werden. {2} - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4127: The "{0}" task could not be instantiated from the assembly "{1}". Please verify the task assembly has been built using the same version of the Microsoft.Build.Framework assembly as the one installed on your computer and that your host application is not missing a binding redirect for Microsoft.Build.Framework. {2} - MSB4127: "{1}" bütünleştirilmiş kodundan "{0}" görevinin örneği oluşturulamadı. Lütfen görev bütünleştirilmiş kodunun derlenmesinde kullanılan sürümün, Microsoft.Build.Framework bütünleştirilmiş kodunun bilgisayarınızda yüklü olan sürümüyle aynı olduğunu ve konak uygulamanızda Microsoft.Build.Framework için bir bağlama yeniden yönlendirmesinin eksik olmadığını doğrulayın. {2} - {StrBegin="MSB4127: "}UE: This message is a specialized version of the TaskInstantiationFailureError message and can probably reuse some of its docs. - LOCALIZATION: "{2}" is a localized message from a CLR/FX exception. Also, Microsoft.Build.Framework should not be localized - - MSB4127: Die "{0}"-Aufgabe konnte nicht aus der "{1}"-Assembly instanziiert werden. Überprüfen Sie, ob die Aufgabenassembly mit der gleichen Version der Microsoft.Build.Framework-Assembly erstellt wurde, die auf Ihrem Computer installiert ist, und dass Ihrer Hostanwendung kein BindingRedirect-Eintrag für Microsoft.Build.Framework fehlt. {2} - - fuzzyMatch="101" wordcount="49" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4062: The "{0}" task could not be loaded from the assembly {1}. {2} Confirm that the <UsingTask> declaration is correct, and that the assembly and all its dependencies are available. - MSB4062: "{0}" görevi {1} derlemesinden yüklenemedi. {2} <UsingTask> bildiriminin doğru olduğunu ve derlemenin ve tüm bağımlılıklarının kullanılabilir olduğunu doğrulayın. - {StrBegin="MSB4062: "}UE: This message is shown when a task cannot be loaded from its assembly for various reasons e.g. corrupt assembly, - invalid task declaration, disk error, etc. "{2}" contains a message explaining what happened. - LOCALIZATION: "{2}" is a message from the CLR loader and is already localized. Also, <UsingTask> should not be localized. - - MSB4062: Die "{0}" Vorgang konnte nicht aus der Assembly geladen werden {1}. {2} Bestätigen < UsingTask > Erklärung richtig ist und die Assembly und die zugehörigen Dateien verfügbar sind. - - fuzzyMatch="15" wordcount="31" adjWordcount="26.35" curWordcount="26.35" - - - MSB4063: The "{0}" task could not be initialized with its input parameters. {1} - MSB4063: "{0}" görevi giriş parametreleriyle başlatılamadı. {1} - {StrBegin="MSB4063: "} - - MSB4063: Die "{0}"-Aufgabe konnte nicht mit ihren Eingabeparametern initialisiert werden. {1} - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - Task Performance Summary: - Görev Performansı Özeti: - - - Leistungszusammenfassung für die Aufgabe: - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Task "{0}" skipped, due to false condition; ({1}) was evaluated as ({2}). - Yanlış koşul nedeniyle "{0}" görevi atlandı; ({1}), ({2}) olarak değerlendirildi. - - - Die {0}-Aufgabe wurde übersprungen, da die Bedingung "false" war . ({1}) wurde als ({2}) ausgewertet. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Task "{0}" - "{0}" görevi - - - Task "{0}" - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Time Elapsed {0} - Geçen Süre {0} - - - Verstrichene Zeit {0} - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Building with tools version "{0}". - Araçlar sürümü "{0}" ile oluşturuluyor. - - - Erstellung mit der Toolsversion "{0}". - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Project file contains ToolsVersion="{0}". This toolset is unknown or missing. You may be able to resolve this by installing the appropriate .NET Framework for this toolset. Treating the project as if it had ToolsVersion="4.0". - Proje dosyası ToolsVersion="{0}" içeriyor. Bu araç kümesi bilinmiyor veya eksik. Bu görev takımı için uygun .NET Framework'ü yükleyerek bunu çözümleyebilirsiniz. Projede ToolsVersion="4.0" varmış gibi kabul edilecek. - - - Die Projektdatei enthält ToolsVersion="{0}". Dieses Toolset ist nicht bekannt oder nicht vorhanden. Sie können das Problem möglicherweise beheben, indem Sie das entsprechende .NET Framework für dieses Toolset installieren. Das Projekt wird behandelt als enthielte es ToolsVersion="4.0". - - fuzzyMatch="101" wordcount="34" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Deferred Messages - Geciktirilen İletiler - - - Zurückgestellte Meldungen - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Some messages did not display because they were not associated with any ProjectStarted events. Use diagnostic verbosity to view these messages. - Bazı iletiler hiçbir ProjectStarted olayıyla ilişkilendirilmediğinden görüntülenmedi. Bu iletileri görmek için tanılama ayrıntı düzeyini kullanın. - - - Einige Meldungen wurden nicht angezeigt, weil sie keinem ProjectStarted-Ereignis zugeordnet sind. Verwenden Sie den Ausführlichkeitsgrad "diagnostic", um diese Meldungen anzuzeigen. - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - MSB4090: Found an unexpected character '{2}' at position {1} in condition "{0}". - MSB4090: "{0}" koşulunda, '{1}' konumunda beklenmeyen {2} karakteri bulundu. - {StrBegin="MSB4090: "} - - MSB4090: Das unerwartete Zeichen {2} wurde an Position {1} in der {0}-Bedingung gefunden. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4091: Found a call to an undefined function "{1}" in condition "{0}". - MSB4091: "{0}" koşulunda tanımlanmamış "{1}" işlevine yönelik çağrı bulundu. - {StrBegin="MSB4091: "} - - MSB4091: Aufruf zu einer undefinierten Funktion "{1}" in Bedingung "{0}" gefunden. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4064: The "{0}" parameter is not supported by the "{1}" task. Verify the parameter exists on the task, and it is a settable public instance property. - MSB4064: "{0}" parametresi "{1}" görevi tarafından desteklenmiyor. Parametrenin görevde bulunduğunu ve ayarlanabilir bir genel örnek özelliği olduğunu doğrulayın. - {StrBegin="MSB4064: "} - - MSB4064: Der {0}-Parameter wird von der {1}-Aufgabe nicht unterstützt. Vergewissern Sie sich, dass der Parameter in der Aufgabe vorhanden ist und es sich um eine festlegbare öffentliche Instanzeigenschaft handelt. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4131: The "{0}" parameter is not supported by the "{1}" task. Verify the parameter exists on the task, and it is a gettable public instance property. - MSB4131: "{0}" parametresi "{1}" görevi tarafından desteklenmiyor. Parametrenin görevde bulunduğunu ve alınabilir bir genel örnek özelliği olduğunu doğrulayın. - {StrBegin="MSB4131: "} - - MSB4131: Der {0}-Parameter wird von der {1}-Aufgabe nicht unterstützt. Vergewissern Sie sich, dass der Parameter in der Aufgabe vorhanden ist und es sich um eine abrufbare öffentliche Instanzeigenschaft handelt. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4092: An unexpected token "{1}" was found at character position {2} in condition "{0}". - MSB4092: "{0}" koşulunda, {2} karakter konumunda beklenmeyen "{1}" belirteci bulundu. - {StrBegin="MSB4092: "} - - MSB4092: Ein unerwartetes Token "{1}" wurde an Zeichenposition "{2}" in Bedingung "{0}" gefunden. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4065: The "{0}" parameter is not marked for output by the "{1}" task. - MSB4065: "{0}" parametresi, "{1}" görevi tarafından çıkış için işaretlenmedi. - {StrBegin="MSB4065: "} - - MSB4065: Der {0}-Parameter ist nicht für die Ausgabe durch die {1}-Aufgabe markiert. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4066: The attribute "{0}" in element <{1}> is unrecognized. - MSB4066: <{1}> öğesindeki "{0}" özniteliği tanınmıyor. - {StrBegin="MSB4066: "} - - MSB4066: Das Attribut "{0}" im Element <{1}> wurde nicht erkannt. - - fuzzyMatch="15" wordcount="10" adjWordcount="8.5" curWordcount="8.5" - - - MSB4067: The element <{0}> beneath element <{1}> is unrecognized. - MSB4067: <{1}> öğesinin altındaki <{0}> öğesi tanınmıyor. - {StrBegin="MSB4067: "} - - MSB4067: Das Element <{0}> unter Element <{1}> wurde nicht erkannt. - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB4068: The element <{0}> is unrecognized, or not supported in this context. - MSB4068: <{0}> öğesi tanınmıyor veya bu bağlamda desteklenmiyor. - {StrBegin="MSB4068: "} - - MSB4068: Das Element <{0}> ist unbekannt oder in diesem Kontext nicht unterstützt. - - fuzzyMatch="15" wordcount="13" adjWordcount="11.05" curWordcount="11.05" - - - MSB4132: The tools version "{0}" is unrecognized. - MSB4132: Araçlar sürümü "{0}" tanınmıyor. - {StrBegin="MSB4132: "} - - MSB4132: Die Toolsversion "{0}" ist unbekannt. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4069: The "{0}" type of the "{1}" parameter of the "{2}" task is not supported by MSBuild. - MSB4069: "{2}" görevindeki "{1}" parametresinin "{0}" türü, MSBuild tarafından desteklenmiyor. - {StrBegin="MSB4069: "}LOCALIZATION: "MSBuild" should not be localized. - - MSB4069: Der {0}-Typ des {1}-Parameters der {2}-Aufgabe wird von MSBuild nicht unterstützt. - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - MSB4072: A <{0}> element must contain either the "{1}" attribute or the "{2}" attribute (but not both). - MSB4072: <{0}> öğesi ya "{1}" ya da "{2}" özniteliğini içermelidir (ancak her ikisini de değil). - {StrBegin="MSB4072: "} - - MSB4072: Ein <{0}>-Element muss entweder die "{1}" Attribut oder "{2}" Attribut (jedoch nicht beide). - - fuzzyMatch="15" wordcount="18" adjWordcount="15.3" curWordcount="15.3" - - - {0} Warning(s) - {0} Uyarı - - - {0} Warnung(en) - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4084: A <When> element may not follow an <Otherwise> element in a <Choose>. - MSB4084: <Choose> öğesinde <When> öğesinin ardından <Otherwise> gelemez. - {StrBegin="MSB4084: "} - - MSB4084: A < >-Element kein Element < Otherwise > < auswählen > folgen. - - fuzzyMatch="15" wordcount="16" adjWordcount="13.6" curWordcount="13.6" - - - Target Name: "{0}" Project Name: "{1}" - Hedef Adı: "{0}" Proje Adı: "{1}" - - - Zielname: "{0}" Projektname: "{1}" - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Cycle trace: - Döngü izi: - - - Schleifenablaufverfolgung: - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4150: Must initialize the console logger using the initialize method before using ApplyParameter - MSB4150: ApplyParameter kullanılmadan önce başlatma yöntemi kullanılarak konsol günlükçüsü başlatılmalıdır - {StrBegin="MSB4150: "} - - MSB4150: Die Konsolenprotokollierung muss vor der Verwendung von ApplyParameter mithilfe der Initialisierungsmethode initialisiert werden. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4151: An error occurred while building project "{0}", target "{1}". Please see innerException for detailed information. - MSB4151: "{1}" hedefinde "{0}" projesi oluşturulurken hata oluştu. Ayrıntılı bilgiler için lütfen innerException öğesine bakın. - {StrBegin="MSB4151: "} - - MSB4151: Fehler beim Erstellen von Projekt "{0}", Ziel "{1}". Ausführliche Informationen finden Sie in der innerException. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB4152: An error occurred on the child node "{0}" and could not be passed to the parent node. {1} - MSB4152: "{0}" alt düğümünde bir hata oluştu ve üst düğüme geçirilemedi. {1} - {StrBegin="MSB4152: "} - - MSB4152: Fehler im untergeordneten Knoten "{0}", der nicht an den übergeordneten Knoten übergeben werden konnte. {1} - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4153: A call is made on an inactive IBuildEngine interface corresponding to a task that already finished execution. - MSB4153: Yürütülmesi zaten bitmiş bir göreve karşılık gelen etkinlik dışı IBuildEngine arabiriminde bir çağrı yapıldı. - {StrBegin="MSB4153: "} - - MSB4153: Eine inaktive IBuildEngine-Schnittstelle wird aufgerufen, der eine Aufgabe entspricht, deren Ausführung bereits abgeschlossen wurde. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - MSB4154: A forwarding logger is attempting to forward BuildFinished event - MSB4154: İletme günlükçüsü BuildFinished olayını iletmeye çalışıyor - {StrBegin="MSB4154: "} - - MSB4154: Eine weiterleitende Protokollierung versucht, das BuildFinished-Ereignis weiterzuleiten. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4155: There was an error while communicating with a node. - MSB4155: Düğümle iletişim kurulurken hata oluştu. - {StrBegin="MSB4155: "} - - MSB4155: Fehler bei der Kommunikation mit einem Knoten. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB1021: Cannot create an instance of the logger - {0}. - MSB1021: Günlükçünün örneği oluşturulamıyor - {0}. - {StrBegin="MSB1021: "}The error code for this message is duplicated from MSBuild.exe. - - MSB1021: Eine Instanz der Protokollierung kann nicht erstellt werden - {0}. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB1020: The logger {0} was not found. Check the following: 1.) The logger name specified is the same as the name of the logger class. 2.) The logger class is "public" and implements the Microsoft.Build.Framework.ILogger interface. 3.) The path to the logger assembly is correct, or the logger can be loaded using only the assembly name provided. - MSB1020: {0} günlükçüsü bulunamadı. Şunları denetleyin: 1.) Belirtilen günlükçü adı günlükçü sınıfındakiyle aynı. 2.) Günlükçü sınıfı "public" ve Microsoft.Build.Framework.ILogger arabirimini uyguluyor. 3.) Günlükçü derlemesi yolu doğru veya günlükçü yalnızca sağlanan derleme adıyla yüklenebiliyor. - {StrBegin="MSB1020: "}The error code for this message is duplicated from MSBuild.exe. - - MSB1020: Die Protokollierung {0} wurde nicht gefunden. Überprüfen Sie Folgendes: 1.) Der angegebene Name der Protokollierung ist mit dem Namen der Protokollierungsklasse identisch. 2.) Die Protokollierungsklasse ist "public" und implementiert die Microsoft.Build.Framework.ILogger-Schnittstelle. 3.) Der Pfad zur Protokollierungsassembly ist richtig, bzw. die Protokollierung kann alleine mithilfe des angegebenen Assemblynamens geladen werden. - - fuzzyMatch="101" wordcount="57" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4156: A forwarding logger is attempting to forward BuildStarted event - MSB4156: İletme günlükçüsü BuildStarted olayını iletmeye çalışıyor - {StrBegin="MSB4156: "} - - MSB4156: Eine weiterleitende Protokollierung versucht, das BuildStarted-Ereignis weiterzuleiten. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - "{0}" ({1} target) ({2}) -> - "{0}" ({1} hedefi) ({2}) -> - - - "{0}" ({1} target) ({2}) -> - - fuzzyMatch="15" wordcount="5" adjWordcount="4.25" curWordcount="4.25" - - - "{0}" (default target) ({1}) -> - "{0}" (varsayılan hedef) ({1}) -> - - - "{0}" (Standardziel) ({1}) -> - - fuzzyMatch="15" wordcount="5" adjWordcount="4.25" curWordcount="4.25" - - - {0} {1,5} - {0} {1,5} - - - {0} {1,5} - - fuzzyMatch="15" wordcount="2" adjWordcount="1.7" curWordcount="1.7" - - - Project "{0}" on node {1} ({2} target(s)). - {1} düğümünde "{0}" projesi ({2} hedef). - - - Projekt "{0}" auf Knoten "{1}", {2} Ziel(e). - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Project "{0}" on node {1} (default targets). - {1} düğümünde "{0}" projesi (varsayılan hedefler). - - - Projekt "{0}" auf Knoten "{1}" (Standardziele). - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Project "{0}" ({1}) is building "{2}" ({3}) on node {4} ({5} target(s)). - "{0}" projesi ({1}) {4} düğümünde "{2}" ({3}) oluşturuyor ({5} hedef). - - - Das Projekt "{0}" ({1}) erstellt "{2}" ({3}) auf Knoten "{4}", {5} Ziel(e). - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Project "{0}" ({1}) is building "{2}" ({3}) on node {4} (default targets). - "{0}" projesi ({1}) {4} düğümünde "{2}" ({3}) oluşturuyor (varsayılan hedefler). - - - Das Projekt "{0}" ({1}) erstellt "{2}" ({3}) auf Knoten "{4}" (Standardziele). - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - ({0} target) -> - ({0} hedefi) -> - - - ({0} Ziel) -> - - fuzzyMatch="15" wordcount="3" adjWordcount="2.55" curWordcount="2.55" - - - MSB4157: The array of project files needs to contain at least one value. - MSB4157: Proje dosyaları dizisinin en az bir değer içermesi gerekiyor. - {StrBegin="MSB4157: "} - - MSB4157: Das Array der Projektdateien muss mindestens einen Wert enthalten. - - fuzzyMatch="15" wordcount="13" adjWordcount="11.05" curWordcount="11.05" - - - MSB4158: The project file name at element {0} is empty. - MSB4158: {0} öğesindeki proje dosyası adı boş. - {StrBegin="MSB4158: "} - - MSB4158: Der Projektdateiname bei Element {0} ist leer. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - The property "{0}" with value "{1}" is being overridden by another batch. The property is now: "{2}" - Değeri "{1}" olan "{0}" özelliği başka bir toplu işlem tarafından geçersiz kılınıyor. Özelliğin şimdiki değeri: "{2}" - - - Die Eigenschaft "{0}" mit dem Wert "{1}" wird von einem anderen Batch überschrieben. Die Eigenschaft ist jetzt: "{2}" - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - Please see inner exception for error information. - Lütfen hata bilgileri için iç özel duruma bakın. - - - Fehlerinformationen finden Sie in der internen Ausnahme. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Event type "{0}" was expected to be serializable. The event was not serializable and has been ignored. - "{0}" olay türünün seri hale getirilebileceği bekleniyordu. Olay seri hale getirilemedi ve yoksayıldı. - - - Es wurde erwartet, dass der Typ "{0}" serialisierbar ist. Das Ereignis war nicht serialisierbar und wurde ignoriert. - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - The log file path cannot be null or empty. - Günlük dosyası yolu null veya boş olamaz. - - - Der Protokolldateipfad darf nicht NULL oder leer sein. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4161: Project "{0}" was loaded and unloaded during the current build. Reloading a project during the build can result in errors or an inconsistent build state. Either avoid unloading project "{0}" or cache the evaluation results of target(s) "{1}" before unloading the project. - MSB4161: Geçerli oluşturma sırasında "{0}" projesi yüklendi ve kaldırıldı. Oluşturma sırasında bir projenin yeniden yüklenmesi hatalara veya tutarsız bir oluşturma durumuna neden olabilir. "{0}" projesinin kaldırılmasını engelleyin veya projeyi kaldırmadan önce "{1}" hedeflerinin değerlendirme sonuçlarını önbelleğe alın. - {StrBegin="MSB4161: "} - - MSB4161: Das Projekt "{0}" wurde während der aktuellen Erstellung geladen und entladen. Das erneute Laden eines Projekts während der Erstellung kann zu Fehlern oder einem nicht konsistenten Buildzustand führen. Vermeiden Sie entweder das Entladen des Projekts "{0}", oder speichern Sie die Auswertungsergebnisse der Ziele "{1}" vor dem Entladen des Projekts im Cache. - - fuzzyMatch="101" wordcount="43" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - [default] - [varsayılan] - - - [Standard] - - fuzzyMatch="100" wordcount="1" adjWordcount="0.25" curWordcount="0.25" tmLabel="N''" - - -
-
\ No newline at end of file diff --git a/src/Deprecated/Engine/Resources/xlf/Strings.xlf b/src/Deprecated/Engine/Resources/xlf/Strings.xlf deleted file mode 100644 index dec445966a5..00000000000 --- a/src/Deprecated/Engine/Resources/xlf/Strings.xlf +++ /dev/null @@ -1,1820 +0,0 @@ - - - -
- - 4013 - 1176.8 - 1176.8 - 0 - 0 - - - 0 - 981 - 2334 - 0 - 0 - 698 - 0 - -
- - - - MSB4001: The "{0}" task has more than one parameter called "{1}". - {StrBegin="MSB4001: "}UE: This message is shown when a task has more than one .NET property with the same name -- it's unclear which of - those properties the task wants to use as a parameter in project files. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4081: The value "{0}" of the "ItemName" attribute in element <Output> contains an "@" character. If you intended to use an item name then remove the @( ) around the item name. - {StrBegin="MSB4081: "}UE: This message is shown when an output tag has an itemname that contains an @. They probably typed @(foo) instead of foo in the ItemName.LOCALIZATION: Output and ItemName should not be localized. - - fuzzyMatch="15" wordcount="30" adjWordcount="25.5" curWordcount="25.5" - - - MSB4002: There was a failure retrieving the attributes for parameters in the "{0}" task. {1} - {StrBegin="MSB4002: "}UE: This message is shown when the .NET attributes that a task's .NET properties are decorated with, cannot be - retrieved -- this is typically because the .NET classes that define the .NET attributes cannot be loaded because the assembly - they are defined in cannot be found, or the classes themselves cannot be found. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - MSB4003: "{0}" is a reserved attribute of the <{1}> element, and must be spelled with the correct casing. This attribute cannot be used as a parameter to the "{2}" task. - {StrBegin="MSB4003: "}UE: Tasks are not allowed to use incorrect case for reserved attributes on the task nodes e.g. "continueonerror" - instead of the "ContinueOnError". - - fuzzyMatch="15" wordcount="31" adjWordcount="26.35" curWordcount="26.35" - - - The "REQUESTBATCHSIZE" must be a number greater than 1. "{0}" is an invalid value. The value 10 will be used instead. - The name "REQUESTBATCHSIZE" is an environment variable - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - Build completed in {0}. - - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - Build FAILED. - - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Build succeeded. - - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Build started. - - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Build started {0}. - - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Building target "{0}" completely. - {0} is the name of the target. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - No input files were specified. - - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Input file "{0}" is newer than output file "{1}". - {0} and {1} are filenames on disk. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - Output file "{0}" does not exist. - {0} is a filename on disk. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Input file "{0}" does not exist. - {0} is a filename on disk. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Building target "{0}" partially, because some output files are out of date with respect to their input files. - {0} is the name of the target. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - [{0}: Input={1}, Output={2}] Input file is newer than output file. - {0} is the name of an MSBuild item. {1} and {2} are filenames on disk. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - [{0}: Input={1}, Output={2}] Output file does not exist. - {0} is the name of an MSBuild item. {1} and {2} are filenames on disk. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - [{0}: Input={1}, Output={2}] Input file does not exist. - {0} is the name of an MSBuild item. {1} and {2} are filenames on disk. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - The attribute "{0}" is a known MSBuild attribute, and cannot be accessed using this method. - - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - Properties in persisted property groups cannot be accessed by name. - - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4023: Cannot evaluate the item metadata "%({0})". {1} - {StrBegin="MSB4023: "}UE: This message is shown when the value of an item metadata cannot be computed for some reason e.g. trying to apply - %(RootDir) to an item-spec that's not a valid path, would result in this error. - LOCALIZATION: "{1}" is a localized message explaining the problem. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Cannot execute a task not associated with a project object. - - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - The cache entry has already been set to a different value and cannot be modified. - - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - The "{0}" property comes from an environment variable, and cannot be modified. - - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - The "{0}" property is a global property, and cannot be modified through an evaluated property group. Use "{1}" instead. - - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - Modifying the XML of an imported project file is not allowed. Open that project file directly. - - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB4117: The "{0}" item name is reserved, and cannot be used. - {StrBegin="MSB4117: "}UE: This message is shown when the user tries to redefine one of the reserved MSBuild items e.g. @(Choose) - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4118: The "{0}" item metadata name is reserved, and cannot be used. - {StrBegin="MSB4118: "}UE: This message is shown when the user tries to redefine one of the reserved MSBuild items e.g. @(Choose) - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4004: The "{0}" property is reserved, and cannot be modified. - {StrBegin="MSB4004: "}UE: This message is shown when the user tries to redefine one of the reserved MSBuild properties e.g. $(MSBuildProjectFile) - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4094: "{0}" is an invalid value for the "{1}" parameter of the "{3}" task. Multiple items cannot be passed into a parameter of type "{2}". - {StrBegin="MSB4094: "} - UE: This error is shown when a project tries to pass multiple items into a task parameter of type ITaskItem (singular). - - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4115: The "{0}" function only accepts a scalar value, but its argument "{1}" evaluates to "{2}" which is not a scalar value. - {StrBegin="MSB4115: "} - UE: This error is shown when a project tries to pass multiple items into a function in a conditional expression, that can only accept a scalar value (such as the "exists()" function). - - - fuzzyMatch="100" wordcount="22" adjWordcount="5.5" curWordcount="5.5" tmLabel="N''" - - - The task is currently associated with a project object, and should not be added to a different one. - - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - MSB4095: The item metadata %({0}) is being referenced without an item name. Specify the item name by using %(itemname.{0}). - {StrBegin="MSB4095: "} - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - The task is not associated with the specified target element collection, and should not be removed from it. - - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - MSB4005: The current working directory could not be restored to {0}. {1} - {StrBegin="MSB4005: "}UE: This message is shown when the current working directory cannot be reset after a build. "{1}" contains a message explaining why. - LOCALIZATION: "{1}" is a message from an CLR/FX exception and is already localized. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Cannot set a condition on an object not represented by an XML element in the project file. - - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - Cannot set ContinueOnError on an object not represented by an XML element in the project file. - - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB4134: DefaultToolsVersion cannot be set after a project has been loaded into the Engine. - {StrBegin="MSB4134: "} - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - Assigning the "{0}" attribute on an item that has been evaluated is not allowed. This operation is only allowed on the original persisted item that came directly from the project file. - - - fuzzyMatch="101" wordcount="31" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Assigning the "{0}" attribute of a virtual item is not allowed. - - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - A property cannot be set while building. - - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - A property cannot be set to null. - - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Cannot get or set parameters on a task not associated with a project object. - - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4162: <{0}> is not valid. Child elements are not allowed below a item remove element. - {StrBegin="MSB4162: "} - - fuzzyMatch="15" wordcount="16" adjWordcount="13.6" curWordcount="13.6" - - - MSB4166: Child node "{0}" exited prematurely. Shutting down. - {StrBegin="MSB4166: "} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4085: A <Choose> must contain at least one <When>. - {StrBegin="MSB4085: "} - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB4114: <Choose> elements cannot be nested more than {0} levels deep. - {StrBegin="MSB4114: "}UE: This message appears if the project file contains unreasonably nested Choose elements. - LOCALIZATION: Do not localize "Choose" as it is an XML element name. - - fuzzyMatch="15" wordcount="12" adjWordcount="10.2" curWordcount="10.2" - - - MSB4006: There is a circular dependency in the target dependency graph involving target "{0}". - {StrBegin="MSB4006: "}UE: This message is shown when the build engine detects a target referenced in a circular manner -- a project cannot - request a target to build itself (perhaps via a chain of other targets). - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4086: A numeric comparison was attempted on "{1}" that evaluates to "{2}" instead of a number, in condition "{0}". - {StrBegin="MSB4086: "} - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4007: The clause "{0}", specified in the "{1}" attribute is invalid. - {StrBegin="MSB4007: "}UE: This message is shown when the Condition on an element is invalid in some way -- e.g. syntax error, unrecognized operator. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4130: The condition "{0}" may have been evaluated incorrectly in an earlier version of MSBuild. Please verify that the order of the AND and OR clauses is written as intended. To avoid this warning, add parentheses to make the evaluation order explicit. - {StrBegin="MSB4130: "} - - fuzzyMatch="101" wordcount="42" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4087: Specified condition "{0}" does not evaluate to a boolean. - {StrBegin="MSB4087: "} - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4113: Specified condition "{0}" evaluates to "{1}" instead of a boolean. - {StrBegin="MSB4113: "} - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - {0}, line {1} - - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - MSB4136: Error reading the toolset information from the configuration file "{0}". {1} - {StrBegin="MSB4136: "} - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4008: A conflicting assembly for the task assembly "{0}" has been found at "{1}". - {StrBegin="MSB4008: "}UE: This message is shown when the type/class of a task cannot be resolved uniquely from a single assembly. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4142: MSBuildToolsPath is not the same as MSBuildBinPath for the ToolsVersion "{0}" defined at "{1}". If both are present they must have the same value. - {StrBegin="MSB4142: "} - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4097: The element <{0}> beneath element <{1}> may not have a custom XML namespace. - {StrBegin="MSB4097: "} - - fuzzyMatch="15" wordcount="16" adjWordcount="13.6" curWordcount="13.6" - - - MSB4009: The default tasks file could not be successfully loaded. {0} - {StrBegin="MSB4009: "}UE: This message is shown when one of the default tasks file (*.tasks) located alongside the MSBuild binaries cannot - be opened/parsed. "{0}" contains a message explaining why. The filename itself is not part of the message but is provided - separately to loggers. - LOCALIZATION: "{0}" is a message from some FX method and is already localized. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4010: The "{0}" files could not be successfully loaded from their expected location "{1}". Default tasks will not be available. {2} - {StrBegin="MSB4010: "}UE: This message is shown when the default tasks files that are located alongside the MSBuild binaries cannot be - found, either because they don't exist, or because of lack of permissions. "{2}" contains a message explaining why. - LOCALIZATION: "{2}" is a message from some FX method and is already localized. - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - MSB4140: Default tools version is specified in neither the registry nor the configuration file. - {StrBegin="MSB4140: "} - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4133: A default tools version "{0}" was specified, but its definition could not be found. - {StrBegin="MSB4133: "} - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - MSB4080: The value "{0}" of the "PropertyName" attribute in element <Output> contains a "$" character. If you intended to use a property name then remove the $( ) around the property name. - {StrBegin="MSB4080: "}UE: This message is shown when an output tag has an property name that contains an $. They probably typed $(foo) instead of foo in the PropertyName. LOCALIZATION: Output and PropertyName should not be localized. - - fuzzyMatch="15" wordcount="32" adjWordcount="27.2" curWordcount="27.2" - - - MSB4011: There is a circular reference involving the import of file "{0}". This file may have been imported more than once, or you may have attempted to import the main project file. All except the first instance of this file will be ignored. - {StrBegin="MSB4011: "} - - fuzzyMatch="101" wordcount="43" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4079: The <ProjectExtensions> element occurs more than once. - {StrBegin="MSB4079: "} - - fuzzyMatch="15" wordcount="9" adjWordcount="7.65" curWordcount="7.65" - - - MSB4012: The expression "{0}" cannot be used in this context. Item lists cannot be concatenated with other strings where an item list is expected. Use a semicolon to separate multiple item lists. - {StrBegin="MSB4012: "}UE: This message is shown when the user does not properly specify an item list when an item list is expected - e.g. "badprefix@(foo)badsuffix" instead of "prefix; @(foo); suffix" - - fuzzyMatch="101" wordcount="32" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Need to specify the project file name. - UE: This message is shown when the user calls into the engine to build a project without specifying a filename. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - end of input - This is the name of the "EndOfInput" token. It is displayed in quotes as the - unexpected char or token when the end of a conditional was unexpectedly reached. - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - The previous error was converted to a warning because the task was called with ContinueOnError=true. - - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - {0} Error(s) - - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4159: Error creating the toolset "{0}". {1} - {StrBegin="MSB4159: "} - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4146: Cannot evaluate the property expression "{0}" found at "{1}". {2} - {StrBegin="MSB4146: "} - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - The <{0}> tag is no longer supported as a child of the <Project> element. Place this tag within a target, and add the name of the target to the "InitialTargets" attribute of the <Project> element. - - - fuzzyMatch="15" wordcount="38" adjWordcount="32.3" curWordcount="32.3" - - - MSB4100: Expected "{0}" to evaluate to a boolean instead of "{1}", in condition "{2}". - {StrBegin="MSB4100: "} - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4028: The "{0}" task's outputs could not be retrieved from the "{1}" parameter. {2} - {StrBegin="MSB4028: "} - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4014: The build was aborted because of an internal failure. - {StrBegin="MSB4014: "}UE: This message is shown when an unhandled exception terminates the build. The cause is most likely a programming - error in the build engine. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4015: The build was aborted because the "{0}" logger failed unexpectedly during shutdown. - {StrBegin="MSB4015: "}UE: This message is used for a special exception that is thrown when a logger fails while shutting down (most likely - because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a special - exception to abort the build. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4016: The build was aborted because the "{0}" logger failed unexpectedly during initialization. - {StrBegin="MSB4016: "}UE: This message is used for a special exception that is thrown when a logger fails while initializing itself (most - likely because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a - special exception to abort the build. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4017: The build was aborted because of an unexpected logger failure. - {StrBegin="MSB4017: "}UE: This message is used for a special exception that is thrown when a logger fails while logging an event (most - likely because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a - special exception to abort the build. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4018: The "{0}" task failed unexpectedly. - {StrBegin="MSB4018: "}UE: This message is shown when a task terminates because of an unhandled exception. The cause is most likely a - programming error in the task; however, it is also possible that the unhandled exception originated in the engine, and was - surfaced through the task when the task called into the engine. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4165: Failed to receive a response from the child node "{0}" in the timeout period "{1}" ms. Shutting down. - {StrBegin="MSB4165: "} - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4088: Condition "{0}" is improperly constructed. - {StrBegin="MSB4088: "} - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4105: Found an unexpected character '{2}' at position {1} in condition "{0}". Did you intend to use "=="? - {StrBegin="MSB4105: "} - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - MSB4106: Expected an item list at position {1} in condition "{0}". Did you forget the closing parenthesis? - {StrBegin="MSB4106: "} - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - MSB4107: Expected an item list at position {1} in condition "{0}". Did you forget the opening parenthesis after the '@'? To use a literal '@', use '%40' instead. - {StrBegin="MSB4107: "} - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4108: Expected an item list at position {1} in condition "{0}". Did you forget to close a quote inside the item list expression? - {StrBegin="MSB4108: "} - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - MSB4109: Expected a property at position {1} in condition "{0}". Did you forget the closing parenthesis? - {StrBegin="MSB4109: "} - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB4110: Expected a property at position {1} in condition "{0}". Did you forget the opening parenthesis after the '$'? To use a literal '$', use '%24' instead. - {StrBegin="MSB4110: "} - - fuzzyMatch="101" wordcount="27" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4101: Expected a closing quote after position {1} in condition "{0}". - {StrBegin="MSB4101: "} - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4019: The imported project "{0}" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. - {StrBegin="MSB4019: "}LOCALIZATION: <Import> should not be localized. - - fuzzyMatch="15" wordcount="26" adjWordcount="22.1" curWordcount="22.1" - - - MSB4089: Incorrect number of arguments to function in condition "{0}". Found {1} argument(s) when expecting {2}. - {StrBegin="MSB4089: "} - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - The "{0}" object specified does not belong to the correct "{1}" object. - - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4020: The value "{0}" of the "{1}" attribute in element <{2}> is invalid. - {StrBegin="MSB4020: "}UE: This is a generic message that is displayed when we find a project element with an incorrect value for one of its - attributes e.g. <Import Project=""> -- the value of Project should not be an empty string. - - fuzzyMatch="15" wordcount="14" adjWordcount="11.9" curWordcount="11.9" - - - MSB4102: The value "{0}" of the "{1}" attribute in element <{2}> is invalid. {3} - {StrBegin="MSB4102: "}UE: This is a generic message that is displayed when we find a project element with an incorrect value for one of its - attributes. At the end of the message we show the exception text we got trying to use the value. - - fuzzyMatch="15" wordcount="15" adjWordcount="12.75" curWordcount="12.75" - - - MSB4021: The "ContinueOnError" attribute of the "{0}" task is not valid. {1} - {StrBegin="MSB4021: "}LOCALIZATION: "ContinueOnError" should not be localized. "{1}" is a message from another exception explaining the problem. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4139: Invalid value for default ToolsVersion is specified in registry key "{0}". - {StrBegin="MSB4139: "} - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4022: The result "{0}" of evaluating the value "{1}" of the "{2}" attribute in element <{3}> is not valid. - {StrBegin="MSB4022: "}UE: This message is shown when the engine is checking the correctness of the value (after evaluating embedded - properties/items) assigned to an XML attribute of an XML element in the project file. - - fuzzyMatch="15" wordcount="20" adjWordcount="17" curWordcount="17" - - - "{0}" is not a valid event category. To raise a custom event, use the "{1}" category. - - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - "{0}" is not a valid importance level for events. - - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4104: Failed to write to log file "{0}". {1} - {StrBegin="MSB4104: "}UE: This is shown when the File Logger can't create or write to the file it was instructed to log to. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4024: The imported project file could not be loaded. {0} - {StrBegin="MSB4024: "}UE: This message is shown when an imported project file cannot be loaded because of incorrect XML. The project - filename is not part of the message because it is provided separately to loggers. - LOCALIZATION: {0} is a localized message from the CLR/FX explaining why the project is invalid. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - Operation invalid for a persisted item group. - - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Operation invalid for a virtual item group. - - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4071: The value Importance="{0}" in the <Message> element is invalid. Valid values are: High, Normal and Low. - {StrBegin="MSB4071: "}UE: This message is shown when a user specifies a value for the importance attribute of Message which is not valid. - The importance enumeration is: High, Normal and Low. Specifying any other importance will result in this message being shown - LOCALIZATION: "Importance" should not be localized. - "Message" should not be localized. - High should not be localized. - Normal should not be localized. - Low should not be localized. - - fuzzyMatch="15" wordcount="18" adjWordcount="15.3" curWordcount="15.3" - - - MSB4025: The project file could not be loaded. {0} - {StrBegin="MSB4025: "}UE: This message is shown when the project file given to the engine cannot be loaded because the filename/path is - invalid, or due to lack of permissions, or incorrect XML. The project filename is not part of the message because it is - provided separately to loggers. - LOCALIZATION: {0} is a localized message from the CLR/FX explaining why the project is invalid. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4147: The property "{0}" at "{1}" is invalid. {2} - {StrBegin="MSB4147: "} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - "{0}" is an invalid "ProjectFileEncoding" value. - LOCALIZATION: "ProjectFileEncoding" should not be localized. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4143: The expression "{0}" cannot be evaluated. {1} - {StrBegin="MSB4143: "} - UE: This message is shown when the user attempts to provide an expression like "$(Registry:HKEY_LOCAL_MACHINE\Software\Vendor\Tools@TaskLocation)" - LOCALIZATION: "{0}" is the expression that was bad. "{1}" is a message from an FX exception that describes why the expression is bad. - - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4184: The expression "{0}" cannot be evaluated. {1} - {StrBegin="MSB4184: "} - Single quotes as the expression will typically have double quotes in it. - UE: This message is shown when the user attempts to provide an expression like "$(SomeProperty.ToLower())" - LOCALIZATION: "{0}" is the expression that was bad. "{1}" is a message from an FX exception that describes why the expression is bad. - - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4185: The function "{0}" on type "{1}" has not been enabled for execution. - {StrBegin="MSB4185: "} - UE: This message is shown when the user attempts to provide an expression like "$([System.DateTime]::Now)", but the expression has not been enabled - LOCALIZATION: "{0}" is the static function name, "{1}" is the .NET Framework type name - - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4186: Invalid static method invocation syntax: "{0}". Static method invocation should be of the form: $([FullTypeName]::Method()), e.g. $([System.IO.Path]::Combine(`a`, `b`)) - {StrBegin="MSB4186: "} - UE: This message is shown when the user attempts to call a static method on a type, but has used the incorrect syntax - LOCALIZATION: "{0}" is the function expression which is in error - - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4070: The schema "{0}" is not valid. {1} - {StrBegin="MSB4070: "}UE: This message is shown when the schema file provided for the validation of a project is itself not valid. - LOCALIZATION: "{0}" is the schema file path. "{1}" is a message from an FX exception that describes why the schema file is bad. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4026: The "{0}={1}" parameter for the "{2}" task is invalid. - {StrBegin="MSB4026: "}UE: This message is displayed when a task has an invalid parameter that cannot be initialized. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4027: The "{0}" task generated invalid items from the "{1}" output parameter. {2} - {StrBegin="MSB4027: "} - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4029: The "{0}" task has an invalid output specification. The "TaskParameter" attribute is required, and either the "ItemName" or "PropertyName" attribute must be specified (but not both). - {StrBegin="MSB4029: "}LOCALIZATION: "TaskParameter", "ItemName" and "PropertyName" should not be localized. - - fuzzyMatch="101" wordcount="27" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4030: "{0}" is an invalid value for the "{1}" parameter of the "{3}" task. The "{1}" parameter is of type "{2}". - {StrBegin="MSB4030: "}UE: This error is shown when a type mis-match occurs between the value assigned to task parameter in the project file - and the type of the .NET property that corresponds to the task parameter. For example, if an int task parameter called "Count" - is assigned the value "x", this error would be displayed: <MyTask Count="x" /> - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - MSB4137: Invalid value specified in the configuration file at "{0}". Property name or tools version name is an empty string. - {StrBegin="MSB4137: "} - - fuzzyMatch="100" wordcount="20" adjWordcount="5" curWordcount="5" tmLabel="N''" - - - MSB4103: "{0}" is not a valid logger verbosity level. - {StrBegin="MSB4103: "} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4163: <ItemDefinitionGroup> is not allowed inside a target. - {StrBegin="MSB4163: "} - - fuzzyMatch="15" wordcount="9" adjWordcount="7.65" curWordcount="7.65" - - - The specified item does not belong to the current item group. - - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4096: The item "{0}" in item list "{1}" does not define a value for metadata "{2}". In order to use this metadata, either qualify it by specifying %({1}.{2}), or ensure that all items in this list define a value for this metadata. - {StrBegin="MSB4096: "} - - fuzzyMatch="101" wordcount="42" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4099: A reference to an item list at position {1} is not allowed in this condition "{0}". - {StrBegin="MSB4099: "} - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - MSB4033: "{0}" is a reserved item metadata, and cannot be redefined as a custom metadata on the item. - {StrBegin="MSB4033: "} - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - An InternalLoggerException can only be thrown by the MSBuild engine. The public constructors of this class cannot be used to create an instance of the exception. - UE: This message is shown when a user tries to instantiate a special exception called InternalLoggerException through the OM -- - only the engine is allowed to create and throw this exception. - LOCALIZATION: "InternalLoggerException" and "MSBuild" should not be localized. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Initial Items: - - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4083: Expected a Condition attribute on element "{0}". - {StrBegin="MSB4083: "} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4164: The value "{0}" of metadata "{1}" contains an item list expression. Item list expressions are not allowed on default metadata values. - {StrBegin="MSB4164: "} - - fuzzyMatch="100" wordcount="22" adjWordcount="5.5" curWordcount="5.5" tmLabel="N''" - - - MSBuild is expecting a valid "{0}" object. - - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4035: The required attribute "{0}" is missing from element <{1}>. - {StrBegin="MSB4035: "}UE: This message is shown when a user leaves off a required attribute from a project element - e.g. <UsingTask AssemblyName="foo"> -- this is missing the "TaskName" attribute. - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB4036: The "{0}" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "{1}" directory. - {StrBegin="MSB4036: "}LOCALIZATION: <UsingTask> and "*.tasks" should not be localized. - - fuzzyMatch="15" wordcount="64" adjWordcount="54.4" curWordcount="54.4" - - - MSB4141: MSBuildToolsPath is not specified for the ToolsVersion "{0}" defined at "{1}", or the value specified evaluates to the empty string. - {StrBegin="MSB4141: "} - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - MSB4031: The "MSBuildVersion" attribute is deprecated. If the project is authored in the MSBuild 2003 format, please remove the attribute from the <Project> tag. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format. - {StrBegin="MSB4031: "}UE: This message is shown for projects that still contain the "MSBuildVersion" attribute in their <Project> - tag. We no longer need this attribute because the project's XML namespace (i.e. the "xmlns" attribute) gives us all the - version information we need. - LOCALIZATION: "MSBuild", "MSBuildVersion" and <Project> should not be localized. - - fuzzyMatch="15" wordcount="45" adjWordcount="38.25" curWordcount="38.25" - - - MSB4144: Multiple definitions were found for the toolset "{0}". - {StrBegin="MSB4144: "} - - fuzzyMatch="15" wordcount="9" adjWordcount="7.65" curWordcount="7.65" - - - MSB4145: Multiple definitions were found for the property "{0}". - {StrBegin="MSB4145: "} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4082: Choose has more than one <Otherwise> element. - {StrBegin="MSB4082: "} - - fuzzyMatch="15" wordcount="9" adjWordcount="7.65" curWordcount="7.65" - - - This method is only valid for persisted <{0}> elements. - - - fuzzyMatch="15" wordcount="10" adjWordcount="8.5" curWordcount="8.5" - - - This method is only valid for virtual property groups, not <{0}> elements. - - - fuzzyMatch="15" wordcount="13" adjWordcount="11.05" curWordcount="11.05" - - - MSB4038: The element <{0}> must be last under element <{1}>. Found element <{2}> instead. - {StrBegin="MSB4038: "} - - fuzzyMatch="15" wordcount="17" adjWordcount="14.45" curWordcount="14.45" - - - MSB4138: Non-string data was specified at the registry location "{0}". - {StrBegin="MSB4138: "} - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4039: No "{0}" element was found in the project file. - {StrBegin="MSB4039: "} - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4040: There is no target in the project. - {StrBegin="MSB4040: "} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Removing the "{0}" attribute of an item is not allowed. - - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - The object passed in is not part of the project. - - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - Overriding target "{0}" in project "{1}" with target "{2}" from project "{3}". - - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4167: The parent process unexpectedly exited. Shutting down child node "{0}". - {StrBegin="MSB4167: "} - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - {0} ms {1} {2} calls - - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - (* = timing was not recorded because of reentrancy) - - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - This project object has been unloaded from the MSBuild engine and is no longer valid. - - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - The project file "{0}" was not found. - UE: This message is shown when the user calls into the OM to build a project that doesn't exist on disk. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Done building project "{0}" -- FAILED. - - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Done building project "{0}". - - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - MSB4041: The default XML namespace of the project must be the MSBuild XML namespace. If the project is authored in the MSBuild 2003 format, please add xmlns="{0}" to the <Project> element. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format. - {StrBegin="MSB4041: "}UE: This is a Beta 1 message only. - LOCALIZATION: <Project>, "MSBuild" and "xmlns" should not be localized. - - fuzzyMatch="15" wordcount="52" adjWordcount="44.2" curWordcount="44.2" - - - Project Performance Summary: - - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - MSB4042: Stopping because of syntax errors in project file. - {StrBegin="MSB4042: "} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - Project "{0}" is building "{1}" ({2} target(s)): - - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Project "{0}" is building "{1}" (default targets): - - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Project "{0}" ({1} target(s)): - - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - Project "{0}" (default targets): - - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - Done Building Project "{0}" ({1} target(s)). - - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Done Building Project "{0}" (default targets). - - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Done Building Project "{0}" ({1} target(s)) -- FAILED. - - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Done Building Project "{0}" (default targets) -- FAILED. - - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4075: The project file must be opened in the Visual Studio IDE and converted to the latest version before it can be built by MSBuild. - {StrBegin="MSB4075: "} - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4192: The project file "{0}" is in the ".vcproj" file format, which MSBuild no longer supports. Please convert the project by opening it in the Visual Studio IDE or running the conversion tool, or use MSBuild 3.5 or earlier to build it. - {StrBegin="MSB4192: "} LOC: ".vcproj" should not be localized - - fuzzyMatch="101" wordcount="42" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - The specified property does not belong to the current property group. - - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - Initial Properties: - - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4148: The name of a property stored under the registry key "{0}" has zero length. - {StrBegin="MSB4148: "} - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - The property names in the indexer and the "{0}" object do not match. - - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4043: The item metadata reference "{0}" is invalid because it is qualified with an item name. Item metadata referenced in transforms do not need to be qualified, because the item name is automatically deduced from the items being transformed. Change "{0}" to "%({1})". - {StrBegin="MSB4043: "}UE: This message is shown when the user does something like this: @(foo->'%(foo.metadata)'). There is no need to specify - "foo.metadata", because "foo" is automatically deduced. In corollary, "bar.metadata" is not allowed either, where "bar" is a different - item list type. - - fuzzyMatch="101" wordcount="43" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4135: Error reading the toolset information from the registry location "{0}". {1} - {StrBegin="MSB4135: "} - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4044: The "{0}" task was not given a value for the required parameter "{1}". - {StrBegin="MSB4044: "}UE: This message is shown when a task parameter designated as "required" is not set in the project file. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - Validating project using schema file "{0}". - LOCALIZATION: "{0}" is the location of the schema file. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4045: Project is not valid. {0} - {StrBegin="MSB4045: "}UE: This error is shown when the user asks his project to be validated against a schema (/val switch for - MSBuild.exe), and the project has errors. "{0}" contains a message explaining the problem. - LOCALIZATION: "{0}" is a message from the System.XML schema validator and is already localized. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4112: The targets in this project have been disabled by the host and therefore cannot be built at this time. This may have been done for security reasons. To enable the targets, the host must set Project.BuildEnabled to "true". - {StrBegin="MSB4112: "} - - fuzzyMatch="101" wordcount="39" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4093: The "{0}" parameter of the "{1}" task cannot be written to because it does not have a "set" accessor. - {StrBegin="MSB4093: "}UE: This error is shown when a project tries to assign a value to a task parameter that does not have a "set" - accessor on the corresponding .NET property on the task class. - - fuzzyMatch="100" wordcount="20" adjWordcount="5" curWordcount="5" tmLabel="N''" - - - A shallow clone of this object cannot be created. - - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - Skipping target "{0}" because it has no inputs. - - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Though the target has declared its inputs, the input specification only references empty properties and/or empty item lists. - - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - Skipping target "{0}" because it has no outputs. - - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Though the target has declared its outputs, the output specification only references empty properties and/or empty item lists. - - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - Skipping target "{0}" because all output files are up-to-date with respect to the input files. - - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - Input files: {0} - {0} is a semicolon-separated list of filenames. - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Output files: {0} - {0} is a semicolon-separated list of filenames. - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Building solution configuration "{0}". - UE: This is not an error, so doesn't need an error code. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - Using solution cache file "{0}" for configuration "{1}" and tools version "{2}". - UE: This is not an error, so doesn't need an error code. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Failed to read solution cache file "{0}". {1} Using solution file directly. - UE: This is not a true error, so doesn't need an error code. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Failed to write solution cache file "{0}". {1} - UE: This is not a true error, so doesn't need an error code. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Solution cache file was created for a "{0}" value of "{1}" but the current value is "{2}". Refreshing cache file. - UE: This is not an error, so doesn't need an error code. - - fuzzyMatch="100" wordcount="20" adjWordcount="5" curWordcount="5" tmLabel="N''" - - - Solution cache file has an internal version number "{0}" but the current value is "{1}". Refreshing cache file. - UE: This is not an error, so doesn't need an error code. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - Solution cache file is out of date. Refreshing cache file. {0} - UE: This is not an error, so doesn't need an error code. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4160: A circular dependency involving project "{0}" has been detected. - {StrBegin="MSB4160: "} - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4126: The specified solution configuration "{0}" is invalid. Please specify a valid solution configuration using the Configuration and Platform properties (e.g. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU") or leave those properties blank to use the default solution configuration. - {StrBegin="MSB4126: "}UE: The solution filename is provided separately to loggers. - - fuzzyMatch="101" wordcount="37" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4046: Error reading project file "{0}": {1} - {StrBegin="MSB4046: "} - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4125: The project file name "{0}" is invalid. {1} - {StrBegin="MSB4125: "}UE: The solution filename is provided separately to loggers. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4051: Project {0} is referencing a project with GUID {1}, but a project with this GUID was not found in the .SLN file. - {StrBegin="MSB4051: "}UE: The solution filename is provided separately to loggers. - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - MSB4078: The project file "{0}" is not supported by MSBuild and cannot be built. - {StrBegin="MSB4078: "} - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4054: The solution file must be opened in the Visual Studio IDE and converted to the latest version before it can be built by MSBuild. - {StrBegin="MSB4054: "}UE: The solution filename is provided separately to loggers. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4121: The project configuration for project "{0}" was not specified in the solution file for the solution configuration "{1}". - {StrBegin="MSB4121: "} - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - The project "{0}" is not selected for building in solution configuration "{1}". - - UE: This is not an error, so doesn't need an error code. - - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4122: Scanning project dependencies for project "{0}" failed. {1} - {StrBegin="MSB4122: "} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4149: The tools version "{0}" of the solution does not support building projects with a different tools version. - {StrBegin="MSB4149: "} - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - Web projects do not support the "Clean" target. Continuing with remaining projects ... - UE: This is not an error, so doesn't need an error code. - LOCALIZATION: Do not localize "Clean". - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Web projects do not support the "Publish" target. Continuing with remaining projects ... - UE: This is not an error, so doesn't need an error code. - LOCALIZATION: Do not localize "Publish". - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Skipping because the "$(AspNetConfiguration)" configuration is not supported for this web project. You can use the AspNetConfiguration property to override the configuration used for building web projects, by adding /p:AspNetConfiguration=<value> to the command line. Currently web projects only support Debug and Release configurations. - - UE: This is not an error, so doesn't need an error code. - LOCALIZATION: Do NOT localize "AspNetConfiguration", "Debug", "Release". - - - fuzzyMatch="15" wordcount="44" adjWordcount="37.4" curWordcount="37.4" - - - MSB4076: VC projects do not support the "Publish" target. - {StrBegin="MSB4076: "}LOCALIZATION: Do not localize "Publish". - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4098: MSBuild is invoking VCBuild to build this project. Project-to-project references between VC++ projects (.VCPROJ) and C#/VB/VJ# projects (.CSPROJ, .VBPROJ, .VJSPROJ) are not supported by the command-line build systems when building stand-alone VC++ projects. Projects that contain such project-to-project references will fail to build. Please build the solution file containing this project instead. - {StrBegin="MSB4098: "} - - fuzzyMatch="101" wordcount="53" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4056: The MSBuild engine must be called on a single-threaded-apartment. Current threading model is "{0}". Proceeding, but some tasks may not function correctly. - {StrBegin="MSB4056: "} - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - Schema validation - UE: this fragment is used to describe errors that are caused by schema validation. For example, if a normal error is - displayed like this: "MSBUILD : error MSB0000: This is an error.", then an error from schema validation would look like this: - "MSBUILD : Schema validation error MSB0000: This is an error." - LOCALIZATION: This fragment needs to be localized. - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Target "{0}" skipped. Previously built unsuccessfully. - - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Target "{0}" skipped. Previously built successfully. - - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4116: The condition "{1}" on the "{0}" target has a reference to item metadata. References to item metadata are not allowed in target conditions unless they are part of an item transform. - {StrBegin="MSB4116: "} - - fuzzyMatch="101" wordcount="32" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4057: The target "{0}" does not exist in the project. - {StrBegin="MSB4057: "} - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - Done building target "{0}" in project "{1}" -- FAILED. - - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Done building target "{0}" in project "{1}". - - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - {0}: (TargetId:{1}) - - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4058: The "{0}" target is missing its output specification. If a target declares inputs, it must also declare outputs. - {StrBegin="MSB4058: "} - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4168: The item "{0}" of type "{1}" does not define a value for the metadata in the expression "{2}". This expression is used in the target output for target "{3}". If a target declares outputs that are transforms, all items in the transform must have a value for the metadata in the transform. - {StrBegin="MSB4168: "} - - fuzzyMatch="101" wordcount="53" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Target Performance Summary: - - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Target "{0}" skipped, due to false condition; ({1}) was evaluated as ({2}). - - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Target "{0}" in project "{1}" - - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Target {0}: - - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Target "{0}" in file "{1}": - - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Build continuing because "{0}" on the task "{1}" is set to "{2}". - - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Target {0} from project "{1}": - - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Target "{0}" in file "{1}" from project "{2}": - - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4060: The "{0}" task has been declared or used incorrectly, or failed during construction. Check the spelling of the task name and the assembly name. - {StrBegin="MSB4060: "} - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4077: The "{0}" task has been marked with the attribute LoadInSeparateAppDomain, but does not derive from MarshalByRefObject. Check that the task derives from MarshalByRefObject or AppDomainIsolatedTask. - {StrBegin="MSB4077: "}LOCALIZATION: <LoadInSeparateAppDomain>, <MarshalByRefObject>, <AppDomainIsolatedTask> should not be localized. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Done executing task "{0}" -- FAILED. - - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Done executing task "{0}". - - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - {0} (TaskId:{1}) - - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Using "{0}" task from assembly "{1}". - UE: This informational message helps users determine which assemblies their tasks were loaded from. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4061: The "{0}" task could not be instantiated from the assembly "{1}". {2} - {StrBegin="MSB4061: "}LOCALIZATION: "{2}" is a localized message from a CLR/FX exception. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4127: The "{0}" task could not be instantiated from the assembly "{1}". Please verify the task assembly has been built using the same version of the Microsoft.Build.Framework assembly as the one installed on your computer and that your host application is not missing a binding redirect for Microsoft.Build.Framework. {2} - {StrBegin="MSB4127: "}UE: This message is a specialized version of the TaskInstantiationFailureError message and can probably reuse some of its docs. - LOCALIZATION: "{2}" is a localized message from a CLR/FX exception. Also, Microsoft.Build.Framework should not be localized - - fuzzyMatch="101" wordcount="49" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4062: The "{0}" task could not be loaded from the assembly {1}. {2} Confirm that the <UsingTask> declaration is correct, and that the assembly and all its dependencies are available. - {StrBegin="MSB4062: "}UE: This message is shown when a task cannot be loaded from its assembly for various reasons e.g. corrupt assembly, - invalid task declaration, disk error, etc. "{2}" contains a message explaining what happened. - LOCALIZATION: "{2}" is a message from the CLR loader and is already localized. Also, <UsingTask> should not be localized. - - fuzzyMatch="15" wordcount="31" adjWordcount="26.35" curWordcount="26.35" - - - MSB4063: The "{0}" task could not be initialized with its input parameters. {1} - {StrBegin="MSB4063: "} - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - Task Performance Summary: - - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Task "{0}" skipped, due to false condition; ({1}) was evaluated as ({2}). - - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Task "{0}" - - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Time Elapsed {0} - - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Building with tools version "{0}". - - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Project file contains ToolsVersion="{0}". This toolset is unknown or missing. You may be able to resolve this by installing the appropriate .NET Framework for this toolset. Treating the project as if it had ToolsVersion="4.0". - - - fuzzyMatch="101" wordcount="34" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Deferred Messages - - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Some messages did not display because they were not associated with any ProjectStarted events. Use diagnostic verbosity to view these messages. - - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - MSB4090: Found an unexpected character '{2}' at position {1} in condition "{0}". - {StrBegin="MSB4090: "} - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4091: Found a call to an undefined function "{1}" in condition "{0}". - {StrBegin="MSB4091: "} - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4064: The "{0}" parameter is not supported by the "{1}" task. Verify the parameter exists on the task, and it is a settable public instance property. - {StrBegin="MSB4064: "} - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4131: The "{0}" parameter is not supported by the "{1}" task. Verify the parameter exists on the task, and it is a gettable public instance property. - {StrBegin="MSB4131: "} - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4092: An unexpected token "{1}" was found at character position {2} in condition "{0}". - {StrBegin="MSB4092: "} - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4065: The "{0}" parameter is not marked for output by the "{1}" task. - {StrBegin="MSB4065: "} - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4066: The attribute "{0}" in element <{1}> is unrecognized. - {StrBegin="MSB4066: "} - - fuzzyMatch="15" wordcount="10" adjWordcount="8.5" curWordcount="8.5" - - - MSB4067: The element <{0}> beneath element <{1}> is unrecognized. - {StrBegin="MSB4067: "} - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB4068: The element <{0}> is unrecognized, or not supported in this context. - {StrBegin="MSB4068: "} - - fuzzyMatch="15" wordcount="13" adjWordcount="11.05" curWordcount="11.05" - - - MSB4132: The tools version "{0}" is unrecognized. - {StrBegin="MSB4132: "} - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4069: The "{0}" type of the "{1}" parameter of the "{2}" task is not supported by MSBuild. - {StrBegin="MSB4069: "}LOCALIZATION: "MSBuild" should not be localized. - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - MSB4072: A <{0}> element must contain either the "{1}" attribute or the "{2}" attribute (but not both). - {StrBegin="MSB4072: "} - - fuzzyMatch="15" wordcount="18" adjWordcount="15.3" curWordcount="15.3" - - - {0} Warning(s) - - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4084: A <When> element may not follow an <Otherwise> element in a <Choose>. - {StrBegin="MSB4084: "} - - fuzzyMatch="15" wordcount="16" adjWordcount="13.6" curWordcount="13.6" - - - Target Name: "{0}" Project Name: "{1}" - - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Cycle trace: - - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4150: Must initialize the console logger using the initialize method before using ApplyParameter - {StrBegin="MSB4150: "} - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4151: An error occurred while building project "{0}", target "{1}". Please see innerException for detailed information. - {StrBegin="MSB4151: "} - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB4152: An error occurred on the child node "{0}" and could not be passed to the parent node. {1} - {StrBegin="MSB4152: "} - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4153: A call is made on an inactive IBuildEngine interface corresponding to a task that already finished execution. - {StrBegin="MSB4153: "} - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - MSB4154: A forwarding logger is attempting to forward BuildFinished event - {StrBegin="MSB4154: "} - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4155: There was an error while communicating with a node. - {StrBegin="MSB4155: "} - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB1021: Cannot create an instance of the logger - {0}. - {StrBegin="MSB1021: "}The error code for this message is duplicated from MSBuild.exe. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB1020: The logger {0} was not found. Check the following: 1.) The logger name specified is the same as the name of the logger class. 2.) The logger class is "public" and implements the Microsoft.Build.Framework.ILogger interface. 3.) The path to the logger assembly is correct, or the logger can be loaded using only the assembly name provided. - {StrBegin="MSB1020: "}The error code for this message is duplicated from MSBuild.exe. - - fuzzyMatch="101" wordcount="57" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4156: A forwarding logger is attempting to forward BuildStarted event - {StrBegin="MSB4156: "} - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - "{0}" ({1} target) ({2}) -> - - - fuzzyMatch="15" wordcount="5" adjWordcount="4.25" curWordcount="4.25" - - - "{0}" (default target) ({1}) -> - - - fuzzyMatch="15" wordcount="5" adjWordcount="4.25" curWordcount="4.25" - - - {0} {1,5} - - - fuzzyMatch="15" wordcount="2" adjWordcount="1.7" curWordcount="1.7" - - - Project "{0}" on node {1} ({2} target(s)). - - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Project "{0}" on node {1} (default targets). - - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Project "{0}" ({1}) is building "{2}" ({3}) on node {4} ({5} target(s)). - - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Project "{0}" ({1}) is building "{2}" ({3}) on node {4} (default targets). - - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - ({0} target) -> - - - fuzzyMatch="15" wordcount="3" adjWordcount="2.55" curWordcount="2.55" - - - MSB4157: The array of project files needs to contain at least one value. - {StrBegin="MSB4157: "} - - fuzzyMatch="15" wordcount="13" adjWordcount="11.05" curWordcount="11.05" - - - MSB4158: The project file name at element {0} is empty. - {StrBegin="MSB4158: "} - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - The property "{0}" with value "{1}" is being overridden by another batch. The property is now: "{2}" - - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - Please see inner exception for error information. - - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Event type "{0}" was expected to be serializable. The event was not serializable and has been ignored. - - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - The log file path cannot be null or empty. - - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4161: Project "{0}" was loaded and unloaded during the current build. Reloading a project during the build can result in errors or an inconsistent build state. Either avoid unloading project "{0}" or cache the evaluation results of target(s) "{1}" before unloading the project. - {StrBegin="MSB4161: "} - - fuzzyMatch="101" wordcount="43" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - [default] - - - fuzzyMatch="100" wordcount="1" adjWordcount="0.25" curWordcount="0.25" tmLabel="N''" - - -
-
\ No newline at end of file diff --git a/src/Deprecated/Engine/Resources/xlf/Strings.zh-Hans.xlf b/src/Deprecated/Engine/Resources/xlf/Strings.zh-Hans.xlf deleted file mode 100644 index 95cc52355de..00000000000 --- a/src/Deprecated/Engine/Resources/xlf/Strings.zh-Hans.xlf +++ /dev/null @@ -1,2674 +0,0 @@ - - - -
- - 4013 - 1176.8 - 1176.8 - 0 - 0 - - - 0 - 981 - 2334 - 0 - 0 - 698 - 0 - -
- - - MSB4001: The "{0}" task has more than one parameter called "{1}". - MSB4001: “{0}”任务包含多个名为“{1}”的参数。 - {StrBegin="MSB4001: "}UE: This message is shown when a task has more than one .NET property with the same name -- it's unclear which of - those properties the task wants to use as a parameter in project files. - - MSB4001: Die {0}-Aufgabe enthält mehrere Parameter mit dem Namen "{1}". - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4081: The value "{0}" of the "ItemName" attribute in element <Output> contains an "@" character. If you intended to use an item name then remove the @( ) around the item name. - MSB4081: 元素 <Output> 中的“ItemName”特性的值“{0}”包含“@”字符。如果打算使用项名称,请移除该项名两边的 @( )。 - {StrBegin="MSB4081: "}UE: This message is shown when an output tag has an itemname that contains an @. They probably typed @(foo) instead of foo in the ItemName.LOCALIZATION: Output and ItemName should not be localized. - - MSB4081: Der Wert "{0}" "ItemName-Attribut im Element < Output > enthält ein" @"Zeichen. Soll ein Elementname verwenden und entfernen dann die @ (), um den Namen des Elements. - - fuzzyMatch="15" wordcount="30" adjWordcount="25.5" curWordcount="25.5" - - - MSB4002: There was a failure retrieving the attributes for parameters in the "{0}" task. {1} - MSB4002: 检索任务“{0}”中参数的特性时失败。{1} - {StrBegin="MSB4002: "}UE: This message is shown when the .NET attributes that a task's .NET properties are decorated with, cannot be - retrieved -- this is typically because the .NET classes that define the .NET attributes cannot be loaded because the assembly - they are defined in cannot be found, or the classes themselves cannot be found. - - MSB4002: Fehler beim Abrufen der Attribute für Parameter in der {0}-Aufgabe. {1} - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - MSB4003: "{0}" is a reserved attribute of the <{1}> element, and must be spelled with the correct casing. This attribute cannot be used as a parameter to the "{2}" task. - MSB4003: “{0}”是 <{1}> 元素的保留特性,必须具有正确的大小写形式。此特性不能用作“{2}”任务的参数。 - {StrBegin="MSB4003: "}UE: Tasks are not allowed to use incorrect case for reserved attributes on the task nodes e.g. "continueonerror" - instead of the "ContinueOnError". - - MSB4003: "{0}" ist ein reserviertes Attribut der <{1}>-Element und mit der richtigen Groß-/Kleinschreibung geschrieben werden muss. Dieses Attribut kann nicht verwendet werden, als Parameter an die "{2}" Aufgabe. - - fuzzyMatch="15" wordcount="31" adjWordcount="26.35" curWordcount="26.35" - - - The "REQUESTBATCHSIZE" must be a number greater than 1. "{0}" is an invalid value. The value 10 will be used instead. - “REQUESTBATCHSIZE”必须是大于 1 的数字。“{0}”是无效的值。将改用值 10。 - The name "REQUESTBATCHSIZE" is an environment variable - - Die "REQUESTBATCHSIZE" muss eine Zahl größer als 1 sein. "{0}" ist ein ungültiger Wert. Der Wert 10 wird stattdessen verwendet. - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - Build completed in {0}. - 生成在 {0} 内完成。 - - - Das Erstellen wurde in {0} beendet. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - Build FAILED. - 生成失败。 - - - Fehler beim Buildvorgang. - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Build succeeded. - 已成功生成。 - - - Buildvorgang erfolgreich. - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Build started. - 已启动生成。 - - - Der Buildvorgang wurde gestartet. - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Build started {0}. - 生成启动时间为 {0}。 - - - Der Buildvorgang wurde am {0} gestartet. - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Building target "{0}" completely. - 正在完全生成目标“{0}”。 - {0} is the name of the target. - - Das Ziel "{0}" wird vollständig erstellt. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - No input files were specified. - 未指定输入文件。 - - - Es wurden keine Eingabedateien angegeben. - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Input file "{0}" is newer than output file "{1}". - 输入文件“{0}”比输出文件“{1}”新。 - {0} and {1} are filenames on disk. - - Die Eingabedatei "{0}" ist neuer als die Ausgabedatei "{1}". - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - Output file "{0}" does not exist. - 输出文件“{0}”不存在。 - {0} is a filename on disk. - - Die Ausgabedatei "{0}" ist nicht vorhanden. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Input file "{0}" does not exist. - 输入文件“{0}”不存在。 - {0} is a filename on disk. - - Die Eingabedatei "{0}" ist nicht vorhanden. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Building target "{0}" partially, because some output files are out of date with respect to their input files. - 正在部分生成目标“{0}”,因为某些输出文件相对于其输入文件而言已经过期。 - {0} is the name of the target. - - Das Ziel "{0}" wird teilweise erstellt, da einige Ausgabedateien hinsichtlich ihrer Eingabedateien veraltet sind. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - [{0}: Input={1}, Output={2}] Input file is newer than output file. - [{0}: Input={1}, Output={2}] 输入文件比输出文件新。 - {0} is the name of an MSBuild item. {1} and {2} are filenames on disk. - - [{0}: Eingabe={1}, Ausgabe={2}] Die Eingabedatei ist neuer als die Ausgabedatei. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - [{0}: Input={1}, Output={2}] Output file does not exist. - [{0}: Input={1}, Output={2}] 输出文件不存在。 - {0} is the name of an MSBuild item. {1} and {2} are filenames on disk. - - [{0}: Eingabe={1}, Ausgabe={2}] Die Ausgabedatei ist nicht vorhanden. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - [{0}: Input={1}, Output={2}] Input file does not exist. - [{0}: Input={1}, Output={2}] 输入文件不存在。 - {0} is the name of an MSBuild item. {1} and {2} are filenames on disk. - - [{0}: Eingabe={1}, Ausgabe={2}] Die Eingabedatei ist nicht vorhanden. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - The attribute "{0}" is a known MSBuild attribute, and cannot be accessed using this method. - 特性“{0}”是已知的 MSBuild 特性,不能使用此方法访问。 - - - Das {0}-Attribut ist ein bekanntes MSBuild-Attribut, auf das mithilfe dieser Methode nicht zugegriffen werden kann. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - Properties in persisted property groups cannot be accessed by name. - 不能通过名称访问保留的属性组中的属性。 - - - Auf Eigenschaften in persistenten Eigenschaftengruppen ist kein Zugriff über den Namen möglich. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4023: Cannot evaluate the item metadata "%({0})". {1} - MSB4023: 无法计算项元数据“%({0})”。{1} - {StrBegin="MSB4023: "}UE: This message is shown when the value of an item metadata cannot be computed for some reason e.g. trying to apply - %(RootDir) to an item-spec that's not a valid path, would result in this error. - LOCALIZATION: "{1}" is a localized message explaining the problem. - - MSB4023: Elementmetadaten "%({0})" können nicht ausgewertet werden. {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Cannot execute a task not associated with a project object. - 无法执行未与项目对象关联的任务。 - - - Eine Aufgabe, die keinem Projektobjekt zugeordnet ist, kann nicht ausgeführt werden. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - The cache entry has already been set to a different value and cannot be modified. - 缓存条目已被设置为其他值,并且无法修改。 - - - Der Cacheeintrag wurde bereits auf einen anderen Wert festgelegt und kann nicht geändert werden. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - The "{0}" property comes from an environment variable, and cannot be modified. - “{0}”属性来自环境变量,无法修改。 - - - Die {0}-Eigenschaft stammt aus einer Umgebungsvariablen und kann nicht geändert werden. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - The "{0}" property is a global property, and cannot be modified through an evaluated property group. Use "{1}" instead. - “{0}”属性是全局属性,无法通过计算的属性组修改。请改用“{1}”。 - - - Die {0}-Eigenschaft ist eine globale Eigenschaft und kann nicht über eine ausgewertete Eigenschaftengruppe geändert werden. Verwenden Sie stattdessen {1}. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - Modifying the XML of an imported project file is not allowed. Open that project file directly. - 不允许修改导入的项目文件的 XML。请直接打开该项目文件。 - - - Der XML-Code einer importierten Projektdatei darf nicht geändert werden. Öffnen Sie diese Projektdatei direkt. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB4117: The "{0}" item name is reserved, and cannot be used. - MSB4117: 项名称“{0}”是保留名称,不能使用。 - {StrBegin="MSB4117: "}UE: This message is shown when the user tries to redefine one of the reserved MSBuild items e.g. @(Choose) - - MSB4117: Der Elementname "{0}" ist reserviert und kann nicht verwendet werden. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4118: The "{0}" item metadata name is reserved, and cannot be used. - MSB4118: 项元数据名称“{0}”是保留名称,不能使用。 - {StrBegin="MSB4118: "}UE: This message is shown when the user tries to redefine one of the reserved MSBuild items e.g. @(Choose) - - MSB4118: Der Elementmetadatenname "{0}" ist reserviert und kann nicht verwendet werden. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4004: The "{0}" property is reserved, and cannot be modified. - MSB4004: “{0}”属性是保留属性,不能修改。 - {StrBegin="MSB4004: "}UE: This message is shown when the user tries to redefine one of the reserved MSBuild properties e.g. $(MSBuildProjectFile) - - MSB4004: Die {0}-Eigenschaft ist reserviert und kann nicht geändert werden. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4094: "{0}" is an invalid value for the "{1}" parameter of the "{3}" task. Multiple items cannot be passed into a parameter of type "{2}". - MSB4094: “{0}”对于“{3}”任务的“{1}”参数是无效值。不能将多个项传入“{2}”类型的参数。 - {StrBegin="MSB4094: "} - UE: This error is shown when a project tries to pass multiple items into a task parameter of type ITaskItem (singular). - - - MSB4094: "{0}" ist ein ungültiger Wert für den "{1}"-Parameter der "{3}"-Aufgabe. Mehrere Elemente können nicht in einen Parameter vom Typ "{2}" übergeben werden. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4115: The "{0}" function only accepts a scalar value, but its argument "{1}" evaluates to "{2}" which is not a scalar value. - MSB4115: 函数“{0}”只接受标量值,但其参数“{1}”的计算结果为“{2}”,不是标量值。 - {StrBegin="MSB4115: "} - UE: This error is shown when a project tries to pass multiple items into a function in a conditional expression, that can only accept a scalar value (such as the "exists()" function). - - - MSB4115: Die "{0}"-Funktion nimmt nur einen Skalarwert an, ihr "{1}"-Argument wird jedoch zu "{2}" ausgewertet, bei dem es sich nicht um einen Skalarwert handelt. - - fuzzyMatch="100" wordcount="22" adjWordcount="5.5" curWordcount="5.5" tmLabel="N''" - - - The task is currently associated with a project object, and should not be added to a different one. - 该任务当前已与某项目对象相关联,不应添加到其他项目对象中。 - - - Die Aufgabe ist derzeit einem Projektobjekt zugeordnet und sollte zu keinem anderen Projektobjekt hinzugefügt werden. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - MSB4095: The item metadata %({0}) is being referenced without an item name. Specify the item name by using %(itemname.{0}). - MSB4095: 引用项元数据 %({0}) 时未指定项名称。请使用 %(itemname.{0}) 指定项名称。 - {StrBegin="MSB4095: "} - - MSB4095: Auf die %({0})-Elementmetadaten wird ohne einen Elementnamen verwiesen. Geben Sie den Namen mithilfe von %(itemname.{0}) an. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - The task is not associated with the specified target element collection, and should not be removed from it. - 该任务未与指定的目标元素集合相关联,不应从该集合中移除。 - - - Die Aufgabe ist nicht der angegebenen Auflistung von Zielelementen zugeordnet und sollte nicht daraus entfernt werden. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - MSB4005: The current working directory could not be restored to {0}. {1} - MSB4005: 未能将当前工作目录还原到 {0}。{1} - {StrBegin="MSB4005: "}UE: This message is shown when the current working directory cannot be reset after a build. "{1}" contains a message explaining why. - LOCALIZATION: "{1}" is a message from an CLR/FX exception and is already localized. - - MSB4005: Das aktuelle Arbeitsverzeichnis konnte unter {0} nicht wiederhergestellt werden. {1} - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Cannot set a condition on an object not represented by an XML element in the project file. - 无法在未用项目文件中的 XML 元素表示的对象上设置条件。 - - - Eine Bedingung kann nicht für ein Objekt festgelegt werden, wenn das Objekt nicht von einem XML-Element in der Projektdatei repräsentiert wird. - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - Cannot set ContinueOnError on an object not represented by an XML element in the project file. - 在不是用项目文件中的 XML 元素表示的对象上不能设置 ContinueOnError。 - - - Das ContinueOnError-Attribut kann nicht für ein Objekt festgelegt werden, wenn das Objekt nicht von einem XML-Element in der Projektdatei repräsentiert wird. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB4134: DefaultToolsVersion cannot be set after a project has been loaded into the Engine. - MSB4134: 将项目加载到引擎中后,将无法设置 DefaultToolsVersion。 - {StrBegin="MSB4134: "} - - MSB4134: DefaultToolsVersion darf nicht festgelegt werden, nachdem ein Projekt in das Modul geladen wurde. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - Assigning the "{0}" attribute on an item that has been evaluated is not allowed. This operation is only allowed on the original persisted item that came directly from the project file. - 不允许对已计算的项指定“{0}”特性。只允许对直接来自项目文件的原始保留项执行此操作。 - - - Das {0}-Attribut darf nicht einem Element zugewiesen werden, das ausgewertet wurde. Dieser Vorgang ist nur für das ursprüngliche persistente Element zulässig, das direkt aus der Projektdatei stammt. - - fuzzyMatch="101" wordcount="31" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Assigning the "{0}" attribute of a virtual item is not allowed. - 不允许指定虚拟项的“{0}”特性。 - - - Das Zuweisen des {0}-Attributs eines virtuellen Elements ist nicht zulässig. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - A property cannot be set while building. - 不能在生成过程中设置属性。 - - - Eine Eigenschaft kann nicht während des Erstellens festgelegt werden. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - A property cannot be set to null. - 属性不能设置为 null。 - - - Eine Eigenschaft kann nicht auf NULL festgelegt werden. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Cannot get or set parameters on a task not associated with a project object. - 无法对未与项目对象关联的任务获取或设置参数。 - - - Parameter für eine Aufgabe können nicht abgefragt oder festgelegt werden, wenn die Aufgabe keinem Projektobjekt zugeordnet ist. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4162: <{0}> is not valid. Child elements are not allowed below a item remove element. - MSB4162: <{0}> 无效。item remove 元素下不允许有子元素。 - {StrBegin="MSB4162: "} - - MSB4162: <{0}> ist ungültig. Untergeordnete Elemente dürfen nicht unter einem Element Element entfernen. - - fuzzyMatch="15" wordcount="16" adjWordcount="13.6" curWordcount="13.6" - - - MSB4166: Child node "{0}" exited prematurely. Shutting down. - MSB4166: 子节点“{0}”过早退出。正在关闭。 - {StrBegin="MSB4166: "} - - MSB4166: Der untergeordnete Knoten "{0}" wurde vorzeitig beendet. Herunterfahren. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4085: A <Choose> must contain at least one <When>. - MSB4085: 一个 <Choose> 必须包含至少一个 <When>。 - {StrBegin="MSB4085: "} - - MSB4085: < auswählen > muss mindestens < Wenn >. - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB4114: <Choose> elements cannot be nested more than {0} levels deep. - MSB4114: <Choose> 元素的嵌套深度不能超过 {0} 层。 - {StrBegin="MSB4114: "}UE: This message appears if the project file contains unreasonably nested Choose elements. - LOCALIZATION: Do not localize "Choose" as it is an XML element name. - - MSB4114: < auswählen > Elemente können nicht geschachtelt werden mehr als {0} Ebenen. - - fuzzyMatch="15" wordcount="12" adjWordcount="10.2" curWordcount="10.2" - - - MSB4006: There is a circular dependency in the target dependency graph involving target "{0}". - MSB4006: 涉及目标“{0}”的目标依赖项关系图中存在循环依赖项。 - {StrBegin="MSB4006: "}UE: This message is shown when the build engine detects a target referenced in a circular manner -- a project cannot - request a target to build itself (perhaps via a chain of other targets). - - MSB4006: Im Zielabhängigkeitsdiagramm besteht eine Ringabhängigkeit im Zusammenhang mit dem Ziel "{0}". - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4086: A numeric comparison was attempted on "{1}" that evaluates to "{2}" instead of a number, in condition "{0}". - MSB4086: 尝试在条件“{0}”中对计算结果为“{2}”而不是数字的“{1}”进行数值比较。 - {StrBegin="MSB4086: "} - - MSB4086: Es wurde versucht, einen numerischen Vergleich für "{1}" auszuführen, der zu "{2}" anstatt zu einer Zahl in Bedingung "{0}" ausgewertet wird. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4007: The clause "{0}", specified in the "{1}" attribute is invalid. - MSB4007: 在特性“{1}”中指定的子句“{0}”无效。 - {StrBegin="MSB4007: "}UE: This message is shown when the Condition on an element is invalid in some way -- e.g. syntax error, unrecognized operator. - - MSB4007: Die im {1}-Attribut festgelegte {0}-Klausel ist ungültig. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4130: The condition "{0}" may have been evaluated incorrectly in an earlier version of MSBuild. Please verify that the order of the AND and OR clauses is written as intended. To avoid this warning, add parentheses to make the evaluation order explicit. - MSB4130: 在 MSBuild 的早期版本中,条件“{0}”的计算可能有误。请验证 AND 和 OR 子句的编写顺序是否与预期相符。若要避免此警告,请添加括号以使求值顺序清晰明确。 - {StrBegin="MSB4130: "} - - MSB4130: Die Bedingung "{0}" ist in einer früheren Version von MSBuild möglicherweise fehlerhaft ausgewertet worden. Stellen Sie sicher, dass die AND- und OR-Klauseln in der beabsichtigten Reihenfolge stehen. Damit diese Warnung nicht angezeigt wird, fügen Sie Klammern hinzu, um die Auswertungsreihenfolge explizit anzugeben. - - fuzzyMatch="101" wordcount="42" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4087: Specified condition "{0}" does not evaluate to a boolean. - MSB4087: 指定的条件“{0}”的计算结果不是布尔值。 - {StrBegin="MSB4087: "} - - MSB4087: Die angegebene {0}-Bedingung wird nicht zu einem booleschen Wert ausgewertet. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4113: Specified condition "{0}" evaluates to "{1}" instead of a boolean. - MSB4113: 指定条件“{0}”的计算结果为“{1}”而不是布尔值。 - {StrBegin="MSB4113: "} - - MSB4113: Die angegebene Bedingung {0} wird zu {1} statt zu einem booleschen Wert ausgewertet. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - {0}, line {1} - {0},第 {1} 行 - - - {0}, Zeile {1} - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - MSB4136: Error reading the toolset information from the configuration file "{0}". {1} - MSB4136: 从配置文件“{0}”中读取工具集信息时出错。{1} - {StrBegin="MSB4136: "} - - MSB4136: Fehler beim Lesen der Toolsetinformationen aus der Konfigurationsdatei "{0}". {1} - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4008: A conflicting assembly for the task assembly "{0}" has been found at "{1}". - MSB4008: 在“{1}”处发现了与任务程序集“{0}”冲突的程序集。 - {StrBegin="MSB4008: "}UE: This message is shown when the type/class of a task cannot be resolved uniquely from a single assembly. - - MSB4008: Eine mit der Aufgabenassembly "{0}" in Konflikt stehende Assembly wurde in "{1}" gefunden. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4142: MSBuildToolsPath is not the same as MSBuildBinPath for the ToolsVersion "{0}" defined at "{1}". If both are present they must have the same value. - MSB4142: MSBuildToolsPath 与 ToolsVersion“{0}”(在“{1}”处定义) 的 MSBuildBinPath 不同。如果两者都存在,它们的值必须相同。 - {StrBegin="MSB4142: "} - - MSB4142: MSBuildToolsPath ist nicht identisch mit MSBuildBinPath für die bei "{1}" definierte ToolsVersion {0}. Wenn beide Pfade vorhanden sind, müssen sie identische Werte haben. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4097: The element <{0}> beneath element <{1}> may not have a custom XML namespace. - MSB4097: 元素 <{1}> 下的元素 <{0}> 可能没有自定义 XML 命名空间。 - {StrBegin="MSB4097: "} - - MSB4097: Das Element <{0}> unter Element <{1}> möglicherweise keinen benutzerdefinierten XML-Namespace. - - fuzzyMatch="15" wordcount="16" adjWordcount="13.6" curWordcount="13.6" - - - MSB4009: The default tasks file could not be successfully loaded. {0} - MSB4009: 未能成功加载默认任务文件。{0} - {StrBegin="MSB4009: "}UE: This message is shown when one of the default tasks file (*.tasks) located alongside the MSBuild binaries cannot - be opened/parsed. "{0}" contains a message explaining why. The filename itself is not part of the message but is provided - separately to loggers. - LOCALIZATION: "{0}" is a message from some FX method and is already localized. - - MSB4009: Die Standardaufgabendatei konnte nicht geladen werden. {0} - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4010: The "{0}" files could not be successfully loaded from their expected location "{1}". Default tasks will not be available. {2} - MSB4010: 未能从预期位置“{1}”成功加载“{0}”文件。默认任务将不可用。{2} - {StrBegin="MSB4010: "}UE: This message is shown when the default tasks files that are located alongside the MSBuild binaries cannot be - found, either because they don't exist, or because of lack of permissions. "{2}" contains a message explaining why. - LOCALIZATION: "{2}" is a message from some FX method and is already localized. - - MSB4010: Die {0}-Dateien konnten nicht vom erwarteten Speicherplatz "{1}" geladen werden. Standardaufgaben sind nicht verfügbar. {2} - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - MSB4140: Default tools version is specified in neither the registry nor the configuration file. - MSB4140: 默认工具版本既不是在注册表中指定的,也不是在配置文件中指定的。 - {StrBegin="MSB4140: "} - - MSB4140: Die Standardtoolsversion ist weder in der Registrierung noch in der Konfigurationsdatei angegeben. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4133: A default tools version "{0}" was specified, but its definition could not be found. - MSB4133: 指定了默认工具版本“{0}”,但未能找到其定义。 - {StrBegin="MSB4133: "} - - MSB4133: Eine Standardtoolsversion "{0}" wurde angegeben, aber ihre Definition konnte nicht gefunden werden. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - MSB4080: The value "{0}" of the "PropertyName" attribute in element <Output> contains a "$" character. If you intended to use a property name then remove the $( ) around the property name. - MSB4080: 元素 <Output> 中的“PropertyName”特性的值“{0}”包含字符“$”。如果打算使用属性名称,请移除该属性名称两边的 $( )。 - {StrBegin="MSB4080: "}UE: This message is shown when an output tag has an property name that contains an $. They probably typed $(foo) instead of foo in the PropertyName. LOCALIZATION: Output and PropertyName should not be localized. - - MSB4080: Der Wert "{0}" "PropertyName-Attribut im Element < Output >"$"-Zeichen enthält. Wenn Sie auf einen Eigenschaftennamen verwenden und entfernen Sie anschließend die ($), um den Eigenschaftennamen. - - fuzzyMatch="15" wordcount="32" adjWordcount="27.2" curWordcount="27.2" - - - MSB4011: There is a circular reference involving the import of file "{0}". This file may have been imported more than once, or you may have attempted to import the main project file. All except the first instance of this file will be ignored. - MSB4011: 文件“{0}”的导入存在循环引用。此文件可能已被导入多次,或者您尝试导入的是主项目文件。此文件的第一个实例以外的所有实例都将被忽略。 - {StrBegin="MSB4011: "} - - MSB4011: Es besteht eine Ringabhängigkeit im Zusammenhang mit dem Import der Datei {0}. Diese Datei wurde unter Umständen mehrmals importiert, oder es wurde versucht, die Hauptprojektdatei zu importieren. Alle außer der ersten Instanz dieser Datei werden ignoriert. - - fuzzyMatch="101" wordcount="43" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4079: The <ProjectExtensions> element occurs more than once. - MSB4079: <ProjectExtensions> 元素出现多次。 - {StrBegin="MSB4079: "} - - MSB4079: Das Element < ProjectExtensions > tritt mehr als einmal. - - fuzzyMatch="15" wordcount="9" adjWordcount="7.65" curWordcount="7.65" - - - MSB4012: The expression "{0}" cannot be used in this context. Item lists cannot be concatenated with other strings where an item list is expected. Use a semicolon to separate multiple item lists. - MSB4012: 表达式“{0}”不能用在此上下文中。在应使用项列表的位置,项列表不能与其他字符串相串联。请使用分号来分隔多个项列表。 - {StrBegin="MSB4012: "}UE: This message is shown when the user does not properly specify an item list when an item list is expected - e.g. "badprefix@(foo)badsuffix" instead of "prefix; @(foo); suffix" - - MSB4012: Der Ausdruck {0} kann in diesem Kontext nicht verwendet werden. Elementlisten können nicht mit anderen Zeichenfolgen verkettet werden, wenn eine Elementliste erwartet wird. Verwenden Sie ein Semikolon, um mehrere Elementlisten voneinander zu trennen. - - fuzzyMatch="101" wordcount="32" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Need to specify the project file name. - 需要指定项目文件名。 - UE: This message is shown when the user calls into the engine to build a project without specifying a filename. - - Geben Sie den Projektdateinamen an. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - end of input - 输入结束 - This is the name of the "EndOfInput" token. It is displayed in quotes as the - unexpected char or token when the end of a conditional was unexpectedly reached. - - Ende der Eingabe - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - The previous error was converted to a warning because the task was called with ContinueOnError=true. - 上一错误已转换为警告,因为调用任务时指定了 ContinueOnError=true。 - - - Der vorherige Fehler wurde in eine Warnung umgewandelt, da die Aufgabe mit ContinueOnError=true aufgerufen wurde. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - {0} Error(s) - {0} 个错误 - - - {0} Fehler - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4159: Error creating the toolset "{0}". {1} - MSB4159: 创建工具集“{0}”时出错。{1} - {StrBegin="MSB4159: "} - - MSB4159: Fehler beim Erstellen des Toolsets "{0}". {1} - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4146: Cannot evaluate the property expression "{0}" found at "{1}". {2} - MSB4146: 无法计算“{1}”处的属性表达式“{0}”的值。{2} - {StrBegin="MSB4146: "} - - MSB4146: Der bei "{1}" gefundene Eigenschaftsausdruck "{0}" kann nicht ausgewertet werden. {2} - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - The <{0}> tag is no longer supported as a child of the <Project> element. Place this tag within a target, and add the name of the target to the "InitialTargets" attribute of the <Project> element. - 不再支持将 <{0}> 标记作为 <Project> 元素的子元素。请将此标记放在某个目标中,然后向 <Project> 元素的“InitialTargets”特性中添加该目标的名称。 - - - Das <{0}>-Tag nicht als untergeordnetes Element des < Project >-Elements unterstützt. Platzieren Sie dieses Tag in einem Ziel und fügen Sie den Namen des Ziels InitialTargets-Attribut des < Project >-Elements hinzu. - - fuzzyMatch="15" wordcount="38" adjWordcount="32.3" curWordcount="32.3" - - - MSB4100: Expected "{0}" to evaluate to a boolean instead of "{1}", in condition "{2}". - MSB4100: 在条件“{2}”中,“{0}”的计算结果应为布尔值而不是“{1}”。 - {StrBegin="MSB4100: "} - - MSB4100: Das Ergebnis der Auswertung von {0} war {1}, es wurde jedoch ein boolescher Wert in der {2}-Bedingung erwartet. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4028: The "{0}" task's outputs could not be retrieved from the "{1}" parameter. {2} - MSB4028: 未能从“{1}”参数中检索到“{0}”任务的输出。{2} - {StrBegin="MSB4028: "} - - MSB4028: Die Ausgaben der {0}-Aufgabe konnten nicht aus dem {1}-Parameter abgerufen werden. {2} - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4014: The build was aborted because of an internal failure. - MSB4014: 由于发生内部错误,已中止生成。 - {StrBegin="MSB4014: "}UE: This message is shown when an unhandled exception terminates the build. The cause is most likely a programming - error in the build engine. - - MSB4014: Das Erstellen wurde aufgrund eines internen Fehlers abgebrochen. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4015: The build was aborted because the "{0}" logger failed unexpectedly during shutdown. - MSB4015: 由于“{0}”记录器在关闭过程中意外失败,已中止生成。 - {StrBegin="MSB4015: "}UE: This message is used for a special exception that is thrown when a logger fails while shutting down (most likely - because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a special - exception to abort the build. - - MSB4015: Das Erstellen wurde abgebrochen, da für die {0}-Protokollierung beim Herunterfahren ein unerwarteter Fehler aufgetreten ist. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4016: The build was aborted because the "{0}" logger failed unexpectedly during initialization. - MSB4016: 由于“{0}”记录器在初始化过程中意外失败,已中止生成。 - {StrBegin="MSB4016: "}UE: This message is used for a special exception that is thrown when a logger fails while initializing itself (most - likely because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a - special exception to abort the build. - - MSB4016: Das Erstellen wurde abgebrochen, da für die {0}-Protokollierung bei der Initialisierung ein unerwarteter Fehler aufgetreten ist. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4017: The build was aborted because of an unexpected logger failure. - MSB4017: 由于发生意外的记录器错误,已中止生成。 - {StrBegin="MSB4017: "}UE: This message is used for a special exception that is thrown when a logger fails while logging an event (most - likely because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a - special exception to abort the build. - - MSB4017: Das Erstellen wurde wegen eines unerwarteten Protokollierungsfehlers abgebrochen. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4018: The "{0}" task failed unexpectedly. - MSB4018: “{0}”任务意外失败。 - {StrBegin="MSB4018: "}UE: This message is shown when a task terminates because of an unhandled exception. The cause is most likely a - programming error in the task; however, it is also possible that the unhandled exception originated in the engine, and was - surfaced through the task when the task called into the engine. - - MSB4018: Unerwarteter Fehler bei der {0}-Aufgabe. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4165: Failed to receive a response from the child node "{0}" in the timeout period "{1}" ms. Shutting down. - MSB4165: 未能在超时期限“{1}”毫秒内收到来自子节点“{0}”的响应。正在关闭。 - {StrBegin="MSB4165: "} - - MSB4165: Vom untergeordneten Knoten "{0}" wurde innerhalb des Zeitlimits von "{1}" ms keine Antwort empfangen. Herunterfahren. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4088: Condition "{0}" is improperly constructed. - MSB4088: 条件“{0}”的构造不正确。 - {StrBegin="MSB4088: "} - - MSB4088: Die {0}-Bedingung ist falsch konstruiert. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4105: Found an unexpected character '{2}' at position {1} in condition "{0}". Did you intend to use "=="? - MSB4105: 在条件“{0}”中的位置 {1} 处发现意外字符“{2}”。是否希望使用“==”? - {StrBegin="MSB4105: "} - - MSB4105: Ein unerwartetes Zeichen {2} wurde an Position {1} in der {0}-Bedingung gefunden. Wollten Sie "==" verwenden? - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - MSB4106: Expected an item list at position {1} in condition "{0}". Did you forget the closing parenthesis? - MSB4106: 条件“{0}”中的位置 {1} 处应为项列表。是否忘记了右括号? - {StrBegin="MSB4106: "} - - MSB4106: Eine Elementliste wurde an Position {1} in Bedingung {0} erwartet. Haben Sie die schließende Klammer vergessen? - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - MSB4107: Expected an item list at position {1} in condition "{0}". Did you forget the opening parenthesis after the '@'? To use a literal '@', use '%40' instead. - MSB4107: 条件“{0}”中的位置 {1} 处应为项列表。是否忘记了“@”后面的左括号?若要使用“@”,请改用“%40”。 - {StrBegin="MSB4107: "} - - MSB4107: Eine Elementliste wurde an Position {1} in Bedingung {0} erwartet. Haben Sie die öffnende Klammer hinter dem Zeichen "@" vergessen? Wenn Sie ein literales "@" verwenden möchten, geben Sie "%40" ein. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4108: Expected an item list at position {1} in condition "{0}". Did you forget to close a quote inside the item list expression? - MSB4108: 条件“{0}”中的位置 {1} 处应为项列表。是否忘记了项列表表达式内的右引号? - {StrBegin="MSB4108: "} - - MSB4108: Eine Elementliste wurde an Position {1} in Bedingung {0} erwartet. Haben Sie das schließende Anführungszeichen innerhalb des Elementlistenausdrucks vergessen? - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - MSB4109: Expected a property at position {1} in condition "{0}". Did you forget the closing parenthesis? - MSB4109: 条件“{0}”中的位置 {1} 处应为属性。是否忘记了右括号? - {StrBegin="MSB4109: "} - - MSB4109: Eine Eigenschaft wurde an Position {1} in Bedingung {0} erwartet. Haben Sie die schließende Klammer vergessen? - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB4110: Expected a property at position {1} in condition "{0}". Did you forget the opening parenthesis after the '$'? To use a literal '$', use '%24' instead. - MSB4110: 条件“{0}”中的位置 {1} 处应为属性。是否忘记了“$”后面的左括号?若要使用“$”,请改用“%24”。 - {StrBegin="MSB4110: "} - - MSB4110: Eine Eigenschaft wurde an Position {1} in Bedingung {0} erwartet. Haben Sie die öffnende Klammer hinter dem Zeichen "$" vergessen? Wenn Sie eine literales "$" verwenden möchten, geben Sie "%24" ein. - - fuzzyMatch="101" wordcount="27" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4101: Expected a closing quote after position {1} in condition "{0}". - MSB4101: 条件“{0}”中的位置 {1} 后面应为右引号。 - {StrBegin="MSB4101: "} - - MSB4101: Es wurde ein schließendes Anführungszeichen hinter Position {1} in Bedingung {0} erwartet. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4019: The imported project "{0}" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. - MSB4019: 未找到导入的项目“{0}”。请确认 <Import> 声明中的路径正确,且磁盘上存在该文件。 - {StrBegin="MSB4019: "}LOCALIZATION: <Import> should not be localized. - - MSB4019: Das importierte Projekt "{0}" wurde nicht gefunden. Bestätigen Sie den Pfad in der Deklaration < Import > und die Datei auf dem Datenträger vorhanden ist. - - fuzzyMatch="15" wordcount="26" adjWordcount="22.1" curWordcount="22.1" - - - MSB4089: Incorrect number of arguments to function in condition "{0}". Found {1} argument(s) when expecting {2}. - MSB4089: 条件“{0}”中的函数参数数目不正确。应为 {2} 个,但找到 {1} 个。 - {StrBegin="MSB4089: "} - - MSB4089: Falsche Anzahl von Argumenten für eine Funktion in der Bedingung "{0}". {1} Argument(e) gefunden, obwohl {2} erwartet wurde(n). - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - The "{0}" object specified does not belong to the correct "{1}" object. - 指定的“{0}”对象不属于正确的“{1}”对象。 - - - Das angegebene {0}-Objekt gehört nicht zum korrekten {1}-Objekt. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4020: The value "{0}" of the "{1}" attribute in element <{2}> is invalid. - MSB4020: 元素 <{2}> 中“{1}”特性的值“{0}”无效。 - {StrBegin="MSB4020: "}UE: This is a generic message that is displayed when we find a project element with an incorrect value for one of its - attributes e.g. <Import Project=""> -- the value of Project should not be an empty string. - - MSB4020: Der Wert "{0}" von der "{1}" Attribut im Element <{2}> ist ungültig. - - fuzzyMatch="15" wordcount="14" adjWordcount="11.9" curWordcount="11.9" - - - MSB4102: The value "{0}" of the "{1}" attribute in element <{2}> is invalid. {3} - MSB4102: 元素 <{2}> 中“{1}”特性的值“{0}”无效。{3} - {StrBegin="MSB4102: "}UE: This is a generic message that is displayed when we find a project element with an incorrect value for one of its - attributes. At the end of the message we show the exception text we got trying to use the value. - - MSB4102: Der Wert "{0}" von der "{1}" Attribut im Element <{2}> ist ungültig. {3} - - fuzzyMatch="15" wordcount="15" adjWordcount="12.75" curWordcount="12.75" - - - MSB4021: The "ContinueOnError" attribute of the "{0}" task is not valid. {1} - MSB4021: “{0}”任务的“ContinueOnError”特性无效。{1} - {StrBegin="MSB4021: "}LOCALIZATION: "ContinueOnError" should not be localized. "{1}" is a message from another exception explaining the problem. - - MSB4021: Das ContinueOnError-Attribut für die {0}-Aufgabe ist ungültig. {1} - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4139: Invalid value for default ToolsVersion is specified in registry key "{0}". - MSB4139: 在注册表项“{0}”中指定的默认 ToolsVersion 值无效。 - {StrBegin="MSB4139: "} - - MSB4139: Im Registrierungsschlüssel "{0}" ist ein ungültiger Wert für die Standard-ToolsVersion angegeben. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4022: The result "{0}" of evaluating the value "{1}" of the "{2}" attribute in element <{3}> is not valid. - MSB4022: 元素 <{3}> 中“{2}”特性的值“{1}”的计算结果“{0}”无效。 - {StrBegin="MSB4022: "}UE: This message is shown when the engine is checking the correctness of the value (after evaluating embedded - properties/items) assigned to an XML attribute of an XML element in the project file. - - MSB4022: Das Ergebnis "{0}"der Auswertung des Werts"{1}" von der "{2}" Attribut im Element <{3}> ist ungültig. - - fuzzyMatch="15" wordcount="20" adjWordcount="17" curWordcount="17" - - - "{0}" is not a valid event category. To raise a custom event, use the "{1}" category. - “{0}”不是有效的事件类别。若要引发自定义事件,请使用“{1}”类别。 - - - {0} ist keine gültige Ereigniskategorie. Verwenden Sie die {1}-Kategorie, um ein benutzerdefiniertes Ereignis auszulösen. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - "{0}" is not a valid importance level for events. - “{0}”不是事件的有效重要性级别。 - - - {0} ist kein gültiger Wert für die Bedeutung eines Ereignisses. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4104: Failed to write to log file "{0}". {1} - MSB4104: 未能写入日志文件“{0}”。{1} - {StrBegin="MSB4104: "}UE: This is shown when the File Logger can't create or write to the file it was instructed to log to. - - MSB4104: Fehler beim Schreiben in die Protokollierungsdatei "{0}". {1} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4024: The imported project file could not be loaded. {0} - MSB4024: 未能加载导入的项目文件。{0} - {StrBegin="MSB4024: "}UE: This message is shown when an imported project file cannot be loaded because of incorrect XML. The project - filename is not part of the message because it is provided separately to loggers. - LOCALIZATION: {0} is a localized message from the CLR/FX explaining why the project is invalid. - - MSB4024: Die importierte Projektdatei konnte nicht geladen werden. {0} - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - Operation invalid for a persisted item group. - 操作对于保留的项组无效。 - - - Ungültiger Vorgang für eine persistente Elementgruppe. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Operation invalid for a virtual item group. - 操作对于虚拟项组无效。 - - - Ungültiger Vorgang für eine virtuelle Elementgruppe. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4071: The value Importance="{0}" in the <Message> element is invalid. Valid values are: High, Normal and Low. - MSB4071: <Message> 元素中的值 Importance="{0}" 无效。有效值有: High、Normal 和 Low。 - {StrBegin="MSB4071: "}UE: This message is shown when a user specifies a value for the importance attribute of Message which is not valid. - The importance enumeration is: High, Normal and Low. Specifying any other importance will result in this message being shown - LOCALIZATION: "Importance" should not be localized. - "Message" should not be localized. - High should not be localized. - Normal should not be localized. - Low should not be localized. - - MSB4071: Der Wert Importance = "{0}" in < Nachricht > Element ist ungültig. Gültige Werte sind: hoch, Normal und niedrig. - - fuzzyMatch="15" wordcount="18" adjWordcount="15.3" curWordcount="15.3" - - - MSB4025: The project file could not be loaded. {0} - MSB4025: 未能加载项目文件。{0} - {StrBegin="MSB4025: "}UE: This message is shown when the project file given to the engine cannot be loaded because the filename/path is - invalid, or due to lack of permissions, or incorrect XML. The project filename is not part of the message because it is - provided separately to loggers. - LOCALIZATION: {0} is a localized message from the CLR/FX explaining why the project is invalid. - - MSB4025: Die Projektdatei konnte nicht geladen werden. {0} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4147: The property "{0}" at "{1}" is invalid. {2} - MSB4147: “{1}”处的属性“{0}”无效。{2} - {StrBegin="MSB4147: "} - - MSB4147: Die {0}-Eigenschaft bei "{1}" ist ungültig. {2} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - "{0}" is an invalid "ProjectFileEncoding" value. - “{0}”为无效的“ProjectFileEncoding”值。 - LOCALIZATION: "ProjectFileEncoding" should not be localized. - - {0} ist ein ungültiger ProjectFileEncoding-Wert. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4143: The expression "{0}" cannot be evaluated. {1} - MSB4143: 无法计算表达式“{0}”的值。{1} - {StrBegin="MSB4143: "} - UE: This message is shown when the user attempts to provide an expression like "$(Registry:HKEY_LOCAL_MACHINE\Software\Vendor\Tools@TaskLocation)" - LOCALIZATION: "{0}" is the expression that was bad. "{1}" is a message from an FX exception that describes why the expression is bad. - - - MSB4143: Der Ausdruck "{0}" kann nicht ausgewertet werden. {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4184: The expression "{0}" cannot be evaluated. {1} - MSB4184: 无法计算表达式“{0}”。{1} - {StrBegin="MSB4184: "} - Single quotes as the expression will typically have double quotes in it. - UE: This message is shown when the user attempts to provide an expression like "$(SomeProperty.ToLower())" - LOCALIZATION: "{0}" is the expression that was bad. "{1}" is a message from an FX exception that describes why the expression is bad. - - - MSB4184: Der Ausdruck "{0}" kann nicht ausgewertet werden. {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4185: The function "{0}" on type "{1}" has not been enabled for execution. - MSB4185: 类型“{1}”上的函数“{0}”尚未启用,无法执行。 - {StrBegin="MSB4185: "} - UE: This message is shown when the user attempts to provide an expression like "$([System.DateTime]::Now)", but the expression has not been enabled - LOCALIZATION: "{0}" is the static function name, "{1}" is the .NET Framework type name - - - MSB4185: Die {0}-Funktion für den {1}-Typ wurde nicht für die Ausführung aktiviert. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4186: Invalid static method invocation syntax: "{0}". Static method invocation should be of the form: $([FullTypeName]::Method()), e.g. $([System.IO.Path]::Combine(`a`, `b`)) - MSB4186: 静态方法调用语法“{0}”无效。静态方法调用应采用以下形式:$([FullTypeName]::Method()),例如 $([System.IO.Path]::Combine(`a`, `b`)) - {StrBegin="MSB4186: "} - UE: This message is shown when the user attempts to call a static method on a type, but has used the incorrect syntax - LOCALIZATION: "{0}" is the function expression which is in error - - - MSB4186: Ungültige Aufrufsyntax für statische Methode: "{0}". Für den Aufruf statischer Methoden muss folgendes Format verwendet werden: $([vollständiger Typname]::Methode()), z. B. $([System.IO.Path]::Combine(`a`, `b`)) - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4070: The schema "{0}" is not valid. {1} - MSB4070: 架构“{0}”无效。{1} - {StrBegin="MSB4070: "}UE: This message is shown when the schema file provided for the validation of a project is itself not valid. - LOCALIZATION: "{0}" is the schema file path. "{1}" is a message from an FX exception that describes why the schema file is bad. - - MSB4070: Das Schema "{0}" ist nicht gültig. {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4026: The "{0}={1}" parameter for the "{2}" task is invalid. - MSB4026: “{2}”任务的“{0}={1}”参数无效。 - {StrBegin="MSB4026: "}UE: This message is displayed when a task has an invalid parameter that cannot be initialized. - - MSB4026: Der {0}={1}-Parameter für die {2}-Aufgabe ist ungültig. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4027: The "{0}" task generated invalid items from the "{1}" output parameter. {2} - MSB4027: “{0}”任务从“{1}”输出参数生成了无效项。{2} - {StrBegin="MSB4027: "} - - MSB4027: Die {0}-Aufgabe generierte ungültige Elemente aus dem {1}-Ausgabeparameter. {2} - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4029: The "{0}" task has an invalid output specification. The "TaskParameter" attribute is required, and either the "ItemName" or "PropertyName" attribute must be specified (but not both). - MSB4029: “{0}”任务包含无效的输出规范。“TaskParameter”特性是必需的,并且必须指定“ItemName”或“PropertyName”特性(但不能同时指定二者)。 - {StrBegin="MSB4029: "}LOCALIZATION: "TaskParameter", "ItemName" and "PropertyName" should not be localized. - - MSB4029: Die {0}-Aufgabe enthält eine ungültige Ausgabespezifikation. Das TaskParameter-Attribut ist erforderlich, und es muss entweder das ItemName- oder PropertyName-Attribut angegeben werden (jedoch nicht beide). - - fuzzyMatch="101" wordcount="27" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4030: "{0}" is an invalid value for the "{1}" parameter of the "{3}" task. The "{1}" parameter is of type "{2}". - MSB4030: “{0}”对于“{3}”任务的“{1}”参数是无效值。“{1}”参数的类型为“{2}”。 - {StrBegin="MSB4030: "}UE: This error is shown when a type mis-match occurs between the value assigned to task parameter in the project file - and the type of the .NET property that corresponds to the task parameter. For example, if an int task parameter called "Count" - is assigned the value "x", this error would be displayed: <MyTask Count="x" /> - - MSB4030: "{0}" ist ein ungültiger Wert für den {1}-Parameter der {3}-Aufgabe. Der {1}-Parameter ist vom Typ "{2}". - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - MSB4137: Invalid value specified in the configuration file at "{0}". Property name or tools version name is an empty string. - MSB4137: 在配置文件的“{0}”处指定的值无效。属性名或工具版本名称为空字符串。 - {StrBegin="MSB4137: "} - - MSB4137: In der Konfigurationsdatei ist bei "{0}" ein ungültiger Wert angegeben. Der Eigenschaftenname oder der Toolsversionname ist eine leere Zeichenfolge. - - fuzzyMatch="100" wordcount="20" adjWordcount="5" curWordcount="5" tmLabel="N''" - - - MSB4103: "{0}" is not a valid logger verbosity level. - MSB4103: "{0}" 不是有效的记录器详细程度。 - {StrBegin="MSB4103: "} - - MSB4103: "{0}" ist kein gültiger Ausführlichkeitsgrad für die Protokollierung. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4163: <ItemDefinitionGroup> is not allowed inside a target. - MSB4163: 目标内部不允许有 <ItemDefinitionGroup>。 - {StrBegin="MSB4163: "} - - MSB4163: < ItemDefinitionGroup > ist in einem Ziel nicht zulässig. - - fuzzyMatch="15" wordcount="9" adjWordcount="7.65" curWordcount="7.65" - - - The specified item does not belong to the current item group. - 指定项不属于当前项组。 - - - Das angegebene Element gehört nicht zu der aktuellen Elementgruppe. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4096: The item "{0}" in item list "{1}" does not define a value for metadata "{2}". In order to use this metadata, either qualify it by specifying %({1}.{2}), or ensure that all items in this list define a value for this metadata. - MSB4096: 项列表“{1}”中的项“{0}”没有定义元数据“{2}”的值。要使用此元数据,请通过指定 %({1}.{2}) 来限定它,或确保此列表中的所有项都为此元数据定义了一个值。 - {StrBegin="MSB4096: "} - - MSB4096: Das Element "{0}" in der Elementliste "{1}" definiert keinen Wert für die {2}-Metadaten. Wenn Sie diese Metadaten verwenden möchten, qualifizieren Sie sie, indem Sie %({1}.{2}) angeben, oder vergewissern Sie sich, dass alle Elemente in der Liste einen Wert für diese Metadaten definieren. - - fuzzyMatch="101" wordcount="42" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4099: A reference to an item list at position {1} is not allowed in this condition "{0}". - MSB4099: 在条件“{0}”中,不允许存在对位置 {1} 处的项列表的引用。 - {StrBegin="MSB4099: "} - - MSB4099: Ein Verweis auf eine Elementliste an Position {1} ist in dieser {0}-Bedingung nicht zulässig. - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - MSB4033: "{0}" is a reserved item metadata, and cannot be redefined as a custom metadata on the item. - MSB4033: “{0}”是保留的项元数据,不能重新定义为该项的自定义元数据。 - {StrBegin="MSB4033: "} - - MSB4033: "{0}" sind reservierte Elementmetadaten und können nicht als benutzerdefinierte Metadaten für das Element neu definiert werden. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - An InternalLoggerException can only be thrown by the MSBuild engine. The public constructors of this class cannot be used to create an instance of the exception. - InternalLoggerException 只能由 MSBuild 引擎引发。不能使用此类的公共构造函数创建该异常的实例。 - UE: This message is shown when a user tries to instantiate a special exception called InternalLoggerException through the OM -- - only the engine is allowed to create and throw this exception. - LOCALIZATION: "InternalLoggerException" and "MSBuild" should not be localized. - - Eine InternalLoggerException kann nur durch das MSBuild-Modul ausgelöst werden. Die öffentlichen Konstruktoren dieser Klasse können nicht verwendet werden, um eine Instanz der Ausnahme zu erstellen. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Initial Items: - 初始项: - - - Ursprüngliche Elemente: - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4083: Expected a Condition attribute on element "{0}". - MSB4083: 元素“{0}”上需要 Condition 特性。 - {StrBegin="MSB4083: "} - - MSB4083: Es wurde ein Bedingungsattribut für das {0}-Element erwartet. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4164: The value "{0}" of metadata "{1}" contains an item list expression. Item list expressions are not allowed on default metadata values. - MSB4164: 元数据“{1}”的值“{0}”包含一个项列表表达式。默认元数据值不能包含项列表表达式。 - {StrBegin="MSB4164: "} - - MSB4164: Der Wert "{0}" der {1}-Metadaten enthält einen Elementlistenausdruck. Elementlistenausdrücke sind nicht als Standardwerte für Metadaten zulässig. - - fuzzyMatch="100" wordcount="22" adjWordcount="5.5" curWordcount="5.5" tmLabel="N''" - - - MSBuild is expecting a valid "{0}" object. - MSBuild 需要有效的“{0}”对象。 - - - MSBuild erwartet ein gültiges {0}-Objekt. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4035: The required attribute "{0}" is missing from element <{1}>. - MSB4035: 元素 <{1}> 中缺少必需的特性“{0}”。 - {StrBegin="MSB4035: "}UE: This message is shown when a user leaves off a required attribute from a project element - e.g. <UsingTask AssemblyName="foo"> -- this is missing the "TaskName" attribute. - - MSB4035: Das erforderliche Attribut "{0}"-Element fehlt <{1}>. - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB4036: The "{0}" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "{1}" directory. - MSB4036: 未找到“{0}”任务。请检查下列各项: 1.) 项目文件中的任务名称与任务类的名称相同。2.) 任务类为“public”且实现 Microsoft.Build.Framework.ITask 接口。3.) 在项目文件中或位于“{1}”目录的 *.tasks 文件中使用 <UsingTask> 正确声明了该任务。 - {StrBegin="MSB4036: "}LOCALIZATION: <UsingTask> and "*.tasks" should not be localized. - - MSB4036: Die "{0}" Task wurde nicht gefunden. Überprüfen Sie Folgendes: 1.) der Name der Aufgabe in der Projektdatei entspricht dem Namen der Aufgabenklasse. 2) die Aufgabenklasse ist "public" und implementiert die Microsoft.Build.Framework.ITask-Schnittstelle. 3) die Aufgabe korrekt mit < UsingTask > deklariert, in der Projektdatei oder in den Tasks-Dateien der "{1}" Verzeichnis. - - fuzzyMatch="15" wordcount="64" adjWordcount="54.4" curWordcount="54.4" - - - MSB4141: MSBuildToolsPath is not specified for the ToolsVersion "{0}" defined at "{1}", or the value specified evaluates to the empty string. - MSB4141: 没有为 ToolsVersion“{0}”(在“{1}”处定义)指定 MSBuildToolsPath,或者指定值的计算结果为空字符串。 - {StrBegin="MSB4141: "} - - MSB4141: MSBuildToolsPath ist für die bei "{1}" definierte ToolsVersion {0} nicht angegeben, oder der angegebene Wert wird zu einer leeren Zeichenfolge ausgewertet. - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - MSB4031: The "MSBuildVersion" attribute is deprecated. If the project is authored in the MSBuild 2003 format, please remove the attribute from the <Project> tag. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format. - MSB4031: 已否决“MSBuildVersion”特性。如果项目是用 MSBuild 2003 格式编写的,请从 <Project> 标记中移除该特性。如果项目是用旧的 1.0 或 1.2 格式编写的,请将它转换为 MSBuild 2003 格式。 - {StrBegin="MSB4031: "}UE: This message is shown for projects that still contain the "MSBuildVersion" attribute in their <Project> - tag. We no longer need this attribute because the project's XML namespace (i.e. the "xmlns" attribute) gives us all the - version information we need. - LOCALIZATION: "MSBuild", "MSBuildVersion" and <Project> should not be localized. - - MSB4031: Das Attribut "MSBuildVersion" ist veraltet. Wenn das Projekt im Format MSBuild 2003 erstellt wurde, entfernen Sie das Attribut aus dem Tag < Project >. Wenn das Projekt im alten Format 1.0 oder 1.2 erstellt wurde, konvertieren Sie es in das MSBuild 2003-Format. - - fuzzyMatch="15" wordcount="45" adjWordcount="38.25" curWordcount="38.25" - - - MSB4144: Multiple definitions were found for the toolset "{0}". - MSB4144: 找到了工具集“{0}”的多个定义。 - {StrBegin="MSB4144: "} - - MSB4144: Für das Toolset wurden mehrere Definitionen gefunden "{0}". - - fuzzyMatch="15" wordcount="9" adjWordcount="7.65" curWordcount="7.65" - - - MSB4145: Multiple definitions were found for the property "{0}". - MSB4145: 找到了属性“{0}”的多个定义。 - {StrBegin="MSB4145: "} - - MSB4145: Für die {0}-Eigenschaft wurden mehrere Definitionen gefunden. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4082: Choose has more than one <Otherwise> element. - MSB4082: Choose 包含多个 <Otherwise> 元素。 - {StrBegin="MSB4082: "} - - MSB4082: Wählen Sie mehrere < Otherwise >-Element enthält. - - fuzzyMatch="15" wordcount="9" adjWordcount="7.65" curWordcount="7.65" - - - This method is only valid for persisted <{0}> elements. - 此方法仅对保留的 <{0}> 元素有效。 - - - Diese Methode ist nur gültig für beibehalten <{0}> Elemente. - - fuzzyMatch="15" wordcount="10" adjWordcount="8.5" curWordcount="8.5" - - - This method is only valid for virtual property groups, not <{0}> elements. - 此方法只对虚拟属性组有效,对 <{0}> 元素无效。 - - - Diese Methode gilt nur für virtuelle Eigenschaftengruppen nicht <{0}> Elemente. - - fuzzyMatch="15" wordcount="13" adjWordcount="11.05" curWordcount="11.05" - - - MSB4038: The element <{0}> must be last under element <{1}>. Found element <{2}> instead. - MSB4038: 元素 <{0}> 必须是元素 <{1}> 下的最后一个元素。但找到的是元素 <{2}>。 - {StrBegin="MSB4038: "} - - MSB4038: Das Element <{0}> muss unter Element <{1}>. Element wurde gefunden <{2}> statt. - - fuzzyMatch="15" wordcount="17" adjWordcount="14.45" curWordcount="14.45" - - - MSB4138: Non-string data was specified at the registry location "{0}". - MSB4138: 在注册表位置“{0}”处指定了非字符串数据。 - {StrBegin="MSB4138: "} - - MSB4138: Am Registrierungsspeicherort "{0}" wurden Daten angegeben, die keine Zeichenfolge sind. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4039: No "{0}" element was found in the project file. - MSB4039: 未在项目文件中找到任何“{0}”元素。 - {StrBegin="MSB4039: "} - - MSB4039: Das {0}-Element wurde in der Projektdatei nicht gefunden. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4040: There is no target in the project. - MSB4040: 项目中无任何目标。 - {StrBegin="MSB4040: "} - - MSB4040: Das Projekt enthält kein Ziel. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Removing the "{0}" attribute of an item is not allowed. - 不允许移除项的“{0}”特性。 - - - Das Löschen des {0}-Attributs eines Elements ist nicht zulässig. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - The object passed in is not part of the project. - 传入的对象不属于该项目。 - - - Das übergebene Objekt ist nicht Teil des Projekts. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - Overriding target "{0}" in project "{1}" with target "{2}" from project "{3}". - 正在使用项目“{3}”中的目标“{2}”重写项目“{1}”中的目标“{0}”。 - - - Das Ziel "{0}" im Projekt "{1}" wird durch das Ziel "{2}" aus dem Projekt "{3}" außer Kraft gesetzt. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4167: The parent process unexpectedly exited. Shutting down child node "{0}". - MSB4167: 父进程意外退出。正在关闭子节点“{0}”。 - {StrBegin="MSB4167: "} - - MSB4167: Der übergeordnete Prozess wurde unerwartet beendet. Der untergeordnete Knoten "{0}" wird heruntergefahren. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - {0} ms {1} {2} calls - {0} 毫秒 {1} {2} 次调用 - - - {0} ms {1} {2} Aufrufe - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - (* = timing was not recorded because of reentrancy) - (* = 由于重新进入而未记录执行时间) - - - (* = Zeit wurde aufgrund des erneuten Eintretens nicht aufgezeichnet) - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - This project object has been unloaded from the MSBuild engine and is no longer valid. - 此项目对象已从 MSBuild 引擎卸载,因此不再有效。 - - - Dieses Projektobjekt wurde aus dem MSBuild-Modul entladen und ist nicht mehr gültig. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - The project file "{0}" was not found. - 未找到项目文件“{0}”。 - UE: This message is shown when the user calls into the OM to build a project that doesn't exist on disk. - - Die Projektdatei "{0}" wurde nicht gefunden. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Done building project "{0}" -- FAILED. - 已完成生成项目“{0}”的操作 - 失败。 - - - Die Erstellung des Projekts "{0}" ist abgeschlossen – FEHLER. - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Done building project "{0}". - 已完成生成项目“{0}”的操作。 - - - Die Erstellung des Projekts "{0}" ist abgeschlossen. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - MSB4041: The default XML namespace of the project must be the MSBuild XML namespace. If the project is authored in the MSBuild 2003 format, please add xmlns="{0}" to the <Project> element. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format. - MSB4041: 项目的默认 XML 命名空间必须为 MSBuild XML 命名空间。如果项目是用 MSBuild 2003 格式创建的,请将 xmlns="{0}" 添加到 <Project> 元素中。如果项目是用旧的 1.0 或 1.2 格式创建的,请将其转换为 MSBuild 2003 格式。 - {StrBegin="MSB4041: "}UE: This is a Beta 1 message only. - LOCALIZATION: <Project>, "MSBuild" and "xmlns" should not be localized. - - MSB4041: Der XML-Standardnamespace des Projekts muss MSBuild XML-Namespace. Wenn das Projekt im Format MSBuild 2003 erstellt wurde, fügen Sie Xmlns = "{0}" < Project >-Element. Wenn das Projekt im alten Format 1.0 oder 1.2 erstellt wurde, konvertieren Sie es in das MSBuild 2003-Format. - - fuzzyMatch="15" wordcount="52" adjWordcount="44.2" curWordcount="44.2" - - - Project Performance Summary: - 项目性能摘要: - - - Leistungszusammenfassung für das Projekt: - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - MSB4042: Stopping because of syntax errors in project file. - MSB4042: 由于项目文件中存在语法错误而正在停止。 - {StrBegin="MSB4042: "} - - MSB4042: Prozess aufgrund von Syntaxfehlern in der Projektdatei angehalten. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - Project "{0}" is building "{1}" ({2} target(s)): - 项目“{0}”正在生成“{1}”({2} 目标): - - - Das Projekt {0} erstellt {1} ({2} Ziel(e)): - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Project "{0}" is building "{1}" (default targets): - 项目“{0}”正在生成“{1}”(默认目标): - - - Das Projekt "{0}" erstellt "{1}" (Standardziele): - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Project "{0}" ({1} target(s)): - 项目“{0}”({1} 个目标): - - - Projekt "{0}", {1} Ziel(e): - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - Project "{0}" (default targets): - 项目“{0}”(默认目标): - - - Projekt "{0}" (Standardziele): - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - Done Building Project "{0}" ({1} target(s)). - 已完成生成项目“{0}”({1} 个目标)的操作。 - - - Die Erstellung von Projekt "{0}" ist abgeschlossen ({1} Ziel(e)). - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Done Building Project "{0}" (default targets). - 已完成生成项目“{0}”(默认目标)的操作。 - - - Die Erstellung von Projekt "{0}" ist abgeschlossen (Standardziele). - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Done Building Project "{0}" ({1} target(s)) -- FAILED. - 已完成生成项目“{0}”({1} 个目标)的操作 - 失败。 - - - Die Erstellung des Projekts "{0}" ist abgeschlossen, {1} Ziel(e) -- FEHLER. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Done Building Project "{0}" (default targets) -- FAILED. - 已完成生成项目“{0}”(默认目标)的操作 - 失败。 - - - Die Erstellung von Projekt "{0}" ist abgeschlossen (Standardziele) -- FEHLER. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4075: The project file must be opened in the Visual Studio IDE and converted to the latest version before it can be built by MSBuild. - MSB4075: 必须在 Visual Studio IDE 中打开该项目文件,并将其转换为最新版本,然后才能由 MSBuild 生成。 - {StrBegin="MSB4075: "} - - MSB4075: Die Projektdatei muss in der Visual Studio IDE geöffnet und in ein aktuelles Versionsformat gebracht werden, bevor sie mit MSBuild erstellt werden kann. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4192: The project file "{0}" is in the ".vcproj" file format, which MSBuild no longer supports. Please convert the project by opening it in the Visual Studio IDE or running the conversion tool, or use MSBuild 3.5 or earlier to build it. - MSB4192: 项目文件“{0}”为“.vcproj”文件格式,而 MSBuild 不再支持该格式。请通过在 Visual Studio IDE 中打开该项目或运行转换工具来转换该项目,或者使用 MSBuild 3.5 或早期版本来生成该项目。 - {StrBegin="MSB4192: "} LOC: ".vcproj" should not be localized - - MSB4192: Die Projektdatei "{0}" ist im VSPROJ-Dateiformat gespeichert, das nicht mehr von MSBuild unterstützt wird. Konvertieren Sie das Projekt, indem Sie es in der Visual Studio IDE öffnen oder das Konvertierungstool ausführen, oder verwenden Sie MSBuild 3.5 oder früher zum Erstellen des Projekts. - - fuzzyMatch="101" wordcount="42" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - The specified property does not belong to the current property group. - 指定的属性不属于当前属性组。 - - - Die angegebene Eigenschaft gehört nicht zu der aktuellen Eigenschaftengruppe. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - Initial Properties: - 初始属性: - - - Ursprüngliche Eigenschaften: - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4148: The name of a property stored under the registry key "{0}" has zero length. - MSB4148: 存储在注册表项“{0}”下的属性名称的长度为零。 - {StrBegin="MSB4148: "} - - MSB4148: Der Name einer unter dem Registrierungsschlüssel "{0}" gespeicherten Eigenschaft hat eine Länge von Null. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - The property names in the indexer and the "{0}" object do not match. - 索引器中的属性名称与“{0}”对象不匹配。 - - - Die Eigenschaftennamen im Indexer und das {0}-Objekt stimmen nicht überein. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4043: The item metadata reference "{0}" is invalid because it is qualified with an item name. Item metadata referenced in transforms do not need to be qualified, because the item name is automatically deduced from the items being transformed. Change "{0}" to "%({1})". - MSB4043: 项元数据引用“{0}”无效,因为它是用项名称限定的。不需要限定转换中引用的项元数据,因为项名称会自动根据所转换的项推导出来。请将“{0}”更改为“%({1})”。 - {StrBegin="MSB4043: "}UE: This message is shown when the user does something like this: @(foo->'%(foo.metadata)'). There is no need to specify - "foo.metadata", because "foo" is automatically deduced. In corollary, "bar.metadata" is not allowed either, where "bar" is a different - item list type. - - MSB4043: Der Elementmetadatenverweis "{0}" ist ungültig, da er mit einem Elementnamen qualifiziert ist. Elementmetadaten, auf die bei Transformationen verwiesen wird, müssen nicht qualifiziert werden, da der Elementname automatisch aus den transformierten Elementen abgeleitet wird. Ändern Sie "{0}" in "%({1})". - - fuzzyMatch="101" wordcount="43" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4135: Error reading the toolset information from the registry location "{0}". {1} - MSB4135: 从注册表位置“{0}”读取工具集信息时出错。{1} - {StrBegin="MSB4135: "} - - MSB4135: Fehler beim Lesen der Toolsetinformationen am Registrierungsspeicherort "{0}". {1} - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4044: The "{0}" task was not given a value for the required parameter "{1}". - MSB4044: 未给任务“{0}”的必需参数“{1}”赋值。 - {StrBegin="MSB4044: "}UE: This message is shown when a task parameter designated as "required" is not set in the project file. - - MSB4044: Die {0}-Aufgabe hat keinen Wert für den erforderlichen {1}-Parameter erhalten. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - Validating project using schema file "{0}". - 正在使用架构文件“{0}”验证项目。 - LOCALIZATION: "{0}" is the location of the schema file. - - Das Projekt wird anhand der Schemadatei "{0}" überprüft. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4045: Project is not valid. {0} - MSB4045: 项目无效。{0} - {StrBegin="MSB4045: "}UE: This error is shown when the user asks his project to be validated against a schema (/val switch for - MSBuild.exe), and the project has errors. "{0}" contains a message explaining the problem. - LOCALIZATION: "{0}" is a message from the System.XML schema validator and is already localized. - - MSB4045: Ungültiges Projekt. {0} - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4112: The targets in this project have been disabled by the host and therefore cannot be built at this time. This may have been done for security reasons. To enable the targets, the host must set Project.BuildEnabled to "true". - MSB4112: 此项目中的目标已被宿主禁用,因此无法在此时生成。这可能是出于安全考虑。若要启用这些目标,宿主必须将 Project.BuildEnabled 设置为“true”。 - {StrBegin="MSB4112: "} - - MSB4112: Die Ziele in diesem Projekt wurden vom Host deaktiviert und können aus diesem Grund derzeit nicht erstellt werden. Die Deaktivierung wurde wahrscheinlich aus Sicherheitsgründen durchgeführt. Wenn Sie die Ziele aktivieren möchten, muss der Host Project.BuildEnabled auf "true" festlegen. - - fuzzyMatch="101" wordcount="39" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4093: The "{0}" parameter of the "{1}" task cannot be written to because it does not have a "set" accessor. - MSB4093: 无法写入“{1}”任务的“{0}”参数,因为它没有“set”访问器。 - {StrBegin="MSB4093: "}UE: This error is shown when a project tries to assign a value to a task parameter that does not have a "set" - accessor on the corresponding .NET property on the task class. - - MSB4093: In den {0}-Parameter der {1}-Aufgabe kann nicht geschrieben werden, da er keinen set-Accessor besitzt. - - fuzzyMatch="100" wordcount="20" adjWordcount="5" curWordcount="5" tmLabel="N''" - - - A shallow clone of this object cannot be created. - 无法创建此对象的浅表克隆。 - - - Ein unechter Klon dieses Objekts kann nicht erstellt werden. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - Skipping target "{0}" because it has no inputs. - 正在跳过目标“{0}”,因为它没有输入。 - - - Das {0}-Ziel wird übersprungen, da es keine Eingaben besitzt. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Though the target has declared its inputs, the input specification only references empty properties and/or empty item lists. - 虽然目标已声明其输入,但输入规范仅引用了空属性和/或空项列表。 - - - Obwohl das Ziel seine Eingaben deklariert hat, verweist die Eingabespezifikation nur auf leere Eigenschaften und/oder leere Elementlisten. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - Skipping target "{0}" because it has no outputs. - 正在跳过目标“{0}”,因为它没有输出。 - - - Das Ziel "{0}" wird übersprungen, da es keine Ausgaben enthält. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Though the target has declared its outputs, the output specification only references empty properties and/or empty item lists. - 虽然目标已声明其输出,但输出规范仅引用了空属性和/或空项列表。 - - - Obwohl das Ziel seine Ausgaben deklariert hat, verweist die Ausgabespezifikation nur auf leere Eigenschaften und/oder leere Elementlisten. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - Skipping target "{0}" because all output files are up-to-date with respect to the input files. - 正在跳过目标“{0}”,因为所有输出文件相对于输入文件而言都是最新的。 - - - Das Ziel "{0}" wird übersprungen, da alle Ausgabedateien hinsichtlich der Eingabedateien aktuell sind. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - Input files: {0} - 输入文件:{0} - {0} is a semicolon-separated list of filenames. - - Eingabedateien: {0} - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Output files: {0} - 输出文件:{0} - {0} is a semicolon-separated list of filenames. - - Ausgabedateien: {0} - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Building solution configuration "{0}". - 正在生成解决方案配置“{0}”。 - UE: This is not an error, so doesn't need an error code. - - Die Projektmappenkonfiguration "{0}" wird erstellt. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - Using solution cache file "{0}" for configuration "{1}" and tools version "{2}". - 对配置“{1}”和工具版本“{2}”使用解决方案缓存文件“{0}”。 - UE: This is not an error, so doesn't need an error code. - - Die Projektmappen-Cachedatei "{0}" wird für die Konfiguration "{1}" und die Toolsversion "{2}" verwendet. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Failed to read solution cache file "{0}". {1} Using solution file directly. - 未能读取解决方案缓存文件“{0}”。{1} 直接使用解决方案文件。 - UE: This is not a true error, so doesn't need an error code. - - Fehler beim Lesen der Projektmappen-Cachedatei "{0}". {1} Projektmappendatei wird direkt verwendet. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Failed to write solution cache file "{0}". {1} - 未能写入解决方案缓存文件“{0}”。{1} - UE: This is not a true error, so doesn't need an error code. - - Fehler beim Schreiben der Projektmappen-Cachedatei "{0}". {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Solution cache file was created for a "{0}" value of "{1}" but the current value is "{2}". Refreshing cache file. - 为“{0}”值“{1}”创建了解决方案缓存文件,但当前值为“{2}”。正在刷新缓存文件。 - UE: This is not an error, so doesn't need an error code. - - Die Projektmappen-Cachedatei wurde für den {0}-Wert "{1}" erstellt, aber der aktuelle Wert ist "{2}". Cachedatei wird aktualisiert. - - fuzzyMatch="100" wordcount="20" adjWordcount="5" curWordcount="5" tmLabel="N''" - - - Solution cache file has an internal version number "{0}" but the current value is "{1}". Refreshing cache file. - 解决方案缓存文件的内部版本号为“{0}”,但当前值为“{1}”。正在刷新缓存文件。 - UE: This is not an error, so doesn't need an error code. - - Die Projektmappen-Cachedatei hat die interne Versionsnummer "{0}", der aktuelle Wert ist aber "{1}". Cachedatei wird aktualisiert. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - Solution cache file is out of date. Refreshing cache file. {0} - 解决方案缓存文件已过期。正在刷新缓存文件。{0} - UE: This is not an error, so doesn't need an error code. - - Die Projektmappen-Cachedatei ist veraltet. Cachedatei wird aktualisiert. {0} - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4160: A circular dependency involving project "{0}" has been detected. - MSB4160: 检测到涉及项目“{0}”的循环依赖项。 - {StrBegin="MSB4160: "} - - MSB4160: Eine Ringabhängigkeit im Zusammenhang mit dem Projekt "{0}" wurde erkannt. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4126: The specified solution configuration "{0}" is invalid. Please specify a valid solution configuration using the Configuration and Platform properties (e.g. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU") or leave those properties blank to use the default solution configuration. - MSB4126: 指定的解决方案配置“{0}”无效。请使用 Configuration 和 Platform 属性指定有效的解决方案配置(例如 MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU"),或者将这些属性保留为空,以使用默认的解决方案配置。 - {StrBegin="MSB4126: "}UE: The solution filename is provided separately to loggers. - - MSB4126: Die angegebene Projektmappenkonfiguration "{0}" ist ungültig. Geben Sie mithilfe der Konfigurations- und Plattformeigenschaften eine gültige Projektmappenkonfiguration an (z. B. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU"), oder lassen Sie diese Eigenschaften leer, sodass die Standardprojektmappenkonfiguration verwendet wird. - - fuzzyMatch="101" wordcount="37" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4046: Error reading project file "{0}": {1} - MSB4046: 读取项目文件“{0}”时出错: {1} - {StrBegin="MSB4046: "} - - MSB4046: Fehler beim Lesen der Projektdatei "{0}": {1} - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4125: The project file name "{0}" is invalid. {1} - MSB4125: 项目文件名“{0}”无效。{1} - {StrBegin="MSB4125: "}UE: The solution filename is provided separately to loggers. - - MSB4125: Der Projektdateiname "{0}" ist ungültig. {1} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4051: Project {0} is referencing a project with GUID {1}, but a project with this GUID was not found in the .SLN file. - MSB4051: 项目 {0} 引用的是 GUID 为 {1} 的项目,但在 .SLN 文件中找不到具有此 GUID 的项目。 - {StrBegin="MSB4051: "}UE: The solution filename is provided separately to loggers. - - MSB4051: Das Projekt "{0}" verweist auf ein Projekt mit der GUID {1}, in der SLN-Datei wurde jedoch kein Projekt mit dieser GUID gefunden. - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - MSB4078: The project file "{0}" is not supported by MSBuild and cannot be built. - MSB4078: 项目文件“{0}”不受 MSBuild 支持,无法生成。 - {StrBegin="MSB4078: "} - - MSB4078: Die Projektdatei "{0}" wird nicht von MSBuild unterstützt und kann nicht erstellt werden. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4054: The solution file must be opened in the Visual Studio IDE and converted to the latest version before it can be built by MSBuild. - MSB4054: 必须在 Visual Studio IDE 中打开该解决方案文件,并将其转换为最新版本,然后才能使用 MSBuild 生成该解决方案文件。 - {StrBegin="MSB4054: "}UE: The solution filename is provided separately to loggers. - - MSB4054: Die Projektmappendatei muss in der Visual Studio IDE geöffnet und in die neuste Version konvertiert werden, bevor sie mit MSBuild erstellt werden kann. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4121: The project configuration for project "{0}" was not specified in the solution file for the solution configuration "{1}". - MSB4121: 在解决方案文件中没有为解决方案配置“{1}”指定项目“{0}”的项目配置。 - {StrBegin="MSB4121: "} - - MSB4121: Die Projektkonfiguration für das Projekt "{0}" wurde nicht in der Projektmappendatei für die Projektmappenkonfiguration "{1}" angegeben. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - The project "{0}" is not selected for building in solution configuration "{1}". - 在解决方案配置“{1}”中未选定生成项目“{0}”。 - - UE: This is not an error, so doesn't need an error code. - - - Das Projekt "{0}" ist in der Projektmappenkonfiguration "{1}" nicht zum Erstellen ausgewählt. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4122: Scanning project dependencies for project "{0}" failed. {1} - MSB4122: 扫描项目“{0}”的项目依赖项失败。{1} - {StrBegin="MSB4122: "} - - MSB4122: Fehler beim Überprüfen der Projektabhängigkeiten für Projekt "{0}". {1} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4149: The tools version "{0}" of the solution does not support building projects with a different tools version. - MSB4149: 解决方案的工具版本“{0}”不支持使用其他工具版本生成项目。 - {StrBegin="MSB4149: "} - - MSB4149: Die Toolsversion {0} der Projektmappe unterstützt das Erstellen von Projekten mit unterschiedlichen Toolsversionen nicht. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - Web projects do not support the "Clean" target. Continuing with remaining projects ... - Web 项目不支持“Clean”目标。继续余下的项目... - UE: This is not an error, so doesn't need an error code. - LOCALIZATION: Do not localize "Clean". - - Webprojekte unterstützen das Clean-Ziel nicht. Verbleibende Projekte werden fortgesetzt... - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Web projects do not support the "Publish" target. Continuing with remaining projects ... - Web 项目不支持“Publish”目标。继续余下的项目... - UE: This is not an error, so doesn't need an error code. - LOCALIZATION: Do not localize "Publish". - - Webprojekte unterstützen das Publish-Ziel nicht. Verbleibende Projekte werden fortgesetzt... - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Skipping because the "$(AspNetConfiguration)" configuration is not supported for this web project. You can use the AspNetConfiguration property to override the configuration used for building web projects, by adding /p:AspNetConfiguration=<value> to the command line. Currently web projects only support Debug and Release configurations. - 由于此 Web 项目不支持“$(AspNetConfiguration)”配置,因此跳过。通过向命令行添加 /p:AspNetConfiguration=<value>,可以使用 AspNetConfiguration 属性来重写用于生成 Web 项目的配置。Web 项目目前仅支持 Debug 和 Release 配置。 - - UE: This is not an error, so doesn't need an error code. - LOCALIZATION: Do NOT localize "AspNetConfiguration", "Debug", "Release". - - - Da der "$(AspNetConfiguration)" Konfiguration für dieses Webprojekt nicht unterstützt. Verwenden die AspNetConfiguration-Eigenschaft die Konfiguration zum Erstellen von Webprojekten hinzufügen/p: AspNetConfiguration überschreiben = < Wert > in der Befehlszeile. Aktuell unterstützen Webprojekte nur Debug- und Releasekonfigurationen. - - fuzzyMatch="15" wordcount="44" adjWordcount="37.4" curWordcount="37.4" - - - MSB4076: VC projects do not support the "Publish" target. - MSB4076: VC 项目不支持“Publish”目标。 - {StrBegin="MSB4076: "}LOCALIZATION: Do not localize "Publish". - - MSB4076: VC-Projekte unterstützen nicht das Publish-Ziel. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4098: MSBuild is invoking VCBuild to build this project. Project-to-project references between VC++ projects (.VCPROJ) and C#/VB/VJ# projects (.CSPROJ, .VBPROJ, .VJSPROJ) are not supported by the command-line build systems when building stand-alone VC++ projects. Projects that contain such project-to-project references will fail to build. Please build the solution file containing this project instead. - MSB4098: MSBuild 正在调用 VCBuild 以生成此项目。生成独立的 VC++ 项目时,命令行生成系统不支持 VC++ 项目(.VCPROJ)与 C#/VB/VJ# 项目(.CSPROJ、.VBPROJ、.VJSPROJ)之间的项目到项目的引用,因此无法生成包含这种项目到项目的引用的项目。请生成包含此项目的解决方案文件。 - {StrBegin="MSB4098: "} - - MSB4098: MSBuild ruft zum Erstellen dieses Projekts VCBuild auf. Interprojektverweise zwischen VC++-Projekten (.VCPROJ) und C#-/VB-/VJ#-Projekten (.CSPROJ, .VBPROJ, .VJSPROJ) werden beim Erstellen eigenständiger VC++-Projekte von den Befehlszeilen-Buildsystemen nicht unterstützt. Projekte, die solche Interprojektverweise enthalten, werden nicht erstellt. Erstellen Sie stattdessen die Projektmappendatei, die dieses Projekt enthält. - - fuzzyMatch="101" wordcount="53" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4056: The MSBuild engine must be called on a single-threaded-apartment. Current threading model is "{0}". Proceeding, but some tasks may not function correctly. - MSB4056: 必须对单线程单元调用 MSBuild 引擎。当前线程模型为“{0}”。将继续,但某些任务可能无法正常工作。 - {StrBegin="MSB4056: "} - - MSB4056: Das MSBuild-Modul muss in einem Singlethread-Apartment aufgerufen werden. Das aktuelle Threadmodell ist {0}. Der Vorgang wird fortgesetzt, aber einige Aufgaben werden möglicherweise nicht ordnungsgemäß ausgeführt. - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - Schema validation - 架构验证 - UE: this fragment is used to describe errors that are caused by schema validation. For example, if a normal error is - displayed like this: "MSBUILD : error MSB0000: This is an error.", then an error from schema validation would look like this: - "MSBUILD : Schema validation error MSB0000: This is an error." - LOCALIZATION: This fragment needs to be localized. - - Schemavalidierung - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Target "{0}" skipped. Previously built unsuccessfully. - 已跳过目标“{0}”。以前的生成不成功。 - - - Das Ziel "{0}" wurde übersprungen. Die vorherige Erstellung war nicht erfolgreich. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Target "{0}" skipped. Previously built successfully. - 已跳过目标“{0}”。以前的生成已成功。 - - - Das Ziel "{0}" wurde übersprungen. Die vorherige Erstellung war erfolgreich. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4116: The condition "{1}" on the "{0}" target has a reference to item metadata. References to item metadata are not allowed in target conditions unless they are part of an item transform. - MSB4116: 目标“{0}”上的条件“{1}”有一个对项元数据的引用。除非对项元数据的引用是项转换的一部分,否则不允许在目标条件中进行这种引用。 - {StrBegin="MSB4116: "} - - MSB4116: Die Bedingung "{1}" des {0}-Ziels enthält einen Verweis auf Elementmetadaten. Verweise auf Elementmetadaten sind in Zielbedingungen nicht zulässig, es sei denn, sie sind Teil einer Elementtransformation. - - fuzzyMatch="101" wordcount="32" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4057: The target "{0}" does not exist in the project. - MSB4057: 该项目中不存在目标“{0}”。 - {StrBegin="MSB4057: "} - - MSB4057: Das Ziel "{0}" ist im Projekt nicht vorhanden. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - Done building target "{0}" in project "{1}" -- FAILED. - 已完成在项目“{1}”中生成目标“{0}”的操作 - 失败。 - - - Erstellen des {0}-Ziels in Projekt {1} beendet - Fehler beim Erstellen. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Done building target "{0}" in project "{1}". - 已完成在项目“{1}”中生成目标“{0}”的操作。 - - - Die Erstellung des Ziels "{0}" im Projekt "{1}" ist abgeschlossen. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - {0}: (TargetId:{1}) - {0}: (目标 ID: {1}) - - - {0}: (Ziel-ID:{1}) - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4058: The "{0}" target is missing its output specification. If a target declares inputs, it must also declare outputs. - MSB4058: 目标“{0}”缺少输出规范。如果目标声明输入,也必须声明输出。 - {StrBegin="MSB4058: "} - - MSB4058: Das {0}-Ziel enthält keine Ausgabespezifikation. Wenn ein Ziel Eingaben deklariert, muss es auch Ausgaben deklarieren. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4168: The item "{0}" of type "{1}" does not define a value for the metadata in the expression "{2}". This expression is used in the target output for target "{3}". If a target declares outputs that are transforms, all items in the transform must have a value for the metadata in the transform. - MSB4168: 类型“{1}”的项“{0}”没有定义表达式“{2}”中元数据的值。该表达式用在目标“{3}”的目标输出中。如果目标声明的输出是转换,则转换中的所有项都必须具有转换中的元数据值。 - {StrBegin="MSB4168: "} - - MSB4168: Das Element "{0}" vom Typ "{1}" definiert keinen Wert für die Metadaten im Ausdruck "{2}". Dieser Ausdruck wird in der Zielausgabe für "{3}" verwendet. Wenn ein Ziel Ausgaben deklariert, bei denen es sich um Transformationen handelt, müssen alle Elemente in der Transformation einen Wert für die in der Transformation enthaltenen Metadaten aufweisen. - - fuzzyMatch="101" wordcount="53" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Target Performance Summary: - 目标性能摘要: - - - Leistungszusammenfassung für das Ziel: - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Target "{0}" skipped, due to false condition; ({1}) was evaluated as ({2}). - 由于条件的计算结果为 false,已跳过目标“{0}”;({1})的计算结果为({2})。 - - - Das Ziel "{0}" wurde übersprungen, da die Bedingung "false" war . ({1}) wurde als ({2}) ausgewertet. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Target "{0}" in project "{1}" - 目标“{0}”在项目“{1}”中 - - - {0}-Ziel in {1}-Projekt. - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Target {0}: - 目标 {0}: - - - Ziel "{0}": - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Target "{0}" in file "{1}": - 文件“{1}”中的目标“{0}”: - - - Ziel "{0}" in Datei "{1}": - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Build continuing because "{0}" on the task "{1}" is set to "{2}". - 继续生成,因为任务“{1}”的“{0}”设置为“{2}”。 - - - Der Buildvorgang wird fortgesetzt, da {0} in der {1}-Aufgabe auf "{2}" festgelegt ist. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Target {0} from project "{1}": - 项目“{1}”中的目标 {0}: - - - Ziel "{0}" aus Projekt "{1}": - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Target "{0}" in file "{1}" from project "{2}": - 项目“{2}”的文件“{1}”中的目标“{0}”: - - - Ziel "{0}" in Datei "{1}" aus Projekt "{2}": - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4060: The "{0}" task has been declared or used incorrectly, or failed during construction. Check the spelling of the task name and the assembly name. - MSB4060: “{0}”任务的声明或使用不正确,或在构造过程中失败。请检查任务名称和程序集名称的拼写是否正确。 - {StrBegin="MSB4060: "} - - MSB4060: Die {0}-Aufgabe wurde falsch deklariert, falsch verwendet oder konnte bei der Erstellung nicht ausgeführt werden. Überprüfen Sie die Schreibweise des Aufgaben- und des Assemblynamens. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4077: The "{0}" task has been marked with the attribute LoadInSeparateAppDomain, but does not derive from MarshalByRefObject. Check that the task derives from MarshalByRefObject or AppDomainIsolatedTask. - MSB4077: “{0}”任务已标记为 LoadInSeparateAppDomain 特性,但未派生自 MarshalByRefObject。请检查该任务是派生自 MarshalByRefObject 还是 AppDomainIsolatedTask。 - {StrBegin="MSB4077: "}LOCALIZATION: <LoadInSeparateAppDomain>, <MarshalByRefObject>, <AppDomainIsolatedTask> should not be localized. - - MSB4077: Die Aufgabe "{0}" wurde mit dem LoadInSeparateAppDomain-Attribut markiert, ist jedoch nicht von MarshalByRefObject abgeleitet. Stellen Sie sicher, dass die Aufgabe von MarshalByRefObject oder AppDomainIsolatedTask abgeleitet wird. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Done executing task "{0}" -- FAILED. - 已完成执行任务“{0}”的操作 - 失败。 - - - Die Ausführung von Task "{0}" wurde beendet – FEHLER. - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Done executing task "{0}". - 已完成执行任务“{0}”的操作。 - - - Die Ausführung von Task "{0}" wurde beendet. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - {0} (TaskId:{1}) - {0} (任务 ID: {1}) - - - {0} (Aufgaben-ID: {1}) - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Using "{0}" task from assembly "{1}". - 正在使用程序集“{1}”中的“{0}”任务。 - UE: This informational message helps users determine which assemblies their tasks were loaded from. - - Die {0}-Aufgabe aus der {1}-Assembly wird verwendet. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4061: The "{0}" task could not be instantiated from the assembly "{1}". {2} - MSB4061: 未能从程序集“{1}”中实例化“{0}”任务。{2} - {StrBegin="MSB4061: "}LOCALIZATION: "{2}" is a localized message from a CLR/FX exception. - - MSB4061: Die {0}-Aufgabe konnte nicht aus der {1}-Assembly instanziiert werden. {2} - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4127: The "{0}" task could not be instantiated from the assembly "{1}". Please verify the task assembly has been built using the same version of the Microsoft.Build.Framework assembly as the one installed on your computer and that your host application is not missing a binding redirect for Microsoft.Build.Framework. {2} - MSB4127: 未能从程序集“{1}”实例化“{0}”任务。请确认任务程序集是使用与计算机上所安装版本相同的 Microsoft.Build.Framework 程序集版本生成的,并且宿主应用程序不缺少对 Microsoft.Build.Framework 的绑定重定向。{2} - {StrBegin="MSB4127: "}UE: This message is a specialized version of the TaskInstantiationFailureError message and can probably reuse some of its docs. - LOCALIZATION: "{2}" is a localized message from a CLR/FX exception. Also, Microsoft.Build.Framework should not be localized - - MSB4127: Die "{0}"-Aufgabe konnte nicht aus der "{1}"-Assembly instanziiert werden. Überprüfen Sie, ob die Aufgabenassembly mit der gleichen Version der Microsoft.Build.Framework-Assembly erstellt wurde, die auf Ihrem Computer installiert ist, und dass Ihrer Hostanwendung kein BindingRedirect-Eintrag für Microsoft.Build.Framework fehlt. {2} - - fuzzyMatch="101" wordcount="49" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4062: The "{0}" task could not be loaded from the assembly {1}. {2} Confirm that the <UsingTask> declaration is correct, and that the assembly and all its dependencies are available. - MSB4062: 未能从程序集 {1} 加载任务“{0}”。{2} 确认 <UsingTask> 声明是正确的,并且该程序集及其所有依赖项都可用。 - {StrBegin="MSB4062: "}UE: This message is shown when a task cannot be loaded from its assembly for various reasons e.g. corrupt assembly, - invalid task declaration, disk error, etc. "{2}" contains a message explaining what happened. - LOCALIZATION: "{2}" is a message from the CLR loader and is already localized. Also, <UsingTask> should not be localized. - - MSB4062: Die "{0}" Vorgang konnte nicht aus der Assembly geladen werden {1}. {2} Bestätigen < UsingTask > Erklärung richtig ist und die Assembly und die zugehörigen Dateien verfügbar sind. - - fuzzyMatch="15" wordcount="31" adjWordcount="26.35" curWordcount="26.35" - - - MSB4063: The "{0}" task could not be initialized with its input parameters. {1} - MSB4063: 未能使用“{0}”任务的输入参数初始化该任务。{1} - {StrBegin="MSB4063: "} - - MSB4063: Die "{0}"-Aufgabe konnte nicht mit ihren Eingabeparametern initialisiert werden. {1} - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - Task Performance Summary: - 任务性能摘要: - - - Leistungszusammenfassung für die Aufgabe: - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Task "{0}" skipped, due to false condition; ({1}) was evaluated as ({2}). - 由于 false 条件,已跳过任务“{0}”;({1})计算为({2})。 - - - Die {0}-Aufgabe wurde übersprungen, da die Bedingung "false" war . ({1}) wurde als ({2}) ausgewertet. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Task "{0}" - 任务“{0}” - - - Task "{0}" - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Time Elapsed {0} - 已用时间 {0} - - - Verstrichene Zeit {0} - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Building with tools version "{0}". - 正在使用工具版本“{0}”进行生成。 - - - Erstellung mit der Toolsversion "{0}". - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Project file contains ToolsVersion="{0}". This toolset is unknown or missing. You may be able to resolve this by installing the appropriate .NET Framework for this toolset. Treating the project as if it had ToolsVersion="4.0". - 项目文件包含 ToolsVersion="{0}" 设置,但此工具集未知或缺失。您可以通过为此工具集安装相应的 .NET Framework 来解决此问题。将项目视为具有 ToolsVersion="4.0" 设置。 - - - Die Projektdatei enthält ToolsVersion="{0}". Dieses Toolset ist nicht bekannt oder nicht vorhanden. Sie können das Problem möglicherweise beheben, indem Sie das entsprechende .NET Framework für dieses Toolset installieren. Das Projekt wird behandelt als enthielte es ToolsVersion="4.0". - - fuzzyMatch="101" wordcount="34" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Deferred Messages - 延迟消息 - - - Zurückgestellte Meldungen - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Some messages did not display because they were not associated with any ProjectStarted events. Use diagnostic verbosity to view these messages. - 某些消息未显示,因为它们未与任何 ProjectStarted 事件关联。请在诊断详细程度中查看这些消息。 - - - Einige Meldungen wurden nicht angezeigt, weil sie keinem ProjectStarted-Ereignis zugeordnet sind. Verwenden Sie den Ausführlichkeitsgrad "diagnostic", um diese Meldungen anzuzeigen. - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - MSB4090: Found an unexpected character '{2}' at position {1} in condition "{0}". - MSB4090: 在条件“{0}”中的位置 {1} 处发现意外字符“{2}”。 - {StrBegin="MSB4090: "} - - MSB4090: Das unerwartete Zeichen {2} wurde an Position {1} in der {0}-Bedingung gefunden. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4091: Found a call to an undefined function "{1}" in condition "{0}". - MSB4091: 在条件“{0}”中发现对未定义函数“{1}”的调用。 - {StrBegin="MSB4091: "} - - MSB4091: Aufruf zu einer undefinierten Funktion "{1}" in Bedingung "{0}" gefunden. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4064: The "{0}" parameter is not supported by the "{1}" task. Verify the parameter exists on the task, and it is a settable public instance property. - MSB4064: “{1}”任务不支持“{0}”参数。请确认该参数存在于此任务中,并且是可设置的公共实例属性。 - {StrBegin="MSB4064: "} - - MSB4064: Der {0}-Parameter wird von der {1}-Aufgabe nicht unterstützt. Vergewissern Sie sich, dass der Parameter in der Aufgabe vorhanden ist und es sich um eine festlegbare öffentliche Instanzeigenschaft handelt. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4131: The "{0}" parameter is not supported by the "{1}" task. Verify the parameter exists on the task, and it is a gettable public instance property. - MSB4131: “{1}”任务不支持“{0}”参数。请确认该参数存在于此任务中,并且是可获得的公共实例属性。 - {StrBegin="MSB4131: "} - - MSB4131: Der {0}-Parameter wird von der {1}-Aufgabe nicht unterstützt. Vergewissern Sie sich, dass der Parameter in der Aufgabe vorhanden ist und es sich um eine abrufbare öffentliche Instanzeigenschaft handelt. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4092: An unexpected token "{1}" was found at character position {2} in condition "{0}". - MSB4092: 在条件“{0}”中的字符位置 {2} 处发现意外标记“{1}”。 - {StrBegin="MSB4092: "} - - MSB4092: Ein unerwartetes Token "{1}" wurde an Zeichenposition "{2}" in Bedingung "{0}" gefunden. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4065: The "{0}" parameter is not marked for output by the "{1}" task. - MSB4065: 任务“{1}”未将“{0}”参数标记为输出。 - {StrBegin="MSB4065: "} - - MSB4065: Der {0}-Parameter ist nicht für die Ausgabe durch die {1}-Aufgabe markiert. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4066: The attribute "{0}" in element <{1}> is unrecognized. - MSB4066: 无法识别元素 <{1}> 中的特性“{0}”。 - {StrBegin="MSB4066: "} - - MSB4066: Das Attribut "{0}" im Element <{1}> wurde nicht erkannt. - - fuzzyMatch="15" wordcount="10" adjWordcount="8.5" curWordcount="8.5" - - - MSB4067: The element <{0}> beneath element <{1}> is unrecognized. - MSB4067: 无法识别元素 <{1}> 下面的元素 <{0}>。 - {StrBegin="MSB4067: "} - - MSB4067: Das Element <{0}> unter Element <{1}> wurde nicht erkannt. - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB4068: The element <{0}> is unrecognized, or not supported in this context. - MSB4068: 无法识别元素 <{0}>,或者在此上下文中不支持该元素。 - {StrBegin="MSB4068: "} - - MSB4068: Das Element <{0}> ist unbekannt oder in diesem Kontext nicht unterstützt. - - fuzzyMatch="15" wordcount="13" adjWordcount="11.05" curWordcount="11.05" - - - MSB4132: The tools version "{0}" is unrecognized. - MSB4132: 无法识别工具版本“{0}”。 - {StrBegin="MSB4132: "} - - MSB4132: Die Toolsversion "{0}" ist unbekannt. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4069: The "{0}" type of the "{1}" parameter of the "{2}" task is not supported by MSBuild. - MSB4069: MSBuild 不支持“{2}”任务的“{1}”参数的“{0}”类型。 - {StrBegin="MSB4069: "}LOCALIZATION: "MSBuild" should not be localized. - - MSB4069: Der {0}-Typ des {1}-Parameters der {2}-Aufgabe wird von MSBuild nicht unterstützt. - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - MSB4072: A <{0}> element must contain either the "{1}" attribute or the "{2}" attribute (but not both). - MSB4072: <{0}> 元素必须包含“{1}”特性或“{2}”特性(但不能同时包含二者)。 - {StrBegin="MSB4072: "} - - MSB4072: Ein <{0}>-Element muss entweder die "{1}" Attribut oder "{2}" Attribut (jedoch nicht beide). - - fuzzyMatch="15" wordcount="18" adjWordcount="15.3" curWordcount="15.3" - - - {0} Warning(s) - {0} 个警告 - - - {0} Warnung(en) - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4084: A <When> element may not follow an <Otherwise> element in a <Choose>. - MSB4084: 在 <Choose> 中 <When> 元素不能跟在 <Otherwise> 元素之后。 - {StrBegin="MSB4084: "} - - MSB4084: A < >-Element kein Element < Otherwise > < auswählen > folgen. - - fuzzyMatch="15" wordcount="16" adjWordcount="13.6" curWordcount="13.6" - - - Target Name: "{0}" Project Name: "{1}" - 目标名:“{0}”项目名:“{1}” - - - Zielname: "{0}" Projektname: "{1}" - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Cycle trace: - 循环跟踪: - - - Schleifenablaufverfolgung: - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4150: Must initialize the console logger using the initialize method before using ApplyParameter - MSB4150: 在使用 ApplyParameter 之前,必须使用 initialize 方法来初始化控制台记录器 - {StrBegin="MSB4150: "} - - MSB4150: Die Konsolenprotokollierung muss vor der Verwendung von ApplyParameter mithilfe der Initialisierungsmethode initialisiert werden. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4151: An error occurred while building project "{0}", target "{1}". Please see innerException for detailed information. - MSB4151: 生成项目“{0}”(目标“{1}”)时出错。有关详细信息,请参阅 innerException。 - {StrBegin="MSB4151: "} - - MSB4151: Fehler beim Erstellen von Projekt "{0}", Ziel "{1}". Ausführliche Informationen finden Sie in der innerException. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB4152: An error occurred on the child node "{0}" and could not be passed to the parent node. {1} - MSB4152: 子节点“{0}”上出错,未能传递到父节点。{1} - {StrBegin="MSB4152: "} - - MSB4152: Fehler im untergeordneten Knoten "{0}", der nicht an den übergeordneten Knoten übergeben werden konnte. {1} - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4153: A call is made on an inactive IBuildEngine interface corresponding to a task that already finished execution. - MSB4153: 调用了对应于已完成执行的任务的不活动 IBuildEngine 接口。 - {StrBegin="MSB4153: "} - - MSB4153: Eine inaktive IBuildEngine-Schnittstelle wird aufgerufen, der eine Aufgabe entspricht, deren Ausführung bereits abgeschlossen wurde. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - MSB4154: A forwarding logger is attempting to forward BuildFinished event - MSB4154: 转发记录器正在尝试转发 BuildFinished 事件 - {StrBegin="MSB4154: "} - - MSB4154: Eine weiterleitende Protokollierung versucht, das BuildFinished-Ereignis weiterzuleiten. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4155: There was an error while communicating with a node. - MSB4155: 与节点通信时出错。 - {StrBegin="MSB4155: "} - - MSB4155: Fehler bei der Kommunikation mit einem Knoten. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB1021: Cannot create an instance of the logger - {0}. - MSB1021: 无法创建记录器的实例 - {0}。 - {StrBegin="MSB1021: "}The error code for this message is duplicated from MSBuild.exe. - - MSB1021: Eine Instanz der Protokollierung kann nicht erstellt werden - {0}. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB1020: The logger {0} was not found. Check the following: 1.) The logger name specified is the same as the name of the logger class. 2.) The logger class is "public" and implements the Microsoft.Build.Framework.ILogger interface. 3.) The path to the logger assembly is correct, or the logger can be loaded using only the assembly name provided. - MSB1020: 找不到记录器 {0}。请检查以下各项: 1.) 指定的记录器名称与记录器类的名称相同。2.) 记录器类为“公共的”并且实现 Microsoft.Build.Framework.ILogger 接口。3.) 记录器程序集的路径正确无误,或者只能使用提供的程序集名称来加载记录器。 - {StrBegin="MSB1020: "}The error code for this message is duplicated from MSBuild.exe. - - MSB1020: Die Protokollierung {0} wurde nicht gefunden. Überprüfen Sie Folgendes: 1.) Der angegebene Name der Protokollierung ist mit dem Namen der Protokollierungsklasse identisch. 2.) Die Protokollierungsklasse ist "public" und implementiert die Microsoft.Build.Framework.ILogger-Schnittstelle. 3.) Der Pfad zur Protokollierungsassembly ist richtig, bzw. die Protokollierung kann alleine mithilfe des angegebenen Assemblynamens geladen werden. - - fuzzyMatch="101" wordcount="57" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4156: A forwarding logger is attempting to forward BuildStarted event - MSB4156: 转发记录器正在尝试转发 BuildStarted 事件 - {StrBegin="MSB4156: "} - - MSB4156: Eine weiterleitende Protokollierung versucht, das BuildStarted-Ereignis weiterzuleiten. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - "{0}" ({1} target) ({2}) -> - “{0}”({1} 目标) ({2}) -> - - - "{0}" ({1} target) ({2}) -> - - fuzzyMatch="15" wordcount="5" adjWordcount="4.25" curWordcount="4.25" - - - "{0}" (default target) ({1}) -> - “{0}”(默认目标) ({1}) -> - - - "{0}" (Standardziel) ({1}) -> - - fuzzyMatch="15" wordcount="5" adjWordcount="4.25" curWordcount="4.25" - - - {0} {1,5} - {0} {1,5} - - - {0} {1,5} - - fuzzyMatch="15" wordcount="2" adjWordcount="1.7" curWordcount="1.7" - - - Project "{0}" on node {1} ({2} target(s)). - 项目“{0}”在节点 {1} 上({2} 个目标)。 - - - Projekt "{0}" auf Knoten "{1}", {2} Ziel(e). - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Project "{0}" on node {1} (default targets). - 节点 {1} 上的项目“{0}”(默认目标)。 - - - Projekt "{0}" auf Knoten "{1}" (Standardziele). - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Project "{0}" ({1}) is building "{2}" ({3}) on node {4} ({5} target(s)). - 项目“{0}”({1})正在节点 {4} 上生成“{2}”({3}) ({5} 个目标)。 - - - Das Projekt "{0}" ({1}) erstellt "{2}" ({3}) auf Knoten "{4}", {5} Ziel(e). - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Project "{0}" ({1}) is building "{2}" ({3}) on node {4} (default targets). - 项目“{0}”({1})正在节点 {4} 上生成“{2}”({3}) (默认目标)。 - - - Das Projekt "{0}" ({1}) erstellt "{2}" ({3}) auf Knoten "{4}" (Standardziele). - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - ({0} target) -> - ({0} 目标) -> - - - ({0} Ziel) -> - - fuzzyMatch="15" wordcount="3" adjWordcount="2.55" curWordcount="2.55" - - - MSB4157: The array of project files needs to contain at least one value. - MSB4157: 项目文件的数组至少需要包含一个值。 - {StrBegin="MSB4157: "} - - MSB4157: Das Array der Projektdateien muss mindestens einen Wert enthalten. - - fuzzyMatch="15" wordcount="13" adjWordcount="11.05" curWordcount="11.05" - - - MSB4158: The project file name at element {0} is empty. - MSB4158: 元素 {0} 处的项目文件名为空。 - {StrBegin="MSB4158: "} - - MSB4158: Der Projektdateiname bei Element {0} ist leer. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - The property "{0}" with value "{1}" is being overridden by another batch. The property is now: "{2}" - 值为“{1}”的属性“{0}”被另一个 Batch 重写。该属性现在为:“{2}” - - - Die Eigenschaft "{0}" mit dem Wert "{1}" wird von einem anderen Batch überschrieben. Die Eigenschaft ist jetzt: "{2}" - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - Please see inner exception for error information. - 有关错误信息,请参阅内部异常。 - - - Fehlerinformationen finden Sie in der internen Ausnahme. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Event type "{0}" was expected to be serializable. The event was not serializable and has been ignored. - 事件类型“{0}”应是可序列化的。该事件不可序列化,已被忽略。 - - - Es wurde erwartet, dass der Typ "{0}" serialisierbar ist. Das Ereignis war nicht serialisierbar und wurde ignoriert. - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - The log file path cannot be null or empty. - 日志文件路径不能为 null 或为空。 - - - Der Protokolldateipfad darf nicht NULL oder leer sein. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4161: Project "{0}" was loaded and unloaded during the current build. Reloading a project during the build can result in errors or an inconsistent build state. Either avoid unloading project "{0}" or cache the evaluation results of target(s) "{1}" before unloading the project. - MSB4161: 在当前生成过程中加载和卸载了项目“{0}”。在生成过程中重新加载项目可能会导致错误或生成状态不一致。请避免卸载项目“{0}”,或在卸载项目之前将目标“{1}”的求值结果存入缓存。 - {StrBegin="MSB4161: "} - - MSB4161: Das Projekt "{0}" wurde während der aktuellen Erstellung geladen und entladen. Das erneute Laden eines Projekts während der Erstellung kann zu Fehlern oder einem nicht konsistenten Buildzustand führen. Vermeiden Sie entweder das Entladen des Projekts "{0}", oder speichern Sie die Auswertungsergebnisse der Ziele "{1}" vor dem Entladen des Projekts im Cache. - - fuzzyMatch="101" wordcount="43" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - [default] - [默认值] - - - [Standard] - - fuzzyMatch="100" wordcount="1" adjWordcount="0.25" curWordcount="0.25" tmLabel="N''" - - -
-
\ No newline at end of file diff --git a/src/Deprecated/Engine/Resources/xlf/Strings.zh-Hant.xlf b/src/Deprecated/Engine/Resources/xlf/Strings.zh-Hant.xlf deleted file mode 100644 index 250ba817679..00000000000 --- a/src/Deprecated/Engine/Resources/xlf/Strings.zh-Hant.xlf +++ /dev/null @@ -1,2674 +0,0 @@ - - - -
- - 4013 - 1176.8 - 1176.8 - 0 - 0 - - - 0 - 981 - 2334 - 0 - 0 - 698 - 0 - -
- - - MSB4001: The "{0}" task has more than one parameter called "{1}". - MSB4001: "{0}" 工作有多個名稱為 "{1}" 的參數。 - {StrBegin="MSB4001: "}UE: This message is shown when a task has more than one .NET property with the same name -- it's unclear which of - those properties the task wants to use as a parameter in project files. - - MSB4001: Die {0}-Aufgabe enthält mehrere Parameter mit dem Namen "{1}". - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4081: The value "{0}" of the "ItemName" attribute in element <Output> contains an "@" character. If you intended to use an item name then remove the @( ) around the item name. - MSB4081: <Output> 項目中 "ItemName" 屬性的值 "{0}" 包含 "@" 字元。如果您要使用項目名稱,請移除項目名稱前後的 @( )。 - {StrBegin="MSB4081: "}UE: This message is shown when an output tag has an itemname that contains an @. They probably typed @(foo) instead of foo in the ItemName.LOCALIZATION: Output and ItemName should not be localized. - - MSB4081: Der Wert "{0}" "ItemName-Attribut im Element < Output > enthält ein" @"Zeichen. Soll ein Elementname verwenden und entfernen dann die @ (), um den Namen des Elements. - - fuzzyMatch="15" wordcount="30" adjWordcount="25.5" curWordcount="25.5" - - - MSB4002: There was a failure retrieving the attributes for parameters in the "{0}" task. {1} - MSB4002: 擷取 "{0}" 工作中參數的屬性時發生失敗。{1} - {StrBegin="MSB4002: "}UE: This message is shown when the .NET attributes that a task's .NET properties are decorated with, cannot be - retrieved -- this is typically because the .NET classes that define the .NET attributes cannot be loaded because the assembly - they are defined in cannot be found, or the classes themselves cannot be found. - - MSB4002: Fehler beim Abrufen der Attribute für Parameter in der {0}-Aufgabe. {1} - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - MSB4003: "{0}" is a reserved attribute of the <{1}> element, and must be spelled with the correct casing. This attribute cannot be used as a parameter to the "{2}" task. - MSB4003: "{0}" 是 <{1}> 項目的保留屬性,必須使用正確的大小寫拼寫。這個屬性不能當做 "{2}" 工作的參數。 - {StrBegin="MSB4003: "}UE: Tasks are not allowed to use incorrect case for reserved attributes on the task nodes e.g. "continueonerror" - instead of the "ContinueOnError". - - MSB4003: "{0}" ist ein reserviertes Attribut der <{1}>-Element und mit der richtigen Groß-/Kleinschreibung geschrieben werden muss. Dieses Attribut kann nicht verwendet werden, als Parameter an die "{2}" Aufgabe. - - fuzzyMatch="15" wordcount="31" adjWordcount="26.35" curWordcount="26.35" - - - The "REQUESTBATCHSIZE" must be a number greater than 1. "{0}" is an invalid value. The value 10 will be used instead. - "REQUESTBATCHSIZE" 必須是大於 1 的數字。"{0}" 是無效值。將改用值 10。 - The name "REQUESTBATCHSIZE" is an environment variable - - Die "REQUESTBATCHSIZE" muss eine Zahl größer als 1 sein. "{0}" ist ein ungültiger Wert. Der Wert 10 wird stattdessen verwendet. - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - Build completed in {0}. - 在 {0} 內完成建置。 - - - Das Erstellen wurde in {0} beendet. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - Build FAILED. - 建置失敗。 - - - Fehler beim Buildvorgang. - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Build succeeded. - 建置成功。 - - - Buildvorgang erfolgreich. - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Build started. - 已經開始建置。 - - - Der Buildvorgang wurde gestartet. - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Build started {0}. - 已經開始建置於 {0}。 - - - Der Buildvorgang wurde am {0} gestartet. - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Building target "{0}" completely. - 目標 "{0}" 建置完成。 - {0} is the name of the target. - - Das Ziel "{0}" wird vollständig erstellt. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - No input files were specified. - 未指定輸入檔。 - - - Es wurden keine Eingabedateien angegeben. - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Input file "{0}" is newer than output file "{1}". - 輸入檔 "{0}" 比輸出檔 "{1}" 新。 - {0} and {1} are filenames on disk. - - Die Eingabedatei "{0}" ist neuer als die Ausgabedatei "{1}". - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - Output file "{0}" does not exist. - 輸出檔 "{0}" 不存在。 - {0} is a filename on disk. - - Die Ausgabedatei "{0}" ist nicht vorhanden. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Input file "{0}" does not exist. - 輸入檔 "{0}" 不存在。 - {0} is a filename on disk. - - Die Eingabedatei "{0}" ist nicht vorhanden. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Building target "{0}" partially, because some output files are out of date with respect to their input files. - 部分建置目標 "{0}",因為某些輸出檔對於其輸入檔而言已過期。 - {0} is the name of the target. - - Das Ziel "{0}" wird teilweise erstellt, da einige Ausgabedateien hinsichtlich ihrer Eingabedateien veraltet sind. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - [{0}: Input={1}, Output={2}] Input file is newer than output file. - [{0}: Input={1}, Output={2}] 輸入檔比輸出檔新。 - {0} is the name of an MSBuild item. {1} and {2} are filenames on disk. - - [{0}: Eingabe={1}, Ausgabe={2}] Die Eingabedatei ist neuer als die Ausgabedatei. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - [{0}: Input={1}, Output={2}] Output file does not exist. - [{0}: Input={1}, Output={2}] 輸出檔不存在。 - {0} is the name of an MSBuild item. {1} and {2} are filenames on disk. - - [{0}: Eingabe={1}, Ausgabe={2}] Die Ausgabedatei ist nicht vorhanden. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - [{0}: Input={1}, Output={2}] Input file does not exist. - [{0}: Input={1}, Output={2}] 輸入檔不存在。 - {0} is the name of an MSBuild item. {1} and {2} are filenames on disk. - - [{0}: Eingabe={1}, Ausgabe={2}] Die Eingabedatei ist nicht vorhanden. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - The attribute "{0}" is a known MSBuild attribute, and cannot be accessed using this method. - 屬性 "{0}" 是已知的 MSBuild 屬性,無法使用這個方法存取。 - - - Das {0}-Attribut ist ein bekanntes MSBuild-Attribut, auf das mithilfe dieser Methode nicht zugegriffen werden kann. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - Properties in persisted property groups cannot be accessed by name. - 永續性屬性群組中的屬性不能依照名稱來存取。 - - - Auf Eigenschaften in persistenten Eigenschaftengruppen ist kein Zugriff über den Namen möglich. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4023: Cannot evaluate the item metadata "%({0})". {1} - MSB4023: 無法評估項目中繼資料 "%({0})"。{1} - {StrBegin="MSB4023: "}UE: This message is shown when the value of an item metadata cannot be computed for some reason e.g. trying to apply - %(RootDir) to an item-spec that's not a valid path, would result in this error. - LOCALIZATION: "{1}" is a localized message explaining the problem. - - MSB4023: Elementmetadaten "%({0})" können nicht ausgewertet werden. {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Cannot execute a task not associated with a project object. - 無法執行與專案物件沒有關聯的工作。 - - - Eine Aufgabe, die keinem Projektobjekt zugeordnet ist, kann nicht ausgeführt werden. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - The cache entry has already been set to a different value and cannot be modified. - 快取項目已經設定為另一個值,無法修改。 - - - Der Cacheeintrag wurde bereits auf einen anderen Wert festgelegt und kann nicht geändert werden. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - The "{0}" property comes from an environment variable, and cannot be modified. - "{0}" 屬性來自環境變數,而且不能修改。 - - - Die {0}-Eigenschaft stammt aus einer Umgebungsvariablen und kann nicht geändert werden. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - The "{0}" property is a global property, and cannot be modified through an evaluated property group. Use "{1}" instead. - "{0}" 屬性是全域屬性,而且不能透過已評估的屬性群組進行修改。請改用 "{1}"。 - - - Die {0}-Eigenschaft ist eine globale Eigenschaft und kann nicht über eine ausgewertete Eigenschaftengruppe geändert werden. Verwenden Sie stattdessen {1}. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - Modifying the XML of an imported project file is not allowed. Open that project file directly. - 不能修改匯入專案檔的 XML。請直接開啟該專案檔。 - - - Der XML-Code einer importierten Projektdatei darf nicht geändert werden. Öffnen Sie diese Projektdatei direkt. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB4117: The "{0}" item name is reserved, and cannot be used. - MSB4117: "{0}" 項目名稱為保留名稱,不能使用。 - {StrBegin="MSB4117: "}UE: This message is shown when the user tries to redefine one of the reserved MSBuild items e.g. @(Choose) - - MSB4117: Der Elementname "{0}" ist reserviert und kann nicht verwendet werden. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4118: The "{0}" item metadata name is reserved, and cannot be used. - MSB4118: "{0}" 項目中繼資料名稱為保留名稱,不能使用。 - {StrBegin="MSB4118: "}UE: This message is shown when the user tries to redefine one of the reserved MSBuild items e.g. @(Choose) - - MSB4118: Der Elementmetadatenname "{0}" ist reserviert und kann nicht verwendet werden. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4004: The "{0}" property is reserved, and cannot be modified. - MSB4004: "{0}" 屬性已保留,不能修改。 - {StrBegin="MSB4004: "}UE: This message is shown when the user tries to redefine one of the reserved MSBuild properties e.g. $(MSBuildProjectFile) - - MSB4004: Die {0}-Eigenschaft ist reserviert und kann nicht geändert werden. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4094: "{0}" is an invalid value for the "{1}" parameter of the "{3}" task. Multiple items cannot be passed into a parameter of type "{2}". - MSB4094: "{0}" 是 "{3}" 工作 "{1}" 參數的無效值。多個項目無法傳遞至類型 "{2}" 的參數。 - {StrBegin="MSB4094: "} - UE: This error is shown when a project tries to pass multiple items into a task parameter of type ITaskItem (singular). - - - MSB4094: "{0}" ist ein ungültiger Wert für den "{1}"-Parameter der "{3}"-Aufgabe. Mehrere Elemente können nicht in einen Parameter vom Typ "{2}" übergeben werden. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4115: The "{0}" function only accepts a scalar value, but its argument "{1}" evaluates to "{2}" which is not a scalar value. - MSB4115: "{0}" 函式只接受純量值,但它的引數 "{1}" 評估為 "{2}",並不是一個純量值。 - {StrBegin="MSB4115: "} - UE: This error is shown when a project tries to pass multiple items into a function in a conditional expression, that can only accept a scalar value (such as the "exists()" function). - - - MSB4115: Die "{0}"-Funktion nimmt nur einen Skalarwert an, ihr "{1}"-Argument wird jedoch zu "{2}" ausgewertet, bei dem es sich nicht um einen Skalarwert handelt. - - fuzzyMatch="100" wordcount="22" adjWordcount="5.5" curWordcount="5.5" tmLabel="N''" - - - The task is currently associated with a project object, and should not be added to a different one. - 這項工作目前與某個專案物件相關聯,而且不能加入至不同的專案物件。 - - - Die Aufgabe ist derzeit einem Projektobjekt zugeordnet und sollte zu keinem anderen Projektobjekt hinzugefügt werden. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - MSB4095: The item metadata %({0}) is being referenced without an item name. Specify the item name by using %(itemname.{0}). - MSB4095: 正在參考的項目中繼資料 %({0}) 沒有項目名稱。請使用 %(itemname.{0}) 指定項目名稱。 - {StrBegin="MSB4095: "} - - MSB4095: Auf die %({0})-Elementmetadaten wird ohne einen Elementnamen verwiesen. Geben Sie den Namen mithilfe von %(itemname.{0}) an. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - The task is not associated with the specified target element collection, and should not be removed from it. - 這項工作與指定的目標項目集合沒有關聯,而且不應該從該集合中移除。 - - - Die Aufgabe ist nicht der angegebenen Auflistung von Zielelementen zugeordnet und sollte nicht daraus entfernt werden. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - MSB4005: The current working directory could not be restored to {0}. {1} - MSB4005: 無法將目前的工作目錄還原成 {0}。{1} - {StrBegin="MSB4005: "}UE: This message is shown when the current working directory cannot be reset after a build. "{1}" contains a message explaining why. - LOCALIZATION: "{1}" is a message from an CLR/FX exception and is already localized. - - MSB4005: Das aktuelle Arbeitsverzeichnis konnte unter {0} nicht wiederhergestellt werden. {1} - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Cannot set a condition on an object not represented by an XML element in the project file. - 無法在不是由專案檔中 XML 項目代表的物件上設定條件。 - - - Eine Bedingung kann nicht für ein Objekt festgelegt werden, wenn das Objekt nicht von einem XML-Element in der Projektdatei repräsentiert wird. - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - Cannot set ContinueOnError on an object not represented by an XML element in the project file. - 無法在不是由專案檔中 XML 項目代表的物件上設定 ContinueOnError。 - - - Das ContinueOnError-Attribut kann nicht für ein Objekt festgelegt werden, wenn das Objekt nicht von einem XML-Element in der Projektdatei repräsentiert wird. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB4134: DefaultToolsVersion cannot be set after a project has been loaded into the Engine. - MSB4134: DefaultToolsVersion 不可在專案已載入引擎中之後設定。 - {StrBegin="MSB4134: "} - - MSB4134: DefaultToolsVersion darf nicht festgelegt werden, nachdem ein Projekt in das Modul geladen wurde. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - Assigning the "{0}" attribute on an item that has been evaluated is not allowed. This operation is only allowed on the original persisted item that came directly from the project file. - 不允許在已評估過的項目上指派 "{0}" 屬性。這項作業只能在直接來自專案檔的原始永續性項目上執行。 - - - Das {0}-Attribut darf nicht einem Element zugewiesen werden, das ausgewertet wurde. Dieser Vorgang ist nur für das ursprüngliche persistente Element zulässig, das direkt aus der Projektdatei stammt. - - fuzzyMatch="101" wordcount="31" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Assigning the "{0}" attribute of a virtual item is not allowed. - 不允許指派虛擬項目的 "{0}" 屬性。 - - - Das Zuweisen des {0}-Attributs eines virtuellen Elements ist nicht zulässig. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - A property cannot be set while building. - 有一個屬性在建置期間無法設定。 - - - Eine Eigenschaft kann nicht während des Erstellens festgelegt werden. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - A property cannot be set to null. - 不能將屬性設定為 null。 - - - Eine Eigenschaft kann nicht auf NULL festgelegt werden. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Cannot get or set parameters on a task not associated with a project object. - 無法在與專案物件沒有關聯的工作上取得或設定參數。 - - - Parameter für eine Aufgabe können nicht abgefragt oder festgelegt werden, wenn die Aufgabe keinem Projektobjekt zugeordnet ist. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4162: <{0}> is not valid. Child elements are not allowed below a item remove element. - MSB4162: <{0}> 無效。子項目不允許在項目移除項目之下。 - {StrBegin="MSB4162: "} - - MSB4162: <{0}> ist ungültig. Untergeordnete Elemente dürfen nicht unter einem Element Element entfernen. - - fuzzyMatch="15" wordcount="16" adjWordcount="13.6" curWordcount="13.6" - - - MSB4166: Child node "{0}" exited prematurely. Shutting down. - MSB4166: 子節點 "{0}" 不當結束。即將關閉。 - {StrBegin="MSB4166: "} - - MSB4166: Der untergeordnete Knoten "{0}" wurde vorzeitig beendet. Herunterfahren. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4085: A <Choose> must contain at least one <When>. - MSB4085: <Choose> 至少必須包含一個 <When>。 - {StrBegin="MSB4085: "} - - MSB4085: < auswählen > muss mindestens < Wenn >. - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB4114: <Choose> elements cannot be nested more than {0} levels deep. - MSB4114: <Choose> 項目無法放在深於 {0} 層以上的巢狀結構中。 - {StrBegin="MSB4114: "}UE: This message appears if the project file contains unreasonably nested Choose elements. - LOCALIZATION: Do not localize "Choose" as it is an XML element name. - - MSB4114: < auswählen > Elemente können nicht geschachtelt werden mehr als {0} Ebenen. - - fuzzyMatch="15" wordcount="12" adjWordcount="10.2" curWordcount="10.2" - - - MSB4006: There is a circular dependency in the target dependency graph involving target "{0}". - MSB4006: 涉及目標 "{0}" 的目標相依性圖形中有循環相依性。 - {StrBegin="MSB4006: "}UE: This message is shown when the build engine detects a target referenced in a circular manner -- a project cannot - request a target to build itself (perhaps via a chain of other targets). - - MSB4006: Im Zielabhängigkeitsdiagramm besteht eine Ringabhängigkeit im Zusammenhang mit dem Ziel "{0}". - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4086: A numeric comparison was attempted on "{1}" that evaluates to "{2}" instead of a number, in condition "{0}". - MSB4086: 嘗試對條件 "{0}" 中評估為 "{2}" (而非數字) 的 "{1}" 進行數字比較。 - {StrBegin="MSB4086: "} - - MSB4086: Es wurde versucht, einen numerischen Vergleich für "{1}" auszuführen, der zu "{2}" anstatt zu einer Zahl in Bedingung "{0}" ausgewertet wird. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4007: The clause "{0}", specified in the "{1}" attribute is invalid. - MSB4007: "{1}" 屬性中指定的子句 "{0}" 無效。 - {StrBegin="MSB4007: "}UE: This message is shown when the Condition on an element is invalid in some way -- e.g. syntax error, unrecognized operator. - - MSB4007: Die im {1}-Attribut festgelegte {0}-Klausel ist ungültig. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4130: The condition "{0}" may have been evaluated incorrectly in an earlier version of MSBuild. Please verify that the order of the AND and OR clauses is written as intended. To avoid this warning, add parentheses to make the evaluation order explicit. - MSB4130: 條件 "{0}" 在先前的 MSBuild 版本中評估可能有誤。請驗證 AND 和 OR 字句的撰寫順序是否正確。若要避免這項警告,請加入括弧讓評估順序更明確。 - {StrBegin="MSB4130: "} - - MSB4130: Die Bedingung "{0}" ist in einer früheren Version von MSBuild möglicherweise fehlerhaft ausgewertet worden. Stellen Sie sicher, dass die AND- und OR-Klauseln in der beabsichtigten Reihenfolge stehen. Damit diese Warnung nicht angezeigt wird, fügen Sie Klammern hinzu, um die Auswertungsreihenfolge explizit anzugeben. - - fuzzyMatch="101" wordcount="42" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4087: Specified condition "{0}" does not evaluate to a boolean. - MSB4087: 指定的條件 "{0}" 未評估為布林值。 - {StrBegin="MSB4087: "} - - MSB4087: Die angegebene {0}-Bedingung wird nicht zu einem booleschen Wert ausgewertet. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4113: Specified condition "{0}" evaluates to "{1}" instead of a boolean. - MSB4113: 指定的條件 "{0}" 評估為 "{1}",而非布林值。 - {StrBegin="MSB4113: "} - - MSB4113: Die angegebene Bedingung {0} wird zu {1} statt zu einem booleschen Wert ausgewertet. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - {0}, line {1} - {0},第 {1} 行 - - - {0}, Zeile {1} - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - MSB4136: Error reading the toolset information from the configuration file "{0}". {1} - MSB4136: 從組態檔 "{0}" 讀取工具組資訊時發生錯誤。{1} - {StrBegin="MSB4136: "} - - MSB4136: Fehler beim Lesen der Toolsetinformationen aus der Konfigurationsdatei "{0}". {1} - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4008: A conflicting assembly for the task assembly "{0}" has been found at "{1}". - MSB4008: 已在 "{1}" 中發現工作組件 "{0}" 的衝突組件。 - {StrBegin="MSB4008: "}UE: This message is shown when the type/class of a task cannot be resolved uniquely from a single assembly. - - MSB4008: Eine mit der Aufgabenassembly "{0}" in Konflikt stehende Assembly wurde in "{1}" gefunden. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4142: MSBuildToolsPath is not the same as MSBuildBinPath for the ToolsVersion "{0}" defined at "{1}". If both are present they must have the same value. - MSB4142: 對於定義在 "{1}" 的 ToolsVersion "{0}",MSBuildToolsPath 與 MSBuildBinPath 不相同。如果兩者都出現時,它們的值必須相同。 - {StrBegin="MSB4142: "} - - MSB4142: MSBuildToolsPath ist nicht identisch mit MSBuildBinPath für die bei "{1}" definierte ToolsVersion {0}. Wenn beide Pfade vorhanden sind, müssen sie identische Werte haben. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4097: The element <{0}> beneath element <{1}> may not have a custom XML namespace. - MSB4097: 項目 <{1}> 下的項目 <{0}> 可能沒有自訂 XML 命名空間。 - {StrBegin="MSB4097: "} - - MSB4097: Das Element <{0}> unter Element <{1}> möglicherweise keinen benutzerdefinierten XML-Namespace. - - fuzzyMatch="15" wordcount="16" adjWordcount="13.6" curWordcount="13.6" - - - MSB4009: The default tasks file could not be successfully loaded. {0} - MSB4009: 無法順利載入預設的工作檔。{0} - {StrBegin="MSB4009: "}UE: This message is shown when one of the default tasks file (*.tasks) located alongside the MSBuild binaries cannot - be opened/parsed. "{0}" contains a message explaining why. The filename itself is not part of the message but is provided - separately to loggers. - LOCALIZATION: "{0}" is a message from some FX method and is already localized. - - MSB4009: Die Standardaufgabendatei konnte nicht geladen werden. {0} - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4010: The "{0}" files could not be successfully loaded from their expected location "{1}". Default tasks will not be available. {2} - MSB4010: 無法從預期的位置 "{1}" 載入 "{0}" 檔案。預設的工作將無法使用。{2} - {StrBegin="MSB4010: "}UE: This message is shown when the default tasks files that are located alongside the MSBuild binaries cannot be - found, either because they don't exist, or because of lack of permissions. "{2}" contains a message explaining why. - LOCALIZATION: "{2}" is a message from some FX method and is already localized. - - MSB4010: Die {0}-Dateien konnten nicht vom erwarteten Speicherplatz "{1}" geladen werden. Standardaufgaben sind nicht verfügbar. {2} - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - MSB4140: Default tools version is specified in neither the registry nor the configuration file. - MSB4140: 指定的預設工具版本不在登錄中,也不在組態檔中。 - {StrBegin="MSB4140: "} - - MSB4140: Die Standardtoolsversion ist weder in der Registrierung noch in der Konfigurationsdatei angegeben. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4133: A default tools version "{0}" was specified, but its definition could not be found. - MSB4133: 已指定預設工具版本 "{0}",但是找不到它的定義。 - {StrBegin="MSB4133: "} - - MSB4133: Eine Standardtoolsversion "{0}" wurde angegeben, aber ihre Definition konnte nicht gefunden werden. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - MSB4080: The value "{0}" of the "PropertyName" attribute in element <Output> contains a "$" character. If you intended to use a property name then remove the $( ) around the property name. - MSB4080: <Output> 項目中 "PropertyName" 屬性的值 "{0}" 包含 "$" 字元。如果您要使用屬性名稱,請移除屬性名稱前後的 $( )。 - {StrBegin="MSB4080: "}UE: This message is shown when an output tag has an property name that contains an $. They probably typed $(foo) instead of foo in the PropertyName. LOCALIZATION: Output and PropertyName should not be localized. - - MSB4080: Der Wert "{0}" "PropertyName-Attribut im Element < Output >"$"-Zeichen enthält. Wenn Sie auf einen Eigenschaftennamen verwenden und entfernen Sie anschließend die ($), um den Eigenschaftennamen. - - fuzzyMatch="15" wordcount="32" adjWordcount="27.2" curWordcount="27.2" - - - MSB4011: There is a circular reference involving the import of file "{0}". This file may have been imported more than once, or you may have attempted to import the main project file. All except the first instance of this file will be ignored. - MSB4011: 有涉及匯入檔案 "{0}" 的循環參考。這個檔案可能已經匯入一次以上,或者您可能已經嘗試過匯入主要專案檔。除了這個檔案的第一個執行個體以外,將忽略所有的執行個體。 - {StrBegin="MSB4011: "} - - MSB4011: Es besteht eine Ringabhängigkeit im Zusammenhang mit dem Import der Datei {0}. Diese Datei wurde unter Umständen mehrmals importiert, oder es wurde versucht, die Hauptprojektdatei zu importieren. Alle außer der ersten Instanz dieser Datei werden ignoriert. - - fuzzyMatch="101" wordcount="43" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4079: The <ProjectExtensions> element occurs more than once. - MSB4079: <ProjectExtensions> 項目出現一次以上。 - {StrBegin="MSB4079: "} - - MSB4079: Das Element < ProjectExtensions > tritt mehr als einmal. - - fuzzyMatch="15" wordcount="9" adjWordcount="7.65" curWordcount="7.65" - - - MSB4012: The expression "{0}" cannot be used in this context. Item lists cannot be concatenated with other strings where an item list is expected. Use a semicolon to separate multiple item lists. - MSB4012: 此內容中不能使用運算式 "{0}"。項目清單無法與必須是項目清單的其他字串結合在一起使用。請使用分號來分隔多個項目清單。 - {StrBegin="MSB4012: "}UE: This message is shown when the user does not properly specify an item list when an item list is expected - e.g. "badprefix@(foo)badsuffix" instead of "prefix; @(foo); suffix" - - MSB4012: Der Ausdruck {0} kann in diesem Kontext nicht verwendet werden. Elementlisten können nicht mit anderen Zeichenfolgen verkettet werden, wenn eine Elementliste erwartet wird. Verwenden Sie ein Semikolon, um mehrere Elementlisten voneinander zu trennen. - - fuzzyMatch="101" wordcount="32" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Need to specify the project file name. - 必須指定專案檔名。 - UE: This message is shown when the user calls into the engine to build a project without specifying a filename. - - Geben Sie den Projektdateinamen an. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - end of input - 輸入的結尾 - This is the name of the "EndOfInput" token. It is displayed in quotes as the - unexpected char or token when the end of a conditional was unexpectedly reached. - - Ende der Eingabe - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - The previous error was converted to a warning because the task was called with ContinueOnError=true. - 先前的錯誤已轉換成警告,因為工作是以 ContinueOnError=true 呼叫。 - - - Der vorherige Fehler wurde in eine Warnung umgewandelt, da die Aufgabe mit ContinueOnError=true aufgerufen wurde. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - {0} Error(s) - {0} 個錯誤 - - - {0} Fehler - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4159: Error creating the toolset "{0}". {1} - MSB4159: 建立工具組 "{0}" 時發生錯誤。{1} - {StrBegin="MSB4159: "} - - MSB4159: Fehler beim Erstellen des Toolsets "{0}". {1} - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4146: Cannot evaluate the property expression "{0}" found at "{1}". {2} - MSB4146: 無法評估位於 "{1}" 的屬性運算式 "{0}"。{2} - {StrBegin="MSB4146: "} - - MSB4146: Der bei "{1}" gefundene Eigenschaftsausdruck "{0}" kann nicht ausgewertet werden. {2} - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - The <{0}> tag is no longer supported as a child of the <Project> element. Place this tag within a target, and add the name of the target to the "InitialTargets" attribute of the <Project> element. - 不再支援 <{0}> 標記做為 <Project> 項目的子系。請將這個標記置放於目標中,然後將目標的名稱加入 <Project> 項目的 "InitialTargets" 屬性中。 - - - Das <{0}>-Tag nicht als untergeordnetes Element des < Project >-Elements unterstützt. Platzieren Sie dieses Tag in einem Ziel und fügen Sie den Namen des Ziels InitialTargets-Attribut des < Project >-Elements hinzu. - - fuzzyMatch="15" wordcount="38" adjWordcount="32.3" curWordcount="32.3" - - - MSB4100: Expected "{0}" to evaluate to a boolean instead of "{1}", in condition "{2}". - MSB4100: 條件 "{2}" 中的 "{0}" 必須評估為布林值,而非 "{1}"。 - {StrBegin="MSB4100: "} - - MSB4100: Das Ergebnis der Auswertung von {0} war {1}, es wurde jedoch ein boolescher Wert in der {2}-Bedingung erwartet. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4028: The "{0}" task's outputs could not be retrieved from the "{1}" parameter. {2} - MSB4028: 無法從 "{1}" 參數擷取 "{0}" 工作的輸出。{2} - {StrBegin="MSB4028: "} - - MSB4028: Die Ausgaben der {0}-Aufgabe konnten nicht aus dem {1}-Parameter abgerufen werden. {2} - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4014: The build was aborted because of an internal failure. - MSB4014: 由於內部失敗而中止建置。 - {StrBegin="MSB4014: "}UE: This message is shown when an unhandled exception terminates the build. The cause is most likely a programming - error in the build engine. - - MSB4014: Das Erstellen wurde aufgrund eines internen Fehlers abgebrochen. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4015: The build was aborted because the "{0}" logger failed unexpectedly during shutdown. - MSB4015: 由於 "{0}" 記錄器於關機期間發生未預期的失敗,因此已中止建置。 - {StrBegin="MSB4015: "}UE: This message is used for a special exception that is thrown when a logger fails while shutting down (most likely - because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a special - exception to abort the build. - - MSB4015: Das Erstellen wurde abgebrochen, da für die {0}-Protokollierung beim Herunterfahren ein unerwarteter Fehler aufgetreten ist. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4016: The build was aborted because the "{0}" logger failed unexpectedly during initialization. - MSB4016: 由於 "{0}" 記錄器於初始設定期間發生未預期的失敗,因此已中止建置。 - {StrBegin="MSB4016: "}UE: This message is used for a special exception that is thrown when a logger fails while initializing itself (most - likely because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a - special exception to abort the build. - - MSB4016: Das Erstellen wurde abgebrochen, da für die {0}-Protokollierung bei der Initialisierung ein unerwarteter Fehler aufgetreten ist. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4017: The build was aborted because of an unexpected logger failure. - MSB4017: 由於發生未預期的記錄器失敗,因此已中止建置。 - {StrBegin="MSB4017: "}UE: This message is used for a special exception that is thrown when a logger fails while logging an event (most - likely because of a programming error in the logger). When a logger dies, we cannot proceed with the build, and we throw a - special exception to abort the build. - - MSB4017: Das Erstellen wurde wegen eines unerwarteten Protokollierungsfehlers abgebrochen. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4018: The "{0}" task failed unexpectedly. - MSB4018: "{0}" 工作發生未預期的失敗。 - {StrBegin="MSB4018: "}UE: This message is shown when a task terminates because of an unhandled exception. The cause is most likely a - programming error in the task; however, it is also possible that the unhandled exception originated in the engine, and was - surfaced through the task when the task called into the engine. - - MSB4018: Unerwarteter Fehler bei der {0}-Aufgabe. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4165: Failed to receive a response from the child node "{0}" in the timeout period "{1}" ms. Shutting down. - MSB4165: 無法在 "{1}" 毫秒的逾時期限內收到來自子節點 "{0}" 的回應。即將關閉。 - {StrBegin="MSB4165: "} - - MSB4165: Vom untergeordneten Knoten "{0}" wurde innerhalb des Zeitlimits von "{1}" ms keine Antwort empfangen. Herunterfahren. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4088: Condition "{0}" is improperly constructed. - MSB4088: 條件 "{0}" 的建構不正確。 - {StrBegin="MSB4088: "} - - MSB4088: Die {0}-Bedingung ist falsch konstruiert. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4105: Found an unexpected character '{2}' at position {1} in condition "{0}". Did you intend to use "=="? - MSB4105: 條件 "{0}" 的位置 {1} 中找到未預期的字元 '{2}'。是否想要使用 "=="? - {StrBegin="MSB4105: "} - - MSB4105: Ein unerwartetes Zeichen {2} wurde an Position {1} in der {0}-Bedingung gefunden. Wollten Sie "==" verwenden? - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - MSB4106: Expected an item list at position {1} in condition "{0}". Did you forget the closing parenthesis? - MSB4106: 條件 "{0}" 的位置 {1} 中必須是項目清單。是否忘記右括弧? - {StrBegin="MSB4106: "} - - MSB4106: Eine Elementliste wurde an Position {1} in Bedingung {0} erwartet. Haben Sie die schließende Klammer vergessen? - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - MSB4107: Expected an item list at position {1} in condition "{0}". Did you forget the opening parenthesis after the '@'? To use a literal '@', use '%40' instead. - MSB4107: 條件 "{0}" 的位置 {1} 中必須是項目清單。是否忘記 '@' 後面的左括弧?若要使用常值 '@',請改用 '%40'。 - {StrBegin="MSB4107: "} - - MSB4107: Eine Elementliste wurde an Position {1} in Bedingung {0} erwartet. Haben Sie die öffnende Klammer hinter dem Zeichen "@" vergessen? Wenn Sie ein literales "@" verwenden möchten, geben Sie "%40" ein. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4108: Expected an item list at position {1} in condition "{0}". Did you forget to close a quote inside the item list expression? - MSB4108: 條件 "{0}" 的位置 {1} 中必須是項目清單。是否忘記項目清單運算式內的結束引號? - {StrBegin="MSB4108: "} - - MSB4108: Eine Elementliste wurde an Position {1} in Bedingung {0} erwartet. Haben Sie das schließende Anführungszeichen innerhalb des Elementlistenausdrucks vergessen? - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - MSB4109: Expected a property at position {1} in condition "{0}". Did you forget the closing parenthesis? - MSB4109: 條件 "{0}" 的位置 {1} 中必須是項目清單。是否忘記右括弧? - {StrBegin="MSB4109: "} - - MSB4109: Eine Eigenschaft wurde an Position {1} in Bedingung {0} erwartet. Haben Sie die schließende Klammer vergessen? - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB4110: Expected a property at position {1} in condition "{0}". Did you forget the opening parenthesis after the '$'? To use a literal '$', use '%24' instead. - MSB4110: 條件 "{0}" 的位置 {1} 中必須是屬性。是否忘記 '$' 後面的左括弧?若要使用常值 '$',請改用 '%24'。 - {StrBegin="MSB4110: "} - - MSB4110: Eine Eigenschaft wurde an Position {1} in Bedingung {0} erwartet. Haben Sie die öffnende Klammer hinter dem Zeichen "$" vergessen? Wenn Sie eine literales "$" verwenden möchten, geben Sie "%24" ein. - - fuzzyMatch="101" wordcount="27" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4101: Expected a closing quote after position {1} in condition "{0}". - MSB4101: 條件 "{0}" 的位置 {1} 後面必須是結束引號。 - {StrBegin="MSB4101: "} - - MSB4101: Es wurde ein schließendes Anführungszeichen hinter Position {1} in Bedingung {0} erwartet. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4019: The imported project "{0}" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. - MSB4019: 找不到匯入的專案 "{0}"。請確認 <Import> 宣告中的路徑正確,而且檔案存在於磁碟上。 - {StrBegin="MSB4019: "}LOCALIZATION: <Import> should not be localized. - - MSB4019: Das importierte Projekt "{0}" wurde nicht gefunden. Bestätigen Sie den Pfad in der Deklaration < Import > und die Datei auf dem Datenträger vorhanden ist. - - fuzzyMatch="15" wordcount="26" adjWordcount="22.1" curWordcount="22.1" - - - MSB4089: Incorrect number of arguments to function in condition "{0}". Found {1} argument(s) when expecting {2}. - MSB4089: 條件 "{0}" 中函式引數的數目不正確。應該有 {2} 個引數,但卻找到 {1} 個。 - {StrBegin="MSB4089: "} - - MSB4089: Falsche Anzahl von Argumenten für eine Funktion in der Bedingung "{0}". {1} Argument(e) gefunden, obwohl {2} erwartet wurde(n). - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - The "{0}" object specified does not belong to the correct "{1}" object. - 指定的 "{0}" 物件不屬於正確的 "{1}" 物件。 - - - Das angegebene {0}-Objekt gehört nicht zum korrekten {1}-Objekt. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4020: The value "{0}" of the "{1}" attribute in element <{2}> is invalid. - MSB4020: 項目 <{2}> 中 "{1}" 屬性的值 "{0}" 無效。 - {StrBegin="MSB4020: "}UE: This is a generic message that is displayed when we find a project element with an incorrect value for one of its - attributes e.g. <Import Project=""> -- the value of Project should not be an empty string. - - MSB4020: Der Wert "{0}" von der "{1}" Attribut im Element <{2}> ist ungültig. - - fuzzyMatch="15" wordcount="14" adjWordcount="11.9" curWordcount="11.9" - - - MSB4102: The value "{0}" of the "{1}" attribute in element <{2}> is invalid. {3} - MSB4102: 項目 <{2}> 中 "{1}" 屬性的值 "{0}" 無效。{3} - {StrBegin="MSB4102: "}UE: This is a generic message that is displayed when we find a project element with an incorrect value for one of its - attributes. At the end of the message we show the exception text we got trying to use the value. - - MSB4102: Der Wert "{0}" von der "{1}" Attribut im Element <{2}> ist ungültig. {3} - - fuzzyMatch="15" wordcount="15" adjWordcount="12.75" curWordcount="12.75" - - - MSB4021: The "ContinueOnError" attribute of the "{0}" task is not valid. {1} - MSB4021: "{0}" 工作的 "ContinueOnError" 屬性無效。{1} - {StrBegin="MSB4021: "}LOCALIZATION: "ContinueOnError" should not be localized. "{1}" is a message from another exception explaining the problem. - - MSB4021: Das ContinueOnError-Attribut für die {0}-Aufgabe ist ungültig. {1} - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4139: Invalid value for default ToolsVersion is specified in registry key "{0}". - MSB4139: 登錄機碼 "{0}" 中指定的預設 ToolsVersion 值無效。 - {StrBegin="MSB4139: "} - - MSB4139: Im Registrierungsschlüssel "{0}" ist ein ungültiger Wert für die Standard-ToolsVersion angegeben. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4022: The result "{0}" of evaluating the value "{1}" of the "{2}" attribute in element <{3}> is not valid. - MSB4022: 對項目 <{3}> 中 "{2}" 屬性的值 "{1}" 評估的結果 "{0}" 無效。 - {StrBegin="MSB4022: "}UE: This message is shown when the engine is checking the correctness of the value (after evaluating embedded - properties/items) assigned to an XML attribute of an XML element in the project file. - - MSB4022: Das Ergebnis "{0}"der Auswertung des Werts"{1}" von der "{2}" Attribut im Element <{3}> ist ungültig. - - fuzzyMatch="15" wordcount="20" adjWordcount="17" curWordcount="17" - - - "{0}" is not a valid event category. To raise a custom event, use the "{1}" category. - "{0}" 不是有效的事件分類。若要引發自訂事件,請使用 "{1}" 分類。 - - - {0} ist keine gültige Ereigniskategorie. Verwenden Sie die {1}-Kategorie, um ein benutzerdefiniertes Ereignis auszulösen. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - "{0}" is not a valid importance level for events. - "{0}" 不是有效的事件重要性層級。 - - - {0} ist kein gültiger Wert für die Bedeutung eines Ereignisses. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4104: Failed to write to log file "{0}". {1} - MSB4104: 無法寫入記錄檔 "{0}"。{1} - {StrBegin="MSB4104: "}UE: This is shown when the File Logger can't create or write to the file it was instructed to log to. - - MSB4104: Fehler beim Schreiben in die Protokollierungsdatei "{0}". {1} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4024: The imported project file could not be loaded. {0} - MSB4024: 無法載入匯入的專案檔。{0} - {StrBegin="MSB4024: "}UE: This message is shown when an imported project file cannot be loaded because of incorrect XML. The project - filename is not part of the message because it is provided separately to loggers. - LOCALIZATION: {0} is a localized message from the CLR/FX explaining why the project is invalid. - - MSB4024: Die importierte Projektdatei konnte nicht geladen werden. {0} - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - Operation invalid for a persisted item group. - 永續性項目群組的作業無效。 - - - Ungültiger Vorgang für eine persistente Elementgruppe. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Operation invalid for a virtual item group. - 虛擬項目群組的作業無效。 - - - Ungültiger Vorgang für eine virtuelle Elementgruppe. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4071: The value Importance="{0}" in the <Message> element is invalid. Valid values are: High, Normal and Low. - MSB4071: <Message> 項目中的值 Importance="{0}" 無效。有效值為: High、Normal 和 Low。 - {StrBegin="MSB4071: "}UE: This message is shown when a user specifies a value for the importance attribute of Message which is not valid. - The importance enumeration is: High, Normal and Low. Specifying any other importance will result in this message being shown - LOCALIZATION: "Importance" should not be localized. - "Message" should not be localized. - High should not be localized. - Normal should not be localized. - Low should not be localized. - - MSB4071: Der Wert Importance = "{0}" in < Nachricht > Element ist ungültig. Gültige Werte sind: hoch, Normal und niedrig. - - fuzzyMatch="15" wordcount="18" adjWordcount="15.3" curWordcount="15.3" - - - MSB4025: The project file could not be loaded. {0} - MSB4025: 無法載入專案檔。{0} - {StrBegin="MSB4025: "}UE: This message is shown when the project file given to the engine cannot be loaded because the filename/path is - invalid, or due to lack of permissions, or incorrect XML. The project filename is not part of the message because it is - provided separately to loggers. - LOCALIZATION: {0} is a localized message from the CLR/FX explaining why the project is invalid. - - MSB4025: Die Projektdatei konnte nicht geladen werden. {0} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4147: The property "{0}" at "{1}" is invalid. {2} - MSB4147: 位於 "{1}" 的屬性 "{0}" 無效。{2} - {StrBegin="MSB4147: "} - - MSB4147: Die {0}-Eigenschaft bei "{1}" ist ungültig. {2} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - "{0}" is an invalid "ProjectFileEncoding" value. - "{0}" 是無效的 "ProjectFileEncoding" 值。 - LOCALIZATION: "ProjectFileEncoding" should not be localized. - - {0} ist ein ungültiger ProjectFileEncoding-Wert. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4143: The expression "{0}" cannot be evaluated. {1} - MSB4143: 無法評估運算式 "{0}"。{1} - {StrBegin="MSB4143: "} - UE: This message is shown when the user attempts to provide an expression like "$(Registry:HKEY_LOCAL_MACHINE\Software\Vendor\Tools@TaskLocation)" - LOCALIZATION: "{0}" is the expression that was bad. "{1}" is a message from an FX exception that describes why the expression is bad. - - - MSB4143: Der Ausdruck "{0}" kann nicht ausgewertet werden. {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4184: The expression "{0}" cannot be evaluated. {1} - MSB4184: 無法評估運算式 "{0}"。{1} - {StrBegin="MSB4184: "} - Single quotes as the expression will typically have double quotes in it. - UE: This message is shown when the user attempts to provide an expression like "$(SomeProperty.ToLower())" - LOCALIZATION: "{0}" is the expression that was bad. "{1}" is a message from an FX exception that describes why the expression is bad. - - - MSB4184: Der Ausdruck "{0}" kann nicht ausgewertet werden. {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4185: The function "{0}" on type "{1}" has not been enabled for execution. - MSB4185: 類型 "{1}" 上的函式 "{0}" 尚未被啟用成執行。 - {StrBegin="MSB4185: "} - UE: This message is shown when the user attempts to provide an expression like "$([System.DateTime]::Now)", but the expression has not been enabled - LOCALIZATION: "{0}" is the static function name, "{1}" is the .NET Framework type name - - - MSB4185: Die {0}-Funktion für den {1}-Typ wurde nicht für die Ausführung aktiviert. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4186: Invalid static method invocation syntax: "{0}". Static method invocation should be of the form: $([FullTypeName]::Method()), e.g. $([System.IO.Path]::Combine(`a`, `b`)) - MSB4186: 無效的靜態方法引動過程語法: "{0}"。靜態方法引動過程的格式應為: $([FullTypeName]::Method()),例如 $([System.IO.Path]::Combine(`a`, `b`)) - {StrBegin="MSB4186: "} - UE: This message is shown when the user attempts to call a static method on a type, but has used the incorrect syntax - LOCALIZATION: "{0}" is the function expression which is in error - - - MSB4186: Ungültige Aufrufsyntax für statische Methode: "{0}". Für den Aufruf statischer Methoden muss folgendes Format verwendet werden: $([vollständiger Typname]::Methode()), z. B. $([System.IO.Path]::Combine(`a`, `b`)) - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4070: The schema "{0}" is not valid. {1} - MSB4070: 結構描述 "{0}" 無效。{1} - {StrBegin="MSB4070: "}UE: This message is shown when the schema file provided for the validation of a project is itself not valid. - LOCALIZATION: "{0}" is the schema file path. "{1}" is a message from an FX exception that describes why the schema file is bad. - - MSB4070: Das Schema "{0}" ist nicht gültig. {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4026: The "{0}={1}" parameter for the "{2}" task is invalid. - MSB4026: "{2}" 工作的 "{0}={1}" 參數無效。 - {StrBegin="MSB4026: "}UE: This message is displayed when a task has an invalid parameter that cannot be initialized. - - MSB4026: Der {0}={1}-Parameter für die {2}-Aufgabe ist ungültig. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4027: The "{0}" task generated invalid items from the "{1}" output parameter. {2} - MSB4027: "{0}" 工作從 "{1}" 輸出參數產生無效的項目。{2} - {StrBegin="MSB4027: "} - - MSB4027: Die {0}-Aufgabe generierte ungültige Elemente aus dem {1}-Ausgabeparameter. {2} - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4029: The "{0}" task has an invalid output specification. The "TaskParameter" attribute is required, and either the "ItemName" or "PropertyName" attribute must be specified (but not both). - MSB4029: "{0}" 工作有無效的輸出規格。必須有 "TaskParameter" 屬性,而且必須指定 "ItemName" 或 "PropertyName" 其中一個屬性 (但兩者不可以同時指定)。 - {StrBegin="MSB4029: "}LOCALIZATION: "TaskParameter", "ItemName" and "PropertyName" should not be localized. - - MSB4029: Die {0}-Aufgabe enthält eine ungültige Ausgabespezifikation. Das TaskParameter-Attribut ist erforderlich, und es muss entweder das ItemName- oder PropertyName-Attribut angegeben werden (jedoch nicht beide). - - fuzzyMatch="101" wordcount="27" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4030: "{0}" is an invalid value for the "{1}" parameter of the "{3}" task. The "{1}" parameter is of type "{2}". - MSB4030: "{0}" 是 "{3}" 工作 "{1}" 參數的無效值。"{1}" 參數屬於類型 "{2}"。 - {StrBegin="MSB4030: "}UE: This error is shown when a type mis-match occurs between the value assigned to task parameter in the project file - and the type of the .NET property that corresponds to the task parameter. For example, if an int task parameter called "Count" - is assigned the value "x", this error would be displayed: <MyTask Count="x" /> - - MSB4030: "{0}" ist ein ungültiger Wert für den {1}-Parameter der {3}-Aufgabe. Der {1}-Parameter ist vom Typ "{2}". - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - MSB4137: Invalid value specified in the configuration file at "{0}". Property name or tools version name is an empty string. - MSB4137: 位於 "{0}" 的組態檔中指定了無效值。屬性名稱或工具版本名稱是空字串。 - {StrBegin="MSB4137: "} - - MSB4137: In der Konfigurationsdatei ist bei "{0}" ein ungültiger Wert angegeben. Der Eigenschaftenname oder der Toolsversionname ist eine leere Zeichenfolge. - - fuzzyMatch="100" wordcount="20" adjWordcount="5" curWordcount="5" tmLabel="N''" - - - MSB4103: "{0}" is not a valid logger verbosity level. - MSB4103: "{0}" 不是有效的記錄器詳細程度等級。 - {StrBegin="MSB4103: "} - - MSB4103: "{0}" ist kein gültiger Ausführlichkeitsgrad für die Protokollierung. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4163: <ItemDefinitionGroup> is not allowed inside a target. - MSB4163: 目標內部不允許有 <ItemDefinitionGroup>。 - {StrBegin="MSB4163: "} - - MSB4163: < ItemDefinitionGroup > ist in einem Ziel nicht zulässig. - - fuzzyMatch="15" wordcount="9" adjWordcount="7.65" curWordcount="7.65" - - - The specified item does not belong to the current item group. - 指定的項目不屬於目前的項目群組。 - - - Das angegebene Element gehört nicht zu der aktuellen Elementgruppe. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4096: The item "{0}" in item list "{1}" does not define a value for metadata "{2}". In order to use this metadata, either qualify it by specifying %({1}.{2}), or ensure that all items in this list define a value for this metadata. - MSB4096: 項目清單 "{1}" 中的項目 "{0}" 未定義中繼資料 "{2}" 的值。若要使用此中繼資料,請指定 %({1}.{2}) 加以限定,或確保此清單中的所有項目都會為此中繼資料定義值。 - {StrBegin="MSB4096: "} - - MSB4096: Das Element "{0}" in der Elementliste "{1}" definiert keinen Wert für die {2}-Metadaten. Wenn Sie diese Metadaten verwenden möchten, qualifizieren Sie sie, indem Sie %({1}.{2}) angeben, oder vergewissern Sie sich, dass alle Elemente in der Liste einen Wert für diese Metadaten definieren. - - fuzzyMatch="101" wordcount="42" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4099: A reference to an item list at position {1} is not allowed in this condition "{0}". - MSB4099: 這個條件 "{0}" 中,不允許參考至在位置 {1} 的項目清單。 - {StrBegin="MSB4099: "} - - MSB4099: Ein Verweis auf eine Elementliste an Position {1} ist in dieser {0}-Bedingung nicht zulässig. - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - MSB4033: "{0}" is a reserved item metadata, and cannot be redefined as a custom metadata on the item. - MSB4033: "{0}" 是保留的項目中繼資料,不能重新定義為該項目上的自訂中繼資料。 - {StrBegin="MSB4033: "} - - MSB4033: "{0}" sind reservierte Elementmetadaten und können nicht als benutzerdefinierte Metadaten für das Element neu definiert werden. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - An InternalLoggerException can only be thrown by the MSBuild engine. The public constructors of this class cannot be used to create an instance of the exception. - InternalLoggerException 只能由 MSBuild 引擎擲回。此類別的公用建構函式不能用來建立例外狀況的執行個體。 - UE: This message is shown when a user tries to instantiate a special exception called InternalLoggerException through the OM -- - only the engine is allowed to create and throw this exception. - LOCALIZATION: "InternalLoggerException" and "MSBuild" should not be localized. - - Eine InternalLoggerException kann nur durch das MSBuild-Modul ausgelöst werden. Die öffentlichen Konstruktoren dieser Klasse können nicht verwendet werden, um eine Instanz der Ausnahme zu erstellen. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Initial Items: - 初始項目: - - - Ursprüngliche Elemente: - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4083: Expected a Condition attribute on element "{0}". - MSB4083: 在項目 "{0}" 上必須有條件屬性。 - {StrBegin="MSB4083: "} - - MSB4083: Es wurde ein Bedingungsattribut für das {0}-Element erwartet. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4164: The value "{0}" of metadata "{1}" contains an item list expression. Item list expressions are not allowed on default metadata values. - MSB4164: 中繼資料 "{1}" 的值 "{0}" 包含項目清單運算式。預設中繼資料值上不允許有項目清單運算式。 - {StrBegin="MSB4164: "} - - MSB4164: Der Wert "{0}" der {1}-Metadaten enthält einen Elementlistenausdruck. Elementlistenausdrücke sind nicht als Standardwerte für Metadaten zulässig. - - fuzzyMatch="100" wordcount="22" adjWordcount="5.5" curWordcount="5.5" tmLabel="N''" - - - MSBuild is expecting a valid "{0}" object. - MSBuild 需要有效的 "{0}" 物件。 - - - MSBuild erwartet ein gültiges {0}-Objekt. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4035: The required attribute "{0}" is missing from element <{1}>. - MSB4035: 項目 <{1}> 遺漏必要的屬性 "{0}"。 - {StrBegin="MSB4035: "}UE: This message is shown when a user leaves off a required attribute from a project element - e.g. <UsingTask AssemblyName="foo"> -- this is missing the "TaskName" attribute. - - MSB4035: Das erforderliche Attribut "{0}"-Element fehlt <{1}>. - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB4036: The "{0}" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "{1}" directory. - MSB4036: 找不到 "{0}" 工作。請檢查下列事項: 1.) 專案檔中工作的名稱與工作類別的名稱相同。2.) 工作類別是 "public",並且實作 Microsoft.Build.Framework.ITask 介面。3.) 工作是以專案檔中的 <UsingTask> 或在位於 "{1}" 目錄中的 *.tasks 檔案中正確宣告該名稱。 - {StrBegin="MSB4036: "}LOCALIZATION: <UsingTask> and "*.tasks" should not be localized. - - MSB4036: Die "{0}" Task wurde nicht gefunden. Überprüfen Sie Folgendes: 1.) der Name der Aufgabe in der Projektdatei entspricht dem Namen der Aufgabenklasse. 2) die Aufgabenklasse ist "public" und implementiert die Microsoft.Build.Framework.ITask-Schnittstelle. 3) die Aufgabe korrekt mit < UsingTask > deklariert, in der Projektdatei oder in den Tasks-Dateien der "{1}" Verzeichnis. - - fuzzyMatch="15" wordcount="64" adjWordcount="54.4" curWordcount="54.4" - - - MSB4141: MSBuildToolsPath is not specified for the ToolsVersion "{0}" defined at "{1}", or the value specified evaluates to the empty string. - MSB4141: 未針對在 "{1}" 定義的 ToolsVersion "{0}" 指定 MSBuildToolsPath,或者指定的值評估為空字串。 - {StrBegin="MSB4141: "} - - MSB4141: MSBuildToolsPath ist für die bei "{1}" definierte ToolsVersion {0} nicht angegeben, oder der angegebene Wert wird zu einer leeren Zeichenfolge ausgewertet. - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - MSB4031: The "MSBuildVersion" attribute is deprecated. If the project is authored in the MSBuild 2003 format, please remove the attribute from the <Project> tag. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format. - MSB4031: "MSBuildVersion" 屬性已被取代。如果使用 MSBuild 2003 格式設計專案,請將該屬性從 <Project> 標記中移除。如果使用舊版的 1.0 或 1.2 格式設計專案,請將專案轉換成 MSBuild 2003 的格式。 - {StrBegin="MSB4031: "}UE: This message is shown for projects that still contain the "MSBuildVersion" attribute in their <Project> - tag. We no longer need this attribute because the project's XML namespace (i.e. the "xmlns" attribute) gives us all the - version information we need. - LOCALIZATION: "MSBuild", "MSBuildVersion" and <Project> should not be localized. - - MSB4031: Das Attribut "MSBuildVersion" ist veraltet. Wenn das Projekt im Format MSBuild 2003 erstellt wurde, entfernen Sie das Attribut aus dem Tag < Project >. Wenn das Projekt im alten Format 1.0 oder 1.2 erstellt wurde, konvertieren Sie es in das MSBuild 2003-Format. - - fuzzyMatch="15" wordcount="45" adjWordcount="38.25" curWordcount="38.25" - - - MSB4144: Multiple definitions were found for the toolset "{0}". - MSB4144: 找到工具組 "{0}" 的多個定義。 - {StrBegin="MSB4144: "} - - MSB4144: Für das Toolset wurden mehrere Definitionen gefunden "{0}". - - fuzzyMatch="15" wordcount="9" adjWordcount="7.65" curWordcount="7.65" - - - MSB4145: Multiple definitions were found for the property "{0}". - MSB4145: 找到屬性 "{0}" 的多個定義。 - {StrBegin="MSB4145: "} - - MSB4145: Für die {0}-Eigenschaft wurden mehrere Definitionen gefunden. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4082: Choose has more than one <Otherwise> element. - MSB4082: Choose 有一個以上的 <Otherwise> 項目。 - {StrBegin="MSB4082: "} - - MSB4082: Wählen Sie mehrere < Otherwise >-Element enthält. - - fuzzyMatch="15" wordcount="9" adjWordcount="7.65" curWordcount="7.65" - - - This method is only valid for persisted <{0}> elements. - 此方法只對永續性的 <{0}> 項目有效。 - - - Diese Methode ist nur gültig für beibehalten <{0}> Elemente. - - fuzzyMatch="15" wordcount="10" adjWordcount="8.5" curWordcount="8.5" - - - This method is only valid for virtual property groups, not <{0}> elements. - 此方法只對虛擬屬性群組有效,但對 <{0}> 項目無效。 - - - Diese Methode gilt nur für virtuelle Eigenschaftengruppen nicht <{0}> Elemente. - - fuzzyMatch="15" wordcount="13" adjWordcount="11.05" curWordcount="11.05" - - - MSB4038: The element <{0}> must be last under element <{1}>. Found element <{2}> instead. - MSB4038: 項目 <{0}> 必須是項目 <{1}> 下的最後一個項目。反而找到項目 <{2}>。 - {StrBegin="MSB4038: "} - - MSB4038: Das Element <{0}> muss unter Element <{1}>. Element wurde gefunden <{2}> statt. - - fuzzyMatch="15" wordcount="17" adjWordcount="14.45" curWordcount="14.45" - - - MSB4138: Non-string data was specified at the registry location "{0}". - MSB4138: 在登錄位置 "{0}" 指定了非字串資料。 - {StrBegin="MSB4138: "} - - MSB4138: Am Registrierungsspeicherort "{0}" wurden Daten angegeben, die keine Zeichenfolge sind. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4039: No "{0}" element was found in the project file. - MSB4039: 在專案檔中找不到 "{0}" 項目。 - {StrBegin="MSB4039: "} - - MSB4039: Das {0}-Element wurde in der Projektdatei nicht gefunden. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4040: There is no target in the project. - MSB4040: 專案中沒有目標。 - {StrBegin="MSB4040: "} - - MSB4040: Das Projekt enthält kein Ziel. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Removing the "{0}" attribute of an item is not allowed. - 不允許移除項目的 "{0}" 屬性。 - - - Das Löschen des {0}-Attributs eines Elements ist nicht zulässig. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - The object passed in is not part of the project. - 傳遞的物件不是專案的一部分。 - - - Das übergebene Objekt ist nicht Teil des Projekts. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - Overriding target "{0}" in project "{1}" with target "{2}" from project "{3}". - 以來自專案 "{3}" 的目標 "{2}" 覆寫專案 "{1}" 中的目標 "{0}"。 - - - Das Ziel "{0}" im Projekt "{1}" wird durch das Ziel "{2}" aus dem Projekt "{3}" außer Kraft gesetzt. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4167: The parent process unexpectedly exited. Shutting down child node "{0}". - MSB4167: 父處理序意外結束。即將關閉子節點 "{0}"。 - {StrBegin="MSB4167: "} - - MSB4167: Der übergeordnete Prozess wurde unerwartet beendet. Der untergeordnete Knoten "{0}" wird heruntergefahren. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - {0} ms {1} {2} calls - {0} 毫秒 {1} {2} 次呼叫 - - - {0} ms {1} {2} Aufrufe - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - (* = timing was not recorded because of reentrancy) - (* = 由於重新進入,並未記錄執行時間) - - - (* = Zeit wurde aufgrund des erneuten Eintretens nicht aufgezeichnet) - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - This project object has been unloaded from the MSBuild engine and is no longer valid. - 這個專案物件已從 MSBuild 引擎卸載且不再有效。 - - - Dieses Projektobjekt wurde aus dem MSBuild-Modul entladen und ist nicht mehr gültig. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - The project file "{0}" was not found. - 找不到專案檔 "{0}"。 - UE: This message is shown when the user calls into the OM to build a project that doesn't exist on disk. - - Die Projektdatei "{0}" wurde nicht gefunden. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Done building project "{0}" -- FAILED. - 專案 "{0}" 建置完成 -- 失敗。 - - - Die Erstellung des Projekts "{0}" ist abgeschlossen – FEHLER. - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Done building project "{0}". - 專案 "{0}" 建置完成。 - - - Die Erstellung des Projekts "{0}" ist abgeschlossen. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - MSB4041: The default XML namespace of the project must be the MSBuild XML namespace. If the project is authored in the MSBuild 2003 format, please add xmlns="{0}" to the <Project> element. If the project has been authored in the old 1.0 or 1.2 format, please convert it to MSBuild 2003 format. - MSB4041: 專案的預設 XML 命名空間必須是 MSBuild XML 命名空間。如果使用 MSBuild 2003 格式設計專案,請將 xmlns="{0}" 加入至 <Project> 項目。如果是使用舊版的 1.0 或 1.2 格式設計專案,請將專案轉換為 MSBuild 2003 的格式。 - {StrBegin="MSB4041: "}UE: This is a Beta 1 message only. - LOCALIZATION: <Project>, "MSBuild" and "xmlns" should not be localized. - - MSB4041: Der XML-Standardnamespace des Projekts muss MSBuild XML-Namespace. Wenn das Projekt im Format MSBuild 2003 erstellt wurde, fügen Sie Xmlns = "{0}" < Project >-Element. Wenn das Projekt im alten Format 1.0 oder 1.2 erstellt wurde, konvertieren Sie es in das MSBuild 2003-Format. - - fuzzyMatch="15" wordcount="52" adjWordcount="44.2" curWordcount="44.2" - - - Project Performance Summary: - 專案效能摘要: - - - Leistungszusammenfassung für das Projekt: - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - MSB4042: Stopping because of syntax errors in project file. - MSB4042: 由於專案檔中發生語法錯誤而停止。 - {StrBegin="MSB4042: "} - - MSB4042: Prozess aufgrund von Syntaxfehlern in der Projektdatei angehalten. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - Project "{0}" is building "{1}" ({2} target(s)): - 專案 "{0}" 正在建置 "{1}" ({2} 目標): - - - Das Projekt {0} erstellt {1} ({2} Ziel(e)): - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Project "{0}" is building "{1}" (default targets): - 專案 "{0}" 正在建置 "{1}" (預設目標): - - - Das Projekt "{0}" erstellt "{1}" (Standardziele): - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Project "{0}" ({1} target(s)): - 專案 "{0}" ({1} 目標): - - - Projekt "{0}", {1} Ziel(e): - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - Project "{0}" (default targets): - 專案 "{0}" (預設目標): - - - Projekt "{0}" (Standardziele): - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - Done Building Project "{0}" ({1} target(s)). - 專案 "{0}" ({1} 目標) 建置完成。 - - - Die Erstellung von Projekt "{0}" ist abgeschlossen ({1} Ziel(e)). - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Done Building Project "{0}" (default targets). - 專案 "{0}" (預設目標) 建置完成。 - - - Die Erstellung von Projekt "{0}" ist abgeschlossen (Standardziele). - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Done Building Project "{0}" ({1} target(s)) -- FAILED. - 專案 "{0}" ({1} 目標) 建置完成 -- 失敗。 - - - Die Erstellung des Projekts "{0}" ist abgeschlossen, {1} Ziel(e) -- FEHLER. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Done Building Project "{0}" (default targets) -- FAILED. - 專案 "{0}" (預設目標) 建置完成 -- 失敗。 - - - Die Erstellung von Projekt "{0}" ist abgeschlossen (Standardziele) -- FEHLER. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4075: The project file must be opened in the Visual Studio IDE and converted to the latest version before it can be built by MSBuild. - MSB4075: 專案檔必須在 Visual Studio IDE 中開啟,並轉換成最新版本,然後才能由 MSBuild 建置。 - {StrBegin="MSB4075: "} - - MSB4075: Die Projektdatei muss in der Visual Studio IDE geöffnet und in ein aktuelles Versionsformat gebracht werden, bevor sie mit MSBuild erstellt werden kann. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4192: The project file "{0}" is in the ".vcproj" file format, which MSBuild no longer supports. Please convert the project by opening it in the Visual Studio IDE or running the conversion tool, or use MSBuild 3.5 or earlier to build it. - MSB4192: 專案檔 "{0}" 的檔案格式為 ".vcproj",不再受 MSBuild 支援。請在 Visual Studio IDE 中開啟此專案或執行轉換工具加以轉換,或使用 MSBuild 3.5 (含) 先前版本加以重建。 - {StrBegin="MSB4192: "} LOC: ".vcproj" should not be localized - - MSB4192: Die Projektdatei "{0}" ist im VSPROJ-Dateiformat gespeichert, das nicht mehr von MSBuild unterstützt wird. Konvertieren Sie das Projekt, indem Sie es in der Visual Studio IDE öffnen oder das Konvertierungstool ausführen, oder verwenden Sie MSBuild 3.5 oder früher zum Erstellen des Projekts. - - fuzzyMatch="101" wordcount="42" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - The specified property does not belong to the current property group. - 指定的屬性不屬於目前的屬性群組。 - - - Die angegebene Eigenschaft gehört nicht zu der aktuellen Eigenschaftengruppe. - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - Initial Properties: - 初始屬性: - - - Ursprüngliche Eigenschaften: - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4148: The name of a property stored under the registry key "{0}" has zero length. - MSB4148: 儲存在登錄機碼 "{0}" 下的屬性名稱長度為零。 - {StrBegin="MSB4148: "} - - MSB4148: Der Name einer unter dem Registrierungsschlüssel "{0}" gespeicherten Eigenschaft hat eine Länge von Null. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - The property names in the indexer and the "{0}" object do not match. - 索引子和 "{0}" 物件中的屬性名稱不符。 - - - Die Eigenschaftennamen im Indexer und das {0}-Objekt stimmen nicht überein. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4043: The item metadata reference "{0}" is invalid because it is qualified with an item name. Item metadata referenced in transforms do not need to be qualified, because the item name is automatically deduced from the items being transformed. Change "{0}" to "%({1})". - MSB4043: 項目中繼資料參考 "{0}" 無效,因為此參考受到項目名稱限定。在轉換中參考的項目中繼資料不需要限定,因為系統會由正在轉換的項目,自動推算項目名稱。請將 "{0}" 變更為 "%({1})"。 - {StrBegin="MSB4043: "}UE: This message is shown when the user does something like this: @(foo->'%(foo.metadata)'). There is no need to specify - "foo.metadata", because "foo" is automatically deduced. In corollary, "bar.metadata" is not allowed either, where "bar" is a different - item list type. - - MSB4043: Der Elementmetadatenverweis "{0}" ist ungültig, da er mit einem Elementnamen qualifiziert ist. Elementmetadaten, auf die bei Transformationen verwiesen wird, müssen nicht qualifiziert werden, da der Elementname automatisch aus den transformierten Elementen abgeleitet wird. Ändern Sie "{0}" in "%({1})". - - fuzzyMatch="101" wordcount="43" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4135: Error reading the toolset information from the registry location "{0}". {1} - MSB4135: 從登錄位置 "{0}" 讀取工具組資訊時發生錯誤。{1} - {StrBegin="MSB4135: "} - - MSB4135: Fehler beim Lesen der Toolsetinformationen am Registrierungsspeicherort "{0}". {1} - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4044: The "{0}" task was not given a value for the required parameter "{1}". - MSB4044: 沒有為 "{0}" 工作指定必要參數 "{1}" 的值。 - {StrBegin="MSB4044: "}UE: This message is shown when a task parameter designated as "required" is not set in the project file. - - MSB4044: Die {0}-Aufgabe hat keinen Wert für den erforderlichen {1}-Parameter erhalten. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - Validating project using schema file "{0}". - 正在使用結構描述檔 "{0}" 驗證專案。 - LOCALIZATION: "{0}" is the location of the schema file. - - Das Projekt wird anhand der Schemadatei "{0}" überprüft. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4045: Project is not valid. {0} - MSB4045: 專案無效。{0} - {StrBegin="MSB4045: "}UE: This error is shown when the user asks his project to be validated against a schema (/val switch for - MSBuild.exe), and the project has errors. "{0}" contains a message explaining the problem. - LOCALIZATION: "{0}" is a message from the System.XML schema validator and is already localized. - - MSB4045: Ungültiges Projekt. {0} - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4112: The targets in this project have been disabled by the host and therefore cannot be built at this time. This may have been done for security reasons. To enable the targets, the host must set Project.BuildEnabled to "true". - MSB4112: 主機已經停用此專案的目標,因此目前無法建置目標。這樣做可能是基於安全性考量。若要啟用目標,主機必須將 Project.BuildEnabled 設為 "true"。 - {StrBegin="MSB4112: "} - - MSB4112: Die Ziele in diesem Projekt wurden vom Host deaktiviert und können aus diesem Grund derzeit nicht erstellt werden. Die Deaktivierung wurde wahrscheinlich aus Sicherheitsgründen durchgeführt. Wenn Sie die Ziele aktivieren möchten, muss der Host Project.BuildEnabled auf "true" festlegen. - - fuzzyMatch="101" wordcount="39" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4093: The "{0}" parameter of the "{1}" task cannot be written to because it does not have a "set" accessor. - MSB4093: 無法寫入至 "{1}" 工作的 "{0}" 參數,因為它沒有 "set" 存取子。 - {StrBegin="MSB4093: "}UE: This error is shown when a project tries to assign a value to a task parameter that does not have a "set" - accessor on the corresponding .NET property on the task class. - - MSB4093: In den {0}-Parameter der {1}-Aufgabe kann nicht geschrieben werden, da er keinen set-Accessor besitzt. - - fuzzyMatch="100" wordcount="20" adjWordcount="5" curWordcount="5" tmLabel="N''" - - - A shallow clone of this object cannot be created. - 無法建立此物件的淺層複製 (Shallow Clone)。 - - - Ein unechter Klon dieses Objekts kann nicht erstellt werden. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - Skipping target "{0}" because it has no inputs. - 將略過目標 "{0}",因為它沒有輸入。 - - - Das {0}-Ziel wird übersprungen, da es keine Eingaben besitzt. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Though the target has declared its inputs, the input specification only references empty properties and/or empty item lists. - 雖然目標已經宣告其輸入,但輸入規格只參考空白屬性和/或空白項目清單。 - - - Obwohl das Ziel seine Eingaben deklariert hat, verweist die Eingabespezifikation nur auf leere Eigenschaften und/oder leere Elementlisten. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - Skipping target "{0}" because it has no outputs. - 將略過目標 "{0}",因為它沒有輸出。 - - - Das Ziel "{0}" wird übersprungen, da es keine Ausgaben enthält. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Though the target has declared its outputs, the output specification only references empty properties and/or empty item lists. - 雖然目標已經宣告其輸出,但輸出規格只參考空白屬性和/或空白項目清單。 - - - Obwohl das Ziel seine Ausgaben deklariert hat, verweist die Ausgabespezifikation nur auf leere Eigenschaften und/oder leere Elementlisten. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - Skipping target "{0}" because all output files are up-to-date with respect to the input files. - 將略過目標 "{0}",因為所有輸出檔對於其輸入檔而言都已更新。 - - - Das Ziel "{0}" wird übersprungen, da alle Ausgabedateien hinsichtlich der Eingabedateien aktuell sind. - - fuzzyMatch="100" wordcount="15" adjWordcount="3.75" curWordcount="3.75" tmLabel="N''" - - - Input files: {0} - 輸入檔: {0} - {0} is a semicolon-separated list of filenames. - - Eingabedateien: {0} - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Output files: {0} - 輸出檔: {0} - {0} is a semicolon-separated list of filenames. - - Ausgabedateien: {0} - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Building solution configuration "{0}". - 建置方案組態 "{0}"。 - UE: This is not an error, so doesn't need an error code. - - Die Projektmappenkonfiguration "{0}" wird erstellt. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - Using solution cache file "{0}" for configuration "{1}" and tools version "{2}". - 於組態 "{1}" 和工具版本 "{2}" 上使用方案快取檔案 "{0}"。 - UE: This is not an error, so doesn't need an error code. - - Die Projektmappen-Cachedatei "{0}" wird für die Konfiguration "{1}" und die Toolsversion "{2}" verwendet. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Failed to read solution cache file "{0}". {1} Using solution file directly. - 無法讀取方案快取檔案 "{0}"。{1} 將直接使用方案檔。 - UE: This is not a true error, so doesn't need an error code. - - Fehler beim Lesen der Projektmappen-Cachedatei "{0}". {1} Projektmappendatei wird direkt verwendet. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Failed to write solution cache file "{0}". {1} - 無法寫入方案快取檔案 "{0}"。{1} - UE: This is not a true error, so doesn't need an error code. - - Fehler beim Schreiben der Projektmappen-Cachedatei "{0}". {1} - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Solution cache file was created for a "{0}" value of "{1}" but the current value is "{2}". Refreshing cache file. - 已為 "{1}" 的 "{0}" 值建立方案快取檔案,但目前值為 "{2}"。正在重新整理快取檔案。 - UE: This is not an error, so doesn't need an error code. - - Die Projektmappen-Cachedatei wurde für den {0}-Wert "{1}" erstellt, aber der aktuelle Wert ist "{2}". Cachedatei wird aktualisiert. - - fuzzyMatch="100" wordcount="20" adjWordcount="5" curWordcount="5" tmLabel="N''" - - - Solution cache file has an internal version number "{0}" but the current value is "{1}". Refreshing cache file. - 方案快取檔案有個內部版本號碼 "{0}",但是目前的值為 "{1}"。正在重新整理快取檔案。 - UE: This is not an error, so doesn't need an error code. - - Die Projektmappen-Cachedatei hat die interne Versionsnummer "{0}", der aktuelle Wert ist aber "{1}". Cachedatei wird aktualisiert. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - Solution cache file is out of date. Refreshing cache file. {0} - 方案快取檔案已過期。正在重新整理快取檔案。{0} - UE: This is not an error, so doesn't need an error code. - - Die Projektmappen-Cachedatei ist veraltet. Cachedatei wird aktualisiert. {0} - - fuzzyMatch="100" wordcount="11" adjWordcount="2.75" curWordcount="2.75" tmLabel="N''" - - - MSB4160: A circular dependency involving project "{0}" has been detected. - MSB4160: 偵測到與專案 "{0}" 相關的循環相依性。 - {StrBegin="MSB4160: "} - - MSB4160: Eine Ringabhängigkeit im Zusammenhang mit dem Projekt "{0}" wurde erkannt. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4126: The specified solution configuration "{0}" is invalid. Please specify a valid solution configuration using the Configuration and Platform properties (e.g. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU") or leave those properties blank to use the default solution configuration. - MSB4126: 指定的方案組態 "{0}" 無效。請使用組態及平台屬性指定有效的方案組態 (例如 MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform=" Any CPU" ),或空下這些屬性,使用預設方案組態。 - {StrBegin="MSB4126: "}UE: The solution filename is provided separately to loggers. - - MSB4126: Die angegebene Projektmappenkonfiguration "{0}" ist ungültig. Geben Sie mithilfe der Konfigurations- und Plattformeigenschaften eine gültige Projektmappenkonfiguration an (z. B. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU"), oder lassen Sie diese Eigenschaften leer, sodass die Standardprojektmappenkonfiguration verwendet wird. - - fuzzyMatch="101" wordcount="37" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4046: Error reading project file "{0}": {1} - MSB4046: 讀取專案檔 "{0}" 時發生錯誤: {1} - {StrBegin="MSB4046: "} - - MSB4046: Fehler beim Lesen der Projektdatei "{0}": {1} - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4125: The project file name "{0}" is invalid. {1} - MSB4125: 專案檔名 "{0}" 無效。{1} - {StrBegin="MSB4125: "}UE: The solution filename is provided separately to loggers. - - MSB4125: Der Projektdateiname "{0}" ist ungültig. {1} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4051: Project {0} is referencing a project with GUID {1}, but a project with this GUID was not found in the .SLN file. - MSB4051: 專案 {0} 參考 GUID 為 {1} 的專案,但 .SLN 檔中找不到有此 GUID 的專案。 - {StrBegin="MSB4051: "}UE: The solution filename is provided separately to loggers. - - MSB4051: Das Projekt "{0}" verweist auf ein Projekt mit der GUID {1}, in der SLN-Datei wurde jedoch kein Projekt mit dieser GUID gefunden. - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - MSB4078: The project file "{0}" is not supported by MSBuild and cannot be built. - MSB4078: 專案檔 "{0}" 不受 MSBuild 支援,無法建置。 - {StrBegin="MSB4078: "} - - MSB4078: Die Projektdatei "{0}" wird nicht von MSBuild unterstützt und kann nicht erstellt werden. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4054: The solution file must be opened in the Visual Studio IDE and converted to the latest version before it can be built by MSBuild. - MSB4054: 方案檔必須在 Visual Studio IDE 中開啟,並轉換成最新版本,然後才能由 MSBuild 建置。 - {StrBegin="MSB4054: "}UE: The solution filename is provided separately to loggers. - - MSB4054: Die Projektmappendatei muss in der Visual Studio IDE geöffnet und in die neuste Version konvertiert werden, bevor sie mit MSBuild erstellt werden kann. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4121: The project configuration for project "{0}" was not specified in the solution file for the solution configuration "{1}". - MSB4121: 在方案組態 "{1}" 的方案檔中未指定專案 "{0}" 的專案組態。 - {StrBegin="MSB4121: "} - - MSB4121: Die Projektkonfiguration für das Projekt "{0}" wurde nicht in der Projektmappendatei für die Projektmappenkonfiguration "{1}" angegeben. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - The project "{0}" is not selected for building in solution configuration "{1}". - 在方案組態 "{1}" 中未選取要進行建置的專案 "{0}"。 - - UE: This is not an error, so doesn't need an error code. - - - Das Projekt "{0}" ist in der Projektmappenkonfiguration "{1}" nicht zum Erstellen ausgewählt. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4122: Scanning project dependencies for project "{0}" failed. {1} - MSB4122: 掃描專案 "{0}" 的專案相依性失敗。{1} - {StrBegin="MSB4122: "} - - MSB4122: Fehler beim Überprüfen der Projektabhängigkeiten für Projekt "{0}". {1} - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4149: The tools version "{0}" of the solution does not support building projects with a different tools version. - MSB4149: 此方案的工具版本 "{0}" 不支援以另一個工具版本建置專案。 - {StrBegin="MSB4149: "} - - MSB4149: Die Toolsversion {0} der Projektmappe unterstützt das Erstellen von Projekten mit unterschiedlichen Toolsversionen nicht. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - Web projects do not support the "Clean" target. Continuing with remaining projects ... - Web 專案不支援 "Clean" 目標。將繼續執行其他專案... - UE: This is not an error, so doesn't need an error code. - LOCALIZATION: Do not localize "Clean". - - Webprojekte unterstützen das Clean-Ziel nicht. Verbleibende Projekte werden fortgesetzt... - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Web projects do not support the "Publish" target. Continuing with remaining projects ... - Web 專案不支援 "Publish" 目標。將繼續執行其他專案... - UE: This is not an error, so doesn't need an error code. - LOCALIZATION: Do not localize "Publish". - - Webprojekte unterstützen das Publish-Ziel nicht. Verbleibende Projekte werden fortgesetzt... - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Skipping because the "$(AspNetConfiguration)" configuration is not supported for this web project. You can use the AspNetConfiguration property to override the configuration used for building web projects, by adding /p:AspNetConfiguration=<value> to the command line. Currently web projects only support Debug and Release configurations. - 將略過,因為此 Web 專案不支援 "$(AspNetConfiguration)" 組態。您可以將 /p:AspNetConfiguration=<value> 加入至命令列,藉此使用 AspNetConfiguration 屬性覆寫用來建置 Web 專案的組態。目前 Web 專案僅支援偵錯和發行組態。 - - UE: This is not an error, so doesn't need an error code. - LOCALIZATION: Do NOT localize "AspNetConfiguration", "Debug", "Release". - - - Da der "$(AspNetConfiguration)" Konfiguration für dieses Webprojekt nicht unterstützt. Verwenden die AspNetConfiguration-Eigenschaft die Konfiguration zum Erstellen von Webprojekten hinzufügen/p: AspNetConfiguration überschreiben = < Wert > in der Befehlszeile. Aktuell unterstützen Webprojekte nur Debug- und Releasekonfigurationen. - - fuzzyMatch="15" wordcount="44" adjWordcount="37.4" curWordcount="37.4" - - - MSB4076: VC projects do not support the "Publish" target. - MSB4076: VC 專案不支援 "Publish" 目標。 - {StrBegin="MSB4076: "}LOCALIZATION: Do not localize "Publish". - - MSB4076: VC-Projekte unterstützen nicht das Publish-Ziel. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4098: MSBuild is invoking VCBuild to build this project. Project-to-project references between VC++ projects (.VCPROJ) and C#/VB/VJ# projects (.CSPROJ, .VBPROJ, .VJSPROJ) are not supported by the command-line build systems when building stand-alone VC++ projects. Projects that contain such project-to-project references will fail to build. Please build the solution file containing this project instead. - MSB4098: MSBuild 正在叫用 VCBuild 來建置此專案。命令列建置系統在建置獨立 VC++ 專案時,不支援 VC++ 專案 (.VCPROJ) 和 C#/VB/VJ# 專案 (.CSPROJ, .VBPROJ, .VJSPROJ) 之間專案對專案間的參考。含有專案對專案間的參考的專案將無法建置。請改為建置含有此專案的方案檔。 - {StrBegin="MSB4098: "} - - MSB4098: MSBuild ruft zum Erstellen dieses Projekts VCBuild auf. Interprojektverweise zwischen VC++-Projekten (.VCPROJ) und C#-/VB-/VJ#-Projekten (.CSPROJ, .VBPROJ, .VJSPROJ) werden beim Erstellen eigenständiger VC++-Projekte von den Befehlszeilen-Buildsystemen nicht unterstützt. Projekte, die solche Interprojektverweise enthalten, werden nicht erstellt. Erstellen Sie stattdessen die Projektmappendatei, die dieses Projekt enthält. - - fuzzyMatch="101" wordcount="53" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4056: The MSBuild engine must be called on a single-threaded-apartment. Current threading model is "{0}". Proceeding, but some tasks may not function correctly. - MSB4056: 必須在單一執行緒 Apartment 上呼叫 MSBuild 引擎。目前的執行緒模型是 "{0}"。將繼續執行,但有些工作可能無法正確運作。 - {StrBegin="MSB4056: "} - - MSB4056: Das MSBuild-Modul muss in einem Singlethread-Apartment aufgerufen werden. Das aktuelle Threadmodell ist {0}. Der Vorgang wird fortgesetzt, aber einige Aufgaben werden möglicherweise nicht ordnungsgemäß ausgeführt. - - fuzzyMatch="100" wordcount="23" adjWordcount="5.75" curWordcount="5.75" tmLabel="N''" - - - Schema validation - 結構描述驗證 - UE: this fragment is used to describe errors that are caused by schema validation. For example, if a normal error is - displayed like this: "MSBUILD : error MSB0000: This is an error.", then an error from schema validation would look like this: - "MSBUILD : Schema validation error MSB0000: This is an error." - LOCALIZATION: This fragment needs to be localized. - - Schemavalidierung - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Target "{0}" skipped. Previously built unsuccessfully. - 已略過目標 "{0}"。先前的建置無法順利完成。 - - - Das Ziel "{0}" wurde übersprungen. Die vorherige Erstellung war nicht erfolgreich. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Target "{0}" skipped. Previously built successfully. - 已略過目標 "{0}"。先前的建置已順利完成。 - - - Das Ziel "{0}" wurde übersprungen. Die vorherige Erstellung war erfolgreich. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4116: The condition "{1}" on the "{0}" target has a reference to item metadata. References to item metadata are not allowed in target conditions unless they are part of an item transform. - MSB4116: "{0}" 目標上的條件 "{1}" 具有對項目中繼資料的參考。在目標條件中不允許有對項目中繼資料的參考,除非這些參考是項目轉換的一部分。 - {StrBegin="MSB4116: "} - - MSB4116: Die Bedingung "{1}" des {0}-Ziels enthält einen Verweis auf Elementmetadaten. Verweise auf Elementmetadaten sind in Zielbedingungen nicht zulässig, es sei denn, sie sind Teil einer Elementtransformation. - - fuzzyMatch="101" wordcount="32" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4057: The target "{0}" does not exist in the project. - MSB4057: 目標 "{0}" 不存在於專案中。 - {StrBegin="MSB4057: "} - - MSB4057: Das Ziel "{0}" ist im Projekt nicht vorhanden. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - Done building target "{0}" in project "{1}" -- FAILED. - 專案 "{1}" 中的目標 "{0}" 建置完成 -- 失敗。 - - - Erstellen des {0}-Ziels in Projekt {1} beendet - Fehler beim Erstellen. - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - Done building target "{0}" in project "{1}". - 專案 "{1}" 中的目標 "{0}" 建置完成。 - - - Die Erstellung des Ziels "{0}" im Projekt "{1}" ist abgeschlossen. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - {0}: (TargetId:{1}) - {0}: (目標 ID:{1}) - - - {0}: (Ziel-ID:{1}) - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4058: The "{0}" target is missing its output specification. If a target declares inputs, it must also declare outputs. - MSB4058: "{0}" 目標遺漏其輸出規格。若目標宣告輸入,其也必須宣告輸出。 - {StrBegin="MSB4058: "} - - MSB4058: Das {0}-Ziel enthält keine Ausgabespezifikation. Wenn ein Ziel Eingaben deklariert, muss es auch Ausgaben deklarieren. - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4168: The item "{0}" of type "{1}" does not define a value for the metadata in the expression "{2}". This expression is used in the target output for target "{3}". If a target declares outputs that are transforms, all items in the transform must have a value for the metadata in the transform. - MSB4168: 類型 "{1}" 的項目 "{0}" 未在運算式 "{2}" 中定義中繼資料的值。此運算式用於目標 "{3}" 的目標輸出中。如果目標宣告了屬於轉換的輸出,則轉換中的所有項目都必須擁有轉換中的中繼資料值。 - {StrBegin="MSB4168: "} - - MSB4168: Das Element "{0}" vom Typ "{1}" definiert keinen Wert für die Metadaten im Ausdruck "{2}". Dieser Ausdruck wird in der Zielausgabe für "{3}" verwendet. Wenn ein Ziel Ausgaben deklariert, bei denen es sich um Transformationen handelt, müssen alle Elemente in der Transformation einen Wert für die in der Transformation enthaltenen Metadaten aufweisen. - - fuzzyMatch="101" wordcount="53" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Target Performance Summary: - 目標效能摘要: - - - Leistungszusammenfassung für das Ziel: - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Target "{0}" skipped, due to false condition; ({1}) was evaluated as ({2}). - 由於 false 條件,因此已略過工作 "{0}"; ({1}) 評估為 ({2})。 - - - Das Ziel "{0}" wurde übersprungen, da die Bedingung "false" war . ({1}) wurde als ({2}) ausgewertet. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Target "{0}" in project "{1}" - 專案 "{1}" 中的目標 "{0}" - - - {0}-Ziel in {1}-Projekt. - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Target {0}: - 目標 {0}: - - - Ziel "{0}": - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Target "{0}" in file "{1}": - 檔案 "{1}" 中的目標 "{0}": - - - Ziel "{0}" in Datei "{1}": - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Build continuing because "{0}" on the task "{1}" is set to "{2}". - 繼續進行建置,因為工作 "{1}" 上的 "{0}" 是設為 "{2}"。 - - - Der Buildvorgang wird fortgesetzt, da {0} in der {1}-Aufgabe auf "{2}" festgelegt ist. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Target {0} from project "{1}": - 專案 "{1}" 的目標 {0}: - - - Ziel "{0}" aus Projekt "{1}": - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Target "{0}" in file "{1}" from project "{2}": - 專案 "{2}" 的檔案 "{1}" 中的目標 "{0}": - - - Ziel "{0}" in Datei "{1}" aus Projekt "{2}": - - fuzzyMatch="100" wordcount="8" adjWordcount="2" curWordcount="2" tmLabel="N''" - - - MSB4060: The "{0}" task has been declared or used incorrectly, or failed during construction. Check the spelling of the task name and the assembly name. - MSB4060: "{0}" 工作已宣告或使用不正確,或者於建構期間失敗。請檢查工作名稱和組件名稱的拼寫是否正確。 - {StrBegin="MSB4060: "} - - MSB4060: Die {0}-Aufgabe wurde falsch deklariert, falsch verwendet oder konnte bei der Erstellung nicht ausgeführt werden. Überprüfen Sie die Schreibweise des Aufgaben- und des Assemblynamens. - - fuzzyMatch="101" wordcount="25" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4077: The "{0}" task has been marked with the attribute LoadInSeparateAppDomain, but does not derive from MarshalByRefObject. Check that the task derives from MarshalByRefObject or AppDomainIsolatedTask. - MSB4077: "{0}" 工作已經以屬性 LoadInSeparateAppDomain 標記,但不是衍生自 MarshalByRefObject。請檢查工作是否衍生自 MarshalByRefObject 或 AppDomainIsolatedTask。 - {StrBegin="MSB4077: "}LOCALIZATION: <LoadInSeparateAppDomain>, <MarshalByRefObject>, <AppDomainIsolatedTask> should not be localized. - - MSB4077: Die Aufgabe "{0}" wurde mit dem LoadInSeparateAppDomain-Attribut markiert, ist jedoch nicht von MarshalByRefObject abgeleitet. Stellen Sie sicher, dass die Aufgabe von MarshalByRefObject oder AppDomainIsolatedTask abgeleitet wird. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Done executing task "{0}" -- FAILED. - 工作 "{0}" 執行完成 -- 失敗。 - - - Die Ausführung von Task "{0}" wurde beendet – FEHLER. - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Done executing task "{0}". - 工作 "{0}" 執行完成。 - - - Die Ausführung von Task "{0}" wurde beendet. - - fuzzyMatch="100" wordcount="4" adjWordcount="1" curWordcount="1" tmLabel="N''" - - - {0} (TaskId:{1}) - {0} (工作 ID:{1}) - - - {0} (Aufgaben-ID: {1}) - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Using "{0}" task from assembly "{1}". - 正在使用組件 "{1}" 中的 "{0}" 工作。 - UE: This informational message helps users determine which assemblies their tasks were loaded from. - - Die {0}-Aufgabe aus der {1}-Assembly wird verwendet. - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - MSB4061: The "{0}" task could not be instantiated from the assembly "{1}". {2} - MSB4061: "{0}" 工作無法從組件 "{1}" 執行個體化。{2} - {StrBegin="MSB4061: "}LOCALIZATION: "{2}" is a localized message from a CLR/FX exception. - - MSB4061: Die {0}-Aufgabe konnte nicht aus der {1}-Assembly instanziiert werden. {2} - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4127: The "{0}" task could not be instantiated from the assembly "{1}". Please verify the task assembly has been built using the same version of the Microsoft.Build.Framework assembly as the one installed on your computer and that your host application is not missing a binding redirect for Microsoft.Build.Framework. {2} - MSB4127: "{0}" 工作無法從組件 "{1}" 執行個體化。請驗證已使用與您電腦上所安裝相同版本的 Microsoft.Build.Framework 組件建置此工作組件,且主機並未遺漏 Microsoft.Build.Framework 的繫結重新導向。{2} - {StrBegin="MSB4127: "}UE: This message is a specialized version of the TaskInstantiationFailureError message and can probably reuse some of its docs. - LOCALIZATION: "{2}" is a localized message from a CLR/FX exception. Also, Microsoft.Build.Framework should not be localized - - MSB4127: Die "{0}"-Aufgabe konnte nicht aus der "{1}"-Assembly instanziiert werden. Überprüfen Sie, ob die Aufgabenassembly mit der gleichen Version der Microsoft.Build.Framework-Assembly erstellt wurde, die auf Ihrem Computer installiert ist, und dass Ihrer Hostanwendung kein BindingRedirect-Eintrag für Microsoft.Build.Framework fehlt. {2} - - fuzzyMatch="101" wordcount="49" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4062: The "{0}" task could not be loaded from the assembly {1}. {2} Confirm that the <UsingTask> declaration is correct, and that the assembly and all its dependencies are available. - MSB4062: "{0}" 工作無法從組件 {1} 載入。{2} 請確認 <UsingTask> 宣告是正確的,並且可以使用組件及其相依性。 - {StrBegin="MSB4062: "}UE: This message is shown when a task cannot be loaded from its assembly for various reasons e.g. corrupt assembly, - invalid task declaration, disk error, etc. "{2}" contains a message explaining what happened. - LOCALIZATION: "{2}" is a message from the CLR loader and is already localized. Also, <UsingTask> should not be localized. - - MSB4062: Die "{0}" Vorgang konnte nicht aus der Assembly geladen werden {1}. {2} Bestätigen < UsingTask > Erklärung richtig ist und die Assembly und die zugehörigen Dateien verfügbar sind. - - fuzzyMatch="15" wordcount="31" adjWordcount="26.35" curWordcount="26.35" - - - MSB4063: The "{0}" task could not be initialized with its input parameters. {1} - MSB4063: 無法以 "{0}" 工作的輸入參數初始化此工作。{1} - {StrBegin="MSB4063: "} - - MSB4063: Die "{0}"-Aufgabe konnte nicht mit ihren Eingabeparametern initialisiert werden. {1} - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - Task Performance Summary: - 工作效能摘要: - - - Leistungszusammenfassung für die Aufgabe: - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Task "{0}" skipped, due to false condition; ({1}) was evaluated as ({2}). - 由於 false 條件,因此已略過工作 "{0}"; ({1}) 評估為 ({2})。 - - - Die {0}-Aufgabe wurde übersprungen, da die Bedingung "false" war . ({1}) wurde als ({2}) ausgewertet. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Task "{0}" - 工作 "{0}" - - - Task "{0}" - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Time Elapsed {0} - 經過時間 {0} - - - Verstrichene Zeit {0} - - fuzzyMatch="100" wordcount="3" adjWordcount="0.75" curWordcount="0.75" tmLabel="N''" - - - Building with tools version "{0}". - 以工具版本 "{0}" 建置。 - - - Erstellung mit der Toolsversion "{0}". - - fuzzyMatch="100" wordcount="5" adjWordcount="1.25" curWordcount="1.25" tmLabel="N''" - - - Project file contains ToolsVersion="{0}". This toolset is unknown or missing. You may be able to resolve this by installing the appropriate .NET Framework for this toolset. Treating the project as if it had ToolsVersion="4.0". - 專案檔包含 ToolsVersion="{0}"。這個 Toolset 未知或遺漏。您可以為這個 Toolset 安裝適當的 .NET Framework,藉此解決這個問題。專案將被視為包含 ToolsVersion="4.0"。 - - - Die Projektdatei enthält ToolsVersion="{0}". Dieses Toolset ist nicht bekannt oder nicht vorhanden. Sie können das Problem möglicherweise beheben, indem Sie das entsprechende .NET Framework für dieses Toolset installieren. Das Projekt wird behandelt als enthielte es ToolsVersion="4.0". - - fuzzyMatch="101" wordcount="34" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - Deferred Messages - 延後的訊息 - - - Zurückgestellte Meldungen - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - Some messages did not display because they were not associated with any ProjectStarted events. Use diagnostic verbosity to view these messages. - 有些訊息並未顯示,因為它們未與任何 ProjectStarted 事件關聯。請利用診斷詳細程度檢視這些訊息。 - - - Einige Meldungen wurden nicht angezeigt, weil sie keinem ProjectStarted-Ereignis zugeordnet sind. Verwenden Sie den Ausführlichkeitsgrad "diagnostic", um diese Meldungen anzuzeigen. - - fuzzyMatch="100" wordcount="21" adjWordcount="5.25" curWordcount="5.25" tmLabel="N''" - - - MSB4090: Found an unexpected character '{2}' at position {1} in condition "{0}". - MSB4090: 條件 "{0}" 的位置 {1} 中找到未預期的字元 '{2}'。 - {StrBegin="MSB4090: "} - - MSB4090: Das unerwartete Zeichen {2} wurde an Position {1} in der {0}-Bedingung gefunden. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4091: Found a call to an undefined function "{1}" in condition "{0}". - MSB4091: 在條件 "{0}" 中找到對未定義函式 "{1}" 的呼叫。 - {StrBegin="MSB4091: "} - - MSB4091: Aufruf zu einer undefinierten Funktion "{1}" in Bedingung "{0}" gefunden. - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - MSB4064: The "{0}" parameter is not supported by the "{1}" task. Verify the parameter exists on the task, and it is a settable public instance property. - MSB4064: "{1}" 工作不支援 "{0}" 參數。請驗證參數位於工作上,且為可設定的公用執行個體屬性。 - {StrBegin="MSB4064: "} - - MSB4064: Der {0}-Parameter wird von der {1}-Aufgabe nicht unterstützt. Vergewissern Sie sich, dass der Parameter in der Aufgabe vorhanden ist und es sich um eine festlegbare öffentliche Instanzeigenschaft handelt. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4131: The "{0}" parameter is not supported by the "{1}" task. Verify the parameter exists on the task, and it is a gettable public instance property. - MSB4131: "{1}" 工作不支援 "{0}" 參數。請驗證參數位於工作上,且為可取得的公用執行個體屬性。 - {StrBegin="MSB4131: "} - - MSB4131: Der {0}-Parameter wird von der {1}-Aufgabe nicht unterstützt. Vergewissern Sie sich, dass der Parameter in der Aufgabe vorhanden ist und es sich um eine abrufbare öffentliche Instanzeigenschaft handelt. - - fuzzyMatch="101" wordcount="26" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4092: An unexpected token "{1}" was found at character position {2} in condition "{0}". - MSB4092: 條件 "{0}" 的字元位置 {2} 中找到未預期的語彙基元 "{1}"。 - {StrBegin="MSB4092: "} - - MSB4092: Ein unerwartetes Token "{1}" wurde an Zeichenposition "{2}" in Bedingung "{0}" gefunden. - - fuzzyMatch="100" wordcount="14" adjWordcount="3.5" curWordcount="3.5" tmLabel="N''" - - - MSB4065: The "{0}" parameter is not marked for output by the "{1}" task. - MSB4065: "{0}" 參數未標記為由 "{1}" 工作輸出。 - {StrBegin="MSB4065: "} - - MSB4065: Der {0}-Parameter ist nicht für die Ausgabe durch die {1}-Aufgabe markiert. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4066: The attribute "{0}" in element <{1}> is unrecognized. - MSB4066: 無法辨認項目 <{1}> 中的屬性 "{0}"。 - {StrBegin="MSB4066: "} - - MSB4066: Das Attribut "{0}" im Element <{1}> wurde nicht erkannt. - - fuzzyMatch="15" wordcount="10" adjWordcount="8.5" curWordcount="8.5" - - - MSB4067: The element <{0}> beneath element <{1}> is unrecognized. - MSB4067: 無法辨認項目 <{1}> 下的項目 <{0}>。 - {StrBegin="MSB4067: "} - - MSB4067: Das Element <{0}> unter Element <{1}> wurde nicht erkannt. - - fuzzyMatch="15" wordcount="11" adjWordcount="9.35" curWordcount="9.35" - - - MSB4068: The element <{0}> is unrecognized, or not supported in this context. - MSB4068: 無法辨認或在此內容中不支援項目 <{0}>。 - {StrBegin="MSB4068: "} - - MSB4068: Das Element <{0}> ist unbekannt oder in diesem Kontext nicht unterstützt. - - fuzzyMatch="15" wordcount="13" adjWordcount="11.05" curWordcount="11.05" - - - MSB4132: The tools version "{0}" is unrecognized. - MSB4132: 工具版本 "{0}" 無法辨認。 - {StrBegin="MSB4132: "} - - MSB4132: Die Toolsversion "{0}" ist unbekannt. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - MSB4069: The "{0}" type of the "{1}" parameter of the "{2}" task is not supported by MSBuild. - MSB4069: MSBuild 不支援 "{2}" 工作之 "{1}" 參數的 "{0}" 類型。 - {StrBegin="MSB4069: "}LOCALIZATION: "MSBuild" should not be localized. - - MSB4069: Der {0}-Typ des {1}-Parameters der {2}-Aufgabe wird von MSBuild nicht unterstützt. - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - MSB4072: A <{0}> element must contain either the "{1}" attribute or the "{2}" attribute (but not both). - MSB4072: <{0}> 項目必須包含 "{1}" 或 "{2}" 其中一個屬性 (但兩者不可以同時包含)。 - {StrBegin="MSB4072: "} - - MSB4072: Ein <{0}>-Element muss entweder die "{1}" Attribut oder "{2}" Attribut (jedoch nicht beide). - - fuzzyMatch="15" wordcount="18" adjWordcount="15.3" curWordcount="15.3" - - - {0} Warning(s) - {0} 個警告 - - - {0} Warnung(en) - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4084: A <When> element may not follow an <Otherwise> element in a <Choose>. - MSB4084: 在 <Choose> 中,<When> 元素不能接在 <Otherwise> 元素後面。 - {StrBegin="MSB4084: "} - - MSB4084: A < >-Element kein Element < Otherwise > < auswählen > folgen. - - fuzzyMatch="15" wordcount="16" adjWordcount="13.6" curWordcount="13.6" - - - Target Name: "{0}" Project Name: "{1}" - 目標名稱: "{0}" 專案名稱: "{1}" - - - Zielname: "{0}" Projektname: "{1}" - - fuzzyMatch="100" wordcount="6" adjWordcount="1.5" curWordcount="1.5" tmLabel="N''" - - - Cycle trace: - 循環追蹤: - - - Schleifenablaufverfolgung: - - fuzzyMatch="100" wordcount="2" adjWordcount="0.5" curWordcount="0.5" tmLabel="N''" - - - MSB4150: Must initialize the console logger using the initialize method before using ApplyParameter - MSB4150: 必須先使用 Initialize 方法初始化主控台記錄器,然後才能使用 ApplyParameter - {StrBegin="MSB4150: "} - - MSB4150: Die Konsolenprotokollierung muss vor der Verwendung von ApplyParameter mithilfe der Initialisierungsmethode initialisiert werden. - - fuzzyMatch="100" wordcount="13" adjWordcount="3.25" curWordcount="3.25" tmLabel="N''" - - - MSB4151: An error occurred while building project "{0}", target "{1}". Please see innerException for detailed information. - MSB4151: 建置專案 "{0}" 時發生錯誤,目標 "{1}"。請參閱 innerException 中的詳細資訊。 - {StrBegin="MSB4151: "} - - MSB4151: Fehler beim Erstellen von Projekt "{0}", Ziel "{1}". Ausführliche Informationen finden Sie in der innerException. - - fuzzyMatch="100" wordcount="16" adjWordcount="4" curWordcount="4" tmLabel="N''" - - - MSB4152: An error occurred on the child node "{0}" and could not be passed to the parent node. {1} - MSB4152: 子節點 "{0}" 上發生錯誤,無法傳遞到父節點。{1} - {StrBegin="MSB4152: "} - - MSB4152: Fehler im untergeordneten Knoten "{0}", der nicht an den übergeordneten Knoten übergeben werden konnte. {1} - - fuzzyMatch="100" wordcount="19" adjWordcount="4.75" curWordcount="4.75" tmLabel="N''" - - - MSB4153: A call is made on an inactive IBuildEngine interface corresponding to a task that already finished execution. - MSB4153: 在對應到已完成工作執行的非現用 IBuildEngine 介面上進行了呼叫。 - {StrBegin="MSB4153: "} - - MSB4153: Eine inaktive IBuildEngine-Schnittstelle wird aufgerufen, der eine Aufgabe entspricht, deren Ausführung bereits abgeschlossen wurde. - - fuzzyMatch="100" wordcount="18" adjWordcount="4.5" curWordcount="4.5" tmLabel="N''" - - - MSB4154: A forwarding logger is attempting to forward BuildFinished event - MSB4154: 有個轉送記錄器正嘗試轉送 BuildFinished 事件 - {StrBegin="MSB4154: "} - - MSB4154: Eine weiterleitende Protokollierung versucht, das BuildFinished-Ereignis weiterzuleiten. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB4155: There was an error while communicating with a node. - MSB4155: 與節點通訊時發生錯誤。 - {StrBegin="MSB4155: "} - - MSB4155: Fehler bei der Kommunikation mit einem Knoten. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - MSB1021: Cannot create an instance of the logger - {0}. - MSB1021: 無法建立記錄器 {0} 的執行個體。 - {StrBegin="MSB1021: "}The error code for this message is duplicated from MSBuild.exe. - - MSB1021: Eine Instanz der Protokollierung kann nicht erstellt werden - {0}. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB1020: The logger {0} was not found. Check the following: 1.) The logger name specified is the same as the name of the logger class. 2.) The logger class is "public" and implements the Microsoft.Build.Framework.ILogger interface. 3.) The path to the logger assembly is correct, or the logger can be loaded using only the assembly name provided. - MSB1020: 找不到記錄器 {0}。請檢查: 1.) 指定的記錄器名稱是否與記錄器類的別名相同。2.) 記錄器類別是否為 "public" 並且實作 Microsoft.Build.Framework.ILogger 介面。3.) 記錄器組件的路徑是否正確、記錄器是否只能使用所提供的組件名稱載入。 - {StrBegin="MSB1020: "}The error code for this message is duplicated from MSBuild.exe. - - MSB1020: Die Protokollierung {0} wurde nicht gefunden. Überprüfen Sie Folgendes: 1.) Der angegebene Name der Protokollierung ist mit dem Namen der Protokollierungsklasse identisch. 2.) Die Protokollierungsklasse ist "public" und implementiert die Microsoft.Build.Framework.ILogger-Schnittstelle. 3.) Der Pfad zur Protokollierungsassembly ist richtig, bzw. die Protokollierung kann alleine mithilfe des angegebenen Assemblynamens geladen werden. - - fuzzyMatch="101" wordcount="57" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - MSB4156: A forwarding logger is attempting to forward BuildStarted event - MSB4156: 有個轉送記錄器正嘗試轉送 BuildStarted 事件 - {StrBegin="MSB4156: "} - - MSB4156: Eine weiterleitende Protokollierung versucht, das BuildStarted-Ereignis weiterzuleiten. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - "{0}" ({1} target) ({2}) -> - "{0}" ({1} 目標) ({2}) -> - - - "{0}" ({1} target) ({2}) -> - - fuzzyMatch="15" wordcount="5" adjWordcount="4.25" curWordcount="4.25" - - - "{0}" (default target) ({1}) -> - "{0}" (預設目標) ({1}) -> - - - "{0}" (Standardziel) ({1}) -> - - fuzzyMatch="15" wordcount="5" adjWordcount="4.25" curWordcount="4.25" - - - {0} {1,5} - {0} {1,5} - - - {0} {1,5} - - fuzzyMatch="15" wordcount="2" adjWordcount="1.7" curWordcount="1.7" - - - Project "{0}" on node {1} ({2} target(s)). - 節點 {1} ({2} 目標) 上的專案 "{0}"。 - - - Projekt "{0}" auf Knoten "{1}", {2} Ziel(e). - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Project "{0}" on node {1} (default targets). - 節點 {1} (預設目標) 上的專案 "{0}"。 - - - Projekt "{0}" auf Knoten "{1}" (Standardziele). - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Project "{0}" ({1}) is building "{2}" ({3}) on node {4} ({5} target(s)). - 專案 "{0}" ({1}) 正在節點 {4} ({5} 目標) 上建置 "{2}" ({3})。 - - - Das Projekt "{0}" ({1}) erstellt "{2}" ({3}) auf Knoten "{4}", {5} Ziel(e). - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - Project "{0}" ({1}) is building "{2}" ({3}) on node {4} (default targets). - 專案 "{0}" ({1}) 正在節點 {4} (預設目標) 上建置 "{2}" ({3})。 - - - Das Projekt "{0}" ({1}) erstellt "{2}" ({3}) auf Knoten "{4}" (Standardziele). - - fuzzyMatch="100" wordcount="12" adjWordcount="3" curWordcount="3" tmLabel="N''" - - - ({0} target) -> - ({0} 目標) -> - - - ({0} Ziel) -> - - fuzzyMatch="15" wordcount="3" adjWordcount="2.55" curWordcount="2.55" - - - MSB4157: The array of project files needs to contain at least one value. - MSB4157: 專案檔陣列至少要包含一個值。 - {StrBegin="MSB4157: "} - - MSB4157: Das Array der Projektdateien muss mindestens einen Wert enthalten. - - fuzzyMatch="15" wordcount="13" adjWordcount="11.05" curWordcount="11.05" - - - MSB4158: The project file name at element {0} is empty. - MSB4158: 位於項目 {0} 的專案檔名稱是空白。 - {StrBegin="MSB4158: "} - - MSB4158: Der Projektdateiname bei Element {0} ist leer. - - fuzzyMatch="100" wordcount="10" adjWordcount="2.5" curWordcount="2.5" tmLabel="N''" - - - The property "{0}" with value "{1}" is being overridden by another batch. The property is now: "{2}" - 另一個批次正在覆寫值為 "{1}" 的屬性 "{0}"。此屬性現在是: "{2}" - - - Die Eigenschaft "{0}" mit dem Wert "{1}" wird von einem anderen Batch überschrieben. Die Eigenschaft ist jetzt: "{2}" - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - Please see inner exception for error information. - 請參閱內部例外狀況中的錯誤資訊。 - - - Fehlerinformationen finden Sie in der internen Ausnahme. - - fuzzyMatch="100" wordcount="7" adjWordcount="1.75" curWordcount="1.75" tmLabel="N''" - - - Event type "{0}" was expected to be serializable. The event was not serializable and has been ignored. - 事件類型 "{0}" 應該可以序列化。此事件不可序列化,已被忽略。 - - - Es wurde erwartet, dass der Typ "{0}" serialisierbar ist. Das Ereignis war nicht serialisierbar und wurde ignoriert. - - fuzzyMatch="100" wordcount="17" adjWordcount="4.25" curWordcount="4.25" tmLabel="N''" - - - The log file path cannot be null or empty. - 記錄檔路徑不可為 null 或空白。 - - - Der Protokolldateipfad darf nicht NULL oder leer sein. - - fuzzyMatch="100" wordcount="9" adjWordcount="2.25" curWordcount="2.25" tmLabel="N''" - - - MSB4161: Project "{0}" was loaded and unloaded during the current build. Reloading a project during the build can result in errors or an inconsistent build state. Either avoid unloading project "{0}" or cache the evaluation results of target(s) "{1}" before unloading the project. - MSB4161: 專案 "{0}" 已在目前建置期間載入和卸載。在建置期間重新載入專案可能會造成錯誤或不一致的建置狀態。請避免卸載專案 "{0}",或於卸載此專案前先快取目標 "{1}" 的評估結果。 - {StrBegin="MSB4161: "} - - MSB4161: Das Projekt "{0}" wurde während der aktuellen Erstellung geladen und entladen. Das erneute Laden eines Projekts während der Erstellung kann zu Fehlern oder einem nicht konsistenten Buildzustand führen. Vermeiden Sie entweder das Entladen des Projekts "{0}", oder speichern Sie die Auswertungsergebnisse der Ziele "{1}" vor dem Entladen des Projekts im Cache. - - fuzzyMatch="101" wordcount="43" adjWordcount="0" curWordcount="0" tmLabel="N''" - - - [default] - [預設] - - - [Standard] - - fuzzyMatch="100" wordcount="1" adjWordcount="0.25" curWordcount="0.25" tmLabel="N''" - - -
-
\ No newline at end of file diff --git a/src/Deprecated/Engine/Shared/AssemblyLoadInfo.cs b/src/Deprecated/Engine/Shared/AssemblyLoadInfo.cs deleted file mode 100644 index 880d20bc416..00000000000 --- a/src/Deprecated/Engine/Shared/AssemblyLoadInfo.cs +++ /dev/null @@ -1,132 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; - -namespace Microsoft.Build.BuildEngine.Shared -{ - /// - /// This class packages information about how to load a given assembly -- an assembly can be loaded by either its assembly - /// name (strong or weak), or its filename/path. - /// - /// SumedhK - internal sealed class AssemblyLoadInfo - { - #region Constructors - - /// - /// This constructor initializes the assembly information. - /// - /// SumedhK - /// - /// - public AssemblyLoadInfo(string assemblyName, string assemblyFile) - { - ErrorUtilities.VerifyThrow((!string.IsNullOrEmpty(assemblyName)) || (!string.IsNullOrEmpty(assemblyFile)), - "We must have either the assembly name or the assembly file/path."); - ErrorUtilities.VerifyThrow((assemblyName == null) || (assemblyFile == null), - "We must not have both the assembly name and the assembly file/path."); - - this.assemblyName = assemblyName; - this.assemblyFile = assemblyFile; - } - - #endregion - - #region Properties - - /// - /// Gets the assembly's identity denoted by its strong/weak name. - /// - /// SumedhK - public string AssemblyName - { - get - { - return assemblyName; - } - } - - /// - /// Gets the path to the assembly file. - /// - /// SumedhK - public string AssemblyFile - { - get - { - return assemblyFile; - } - } - - #endregion - - #region Methods - - /// - /// Retrieves the load information for the assembly. - /// - /// The assembly name, or the assembly file/path. - public override string ToString() - { - if (assemblyName != null) - { - ErrorUtilities.VerifyThrow(assemblyFile == null, - "We cannot have both the assembly name and the assembly file/path."); - - return assemblyName; - } - else - { - ErrorUtilities.VerifyThrow(assemblyFile != null, - "We must have either the assembly name or the assembly file/path."); - - return assemblyFile; - } - } - - /// - /// Computes a hashcode for this assembly info, so this object can be used as a key into - /// a hash table. - /// - /// - /// RGoel - public override int GetHashCode() - { - return ToString().GetHashCode(); - } - - /// - /// Determines if two AssemblyLoadInfos are effectively the same. - /// - /// - /// RGoel - public override bool Equals(Object obj) - { - if (obj == null) - { - return false; - } - - AssemblyLoadInfo otherAssemblyInfo = obj as AssemblyLoadInfo; - - if (otherAssemblyInfo == null) - { - return false; - } - - return (this.AssemblyName == otherAssemblyInfo.AssemblyName) && (this.AssemblyFile == otherAssemblyInfo.AssemblyFile); - } - - #endregion - - // the assembly's identity - private string assemblyName; - // the assembly filename/path - private string assemblyFile; - } -} diff --git a/src/Deprecated/Engine/Shared/AssemblyNameExtension.cs b/src/Deprecated/Engine/Shared/AssemblyNameExtension.cs deleted file mode 100644 index 2f2aa8920eb..00000000000 --- a/src/Deprecated/Engine/Shared/AssemblyNameExtension.cs +++ /dev/null @@ -1,513 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Text; -using System.Reflection; -using System.Globalization; -#if DEBUG -using System.Diagnostics; -#endif - -namespace Microsoft.Build.BuildEngine.Shared -{ - /// - /// A replacement for AssemblyName that optimizes calls to FullName which is expensive. - /// The assembly name is represented internally by an AssemblyName and a string, conversion - /// between the two is done lazily on demand. - /// - [Serializable] - internal sealed class AssemblyNameExtension - { - private AssemblyName asAssemblyName = null; - private string asString = null; - - private static AssemblyNameExtension unnamedAssembly = new AssemblyNameExtension(); - - /// - /// Construct an unnamed assembly. - /// Private because we want only one of these. - /// - private AssemblyNameExtension() - { - } - - /// - /// Construct with AssemblyName. - /// - /// - internal AssemblyNameExtension(AssemblyName assemblyName) - { - asAssemblyName = assemblyName; - } - - /// - /// Construct with string. - /// - /// - internal AssemblyNameExtension(string assemblyName) - { - asString = assemblyName; - } - - /// - /// Construct from a string, but immediately construct a real AssemblyName. - /// This will cause an exception to be thrown up front if the assembly name - /// isn't well formed. - /// - /// - /// The string version of the assembly name. - /// - /// - /// Used when the assembly name comes from a user-controlled source like a project file or config file. - /// Does extra checking on the assembly name and will throw exceptions if something is invalid. - /// - internal AssemblyNameExtension(string assemblyName, bool validate) - { - asString = assemblyName; - - if (validate) - { - // This will throw... - CreateAssemblyName(); - } - } - - /// - /// To be used as a delegate. Gets the AssemblyName of the given file. - /// - /// - /// - internal static AssemblyNameExtension GetAssemblyNameEx(string path) - { - AssemblyName assemblyName = AssemblyName.GetAssemblyName(path); - if (assemblyName == null) - { - return null; - } - return new AssemblyNameExtension(assemblyName); - } - - /// - /// Assume there is a string version, create the AssemblyName version. - /// - private void CreateAssemblyName() - { - if (asAssemblyName == null) - { - asAssemblyName = GetAssemblyNameFromDisplayName(asString); - } - } - - /// - /// Assume there is a string version, create the AssemblyName version. - /// - private void CreateFullName() - { - if (asString == null) - { - asString = asAssemblyName.FullName; - } - } - - /// - /// The base name of the assembly. - /// - /// - internal string Name - { - get - { - // Is there a string? - CreateAssemblyName(); - return asAssemblyName.Name; - } - } - - /// - /// The assembly's version number. - /// - /// - internal Version Version - { - get - { - // Is there a string? - CreateAssemblyName(); - return asAssemblyName.Version; - } - } - - /// - /// Replace the current version with a new version. - /// - /// - internal void ReplaceVersion(Version version) - { - CreateAssemblyName(); - if (asAssemblyName.Version != version) - { - asAssemblyName.Version = version; - - // String would now be invalid. - asString = null; - } - } - - /// - /// The assembly's version number. - /// - /// - internal CultureInfo CultureInfo - { - get - { - // Is there a string? - CreateAssemblyName(); - return asAssemblyName.CultureInfo; - } - } - - /// - /// As an AssemblyName - /// - /// - internal AssemblyName AssemblyName - { - get - { - // Is there a string? - CreateAssemblyName(); - return asAssemblyName; - } - } - - /// - /// The assembly's full name. - /// - /// - internal string FullName - { - get - { - // Is there a string? - CreateFullName(); - return asString; - } - } - - /// - /// Get the assembly's public key token. - /// - /// - internal byte[] GetPublicKeyToken() - { - // Is there a string? - CreateAssemblyName(); - return asAssemblyName.GetPublicKeyToken(); - } - - /// - /// A special "unnamed" instance of AssemblyNameExtension. - /// - /// - internal static AssemblyNameExtension UnnamedAssembly - { - get - { - return unnamedAssembly; - } - } - - /// - /// Compare one assembly name to another. - /// - /// - /// - internal int CompareTo(AssemblyNameExtension that) - { - // Are they identical? - if (this.Equals(that)) - { - return 0; - } - - // Are the base names not identical? - int result = CompareBaseNameTo(that); - if (result != 0) - { - return result; - } - - // We need some collating order for these, alphabetical by FullName seems as good as any. - return String.Compare(this.FullName, that.FullName, StringComparison.OrdinalIgnoreCase); - } - - /// - /// Get a hash code for this assembly name. - /// - /// - internal new int GetHashCode() - { - // Ok, so this isn't a great hashing algorithm. However, basenames with different - // versions or PKTs are relatively uncommon and so collisions should be low. - // Hashing on FullName is wrong because the order of tuple fields is undefined. - int hash = StringComparer.OrdinalIgnoreCase.GetHashCode(this.Name); - return hash; - } - - /// - /// Compare two base names as quickly as possible. - /// - /// - /// - internal int CompareBaseNameTo(AssemblyNameExtension that) - { - int result = CompareBaseNameToImpl(that); -#if DEBUG - // Now, compare to the real value to make sure the result was accurate. - AssemblyName a1 = this.asAssemblyName; - AssemblyName a2 = that.asAssemblyName; - if (a1 == null) - { - a1 = new AssemblyName(this.asString); - } - if (a2 == null) - { - a2 = new AssemblyName(that.asString); - } - - int baselineResult = String.Compare(a1.Name, a2.Name, StringComparison.OrdinalIgnoreCase); - Debug.Assert(result == baselineResult, "Optimized version of CompareBaseNameTo didn't return the same result as the baseline."); -#endif - return result; - } - - /// - /// An implementation of compare that compares two base - /// names as quickly as possible. - /// - /// - /// - private int CompareBaseNameToImpl(AssemblyNameExtension that) - { - // Pointer compare, if identical then base names are - // equal. - if (this == that) - { - return 0; - } - // Do both have assembly names? - if (this.asAssemblyName != null && that.asAssemblyName != null) - { - // Pointer compare. - if (this.asAssemblyName == that.asAssemblyName) - { - return 0; - } - - // Base name compare. - return String.Compare(this.asAssemblyName.Name, that.asAssemblyName.Name, StringComparison.OrdinalIgnoreCase); - } - - // Do both have strings? - if (this.asString != null && that.asString != null) - { - // If we have two random-case strings, then we need to compare case sensitively. - return CompareBaseNamesStringWise(this.asString, that.asString); - } - - // Fall back to comparing by name. This is the slow path. - return String.Compare(this.Name, that.Name, StringComparison.OrdinalIgnoreCase); - } - - /// - /// Compare two basenames. - /// - /// - /// - /// - private static int CompareBaseNamesStringWise(string asString1, string asString2) - { - // Identical strings just match. - if (asString1 == asString2) - { - return 0; - } - - // Get the lengths of base names to compare. - int baseLenThis = asString1.IndexOf(','); - int baseLenThat = asString2.IndexOf(','); - if (baseLenThis == -1) - { - baseLenThis = asString1.Length; - } - if (baseLenThat == -1) - { - baseLenThat = asString2.Length; - } - - // If the lengths are the same then we can compare without copying. - if (baseLenThis == baseLenThat) - { - return String.Compare(asString1, 0, asString2, 0, baseLenThis, StringComparison.OrdinalIgnoreCase); - } - - // Lengths are different, so string copy is required. - string nameThis = asString1.Substring(0, baseLenThis); - string nameThat = asString2.Substring(0, baseLenThat); - return String.Compare(nameThis, nameThat, StringComparison.OrdinalIgnoreCase); - } - - /// - /// Compare two assembly names for equality. - /// - /// - /// - internal bool Equals(AssemblyNameExtension that) - { - // Pointer compare. - if (this == that) - { - return true; - } - - // Do both have assembly names? - if (this.asAssemblyName != null && that.asAssemblyName != null) - { - // Pointer compare. - if (this.asAssemblyName == that.asAssemblyName) - { - return true; - } - } - - // Do both have strings that equal each-other? - if (this.asString != null && that.asString != null) - { - if (this.asString == that.asString) - { - return true; - } - - // If they weren't identical then they might still differ only by - // case. So we can't assume that they don't match. So fall through... - - } - - // Do the names match? - if (!String.Equals(Name, that.Name, StringComparison.OrdinalIgnoreCase)) - { - return false; - } - - // Do the versions match? - if (Version != that.Version) - { - return false; - } - - // Do the Cultures match? - CultureInfo aCulture = CultureInfo; - CultureInfo bCulture = that.CultureInfo; - if (aCulture == null) - { - aCulture = CultureInfo.InvariantCulture; - } - if (bCulture == null) - { - bCulture = CultureInfo.InvariantCulture; - } - if (aCulture.LCID != bCulture.LCID) - { - return false; - } - - // Do the PKTs match? - byte[] aPKT = GetPublicKeyToken(); - byte[] bPKT = that.GetPublicKeyToken(); - - // Some assemblies (real case was interop assembly) may have null PKTs. - if (aPKT == null) - { - aPKT = new byte[0]; - } - if (bPKT == null) - { - bPKT = new byte[0]; - } - - if (aPKT.Length != bPKT.Length) - { - return false; - } - for (int i = 0; i < aPKT.Length; ++i) - { - if (aPKT[i] != bPKT[i]) - { - return false; - } - } - - return true; - } - - /// - /// Only the unnamed assembly has both null assemblyname and null string. - /// - /// - internal bool IsUnnamedAssembly - { - get - { - return asAssemblyName == null && asString == null; - } - } - - /// - /// Given a display name, construct an assembly name. - /// - /// The display name. - /// The assembly name. - private static AssemblyName GetAssemblyNameFromDisplayName(string displayName) - { - AssemblyName assemblyName = new AssemblyName(displayName); - return assemblyName; - } - - /// - /// Return a string that has AssemblyName special characters escaped. - /// Those characters are Equals(=), Comma(,), Quote("), Apostrophe('), Backslash(\). - /// - /// - /// WARNING! This method is not meant as a general purpose escaping method for assembly names. - /// Use only if you really know that this does what you need. - /// - /// - /// - internal static string EscapeDisplayNameCharacters(string displayName) - { - StringBuilder sb = new StringBuilder(displayName); - sb = sb.Replace("\\", "\\\\"); - sb = sb.Replace("=", "\\="); - sb = sb.Replace(",", "\\,"); - sb = sb.Replace("\"", "\\\""); - sb = sb.Replace("'", "\\'"); - return sb.ToString(); - } - - /// - /// Convert to a string for display. - /// - /// - public override string ToString() - { - CreateFullName(); - return this.asString; - } - } -} diff --git a/src/Deprecated/Engine/Shared/BuildEventFileInfo.cs b/src/Deprecated/Engine/Shared/BuildEventFileInfo.cs deleted file mode 100644 index b14dbf94ebc..00000000000 --- a/src/Deprecated/Engine/Shared/BuildEventFileInfo.cs +++ /dev/null @@ -1,189 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Xml; -using System.Xml.Schema; - -namespace Microsoft.Build.BuildEngine.Shared -{ - /// - /// This class encapsulates information about a file that is associated with a build event. - /// - /// SumedhK - internal sealed class BuildEventFileInfo - { - #region Constructors - - /// - /// Private default constructor disallows parameterless instantiation. - /// - /// SumedhK - private BuildEventFileInfo() - { - // do nothing - } - - /// - /// Creates an instance of this class using the given filename/path. - /// - /// SumedhK - /// - internal BuildEventFileInfo(string file) - : this(file, 0, 0, 0, 0) - { - // do nothing - } - - /// - /// Creates an instance of this class using the given filename/path and a line/column of interest in the file. - /// - /// SumedhK - /// - /// Set to zero if not available. - /// Set to zero if not available. - internal BuildEventFileInfo(string file, int line, int column) - : this(file, line, column, 0, 0) - { - // do nothing - } - - /// - /// Creates an instance of this class using the given filename/path and a range of lines/columns of interest in the file. - /// - /// SumedhK - /// - /// Set to zero if not available. - /// Set to zero if not available. - /// Set to zero if not available. - /// Set to zero if not available. - internal BuildEventFileInfo(string file, int line, int column, int endLine, int endColumn) - { - ErrorUtilities.VerifyThrow(file != null, "Need filename/path."); - - this.file = file; - this.line = line; - this.column = column; - this.endLine = endLine; - this.endColumn = endColumn; - } - - /// - /// Creates an instance of this class using the information in the given XmlException. - /// - /// SumedhK - /// - internal BuildEventFileInfo(XmlException e) - { - ErrorUtilities.VerifyThrow(e != null, "Need exception context."); - - this.file = (e.SourceUri.Length == 0) ? String.Empty : new Uri(e.SourceUri).LocalPath; - this.line = e.LineNumber; - this.column = e.LinePosition; - this.endLine = 0; - this.endColumn = 0; - } - - /// - /// Creates an instance of this class using the information in the given XmlSchemaException. - /// - /// SumedhK - /// - internal BuildEventFileInfo(XmlSchemaException e) - { - ErrorUtilities.VerifyThrow(e != null, "Need exception context."); - - this.file = (e.SourceUri.Length == 0) ? String.Empty : new Uri(e.SourceUri).LocalPath; - this.line = e.LineNumber; - this.column = e.LinePosition; - this.endLine = 0; - this.endColumn = 0; - } - - #endregion - - #region Properties - - /// - /// Gets the filename/path to be associated with some build event. - /// - /// SumedhK - /// The filename/path string. - internal string File - { - get - { - return file; - } - } - - /// - /// Gets the line number of interest in the file. - /// - /// SumedhK - /// Line number, or zero if not available. - internal int Line - { - get - { - return line; - } - } - - /// - /// Gets the column number of interest in the file. - /// - /// SumedhK - /// Column number, or zero if not available. - internal int Column - { - get - { - return column; - } - } - - /// - /// Gets the last line number of a range of interesting lines in the file. - /// - /// SumedhK - /// Last line number, or zero if not available. - internal int EndLine - { - get - { - return endLine; - } - } - - /// - /// Gets the last column number of a range of interesting columns in the file. - /// - /// SumedhK - /// Last column number, or zero if not available. - internal int EndColumn - { - get - { - return endColumn; - } - } - - #endregion - - // the filename/path - private string file; - // the line number of interest in the file - private int line; - // the column number of interest in the file - private int column; - // the last line in a range of interesting lines in the file - private int endLine; - // the last column in a range of interesting columns in the file - private int endColumn; - } -} diff --git a/src/Deprecated/Engine/Shared/ConfigurationInSolution.cs b/src/Deprecated/Engine/Shared/ConfigurationInSolution.cs deleted file mode 100644 index 0b9e8f4eedc..00000000000 --- a/src/Deprecated/Engine/Shared/ConfigurationInSolution.cs +++ /dev/null @@ -1,87 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System.Globalization; - -namespace Microsoft.Build.BuildEngine.Shared -{ - /// - /// This represents basic configuration functionality used in solution and project configurations. - /// Since solution configurations don't need anything else, they are represented with this class. - /// - /// LukaszG - internal class ConfigurationInSolution - { - internal const char configurationPlatformSeparator = '|'; - - /// - /// Constructor - /// - /// - /// - /// LukaszG - internal ConfigurationInSolution(string configurationName, string platformName) - { - this.configurationName = configurationName; - this.platformName = platformName; - - // Some configurations don't have the platform part - if (!string.IsNullOrEmpty(platformName)) - { - this.fullName = string.Format(CultureInfo.InvariantCulture, "{0}{1}{2}", configurationName, configurationPlatformSeparator, platformName); - } - else - { - this.fullName = configurationName; - } - } - - private string configurationName; - - /// - /// The configuration part of this, uh, configuration - e.g. "Debug", "Release" - /// - /// LukaszG - internal string ConfigurationName - { - get { return this.configurationName; } - } - - private string platformName; - - /// - /// The platform part of this configuration - e.g. "Any CPU", "Win32" - /// - /// LukaszG - internal string PlatformName - { - get { return this.platformName; } - } - - private string fullName; - - /// - /// The full name of this configuration - e.g. "Debug|Any CPU" - /// - /// LukaszG - internal string FullName - { - get { return this.fullName; } - } - - private BuildItemGroup projectBuildItems; - - /// - /// Build items corresponding to projects built in this configuration - /// - internal BuildItemGroup ProjectBuildItems - { - get { return this.projectBuildItems; } - set { this.projectBuildItems = value; } - } - } -} diff --git a/src/Deprecated/Engine/Shared/ConversionUtilities.cs b/src/Deprecated/Engine/Shared/ConversionUtilities.cs deleted file mode 100644 index 4533e5ba505..00000000000 --- a/src/Deprecated/Engine/Shared/ConversionUtilities.cs +++ /dev/null @@ -1,150 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Globalization; - -using error = Microsoft.Build.BuildEngine.Shared.ErrorUtilities; - -namespace Microsoft.Build.BuildEngine.Shared -{ - /// - /// This class contains only static methods, which are useful throughout many - /// of the MSBuild classes and don't really belong in any specific class. - /// - internal static class ConversionUtilities - { - /// - /// Converts a string to a bool. We consider "true/false", "on/off", and - /// "yes/no" to be valid boolean representations in the XML. - /// - /// The string to convert. - /// Boolean true or false, corresponding to the string. - internal static bool ConvertStringToBool(string parameterValue) - { - if (ValidBooleanTrue(parameterValue)) - { - return true; - } - else if (ValidBooleanFalse(parameterValue)) - { - return false; - } - else - { - // Unsupported boolean representation. - error.VerifyThrowArgument(false, "Shared.CannotConvertStringToBool", parameterValue); - return false; - } - } - - /// - /// Returns true if the string can be successfully converted to a bool, - /// such as "on" or "yes" - /// - internal static bool CanConvertStringToBool(string parameterValue) - { - return ValidBooleanTrue(parameterValue) || ValidBooleanFalse(parameterValue); - } - - /// - /// Returns true if the string represents a valid MSBuild boolean true value, - /// such as "on", "!false", "yes" - /// - private static bool ValidBooleanTrue(string parameterValue) - { - return (String.Equals(parameterValue, "true", StringComparison.OrdinalIgnoreCase)) || - (String.Equals(parameterValue, "on", StringComparison.OrdinalIgnoreCase)) || - (String.Equals(parameterValue, "yes", StringComparison.OrdinalIgnoreCase)) || - (String.Equals(parameterValue, "!false", StringComparison.OrdinalIgnoreCase)) || - (String.Equals(parameterValue, "!off", StringComparison.OrdinalIgnoreCase)) || - (String.Equals(parameterValue, "!no", StringComparison.OrdinalIgnoreCase)); - } - - /// - /// Returns true if the string represents a valid MSBuild boolean false value, - /// such as "!on" "off" "no" "!true" - /// - private static bool ValidBooleanFalse(string parameterValue) - { - return (String.Equals(parameterValue, "false", StringComparison.OrdinalIgnoreCase)) || - (String.Equals(parameterValue, "off", StringComparison.OrdinalIgnoreCase)) || - (String.Equals(parameterValue, "no", StringComparison.OrdinalIgnoreCase)) || - (String.Equals(parameterValue, "!true", StringComparison.OrdinalIgnoreCase)) || - (String.Equals(parameterValue, "!on", StringComparison.OrdinalIgnoreCase)) || - (String.Equals(parameterValue, "!yes", StringComparison.OrdinalIgnoreCase)); - } - - /// - /// Converts a string like "123.456" into a double. Leading sign is allowed. - /// - internal static double ConvertDecimalToDouble(string number) - { - return Double.Parse(number, NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign, CultureInfo.InvariantCulture.NumberFormat); - } - - /// - /// Converts a hex string like "0xABC" into a double. - /// - internal static double ConvertHexToDouble(string number) - { - return (double)Int32.Parse(number.Substring(2), NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture.NumberFormat); - } - - /// - /// Converts a string like "123.456" or "0xABC" into a double. - /// Tries decimal conversion first. - /// - internal static double ConvertDecimalOrHexToDouble(string number) - { - if (ConversionUtilities.ValidDecimalNumber(number)) - { - return ConversionUtilities.ConvertDecimalToDouble(number); - } - else if (ConversionUtilities.ValidHexNumber(number)) - { - return ConversionUtilities.ConvertHexToDouble(number); - } - else - { - ErrorUtilities.VerifyThrow(false, "Cannot numeric evaluate"); - return 0.0D; - } - } - - /// - /// Returns true if the string is a valid hex number, like "0xABC" - /// - private static bool ValidHexNumber(string number) - { - bool canConvert = false; - if (number.Length >= 3 && number[0] == '0' && (number[1] == 'x' || number[1] == 'X')) - { - int value; - canConvert = Int32.TryParse(number.Substring(2), NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture.NumberFormat, out value); - } - return canConvert; - } - - /// - /// Returns true if the string is a valid decimal number, like "-123.456" - /// - private static bool ValidDecimalNumber(string number) - { - double value; - return Double.TryParse(number, NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign, CultureInfo.InvariantCulture.NumberFormat, out value); - } - - /// - /// Returns true if the string is a valid decimal or hex number - /// - internal static bool ValidDecimalOrHexNumber(string number) - { - return ValidDecimalNumber(number) || ValidHexNumber(number); - } - } -} diff --git a/src/Deprecated/Engine/Shared/Delegate.cs b/src/Deprecated/Engine/Shared/Delegate.cs deleted file mode 100644 index e205f233704..00000000000 --- a/src/Deprecated/Engine/Shared/Delegate.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -namespace Microsoft.Build.BuildEngine.Shared -{ - /// - /// GetDirectories delegate - /// - /// The path to get directories for. - /// The pattern to search for. - /// An array of directories. - internal delegate string[] GetDirectories(string path, string pattern); -} diff --git a/src/Deprecated/Engine/Shared/ErrorUtilities.cs b/src/Deprecated/Engine/Shared/ErrorUtilities.cs deleted file mode 100644 index b3d152dc7c8..00000000000 --- a/src/Deprecated/Engine/Shared/ErrorUtilities.cs +++ /dev/null @@ -1,632 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Diagnostics; - -namespace Microsoft.Build.BuildEngine.Shared -{ - /// - /// This class contains methods that are useful for error checking and validation. - /// - /// RGoel, SumedhK - internal static class ErrorUtilities - { - #region LaunchMsBuildDebuggerOnFatalError - /// - /// Will launch the msbuild debugger when the environment variable "MSBuildLaunchDebuggerOnFatalError" is set - /// - internal static void LaunchMsBuildDebuggerOnFatalError() - { - string msBuildLaunchDebuggerOnFatalError = Environment.GetEnvironmentVariable("MSBuildLaunchDebuggerOnFatalError"); - if (!String.IsNullOrEmpty(msBuildLaunchDebuggerOnFatalError)) - { - Debugger.Launch(); - } - } - #endregion - - #region VerifyThrow -- for internal errors - - /// - /// Puts up an assertion dialog in debug builds, and throws an exception in - /// both debug and release builds. Since this is not a no-op in release builds, - /// it should not be called repeatedly in performance-critical scenarios. - /// - /// PERF WARNING: calling a method that takes a variable number of arguments - /// is expensive, because memory is allocated for the array of arguments -- do - /// not call this method repeatedly in performance-critical scenarios - /// - /// RGoel, SumedhK - /// - /// - /// - private static void ThrowInternalError - ( - bool showAssert, - string unformattedMessage, - params object[] args - ) - { - // We ignore showAssert: we don't want to show the assert dialog no matter what. - throw new InternalErrorException(ResourceUtilities.FormatString(unformattedMessage, args)); - } - - /// - /// Puts up an assertion dialog in debug builds, and throws an internal error exception in - /// both debug and release builds. Since this is not a no-op in release builds, - /// it should not be called repeatedly in performance-critical scenarios. - /// This is only for situations that would mean that there is a bug in MSBuild itself. - /// - internal static void ThrowInternalError(string message) - { - throw new InternalErrorException(message); - } - - /// - /// Throws an InternalErrorException if the given condition is false, - /// without showing an assert dialog. Use this method only for conditions - /// that mean bugs in MSBuild code (that is, not expected user exceptions). - /// - /// - /// - internal static void VerifyThrowNoAssert - ( - bool condition, - string unformattedMessage - ) - { - if (!condition) - { - // PERF NOTE: explicitly passing null for the arguments array - // prevents memory allocation - ThrowInternalError(false, unformattedMessage, null); - } - } - - /// - /// This method should be used in places where one would normally put - /// an "assert". It should be used to validate that our assumptions are - /// true, where false would indicate that there must be a bug in our - /// code somewhere. This should not be used to throw errors based on bad - /// user input or anything that the user did wrong. - /// - /// RGoel, SumedhK - /// - /// - internal static void VerifyThrow - ( - bool condition, - string unformattedMessage - ) - { - if (!condition) - { - // PERF NOTE: explicitly passing null for the arguments array - // prevents memory allocation - ThrowInternalError(true, unformattedMessage, null); - } - } - - /// - /// Overload for one string format argument. - /// - /// SumedhK - /// - /// - /// - internal static void VerifyThrow - ( - bool condition, - string unformattedMessage, - object arg0 - ) - { - // PERF NOTE: check the condition here instead of pushing it into - // the ThrowInternalError() method, because that method always - // allocates memory for its variable array of arguments - if (!condition) - { - ThrowInternalError(true, unformattedMessage, arg0); - } - } - - /// - /// Overload for two string format arguments. - /// - /// SumedhK - /// - /// - /// - /// - internal static void VerifyThrowNoAssert - ( - bool condition, - string unformattedMessage, - object arg0, - object arg1 - ) - { - // PERF NOTE: check the condition here instead of pushing it into - // the ThrowInternalError() method, because that method always - // allocates memory for its variable array of arguments - if (!condition) - { - ThrowInternalError(false, unformattedMessage, arg0, arg1); - } - } - - /// - /// Overload for two string format arguments. - /// - /// SumedhK - /// - /// - /// - /// - internal static void VerifyThrow - ( - bool condition, - string unformattedMessage, - object arg0, - object arg1 - ) - { - // PERF NOTE: check the condition here instead of pushing it into - // the ThrowInternalError() method, because that method always - // allocates memory for its variable array of arguments - if (!condition) - { - ThrowInternalError(true, unformattedMessage, arg0, arg1); - } - } - - /// - /// Overload for three string format arguments. - /// - /// SumedhK - /// - /// - /// - /// - /// - internal static void VerifyThrow - ( - bool condition, - string unformattedMessage, - object arg0, - object arg1, - object arg2 - ) - { - // PERF NOTE: check the condition here instead of pushing it into - // the ThrowInternalError() method, because that method always - // allocates memory for its variable array of arguments - if (!condition) - { - ThrowInternalError(true, unformattedMessage, arg0, arg1, arg2); - } - } - - /// - /// Overload for four string format arguments. - /// - /// SumedhK - /// - /// - /// - /// - /// - /// - internal static void VerifyThrow - ( - bool condition, - string unformattedMessage, - object arg0, - object arg1, - object arg2, - object arg3 - ) - { - // PERF NOTE: check the condition here instead of pushing it into - // the ThrowInternalError() method, because that method always - // allocates memory for its variable array of arguments - if (!condition) - { - ThrowInternalError(true, unformattedMessage, arg0, arg1, arg2, arg3); - } - } - - #endregion - - #region VerifyThrowInvalidOperation - - /// - /// Throws an InvalidOperationException. - /// - /// PERF WARNING: calling a method that takes a variable number of arguments - /// is expensive, because memory is allocated for the array of arguments -- do - /// not call this method repeatedly in performance-critical scenarios - /// - /// RGoel, SumedhK - /// - /// - private static void ThrowInvalidOperation - ( - string resourceName, - params object[] args - ) - { -#if DEBUG - ResourceUtilities.VerifyResourceStringExists(resourceName); -#endif - throw new InvalidOperationException(ResourceUtilities.FormatResourceString(resourceName, args)); - } - - /// - /// Throws an InvalidOperationException if the given condition is false. - /// - /// RGoel, SumedhK - /// - /// - internal static void VerifyThrowInvalidOperation - ( - bool condition, - string resourceName - ) - { - if (!condition) - { - // PERF NOTE: explicitly passing null for the arguments array - // prevents memory allocation - ThrowInvalidOperation(resourceName, null); - } - } - - /// - /// Overload for one string format argument. - /// - /// SumedhK - /// - /// - /// - internal static void VerifyThrowInvalidOperation - ( - bool condition, - string resourceName, - object arg0 - ) - { - // PERF NOTE: check the condition here instead of pushing it into - // the ThrowInvalidOperation() method, because that method always - // allocates memory for its variable array of arguments - if (!condition) - { - ThrowInvalidOperation(resourceName, arg0); - } - } - - /// - /// Overload for two string format arguments. - /// - /// SumedhK - /// - /// - /// - /// - internal static void VerifyThrowInvalidOperation - ( - bool condition, - string resourceName, - object arg0, - object arg1 - ) - { - // PERF NOTE: check the condition here instead of pushing it into - // the ThrowInvalidOperation() method, because that method always - // allocates memory for its variable array of arguments - if (!condition) - { - ThrowInvalidOperation(resourceName, arg0, arg1); - } - } - - /// - /// Overload for three string format arguments. - /// - /// SumedhK - /// - /// - /// - /// - /// - internal static void VerifyThrowInvalidOperation - ( - bool condition, - string resourceName, - object arg0, - object arg1, - object arg2 - ) - { - // PERF NOTE: check the condition here instead of pushing it into - // the ThrowInvalidOperation() method, because that method always - // allocates memory for its variable array of arguments - if (!condition) - { - ThrowInvalidOperation(resourceName, arg0, arg1, arg2); - } - } - - #endregion - - #region VerifyThrowArgument - - /// - /// Throws an ArgumentException that can include an inner exception. - /// - /// - /// This method is thread-safe. - /// - /// RGoel, SumedhK - /// Can be null. - /// - /// - internal static void ThrowArgument - ( - string resourceName, - params object[] args - ) - { - ThrowArgument(null, resourceName, args); - } - - /// - /// Throws an ArgumentException that can include an inner exception. - /// - /// - /// This method is thread-safe. - /// - /// RGoel, SumedhK - /// Can be null. - /// - /// - internal static void ThrowArgument - ( - Exception innerException, - string resourceName, - params object[] args - ) - { -#if DEBUG - ResourceUtilities.VerifyResourceStringExists(resourceName); -#endif - throw new ArgumentException( - ResourceUtilities.FormatResourceString(resourceName, args), - innerException); - } - - /// - /// Throws an ArgumentException if the given condition is false. - /// - /// This method is thread-safe. - /// RGoel, SumedhK - /// - /// - internal static void VerifyThrowArgument - ( - bool condition, - string resourceName - ) - { - VerifyThrowArgument(condition, null, resourceName); - } - - /// - /// Overload for one string format argument. - /// - /// This method is thread-safe. - /// SumedhK - /// - /// - /// - internal static void VerifyThrowArgument - ( - bool condition, - string resourceName, - object arg0 - ) - { - VerifyThrowArgument(condition, null, resourceName, arg0); - } - - /// - /// Overload for two string format arguments. - /// - /// This method is thread-safe. - /// SumedhK - /// - /// - /// - /// - internal static void VerifyThrowArgument - ( - bool condition, - string resourceName, - object arg0, - object arg1 - ) - { - VerifyThrowArgument(condition, null, resourceName, arg0, arg1); - } - - /// - /// Throws an ArgumentException that includes an inner exception, if - /// the given condition is false. - /// - /// This method is thread-safe. - /// SumedhK - /// - /// Can be null. - /// - internal static void VerifyThrowArgument - ( - bool condition, - Exception innerException, - string resourceName - ) - { - if (!condition) - { - // PERF NOTE: explicitly passing null for the arguments array - // prevents memory allocation - ThrowArgument(innerException, resourceName, null); - } - } - - /// - /// Overload for one string format argument. - /// - /// This method is thread-safe. - /// SumedhK - /// - /// - /// - /// - internal static void VerifyThrowArgument - ( - bool condition, - Exception innerException, - string resourceName, - object arg0 - ) - { - // PERF NOTE: check the condition here instead of pushing it into - // the ThrowArgument() method, because that method always allocates - // memory for its variable array of arguments - if (!condition) - { - ThrowArgument(innerException, resourceName, arg0); - } - } - - /// - /// Overload for two string format arguments. - /// - /// This method is thread-safe. - /// SumedhK - /// - /// - /// - /// - /// - internal static void VerifyThrowArgument - ( - bool condition, - Exception innerException, - string resourceName, - object arg0, - object arg1 - ) - { - // PERF NOTE: check the condition here instead of pushing it into - // the ThrowArgument() method, because that method always allocates - // memory for its variable array of arguments - if (!condition) - { - ThrowArgument(innerException, resourceName, arg0, arg1); - } - } - - #endregion - - #region VerifyThrowArgumentXXX - - /// - /// Throws an ArgumentOutOfRangeException using the given parameter name - /// if the condition is false. - /// - /// SumedhK - /// - /// - internal static void VerifyThrowArgumentOutOfRange(bool condition, string parameterName) - { - if (!condition) - { - throw new ArgumentOutOfRangeException(parameterName); - } - } - - /// - /// Throws an ArgumentNullException if the given string parameter is null - /// and ArgumentException if it has zero length. - /// - /// SumedhK - /// - /// - internal static void VerifyThrowArgumentLength(string parameter, string parameterName) - { - VerifyThrowArgumentNull(parameter, parameterName); - - if (parameter.Length == 0) - { - throw new ArgumentException(ResourceUtilities.FormatResourceString("Shared.ParameterCannotHaveZeroLength", parameterName)); - } - } - - /// - /// Throws an ArgumentNullException if the given parameter is null. - /// - /// This method is thread-safe. - /// SumedhK - /// - /// - internal static void VerifyThrowArgumentNull(object parameter, string parameterName) - { - VerifyThrowArgumentNull(parameter, parameterName, "Shared.ParameterCannotBeNull"); - } - - /// - /// Throws an ArgumentNullException if the given parameter is null. - /// - /// This method is thread-safe. - /// SumedhK - /// - /// - internal static void VerifyThrowArgumentNull(object parameter, string parameterName, string resourceName) - { - if (parameter == null) - { - // Most ArgumentNullException overloads append its own rather clunky multi-line message. - // So use the one overload that doesn't. - throw new ArgumentNullException( - ResourceUtilities.FormatResourceString(resourceName, parameterName), - (Exception)null); - } - } - - /// - /// Verifies the given arrays are not null and have the same length - /// - /// - /// - /// - /// - internal static void VerifyThrowArgumentArraysSameLength(Array parameter1, Array parameter2, string parameter1Name, string parameter2Name) - { - VerifyThrowArgumentNull(parameter1, parameter1Name); - VerifyThrowArgumentNull(parameter2, parameter2Name); - - if (parameter1.Length != parameter2.Length) - { - throw new ArgumentException(ResourceUtilities.FormatResourceString("Shared.ParametersMustHaveTheSameLength", parameter1Name, parameter2Name)); - } - } - - #endregion - } -} diff --git a/src/Deprecated/Engine/Shared/EscapingUtilities.cs b/src/Deprecated/Engine/Shared/EscapingUtilities.cs deleted file mode 100644 index a3dba500388..00000000000 --- a/src/Deprecated/Engine/Shared/EscapingUtilities.cs +++ /dev/null @@ -1,199 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Text; -using System.Globalization; - -namespace Microsoft.Build.BuildEngine.Shared -{ - /// - /// This class implements static methods to assist with unescaping of %XX codes - /// in the MSBuild file format. - /// - /// RGoel - internal static class EscapingUtilities - { - /// - /// Replaces all instances of %XX in the input string with the character represented - /// by the hexadecimal number XX. - /// - /// - /// unescaped string - internal static string UnescapeAll - ( - string escapedString - ) - { - bool throwAwayBool; - return UnescapeAll(escapedString, out throwAwayBool); - } - - /// - /// Replaces all instances of %XX in the input string with the character represented - /// by the hexadecimal number XX. - /// - /// - /// - /// unescaped string - internal static string UnescapeAll - ( - string escapedString, - out bool escapingWasNecessary - ) - { - ErrorUtilities.VerifyThrow(escapedString != null, "Null strings not allowed."); - - escapingWasNecessary = false; - - // If there are no percent signs, just return the original string immediately. - // Don't even instantiate the StringBuilder. - int indexOfPercent = escapedString.IndexOf('%'); - if (indexOfPercent == -1) - { - return escapedString; - } - - // This is where we're going to build up the final string to return to the caller. - StringBuilder unescapedString = new StringBuilder(); - - int currentPosition = 0; - - // Loop until there are no more percent signs in the input string. - while (indexOfPercent != -1) - { - // There must be two hex characters following the percent sign - // for us to even consider doing anything with this. - if ( - (indexOfPercent <= (escapedString.Length - 3)) && - Uri.IsHexDigit(escapedString[indexOfPercent + 1]) && - Uri.IsHexDigit(escapedString[indexOfPercent + 2]) - ) - { - // First copy all the characters up to the current percent sign into - // the destination. - unescapedString.Append(escapedString, currentPosition, indexOfPercent - currentPosition); - - // Convert the %XX to an actual real character. - string hexString = escapedString.Substring(indexOfPercent + 1, 2); - char unescapedCharacter = (char)int.Parse(hexString, System.Globalization.NumberStyles.HexNumber, - CultureInfo.InvariantCulture); - - // if the unescaped character is not on the exception list, append it - unescapedString.Append(unescapedCharacter); - - // Advance the current pointer to reflect the fact that the destination string - // is up to date with everything up to and including this escape code we just found. - currentPosition = indexOfPercent + 3; - - escapingWasNecessary = true; - } - - // Find the next percent sign. - indexOfPercent = escapedString.IndexOf('%', indexOfPercent + 1); - } - - // Okay, there are no more percent signs in the input string, so just copy the remaining - // characters into the destination. - unescapedString.Append(escapedString, currentPosition, escapedString.Length - currentPosition); - - return unescapedString.ToString(); - } - - /// - /// Adds instances of %XX in the input string where the char to be escaped appears - /// XX is the hex value of the ASCII code for the char. - /// - /// - /// escaped string - internal static string Escape - ( - string unescapedString - ) - { - ErrorUtilities.VerifyThrow(unescapedString != null, "Null strings not allowed."); - - // If there are no special chars, just return the original string immediately. - // Don't even instantiate the StringBuilder. - if (!ContainsReservedCharacters(unescapedString)) - { - return unescapedString; - } - - // This is where we're going to build up the final string to return to the caller. - StringBuilder escapedString = new StringBuilder(unescapedString); - - // Replace each unescaped special character with an escape sequence one - foreach (char unescapedChar in charsToEscape) - { - int unescapedCharCode = Convert.ToInt32(unescapedChar); - string escapedCharacterCode = string.Format(CultureInfo.InvariantCulture, "%{0:x00}", unescapedCharCode); - escapedString.Replace(unescapedChar.ToString(CultureInfo.InvariantCulture), escapedCharacterCode); - } - - return escapedString.ToString(); - } - - /// - /// Before trying to actually escape the string, it can be useful to call this method to determine - /// if escaping is necessary at all. This can save lots of calls to copy around item metadata - /// that is really the same whether escaped or not. - /// - /// - /// - /// RGoel - private static bool ContainsReservedCharacters - ( - string unescapedString - ) - { - return -1 != unescapedString.IndexOfAny(charsToEscape); - } - - /// - /// Determines whether the string contains the escaped form of '*' or '?'. - /// - /// - /// - /// RGoel - internal static bool ContainsEscapedWildcards - ( - string escapedString - ) - { - if (-1 != escapedString.IndexOf('%')) - { - // It has a '%' sign. We have promise. - if ( - (-1 != escapedString.IndexOf("%2", StringComparison.Ordinal)) || - (-1 != escapedString.IndexOf("%3", StringComparison.Ordinal)) - ) - { - // It has either a '%2' or a '%3'. This is looking very promising. - return - - (-1 != escapedString.IndexOf("%2a", StringComparison.Ordinal)) || - (-1 != escapedString.IndexOf("%2A", StringComparison.Ordinal)) || - (-1 != escapedString.IndexOf("%3f", StringComparison.Ordinal)) || - (-1 != escapedString.IndexOf("%3F", StringComparison.Ordinal)) - ; - } - } - return false; - } - - /// - /// Special characters that need escaping. - /// It's VERY important that the percent character is the FIRST on the list - since it's both a character - /// we escape and use in escape sequences, we can unintentionally escape other escape sequences if we - /// don't process it first. Of course we'll have a similar problem if we ever decide to escape hex digits - /// (that would require rewriting the algorithm) but since it seems unlikely that we ever do, this should - /// be good enough to avoid complicating the algorithm at this point. - /// - private static char[] charsToEscape = { '%', '*', '?', '@', '$', '(', ')', ';', '\'' }; - } -} diff --git a/src/Deprecated/Engine/Shared/EventArgsFormatting.cs b/src/Deprecated/Engine/Shared/EventArgsFormatting.cs deleted file mode 100644 index 2ab8b3b6a5b..00000000000 --- a/src/Deprecated/Engine/Shared/EventArgsFormatting.cs +++ /dev/null @@ -1,259 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Globalization; -using System.Text; - -using Microsoft.Build.Framework; - -namespace Microsoft.Build.BuildEngine.Shared -{ - /// - /// Offers a default string format for Error and Warning events - /// - internal static class EventArgsFormatting - { - /// - /// Escape the carriage Return from a string - /// - /// - /// String with carriage returns escaped as \\r - internal static string EscapeCarriageReturn(string stringWithCarriageReturn) - { - if (!string.IsNullOrEmpty(stringWithCarriageReturn)) - { - return stringWithCarriageReturn.Replace("\r", "\\r"); - } - // If the string is null or empty or then we just return the string - return stringWithCarriageReturn; - } - - /// - /// Format the error event message and all the other event data into - /// a single string. - /// - /// t-jeffv - /// Error to format - /// The formatted message string. - internal static string FormatEventMessage(BuildErrorEventArgs e) - { - return FormatEventMessage(e, false); - } - - /// - /// Format the error event message and all the other event data into - /// a single string. - /// - /// t-jeffv - /// Error to format - /// The formatted message string. - internal static string FormatEventMessage(BuildErrorEventArgs e, bool removeCarriageReturn) - { - ErrorUtilities.VerifyThrowArgumentNull(e, nameof(e)); - - // "error" should not be localized - return FormatEventMessage("error", e.Subcategory, removeCarriageReturn ? EscapeCarriageReturn(e.Message) : e.Message, - e.Code, e.File, e.LineNumber, e.EndLineNumber, - e.ColumnNumber, e.EndColumnNumber, e.ThreadId); - } - - /// - /// Format the warning message and all the other event data into a - /// single string. - /// - /// t-jeffv, sumedhk - /// Warning to format - /// The formatted message string. - internal static string FormatEventMessage(BuildWarningEventArgs e) - { - return FormatEventMessage(e, false); - } - - /// - /// Format the warning message and all the other event data into a - /// single string. - /// - /// t-jeffv, sumedhk - /// Warning to format - /// The formatted message string. - internal static string FormatEventMessage(BuildWarningEventArgs e, bool removeCarriageReturn) - { - ErrorUtilities.VerifyThrowArgumentNull(e, nameof(e)); - - // "warning" should not be localized - return FormatEventMessage("warning", e.Subcategory, removeCarriageReturn ? EscapeCarriageReturn(e.Message) : e.Message, - e.Code, e.File, e.LineNumber, e.EndLineNumber, - e.ColumnNumber, e.EndColumnNumber, e.ThreadId); - } - - /// - /// Format the event message and all the other event data into a - /// single string. - /// Internal for unit testing only. - /// - /// t-jeffv, sumedhK - /// category ("error" or "warning") - /// subcategory - /// event message - /// error or warning code number - /// file name - /// line number (0 if n/a) - /// end line number (0 if n/a) - /// column number (0 if n/a) - /// end column number (0 if n/a) - /// thread id - /// The formatted message string. - internal static string FormatEventMessage - ( - string category, - string subcategory, - string message, - string code, - string file, - int lineNumber, - int endLineNumber, - int columnNumber, - int endColumnNumber, - int threadId - ) - { - StringBuilder format = new StringBuilder(); - - // Uncomment these lines to show show the processor, if present. - /* - if (threadId != 0) - { - format.Append("{0}>"); - } - */ - - if (string.IsNullOrEmpty(file)) - { - format.Append("MSBUILD : "); // Should not be localized. - } - else - { - format.Append("{1}"); - - if (lineNumber == 0) - { - format.Append(" : "); - } - else - { - if (columnNumber == 0) - { - if (endLineNumber == 0) - { - format.Append("({2}): "); - } - else - { - format.Append("({2}-{7}): "); - } - } - else - { - if (endLineNumber == 0) - { - if (endColumnNumber == 0) - { - format.Append("({2},{3}): "); - } - else - { - format.Append("({2},{3}-{8}): "); - } - } - else - { - if (endColumnNumber == 0) - { - format.Append("({2}-{7},{3}): "); - } - else - { - format.Append("({2},{3},{7},{8}): "); - } - } - } - } - } - - if (!string.IsNullOrEmpty(subcategory)) - { - format.Append("{9} "); - } - - // The category as a string (should not be localized) - format.Append("{4} "); - - // Put a code in, if available and necessary. - if (code == null) - { - format.Append(": "); - } - else - { - format.Append("{5}: "); - } - - // Put the message in, if available. - if (message != null) - { - format.Append("{6}"); - } - - // A null message is allowed and is to be treated as a blank line. - if (message == null) - { - message = String.Empty; - } - - string finalFormat = format.ToString(); - - // If there are multiple lines, show each line as a separate message. - string[] lines = SplitStringOnNewLines(message); - StringBuilder formattedMessage = new StringBuilder(); - - for (int i = 0; i < lines.Length; i++) - { - formattedMessage.AppendFormat( - CultureInfo.CurrentCulture, finalFormat, - threadId, file, - lineNumber, columnNumber, category, code, - lines[i], endLineNumber, endColumnNumber, - subcategory); - - if (i < (lines.Length - 1)) - { - formattedMessage.AppendLine(); - } - } - - return formattedMessage.ToString(); - } - - /// - /// Splits strings on 'newLines' with tolerance for Everett and Dogfood builds. - /// - /// String to split. - /// t-jeffv, sumedhk - private static string[] SplitStringOnNewLines(string s) - { - string[] subStrings = s.Split(newLines, StringSplitOptions.None); - return subStrings; - } - - /// - /// The kinds of newline breaks we expect. - /// - /// Currently we're not supporting "\r". - private static readonly string[] newLines = { "\r\n", "\n" }; - } -} diff --git a/src/Deprecated/Engine/Shared/ExceptionHandling.cs b/src/Deprecated/Engine/Shared/ExceptionHandling.cs deleted file mode 100644 index bf6a914bc26..00000000000 --- a/src/Deprecated/Engine/Shared/ExceptionHandling.cs +++ /dev/null @@ -1,127 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.IO; -using System.Security; -using System.Reflection; - -namespace Microsoft.Build.BuildEngine.Shared -{ - /// - /// Utility methods for classifying and handling exceptions. - /// - /// JomoF - internal static class ExceptionHandling - { - /// - /// If the given exception is "ignorable under some circumstances" return false. - /// Otherwise it's "really bad", and return true. - /// This makes it possible to catch(Exception ex) without catching disasters. - /// - internal static bool IsCriticalException(Exception e) - { - if - ( - e is StackOverflowException - || e is OutOfMemoryException - || e is AccessViolationException - // ExecutionEngineException has been deprecated by the CLR - ) - { - return true; - } - - return false; - } - - - /// - /// If the given exception is file IO related or expected return false. - /// Otherwise, return true. - /// - /// The exception to check. - internal static bool NotExpectedException(Exception e) - { - if - ( - e is UnauthorizedAccessException - || e is ArgumentNullException - || e is PathTooLongException - || e is DirectoryNotFoundException - || e is NotSupportedException - || e is ArgumentException - || e is SecurityException - || e is IOException - ) - { - return false; - } - - return true; - } - - /// - /// If the given exception is reflection-related return the exception -- or in the case - /// of TargetInvocationException, return the inner exception. - /// Otherwise, return null. - /// - /// - /// The reason we return the exception rather than a bool is that some exceptions need to - /// be "unwrapped" and we want this method to handle that for us. - /// - /// The exception to check. - internal static bool NotExpectedReflectionException(Exception e) - { - // We are explicitly not handling TargetInvocationException. Those are just wrappers around - // exceptions thrown by the called code (such as a task or logger) which callers will typically - // want to treat differently. - - if - ( - e is TypeLoadException // thrown when the common language runtime cannot find the assembly, the type within the assembly, or cannot load the type - || e is MethodAccessException // thrown when a class member is not found or access to the member is not permitted - || e is MissingMethodException // thrown when code in a dependent assembly attempts to access a missing method in an assembly that was modified - || e is MemberAccessException // thrown when a class member is not found or access to the member is not permitted - || e is BadImageFormatException // thrown when the file image of a DLL or an executable program is invalid - || e is ReflectionTypeLoadException // thrown by the Module.GetTypes method if any of the classes in a module cannot be loaded - || e is CustomAttributeFormatException // thrown if a custom attribute on a data type is formatted incorrectly - || e is TargetParameterCountException // thrown when the number of parameters for an invocation does not match the number expected - || e is InvalidCastException - || e is AmbiguousMatchException // thrown when binding to a member results in more than one member matching the binding criteria - || e is InvalidFilterCriteriaException // thrown in FindMembers when the filter criteria is not valid for the type of filter you are using - || e is TargetException // thrown when an attempt is made to invoke a non-static method on a null object. This may occur because the caller does not - // have access to the member, or because the target does not define the member, and so on. - || e is MissingFieldException // thrown when code in a dependent assembly attempts to access a missing field in an assembly that was modified. - || !NotExpectedException(e) // Reflection can throw IO exceptions if the assembly cannot be opened - - ) - { - return false; - } - - return true; - } - - /// - /// Returns false if this is a known exception thrown by function evaluation - /// - internal static bool NotExpectedFunctionException(Exception e) - { - if (e is InvalidCastException - || e is ArgumentNullException - || e is FormatException - || e is InvalidOperationException - || !NotExpectedReflectionException(e)) - { - return false; - } - - return true; - } - } -} diff --git a/src/Deprecated/Engine/Shared/FileMatcher.cs b/src/Deprecated/Engine/Shared/FileMatcher.cs deleted file mode 100644 index a7328b6cf4e..00000000000 --- a/src/Deprecated/Engine/Shared/FileMatcher.cs +++ /dev/null @@ -1,1271 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.IO; -using System.Text; -using System.Diagnostics; -using System.Text.RegularExpressions; - -namespace Microsoft.Build.BuildEngine.Shared -{ - /// - /// Functions for matching file names with patterns. - /// - /// JomoF - internal static class FileMatcher - { - private const string recursiveDirectoryMatch = "**"; - private const string dotdot = ".."; - private static readonly string directorySeparator = new string(Path.DirectorySeparatorChar, 1); - private static readonly string altDirectorySeparator = new string(Path.AltDirectorySeparatorChar, 1); - - private static readonly char[] wildcardCharacters = { '*', '?' }; - internal static readonly char[] directorySeparatorCharacters = { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar }; - private static readonly GetFileSystemEntries defaultGetFileSystemEntries = new GetFileSystemEntries(GetAccessibleFileSystemEntries); - private static readonly DirectoryExists defaultDirectoryExists = new DirectoryExists(Directory.Exists); - - /// - /// The type of entity that GetFileSystemEntries should return. - /// - internal enum FileSystemEntity - { - Files, - Directories, - FilesAndDirectories - }; - - /// - /// Delegate defines the GetFileSystemEntries signature that GetLongPathName uses - /// to enumerate directories on the file system. - /// - /// Files, Directories, or Files and Directories - /// The path to search. - /// The file pattern. - /// - /// - /// The array of filesystem entries. - internal delegate string[] GetFileSystemEntries(FileSystemEntity entityType, string path, string pattern, string projectDirectory, bool stripProjectDirectory); - - /// - /// Returns true if the directory exists and is not a file, otherwise false. - /// - /// The path to check - /// True if the directory exists. - internal delegate bool DirectoryExists(string path); - - /// - /// Determines whether the given path has any wild card characters. - /// - /// - /// - internal static bool HasWildcards(string filespec) - { - return -1 != filespec.IndexOfAny(wildcardCharacters); - } - - /// - /// Get the files and\or folders specified by the given path and pattern. - /// - /// Whether Files, Directories or both. - /// The path to search. - /// The pattern to search. - /// The directory for the project within which the call is made - /// If true the project directory should be stripped - /// - private static string[] GetAccessibleFileSystemEntries(FileSystemEntity entityType, string path, string pattern, string projectDirectory, bool stripProjectDirectory) - { - string[] files = null; - switch (entityType) - { - case FileSystemEntity.Files: files = GetAccessibleFiles(path, pattern, projectDirectory, stripProjectDirectory); break; - case FileSystemEntity.Directories: files = GetAccessibleDirectories(path, pattern); break; - case FileSystemEntity.FilesAndDirectories: files = GetAccessibleFilesAndDirectories(path, pattern); break; - default: - ErrorUtilities.VerifyThrow(false, "Unexpected filesystem entity type."); - break; - } - - return files; - } - - /// - /// Returns an array of file system entries matching the specified search criteria. Inaccessible or non-existent file - /// system entries are skipped. - /// - /// SumedhK,JomoF - /// - /// - /// Array of matching file system entries (can be empty). - private static string[] GetAccessibleFilesAndDirectories(string path, string pattern) - { - string[] entries = null; - - if (Directory.Exists(path)) - { - try - { - entries = Directory.GetFileSystemEntries(path, pattern); - } - // for OS security - catch (UnauthorizedAccessException) - { - // do nothing - } - // for code access security - catch (System.Security.SecurityException) - { - // do nothing - } - } - - if (entries == null) - { - entries = new string[0]; - } - - return entries; - } - - /// - /// Same as Directory.GetFiles(...) except that files that - /// aren't accessible are skipped instead of throwing an exception. - /// - /// Other exceptions are passed through. - /// - /// The path. - /// The pattern. - /// The project directory - /// - /// Files that can be accessed. - private static string[] GetAccessibleFiles - ( - string path, - string filespec, // can be null - string projectDirectory, - bool stripProjectDirectory - ) - { - try - { - // look in current directory if no path specified - string dir = ((path.Length == 0) ? ".\\" : path); - - // get all files in specified directory, unless a file-spec has been provided - string[] files = (filespec == null) - ? Directory.GetFiles(dir) - : Directory.GetFiles(dir, filespec); - - // If the Item is based on a relative path we need to strip - // the current directory from the front - if (stripProjectDirectory) - { - RemoveProjectDirectory(files, projectDirectory); - } - // Files in the current directory are coming back with a ".\" - // prepended to them. We need to remove this; it breaks the - // IDE, which expects just the filename if it is in the current - // directory. But only do this if the original path requested - // didn't itself contain a ".\". - else if (!path.StartsWith(".\\", StringComparison.Ordinal)) - { - RemoveInitialDotSlash(files); - } - - return files; - } - catch (System.Security.SecurityException) - { - // For code access security. - return new string[0]; - } - catch (System.UnauthorizedAccessException) - { - // For OS security. - return new string[0]; - } - } - - /// - /// Same as Directory.GetDirectories(...) except that files that - /// aren't accessible are skipped instead of throwing an exception. - /// - /// Other exceptions are passed through. - /// - /// The path. - /// Pattern to match - /// Accessible directories. - private static string[] GetAccessibleDirectories - ( - string path, - string pattern - ) - { - try - { - string[] directories = null; - - if (pattern == null) - { - directories = Directory.GetDirectories((path.Length == 0) ? ".\\" : path); - } - else - { - directories = Directory.GetDirectories((path.Length == 0) ? ".\\" : path, pattern); - } - - // Subdirectories in the current directory are coming back with a ".\" - // prepended to them. We need to remove this; it breaks the - // IDE, which expects just the filename if it is in the current - // directory. But only do this if the original path requested - // didn't itself contain a ".\". - if (!path.StartsWith(".\\", StringComparison.Ordinal)) - { - RemoveInitialDotSlash(directories); - } - - return directories; - } - catch (System.Security.SecurityException) - { - // For code access security. - return new string[0]; - } - catch (System.UnauthorizedAccessException) - { - // For OS security. - return new string[0]; - } - } - - /// - /// Given a path name, get its long version. - /// - /// The short path. - /// Delegate. - /// The long path. - internal static string GetLongPathName - ( - string path, - GetFileSystemEntries getFileSystemEntries - ) - { - if (path.IndexOf("~", StringComparison.Ordinal) == -1) - { - // A path with no '~' must not be a short name. - return path; - } - - ErrorUtilities.VerifyThrow(!HasWildcards(path), - "GetLongPathName does not handle wildcards and was passed '{0}'.", path); - - string[] parts = path.Split(directorySeparatorCharacters); - string pathRoot; - bool isUnc = path.StartsWith(directorySeparator + directorySeparator, StringComparison.Ordinal); - int startingElement; - if (isUnc) - { - pathRoot = directorySeparator + directorySeparator; - pathRoot += parts[2]; - pathRoot += directorySeparator; - pathRoot += parts[3]; - pathRoot += directorySeparator; - startingElement = 4; - } - else - { - // Is it relative? - if (path.Length > 2 && path[1] == ':') - { - // Not relative - pathRoot = parts[0] + directorySeparator; - startingElement = 1; - } - else - { - // Relative - pathRoot = String.Empty; - startingElement = 0; - } - } - - // Build up an array of parts. These elements may be "" if there are - // extra slashes. - string[] longParts = new string[parts.Length - startingElement]; - - string longPath = pathRoot; - for (int i = startingElement; i < parts.Length; ++i) - { - // If there is a zero-length part, then that means there was an extra slash. - if (parts[i].Length == 0) - { - longParts[i - startingElement] = String.Empty; - } - else - { - if (parts[i].IndexOf("~", StringComparison.Ordinal) == -1) - { - // If there's no ~, don't hit the disk. - longParts[i - startingElement] = parts[i]; - longPath = Path.Combine(longPath, parts[i]); - } - else - { - // getFileSystemEntries(...) returns an empty array if longPath doesn't exist. - string[] entries = getFileSystemEntries(FileSystemEntity.FilesAndDirectories, longPath, parts[i], null, false); - - if (0 == entries.Length) - { - // The next part doesn't exist. Therefore, no more of the path will exist. - // Just return the rest. - for (int j = i; j < parts.Length; ++j) - { - longParts[j - startingElement] = parts[j]; - } - break; - } - - // Since we know there are no wild cards, this should be length one. - ErrorUtilities.VerifyThrow(entries.Length == 1, - "Unexpected number of entries ({3}) found when enumerating '{0}' under '{1}'. Original path was '{2}'", - parts[i], longPath, path, entries.Length); - - // Entries[0] contains the full path. - longPath = entries[0]; - - // We just want the trailing node. - longParts[i - startingElement] = Path.GetFileName(longPath); - } - } - } - - return pathRoot + String.Join(directorySeparator, longParts); - } - - /// - /// Given a filespec, split it into left-most 'fixed' dir part, middle 'wildcard' dir part, and filename part. - /// The filename part may have wildcard characters in it. - /// - /// The filespec to be decomposed. - /// Receives the fixed directory part. - /// The wildcard directory part. - /// The filename part. - /// Delegate. - internal static void SplitFileSpec - ( - string filespec, - out string fixedDirectoryPart, - out string wildcardDirectoryPart, - out string filenamePart, - GetFileSystemEntries getFileSystemEntries - ) - { - PreprocessFileSpecForSplitting - ( - filespec, - out fixedDirectoryPart, - out wildcardDirectoryPart, - out filenamePart - ); - - /* - * Handle the special case in which filenamePart is '**'. - * In this case, filenamePart becomes '*.*' and the '**' is appended - * to the end of the wildcardDirectory part. - * This is so that later regular expression matching can accurately - * pull out the different parts (fixed, wildcard, filename) of given - * file specs. - */ - if (recursiveDirectoryMatch == filenamePart) - { - wildcardDirectoryPart += recursiveDirectoryMatch; - wildcardDirectoryPart += directorySeparator; - filenamePart = "*.*"; - } - - fixedDirectoryPart = FileMatcher.GetLongPathName(fixedDirectoryPart, getFileSystemEntries); - } - - /// - /// Do most of the grunt work of splitting the filespec into parts. - /// Does not handle post-processing common to the different matching - /// paths. - /// - /// The filespec to be decomposed. - /// Receives the fixed directory part. - /// The wildcard directory part. - /// The filename part. - private static void PreprocessFileSpecForSplitting - ( - string filespec, - out string fixedDirectoryPart, - out string wildcardDirectoryPart, - out string filenamePart - ) - { - int indexOfLastDirectorySeparator = filespec.LastIndexOfAny(directorySeparatorCharacters); - if (-1 == indexOfLastDirectorySeparator) - { - /* - * No dir separator found. This is either this form, - * - * Source.cs - * *.cs - * - * or this form, - * - * ** - */ - fixedDirectoryPart = String.Empty; - wildcardDirectoryPart = String.Empty; - filenamePart = filespec; - return; - } - - int indexOfFirstWildcard = filespec.IndexOfAny(wildcardCharacters); - if - ( - -1 == indexOfFirstWildcard - || indexOfFirstWildcard > indexOfLastDirectorySeparator - ) - { - /* - * There is at least one dir separator, but either there is no wild card or the - * wildcard is after the dir separator. - * - * The form is one of these: - * - * dir1\Source.cs - * dir1\*.cs - * - * Where the trailing spec is meant to be a filename. Or, - * - * dir1\** - * - * Where the trailing spec is meant to be any file recursively. - */ - - // We know the fixed director part now. - fixedDirectoryPart = filespec.Substring(0, indexOfLastDirectorySeparator + 1); - wildcardDirectoryPart = String.Empty; - filenamePart = filespec.Substring(indexOfLastDirectorySeparator + 1); - return; - } - - /* - * Find the separator right before the first wildcard. - */ - string filespecLeftOfWildcard = filespec.Substring(0, indexOfFirstWildcard); - int indexOfSeparatorBeforeWildCard = filespecLeftOfWildcard.LastIndexOfAny(directorySeparatorCharacters); - if (-1 == indexOfSeparatorBeforeWildCard) - { - /* - * There is no separator before the wildcard, so the form is like this: - * - * dir?\Source.cs - * - * or this, - * - * dir?\** - */ - fixedDirectoryPart = String.Empty; - wildcardDirectoryPart = filespec.Substring(0, indexOfLastDirectorySeparator + 1); - filenamePart = filespec.Substring(indexOfLastDirectorySeparator + 1); - return; - } - - /* - * There is at least one wildcard and one dir separator, split parts out. - */ - fixedDirectoryPart = filespec.Substring(0, indexOfSeparatorBeforeWildCard + 1); - wildcardDirectoryPart = filespec.Substring(indexOfSeparatorBeforeWildCard + 1, indexOfLastDirectorySeparator - indexOfSeparatorBeforeWildCard); - filenamePart = filespec.Substring(indexOfLastDirectorySeparator + 1); - } - - /// - /// Removes the leading ".\" from all of the paths in the array. - /// - /// Paths to remove .\ from. - private static void RemoveInitialDotSlash - ( - string[] paths - ) - { - for (int i = 0; i < paths.Length; i++) - { - if (paths[i].StartsWith(".\\", StringComparison.Ordinal)) - { - paths[i] = paths[i].Substring(2); - } - } - } - - - /// - /// Checks if the char is a DirectorySeparatorChar or a AltDirectorySeparatorChar - /// - /// - /// - internal static bool IsDirectorySeparator(char c) - { - return c == Path.DirectorySeparatorChar || c == Path.AltDirectorySeparatorChar; - } - /// - /// Removes the current directory converting the file back to relative path - /// - /// Paths to remove current directory from. - /// - internal static void RemoveProjectDirectory - ( - string[] paths, - string projectDirectory - ) - { - bool directoryLastCharIsSeparator = IsDirectorySeparator(projectDirectory[projectDirectory.Length - 1]); - for (int i = 0; i < paths.Length; i++) - { - if (paths[i].StartsWith(projectDirectory, StringComparison.Ordinal)) - { - // If the project directory did not end in a slash we need to check to see if the next char in the path is a slash - if (!directoryLastCharIsSeparator) - { - //If the next char after the project directory is not a slash, skip this path - if (paths[i].Length <= projectDirectory.Length || !IsDirectorySeparator(paths[i][projectDirectory.Length])) - { - continue; - } - paths[i] = paths[i].Substring(projectDirectory.Length + 1); - } - else - { - paths[i] = paths[i].Substring(projectDirectory.Length); - } - } - } - } - - /// - /// Get all files that match either the file-spec or the regular expression. - /// - /// List of files that gets populated. - /// The path to enumerate - /// The remaining, wildcard part of the directory. - /// The filespec. - /// - /// Wild-card matching. - /// If true, then recursion is required. - /// - /// - /// Delegate. - private static void GetFilesRecursive - ( - System.Collections.IList listOfFiles, - string baseDirectory, - string remainingWildcardDirectory, - string filespec, // can be null - int extensionLengthToEnforce, // only relevant when filespec is not null - Regex regexFileMatch, // can be null - bool needsRecursion, - string projectDirectory, - bool stripProjectDirectory, - GetFileSystemEntries getFileSystemEntries - ) - { - Debug.Assert((filespec == null) || (regexFileMatch == null), - "File-spec overrides the regular expression -- pass null for file-spec if you want to use the regular expression."); - - ErrorUtilities.VerifyThrow((filespec != null) || (regexFileMatch != null), - "Need either a file-spec or a regular expression to match files."); - - ErrorUtilities.VerifyThrow(remainingWildcardDirectory != null, "Expected non-null remaning wildcard directory."); - - /* - * Get the matching files. - */ - bool considerFiles = false; - - // Only consider files if... - if (remainingWildcardDirectory.Length == 0) - { - // We've reached the end of the wildcard directory elements. - considerFiles = true; - } - else if (remainingWildcardDirectory.IndexOf(recursiveDirectoryMatch, StringComparison.Ordinal) == 0) - { - // or, we've reached a "**" so everything else is matched recursively. - considerFiles = true; - } - - if (considerFiles) - { - string[] files = getFileSystemEntries(FileSystemEntity.Files, baseDirectory, filespec, projectDirectory, stripProjectDirectory); - foreach (string file in files) - { - if ((filespec != null) || - // if no file-spec provided, match the file to the regular expression - // PERF NOTE: Regex.IsMatch() is an expensive operation, so we avoid it whenever possible - regexFileMatch.IsMatch(file)) - { - if ((filespec == null) || - // if we used a file-spec with a "loosely" defined extension - (extensionLengthToEnforce == 0) || - // discard all files that do not have extensions of the desired length - (Path.GetExtension(file).Length == extensionLengthToEnforce)) - { - listOfFiles.Add((object)file); - } - } - } - } - - /* - * Recurse into subdirectories. - */ - if (needsRecursion && remainingWildcardDirectory.Length > 0) - { - // Find the next directory piece. - string pattern = null; - - if (remainingWildcardDirectory != recursiveDirectoryMatch) - { - int indexOfNextSlash = remainingWildcardDirectory.IndexOfAny(directorySeparatorCharacters); - ErrorUtilities.VerifyThrow(indexOfNextSlash != -1, "Slash should be guaranteed."); - - // Peel off the leftmost directory piece. So for example, if remainingWildcardDirectory - // contains: - // - // ?emp\foo\**\bar - // - // then put '?emp' into pattern. Then put the remaining part, - // - // foo\**\bar - // - // back into remainingWildcardDirectory. - // This is a performance optimization. We don't want to enumerate everything if we - // don't have to. - pattern = remainingWildcardDirectory.Substring(0, indexOfNextSlash); - remainingWildcardDirectory = remainingWildcardDirectory.Substring(indexOfNextSlash + 1); - - // If pattern turned into **, then there's no choice but to enumerate everything. - if (pattern == recursiveDirectoryMatch) - { - pattern = null; - remainingWildcardDirectory = recursiveDirectoryMatch; - } - } - - // We never want to strip the project directory from the leaves, because the current - // process directory maybe different - string[] subdirs = getFileSystemEntries(FileSystemEntity.Directories, baseDirectory, pattern, null, false); - foreach (string subdir in subdirs) - { - GetFilesRecursive(listOfFiles, subdir, remainingWildcardDirectory, filespec, extensionLengthToEnforce, regexFileMatch, true, projectDirectory, stripProjectDirectory, getFileSystemEntries); - } - } - } - - /// - /// Given a file spec, create a regular expression that will match that - /// file spec. - /// - /// PERF WARNING: this method is called in performance-critical - /// scenarios, so keep it fast and cheap - /// - /// The fixed directory part. - /// The wildcard directory part. - /// The filename part. - /// Receives whether this pattern is legal or not. - /// The regular expression string. - private static string RegularExpressionFromFileSpec - ( - string fixedDirectoryPart, - string wildcardDirectoryPart, - string filenamePart, - out bool isLegalFileSpec - ) - { - isLegalFileSpec = true; - - /* - * The code below uses tags in the form <:tag:> to encode special information - * while building the regular expression. - * - * This format was chosen because it's not a legal form for filespecs. If the - * filespec comes in with either "<:" or ":>", return isLegalFileSpec=false to - * prevent intrusion into the special processing. - */ - if ((fixedDirectoryPart.IndexOf("<:", StringComparison.Ordinal) != -1) || - (fixedDirectoryPart.IndexOf(":>", StringComparison.Ordinal) != -1) || - (wildcardDirectoryPart.IndexOf("<:", StringComparison.Ordinal) != -1) || - (wildcardDirectoryPart.IndexOf(":>", StringComparison.Ordinal) != -1) || - (filenamePart.IndexOf("<:", StringComparison.Ordinal) != -1) || - (filenamePart.IndexOf(":>", StringComparison.Ordinal) != -1)) - { - isLegalFileSpec = false; - return String.Empty; - } - - /* - * Its not legal for there to be a ".." after a wildcard. - */ - if (wildcardDirectoryPart.Contains(dotdot)) - { - isLegalFileSpec = false; - return String.Empty; - } - - /* - * Trailing dots in file names have to be treated specially. - * We want: - * - * *. to match foo - * - * but 'foo' doesn't have a trailing '.' so we need to handle this while still being careful - * not to match 'foo.txt' - */ - if (filenamePart.EndsWith(".", StringComparison.Ordinal)) - { - filenamePart = filenamePart.Replace("*", "<:anythingbutdot:>"); - filenamePart = filenamePart.Replace("?", "<:anysinglecharacterbutdot:>"); - filenamePart = filenamePart.Substring(0, filenamePart.Length - 1); - } - - /* - * Now, build up the starting filespec but put tags in to identify where the fixedDirectory, - * wildcardDirectory and filenamePart are. Also tag the beginning of the line and the end of - * the line, so that we can identify patterns by whether they're on one end or the other. - */ - StringBuilder matchFileExpression = new StringBuilder(); - matchFileExpression.Append("<:bol:>"); - matchFileExpression.Append("<:fixeddir:>").Append(fixedDirectoryPart).Append("<:endfixeddir:>"); - matchFileExpression.Append("<:wildcarddir:>").Append(wildcardDirectoryPart).Append("<:endwildcarddir:>"); - matchFileExpression.Append("<:filename:>").Append(filenamePart).Append("<:endfilename:>"); - matchFileExpression.Append("<:eol:>"); - - /* - * Call out our special matching characters. - */ - matchFileExpression.Replace(directorySeparator, "<:dirseparator:>"); - matchFileExpression.Replace(altDirectorySeparator, "<:dirseparator:>"); - - /* - * Capture the leading \\ in UNC paths, so that the doubled slash isn't - * reduced in a later step. - */ - matchFileExpression.Replace("<:fixeddir:><:dirseparator:><:dirseparator:>", "<:fixeddir:><:uncslashslash:>"); - - /* - * Iteratively reduce four cases involving directory separators - * - * (1) <:dirseparator:>.<:dirseparator:> -> <:dirseparator:> - * This is an identity, so for example, these two are equivalent, - * - * dir1\.\dir2 == dir1\dir2 - * - * (2) <:dirseparator:><:dirseparator:> -> <:dirseparator:> - * Double directory separators are treated as a single directory separator, - * so, for example, this is an identity: - * - * f:\dir1\\dir2 == f:\dir1\dir2 - * - * The single exemption is for UNC path names, like this: - * - * \\server\share != \server\share - * - * This case is handled by the <:uncslashslash:> which was substituted in - * a prior step. - * - * (3) <:fixeddir:>.<:dirseparator:>.<:dirseparator:> -> <:fixeddir:>.<:dirseparator:> - * A ".\" at the beginning of a line is equivalent to nothing, so: - * - * .\.\dir1\file.txt == .\dir1\file.txt - * - * (4) <:dirseparator:>.<:eol:> -> <:eol:> - * A "\." at the end of a line is equivalent to nothing, so: - * - * dir1\dir2\. == dir1\dir2 * - */ - int sizeBefore; - do - { - sizeBefore = matchFileExpression.Length; - - // NOTE: all these replacements will necessarily reduce the expression length i.e. length will either reduce or - // stay the same through this loop - matchFileExpression.Replace("<:dirseparator:>.<:dirseparator:>", "<:dirseparator:>"); - matchFileExpression.Replace("<:dirseparator:><:dirseparator:>", "<:dirseparator:>"); - matchFileExpression.Replace("<:fixeddir:>.<:dirseparator:>.<:dirseparator:>", "<:fixeddir:>.<:dirseparator:>"); - matchFileExpression.Replace("<:dirseparator:>.<:endfilename:>", "<:endfilename:>"); - matchFileExpression.Replace("<:filename:>.<:endfilename:>", "<:filename:><:endfilename:>"); - - ErrorUtilities.VerifyThrow(matchFileExpression.Length <= sizeBefore, - "Expression reductions cannot increase the length of the expression."); - - } while (matchFileExpression.Length < sizeBefore); - - /* - * Collapse **\** into **. - */ - do - { - sizeBefore = matchFileExpression.Length; - matchFileExpression.Replace(recursiveDirectoryMatch + "<:dirseparator:>" + recursiveDirectoryMatch, recursiveDirectoryMatch); - - ErrorUtilities.VerifyThrow(matchFileExpression.Length <= sizeBefore, - "Expression reductions cannot increase the length of the expression."); - - } while (matchFileExpression.Length < sizeBefore); - - /* - * Call out legal recursion operators: - * - * fixed-directory + **\ - * \**\ - * **\** - * - */ - do - { - sizeBefore = matchFileExpression.Length; - matchFileExpression.Replace("<:dirseparator:>" + recursiveDirectoryMatch + "<:dirseparator:>", "<:middledirs:>"); - matchFileExpression.Replace("<:wildcarddir:>" + recursiveDirectoryMatch + "<:dirseparator:>", "<:wildcarddir:><:leftdirs:>"); - - ErrorUtilities.VerifyThrow(matchFileExpression.Length <= sizeBefore, - "Expression reductions cannot increase the length of the expression."); - - } while (matchFileExpression.Length < sizeBefore); - - /* - * By definition, "**" must appear alone between directory slashes. If there is any remaining "**" then this is not - * a valid filespec. - */ - // NOTE: this condition is evaluated left-to-right -- this is important because we want the length BEFORE stripping - // any "**"s remaining in the expression - if (matchFileExpression.Length > matchFileExpression.Replace(recursiveDirectoryMatch, null).Length) - { - isLegalFileSpec = false; - return String.Empty; - } - - /* - * Remaining call-outs not involving "**" - */ - matchFileExpression.Replace("*.*", "<:anynonseparator:>"); - matchFileExpression.Replace("*", "<:anynonseparator:>"); - matchFileExpression.Replace("?", "<:singlecharacter:>"); - - /* - * Escape all special characters defined for regular expresssions. - */ - matchFileExpression.Replace("\\", "\\\\"); // Must be first. - matchFileExpression.Replace("$", "\\$"); - matchFileExpression.Replace("(", "\\("); - matchFileExpression.Replace(")", "\\)"); - matchFileExpression.Replace("*", "\\*"); - matchFileExpression.Replace("+", "\\+"); - matchFileExpression.Replace(".", "\\."); - matchFileExpression.Replace("[", "\\["); - matchFileExpression.Replace("?", "\\?"); - matchFileExpression.Replace("^", "\\^"); - matchFileExpression.Replace("{", "\\{"); - matchFileExpression.Replace("|", "\\|"); - - /* - * Now, replace call-outs with their regex equivalents. - */ - matchFileExpression.Replace("<:middledirs:>", "((/)|(\\\\)|(/.*/)|(/.*\\\\)|(\\\\.*\\\\)|(\\\\.*/))"); - matchFileExpression.Replace("<:leftdirs:>", "((.*/)|(.*\\\\)|())"); - matchFileExpression.Replace("<:rightdirs:>", ".*"); - matchFileExpression.Replace("<:anything:>", ".*"); - matchFileExpression.Replace("<:anythingbutdot:>", "[^\\.]*"); - matchFileExpression.Replace("<:anysinglecharacterbutdot:>", "[^\\.]."); - matchFileExpression.Replace("<:anynonseparator:>", "[^/\\\\]*"); - matchFileExpression.Replace("<:singlecharacter:>", "."); - matchFileExpression.Replace("<:dirseparator:>", "[/\\\\]+"); - matchFileExpression.Replace("<:uncslashslash:>", @"\\\\"); - matchFileExpression.Replace("<:bol:>", "^"); - matchFileExpression.Replace("<:eol:>", "$"); - matchFileExpression.Replace("<:fixeddir:>", "(?"); - matchFileExpression.Replace("<:endfixeddir:>", ")"); - matchFileExpression.Replace("<:wildcarddir:>", "(?"); - matchFileExpression.Replace("<:endwildcarddir:>", ")"); - matchFileExpression.Replace("<:filename:>", "(?"); - matchFileExpression.Replace("<:endfilename:>", ")"); - - return matchFileExpression.ToString(); - } - - /// - /// Given a filespec, get the information needed for file matching. - /// - /// The filespec. - /// Receives the regular expression. - /// Receives the flag that is true if recursion is required. - /// Receives the flag that is true if the filespec is legal. - /// Delegate. - internal static void GetFileSpecInfo - ( - string filespec, - out Regex regexFileMatch, - out bool needsRecursion, - out bool isLegalFileSpec, - GetFileSystemEntries getFileSystemEntries - - ) - { - string fixedDirectoryPart; - string wildcardDirectoryPart; - string filenamePart; - string matchFileExpression; - - GetFileSpecInfo(filespec, - out fixedDirectoryPart, out wildcardDirectoryPart, out filenamePart, - out matchFileExpression, out needsRecursion, out isLegalFileSpec, - getFileSystemEntries); - - if (isLegalFileSpec) - { - regexFileMatch = new Regex(matchFileExpression, RegexOptions.IgnoreCase); - } - else - { - regexFileMatch = null; - } - } - - /// - /// Given a filespec, get the information needed for file matching. - /// - /// The filespec. - /// Receives the fixed directory part. - /// Receives the wildcard directory part. - /// Receives the filename part. - /// Receives the regular expression. - /// Receives the flag that is true if recursion is required. - /// Receives the flag that is true if the filespec is legal. - /// Delegate. - private static void GetFileSpecInfo - ( - string filespec, - out string fixedDirectoryPart, - out string wildcardDirectoryPart, - out string filenamePart, - out string matchFileExpression, - out bool needsRecursion, - out bool isLegalFileSpec, - GetFileSystemEntries getFileSystemEntries - ) - { - isLegalFileSpec = true; - needsRecursion = false; - fixedDirectoryPart = String.Empty; - wildcardDirectoryPart = String.Empty; - filenamePart = String.Empty; - matchFileExpression = null; - - // bail out if filespec contains illegal characters - if (-1 != filespec.IndexOfAny(Path.GetInvalidPathChars())) - { - isLegalFileSpec = false; - return; - } - - /* - * Check for patterns in the filespec that are explicitly illegal. - * - * Any path with "..." in it is illegal. - */ - if (-1 != filespec.IndexOf("...", StringComparison.Ordinal)) - { - isLegalFileSpec = false; - return; - } - - /* - * If there is a ':' anywhere but the second character, this is an illegal pattern. - * Catches this case among others, - * - * http://www.website.com - * - */ - int rightmostColon = filespec.LastIndexOf(":", StringComparison.Ordinal); - - if - ( - -1 != rightmostColon - && 1 != rightmostColon - ) - { - isLegalFileSpec = false; - return; - } - - /* - * Now break up the filespec into constituent parts--fixed, wildcard and filename. - */ - SplitFileSpec(filespec, out fixedDirectoryPart, out wildcardDirectoryPart, out filenamePart, getFileSystemEntries); - - /* - * Get a regular expression for matching files that will be found. - */ - matchFileExpression = RegularExpressionFromFileSpec(fixedDirectoryPart, wildcardDirectoryPart, filenamePart, out isLegalFileSpec); - - /* - * Was the filespec valid? If not, then just return now. - */ - if (!isLegalFileSpec) - { - return; - } - - /* - * Determine whether recursion will be required. - */ - needsRecursion = (wildcardDirectoryPart.Length != 0); - } - - /// - /// The results of a match between a filespec and a file name. - /// - internal sealed class Result - { - /// - /// Default constructor. - /// - internal Result() - { - // do nothing - } - - internal bool isLegalFileSpec = false; - internal bool isMatch = false; - internal bool isFileSpecRecursive = false; - internal string fixedDirectoryPart = String.Empty; - internal string wildcardDirectoryPart = String.Empty; - internal string filenamePart = String.Empty; - } - - /// - /// Given a pattern (filespec) and a candidate filename (fileToMatch) - /// return matching information. - /// - /// The filespec. - /// The candidate to match against. - /// The result class. - internal static Result FileMatch - ( - string filespec, - string fileToMatch - ) - { - return FileMatch(filespec, fileToMatch, defaultGetFileSystemEntries); - } - - /// - /// Given a pattern (filespec) and a candidate filename (fileToMatch) - /// return matching information. - /// - /// The filespec. - /// The candidate to match against. - /// Delegate. - /// The result class. - internal static Result FileMatch - ( - string filespec, - string fileToMatch, - GetFileSystemEntries getFileSystemEntries - ) - { - Result matchResult = new Result(); - - fileToMatch = GetLongPathName(fileToMatch, getFileSystemEntries); - - Regex regexFileMatch; - GetFileSpecInfo - ( - filespec, - out regexFileMatch, - out matchResult.isFileSpecRecursive, - out matchResult.isLegalFileSpec, - getFileSystemEntries - ); - - if (matchResult.isLegalFileSpec) - { - Match match = regexFileMatch.Match(fileToMatch); - matchResult.isMatch = match.Success; - - if (matchResult.isMatch) - { - matchResult.fixedDirectoryPart = match.Groups["FIXEDDIR"].Value; - matchResult.wildcardDirectoryPart = match.Groups["WILDCARDDIR"].Value; - matchResult.filenamePart = match.Groups["FILENAME"].Value; - } - } - - return matchResult; - } - - /// - /// Given a filespec, find the files that match. - /// - /// Get files that match the given file spec. - /// The array of files. - internal static string[] GetFiles - ( - string projectDirectory, - string filespec - ) - { - string[] files = GetFiles(projectDirectory, filespec, defaultGetFileSystemEntries, defaultDirectoryExists); - return files; - } - - /// - /// Given a filespec, find the files that match. - /// - /// Get files that match the given file spec. - /// Get files that match the given file spec. - /// Determine whether a directory exists. - /// The array of files. - internal static string[] GetFiles - ( - string projectDirectory, - string filespec, - GetFileSystemEntries getFileSystemEntries, - DirectoryExists directoryExists - ) - { - // For performance. Short-circuit iff there is no wildcard. - // Perf Note: Doing a [Last]IndexOfAny(...) is much faster than compiling a - // regular expression that does the same thing, regardless of whether - // filespec contains one of the characters. - // Choose LastIndexOfAny instead of IndexOfAny because it seems more likely - // that wildcards will tend to be towards the right side. - if (!HasWildcards(filespec)) - { - return new string[] { filespec }; - } - - /* - * Even though we return a string[] we work internally with an IList. - * This is because it's cheaper to add items to an IList and this code - * might potentially do a lot of that. - */ - System.Collections.ArrayList arrayListOfFiles = new System.Collections.ArrayList(); - System.Collections.IList listOfFiles = (System.Collections.IList)arrayListOfFiles; - - /* - * Analyze the file spec and get the information we need to do the matching. - */ - string fixedDirectoryPart; - string wildcardDirectoryPart; - string filenamePart; - string matchFileExpression; - bool needsRecursion; - bool isLegalFileSpec; - GetFileSpecInfo - ( - filespec, - out fixedDirectoryPart, - out wildcardDirectoryPart, - out filenamePart, - out matchFileExpression, - out needsRecursion, - out isLegalFileSpec, - getFileSystemEntries - ); - - /* - * If the filespec is invalid, then just return now. - */ - if (!isLegalFileSpec) - { - return new string[] { filespec }; - } - - // The projectDirectory is not null only if we are running the evaluation from - // inside the engine (i.e. not from a task) - bool stripProjectDirectory = false; - if (projectDirectory != null) - { - if (fixedDirectoryPart != null) - { - string oldFixedDirectoryPart = fixedDirectoryPart; - try - { - fixedDirectoryPart = Path.Combine(projectDirectory, fixedDirectoryPart); - } - catch (ArgumentException) - { - return new string[0]; - } - - stripProjectDirectory = !String.Equals(fixedDirectoryPart, oldFixedDirectoryPart, StringComparison.OrdinalIgnoreCase); - } - else - { - fixedDirectoryPart = projectDirectory; - stripProjectDirectory = true; - } - } - - /* - * If the fixed directory part doesn't exist, then this means no files should be - * returned. - */ - if (fixedDirectoryPart.Length > 0 && !directoryExists(fixedDirectoryPart)) - { - return new string[0]; - } - - // determine if we need to use the regular expression to match the files - // PERF NOTE: Constructing a Regex object is expensive, so we avoid it whenever possible - bool matchWithRegex = - // if we have a directory specification that uses wildcards, and - (wildcardDirectoryPart.Length > 0) && - // the specification is not a simple "**" - (wildcardDirectoryPart != (recursiveDirectoryMatch + directorySeparator)); - // then we need to use the regular expression - - // if we're not using the regular expression, get the file pattern extension - string extensionPart = matchWithRegex - ? null - : Path.GetExtension(filenamePart); - - // check if the file pattern would cause Windows to match more loosely on the extension - // NOTE: Windows matches loosely in two cases (in the absence of the * wildcard in the extension): - // 1) if the extension ends with the ? wildcard, it matches files with shorter extensions also e.g. "file.tx?" would - // match both "file.txt" and "file.tx" - // 2) if the extension is three characters, and the filename contains the * wildcard, it matches files with longer - // extensions that start with the same three characters e.g. "*.htm" would match both "file.htm" and "file.html" - bool needToEnforceExtensionLength = - (extensionPart?.IndexOf('*') == -1) - && - (extensionPart.EndsWith("?", StringComparison.Ordinal) - || - ((extensionPart.Length == (3 + 1 /* +1 for the period */)) && - (filenamePart.IndexOf('*') != -1))); - - /* - * Now get the files that match, starting at the lowest fixed directory. - */ - GetFilesRecursive(listOfFiles, fixedDirectoryPart, wildcardDirectoryPart, - // if using the regular expression, ignore the file pattern - matchWithRegex ? null : filenamePart, needToEnforceExtensionLength ? extensionPart.Length : 0, - // if using the file pattern, ignore the regular expression - matchWithRegex ? new Regex(matchFileExpression, RegexOptions.IgnoreCase) : null, - needsRecursion, projectDirectory, stripProjectDirectory, getFileSystemEntries); - - /* - * Build the return array. - */ - string[] files = (string[])arrayListOfFiles.ToArray(typeof(string)); - return files; - } - } -} diff --git a/src/Deprecated/Engine/Shared/FileUtilities.cs b/src/Deprecated/Engine/Shared/FileUtilities.cs deleted file mode 100644 index 41e312d62b6..00000000000 --- a/src/Deprecated/Engine/Shared/FileUtilities.cs +++ /dev/null @@ -1,849 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.IO; -using System.Collections; -using System.Diagnostics; -using System.Globalization; -using System.Text.RegularExpressions; -using System.Text; - -namespace Microsoft.Build.BuildEngine.Shared -{ - /// - /// This class contains utility methods for file IO. - /// PERF\COVERAGE NOTE: Try to keep classes in 'shared' as granular as possible. All the methods in - /// each class get pulled into the resulting assembly. - /// - /// SumedhK - internal static class FileUtilities - { - #region Item-spec modifiers - - /// - /// Encapsulates the definitions of the item-spec modifiers a.k.a. reserved item metadata. - /// - /// SumedhK - internal static class ItemSpecModifiers - { - // NOTE: If you add an item here that starts with a new letter, you need to update the case - // statements in IsItemSpecModifier and IsDerivableItemSpecModifier. - internal const string FullPath = "FullPath"; - internal const string RootDir = "RootDir"; - internal const string Filename = "Filename"; - internal const string Extension = "Extension"; - internal const string RelativeDir = "RelativeDir"; - internal const string Directory = "Directory"; - internal const string RecursiveDir = "RecursiveDir"; - internal const string Identity = "Identity"; - internal const string ModifiedTime = "ModifiedTime"; - internal const string CreatedTime = "CreatedTime"; - internal const string AccessedTime = "AccessedTime"; - - // These are all the well-known attributes. - internal static readonly string[] All = - { - FullPath, - RootDir, - Filename, - Extension, - RelativeDir, - Directory, - RecursiveDir, // <-- Not derivable. - Identity, - ModifiedTime, - CreatedTime, - AccessedTime - }; - - private static Hashtable tableOfItemSpecModifiers; - - internal static Hashtable TableOfItemSpecModifiers - { - get - { - if (ItemSpecModifiers.tableOfItemSpecModifiers == null) - { - ItemSpecModifiers.tableOfItemSpecModifiers = new Hashtable(ItemSpecModifiers.All.Length, StringComparer.OrdinalIgnoreCase); - - // Populate the hashtable with all the valid item spec modifiers, for fast lookup. - // The key in the hashtable is the name of the item spec modifiers. The value - // is always null. - foreach (string itemSpecModifier in ItemSpecModifiers.All) - { - ItemSpecModifiers.tableOfItemSpecModifiers[itemSpecModifier] = String.Empty; - } - } - - return ItemSpecModifiers.tableOfItemSpecModifiers; - } - } - } - - #endregion - - /// - /// Indicates if the given name is reserved for an item-spec modifier. - /// - internal static bool IsItemSpecModifier(string name) - { - if (name == null) - { - return false; - } - - /* - * What follows requires some explanation. - * - * This function is called many times and slowness here will be amplified - * in critical performance scenarios. - * - * The following switch statement attempts to identify item spec modifiers that - * have the exact case that our constants in ItemSpecModifiers have. This is the - * 99% case. - * - * Further, the switch statement can identify certain cases in which there is - * definitely no chance that 'name' is an item spec modifier. For example, a - * 7 letter 'name' that doesn't start with 'r' or 'R' can't be RootDir and - * therefore is not an item spec modifier. - * - */ - switch (name.Length) - { - case 7: // RootDir - switch (name[0]) - { - default: - return false; - case 'R': // RootDir - if (name == ItemSpecModifiers.RootDir) - { - return true; - } - break; - case 'r': - break; - } - break; - case 8: // FullPath, Filename, Identity - - switch (name[0]) - { - default: - return false; - case 'F': // Filename, FullPath - if (name == ItemSpecModifiers.FullPath) - { - return true; - } - if (name == ItemSpecModifiers.Filename) - { - return true; - } - break; - case 'f': - break; - case 'I': // Identity - if (name == ItemSpecModifiers.Identity) - { - return true; - } - break; - case 'i': - break; - } - break; - case 9: // Extension, Directory - switch (name[0]) - { - default: - return false; - case 'D': // Directory - if (name == ItemSpecModifiers.Directory) - { - return true; - } - break; - case 'd': - break; - case 'E': // Extension - if (name == ItemSpecModifiers.Extension) - { - return true; - } - break; - case 'e': - break; - } - break; - case 11: // RelativeDir, CreatedTime - switch (name[0]) - { - default: - return false; - case 'C': // CreatedTime - if (name == ItemSpecModifiers.CreatedTime) - { - return true; - } - break; - case 'c': - break; - case 'R': // RelativeDir - if (name == ItemSpecModifiers.RelativeDir) - { - return true; - } - break; - case 'r': - break; - } - break; - case 12: // RecursiveDir, ModifiedTime, AccessedTime - - switch (name[0]) - { - default: - return false; - case 'A': // AccessedTime - if (name == ItemSpecModifiers.AccessedTime) - { - return true; - } - break; - case 'a': - break; - case 'M': // ModifiedTime - if (name == ItemSpecModifiers.ModifiedTime) - { - return true; - } - break; - case 'm': - break; - case 'R': // RecursiveDir - if (name == ItemSpecModifiers.RecursiveDir) - { - return true; - } - break; - case 'r': - break; - } - break; - default: - // Not the right length for a match. - return false; - } - - - // Could still be a case-insensitive match. - bool result = ItemSpecModifiers.TableOfItemSpecModifiers.ContainsKey(name); - return result; - } - - /// - /// Indicates if the given name is reserved for a derivable item-spec modifier. - /// Derivable means it can be computed given a file name. - /// - /// Name to check. - /// true, if name of a derivable modifier - internal static bool IsDerivableItemSpecModifier(string name) - { - bool isItemSpecModifier = IsItemSpecModifier(name); - - if (isItemSpecModifier) - { - if (name.Length == 12) - { - if (name[0] == 'R' || name[0] == 'r') - { - // The only 12 letter ItemSpecModifier that starts with 'R' is 'RecursiveDir' - return false; - } - } - } - - return isItemSpecModifier; - } - - /// - /// Performs path manipulations on the given item-spec as directed. - /// - /// Supported modifiers: - /// %(FullPath) = full path of item - /// %(RootDir) = root directory of item - /// %(Filename) = item filename without extension - /// %(Extension) = item filename extension - /// %(RelativeDir) = item directory as given in item-spec - /// %(Directory) = full path of item directory relative to root - /// %(RecursiveDir) = portion of item path that matched a recursive wildcard - /// %(Identity) = item-spec as given - /// %(ModifiedTime) = last write time of item - /// %(CreatedTime) = creation time of item - /// %(AccessedTime) = last access time of item - /// - /// NOTES: - /// 1) This method always returns an empty string for the %(RecursiveDir) modifier because it does not have enough - /// information to compute it -- only the BuildItem class can compute this modifier. - /// 2) The %(ModifiedTime), %(CreatedTime) and %(AccessedTime) modifiers are never cached because they are not constants. - /// - /// - /// Methods of the Path class "normalize" slashes and periods. For example: - /// 1) successive slashes are combined into 1 slash - /// 2) trailing periods are discarded - /// 3) forward slashes are changed to back-slashes - /// - /// As a result, we cannot rely on any file-spec that has passed through a Path method to remain the same. We will - /// therefore not bother preserving slashes and periods when file-specs are transformed. - /// - /// SumedhK - /// The root directory for relative item-specs. When called on the Engine thread, this is the project directory. When called as part of building a task, it is null, indicating that the current directory should be used. - /// The item-spec to modify. - /// The modifier to apply to the item-spec. - /// Cache of previously computed modifiers (if null, this method will create it unless the modifier cannot be cached). - /// The modified item-spec (can be empty string, but will never be null). - /// Thrown when the item-spec is not a path. - internal static string GetItemSpecModifier(string currentDirectory, string itemSpec, string modifier, ref Hashtable cachedModifiers) - { - ErrorUtilities.VerifyThrow(itemSpec != null, "Need item-spec to modify."); - ErrorUtilities.VerifyThrow(modifier != null, "Need modifier to apply to item-spec."); - - string modifiedItemSpec = null; - - // check if we have computed this modifier before - if (cachedModifiers != null) - { - ErrorUtilities.VerifyThrow((string)cachedModifiers[String.Empty] == itemSpec, - "The cache of modifiers is only valid for one item-spec. If the item-spec changes, the cache must be nulled out, or a different cache passed in."); - - modifiedItemSpec = (string)cachedModifiers[modifier]; - } - - if (modifiedItemSpec == null) - { - // certain properties can't be cached -- this will be turned to true in those cases - bool isVolatile = false; - - try - { - if (String.Equals(modifier, ItemSpecModifiers.FullPath, StringComparison.OrdinalIgnoreCase)) - { - if (currentDirectory == null) - { - currentDirectory = String.Empty; - } - - modifiedItemSpec = GetFullPath(itemSpec, currentDirectory); - } - else if (String.Equals(modifier, ItemSpecModifiers.RootDir, StringComparison.OrdinalIgnoreCase)) - { - if (currentDirectory == null) - { - currentDirectory = String.Empty; - } - - string fullPath = Path.GetFullPath(Path.Combine(currentDirectory, itemSpec)); - modifiedItemSpec = Path.GetPathRoot(fullPath); - - if (!EndsWithSlash(modifiedItemSpec)) - { - Debug.Assert(FileUtilitiesRegex.UNCPattern.IsMatch(modifiedItemSpec), - "Only UNC shares should be missing trailing slashes."); - - // restore/append trailing slash if Path.GetPathRoot() has either removed it, or failed to add it - // (this happens with UNC shares) - modifiedItemSpec += Path.DirectorySeparatorChar; - } - } - else if (String.Equals(modifier, ItemSpecModifiers.Filename, StringComparison.OrdinalIgnoreCase)) - { - // if the item-spec is a root directory, it can have no filename - if (Path.GetDirectoryName(itemSpec) == null) - { - // NOTE: this is to prevent Path.GetFileNameWithoutExtension() from treating server and share elements - // in a UNC file-spec as filenames e.g. \\server, \\server\share - modifiedItemSpec = String.Empty; - } - else - { - modifiedItemSpec = Path.GetFileNameWithoutExtension(itemSpec); - } - } - else if (String.Equals(modifier, ItemSpecModifiers.Extension, StringComparison.OrdinalIgnoreCase)) - { - // if the item-spec is a root directory, it can have no extension - if (Path.GetDirectoryName(itemSpec) == null) - { - // NOTE: this is to prevent Path.GetExtension() from treating server and share elements in a UNC - // file-spec as filenames e.g. \\server.ext, \\server\share.ext - modifiedItemSpec = String.Empty; - } - else - { - modifiedItemSpec = Path.GetExtension(itemSpec); - } - } - else if (String.Equals(modifier, ItemSpecModifiers.RelativeDir, StringComparison.OrdinalIgnoreCase)) - { - modifiedItemSpec = GetDirectory(itemSpec); - } - else if (String.Equals(modifier, ItemSpecModifiers.Directory, StringComparison.OrdinalIgnoreCase)) - { - if (currentDirectory == null) - { - currentDirectory = String.Empty; - } - - modifiedItemSpec = GetDirectory(GetFullPath(itemSpec, currentDirectory)); - Match root = FileUtilitiesRegex.DrivePattern.Match(modifiedItemSpec); - - if (!root.Success) - { - root = FileUtilitiesRegex.UNCPattern.Match(modifiedItemSpec); - } - - if (root.Success) - { - ErrorUtilities.VerifyThrow((modifiedItemSpec.Length > root.Length) && IsSlash(modifiedItemSpec[root.Length]), - "Root directory must have a trailing slash."); - - modifiedItemSpec = modifiedItemSpec.Substring(root.Length + 1); - } - } - else if (String.Equals(modifier, ItemSpecModifiers.RecursiveDir, StringComparison.OrdinalIgnoreCase)) - { - // only the BuildItem class can compute this modifier -- so leave empty - modifiedItemSpec = String.Empty; - } - else if (String.Equals(modifier, ItemSpecModifiers.Identity, StringComparison.OrdinalIgnoreCase)) - { - modifiedItemSpec = itemSpec; - } - else if (String.Equals(modifier, ItemSpecModifiers.ModifiedTime, StringComparison.OrdinalIgnoreCase)) - { - isVolatile = true; - - // About to go out to the filesystem. This means data is leaving the engine, so need - // to unescape first. - string unescapedItemSpec = EscapingUtilities.UnescapeAll(itemSpec); - - FileInfo info = FileUtilities.GetFileInfoNoThrow(unescapedItemSpec); - - if (info != null) - { - modifiedItemSpec = info.LastWriteTime.ToString(FileTimeFormat, null); - } - else - { - // File does not exist, or path is a directory - modifiedItemSpec = String.Empty; - } - } - else if (String.Equals(modifier, ItemSpecModifiers.CreatedTime, StringComparison.OrdinalIgnoreCase)) - { - isVolatile = true; - - // About to go out to the filesystem. This means data is leaving the engine, so need - // to unescape first. - string unescapedItemSpec = EscapingUtilities.UnescapeAll(itemSpec); - - if (File.Exists(unescapedItemSpec)) - { - modifiedItemSpec = File.GetCreationTime(unescapedItemSpec).ToString(FileTimeFormat, null); - } - else - { - // File does not exist, or path is a directory - modifiedItemSpec = String.Empty; - } - } - else if (String.Equals(modifier, ItemSpecModifiers.AccessedTime, StringComparison.OrdinalIgnoreCase)) - { - isVolatile = true; - - // About to go out to the filesystem. This means data is leaving the engine, so need - // to unescape first. - string unescapedItemSpec = EscapingUtilities.UnescapeAll(itemSpec); - - if (File.Exists(unescapedItemSpec)) - { - modifiedItemSpec = File.GetLastAccessTime(unescapedItemSpec).ToString(FileTimeFormat, null); - } - else - { - // File does not exist, or path is a directory - modifiedItemSpec = String.Empty; - } - } - else - { - ErrorUtilities.VerifyThrow(false, "\"{0}\" is not a valid item-spec modifier.", modifier); - } - } - catch (Exception e) // Catching Exception, but rethrowing unless it's a well-known exception. - { - if (ExceptionHandling.NotExpectedException(e)) - { - throw; - } - - ErrorUtilities.VerifyThrowInvalidOperation(false, "Shared.InvalidFilespecForTransform", modifier, itemSpec, e.Message); - } - - ErrorUtilities.VerifyThrow(modifiedItemSpec != null, "The item-spec modifier \"{0}\" was not evaluated.", modifier); - - // cache the modifier - if (!isVolatile) - { - if (cachedModifiers == null) - { - cachedModifiers = new Hashtable(StringComparer.OrdinalIgnoreCase); - - // mark the cache to indicate the item-spec for which it was created - // NOTE: we've intentionally picked a key here that will never conflict with any modifier name -- if we - // use the item-spec as the key, it's possible for it to conflict with the name of a modifier - cachedModifiers[String.Empty] = itemSpec; - } - - cachedModifiers[modifier] = modifiedItemSpec; - } - } - - return modifiedItemSpec; - } - - /// - /// If the given path doesn't have a trailing slash then add one. - /// - /// The path to check. - /// A path with a slash. - internal static string EnsureTrailingSlash(string fileSpec) - { - if (!EndsWithSlash(fileSpec)) - { - fileSpec += Path.DirectorySeparatorChar; - } - - return fileSpec; - } - - /// - /// Ensures the path does not have a leading slash. - /// - internal static string EnsureNoLeadingSlash(string path) - { - if (path.Length > 0 && IsSlash(path[0])) - { - path = path.Substring(1); - } - - return path; - } - - /// - /// Ensures the path does not have a trailing slash. - /// - internal static string EnsureNoTrailingSlash(string path) - { - if (EndsWithSlash(path)) - { - path = path.Substring(0, path.Length - 1); - } - - return path; - } - - /// - /// Indicates if the given file-spec ends with a slash. - /// - /// SumedhK - /// The file spec. - /// true, if file-spec has trailing slash - internal static bool EndsWithSlash(string fileSpec) - { - return (fileSpec.Length > 0) - ? IsSlash(fileSpec[fileSpec.Length - 1]) - : false; - } - - /// - /// Indicates if the given character is a slash. - /// - /// SumedhK - /// - /// true, if slash - internal static bool IsSlash(char c) - { - return (c == Path.DirectorySeparatorChar) || (c == Path.AltDirectorySeparatorChar); - } - - /// - /// Trims the string and removes any double quotes around it. - /// - internal static string TrimAndStripAnyQuotes(string path) - { - // Trim returns the same string if trimming isn't needed - path = path.Trim(); - path = path.Trim(new char[] { '"' }); - - return path; - } - - /// - /// Determines the full path for the given file-spec. - /// - /// SumedhK - /// The file spec to get the full path of. - /// - /// full path - private static string GetFullPath(string fileSpec, string currentDirectory) - { - // Sending data out of the engine into the filesystem, so time to unescape. - fileSpec = EscapingUtilities.UnescapeAll(fileSpec); - - // Data coming back from the filesystem into the engine, so time to escape it back. - string fullPath = EscapingUtilities.Escape(Path.GetFullPath(Path.Combine(currentDirectory, fileSpec))); - - if (!EndsWithSlash(fullPath)) - { - Match drive = FileUtilitiesRegex.DrivePattern.Match(fileSpec); - Match UNCShare = FileUtilitiesRegex.UNCPattern.Match(fullPath); - - if ((drive.Success && (drive.Length == fileSpec.Length)) || - (UNCShare.Success && (UNCShare.Length == fullPath.Length))) - { - // append trailing slash if Path.GetFullPath failed to (this happens with drive-specs and UNC shares) - fullPath += Path.DirectorySeparatorChar; - } - } - - return fullPath; - } - - /// - /// Extracts the directory from the given file-spec. - /// - /// SumedhK - /// The filespec. - /// directory path - internal static string GetDirectory(string fileSpec) - { - string directory = Path.GetDirectoryName(fileSpec); - - // if file-spec is a root directory e.g. c:, c:\, \, \\server\share - // NOTE: Path.GetDirectoryName also treats invalid UNC file-specs as root directories e.g. \\, \\server - if (directory == null) - { - // just use the file-spec as-is - directory = fileSpec; - } - else if ((directory.Length > 0) && !EndsWithSlash(directory)) - { - // restore trailing slash if Path.GetDirectoryName has removed it (this happens with non-root directories) - directory += Path.DirectorySeparatorChar; - } - - return directory; - } - - /// - /// Determines whether the given assembly file name has one of the listed extensions. - /// - /// The name of the file - /// Array of extensions to consider. - /// - internal static bool HasExtension(string fileName, string[] allowedExtensions) - { - string fileExtension = Path.GetExtension(fileName); - foreach (string extension in allowedExtensions) - { - if (String.Compare(fileExtension, extension, true /* ignore case */, CultureInfo.CurrentCulture) == 0) - { - return true; - } - } - return false; - } - - // ISO 8601 Universal time with sortable format - internal const string FileTimeFormat = "yyyy'-'MM'-'dd HH':'mm':'ss'.'fffffff"; - - /// - /// Cached path to the current exe - /// - private static string executablePath; - - /// - /// Full path to the current exe (for example, msbuild.exe) including the file name - /// - internal static string CurrentExecutablePath - { - get - { - if (executablePath == null) - { - StringBuilder sb = new StringBuilder(NativeMethods.MAX_PATH); - NativeMethods.GetModuleFileName(NativeMethods.NullHandleRef, sb, sb.Capacity); - executablePath = sb.ToString(); - } - - return executablePath; - } - } - - /// - /// Full path to the directory that the current exe (for example, msbuild.exe) is located in - /// - internal static string CurrentExecutableDirectory - { - get - { - return Path.GetDirectoryName(CurrentExecutablePath); - } - } - - /// - /// Full path to the current config file (for example, msbuild.exe.config) - /// - internal static string CurrentExecutableConfigurationFilePath - { - get - { - return String.Concat(CurrentExecutablePath, ".config"); - } - } - - /// - /// Gets a file info object for the specified file path. If the file path - /// is invalid, or is a directory, or cannot be accessed, or does not exist, - /// it returns null rather than throwing or returning a FileInfo around a non-existent file. - /// This allows it to be called where File.Exists() (which never throws, and returns false - /// for directories) was called - but with the advantage that a FileInfo object is returned - /// that can be queried (e.g., for LastWriteTime) without hitting the disk again. - /// - /// - /// FileInfo around path if it is an existing /file/, else null - internal static FileInfo GetFileInfoNoThrow(string filePath) - { - FileInfo fileInfo; - - try - { - fileInfo = new FileInfo(filePath); - } - catch (Exception e) // Catching Exception, but rethrowing unless it's a well-known exception. - { - if (ExceptionHandling.NotExpectedException(e)) - { - throw; - } - - // Invalid or inaccessible path: treat as if nonexistent file, just as File.Exists does - return null; - } - - if (fileInfo.Exists) - { - // It's an existing file - return fileInfo; - } - else - { - // Nonexistent, or existing but a directory, just as File.Exists behaves - return null; - } - } - - /// - /// Gets the current directory using a static buffer to cut down on allocations and permission checking. - /// - /// - /// - internal static string GetCurrentDirectoryStaticBuffer(StringBuilder buffer) - { - if (NativeMethods.GetCurrentDirectory(buffer.Capacity, buffer) == 0) - { - throw new System.ComponentModel.Win32Exception(); - } - - return buffer.ToString(); - } - - /// - /// Returns true if the specified filename is a VC++ project file, otherwise returns false - /// - internal static bool IsVCProjFilename(string filename) - { - return String.Equals(Path.GetExtension(filename), ".vcproj", StringComparison.OrdinalIgnoreCase); - } - - /// - /// Given the absolute location of a file, and a disc location, returns relative file path to that disk location. - /// Throws UriFormatException. - /// - /// - /// The base path we want to relativize to. Must be absolute. - /// Should not include a filename as the last segment will be interpreted as a directory. - /// - /// - /// The path we need to make relative to basePath. The path can be either absolute path or a relative path in which case it is relative to the base path. - /// If the path cannot be made relative to the base path (for example, it is on another drive), it is returned verbatim. - /// If the basePath is an empty string, returns the path. - /// - /// relative path (can be the full path) - internal static string MakeRelative(string basePath, string path) - { - ErrorUtilities.VerifyThrowArgumentNull(basePath, nameof(basePath)); - ErrorUtilities.VerifyThrowArgumentLength(path, nameof(path)); - - if (basePath.Length == 0) - { - return path; - } - - Uri baseUri = new Uri(FileUtilities.EnsureTrailingSlash(basePath), UriKind.Absolute); // May throw UriFormatException - - Uri pathUri = CreateUriFromPath(path); - - if (!pathUri.IsAbsoluteUri) - { - // the path is already a relative url, we will just normalize it... - pathUri = new Uri(baseUri, pathUri); - } - - Uri relativeUri = baseUri.MakeRelativeUri(pathUri); - string relativePath = Uri.UnescapeDataString(relativeUri.IsAbsoluteUri ? relativeUri.LocalPath : relativeUri.ToString()); - - string result = relativePath.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar); - - return result; - } - - /// - /// Helper function to create an Uri object from path. - /// - /// path string - /// uri object - private static Uri CreateUriFromPath(string path) - { - ErrorUtilities.VerifyThrowArgumentLength(path, nameof(path)); - - Uri pathUri; - - // Try absolute first, then fall back on relative, otherwise it - // makes some absolute UNC paths like (\\foo\bar) relative ... - if (!Uri.TryCreate(path, UriKind.Absolute, out pathUri)) - { - pathUri = new Uri(path, UriKind.Relative); - } - - return pathUri; - } - } -} diff --git a/src/Deprecated/Engine/Shared/FileUtilitiesRegex.cs b/src/Deprecated/Engine/Shared/FileUtilitiesRegex.cs deleted file mode 100644 index 097c2d3b1c3..00000000000 --- a/src/Deprecated/Engine/Shared/FileUtilitiesRegex.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.IO; -using System.Globalization; -using System.Text.RegularExpressions; - -namespace Microsoft.Build.BuildEngine.Shared -{ - /// - /// This class contains utility methods for file IO. - /// Separate from FileUtilities because some assemblies may only need the patterns. - /// PERF\COVERAGE NOTE: Try to keep classes in 'shared' as granular as possible. All the methods in - /// each class get pulled into the resulting assembly. - /// - /// SumedhK, JomoF - internal static class FileUtilitiesRegex - { - // regular expression used to match file-specs beginning with ":" - internal static readonly Regex DrivePattern = new Regex(@"^[A-Za-z]:"); - - // regular expression used to match UNC paths beginning with "\\\" - internal static readonly Regex UNCPattern = new Regex(String.Format(CultureInfo.InvariantCulture, - @"^[\{0}\{1}][\{0}\{1}][^\{0}\{1}]+[\{0}\{1}][^\{0}\{1}]+", Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar)); - } -} diff --git a/src/Deprecated/Engine/Shared/FrameworkLocationHelper.cs b/src/Deprecated/Engine/Shared/FrameworkLocationHelper.cs deleted file mode 100644 index 177c0bf7daa..00000000000 --- a/src/Deprecated/Engine/Shared/FrameworkLocationHelper.cs +++ /dev/null @@ -1,564 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.IO; - -namespace Microsoft.Build.BuildEngine.Shared -{ - /// - /// FrameworkLocationHelper provides utility methods for locating .NET Framework and .NET Framework SDK directories and files - /// - internal static class FrameworkLocationHelper - { - #region Private and internal members - - /// - /// By default when a root path is not specified we would like to use the program files directory \ reference assemblies\framework as the root location - /// to generate the reference assembly paths from. - /// - internal static readonly string programFiles = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles); - internal static readonly string programFiles32 = GenerateProgramFiles32(); - internal static readonly string programFilesReferenceAssemblyLocation = GenerateProgramFilesReferenceAssemblyRoot(); - - private const string dotNetFrameworkRegistryPath = "SOFTWARE\\Microsoft\\.NETFramework"; - private const string dotNetFrameworkSetupRegistryPath = "SOFTWARE\\Microsoft\\NET Framework Setup\\NDP"; - private const string dotNetFrameworkSetupRegistryInstalledName = "Install"; - - internal const string fullDotNetFrameworkRegistryKey = "HKEY_LOCAL_MACHINE\\" + dotNetFrameworkRegistryPath; - private const string dotNetFrameworkAssemblyFoldersRegistryPath = dotNetFrameworkRegistryPath + "\\AssemblyFolders"; - private const string referenceAssembliesRegistryValueName = "All Assemblies In"; - - internal const string dotNetFrameworkSdkInstallKeyValueV11 = "SDKInstallRootv1.1"; - internal const string dotNetFrameworkVersionFolderPrefixV11 = "v1.1"; // v1.1 is for Everett. - private const string dotNetFrameworkVersionV11 = "v1.1.4322"; // full Everett version to pass to NativeMethodsShared.GetRequestedRuntimeInfo(). - private const string dotNetFrameworkRegistryKeyV11 = dotNetFrameworkSetupRegistryPath + "\\" + dotNetFrameworkVersionV11; - - internal const string dotNetFrameworkSdkInstallKeyValueV20 = "SDKInstallRootv2.0"; - internal const string dotNetFrameworkVersionFolderPrefixV20 = "v2.0"; // v2.0 is for Whidbey. - private const string dotNetFrameworkVersionV20 = "v2.0.50727"; // full Whidbey version to pass to NativeMethodsShared.GetRequestedRuntimeInfo(). - private const string dotNetFrameworkRegistryKeyV20 = dotNetFrameworkSetupRegistryPath + "\\" + dotNetFrameworkVersionV20; - - internal const string dotNetFrameworkVersionFolderPrefixV30 = "v3.0"; // v3.0 is for WinFx. - private const string dotNetFrameworkVersionV30 = "v3.0"; // full WinFx version to pass to NativeMethodsShared.GetRequestedRuntimeInfo(). - private const string dotNetFrameworkAssemblyFoldersRegistryKeyV30 = dotNetFrameworkAssemblyFoldersRegistryPath + "\\" + dotNetFrameworkVersionFolderPrefixV30; - private const string dotNetFrameworkRegistryKeyV30 = dotNetFrameworkSetupRegistryPath + "\\" + dotNetFrameworkVersionFolderPrefixV30 + "\\Setup"; - - private const string dotNetFrameworkSdkRegistryPathV35 = "SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v7.0A"; - internal const string fullDotNetFrameworkSdkRegistryKeyV35 = "HKEY_LOCAL_MACHINE\\" + dotNetFrameworkSdkRegistryPathV35; - private const string dotNetFrameworkRegistryKeyV35 = dotNetFrameworkSetupRegistryPath + "\\" + dotNetFrameworkVersionFolderPrefixV35; - internal const string dotNetFrameworkSdkInstallKeyValueV35 = "InstallationFolder"; - - internal const string dotNetFrameworkVersionFolderPrefixV35 = "v3.5"; // v3.5 is for Orcas. - - private const string dotNetFrameworkAssemblyFoldersRegistryKeyV35 = dotNetFrameworkAssemblyFoldersRegistryPath + "\\" + dotNetFrameworkVersionFolderPrefixV35; - private const string secondaryDotNetFrameworkSdkRegistryPathV35 = "SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows"; - internal const string secondaryDotNetFrameworkSdkInstallKeyValueV35 = "CurrentInstallFolder"; - - internal const string dotNetFrameworkVersionFolderPrefixV40 = "v4.0"; - private const string dotNetFrameworkVersionV40 = dotNetFrameworkVersionFolderPrefixV40; // full Dev10 version to pass to NativeMethodsShared.GetRequestedRuntimeInfo(). - private const string dotNetFrameworkSdkRegistryPathV40 = "SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v7.0A"; - internal const string fullDotNetFrameworkSdkRegistryKeyV40 = "HKEY_LOCAL_MACHINE\\" + dotNetFrameworkSdkRegistryPathV40; - internal const string dotNetFrameworkSdkInstallKeyValueV40 = "InstallationFolder"; - - private const string dotNetFrameworkAssemblyFoldersRegistryKeyV40 = dotNetFrameworkAssemblyFoldersRegistryPath + "\\" + dotNetFrameworkVersionFolderPrefixV40; - private const string secondaryDotNetFrameworkSdkRegistryPathV40 = "SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows"; - internal const string secondaryDotNetFrameworkSdkInstallKeyValueV40 = "CurrentInstallFolder"; - private const string dotNetFrameworkRegistryKeyV40 = dotNetFrameworkSetupRegistryPath + "\\v4\\Full"; - private static readonly GetDirectories getDirectories = new GetDirectories(Directory.GetDirectories); - - private static string pathToDotNetFrameworkV11; - internal static string PathToDotNetFrameworkV11 - { - get - { - if (FrameworkLocationHelper.pathToDotNetFrameworkV11 == null) - { - if (!CheckForFrameworkInstallation(dotNetFrameworkRegistryKeyV11, dotNetFrameworkSetupRegistryInstalledName)) - { - FrameworkLocationHelper.pathToDotNetFrameworkV11 = null; - } - else - { - FrameworkLocationHelper.pathToDotNetFrameworkV11 = - FindDotNetFrameworkPath( - Path.GetDirectoryName(typeof(object).Module.FullyQualifiedName), - dotNetFrameworkVersionFolderPrefixV11, - getDirectories - ); - } - } - - return FrameworkLocationHelper.pathToDotNetFrameworkV11; - } - } - - private static string pathToDotNetFrameworkV20; - - internal static string PathToDotNetFrameworkV20 - { - get - { - if (FrameworkLocationHelper.pathToDotNetFrameworkV20 == null) - { - if (!CheckForFrameworkInstallation(dotNetFrameworkRegistryKeyV20, dotNetFrameworkSetupRegistryInstalledName)) - { - FrameworkLocationHelper.pathToDotNetFrameworkV20 = null; - } - else - { - FrameworkLocationHelper.pathToDotNetFrameworkV20 = - FindDotNetFrameworkPath( - Path.GetDirectoryName(typeof(object).Module.FullyQualifiedName), - dotNetFrameworkVersionFolderPrefixV20, - getDirectories - ); - } - } - - return FrameworkLocationHelper.pathToDotNetFrameworkV20; - } - } - - private static string pathToDotNetFrameworkV30; - - internal static string PathToDotNetFrameworkV30 - { - get - { - if (FrameworkLocationHelper.pathToDotNetFrameworkV30 == null) - { - if (!CheckForFrameworkInstallation(dotNetFrameworkRegistryKeyV30, "InstallSuccess")) - { - FrameworkLocationHelper.pathToDotNetFrameworkV30 = null; - } - else - { - FrameworkLocationHelper.pathToDotNetFrameworkV30 = - FindDotNetFrameworkPath( - Path.GetDirectoryName(typeof(object).Module.FullyQualifiedName), - dotNetFrameworkVersionFolderPrefixV30, - getDirectories - ); - } - } - - return FrameworkLocationHelper.pathToDotNetFrameworkV30; - } - } - - private static string pathToDotNetFrameworkV35; - - internal static string PathToDotNetFrameworkV35 - { - get - { - if (FrameworkLocationHelper.pathToDotNetFrameworkV35 == null) - { - if (!CheckForFrameworkInstallation(dotNetFrameworkRegistryKeyV35, dotNetFrameworkSetupRegistryInstalledName)) - { - FrameworkLocationHelper.pathToDotNetFrameworkV35 = null; - } - else - { - FrameworkLocationHelper.pathToDotNetFrameworkV35 = - FindDotNetFrameworkPath( - Path.GetDirectoryName(typeof(object).Module.FullyQualifiedName), - dotNetFrameworkVersionFolderPrefixV35, - getDirectories - ); - } - } - - return FrameworkLocationHelper.pathToDotNetFrameworkV35; - } - } - - private static string pathToDotNetFrameworkV40; - - internal static string PathToDotNetFrameworkV40 - { - get - { - if (FrameworkLocationHelper.pathToDotNetFrameworkV40 == null) - { - if (!CheckForFrameworkInstallation(dotNetFrameworkRegistryKeyV40, dotNetFrameworkSetupRegistryInstalledName)) - { - FrameworkLocationHelper.pathToDotNetFrameworkV40 = null; - } - else - { - FrameworkLocationHelper.pathToDotNetFrameworkV40 = - FindDotNetFrameworkPath( - Path.GetDirectoryName(typeof(object).Module.FullyQualifiedName), - dotNetFrameworkVersionFolderPrefixV40, - getDirectories - ); - } - } - - return FrameworkLocationHelper.pathToDotNetFrameworkV40; - } - } - - private static string pathToDotNetFrameworkSdkV11; - - internal static string PathToDotNetFrameworkSdkV11 - { - get - { - if (FrameworkLocationHelper.pathToDotNetFrameworkSdkV11 == null) - { - FrameworkLocationHelper.pathToDotNetFrameworkSdkV11 = FindRegistryValueUnderKey( - dotNetFrameworkRegistryPath, - dotNetFrameworkSdkInstallKeyValueV11); - } - - return FrameworkLocationHelper.pathToDotNetFrameworkSdkV11; - } - } - - private static string pathToDotNetFrameworkSdkV20; - - internal static string PathToDotNetFrameworkSdkV20 - { - get - { - if (FrameworkLocationHelper.pathToDotNetFrameworkSdkV20 == null) - { - FrameworkLocationHelper.pathToDotNetFrameworkSdkV20 = FindRegistryValueUnderKey( - dotNetFrameworkRegistryPath, - dotNetFrameworkSdkInstallKeyValueV20); - } - - return FrameworkLocationHelper.pathToDotNetFrameworkSdkV20; - } - } - - private static string pathToDotNetFrameworkSdkV35; - - internal static string PathToDotNetFrameworkSdkV35 - { - get - { - if (FrameworkLocationHelper.pathToDotNetFrameworkSdkV35 == null) - { - FrameworkLocationHelper.pathToDotNetFrameworkSdkV35 = FindRegistryValueUnderKey( - dotNetFrameworkSdkRegistryPathV35, - dotNetFrameworkSdkInstallKeyValueV35); - - // Because there is no longer a strong 1:1 mapping between FX versions and SDK - // versions, if we're unable to locate the desired SDK version, we will try to - // use whichever SDK version is installed by looking at the key pointing to the - // "latest" version. - // - // This isn't ideal, but it will allow our tasks to function on any of several - // related SDKs even if they don't have exactly the same versions. - - if (String.IsNullOrEmpty(FrameworkLocationHelper.pathToDotNetFrameworkSdkV35)) - { - FrameworkLocationHelper.pathToDotNetFrameworkSdkV35 = FindRegistryValueUnderKey( - secondaryDotNetFrameworkSdkRegistryPathV35, - secondaryDotNetFrameworkSdkInstallKeyValueV35); - } - } - - return FrameworkLocationHelper.pathToDotNetFrameworkSdkV35; - } - } - - private static string pathToDotNetFrameworkSdkV40; - - internal static string PathToDotNetFrameworkSdkV40 - { - get - { - if (FrameworkLocationHelper.pathToDotNetFrameworkSdkV40 == null) - { - FrameworkLocationHelper.pathToDotNetFrameworkSdkV40 = FindRegistryValueUnderKey( - dotNetFrameworkSdkRegistryPathV40, - dotNetFrameworkSdkInstallKeyValueV40); - - // Because there is no longer a strong 1:1 mapping between FX versions and SDK - // versions, if we're unable to locate the desired SDK version, we will try to - // use whichever SDK version is installed by looking at the key pointing to the - // "latest" version. For example, instead of 6.0A, we might fall back to 6.0B. - // - // This isn't ideal, but it will allow our tasks to function on any of several - // related SDKs even if they don't have exactly the same versions. - - if (String.IsNullOrEmpty(FrameworkLocationHelper.pathToDotNetFrameworkSdkV40)) - { - FrameworkLocationHelper.pathToDotNetFrameworkSdkV40 = FindRegistryValueUnderKey( - secondaryDotNetFrameworkSdkRegistryPathV40, - secondaryDotNetFrameworkSdkInstallKeyValueV40); - } - } - - return FrameworkLocationHelper.pathToDotNetFrameworkSdkV40; - } - } - - private static string pathToDotNetFrameworkReferenceAssembliesV30; - - internal static string PathToDotNetFrameworkReferenceAssembliesV30 - { - get - { - if (FrameworkLocationHelper.pathToDotNetFrameworkReferenceAssembliesV30 == null) - { - FrameworkLocationHelper.pathToDotNetFrameworkReferenceAssembliesV30 = FindRegistryValueUnderKey( - dotNetFrameworkAssemblyFoldersRegistryKeyV30, - referenceAssembliesRegistryValueName); - - if (FrameworkLocationHelper.pathToDotNetFrameworkReferenceAssembliesV30 == null) - { - FrameworkLocationHelper.pathToDotNetFrameworkReferenceAssembliesV30 = GenerateReferenceAssemblyDirectory(dotNetFrameworkVersionFolderPrefixV30); - } - } - - return FrameworkLocationHelper.pathToDotNetFrameworkReferenceAssembliesV30; - } - } - - private static string pathToDotNetFrameworkReferenceAssembliesV35; - - internal static string PathToDotNetFrameworkReferenceAssembliesV35 - { - get - { - if (FrameworkLocationHelper.pathToDotNetFrameworkReferenceAssembliesV35 == null) - { - FrameworkLocationHelper.pathToDotNetFrameworkReferenceAssembliesV35 = FindRegistryValueUnderKey( - dotNetFrameworkAssemblyFoldersRegistryKeyV35, - referenceAssembliesRegistryValueName); - - if (FrameworkLocationHelper.pathToDotNetFrameworkReferenceAssembliesV35 == null) - { - FrameworkLocationHelper.pathToDotNetFrameworkReferenceAssembliesV35 = GenerateReferenceAssemblyDirectory(dotNetFrameworkVersionFolderPrefixV35); - } - } - - return FrameworkLocationHelper.pathToDotNetFrameworkReferenceAssembliesV35; - } - } - - private static string pathToDotNetFrameworkReferenceAssembliesV40; - - internal static string PathToDotNetFrameworkReferenceAssembliesV40 - { - get - { - if (FrameworkLocationHelper.pathToDotNetFrameworkReferenceAssembliesV40 == null) - { - FrameworkLocationHelper.pathToDotNetFrameworkReferenceAssembliesV40 = FindRegistryValueUnderKey( - dotNetFrameworkAssemblyFoldersRegistryKeyV40, - referenceAssembliesRegistryValueName); - - if (FrameworkLocationHelper.pathToDotNetFrameworkReferenceAssembliesV40 == null) - { - FrameworkLocationHelper.pathToDotNetFrameworkReferenceAssembliesV40 = GenerateReferenceAssemblyDirectory(dotNetFrameworkVersionFolderPrefixV40); - } - } - - return FrameworkLocationHelper.pathToDotNetFrameworkReferenceAssembliesV40; - } - } - - internal static string GetPathToDotNetFramework(Version version) - { - string frameworkVersion = version.Major + "." + version.Minor; - - switch (frameworkVersion) - { - case "1.1": - return FrameworkLocationHelper.PathToDotNetFrameworkV11; - - case "2.0": - return FrameworkLocationHelper.PathToDotNetFrameworkV20; - - case "3.0": - return FrameworkLocationHelper.PathToDotNetFrameworkV30; - - case "3.5": - return FrameworkLocationHelper.PathToDotNetFrameworkV35; - - case "4.0": - return FrameworkLocationHelper.PathToDotNetFrameworkV40; - - default: - ErrorUtilities.VerifyThrowArgument(false, "FrameworkLocationHelper.UnsupportedFrameworkVersion", frameworkVersion); - return null; - } - } - - /// - /// Will return the path to the dot net framework reference assemblies if they exist under the program files\reference assembies\microsoft\framework directory - /// or null if the directory does not exist. - /// - private static string GenerateReferenceAssemblyDirectory(string versionPrefix) - { - string programFilesReferenceAssemblyDirectory = Path.Combine(programFilesReferenceAssemblyLocation, versionPrefix); - string referenceAssemblyDirectory = null; - - if (Directory.Exists(programFilesReferenceAssemblyDirectory)) - { - referenceAssemblyDirectory = programFilesReferenceAssemblyDirectory; - } - - return referenceAssemblyDirectory; - } - - /// - /// Look for the given registry value under the given key. - /// - /// JomoF,LukaszG - /// - /// - private static string FindRegistryValueUnderKey - ( - string registryBaseKeyName, - string registryKeyName - ) - { - Microsoft.Win32.RegistryKey baseKey = Microsoft.Win32.Registry - .LocalMachine - .OpenSubKey(registryBaseKeyName); - - if (baseKey == null) - { - return null; - } - - object keyValue = baseKey.GetValue(registryKeyName); - - if (keyValue == null) - { - return null; - } - - return keyValue.ToString(); - } - - /// - /// Check the registry key and value to see if the .net Framework is installed on the machine. - /// - /// Registry path to look for the value - /// Key to retreive the value from - /// True if the registry key is 1 false if it is not there. This method also return true if the complus enviornment variables are set. - internal static bool CheckForFrameworkInstallation(string registryEntryToCheckInstall, string registryValueToCheckInstall) - { - // Get the complus install root and version - string complusInstallRoot = Environment.GetEnvironmentVariable("COMPLUS_INSTALLROOT"); - string complusVersion = Environment.GetEnvironmentVariable("COMPLUS_VERSION"); - - // Complus is not set we need to make sure the framework we are targeting is installed. Check the registry key before trying to find the directory. - // If complus is set then we will return that directory as the framework directory, there is no need to check the registry value for the framework and it may not even be installed. - if (String.IsNullOrEmpty(complusInstallRoot) && String.IsNullOrEmpty(complusVersion)) - { - // If the registry entry is 1 then the framework is installed. Go ahead and find the directory. If it is not 1 then the framework is not installed, return null. - return String.Equals("1", FindRegistryValueUnderKey(registryEntryToCheckInstall, registryValueToCheckInstall), StringComparison.OrdinalIgnoreCase); - } - - return true; - } - - /// - /// Heuristic that first considers the current runtime path and then searches the base of that path for the given - /// frameworks version. - /// - /// JomoF - /// The path to the runtime that is currently executing. - /// Should be something like 'v1.2' that indicates the runtime version we want. - /// Should be the full version number of the runtime version we want. - /// Delegate to method that can return filesystem entries. - /// Whether we should fall back to a search heuristic if other searches fail. - /// Will return 'null' if there is no target frameworks on this machine. - internal static string FindDotNetFrameworkPath - ( - string currentRuntimePath, - string prefix, - GetDirectories getDirectories - ) - { - string leaf = Path.GetFileName(currentRuntimePath); - if (leaf.StartsWith(prefix, StringComparison.Ordinal)) - { - // If the current runtime starts with correct prefix, then this is the - // runtime we want to use. - return currentRuntimePath; - } - - // We haven't managed to use exact methods to locate the FX, so - // search for the correct path with a heuristic. - string baseLocation = Path.GetDirectoryName(currentRuntimePath); - string searchPattern = prefix + "*"; - string[] directories = getDirectories(baseLocation, searchPattern); - - if (directories.Length == 0) - { - // Couldn't find the path, return a null. - return null; - } - - // We don't care which one we choose, but we want to be predictible. - // The intention here is to choose the alphabetical maximum. - string max = directories[0]; - - // the max.EndsWith condition: pre beta 2 versions of v3.5 have build number like v3.5.20111. - // This was removed in beta2 - // We should favor \v3.5 over \v3.5.xxxxx - // versions previous to 2.0 have .xxxx version numbers. 3.0 and 3.5 do not. - if (!max.EndsWith(prefix, StringComparison.OrdinalIgnoreCase)) - { - for (int i = 1; i < directories.Length; ++i) - { - if (directories[i].EndsWith(prefix, StringComparison.OrdinalIgnoreCase)) - { - max = directories[i]; - break; - } - else if (String.Compare(directories[i], max, StringComparison.OrdinalIgnoreCase) > 0) - { - max = directories[i]; - } - } - } - - return max; - } - - #endregion - - /// - /// Determine the 32 bit program files directory, this is used for finding where the reference assemblies live. - /// - internal static string GenerateProgramFiles32() - { - // On a 64 bit machine we always want to use the program files x86. If we are running as a 64 bit process then this variable will be set correctly - // If we are on a 32 bit machine or running as a 32 bit process then this variable will be null and the programFiles variable will be correct. - string programFilesX86 = Environment.GetEnvironmentVariable("ProgramFiles(x86)"); - if (String.IsNullOrEmpty(programFilesX86)) - { - // 32 bit box - programFilesX86 = programFiles; - } - - return programFilesX86; - } - - /// - /// Generate the path to the program files reference assembly location by taking in the program files special folder and then - /// using that path to generate the path to the reference assemblies location. - /// - internal static string GenerateProgramFilesReferenceAssemblyRoot() - { - string combinedPath = Path.Combine(programFiles32, "Reference Assemblies\\Microsoft\\Framework"); - return Path.GetFullPath(combinedPath); - } - } -} diff --git a/src/Deprecated/Engine/Shared/InternalErrorException.cs b/src/Deprecated/Engine/Shared/InternalErrorException.cs deleted file mode 100644 index b4e04642429..00000000000 --- a/src/Deprecated/Engine/Shared/InternalErrorException.cs +++ /dev/null @@ -1,84 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Runtime.Serialization; - -namespace Microsoft.Build.BuildEngine.Shared -{ - /// - /// This exception is to be thrown whenever an assumption we have made in the code turns out to be false. Thus, if this - /// exception ever gets thrown, it is because of a bug in our own code, not because of something the user or project author - /// did wrong. - /// - /// !~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~ - /// WARNING: When this file is shared into multiple assemblies each assembly will view this as a different type. - /// Don't throw this exception from one assembly and catch it in another. - /// !~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~!~ - /// - /// - /// RGoel - [Serializable] - internal sealed class InternalErrorException : Exception - { - /// - /// Default constructor. - /// - /// RGoel - internal InternalErrorException() : base() - { - // do nothing - } - - /// - /// Creates an instance of this exception using the given message. - /// - /// RGoel - /// - internal InternalErrorException - ( - String message - ) : - base("Internal MSBuild Error: " + message) - { - // do nothing - } - - /// - /// Creates an instance of this exception using the given message and inner exception. - /// - /// - /// - internal InternalErrorException - ( - String message, - Exception innerException - ) : - base("Internal MSBuild Error: " + message, innerException) - { - // do nothing - } - - #region Serialization (update when adding new class members) - - /// - /// Private constructor used for (de)serialization. The constructor is private as this class is sealed - /// If we ever add new members to this class, we'll need to update this. - /// - /// - /// - private InternalErrorException(SerializationInfo info, StreamingContext context) - : base(info, context) - { - // Do nothing: no fields - } - - // Base implementation of GetObjectData() is sufficient; we have no fields - - #endregion - } -} diff --git a/src/Deprecated/Engine/Shared/LoadedType.cs b/src/Deprecated/Engine/Shared/LoadedType.cs deleted file mode 100644 index 49632ee85e7..00000000000 --- a/src/Deprecated/Engine/Shared/LoadedType.cs +++ /dev/null @@ -1,213 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Reflection; -using System.Collections.Generic; -using Microsoft.Build.Framework; - -namespace Microsoft.Build.BuildEngine.Shared -{ - /// - /// This class packages information about a type loaded from an assembly: for example, - /// the GenerateResource task class type or the ConsoleLogger logger class type. - /// - /// SumedhK - internal sealed class LoadedType - { - #region Constructors - - /// - /// Creates an instance of this class for the given type. - /// - /// SumedhK - /// - /// - internal LoadedType(Type type, AssemblyLoadInfo assembly) - { - ErrorUtilities.VerifyThrow(type != null, "We must have the type."); - ErrorUtilities.VerifyThrow(assembly != null, "We must have the assembly the type was loaded from."); - - this.type = type; - this.assembly = assembly; - } - - #endregion - - #region Methods - - /// - /// Gets the list of names of public instance properties that have the required attribute applied. - /// Caches the result - since it can't change during the build. - /// - /// - public Dictionary GetNamesOfPropertiesWithRequiredAttribute() - { - if (propertyInfoCache == null) - { - PopulatePropertyInfoCache(); - } - return namesOfPropertiesWithRequiredAttribute; - } - - /// - /// Gets the list of names of public instance properties that have the output attribute applied. - /// Caches the result - since it can't change during the build. - /// - /// - public Dictionary GetNamesOfPropertiesWithOutputAttribute() - { - if (propertyInfoCache == null) - { - PopulatePropertyInfoCache(); - } - return namesOfPropertiesWithOutputAttribute; - } - - /// - /// Get the cached propertyinfo of the given name - /// - /// property name - /// PropertyInfo - public PropertyInfo GetProperty(string propertyName) - { - if (propertyInfoCache == null) - { - PopulatePropertyInfoCache(); - } - - PropertyInfo propertyInfo; - if (!propertyInfoCache.TryGetValue(propertyName, out propertyInfo)) - { - return null; - } - else - { - if (namesOfPropertiesWithAmbiguousMatches.ContainsKey(propertyName)) - { - // See comment in PopulatePropertyInfoCache - throw new AmbiguousMatchException(); - } - - return propertyInfo; - } - } - - /// - /// Populate the cache of PropertyInfos for this type - /// - private void PopulatePropertyInfoCache() - { - if (propertyInfoCache == null) - { - propertyInfoCache = new Dictionary(StringComparer.OrdinalIgnoreCase); - namesOfPropertiesWithRequiredAttribute = new Dictionary(StringComparer.OrdinalIgnoreCase); - namesOfPropertiesWithOutputAttribute = new Dictionary(StringComparer.OrdinalIgnoreCase); - namesOfPropertiesWithAmbiguousMatches = new Dictionary(StringComparer.OrdinalIgnoreCase); - - PropertyInfo[] propertyInfos = this.Type.GetProperties(BindingFlags.Instance | BindingFlags.Public); - - for (int i = 0; i < propertyInfos.Length; i++) - { - try - { - propertyInfoCache.Add(propertyInfos[i].Name, propertyInfos[i]); - } - catch (ArgumentException) - { - // We have encountered a duplicate entry in our hashtable; if we had used BindingFlags.IgnoreCase this - // would have produced an AmbiguousMatchException. In the old code, before this cache existed, - // that wouldn't have been thrown unless and until the project actually tried to set this ambiguous parameter. - // So rather than fail here, we store a list of ambiguous names and throw later, when one of them - // is requested. - namesOfPropertiesWithAmbiguousMatches[propertyInfos[i].Name] = String.Empty; - } - - if (propertyInfos[i].IsDefined(typeof(RequiredAttribute), false /* uninherited */)) - { - // we have a require attribute defined, keep a record of that - namesOfPropertiesWithRequiredAttribute[propertyInfos[i].Name] = String.Empty; - } - - if (propertyInfos[i].IsDefined(typeof(OutputAttribute), false /* uninherited */)) - { - // we have a output attribute defined, keep a record of that - namesOfPropertiesWithOutputAttribute[propertyInfos[i].Name] = String.Empty; - } - } - } - } - - /// - /// Gets whether there's a LoadInSeparateAppDomain attribute on this type. - /// Caches the result - since it can't change during the build. - /// - /// - public bool HasLoadInSeparateAppDomainAttribute() - { - if (hasLoadInSeparateAppDomainAttribute == null) - { - hasLoadInSeparateAppDomainAttribute = this.Type.IsDefined(typeof(LoadInSeparateAppDomainAttribute), true /* inherited */); - } - - return (bool)hasLoadInSeparateAppDomainAttribute; - } - - #endregion - - - #region Properties - - /// - /// Gets the type that was loaded from an assembly. - /// - /// SumedhK - /// The loaded type. - internal Type Type - { - get - { - return type; - } - } - - /// - /// Gets the assembly the type was loaded from. - /// - /// SumedhK - /// The assembly info for the loaded type. - internal AssemblyLoadInfo Assembly - { - get - { - return assembly; - } - } - - #endregion - - // the type that was loaded - private Type type; - // the assembly the type was loaded from - private AssemblyLoadInfo assembly; - - // cache of names of required properties on this type - private Dictionary namesOfPropertiesWithRequiredAttribute; - - // cache of names of output properties on this type - private Dictionary namesOfPropertiesWithOutputAttribute; - - // cache of names of properties on this type whose names are ambiguous - private Dictionary namesOfPropertiesWithAmbiguousMatches; - - // cache of PropertyInfos for this type - private Dictionary propertyInfoCache; - - // whether the loadinseparateappdomain attribute is applied to this type - private bool? hasLoadInSeparateAppDomainAttribute; - } -} diff --git a/src/Deprecated/Engine/Shared/NativeMethodsShared.cs b/src/Deprecated/Engine/Shared/NativeMethodsShared.cs deleted file mode 100644 index a411b606cbb..00000000000 --- a/src/Deprecated/Engine/Shared/NativeMethodsShared.cs +++ /dev/null @@ -1,168 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Text; -using System.Runtime.InteropServices; - -namespace Microsoft.Build.BuildEngine.Shared -{ - /// - /// Interop methods. - /// - /// LukaszG - internal static class NativeMethods - { - #region Constants - - internal const uint ERROR_INSUFFICIENT_BUFFER = 0x8007007A; - internal const uint STARTUP_LOADER_SAFEMODE = 0x10; - internal const uint S_OK = 0x0; - internal const uint RUNTIME_INFO_DONT_SHOW_ERROR_DIALOG = 0x40; - internal const uint FILE_TYPE_CHAR = 0x0002; - internal const Int32 STD_OUTPUT_HANDLE = -11; - - private const string kernel32Dll = "kernel32.dll"; - private const string mscoreeDLL = "mscoree.dll"; - - internal static HandleRef NullHandleRef = new HandleRef(null, IntPtr.Zero); - - internal static IntPtr NullIntPtr = new IntPtr(0); - #endregion - - #region Member data - - /// - /// Default buffer size to use when dealing with the Windows API. - /// - /// - /// This member is intentionally not a constant because we want to allow - /// unit tests to change it. - /// - internal static int MAX_PATH = 260; - - #endregion - - #region Wrapper methods - - /// - /// Looks for the given file in the system path i.e. all locations in - /// the %PATH% environment variable. - /// - /// - /// The location of the file, or null if file not found. - internal static string FindOnPath(string filename) - { - StringBuilder pathBuilder = new StringBuilder(MAX_PATH + 1); - string pathToFile = null; - - // we may need to make two attempts because there's a small chance - // the buffer may not be sized correctly the first time - for (int i = 0; i < 2; i++) - { - uint result = SearchPath - ( - null /* search the system path */, - filename /* look for this file */, - null /* don't add an extra extension to the filename when searching */, - pathBuilder.Capacity /* size of buffer */, - pathBuilder /* buffer to write path into */, - null /* don't want pointer to filename in the return path */ - ); - - // if the buffer is not big enough - if (result > pathBuilder.Capacity) - { - ErrorUtilities.VerifyThrow(i == 0, "We should not have to resize the buffer twice."); - - // resize the buffer and try again - pathBuilder.Capacity = (int)result; - } - else if (result > 0) - { - // file was found, so don't make another attempt - pathToFile = pathBuilder.ToString(); - break; - } - else - { - // file was not found, so quit - break; - } - } - - return pathToFile; - } - - #endregion - - #region PInvoke - - /// - /// Gets the current OEM code page which is used by console apps - /// (as opposed to the Windows/ANSI code page) - /// Basically for each ANSI code page (set in Regional settings) there's a corresponding OEM code page - /// that needs to be used for instance when writing to batch files - /// - /// LukaszG - [DllImport(kernel32Dll)] - internal static extern int GetOEMCP(); - - - [DllImport(kernel32Dll, SetLastError = true, CharSet = CharSet.Unicode)] - private static extern uint SearchPath - ( - string path, - string fileName, - string extension, - int numBufferChars, - StringBuilder buffer, - int[] filePart - ); - - - [DllImport("kernel32.dll", PreserveSig = true, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - internal static extern bool FreeLibrary([In] IntPtr module); - - [DllImport("kernel32.dll", PreserveSig = true, BestFitMapping = false, ThrowOnUnmappableChar = true, CharSet = CharSet.Ansi, SetLastError = true)] - internal static extern IntPtr GetProcAddress(IntPtr module, string procName); - - [DllImport("kernel32.dll", CharSet = CharSet.Unicode, PreserveSig = true, SetLastError = true)] - internal static extern IntPtr LoadLibrary(string fileName); - - [DllImport(mscoreeDLL, SetLastError = true, CharSet = CharSet.Unicode)] - internal static extern uint GetRequestedRuntimeInfo(String pExe, - String pwszVersion, - String pConfigurationFile, - uint startupFlags, - uint runtimeInfoFlags, - StringBuilder pDirectory, - int dwDirectory, - out uint dwDirectoryLength, - StringBuilder pVersion, - int cchBuffer, - out uint dwlength); - - /// - /// Gets the fully qualified filename of the currently executing .exe - /// - [DllImport(kernel32Dll, SetLastError = true, CharSet = CharSet.Unicode)] - internal static extern int GetModuleFileName(HandleRef hModule, StringBuilder buffer, int length); - - [DllImport("kernel32.dll")] - internal static extern IntPtr GetStdHandle(int nStdHandle); - - [DllImport("kernel32.dll")] - internal static extern uint GetFileType(IntPtr hFile); - - [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)] - internal static extern int GetCurrentDirectory(int nBufferLength, StringBuilder lpBuffer); - - #endregion - } -} diff --git a/src/Deprecated/Engine/Shared/ProjectConfigurationInSolution.cs b/src/Deprecated/Engine/Shared/ProjectConfigurationInSolution.cs deleted file mode 100644 index d5f7d9097e4..00000000000 --- a/src/Deprecated/Engine/Shared/ProjectConfigurationInSolution.cs +++ /dev/null @@ -1,63 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; - -namespace Microsoft.Build.BuildEngine.Shared -{ - /// - /// This class represents an entry for a project configuration in a solution configuration. - /// - /// LukaszG - internal class ProjectConfigurationInSolution : ConfigurationInSolution - { - /// - /// Constructor. - /// - /// - /// - /// - /// LukaszG - internal ProjectConfigurationInSolution(string configurationName, string platformName, bool includeInBuild) - : base(configurationName, RemoveSpaceFromAnyCpuPlatform(platformName)) - { - this.includeInBuild = includeInBuild; - } - - private bool includeInBuild; - - /// - /// true if this project configuration should be built as part of its parent solution configuration - /// - /// LukaszG - internal bool IncludeInBuild - { - get { return this.includeInBuild; } - } - - /// - /// This is a hacky method to remove the space in the "Any CPU" platform in project configurations. - /// The problem is that this platform is stored as "AnyCPU" in project files, but the project system - /// reports it as "Any CPU" to the solution configuration manager. Because of that all solution configurations - /// contain the version with a space in it, and when we try and give that name to actual projects, - /// they have no clue what we're talking about. We need to remove the space in project platforms so that - /// the platform name matches the one used in projects. - /// - /// - /// - /// LukaszG - private static string RemoveSpaceFromAnyCpuPlatform(string platformName) - { - if (string.Equals(platformName, "Any CPU", StringComparison.OrdinalIgnoreCase)) - { - return "AnyCPU"; - } - - return platformName; - } - } -} diff --git a/src/Deprecated/Engine/Shared/ProjectErrorUtilities.cs b/src/Deprecated/Engine/Shared/ProjectErrorUtilities.cs deleted file mode 100644 index 7c93d4bf4bc..00000000000 --- a/src/Deprecated/Engine/Shared/ProjectErrorUtilities.cs +++ /dev/null @@ -1,365 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System.Xml; - -/****************************************************************************** - * - * !! WARNING !! - * - * This class depends on the build engine assembly! Do not share this class - * into any assembly that is not supposed to take a dependency on the build - * engine assembly! - * - * - ******************************************************************************/ - -namespace Microsoft.Build.BuildEngine.Shared -{ - /// - /// This class contains methods that are useful for error checking and - /// validation of project files. - /// - /// SumedhK - internal static class ProjectErrorUtilities - { - /// - /// This method is used to flag errors in the project file being processed. - /// Do NOT use this method in place of ErrorUtilities.VerifyThrow(), because - /// ErrorUtilities.VerifyThrow() is used to flag internal/programming errors. - /// - /// SumedhK - /// The condition to check. - /// The invalid project node (can be null). - /// The resource string for the error message. - internal static void VerifyThrowInvalidProject - ( - bool condition, - XmlNode xmlNode, - string resourceName - ) - { - VerifyThrowInvalidProject(condition, null, xmlNode, resourceName); - } - - /// - /// Overload for one string format argument. - /// - /// The invalid project node (can be null). - /// The resource string for the error message. - /// - internal static void ThrowInvalidProject - ( - XmlNode xmlNode, - string resourceName, - object arg0 - ) - { - VerifyThrowInvalidProject(false, null, xmlNode, resourceName, arg0); - } - - /// - /// Overload for one string format argument. - /// - /// SumedhK - /// The condition to check. - /// The invalid project node (can be null). - /// The resource string for the error message. - /// - internal static void VerifyThrowInvalidProject - ( - bool condition, - XmlNode xmlNode, - string resourceName, - object arg0 - ) - { - VerifyThrowInvalidProject(condition, null, xmlNode, resourceName, arg0); - } - - /// - /// Overload for two string format arguments. - /// - /// The invalid project node (can be null). - /// The resource string for the error message. - /// - /// - internal static void ThrowInvalidProject - ( - XmlNode xmlNode, - string resourceName, - object arg0, - object arg1 - ) - { - VerifyThrowInvalidProject(false, null, xmlNode, resourceName, arg0, arg1); - } - - /// - /// Overload for two string format arguments. - /// - /// SumedhK - /// The condition to check. - /// The invalid project node (can be null). - /// The resource string for the error message. - /// - /// - internal static void VerifyThrowInvalidProject - ( - bool condition, - XmlNode xmlNode, - string resourceName, - object arg0, - object arg1 - ) - { - VerifyThrowInvalidProject(condition, null, xmlNode, resourceName, arg0, arg1); - } - - /// - /// Overload for three string format arguments. - /// - /// SumedhK - /// The condition to check. - /// The invalid project node (can be null). - /// The resource string for the error message. - /// - /// - /// - internal static void VerifyThrowInvalidProject - ( - bool condition, - XmlNode xmlNode, - string resourceName, - object arg0, - object arg1, - object arg2 - ) - { - VerifyThrowInvalidProject(condition, null, xmlNode, resourceName, arg0, arg1, arg2); - } - - /// - /// Overload for four string format arguments. - /// - /// SumedhK - /// The condition to check. - /// The invalid project node (can be null). - /// The resource string for the error message. - /// - /// - /// - /// - internal static void VerifyThrowInvalidProject - ( - bool condition, - XmlNode xmlNode, - string resourceName, - object arg0, - object arg1, - object arg2, - object arg3 - ) - { - VerifyThrowInvalidProject(condition, null, xmlNode, resourceName, arg0, arg1, arg2, arg3); - } - - /// - /// This method is used to flag errors in the project file being processed. - /// Do NOT use this method in place of ErrorUtilities.VerifyThrow(), because - /// ErrorUtilities.VerifyThrow() is used to flag internal/programming errors. - /// - /// SumedhK - /// The condition to check. - /// The resource string for the - /// error sub-category (can be null). - /// The invalid project node (can be null). - /// The resource string for the error message. - internal static void VerifyThrowInvalidProject - ( - bool condition, - string errorSubCategoryResourceName, - XmlNode xmlNode, - string resourceName - ) - { - if (!condition) - { - // PERF NOTE: explicitly passing null for the arguments array - // prevents memory allocation - ThrowInvalidProject(errorSubCategoryResourceName, xmlNode, resourceName, null); - } - } - - /// - /// Overload for one string format argument. - /// - /// SumedhK - /// The condition to check. - /// The resource string for the - /// error sub-category (can be null). - /// The invalid project node (can be null). - /// The resource string for the error message. - /// - internal static void VerifyThrowInvalidProject - ( - bool condition, - string errorSubCategoryResourceName, - XmlNode xmlNode, - string resourceName, - object arg0 - ) - { - // PERF NOTE: check the condition here instead of pushing it into - // the ThrowInvalidProject() method, because that method always - // allocates memory for its variable array of arguments - if (!condition) - { - ThrowInvalidProject(errorSubCategoryResourceName, xmlNode, resourceName, arg0); - } - } - - /// - /// Overload for two string format arguments. - /// - /// SumedhK - /// The condition to check. - /// The resource string for the - /// error sub-category (can be null). - /// The invalid project node (can be null). - /// The resource string for the error message. - /// - /// - internal static void VerifyThrowInvalidProject - ( - bool condition, - string errorSubCategoryResourceName, - XmlNode xmlNode, - string resourceName, - object arg0, - object arg1 - ) - { - // PERF NOTE: check the condition here instead of pushing it into - // the ThrowInvalidProject() method, because that method always - // allocates memory for its variable array of arguments - if (!condition) - { - ThrowInvalidProject(errorSubCategoryResourceName, xmlNode, resourceName, arg0, arg1); - } - } - - /// - /// Overload for three string format arguments. - /// - /// SumedhK - /// The condition to check. - /// The resource string for the - /// error sub-category (can be null). - /// The invalid project node (can be null). - /// The resource string for the error message. - /// - /// - /// - internal static void VerifyThrowInvalidProject - ( - bool condition, - string errorSubCategoryResourceName, - XmlNode xmlNode, - string resourceName, - object arg0, - object arg1, - object arg2 - ) - { - // PERF NOTE: check the condition here instead of pushing it into - // the ThrowInvalidProject() method, because that method always - // allocates memory for its variable array of arguments - if (!condition) - { - ThrowInvalidProject(errorSubCategoryResourceName, xmlNode, resourceName, arg0, arg1, arg2); - } - } - - /// - /// Overload for four string format arguments. - /// - /// SumedhK - /// The condition to check. - /// The resource string for the - /// error sub-category (can be null). - /// The invalid project node (can be null). - /// The resource string for the error message. - /// - /// - /// - /// - internal static void VerifyThrowInvalidProject - ( - bool condition, - string errorSubCategoryResourceName, - XmlNode xmlNode, - string resourceName, - object arg0, - object arg1, - object arg2, - object arg3 - ) - { - // PERF NOTE: check the condition here instead of pushing it into - // the ThrowInvalidProject() method, because that method always - // allocates memory for its variable array of arguments - if (!condition) - { - ThrowInvalidProject(errorSubCategoryResourceName, xmlNode, resourceName, arg0, arg1, arg2, arg3); - } - } - - /// - /// Throws an InvalidProjectFileException using the given data. - /// - /// PERF WARNING: calling a method that takes a variable number of arguments - /// is expensive, because memory is allocated for the array of arguments -- do - /// not call this method repeatedly in performance-critical scenarios - /// - /// SumedhK - /// The resource string for the - /// error sub-category (can be null). - /// The invalid project node (can be null). - /// The resource string for the error message. - /// Extra arguments for formatting the error message. - private static void ThrowInvalidProject - ( - string errorSubCategoryResourceName, - XmlNode xmlNode, - string resourceName, - params object[] args - ) - { -#if DEBUG - if (errorSubCategoryResourceName != null) - { - ResourceUtilities.VerifyResourceStringExists(errorSubCategoryResourceName); - } - - ResourceUtilities.VerifyResourceStringExists(resourceName); -#endif - string errorSubCategory = null; - - if (errorSubCategoryResourceName != null) - { - errorSubCategory = AssemblyResources.GetString(errorSubCategoryResourceName); - } - - string errorCode; - string helpKeyword; - string message = ResourceUtilities.FormatResourceString(out errorCode, out helpKeyword, resourceName, args); - - throw new InvalidProjectFileException(xmlNode, message, errorSubCategory, errorCode, helpKeyword); - } - } -} diff --git a/src/Deprecated/Engine/Shared/ProjectFileErrorUtilities.cs b/src/Deprecated/Engine/Shared/ProjectFileErrorUtilities.cs deleted file mode 100644 index 12b2ab979d5..00000000000 --- a/src/Deprecated/Engine/Shared/ProjectFileErrorUtilities.cs +++ /dev/null @@ -1,88 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -namespace Microsoft.Build.BuildEngine.Shared -{ - /// - /// This class contains methods that are useful for error checking and validation of project files. - /// - /// SumedhK - internal static class ProjectFileErrorUtilities - { - /// - /// This method is used to flag errors in the project file being processed. Do NOT use this method in place of - /// ErrorUtilities.VerifyThrow(), because ErrorUtilities.VerifyThrow() is used to flag internal/programming errors. - /// - /// PERF WARNING: calling a method that takes a variable number of arguments is expensive, because memory is allocated for - /// the array of arguments -- do not call this method repeatedly in performance-critical scenarios - /// - /// SumedhK - /// The condition to check. - /// The invalid project file. - /// The resource string for the error message. - /// Extra arguments for formatting the error message. - internal static void VerifyThrowInvalidProjectFile - ( - bool condition, - BuildEventFileInfo projectFile, - string resourceName, - params object[] args - ) - { - VerifyThrowInvalidProjectFile(condition, null, projectFile, resourceName, args); - } - - /// - /// This method is used to flag errors in the project file being processed. Do NOT use this method in place of - /// ErrorUtilities.VerifyThrow(), because ErrorUtilities.VerifyThrow() is used to flag internal/programming errors. - /// - /// PERF WARNING: calling a method that takes a variable number of arguments is expensive, because memory is allocated for - /// the array of arguments -- do not call this method repeatedly in performance-critical scenarios - /// - /// SumedhK - /// The condition to check. - /// The resource string for the error sub-category (can be null). - /// The invalid project file. - /// The resource string for the error message. - /// Extra arguments for formatting the error message. - internal static void VerifyThrowInvalidProjectFile - ( - bool condition, - string errorSubCategoryResourceName, - BuildEventFileInfo projectFile, - string resourceName, - params object[] args - ) - { - ErrorUtilities.VerifyThrow(projectFile != null, "Must specify the invalid project file. If project file is not available, use VerifyThrowInvalidProject() and pass in the XML node instead."); - -#if DEBUG - if (errorSubCategoryResourceName != null) - { - ResourceUtilities.VerifyResourceStringExists(errorSubCategoryResourceName); - } - - ResourceUtilities.VerifyResourceStringExists(resourceName); -#endif - if (!condition) - { - string errorSubCategory = null; - - if (errorSubCategoryResourceName != null) - { - errorSubCategory = AssemblyResources.GetString(errorSubCategoryResourceName); - } - - string errorCode; - string helpKeyword; - string message = ResourceUtilities.FormatResourceString(out errorCode, out helpKeyword, resourceName, args); - - throw new InvalidProjectFileException(projectFile.File, projectFile.Line, projectFile.Column, projectFile.EndLine, projectFile.EndColumn, message, errorSubCategory, errorCode, helpKeyword); - } - } - } -} diff --git a/src/Deprecated/Engine/Shared/ProjectInSolution.cs b/src/Deprecated/Engine/Shared/ProjectInSolution.cs deleted file mode 100644 index 9d2bc12f0d8..00000000000 --- a/src/Deprecated/Engine/Shared/ProjectInSolution.cs +++ /dev/null @@ -1,401 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections; -using System.Collections.Generic; -using System.IO; -using System.Security; -using System.Text; -using System.Xml; - -namespace Microsoft.Build.BuildEngine.Shared -{ - /// - /// An enumeration defining the different types of projects we might find in an SLN. - /// - internal enum SolutionProjectType - { - Unknown, // Everything else besides the below well-known project types. - ManagedProject, // C#, VB, and VJ# projects - VCProject, // VC projects, managed and unmanaged - SolutionFolder, // Not really a project, but persisted as such in the .SLN file. - WebProject, // Venus projects - EtpSubProject // Project inside an Enterprise Template project - } - - internal struct AspNetCompilerParameters - { - internal string aspNetVirtualPath; // For Venus projects only, Virtual path for web - internal string aspNetPhysicalPath; // For Venus projects only, Physical path for web - internal string aspNetTargetPath; // For Venus projects only, Target for output files - internal string aspNetForce; // For Venus projects only, Force overwrite of target - internal string aspNetUpdateable; // For Venus projects only, compiled web application is updateable - internal string aspNetDebug; // For Venus projects only, generate symbols, etc. - internal string aspNetKeyFile; // For Venus projects only, strong name key file. - internal string aspNetKeyContainer; // For Venus projects only, strong name key container. - internal string aspNetDelaySign; // For Venus projects only, delay sign strong name. - internal string aspNetAPTCA; // For Venus projects only, AllowPartiallyTrustedCallers. - internal string aspNetFixedNames; // For Venus projects only, generate fixed assembly names. - } - - /// - /// This class represents a project (or SLN folder) that is read in from a solution file. - /// - internal sealed class ProjectInSolution - { - #region Constants - - /// - /// Characters that need to be cleansed from a project name. - /// - private static readonly char[] charsToCleanse = { '%', '$', '@', ';', '.', '(', ')', '\'' }; - - /// - /// Project names that need to be disambiguated when forming a target name - /// - internal static readonly string[] projectNamesToDisambiguate = { "Build", "Rebuild", "Clean", "Publish" }; - - /// - /// Character that will be used to replace 'unclean' ones. - /// - private const char cleanCharacter = '_'; - - #endregion - - #region Member data - - private SolutionProjectType projectType; // For example, ManagedProject, VCProject, WebProject, etc. - private string projectName; // For example, "WindowsApplication1" - private string relativePath; // Relative from .SLN file. For example, "WindowsApplication1\WindowsApplication1.csproj" - private string projectGuid; // The unique Guid assigned to this project or SLN folder. - private ArrayList dependencies; // A list of strings representing the Guids of the dependent projects. - private ArrayList projectReferences; // A list of strings representing the guids of referenced projects. - // This is only used for VC/Venus projects - private string parentProjectGuid; // If this project (or SLN folder) is within a SLN folder, this is the Guid of the parent SLN folder. - private string uniqueProjectName; // For example, "MySlnFolder\MySubSlnFolder\WindowsApplication1" - private Hashtable aspNetConfigurations; // Key is configuration name, value is [struct] AspNetCompilerParameters - private SolutionParser parentSolution; // The parent solution for this project - private int dependencyLevel; // the dependency level of this project. 0 means no dependencies on other projects. - private bool isStaticLibrary; // for VCProjects, is this project a static library? - private bool childReferencesGathered; // Have we gathered the complete set of references for this project? - - /// - /// The project configuration in given solution configuration - /// K: full solution configuration name (cfg + platform) - /// V: project configuration - /// - private Dictionary projectConfigurations; - - #endregion - - #region Constructors - - internal ProjectInSolution(SolutionParser solution) - { - projectType = SolutionProjectType.Unknown; - projectName = null; - relativePath = null; - projectGuid = null; - dependencies = new ArrayList(); - projectReferences = new ArrayList(); - parentProjectGuid = null; - uniqueProjectName = null; - parentSolution = solution; - dependencyLevel = ProjectInSolution.DependencyLevelUnknown; - isStaticLibrary = false; - childReferencesGathered = false; - - // This hashtable stores a AspNetCompilerParameters struct for each configuration name supported. - aspNetConfigurations = new Hashtable(StringComparer.OrdinalIgnoreCase); - - projectConfigurations = new Dictionary(StringComparer.OrdinalIgnoreCase); - } - - #endregion - - #region Properties - - internal SolutionProjectType ProjectType - { - get { return projectType; } - set { projectType = value; } - } - - internal string ProjectName - { - get { return projectName; } - set { projectName = value; } - } - - internal string RelativePath - { - get { return relativePath; } - set { relativePath = value; } - } - - /// - /// Returns the absolute path for this project - /// - /// - /// LukaszG - internal string AbsolutePath - { - get - { - return Path.Combine(this.ParentSolution.SolutionFileDirectory, this.RelativePath); - } - } - - internal string ProjectGuid - { - get { return projectGuid; } - set { projectGuid = value; } - } - - internal ArrayList Dependencies - { - get { return dependencies; } - } - - internal ArrayList ProjectReferences - { - get { return projectReferences; } - } - - internal string ParentProjectGuid - { - get { return parentProjectGuid; } - set { parentProjectGuid = value; } - } - - internal SolutionParser ParentSolution - { - get { return parentSolution; } - set { parentSolution = value; } - } - - internal Hashtable AspNetConfigurations - { - get { return aspNetConfigurations; } - set { aspNetConfigurations = value; } - } - - internal Dictionary ProjectConfigurations - { - get { return this.projectConfigurations; } - } - - internal int DependencyLevel - { - get { return this.dependencyLevel; } - set { this.dependencyLevel = value; } - } - - internal bool IsStaticLibrary - { - get { return this.isStaticLibrary; } - set { this.isStaticLibrary = value; } - } - - internal bool ChildReferencesGathered - { - get { return this.childReferencesGathered; } - set { this.childReferencesGathered = value; } - } - - #endregion - - #region Methods - - private bool checkedIfCanBeMSBuildProjectFile = false; - private bool canBeMSBuildProjectFile; - private string canBeMSBuildProjectFileErrorMessage; - - /// - /// Looks at the project file node and determines (roughly) if the project file is in the MSBuild format. - /// The results are cached in case this method is called multiple times. - /// - /// Detailed error message in case we encounter critical problems reading the file - /// - internal bool CanBeMSBuildProjectFile(out string errorMessage) - { - if (checkedIfCanBeMSBuildProjectFile) - { - errorMessage = canBeMSBuildProjectFileErrorMessage; - return canBeMSBuildProjectFile; - } - - checkedIfCanBeMSBuildProjectFile = true; - canBeMSBuildProjectFile = false; - errorMessage = null; - - try - { - // Load the project file and get the first node - XmlDocument projectDocument = new XmlDocument(); - projectDocument.Load(this.AbsolutePath); - - XmlElement mainProjectElement = null; - - // The XML parser will guarantee that we only have one real root element, - // but we need to find it amongst the other types of XmlNode at the root. - foreach (XmlNode childNode in projectDocument.ChildNodes) - { - if (XmlUtilities.IsXmlRootElement(childNode)) - { - mainProjectElement = (XmlElement)childNode; - break; - } - } - - if (mainProjectElement?.LocalName == "Project") - { - if (String.Equals(mainProjectElement.NamespaceURI, XMakeAttributes.defaultXmlNamespace, StringComparison.OrdinalIgnoreCase)) - { - canBeMSBuildProjectFile = true; - return canBeMSBuildProjectFile; - } - } - } - // catch all sorts of exceptions - if we encounter any problems here, we just assume the project file is not - // in the MSBuild format - - // handle errors in path resolution - catch (SecurityException e) - { - canBeMSBuildProjectFileErrorMessage = e.Message; - } - // handle errors in path resolution - catch (NotSupportedException e) - { - canBeMSBuildProjectFileErrorMessage = e.Message; - } - // handle errors in loading project file - catch (IOException e) - { - canBeMSBuildProjectFileErrorMessage = e.Message; - } - // handle errors in loading project file - catch (UnauthorizedAccessException e) - { - canBeMSBuildProjectFileErrorMessage = e.Message; - } - // handle XML parsing errors (when reading project file) - // this is not critical, since the project file doesn't have to be in XML formal - catch (XmlException) - { - } - - errorMessage = canBeMSBuildProjectFileErrorMessage; - - return canBeMSBuildProjectFile; - } - - /// - /// Find the unique name for this project, e.g. SolutionFolder\SubSolutionFolder\ProjectName - /// - /// RGoel - internal string GetUniqueProjectName() - { - if (this.uniqueProjectName == null) - { - // EtpSubProject and Venus projects have names that are already unique. No need to prepend the SLN folder. - if ((this.ProjectType == SolutionProjectType.WebProject) || (this.ProjectType == SolutionProjectType.EtpSubProject)) - { - this.uniqueProjectName = CleanseProjectName(this.ProjectName); - } - else - { - // This is "normal" project, which in this context means anything non-Venus and non-EtpSubProject. - - // If this project has a parent SLN folder, first get the full unique name for the SLN folder, - // and tack on trailing backslash. - string uniqueName = String.Empty; - - if (this.ParentProjectGuid != null) - { - ProjectInSolution proj = (ProjectInSolution)this.ParentSolution.ProjectsByGuid[this.ParentProjectGuid]; - - ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(proj != null, "SubCategoryForSolutionParsingErrors", - new BuildEventFileInfo(parentSolution.SolutionFile), "SolutionParseNestedProjectError"); - - uniqueName = proj.GetUniqueProjectName() + "\\"; - } - - // Now tack on our own project name, and cache it in the ProjectInSolution object for future quick access. - this.uniqueProjectName = CleanseProjectName(uniqueName + this.ProjectName); - } - } - - return this.uniqueProjectName; - } - - /// - /// Cleanse the project name, by replacing characters like '@', '$' with '_' - /// - /// The name to be cleansed - /// string - /// KieranMo - private static string CleanseProjectName(string projectName) - { - ErrorUtilities.VerifyThrow(projectName != null, "Null strings not allowed."); - - // If there are no special chars, just return the original string immediately. - // Don't even instantiate the StringBuilder. - int indexOfChar = projectName.IndexOfAny(charsToCleanse); - if (indexOfChar == -1) - { - return projectName; - } - - // This is where we're going to work on the final string to return to the caller. - StringBuilder cleanProjectName = new StringBuilder(projectName); - - // Replace each unclean character with a clean one - foreach (char uncleanChar in charsToCleanse) - { - cleanProjectName.Replace(uncleanChar, cleanCharacter); - } - - return cleanProjectName.ToString(); - } - - /// - /// If the unique project name provided collides with one of the standard Solution project - /// entry point targets (Build, Rebuild, Clean, Publish), then disambiguate it by prepending the string "Solution:" - /// - /// The unique name for the project - /// string - /// KieranMo - internal static string DisambiguateProjectTargetName(string uniqueProjectName) - { - // Test our unique project name against those names that collide with Solution - // entry point targets - foreach (string projectName in projectNamesToDisambiguate) - { - if (String.Equals(uniqueProjectName, projectName, StringComparison.OrdinalIgnoreCase)) - { - // Prepend "Solution:" so that the collision is resolved, but the - // log of the solution project still looks reasonable. - return "Solution:" + uniqueProjectName; - } - } - - return uniqueProjectName; - } - - #endregion - - #region Constants - - internal const int DependencyLevelUnknown = -1; - internal const int DependencyLevelBeingDetermined = -2; - - #endregion - } -} diff --git a/src/Deprecated/Engine/Shared/ProjectWriter.cs b/src/Deprecated/Engine/Shared/ProjectWriter.cs deleted file mode 100644 index 715987e6fbe..00000000000 --- a/src/Deprecated/Engine/Shared/ProjectWriter.cs +++ /dev/null @@ -1,207 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System.IO; -using System.Xml; -using System.Text; -using System.Text.RegularExpressions; - -namespace Microsoft.Build.BuildEngine.Shared -{ - /// - /// This class is used to save MSBuild project files. It contains special handling for MSBuild notations that are not saved - /// correctly by the XML DOM's default save mechanism. - /// - /// SumedhK - internal sealed class ProjectWriter : XmlTextWriter - { - #region Regular expressions for item vector transforms - - /************************************************************************************************************************** - * WARNING: The regular expressions below MUST be kept in sync with the expressions in the ItemExpander class -- if the - * description of an item vector changes, the expressions must be updated in both places. - *************************************************************************************************************************/ - - // the portion of the expression that matches the item type or metadata name, eg: "foo123" - // Note that the pattern is more strict than the rules for valid XML element names. - internal const string itemTypeOrMetadataNameSpecification = @"[A-Za-z_][A-Za-z_0-9\-]*"; - - // description of an item vector transform, including the optional separator specification - private const string itemVectorTransformSpecification = - @"(?@\(\s*) - (?" + itemTypeOrMetadataNameSpecification + @") - (?(?\s*->\s*)(?'[^']*')) - (?\s*,\s*'[^']*')? - (?\s*\))"; - // ) - - // regular expression used to match item vector transforms - // internal for unit testing only - internal static readonly Regex itemVectorTransformPattern = new Regex(itemVectorTransformSpecification, RegexOptions.IgnorePatternWhitespace | RegexOptions.ExplicitCapture); - - // description of an item vector transform, including the optional separator specification, but with no (named) capturing - // groups -- see the WriteString() method for details - private const string itemVectorTransformRawSpecification = - @"@\(\s* - (" + itemTypeOrMetadataNameSpecification + @") - (\s*->\s*'[^']*') - (\s*,\s*'[^']*')? - \s*\)"; - - // regular expression used to match item vector transforms, with no (named) capturing groups - // internal for unit testing only - internal static readonly Regex itemVectorTransformRawPattern = new Regex(itemVectorTransformRawSpecification, RegexOptions.IgnorePatternWhitespace | RegexOptions.ExplicitCapture); - - /************************************************************************************************************************** - * WARNING: The regular expressions above MUST be kept in sync with the expressions in the ItemExpander class. - *************************************************************************************************************************/ - - #endregion - - #region Constructors - - /// - /// Creates an instance of this class using the specified TextWriter. - /// - /// SumedhK - /// - internal ProjectWriter(TextWriter w) : base(w) - { - documentEncoding = w.Encoding; - } - - /// - /// Creates an instance of this class using the specified stream and encoding. - /// - /// SumedhK - /// - /// If null, defaults to UTF-8 and omits encoding attribute from processing instruction. - internal ProjectWriter(Stream w, Encoding encoding) : base(w, encoding) - { - documentEncoding = encoding; - } - - /// - /// Creates an instance of this class using the specified file. - /// - /// SumedhK - /// - /// If null, defaults to UTF-8 and omits encoding attribute from processing instruction. - internal ProjectWriter(string filename, Encoding encoding) : base(filename, encoding) - { - documentEncoding = encoding; - } - - #endregion - - #region Methods - - /// - /// Initializes settings for the project to be saved. - /// - /// SumedhK - /// - /// If null, XML declaration is not written. - internal void Initialize(XmlDocument project, XmlDeclaration projectXmlDeclaration) - { - // if the project's whitespace is not being preserved - if (!project.PreserveWhitespace) - { - // write out child elements in an indented fashion, instead of jamming all the XML into one line - base.Formatting = Formatting.Indented; - } - - // don't write an XML declaration unless the project already has one or has non-default encoding - writeXmlDeclaration = - ((projectXmlDeclaration != null) || - ((documentEncoding != Encoding.UTF8) && (documentEncoding != null))); - } - - /// - /// Writes the XML declaration only if the project being saved already has an XML declaration. - /// - /// SumedhK - public override void WriteStartDocument() - { - if (writeXmlDeclaration) - { - base.WriteStartDocument(); - } - } - - /// - /// Writes the XML declaration only if the project being saved already has an XML declaration. - /// - /// SumedhK - /// - public override void WriteStartDocument(bool standalone) - { - if (writeXmlDeclaration) - { - base.WriteStartDocument(standalone); - } - } - - /// - /// Writes item vector transforms embedded in the given string without escaping '->' into "-&gt;". - /// - /// SumedhK - /// - public override void WriteString(string text) - { - MatchCollection itemVectorTransforms = itemVectorTransformRawPattern.Matches(text); - - // if the string contains any item vector transforms - if (itemVectorTransforms.Count > 0) - { - // separate out the text that surrounds the transforms - // NOTE: use the Regex with no (named) capturing groups, otherwise Regex.Split() will split on them - string[] surroundingTextPieces = itemVectorTransformRawPattern.Split(text); - - ErrorUtilities.VerifyThrow(itemVectorTransforms.Count == (surroundingTextPieces.Length - 1), - "We must have two pieces of surrounding text for every item vector transform found."); - - // write each piece of text before a transform, followed by the transform - for (int i = 0; i < itemVectorTransforms.Count; i++) - { - // write the text before the transform - base.WriteString(surroundingTextPieces[i]); - - // break up the transform into its constituent pieces - Match itemVectorTransform = itemVectorTransformPattern.Match(itemVectorTransforms[i].Value); - - ErrorUtilities.VerifyThrow(itemVectorTransform.Success, - "Item vector transform must be matched by both the raw and decorated regular expressions."); - - // write each piece of the transform normally, except for the arrow -- write that without escaping - base.WriteString(itemVectorTransform.Groups["PREFIX"].Value); - base.WriteString(itemVectorTransform.Groups["TYPE"].Value); - base.WriteRaw(itemVectorTransform.Groups["ARROW"].Value); - base.WriteString(itemVectorTransform.Groups["TRANSFORM"].Value); - base.WriteString(itemVectorTransform.Groups["SEPARATOR_SPECIFICATION"].Value); - base.WriteString(itemVectorTransform.Groups["SUFFIX"].Value); - } - - // write the terminal piece of text after the last transform - base.WriteString(surroundingTextPieces[surroundingTextPieces.Length - 1]); - } - // if the string has no item vector transforms in it, write it out as usual - else - { - base.WriteString(text); - } - } - - #endregion - - // indicates whether an XML declaration e.g. will be written at the start of the project - private bool writeXmlDeclaration; - - // encoding of the document, if specified when constructing - private Encoding documentEncoding = null; - } -} diff --git a/src/Deprecated/Engine/Shared/ResourceUtilities.cs b/src/Deprecated/Engine/Shared/ResourceUtilities.cs deleted file mode 100644 index 7eeac400a28..00000000000 --- a/src/Deprecated/Engine/Shared/ResourceUtilities.cs +++ /dev/null @@ -1,225 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -#if !BUILDINGAPPXTASKS && DEBUG -using System.Resources; -using System.Diagnostics; -#endif -using System.Globalization; -using System.Text.RegularExpressions; - -namespace Microsoft.Build.BuildEngine.Shared -{ - /// - /// This class contains utility methods for dealing with resources. - /// - /// SumedhK - internal static class ResourceUtilities - { - // used to find MSBuild message code prefixes - private static readonly Regex msbuildMessageCodePattern = new Regex(@"^\s*(?MSB\d\d\d\d):\s*(?.*)$", RegexOptions.Singleline); - - /// - /// Extracts the message code (if any) prefixed to the given string. If a message code pattern is not supplied, the - /// MSBuild message code pattern is used by default. The message code pattern must contain two named capturing groups - /// called "CODE" and "MESSAGE" that identify the message code and the message respectively. - /// - /// This method is thread-safe. - /// SumedhK - /// The Regex used to find the message code (can be null). - /// The string to parse. - /// [out] The message code, or null if there was no code. - /// The string without its message code prefix. - internal static string ExtractMessageCode(Regex messageCodePattern, string messageWithCode, out string code) - { - code = null; - string messageOnly = messageWithCode; - - if (messageCodePattern == null) - { - messageCodePattern = msbuildMessageCodePattern; - } - - // NOTE: the Regex class is thread-safe (see MSDN) - Match messageCode = messageCodePattern.Match(messageWithCode); - - if (messageCode.Success) - { - code = messageCode.Groups["CODE"].Value; - messageOnly = messageCode.Groups["MESSAGE"].Value; - } - - return messageOnly; - } - - /// - /// Retrieves the MSBuild F1-help keyword for the given resource string. Help keywords are used to index help topics in - /// host IDEs. - /// - /// SumedhK - /// Resource string to get the MSBuild F1-keyword for. - /// The MSBuild F1-help keyword string. - private static string GetHelpKeyword(string resourceName) - { - return "MSBuild." + resourceName; - } - - /// - /// Loads the specified string resource and formats it with the arguments passed in. If the string resource has an MSBuild - /// message code and help keyword associated with it, they too are returned. - /// - /// PERF WARNING: calling a method that takes a variable number of arguments is expensive, because memory is allocated for - /// the array of arguments -- do not call this method repeatedly in performance-critical scenarios - /// - /// This method is thread-safe. - /// SumedhK - /// [out] The MSBuild message code, or null. - /// [out] The MSBuild F1-help keyword for the host IDE, or null. - /// Resource string to load. - /// Optional arguments for formatting the resource string. - /// The formatted resource string. - internal static string FormatResourceString(out string code, out string helpKeyword, string resourceName, params object[] args) - { - helpKeyword = GetHelpKeyword(resourceName); - - // NOTE: the AssemblyResources.GetString() method is thread-safe - return ExtractMessageCode(null, FormatString(AssemblyResources.GetString(resourceName), args), out code); - } - - /// - /// Looks up a string in the resources, and formats it with the arguments passed in. If the string resource has an MSBuild - /// message code and help keyword associated with it, they are discarded. - /// - /// PERF WARNING: calling a method that takes a variable number of arguments is expensive, because memory is allocated for - /// the array of arguments -- do not call this method repeatedly in performance-critical scenarios - /// - /// This method is thread-safe. - /// SumedhK - /// Resource string to load. - /// Optional arguments for formatting the resource string. - /// The formatted resource string. - internal static string FormatResourceString(string resourceName, params object[] args) - { - string code; - string helpKeyword; - - return FormatResourceString(out code, out helpKeyword, resourceName, args); - } - - /// - /// Formats the given string using the variable arguments passed in. - /// - /// PERF WARNING: calling a method that takes a variable number of arguments is expensive, because memory is allocated for - /// the array of arguments -- do not call this method repeatedly in performance-critical scenarios - /// - /// This method is thread-safe. - /// SumedhK - /// The string to format. - /// Optional arguments for formatting the given string. - /// The formatted string. - internal static string FormatString(string unformatted, params object[] args) - { - string formatted = unformatted; - - // NOTE: String.Format() does not allow a null arguments array - if ((args?.Length > 0)) - { -#if DEBUG - -#if VALIDATERESOURCESTRINGS - // The code below reveals many places in our codebase where - // we're not using all of the data given to us to format - // strings -- but there are too many to presently fix. - // Rather than toss away the code, we should later build it - // and fix each offending resource (or the code processing - // the resource). - - // String.Format() will throw a FormatException if args does - // not have enough elements to match each format parameter. - // However, it provides no feedback in the case when args contains - // more elements than necessary to replace each format - // parameter. We'd like to know if we're providing too much - // data in cases like these, so we'll fail if this code runs. - // - // See DevDiv Bugs 15210 for more information. - - // We create an array with one fewer element - object[] trimmedArgs = new object[args.Length - 1]; - Array.Copy(args, 0, trimmedArgs, 0, args.Length - 1); - - bool caughtFormatException = false; - try - { - // This will throw if there aren't enough elements in trimmedArgs... - String.Format(CultureInfo.CurrentCulture, unformatted, trimmedArgs); - } - catch (FormatException) - { - caughtFormatException = true; - } - - // If we didn't catch an exception above, then some of the elements - // of args were unnecessary when formatting unformatted... - Debug.Assert - ( - caughtFormatException, - String.Format("The provided format string '{0}' had fewer format parameters than the number of format args, '{1}'.", unformatted, args.Length) - ); -#endif - -#endif - // Format the string, using the variable arguments passed in. - // NOTE: all String methods are thread-safe - formatted = String.Format(CultureInfo.CurrentCulture, unformatted, args); - } - - return formatted; - } - - /// - /// Verifies that a particular resource string actually exists in the string table. This will only be called in debug - /// builds. It helps catch situations where a dev calls VerifyThrowXXX with a new resource string, but forgets to add the - /// resource string to the string table, or misspells it! - /// - /// This method is thread-safe. - /// RGoel - /// Resource string to check. - internal static void VerifyResourceStringExists(string resourceName) - { -#if DEBUG - try - { - // Look up the resource string in the engine's string table. - // NOTE: the AssemblyResources.GetString() method is thread-safe - string unformattedMessage = AssemblyResources.GetString(resourceName); - - if (unformattedMessage == null) - { - Debug.Fail("The resource string \"" + resourceName + "\" was not found."); - throw new InternalErrorException(); - } - } - catch (ArgumentException e) - { - Debug.Fail("The resource string \"" + resourceName + "\" was not found."); - throw new InternalErrorException(e.Message); - } - catch (InvalidOperationException e) - { - Debug.Fail("The resource string \"" + resourceName + "\" was not found."); - throw new InternalErrorException(e.Message); - } - catch (MissingManifestResourceException e) - { - Debug.Fail("The resource string \"" + resourceName + "\" was not found."); - throw new InternalErrorException(e.Message); - } -#endif - } - } -} diff --git a/src/Deprecated/Engine/Shared/SolutionParser.cs b/src/Deprecated/Engine/Shared/SolutionParser.cs deleted file mode 100644 index 6e146f197df..00000000000 --- a/src/Deprecated/Engine/Shared/SolutionParser.cs +++ /dev/null @@ -1,1337 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Xml; -using System.IO; -using System.Text; -using System.Globalization; -using System.Security; -using System.Text.RegularExpressions; - -using error = Microsoft.Build.BuildEngine.Shared.ErrorUtilities; - -namespace Microsoft.Build.BuildEngine.Shared -{ - /// - /// This class contains the functionality to parse a solution file and return a corresponding - /// MSBuild project file containing the projects and dependencies defined in the solution. - /// - internal class SolutionParser - { - #region Solution specific constants - - // An example of a project line looks like this: - // Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClassLibrary1", "ClassLibrary1\ClassLibrary1.csproj", "{05A5AD00-71B5-4612-AF2F-9EA9121C4111}" - private static readonly Regex crackProjectLine = new Regex - ( - "^" // Beginning of line - + "Project\\(\"(?.*)\"\\)" - + "\\s*=\\s*" // Any amount of whitespace plus "=" plus any amount of whitespace - + "\"(?.*)\"" - + "\\s*,\\s*" // Any amount of whitespace plus "," plus any amount of whitespace - + "\"(?.*)\"" - + "\\s*,\\s*" // Any amount of whitespace plus "," plus any amount of whitespace - + "\"(?.*)\"" - + "$" // End-of-line - ); - - // An example of a property line looks like this: - // AspNetCompiler.VirtualPath = "/webprecompile" - - private static readonly Regex crackPropertyLine = new Regex - ( - "^" // Beginning of line - + "(?[^=]*)" - + "\\s*=\\s*" // Any amount of whitespace plus "=" plus any amount of whitespace - + "(?[^=]*)" - + "$" // End-of-line - ); - - internal const int slnFileMinUpgradableVersion = 7; // Minimum version for MSBuild to give a nice message - internal const int slnFileMinVersion = 9; // Minimum version for MSBuild to actually do anything useful - internal const int slnFileMaxVersion = VisualStudioConstants.CurrentVisualStudioSolutionFileVersion; - - private const string vbProjectGuid = "{F184B08F-C81C-45F6-A57F-5ABD9991F28F}"; - private const string csProjectGuid = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"; - private const string vjProjectGuid = "{E6FDF86B-F3D1-11D4-8576-0002A516ECE8}"; - private const string vcProjectGuid = "{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}"; - private const string webProjectGuid = "{E24C65DC-7377-472B-9ABA-BC803B73C61A}"; - private const string solutionFolderGuid = "{2150E333-8FDC-42A3-9474-1A3956D46DE8}"; - - #endregion - - #region Member data - - private int slnFileActualVersion = 0; // The major version number of the .SLN file we're reading. - private string solutionFile = null; // Could be absolute or relative path to the .SLN file. - private string solutionFileDirectory = null; // Absolute path the solution file - private bool solutionContainsWebProjects = false; // Does this SLN contain any web projects? - - // The list of projects in this SLN, keyed by the project GUID. - private Hashtable projects = null; - - // The list of projects in the SLN, in order of their appearance in the SLN. - private ArrayList projectsInOrder = null; - - // The list of solution configurations in the solution - private List solutionConfigurations; - - // cached default configuration name for GetDefaultConfigurationName - private string defaultConfigurationName; - - // cached default platform name for GetDefaultPlatformName - private string defaultPlatformName; - - //List of warnings that occurred while parsing solution - private ArrayList solutionParserWarnings = null; - - //List of comments that occurred while parsing solution - private ArrayList solutionParserComments = null; - - // unit-testing only - private ArrayList solutionParserErrorCodes = null; - private StreamReader reader = null; - private int currentLineNumber = 0; - - #endregion - - #region Constructors - - /// - /// Constructor - /// - /// RGoel - internal SolutionParser() - { - this.solutionParserWarnings = new ArrayList(); - this.solutionParserErrorCodes = new ArrayList(); - this.solutionParserComments = new ArrayList(); - } - - #endregion - - #region Properties - - /// - /// This property returns the list of warnings that were generated during solution parsing - /// - internal ArrayList SolutionParserWarnings - { - get - { - return solutionParserWarnings; - } - } - - /// - /// This property returns the list of comments that were generated during the solution parsing - /// - internal ArrayList SolutionParserComments - { - get - { - return solutionParserComments; - } - } - - /// - /// This property returns the list of error codes for warnings/errors that were generated during solution parsing. - /// UNIT TESTING ONLY - /// - internal ArrayList SolutionParserErrorCodes - { - get - { - return solutionParserErrorCodes; - } - } - - /// - /// Returns the actual major version of the parsed solution file - /// - /// LukaszG - internal int Version - { - get - { - return this.slnFileActualVersion; - } - } - - /// - /// Returns true if the solution contains any web projects - /// - /// LukaszG - internal bool ContainsWebProjects - { - get - { - return this.solutionContainsWebProjects; - } - } - - /// - /// All projects in this solution, in the order they appeared in the solution file - /// - /// LukaszG - internal ArrayList ProjectsInOrder - { - get - { - return this.projectsInOrder; - } - // For unit testing only - set - { - this.projectsInOrder = value; - } - } - - /// - /// The collection of projects in this solution, accessible by their guids - /// - internal Hashtable ProjectsByGuid - { - get - { - return this.projects; - } - // For unit testing only - set - { - this.projects = value; - } - } - - /// - /// This is the read/write accessor for the solution file which we will parse. This - /// must be set before calling any other methods on this class. - /// - /// - internal string SolutionFile - { - get - { - return solutionFile; - } - - set - { - solutionFile = value; - } - } - - internal string SolutionFileDirectory - { - get - { - return solutionFileDirectory; - } - // This setter is only used by the unit tests - set - { - this.solutionFileDirectory = value; - } - } - - /// - /// For unit-testing only. - /// - /// - /// RGoel - internal StreamReader SolutionReader - { - get - { - return reader; - } - - set - { - reader = value; - } - } - - /// - /// For unit-testing only. - /// - /// - internal ProjectInSolution[] Projects - { - get - { - return (ProjectInSolution[])this.projectsInOrder.ToArray(typeof(ProjectInSolution)); - } - } - - /// - /// The list of all full solution configurations (configuration + platform) in this solution - /// - /// LukaszG - internal List SolutionConfigurations - { - get - { - return this.solutionConfigurations; - } - } - - #endregion - - #region Methods - - /// - /// Reads a line from the StreamReader, trimming leading and trailing whitespace. - /// - /// - /// RGoel - private string ReadLine() - { - error.VerifyThrow(reader != null, "ParseFileHeader(): reader is null!"); - - string line = reader.ReadLine(); - this.currentLineNumber++; - - if (line != null) - { - line = line.Trim(); - } - - return line; - } - - /// - /// This method takes a path to a solution file, parses the projects and project dependencies - /// in the solution file, and creates internal data structures representing the projects within - /// the SLN. - /// - /// RGoel - internal void ParseSolutionFile() - { - error.VerifyThrow(!string.IsNullOrEmpty(solutionFile), "ParseSolutionFile() got a null solution file!"); - - FileStream fileStream = null; - reader = null; - - try - { - // Open the file - fileStream = File.OpenRead(solutionFile); - // Store the directory of the file as the current directory may change while we are processes the file - solutionFileDirectory = Path.GetDirectoryName(Path.GetFullPath(solutionFile)); - reader = new StreamReader(fileStream, Encoding.Default); // HIGHCHAR: If solution files have no byte-order marks, then assume ANSI rather than ASCII. - this.ParseSolution(); - } - finally - { - fileStream?.Close(); - - reader?.Close(); - } - } - - /// - /// Parses the SLN file represented by the StreamReader in this.reader, and populates internal - /// data structures based on the SLN file contents. - /// - /// RGoel - internal void ParseSolution() - { - this.projects = new Hashtable(StringComparer.OrdinalIgnoreCase); - this.projectsInOrder = new ArrayList(); - this.solutionContainsWebProjects = false; - this.slnFileActualVersion = 0; - this.currentLineNumber = 0; - this.solutionConfigurations = new List(); - this.defaultConfigurationName = null; - this.defaultPlatformName = null; - - // the raw list of project configurations in solution configurations, to be processed after it's fully read in. - Hashtable rawProjectConfigurationsEntries = null; - - ParseFileHeader(); - - string str; - while ((str = ReadLine()) != null) - { - if (str.StartsWith("Project(", StringComparison.Ordinal)) - { - ParseProject(str); - } - else if (str.StartsWith("GlobalSection(NestedProjects)", StringComparison.Ordinal)) - { - ParseNestedProjects(); - } - else if (str.StartsWith("GlobalSection(SolutionConfigurationPlatforms)", StringComparison.Ordinal)) - { - ParseSolutionConfigurations(); - } - else if (str.StartsWith("GlobalSection(ProjectConfigurationPlatforms)", StringComparison.Ordinal)) - { - rawProjectConfigurationsEntries = ParseProjectConfigurations(); - } - else - { - // No other section types to process at this point, so just ignore the line - // and continue. - } - } - - if (rawProjectConfigurationsEntries != null) - { - ProcessProjectConfigurationSection(rawProjectConfigurationsEntries); - } - - // Cache the unique name of each project, and check that we don't have any duplicates. - Hashtable projectsByUniqueName = new Hashtable(StringComparer.OrdinalIgnoreCase); - - foreach (ProjectInSolution proj in projectsInOrder) - { - // Find the unique name for the project. This method also caches the unique name, - // so it doesn't have to be recomputed later. - string uniqueName = proj.GetUniqueProjectName(); - - // Throw an error if there are any duplicates - ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile( - projectsByUniqueName[uniqueName] == null, - "SubCategoryForSolutionParsingErrors", - new BuildEventFileInfo(SolutionFile), - "SolutionParseDuplicateProject", - uniqueName); - - // Update the hash table with this unique name - projectsByUniqueName[uniqueName] = proj; - } - } // ParseSolutionFile() - - /// - /// This method searches the first two lines of the solution file opened by the specified - /// StreamReader for the solution file header. An exception is thrown if it is not found. - /// - /// The solution file header looks like this: - /// - /// Microsoft Visual Studio Solution File, Format Version 9.00 - /// - /// - /// RGoel - private void ParseFileHeader() - { - error.VerifyThrow(reader != null, "ParseFileHeader(): reader is null!"); - - const string slnFileHeaderNoVersion = "Microsoft Visual Studio Solution File, Format Version "; - - // Read the file header. This can be on either of the first two lines. - for (int i = 1; i <= 2; i++) - { - string str = ReadLine(); - if (str == null) - { - break; - } - - if (str.StartsWith(slnFileHeaderNoVersion, StringComparison.Ordinal)) - { - // Found it. Validate the version. - ValidateSolutionFileVersion(str.Substring(slnFileHeaderNoVersion.Length)); - return; - } - } - - // Didn't find the header on either the first or second line, so the solution file - // is invalid. - ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(false, "SubCategoryForSolutionParsingErrors", - new BuildEventFileInfo(SolutionFile), "SolutionParseNoHeaderError"); - } - - /// - /// This method extracts the whole part of the version number from the specified line - /// containing the solution file format header, and throws an exception if the version number - /// is outside of the valid range. - /// - /// The solution file header looks like this: - /// - /// Microsoft Visual Studio Solution File, Format Version 9.00 - /// - /// - /// - /// RGoel - private void ValidateSolutionFileVersion(string versionString) - { - error.VerifyThrow(versionString != null, "ValidateSolutionFileVersion() got a null line!"); - - Version version = null; - try - { - version = new Version(versionString); - } - catch (FormatException) - { - // This happens if the version stamp wasn't a properly formed version number, - // as in "1.a.b.c". - ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(false, "SubCategoryForSolutionParsingErrors", - new BuildEventFileInfo(SolutionFile, this.currentLineNumber, 0), "SolutionParseVersionMismatchError", - slnFileMinUpgradableVersion, slnFileMaxVersion); - } - catch (ArgumentException) - { - // This happens if the version stamp wasn't a properly formed version number. - ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(false, "SubCategoryForSolutionParsingErrors", - new BuildEventFileInfo(SolutionFile, this.currentLineNumber, 0), "SolutionParseVersionMismatchError", - slnFileMinUpgradableVersion, slnFileMaxVersion); - } - - this.slnFileActualVersion = version.Major; - - // Validate against our min & max - ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile( - this.slnFileActualVersion >= slnFileMinUpgradableVersion, - "SubCategoryForSolutionParsingErrors", - new BuildEventFileInfo(SolutionFile, this.currentLineNumber, 0), - "SolutionParseVersionMismatchError", - slnFileMinUpgradableVersion, slnFileMaxVersion); - - // If the solution file version is greater than the maximum one we will create a comment rather than warn - // as users such as blend opening a dev10 project cannot do anything about it. - if (this.slnFileActualVersion > slnFileMaxVersion) - { - solutionParserComments.Add(ResourceUtilities.FormatResourceString("UnrecognizedSolutionComment", this.slnFileActualVersion)); - } - } - - /// - /// - /// This method processes a "Project" section in the solution file opened by the specified - /// StreamReader, and returns a populated ProjectInSolution instance, if successful. - /// An exception is thrown if the solution file is invalid. - /// - /// The format of the parts of a Project section that we care about is as follows: - /// - /// Project("{Project type GUID}") = "Project name", "Relative path to project file", "{Project GUID}" - /// ProjectSection(ProjectDependencies) = postProject - /// {Parent project unique name} = {Parent project unique name} - /// ... - /// EndProjectSection - /// EndProject - /// - /// - /// - /// - /// RGoel - private void ParseProject(string firstLine) - { - error.VerifyThrow(!string.IsNullOrEmpty(firstLine), "ParseProject() got a null firstLine!"); - error.VerifyThrow(reader != null, "ParseProject() got a null reader!"); - - ProjectInSolution proj = new ProjectInSolution(this); - - // Extract the important information from the first line. - ParseFirstProjectLine(firstLine, proj); - - // Search for project dependencies. Keeping reading lines until we either 1.) reach - // the end of the file, 2.) see "ProjectSection(ProjectDependencies)" at the beginning - // of the line, or 3.) see "EndProject" at the beginning of the line. - string line; - while ((line = ReadLine()) != null) - { - // If we see an "EndProject", well ... that's the end of this project! - if (line == "EndProject") - { - break; - } - else if (line.StartsWith("ProjectSection(ProjectDependencies)", StringComparison.Ordinal)) - { - // We have a ProjectDependencies section. Each subsequent line should identify - // a dependency. - line = ReadLine(); - while ((line?.StartsWith("EndProjectSection", StringComparison.Ordinal) == false)) - { - // This should be a dependency. The GUID identifying the parent project should - // be both the property name and the property value. - Match match = crackPropertyLine.Match(line); - ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(match.Success, "SubCategoryForSolutionParsingErrors", - new BuildEventFileInfo(SolutionFile, this.currentLineNumber, 0), "SolutionParseProjectDepGuidError", proj.ProjectName); - - string parentGuid = match.Groups["PROPERTYNAME"].Value.Trim(); - proj.Dependencies.Add(parentGuid); - - line = ReadLine(); - } - } - else if (line.StartsWith("ProjectSection(WebsiteProperties)", StringComparison.Ordinal)) - { - // We have a WebsiteProperties section. This section is present only in Venus - // projects, and contains properties that we'll need in order to call the - // AspNetCompiler task. - line = ReadLine(); - while ((line?.StartsWith("EndProjectSection", StringComparison.Ordinal) == false)) - { - Match match = crackPropertyLine.Match(line); - ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(match.Success, "SubCategoryForSolutionParsingErrors", - new BuildEventFileInfo(SolutionFile, this.currentLineNumber, 0), "SolutionParseWebProjectPropertiesError", proj.ProjectName); - - string propertyName = match.Groups["PROPERTYNAME"].Value.Trim(); - string propertyValue = match.Groups["PROPERTYVALUE"].Value.Trim(); - - ParseAspNetCompilerProperty(proj, propertyName, propertyValue); - - line = ReadLine(); - } - } - } - - ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(line != null, "SubCategoryForSolutionParsingErrors", - new BuildEventFileInfo(SolutionFile), "SolutionParseProjectEofError", proj.ProjectName); - - if (proj != null) - { - // Add the project to the collection - AddProjectToSolution(proj); - // If the project is an etp project then parse the etp project file - // to get the projects contained in it. - if (IsEtpProjectFile(proj.RelativePath)) - { - ParseEtpProject(proj); - } - } - } // ParseProject() - - /// - /// This method will parse a .etp project recursively and - /// add all the projects found to projects and projectsInOrder - /// - /// ETP Project - internal void ParseEtpProject(ProjectInSolution etpProj) - { - XmlDocument etpProjectDocument = new XmlDocument(); - // Get the full path to the .etp project file - string fullPathToEtpProj = Path.Combine(solutionFileDirectory, etpProj.RelativePath); - string etpProjectRelativeDir = Path.GetDirectoryName(etpProj.RelativePath); - try - { - /**************************************************************************** - * A Typical .etp project file will look like this - * - * - * - * Microsoft Visual Studio Application Template File - * 1.00 - * - * - * ClassLibrary2\ClassLibrary2.csproj - * - * - * - * - * ClassLibrary2\ClassLibrary2.csproj - * {73D0F4CE-D9D3-4E8B-81E4-B26FBF4CC2FE} - * - * - * - * - **********************************************************************************/ - // Make sure the XML reader ignores DTD processing - XmlReaderSettings readerSettings = new XmlReaderSettings(); - readerSettings.DtdProcessing = DtdProcessing.Ignore; - - // Load the .etp project file thru the XML reader - using (XmlReader xmlReader = XmlReader.Create(fullPathToEtpProj, readerSettings)) - { - etpProjectDocument.Load(xmlReader); - } - - // We need to parse the .etp project file to get the names of projects contained - // in the .etp Project. The projects are listed under /EFPROJECT/GENERAL/References/Reference node in the .etp project file. - // The /EFPROJECT/GENERAL/Views/ProjectExplorer node will not necessarily contain - // all the projects in the .etp project. Therefore, we need to look at - // /EFPROJECT/GENERAL/References/Reference. - // Find the /EFPROJECT/GENERAL/References/Reference node - // Note that this is case sensitive - XmlNodeList referenceNodes = etpProjectDocument.DocumentElement.SelectNodes("/EFPROJECT/GENERAL/References/Reference"); - // Do the right thing for each element - foreach (XmlNode referenceNode in referenceNodes) - { - // Get the relative path to the project file - string fileElementValue = referenceNode.SelectSingleNode("FILE").InnerText; - // If element is not present under then we don't do anything. - if (fileElementValue != null) - { - // Create and populate a ProjectInSolution for the project - ProjectInSolution proj = new ProjectInSolution(this); - proj.RelativePath = Path.Combine(etpProjectRelativeDir, fileElementValue); - - // Verify the relative path specified in the .etp proj file - ValidateProjectRelativePath(proj); - proj.ProjectType = SolutionProjectType.EtpSubProject; - proj.ProjectName = proj.RelativePath; - XmlNode projGuidNode = referenceNode.SelectSingleNode("GUIDPROJECTID"); - if (projGuidNode != null) - { - proj.ProjectGuid = projGuidNode.InnerText; - } - // It is ok for a project to not have a guid inside an etp project. - // If a solution file contains a project without a guid it fails to - // load in Everett. But if an etp project contains a project without - // a guid it loads well in Everett and p2p references to/from this project - // are preserved. So we should make sure that we don�t error in this - // situation while upgrading. - else - { - proj.ProjectGuid = String.Empty; - } - // Add the recently created proj to the collection of projects - AddProjectToSolution(proj); - // If the project is an etp project recurse - if (IsEtpProjectFile(fileElementValue)) - { - ParseEtpProject(proj); - } - } - } - } - // catch all sorts of exceptions - if we encounter any problems here, we just assume the .etp project file is not in the correct format - - // handle security errors - catch (SecurityException e) - { - // Log a warning - string errorCode, ignoredKeyword; - string warning = ResourceUtilities.FormatResourceString(out errorCode, out ignoredKeyword, "Shared.ProjectFileCouldNotBeLoaded", - etpProj.RelativePath, e.Message); - solutionParserWarnings.Add(warning); - solutionParserErrorCodes.Add(errorCode); - } - // handle errors in path resolution - catch (NotSupportedException e) - { - // Log a warning - string errorCode, ignoredKeyword; - string warning = ResourceUtilities.FormatResourceString(out errorCode, out ignoredKeyword, "Shared.ProjectFileCouldNotBeLoaded", - etpProj.RelativePath, e.Message); - solutionParserWarnings.Add(warning); - solutionParserErrorCodes.Add(errorCode); - } - // handle errors in loading project file - catch (IOException e) - { - // Log a warning - string errorCode, ignoredKeyword; - string warning = ResourceUtilities.FormatResourceString(out errorCode, out ignoredKeyword, "Shared.ProjectFileCouldNotBeLoaded", - etpProj.RelativePath, e.Message); - solutionParserWarnings.Add(warning); - solutionParserErrorCodes.Add(errorCode); - } - // handle errors in loading project file - catch (UnauthorizedAccessException e) - { - // Log a warning - string errorCode, ignoredKeyword; - string warning = ResourceUtilities.FormatResourceString(out errorCode, out ignoredKeyword, "Shared.ProjectFileCouldNotBeLoaded", - etpProj.RelativePath, e.Message); - solutionParserWarnings.Add(warning); - solutionParserErrorCodes.Add(errorCode); - } - // handle XML parsing errors - catch (XmlException e) - { - // Log a warning - string errorCode, ignoredKeyword; - string warning = ResourceUtilities.FormatResourceString(out errorCode, out ignoredKeyword, "Shared.InvalidProjectFile", - etpProj.RelativePath, e.Message); - solutionParserWarnings.Add(warning); - solutionParserErrorCodes.Add(errorCode); - } - } - - /// - /// Adds a given project to the project collections of this class - /// - /// proj - private void AddProjectToSolution(ProjectInSolution proj) - { - if (!String.IsNullOrEmpty(proj.ProjectGuid)) - { - projects[proj.ProjectGuid] = proj; - } - projectsInOrder.Add(proj); - } - - /// - /// Checks whether a given project has a .etp extension. - /// - /// - private bool IsEtpProjectFile(string projectFile) - { - return projectFile.EndsWith(".etp", StringComparison.OrdinalIgnoreCase); - } - - /// - /// Validate relative path of a project - /// - /// proj - private void ValidateProjectRelativePath(ProjectInSolution proj) - { - // Verify the relative path is not null - ErrorUtilities.VerifyThrow(proj.RelativePath != null, "Project relative path cannot be null."); - - // Verify the relative path does not contain invalid characters - ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(proj.RelativePath.IndexOfAny(Path.GetInvalidPathChars()) == -1, - "SubCategoryForSolutionParsingErrors", - new BuildEventFileInfo(SolutionFile, this.currentLineNumber, 0), - "SolutionParseInvalidProjectFileNameCharacters", - proj.ProjectName, proj.RelativePath); - - // Verify the relative path is not empty string - ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(proj.RelativePath.Length > 0, - "SubCategoryForSolutionParsingErrors", - new BuildEventFileInfo(SolutionFile, this.currentLineNumber, 0), - "SolutionParseInvalidProjectFileNameEmpty", - proj.ProjectName); - } - - /// - /// Takes a property name / value that comes from the SLN file for a Venus project, and - /// stores it appropriately in our data structures. - /// - /// - /// - /// - /// RGoel - private void ParseAspNetCompilerProperty - ( - ProjectInSolution proj, - string propertyName, - string propertyValue - ) - { - // What we expect to find in the SLN file is something that looks like this: - // - // Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "c:\...\myfirstwebsite\", "..\..\..\..\..\..\rajeev\temp\websites\myfirstwebsite", "{956CC04E-FD59-49A9-9099-96888CB6F366}" - // ProjectSection(WebsiteProperties) = preProject - // ProjectReferences = "{FD705688-88D1-4C22-9BFF-86235D89C2FC}|CSClassLibrary1.dll;{F0726D09-042B-4A7A-8A01-6BED2422BD5D}|VCClassLibrary1.dll;" - // Debug.AspNetCompiler.VirtualPath = "/publishfirst" - // Debug.AspNetCompiler.PhysicalPath = "..\..\..\..\..\..\rajeev\temp\websites\myfirstwebsite\" - // Debug.AspNetCompiler.TargetPath = "..\..\..\..\..\..\rajeev\temp\publishfirst\" - // Debug.AspNetCompiler.ForceOverwrite = "true" - // Debug.AspNetCompiler.Updateable = "true" - // Debug.AspNetCompiler.Enabled = "true" - // Debug.AspNetCompiler.Debug = "true" - // Debug.AspNetCompiler.KeyFile = "" - // Debug.AspNetCompiler.KeyContainer = "" - // Debug.AspNetCompiler.DelaySign = "true" - // Debug.AspNetCompiler.AllowPartiallyTrustedCallers = "true" - // Debug.AspNetCompiler.FixedNames = "true" - // Release.AspNetCompiler.VirtualPath = "/publishfirst" - // Release.AspNetCompiler.PhysicalPath = "..\..\..\..\..\..\rajeev\temp\websites\myfirstwebsite\" - // Release.AspNetCompiler.TargetPath = "..\..\..\..\..\..\rajeev\temp\publishfirst\" - // Release.AspNetCompiler.ForceOverwrite = "true" - // Release.AspNetCompiler.Updateable = "true" - // Release.AspNetCompiler.Enabled = "true" - // Release.AspNetCompiler.Debug = "false" - // Release.AspNetCompiler.KeyFile = "" - // Release.AspNetCompiler.KeyContainer = "" - // Release.AspNetCompiler.DelaySign = "true" - // Release.AspNetCompiler.AllowPartiallyTrustedCallers = "true" - // Release.AspNetCompiler.FixedNames = "true" - // EndProjectSection - // EndProject - // - // This method is responsible for parsing each of the lines within the "WebsiteProperties" section. - // The first component of each property name is actually the configuration for which that - // property applies. - - int indexOfFirstDot = propertyName.IndexOf('.'); - if (indexOfFirstDot != -1) - { - // The portion before the first dot is the configuration name. - string configurationName = propertyName.Substring(0, indexOfFirstDot); - - // The rest of it is the actual property name. - string aspNetPropertyName = propertyName.Substring(indexOfFirstDot + 1, propertyName.Length - indexOfFirstDot - 1); - - // And the part after the sign is the property value (which was parsed out for us prior - // to calling this method). - propertyValue = TrimQuotes(propertyValue); - - // Grab the parameters for this specific configuration if they exist. - object aspNetCompilerParametersObject = proj.AspNetConfigurations[configurationName]; - AspNetCompilerParameters aspNetCompilerParameters; - - if (aspNetCompilerParametersObject == null) - { - // If it didn't exist, create a new one. - aspNetCompilerParameters = new AspNetCompilerParameters(); - aspNetCompilerParameters.aspNetVirtualPath = String.Empty; - aspNetCompilerParameters.aspNetPhysicalPath = String.Empty; - aspNetCompilerParameters.aspNetTargetPath = String.Empty; - aspNetCompilerParameters.aspNetForce = String.Empty; - aspNetCompilerParameters.aspNetUpdateable = String.Empty; - aspNetCompilerParameters.aspNetDebug = String.Empty; - aspNetCompilerParameters.aspNetKeyFile = String.Empty; - aspNetCompilerParameters.aspNetKeyContainer = String.Empty; - aspNetCompilerParameters.aspNetDelaySign = String.Empty; - aspNetCompilerParameters.aspNetAPTCA = String.Empty; - aspNetCompilerParameters.aspNetFixedNames = String.Empty; - } - else - { - // Otherwise just unbox it. - aspNetCompilerParameters = (AspNetCompilerParameters)aspNetCompilerParametersObject; - } - - // Update the appropriate field within the parameters struct. - if (aspNetPropertyName == "AspNetCompiler.VirtualPath") - { - aspNetCompilerParameters.aspNetVirtualPath = propertyValue; - } - else if (aspNetPropertyName == "AspNetCompiler.PhysicalPath") - { - aspNetCompilerParameters.aspNetPhysicalPath = propertyValue; - } - else if (aspNetPropertyName == "AspNetCompiler.TargetPath") - { - aspNetCompilerParameters.aspNetTargetPath = propertyValue; - } - else if (aspNetPropertyName == "AspNetCompiler.ForceOverwrite") - { - aspNetCompilerParameters.aspNetForce = propertyValue; - } - else if (aspNetPropertyName == "AspNetCompiler.Updateable") - { - aspNetCompilerParameters.aspNetUpdateable = propertyValue; - } - else if (aspNetPropertyName == "AspNetCompiler.Debug") - { - aspNetCompilerParameters.aspNetDebug = propertyValue; - } - else if (aspNetPropertyName == "AspNetCompiler.KeyFile") - { - aspNetCompilerParameters.aspNetKeyFile = propertyValue; - } - else if (aspNetPropertyName == "AspNetCompiler.KeyContainer") - { - aspNetCompilerParameters.aspNetKeyContainer = propertyValue; - } - else if (aspNetPropertyName == "AspNetCompiler.DelaySign") - { - aspNetCompilerParameters.aspNetDelaySign = propertyValue; - } - else if (aspNetPropertyName == "AspNetCompiler.AllowPartiallyTrustedCallers") - { - aspNetCompilerParameters.aspNetAPTCA = propertyValue; - } - else if (aspNetPropertyName == "AspNetCompiler.FixedNames") - { - aspNetCompilerParameters.aspNetFixedNames = propertyValue; - } - - // Store the updated parameters struct back into the hashtable by configuration name. - proj.AspNetConfigurations[configurationName] = aspNetCompilerParameters; - } - else - { - // ProjectReferences = "{FD705688-88D1-4C22-9BFF-86235D89C2FC}|CSClassLibrary1.dll;{F0726D09-042B-4A7A-8A01-6BED2422BD5D}|VCClassLibrary1.dll;" - if (string.Equals(propertyName, "ProjectReferences", StringComparison.OrdinalIgnoreCase)) - { - string[] projectReferenceEntries = propertyValue.Split(new char[] { ';' }); - - foreach (string projectReferenceEntry in projectReferenceEntries) - { - int indexOfBar = projectReferenceEntry.IndexOf('|'); - - // indexOfBar could be -1 if we had semicolons in the file names, so skip entries that - // don't contain a guid. File names may not contain the '|' character - if (indexOfBar != -1) - { - int indexOfOpeningBrace = projectReferenceEntry.IndexOf('{'); - int indexOfClosingBrace = projectReferenceEntry.IndexOf('}', indexOfOpeningBrace); - - // Cut out the guid part - if ((indexOfOpeningBrace != -1) && (indexOfClosingBrace != -1)) - { - string referencedProjectGuid = projectReferenceEntry.Substring(indexOfOpeningBrace, - indexOfClosingBrace - indexOfOpeningBrace + 1); - - proj.Dependencies.Add(referencedProjectGuid); - proj.ProjectReferences.Add(referencedProjectGuid); - } - } - } - } - } - } - - /// - /// Strips a single pair of leading/trailing double-quotes from a string. - /// - /// - /// - /// RGoel - private string TrimQuotes - ( - string property - ) - { - // If the incoming string starts and ends with a double-quote, strip the double-quotes. - if (!string.IsNullOrEmpty(property) && (property[0] == '"') && (property[property.Length - 1] == '"')) - { - return property.Substring(1, property.Length - 2); - } - else - { - return property; - } - } - - /// - /// Parse the first line of a Project section of a solution file. This line should look like: - /// - /// Project("{Project type GUID}") = "Project name", "Relative path to project file", "{Project GUID}" - /// - /// - /// - /// - /// RGoel - internal void ParseFirstProjectLine - ( - string firstLine, - ProjectInSolution proj - ) - { - Match match = crackProjectLine.Match(firstLine); - ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(match.Success, "SubCategoryForSolutionParsingErrors", - new BuildEventFileInfo(SolutionFile, this.currentLineNumber, 0), "SolutionParseProjectError"); - - string projectTypeGuid = match.Groups["PROJECTTYPEGUID"].Value.Trim(); - proj.ProjectName = match.Groups["PROJECTNAME"].Value.Trim(); - proj.RelativePath = match.Groups["RELATIVEPATH"].Value.Trim(); - proj.ProjectGuid = match.Groups["PROJECTGUID"].Value.Trim(); - - // Validate project relative path - ValidateProjectRelativePath(proj); - - // Figure out what type of project this is. - if ((String.Equals(projectTypeGuid, vbProjectGuid, StringComparison.OrdinalIgnoreCase)) || - (String.Equals(projectTypeGuid, csProjectGuid, StringComparison.OrdinalIgnoreCase)) || - (String.Equals(projectTypeGuid, vjProjectGuid, StringComparison.OrdinalIgnoreCase))) - { - proj.ProjectType = SolutionProjectType.ManagedProject; - } - else if (String.Equals(projectTypeGuid, solutionFolderGuid, StringComparison.OrdinalIgnoreCase)) - { - proj.ProjectType = SolutionProjectType.SolutionFolder; - } - else if (String.Equals(projectTypeGuid, vcProjectGuid, StringComparison.OrdinalIgnoreCase)) - { - proj.ProjectType = SolutionProjectType.VCProject; - } - else if (String.Equals(projectTypeGuid, webProjectGuid, StringComparison.OrdinalIgnoreCase)) - { - proj.ProjectType = SolutionProjectType.WebProject; - solutionContainsWebProjects = true; - } - else - { - proj.ProjectType = SolutionProjectType.Unknown; - } - } - - /// - /// Read nested projects section. - /// This is required to find a unique name for each project's target - /// - /// RGoel - internal void ParseNestedProjects() - { - string str; - - do - { - str = ReadLine(); - if ((str == null) || (str == "EndGlobalSection")) - { - break; - } - - Match match = crackPropertyLine.Match(str); - ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(match.Success, "SubCategoryForSolutionParsingErrors", - new BuildEventFileInfo(SolutionFile, this.currentLineNumber, 0), "SolutionParseNestedProjectError"); - - string projectGuid = match.Groups["PROPERTYNAME"].Value.Trim(); - string parentProjectGuid = match.Groups["PROPERTYVALUE"].Value.Trim(); - - ProjectInSolution proj = (ProjectInSolution)projects[projectGuid]; - ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(proj != null, "SubCategoryForSolutionParsingErrors", - new BuildEventFileInfo(SolutionFile, this.currentLineNumber, 0), "SolutionParseNestedProjectError"); - - proj.ParentProjectGuid = parentProjectGuid; - - } while (true); - } - - /// - /// Read solution configuration section. - /// - /// - /// A sample section: - /// - /// GlobalSection(SolutionConfigurationPlatforms) = preSolution - /// Debug|Any CPU = Debug|Any CPU - /// Release|Any CPU = Release|Any CPU - /// EndGlobalSection - /// - /// LukaszG - internal void ParseSolutionConfigurations() - { - string str; - char[] nameValueSeparators = new char[] { '=' }; - char[] configPlatformSeparators = new char[] { ConfigurationInSolution.configurationPlatformSeparator }; - - do - { - str = ReadLine(); - - if ((str == null) || (str == "EndGlobalSection")) - { - break; - } - - string[] configurationNames = str.Split(nameValueSeparators); - - // There should be exactly one '=' character, separating two names. - ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(configurationNames.Length == 2, "SubCategoryForSolutionParsingErrors", - new BuildEventFileInfo(SolutionFile, this.currentLineNumber, 0), "SolutionParseInvalidSolutionConfigurationEntry", str); - - string fullConfigurationName = configurationNames[0].Trim(); - - //Fixing bug 555577: Solution file can have description information, in which case we ignore. - if (String.Equals(fullConfigurationName, "DESCRIPTION", StringComparison.OrdinalIgnoreCase)) - { - continue; - } - - // Both names must be identical - ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(fullConfigurationName == configurationNames[1].Trim(), "SubCategoryForSolutionParsingErrors", - new BuildEventFileInfo(SolutionFile, this.currentLineNumber, 0), "SolutionParseInvalidSolutionConfigurationEntry", str); - - string[] configurationPlatformParts = fullConfigurationName.Split(configPlatformSeparators); - - ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(configurationPlatformParts.Length == 2, "SubCategoryForSolutionParsingErrors", - new BuildEventFileInfo(SolutionFile, this.currentLineNumber, 0), "SolutionParseInvalidSolutionConfigurationEntry", str); - - this.solutionConfigurations.Add(new ConfigurationInSolution(configurationPlatformParts[0], configurationPlatformParts[1])); - - } while (true); - } - - /// - /// Read project configurations in solution configurations section. - /// - /// - /// A sample (incomplete) section: - /// - /// GlobalSection(ProjectConfigurationPlatforms) = postSolution - /// {6185CC21-BE89-448A-B3C0-D1C27112E595}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - /// {6185CC21-BE89-448A-B3C0-D1C27112E595}.Debug|Any CPU.Build.0 = Debug|Any CPU - /// {6185CC21-BE89-448A-B3C0-D1C27112E595}.Debug|Mixed Platforms.ActiveCfg = Release|Any CPU - /// {6185CC21-BE89-448A-B3C0-D1C27112E595}.Debug|Mixed Platforms.Build.0 = Release|Any CPU - /// {6185CC21-BE89-448A-B3C0-D1C27112E595}.Debug|Win32.ActiveCfg = Debug|Any CPU - /// {A6F99D27-47B9-4EA4-BFC9-25157CBDC281}.Release|Any CPU.ActiveCfg = Release|Win32 - /// {A6F99D27-47B9-4EA4-BFC9-25157CBDC281}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - /// {A6F99D27-47B9-4EA4-BFC9-25157CBDC281}.Release|Mixed Platforms.Build.0 = Release|Win32 - /// {A6F99D27-47B9-4EA4-BFC9-25157CBDC281}.Release|Win32.ActiveCfg = Release|Win32 - /// {A6F99D27-47B9-4EA4-BFC9-25157CBDC281}.Release|Win32.Build.0 = Release|Win32 - /// EndGlobalSection - /// - /// An unprocessed hashtable of entries in this section - internal Hashtable ParseProjectConfigurations() - { - Hashtable rawProjectConfigurationsEntries = new Hashtable(StringComparer.OrdinalIgnoreCase); - string str; - - do - { - str = ReadLine(); - - if ((str == null) || (str == "EndGlobalSection")) - { - break; - } - - string[] nameValue = str.Split(new char[] { '=' }); - - // There should be exactly one '=' character, separating the name and value. - ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(nameValue.Length == 2, "SubCategoryForSolutionParsingErrors", - new BuildEventFileInfo(SolutionFile, this.currentLineNumber, 0), "SolutionParseInvalidProjectSolutionConfigurationEntry", str); - - rawProjectConfigurationsEntries[nameValue[0].Trim()] = nameValue[1].Trim(); - - } while (true); - - return rawProjectConfigurationsEntries; - } - - /// - /// Read the project configuration information for every project in the solution, using pre-cached - /// solution section data. - /// - /// Cached data from the project configuration section - /// LukaszG - internal void ProcessProjectConfigurationSection(Hashtable rawProjectConfigurationsEntries) - { - // Instead of parsing the data line by line, we parse it project by project, constructing the - // entry name (e.g. "{A6F99D27-47B9-4EA4-BFC9-25157CBDC281}.Release|Any CPU.ActiveCfg") and retrieving its - // value from the raw data. The reason for this is that the IDE does it this way, and as the result - // the '.' character is allowed in configuration names although it technically separates different - // parts of the entry name string. This could lead to ambiguous results if we tried to parse - // the entry name instead of constructing it and looking it up. Although it's pretty unlikely that - // this would ever be a problem, it's safer to do it the same way VS IDE does it. - char[] configPlatformSeparators = new char[] { ConfigurationInSolution.configurationPlatformSeparator }; - - foreach (ProjectInSolution project in this.projectsInOrder) - { - // Solution folders don't have configurations - if (project.ProjectType != SolutionProjectType.SolutionFolder) - { - foreach (ConfigurationInSolution solutionConfiguration in this.solutionConfigurations) - { - // The "ActiveCfg" entry defines the active project configuration in the given solution configuration - // This entry must be present for every possible solution configuration/project combination. - string entryNameActiveConfig = string.Format(CultureInfo.InvariantCulture, "{0}.{1}.ActiveCfg", - project.ProjectGuid, solutionConfiguration.FullName); - - // The "Build.0" entry tells us whether to build the project configuration in the given solution configuration. - // Technically, it specifies a configuration name of its own which seems to be a remnant of an initial, - // more flexible design of solution configurations (as well as the '.0' suffix - no higher values are ever used). - // The configuration name is not used, and the whole entry means "build the project configuration" - // if it's present in the solution file, and "don't build" if it's not. - string entryNameBuild = string.Format(CultureInfo.InvariantCulture, "{0}.{1}.Build.0", - project.ProjectGuid, solutionConfiguration.FullName); - - if (rawProjectConfigurationsEntries.ContainsKey(entryNameActiveConfig)) - { - string[] configurationPlatformParts = ((string)(rawProjectConfigurationsEntries[entryNameActiveConfig])).Split(configPlatformSeparators); - - // Project configuration may not necessarily contain the platform part. Some project support only the configuration part. - ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(configurationPlatformParts.Length <= 2, "SubCategoryForSolutionParsingErrors", - new BuildEventFileInfo(SolutionFile), "SolutionParseInvalidProjectSolutionConfigurationEntry", - string.Format(CultureInfo.InvariantCulture, "{0} = {1}", entryNameActiveConfig, rawProjectConfigurationsEntries[entryNameActiveConfig])); - - ProjectConfigurationInSolution projectConfiguration = new ProjectConfigurationInSolution( - configurationPlatformParts[0], - (configurationPlatformParts.Length > 1) ? configurationPlatformParts[1] : string.Empty, - rawProjectConfigurationsEntries.ContainsKey(entryNameBuild) - ); - - project.ProjectConfigurations[solutionConfiguration.FullName] = projectConfiguration; - } - } - } - } - } - - /// - /// Gets the default configuration name for this solution. Usually it's Debug, unless it's not present - /// in which case it's the first configuration name we find. - /// - /// - /// LukaszG - internal string GetDefaultConfigurationName() - { - // Have we done this already? Return the cached name - if (defaultConfigurationName != null) - { - return defaultConfigurationName; - } - - defaultConfigurationName = string.Empty; - - // Pick the Debug configuration as default if present - foreach (ConfigurationInSolution solutionConfiguration in this.SolutionConfigurations) - { - if (string.Equals(solutionConfiguration.ConfigurationName, "Debug", StringComparison.OrdinalIgnoreCase)) - { - defaultConfigurationName = solutionConfiguration.ConfigurationName; - break; - } - } - - // Failing that, just pick the first configuration name as default - if ((defaultConfigurationName.Length == 0) && (this.SolutionConfigurations.Count > 0)) - { - defaultConfigurationName = this.SolutionConfigurations[0].ConfigurationName; - } - - return defaultConfigurationName; - } - - /// - /// Gets the default platform name for this solution. Usually it's Mixed Platforms, unless it's not present - /// in which case it's the first platform name we find. - /// - /// - /// LukaszG - internal string GetDefaultPlatformName() - { - // Have we done this already? Return the cached name - if (defaultPlatformName != null) - { - return defaultPlatformName; - } - - defaultPlatformName = string.Empty; - - // Pick the Mixed Platforms platform as default if present - foreach (ConfigurationInSolution solutionConfiguration in this.SolutionConfigurations) - { - if (string.Equals(solutionConfiguration.PlatformName, "Mixed Platforms", StringComparison.OrdinalIgnoreCase)) - { - defaultPlatformName = solutionConfiguration.PlatformName; - break; - } - } - - // Failing that, just pick the first platform name as default - if ((defaultPlatformName.Length == 0) && (this.SolutionConfigurations.Count > 0)) - { - defaultPlatformName = this.SolutionConfigurations[0].PlatformName; - } - - return defaultPlatformName; - } - - /// - /// This method takes a string representing one of the project's unique names (guid), and - /// returns the corresponding "friendly" name for this project. - /// - /// - /// - /// RGoel - internal string GetProjectUniqueNameByGuid(string projectGuid) - { - ProjectInSolution proj = (ProjectInSolution)projects[projectGuid]; - return proj?.GetUniqueProjectName(); - } - - /// - /// This method takes a string representing one of the project's unique names (guid), and - /// returns the corresponding relative path to this project. - /// - /// - /// - /// RGoel - internal string GetProjectRelativePathByGuid(string projectGuid) - { - ProjectInSolution proj = (ProjectInSolution)projects[projectGuid]; - return proj?.RelativePath; - } - - #endregion - } // class SolutionParser -} // namespace Microsoft.Build.BuildEngine diff --git a/src/Deprecated/Engine/Shared/Strings.shared.resx b/src/Deprecated/Engine/Shared/Strings.shared.resx deleted file mode 100644 index d059822a569..00000000000 --- a/src/Deprecated/Engine/Shared/Strings.shared.resx +++ /dev/null @@ -1,252 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 1.3 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - MSB5016: The name "{0}" contains an invalid character "{1}". - {StrBegin="MSB5016: "} - - - "{0}" is a reserved item meta-data, and cannot be modified or deleted. - UE: Tasks and OM users are not allowed to remove or change the value of the built-in meta-data on items e.g. the meta-data "FullPath", "RelativeDir", etc. are reserved. - - - The string "{0}" cannot be converted to a boolean (true/false) value. - - - Command: - - - MSB5003: Failed to create a temporary file. Temporary files folder is full or its path is incorrect. {0} - {StrBegin="MSB5003: "} - - - MSB5018: Failed to delete the temporary file "{0}". {1} - {StrBegin="MSB5018: "} - - - The item meta-data "%({0})" cannot be applied to the path "{1}". {2} - UE: This message is shown when the user tries to perform path manipulations using one of the built-in item meta-data e.g. %(RootDir), on an item-spec that's not a valid path. LOCALIZATION: "{2}" is a localized message from a CLR/FX exception. - - - File extension cannot be null or empty - File name must be more than null, empty or just a . - - - Could not find directory path: {0} - Directory must exist - - - You do not have access to: {0} - Directory must have access - - - MSB5002: The task executable has not completed within the specified limit of {0} milliseconds, terminating. - {StrBegin="MSB5002: "} - - - Parameter "{0}" cannot be null. - - - Parameter "{0}" cannot contain null values. - - - Parameter "{0}" cannot have zero length. - - - Parameters "{0}" and "{1}" must have the same number of elements. - - - The resource string "{0}" for the "{1}" task cannot be found. Confirm that the resource name "{0}" is correctly spelled, and the resource exists in the task's assembly. - - - - The "{0}" task has not registered its resources. In order to use the "TaskLoggingHelper.FormatResourceString()" method this task needs to register its resources either during construction, or via the "TaskResources" property. - LOCALIZATION: "TaskLoggingHelper.FormatResourceString()" and "TaskResources" should not be localized. - - - MSB5004: The solution file has two projects named "{0}". - {StrBegin="MSB5004: "}UE: The solution filename is provided separately to loggers. - - - MSB5005: Error parsing project section for project "{0}". The project file name "{1}" contains invalid characters. - {StrBegin="MSB5005: "}UE: The solution filename is provided separately to loggers. - - - MSB5006: Error parsing project section for project "{0}". The project file name is empty. - {StrBegin="MSB5006: "}UE: The solution filename is provided separately to loggers. - - - MSB5007: Error parsing the project configuration section in solution file. The entry "{0}" is invalid. - {StrBegin="MSB5007: "}UE: The solution filename is provided separately to loggers. - - - MSB5008: Error parsing the solution configuration section in solution file. The entry "{0}" is invalid. - {StrBegin="MSB5008: "}UE: The solution filename is provided separately to loggers. - - - MSB5009: Error parsing the nested project section in solution file. - {StrBegin="MSB5009: "}UE: The solution filename is provided separately to loggers. - - - MSB5010: No file format header found. - {StrBegin="MSB5010: "}UE: The solution filename is provided separately to loggers. - - - MSB5011: Parent project GUID not found in "{0}" project dependency section. - {StrBegin="MSB5011: "}UE: The solution filename is provided separately to loggers. - - - MSB5012: Unexpected end-of-file reached inside "{0}" project section. - {StrBegin="MSB5012: "}UE: The solution filename is provided separately to loggers. - - - MSB5013: Error parsing a project section. - {StrBegin="MSB5013: "}UE: The solution filename is provided separately to loggers. - - - MSB5014: File format version is not recognized. MSBuild can only read solution files between versions {0}.0 and {1}.0, inclusive. - {StrBegin="MSB5014: "}UE: The solution filename is provided separately to loggers. - - - MSB5015: The properties could not be read from the WebsiteProperties section of the "{0}" project. - {StrBegin="MSB5015: "}UE: The solution filename is provided separately to loggers. - - - Unrecognized solution version "{0}", attempting to continue. - - - Solution file - UE: this fragment is used to describe errors found while parsing solution files. For example, if a normal error is - displayed like this: "MSBUILD : error MSB0000: This is an error.", then an error from solution parsing would look like this: - "MSBUILD : Solution file error MSB0000: This is an error." - LOCALIZATION: This fragment needs to be localized. - - - MSB5017: Cannot create directory "{0}". {1} - {StrBegin="MSB5017: "} - - - MSB5019: The project file is malformed: "{0}". {1} - {StrBegin="MSB5019: "} - - - MSB5020: Could not load the project file: "{0}". {1} - {StrBegin="MSB5020: "} - - - diff --git a/src/Deprecated/Engine/Shared/TypeLoader.cs b/src/Deprecated/Engine/Shared/TypeLoader.cs deleted file mode 100644 index 2397160dd7a..00000000000 --- a/src/Deprecated/Engine/Shared/TypeLoader.cs +++ /dev/null @@ -1,235 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.IO; -using System.Reflection; -using System.Collections.Generic; - -namespace Microsoft.Build.BuildEngine.Shared -{ - /// - /// This class is used to load types from their assemblies. - /// - /// SumedhK - internal class TypeLoader - { - private Dictionary> cacheOfAllDesiredTypesInAnAssembly = new Dictionary>(); - - private TypeFilter isDesiredType; - - /// - /// Constructor. - /// - /// - /// RGoel - internal TypeLoader(TypeFilter isDesiredType) - { - ErrorUtilities.VerifyThrow(isDesiredType != null, "need a type filter"); - - this.isDesiredType = isDesiredType; - } - - /// - /// Loads the specified type if it exists in the given assembly. If the type name is fully qualified, then a match (if - /// any) is unambiguous; otherwise, if there are multiple types with the same name in different namespaces, the first type - /// found will be returned. - /// - /// This method throws exceptions -- it is the responsibility of the caller to handle them. - /// SumedhK - /// Can be empty string. - /// - /// The loaded type, or null if the type was not found. - internal LoadedType Load - ( - string typeName, - AssemblyLoadInfo assembly - ) - { - Type type = null; - - // Maybe we've already cracked open this assembly before. If so, just grab the list - // of public desired types that we found last time. - List desiredTypesInAssembly; - cacheOfAllDesiredTypesInAnAssembly.TryGetValue(assembly, out desiredTypesInAssembly); - - // If we have the assembly name (strong or weak), and we haven't cracked this assembly open - // before to discover all the public desired types. - if ((assembly.AssemblyName != null) && (typeName.Length > 0) && (desiredTypesInAssembly == null)) - { - try - { - // try to load the type using its assembly qualified name - type = Type.GetType(typeName + "," + assembly.AssemblyName, false /* don't throw on error */, true /* case-insensitive */); - } - catch (ArgumentException) - { - // Type.GetType() will throw this exception if the type name is invalid -- but we have no idea if it's the - // type or the assembly name that's the problem -- so just ignore the exception, because we're going to - // check the existence/validity of the assembly and type respectively, below anyway - } - } - - // if we found the type, it means its assembly qualified name was also its fully qualified name - if (type != null) - { - // if it's not the right type, bail out -- there's no point searching further since we already matched on the - // fully qualified name - if (!isDesiredType(type, null)) - { - return null; - } - } - // if the type name was not fully qualified, or if we only have the assembly file/path - else - { - if (desiredTypesInAssembly == null) - { - // we need to search the assembly for the type... - Assembly loadedAssembly; - - try - { - if (assembly.AssemblyName != null) - { - loadedAssembly = Assembly.Load(assembly.AssemblyName); - } - else - { - loadedAssembly = Assembly.UnsafeLoadFrom(assembly.AssemblyFile); - } - } - // Assembly.Load() and Assembly.LoadFrom() will throw an ArgumentException if the assembly name is invalid - catch (ArgumentException e) - { - // convert to a FileNotFoundException because it's more meaningful - // NOTE: don't use ErrorUtilities.VerifyThrowFileExists() here because that will hit the disk again - throw new FileNotFoundException(null, assembly.ToString(), e); - } - - // only look at public types - Type[] allPublicTypesInAssembly = loadedAssembly.GetExportedTypes(); - desiredTypesInAssembly = new List(); - - foreach (Type publicType in allPublicTypesInAssembly) - { - if (isDesiredType(publicType, null)) - { - desiredTypesInAssembly.Add(publicType); - } - } - - // Save the list of desired types into our cache, so that we don't have to crack it - // open again. - cacheOfAllDesiredTypesInAnAssembly[assembly] = desiredTypesInAssembly; - } - - foreach (Type desiredTypeInAssembly in desiredTypesInAssembly) - { - // if type matches partially on its name - if ((typeName.Length == 0) || IsPartialTypeNameMatch(desiredTypeInAssembly.FullName, typeName)) - { - type = desiredTypeInAssembly; - break; - } - } - } - - if (type != null) - { - return new LoadedType(type, assembly); - } - - return null; - } - - /// - /// Given two type names, looks for a partial match between them. A partial match is considered valid only if it occurs on - /// the right side (tail end) of the name strings, and at the start of a class or namespace name. - /// - /// - /// 1) Matches are case-insensitive. - /// 2) .NET conventions regarding namespaces and nested classes are respected, including escaping of reserved characters. - /// - /// - /// "Csc" and "csc" ==> exact match - /// "Microsoft.Build.Tasks.Csc" and "Microsoft.Build.Tasks.Csc" ==> exact match - /// "Microsoft.Build.Tasks.Csc" and "Csc" ==> partial match - /// "Microsoft.Build.Tasks.Csc" and "Tasks.Csc" ==> partial match - /// "MyTasks.ATask+NestedTask" and "NestedTask" ==> partial match - /// "MyTasks.ATask\\+NestedTask" and "NestedTask" ==> partial match - /// "MyTasks.CscTask" and "Csc" ==> no match - /// "MyTasks.MyCsc" and "Csc" ==> no match - /// "MyTasks.ATask\.Csc" and "Csc" ==> no match - /// "MyTasks.ATask\\\.Csc" and "Csc" ==> no match - /// - /// SumedhK - /// - /// - /// true, if the type names match exactly or partially; false, if there is no match at all - internal static bool IsPartialTypeNameMatch(string typeName1, string typeName2) - { - bool isPartialMatch = false; - - // if the type names are the same length, a partial match is impossible - if (typeName1.Length != typeName2.Length) - { - string longerTypeName; - string shorterTypeName; - - // figure out which type name is longer - if (typeName1.Length > typeName2.Length) - { - longerTypeName = typeName1; - shorterTypeName = typeName2; - } - else - { - longerTypeName = typeName2; - shorterTypeName = typeName1; - } - - // if the shorter type name matches the end of the longer one - if (longerTypeName.EndsWith(shorterTypeName, StringComparison.OrdinalIgnoreCase)) - { - int matchIndex = longerTypeName.Length - shorterTypeName.Length; - - // if the matched sub-string looks like the start of a namespace or class name - if ((longerTypeName[matchIndex - 1] == '.') || (longerTypeName[matchIndex - 1] == '+')) - { - int precedingBackslashes = 0; - - // confirm there are zero, or an even number of \'s preceding it... - for (int i = matchIndex - 2; i >= 0; i--) - { - if (longerTypeName[i] == '\\') - { - precedingBackslashes++; - } - else - { - break; - } - } - - if ((precedingBackslashes % 2) == 0) - { - isPartialMatch = true; - } - } - } - } - // check if the type names match exactly - else - { - isPartialMatch = (String.Equals(typeName1, typeName2, StringComparison.OrdinalIgnoreCase)); - } - - return isPartialMatch; - } - } -} diff --git a/src/Deprecated/Engine/Shared/UnitTests/ErrorUtilities_Tests.cs b/src/Deprecated/Engine/Shared/UnitTests/ErrorUtilities_Tests.cs deleted file mode 100644 index c2d79851b43..00000000000 --- a/src/Deprecated/Engine/Shared/UnitTests/ErrorUtilities_Tests.cs +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -#region Using directives - -using System; -using NUnit.Framework; -using Microsoft.Build.BuildEngine.Shared; - -#endregion - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - sealed public class ErrorUtilities_Tests - { - [Test] - public void VerifyThrowNoAssertFalse() - { - try - { - ErrorUtilities.VerifyThrowNoAssert(false, "msbuild rules"); - } - catch (InternalErrorException e) - { - Assertion.Assert("exception message", e.Message.Contains("msbuild rules")); - return; - } - - Assertion.Assert("Should have thrown an exception", false); - } - - [Test] - public void VerifyThrowNoAssertTrue() - { - // This shouldn't throw. - ErrorUtilities.VerifyThrowNoAssert(true, "msbuild rules"); - } - - [Test] - public void VerifyThrow0True() - { - // This shouldn't throw. - ErrorUtilities.VerifyThrow(true, "blah"); - } - - [Test] - public void VerifyThrow1True() - { - // This shouldn't throw. - ErrorUtilities.VerifyThrow(true, "{0}", "a"); - } - - [Test] - public void VerifyThrow2True() - { - // This shouldn't throw. - ErrorUtilities.VerifyThrow(true, "{0}{1}", "a", "b"); - } - - [Test] - public void VerifyThrow3True() - { - // This shouldn't throw. - ErrorUtilities.VerifyThrow(true, "{0}{1}{2}", "a", "b", "c"); - } - - [Test] - public void VerifyThrow4True() - { - // This shouldn't throw. - ErrorUtilities.VerifyThrow(true, "{0}{1}{2}{3}", "a", "b", "c", "d"); - } - - [ExpectedException(typeof(ArgumentNullException))] - [Test] - public void VerifyThrowArgumentArraysSameLength1() - { - ErrorUtilities.VerifyThrowArgumentArraysSameLength(null, new string[1], string.Empty, string.Empty); - } - - [ExpectedException(typeof(ArgumentNullException))] - [Test] - public void VerifyThrowArgumentArraysSameLength2() - { - ErrorUtilities.VerifyThrowArgumentArraysSameLength(new string[1], null, string.Empty, string.Empty); - } - - [ExpectedException(typeof(ArgumentException))] - [Test] - public void VerifyThrowArgumentArraysSameLength3() - { - ErrorUtilities.VerifyThrowArgumentArraysSameLength(new string[1], new string[2], string.Empty, string.Empty); - } - - [Test] - public void VerifyThrowArgumentArraysSameLength4() - { - ErrorUtilities.VerifyThrowArgumentArraysSameLength(new string[1], new string[1], string.Empty, string.Empty); - } - } -} diff --git a/src/Deprecated/Engine/Shared/UnitTests/EscapingUtilities_Tests.cs b/src/Deprecated/Engine/Shared/UnitTests/EscapingUtilities_Tests.cs deleted file mode 100644 index da5e0d3c484..00000000000 --- a/src/Deprecated/Engine/Shared/UnitTests/EscapingUtilities_Tests.cs +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -#region Using directives - -using System; -using NUnit.Framework; -using Microsoft.Build.BuildEngine.Shared; - -#endregion - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - sealed public class EscapingUtilities_Tests - { - /// - /// - /// RGoel,LukaszG - [Test] - public void Unescape() - { - Assertion.AssertEquals("", EscapingUtilities.UnescapeAll("")); - Assertion.AssertEquals("foo", EscapingUtilities.UnescapeAll("foo")); - Assertion.AssertEquals("foo bar", EscapingUtilities.UnescapeAll("foo%20bar")); - Assertion.AssertEquals("foobar;", EscapingUtilities.UnescapeAll("foobar%3B")); - Assertion.AssertEquals(";foobar", EscapingUtilities.UnescapeAll("%3bfoobar")); - Assertion.AssertEquals(";", EscapingUtilities.UnescapeAll("%3b")); - Assertion.AssertEquals(";;;;;", EscapingUtilities.UnescapeAll("%3b%3B;%3b%3B")); - Assertion.AssertEquals("%3B", EscapingUtilities.UnescapeAll("%253B")); - Assertion.AssertEquals("===%ZZ %%%===", EscapingUtilities.UnescapeAll("===%ZZ%20%%%===")); - Assertion.AssertEquals("hello; escaping% how( are) you?", EscapingUtilities.UnescapeAll("hello%3B escaping%25 how%28 are%29 you%3f")); - - Assertion.AssertEquals("%*?*%*", EscapingUtilities.UnescapeAll("%25*?*%25*")); - Assertion.AssertEquals("%*?*%*", EscapingUtilities.UnescapeAll("%25%2a%3f%2a%25%2a")); - - Assertion.AssertEquals("*Star*craft or *War*cr@ft??", EscapingUtilities.UnescapeAll("%2aStar%2Acraft%20or %2aWar%2Acr%40ft%3f%3F")); - } - - /// - /// - /// KieranMo - [Test] - public void Escape() - { - Assertion.AssertEquals("%2a", EscapingUtilities.Escape("*")); - Assertion.AssertEquals("%3f", EscapingUtilities.Escape("?")); - Assertion.AssertEquals("#%2a%3f%2a#%2a", EscapingUtilities.Escape("#*?*#*")); - Assertion.AssertEquals("%25%2a%3f%2a%25%2a", EscapingUtilities.Escape("%*?*%*")); - } - - /// - /// - /// KieranMo - [Test] - public void UnescapeEscape() - { - string text; - - text = "*"; - Assertion.AssertEquals(text, EscapingUtilities.UnescapeAll(EscapingUtilities.Escape(text))); - - text = "?"; - Assertion.AssertEquals(text, EscapingUtilities.UnescapeAll(EscapingUtilities.Escape(text))); - - text = "#*?*#*"; - Assertion.AssertEquals(text, EscapingUtilities.UnescapeAll(EscapingUtilities.Escape(text))); - } - - /// - /// - /// KieranMo - [Test] - public void EscapeUnescape() - { - string text; - - text = "%2a"; - Assertion.AssertEquals(text, EscapingUtilities.Escape(EscapingUtilities.UnescapeAll(text))); - - text = "%3f"; - Assertion.AssertEquals(text, EscapingUtilities.Escape(EscapingUtilities.UnescapeAll(text))); - - text = "#%2a%3f%2a#%2a"; - Assertion.AssertEquals(text, EscapingUtilities.Escape(EscapingUtilities.UnescapeAll(text))); - } - - [Test] - public void ContainsEscapedWildcards() - { - Assertion.Assert(!EscapingUtilities.ContainsEscapedWildcards("NoStarOrQMark")); - Assertion.Assert(!EscapingUtilities.ContainsEscapedWildcards("%4")); - Assertion.Assert(!EscapingUtilities.ContainsEscapedWildcards("%3B")); - Assertion.Assert(!EscapingUtilities.ContainsEscapedWildcards("%2B")); - Assertion.Assert(EscapingUtilities.ContainsEscapedWildcards("%2a")); - Assertion.Assert(EscapingUtilities.ContainsEscapedWildcards("%2A")); - Assertion.Assert(EscapingUtilities.ContainsEscapedWildcards("%3F")); - Assertion.Assert(EscapingUtilities.ContainsEscapedWildcards("%3f")); - } - - } -} diff --git a/src/Deprecated/Engine/Shared/UnitTests/FileMatcher_Tests.cs b/src/Deprecated/Engine/Shared/UnitTests/FileMatcher_Tests.cs deleted file mode 100644 index 72f6c5dd81b..00000000000 --- a/src/Deprecated/Engine/Shared/UnitTests/FileMatcher_Tests.cs +++ /dev/null @@ -1,1330 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.IO; -using System.Reflection; -using System.Collections; -using System.Globalization; -using System.Text.RegularExpressions; - -using NUnit.Framework; - -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class FileMatcherTest - { - /* - * Method: GetFileSystemEntries - * Owner: jomof - * - * Simulate Directories.GetFileSystemEntries where file names are short. - * - */ - private static string[] GetFileSystemEntries(FileMatcher.FileSystemEntity entityType, string path, string pattern, string projectDirectory, bool stripProjectDirectory) - { - if - ( - pattern==@"LONGDI~1" - && (@"D:\"==path || @"\\server\share\"==path || path.Length==0) - ) - { - return new string [] {Path.Combine(path, "LongDirectoryName")}; - } - else if - ( - pattern==@"LONGSU~1" - && (@"D:\LongDirectoryName"==path || @"\\server\share\LongDirectoryName"==path || @"LongDirectoryName"==path) - ) - { - return new string [] {Path.Combine (path, "LongSubDirectory")}; - } - else if - ( - pattern==@"LONGFI~1.TXT" - && (@"D:\LongDirectoryName\LongSubDirectory"==path || @"\\server\share\LongDirectoryName\LongSubDirectory"==path || @"LongDirectoryName\LongSubDirectory"==path) - ) - { - return new string[] { Path.Combine (path, "LongFileName.txt") }; - } - else if - ( - pattern==@"pomegr~1" - && @"c:\apple\banana\tomato"==path - ) - { - return new string[] { Path.Combine (path, "pomegranate") }; - } - else if - ( - @"c:\apple\banana\tomato\pomegranate\orange"==path - ) - { - // No files exist here. This is an empty directory. - return new string[0]; - } - else - { - Console.WriteLine("GetFileSystemEntries('{0}', '{1}')", path, pattern); - Assertion.Assert("Unexpected input into GetFileSystemEntries", false); - } - return new string [] {""}; - } - - /// - /// Simple test of the MatchDriver code. - /// - [Test] - public void BasicMatchDriver() - { - MatchDriver - ( - @"Source\**", - new string[] // Files that exist and should match. - { - @"Source\Bart.txt", - @"Source\Sub\Homer.txt", - }, - new string[] // Files that exist and should not match. - { - @"Destination\Bart.txt", - @"Destination\Sub\Homer.txt", - }, - null - ); - } - - /// - /// This pattern should *not* recurse indefinitely since there is no '**' in the pattern: - /// - /// c:\?emp\foo - /// - /// - [Test] - public void Regress162390() - { - MatchDriver - ( - @"c:\?emp\foo.txt", - new string[] { @"c:\temp\foo.txt" }, // Should match - new string[] { @"c:\timp\foo.txt" }, // Shouldn't match - new string[] // Should not even consider. - { - @"c:\temp\sub\foo.txt" - } - ); - } - - - /* - * Method: GetLongFileNameForShortLocalPath - * Owner: jomof - * - * Convert a short local path to a long path. - * - */ - [Test] - public void GetLongFileNameForShortLocalPath() - { - string longPath = FileMatcher.GetLongPathName - ( - @"D:\LONGDI~1\LONGSU~1\LONGFI~1.TXT", - new FileMatcher.GetFileSystemEntries(FileMatcherTest.GetFileSystemEntries) - ); - - Assertion.AssertEquals(longPath, @"D:\LongDirectoryName\LongSubDirectory\LongFileName.txt"); - } - - /* - * Method: GetLongFileNameForLongLocalPath - * Owner: jomof - * - * Convert a long local path to a long path (nop). - * - */ - [Test] - public void GetLongFileNameForLongLocalPath() - { - string longPath = FileMatcher.GetLongPathName - ( - @"D:\LongDirectoryName\LongSubDirectory\LongFileName.txt", - new FileMatcher.GetFileSystemEntries(FileMatcherTest.GetFileSystemEntries) - ); - - Assertion.AssertEquals(longPath, @"D:\LongDirectoryName\LongSubDirectory\LongFileName.txt"); - } - - /* - * Method: GetLongFileNameForShortUncPath - * Owner: jomof - * - * Convert a short UNC path to a long path. - * - */ - [Test] - public void GetLongFileNameForShortUncPath() - { - string longPath = FileMatcher.GetLongPathName - ( - @"\\server\share\LONGDI~1\LONGSU~1\LONGFI~1.TXT", - new FileMatcher.GetFileSystemEntries(FileMatcherTest.GetFileSystemEntries) - ); - - Assertion.AssertEquals(longPath, @"\\server\share\LongDirectoryName\LongSubDirectory\LongFileName.txt"); - } - - /* - * Method: GetLongFileNameForLongUncPath - * Owner: jomof - * - * Convert a long UNC path to a long path (nop) - * - */ - [Test] - public void GetLongFileNameForLongUncPath() - { - string longPath = FileMatcher.GetLongPathName - ( - @"\\server\share\LongDirectoryName\LongSubDirectory\LongFileName.txt", - new FileMatcher.GetFileSystemEntries(FileMatcherTest.GetFileSystemEntries) - ); - - Assertion.AssertEquals(longPath, @"\\server\share\LongDirectoryName\LongSubDirectory\LongFileName.txt"); - } - - /* - * Method: GetLongFileNameForRelativePath - * Owner: jomof - * - * Convert a short relative path to a long path - * - */ - [Test] - public void GetLongFileNameForRelativePath() - { - string longPath = FileMatcher.GetLongPathName - ( - @"LONGDI~1\LONGSU~1\LONGFI~1.TXT", - new FileMatcher.GetFileSystemEntries(FileMatcherTest.GetFileSystemEntries) - ); - - Assertion.AssertEquals(longPath, @"LongDirectoryName\LongSubDirectory\LongFileName.txt"); - } - - /* - * Method: GetLongFileNameForRelativePathPreservesTrailingSlash - * Owner: jomof - * - * Convert a short relative path with a trailing backslash to a long path - * - */ - [Test] - public void GetLongFileNameForRelativePathPreservesTrailingSlash() - { - string longPath = FileMatcher.GetLongPathName - ( - @"LONGDI~1\LONGSU~1\", - new FileMatcher.GetFileSystemEntries(FileMatcherTest.GetFileSystemEntries) - ); - - Assertion.AssertEquals(@"LongDirectoryName\LongSubDirectory\", longPath); - } - - /* - * Method: GetLongFileNameForRelativePathPreservesExtraSlashes - * Owner: jomof - * - * Convert a short relative path with doubled embedded backslashes to a long path - * - */ - [Test] - public void GetLongFileNameForRelativePathPreservesExtraSlashes() - { - string longPath = FileMatcher.GetLongPathName - ( - @"LONGDI~1\\LONGSU~1\\", - new FileMatcher.GetFileSystemEntries(FileMatcherTest.GetFileSystemEntries) - ); - - Assertion.AssertEquals(@"LongDirectoryName\\LongSubDirectory\\", longPath); - } - - /* - * Method: GetLongFileNameForMixedLongAndShort - * Owner: jomof - * - * Only part of the path might be short. - * - */ - [Test] - public void GetLongFileNameForMixedLongAndShort() - { - string longPath = FileMatcher.GetLongPathName - ( - @"c:\apple\banana\tomato\pomegr~1\orange\", - new FileMatcher.GetFileSystemEntries(FileMatcherTest.GetFileSystemEntries) - ); - - Assertion.AssertEquals (@"c:\apple\banana\tomato\pomegranate\orange\", longPath); - } - - /* - * Method: GetLongFileNameWherePartOfThePathDoesntExist - * Owner: jomof - * - * Part of the path may not exist. In this case, we treat the non-existent parts - * as if they were already a long file name. - * - */ - [Test] - public void GetLongFileNameWherePartOfThePathDoesntExist() - { - string longPath = FileMatcher.GetLongPathName - ( - @"c:\apple\banana\tomato\pomegr~1\orange\chocol~1\vanila~1", - new FileMatcher.GetFileSystemEntries(FileMatcherTest.GetFileSystemEntries) - ); - - Assertion.AssertEquals (@"c:\apple\banana\tomato\pomegranate\orange\chocol~1\vanila~1", longPath); - } - - [Test] - public void BasicMatch() - { - ValidateFileMatch("file.txt", "File.txt", false); - ValidateNoFileMatch("file.txt", "File.bin", false); - } - - [Test] - public void MatchSingleCharacter() - { - ValidateFileMatch("file.?xt", "File.txt", false); - ValidateNoFileMatch("file.?xt", "File.bin", false); - } - - [Test] - public void MatchMultipleCharacters() - { - ValidateFileMatch("*.txt", "*.txt", false); - ValidateNoFileMatch("*.txt", "*.bin", false); - } - - [Test] - public void SimpleRecursive() - { - ValidateFileMatch("**", ".\\File.txt", true); - } - - [Test] - public void DotForCurrentDirectory() - { - ValidateFileMatch(".\\file.txt", ".\\File.txt", false); - ValidateNoFileMatch(".\\file.txt", ".\\File.bin", false); - } - - [Test] - public void DotDotForParentDirectory() - { - ValidateFileMatch("..\\..\\*.*", "..\\..\\File.txt", false); - ValidateFileMatch("..\\..\\*.*", "..\\..\\File", false); - ValidateNoFileMatch("..\\..\\*.*", "..\\..\\dir1\\dir2\\File.txt", false); - ValidateNoFileMatch("..\\..\\*.*", "..\\..\\dir1\\dir2\\File", false); - } - - [Test] - public void ReduceDoubleSlashesBaseline() - { - // Baseline - ValidateFileMatch("f:\\dir1\\dir2\\file.txt", "f:\\dir1\\dir2\\file.txt", false); - ValidateFileMatch("**\\*.cs", "dir1\\dir2\\file.cs", true); - ValidateFileMatch("**\\*.cs", "file.cs", true); - } - - - [Test] - public void ReduceDoubleSlashes() - { - ValidateFileMatch("f:\\\\dir1\\dir2\\file.txt", "f:\\dir1\\dir2\\file.txt", false); - ValidateFileMatch("f:\\\\dir1\\\\\\dir2\\file.txt", "f:\\dir1\\dir2\\file.txt", false); - ValidateFileMatch("f:\\\\dir1\\\\\\dir2\\\\\\\\\\file.txt", "f:\\dir1\\dir2\\file.txt", false); - ValidateFileMatch("..\\**/\\*.cs", "..\\dir1\\dir2\\file.cs", true); - ValidateFileMatch("..\\**/.\\*.cs", "..\\dir1\\dir2\\file.cs", true); - ValidateFileMatch("..\\**\\./.\\*.cs", "..\\dir1\\dir2\\file.cs", true); - } - - [Test] - public void DoubleSlashesOnBothSidesOfComparison() - { - ValidateFileMatch("f:\\\\dir1\\dir2\\file.txt", "f:\\\\dir1\\dir2\\file.txt", false, false); - ValidateFileMatch("f:\\\\dir1\\\\\\dir2\\file.txt", "f:\\\\dir1\\\\\\dir2\\file.txt", false, false); - ValidateFileMatch("f:\\\\dir1\\\\\\dir2\\\\\\\\\\file.txt", "f:\\\\dir1\\\\\\dir2\\\\\\\\\\file.txt", false, false); - ValidateFileMatch("..\\**/\\*.cs", "..\\dir1\\dir2\\\\file.cs", true, false); - ValidateFileMatch("..\\**/.\\*.cs", "..\\dir1\\dir2//\\file.cs", true, false); - ValidateFileMatch("..\\**\\./.\\*.cs", "..\\dir1/\\/\\/dir2\\file.cs", true, false); - } - - [Test] - public void DecomposeDotSlash() - { - ValidateFileMatch("f:\\.\\dir1\\dir2\\file.txt", "f:\\dir1\\dir2\\file.txt", false); - ValidateFileMatch("f:\\dir1\\.\\dir2\\file.txt", "f:\\dir1\\dir2\\file.txt", false); - ValidateFileMatch("f:\\dir1\\dir2\\.\\file.txt", "f:\\dir1\\dir2\\file.txt", false); - ValidateFileMatch("f:\\.//dir1\\dir2\\file.txt", "f:\\dir1\\dir2\\file.txt", false); - ValidateFileMatch("f:\\dir1\\.//dir2\\file.txt", "f:\\dir1\\dir2\\file.txt", false); - ValidateFileMatch("f:\\dir1\\dir2\\.//file.txt", "f:\\dir1\\dir2\\file.txt", false); - - ValidateFileMatch(".\\dir1\\dir2\\file.txt", ".\\dir1\\dir2\\file.txt", false); - ValidateFileMatch(".\\.\\dir1\\dir2\\file.txt", ".\\dir1\\dir2\\file.txt", false); - ValidateFileMatch(".//dir1\\dir2\\file.txt", ".\\dir1\\dir2\\file.txt", false); - ValidateFileMatch(".//.//dir1\\dir2\\file.txt", ".\\dir1\\dir2\\file.txt", false); - } - - [Test] - public void RecursiveDirRecursive() - { - // Check that a wildcardpath of **\x\**\ matches correctly since, \**\ is a - // separate code path. - ValidateFileMatch(@"c:\foo\**\x\**\*.*", @"c:\foo\x\file.txt", true); - ValidateFileMatch(@"c:\foo\**\x\**\*.*", @"c:\foo\y\x\file.txt", true); - ValidateFileMatch(@"c:\foo\**\x\**\*.*", @"c:\foo\x\y\file.txt", true); - ValidateFileMatch(@"c:\foo\**\x\**\*.*", @"c:\foo\y\x\y\file.txt", true); - ValidateFileMatch(@"c:\foo\**\x\**\*.*", @"c:\foo\x\x\file.txt", true); - ValidateFileMatch(@"c:\foo\**\x\**\*.*", @"c:\foo\x\x\file.txt", true); - ValidateFileMatch(@"c:\foo\**\x\**\*.*", @"c:\foo\x\x\x\file.txt", true); - } - - [Test] - public void Regress155731() - { - ValidateFileMatch(@"a\b\**\**\**\**\**\e\*", @"a\b\c\d\e\f.txt", true); - ValidateFileMatch(@"a\b\**\e\*", @"a\b\c\d\e\f.txt", true); - ValidateFileMatch(@"a\b\**\**\e\*", @"a\b\c\d\e\f.txt", true); - ValidateFileMatch(@"a\b\**\**\**\e\*", @"a\b\c\d\e\f.txt", true); - ValidateFileMatch(@"a\b\**\**\**\**\e\*", @"a\b\c\d\e\f.txt", true); - } - - [Test] - public void ParentWithoutSlash() - { - // However, we don't wtool this to match, - ValidateNoFileMatch(@"C:\foo\**", @"C:\foo", true); - // becase we don't know whether foo is a file or folder. - - // Same for UNC - ValidateNoFileMatch - ( - "\\\\server\\c$\\Documents and Settings\\User\\**", - "\\\\server\\c$\\Documents and Settings\\User", - true - ); - } - - [Test] - public void Unc() - { - // Check UNC functionality - ValidateFileMatch - ( - "\\\\server\\c$\\**\\*.cs", - "\\\\server\\c$\\Documents and Settings\\User\\Source.cs", - true - ); - - ValidateNoFileMatch - ( - "\\\\server\\c$\\**\\*.cs", - "\\\\server\\c$\\Documents and Settings\\User\\Source.txt", - true - ); - ValidateFileMatch - ( - "\\\\**", - "\\\\server\\c$\\Documents and Settings\\User\\Source.cs", - true - ); - ValidateFileMatch - ( - "\\\\**\\*.*", - "\\\\server\\c$\\Documents and Settings\\User\\Source.cs", - true - ); - - - ValidateFileMatch - ( - "**", - "\\\\server\\c$\\Documents and Settings\\User\\Source.cs", - true - ); - - } - - [Test] - public void ExplicitToolCompatibility() - { - // Explicit ANT compatibility. These patterns taken from the ANT documentation. - ValidateFileMatch("**/SourceSafe/*", "./SourceSafe/Repository", true); - ValidateFileMatch("**\\SourceSafe/*", "./SourceSafe/Repository", true); - ValidateFileMatch("**/SourceSafe/*", ".\\SourceSafe\\Repository", true); - ValidateFileMatch("**/SourceSafe/*", "./org/IIS/SourceSafe/Entries", true); - ValidateFileMatch("**/SourceSafe/*", "./org/IIS/pluggin/tools/tool/SourceSafe/Entries", true); - ValidateNoFileMatch("**/SourceSafe/*", "./org/IIS/SourceSafe/foo/bar/Entries", true); - ValidateNoFileMatch("**/SourceSafe/*", "./SourceSafeRepository", true); - ValidateNoFileMatch("**/SourceSafe/*", "./aSourceSafe/Repository", true); - - ValidateFileMatch("org/IIS/pluggin/**", "org/IIS/pluggin/tools/tool/docs/index.html", true); - ValidateFileMatch("org/IIS/pluggin/**", "org/IIS/pluggin/test.xml", true); - ValidateFileMatch("org/IIS/pluggin/**", "org/IIS/pluggin\\test.xml", true); - ValidateNoFileMatch("org/IIS/pluggin/**", "org/IIS/abc.cs", true); - - ValidateFileMatch("org/IIS/**/SourceSafe/*", "org/IIS/SourceSafe/Entries", true); - ValidateFileMatch("org/IIS/**/SourceSafe/*", "org\\IIS/SourceSafe/Entries", true); - ValidateFileMatch("org/IIS/**/SourceSafe/*", "org/IIS\\SourceSafe/Entries", true); - ValidateFileMatch("org/IIS/**/SourceSafe/*", "org/IIS/pluggin/tools/tool/SourceSafe/Entries", true); - ValidateNoFileMatch("org/IIS/**/SourceSafe/*", "org/IIS/SourceSafe/foo/bar/Entries", true); - ValidateNoFileMatch("org/IIS/**/SourceSafe/*", "org/IISSourceSage/Entries", true); - } - - [Test] - public void ExplicitToolIncompatibility() - { - // NOTE: Weirdly, ANT syntax is to match a file here. - // We don't because MSBuild philosophy is that a trailing slash indicates a directory - ValidateNoFileMatch("**/test/**", ".\\test", true); - - // NOTE: We deviate from ANT format here. ANT would append a ** to any path - // that ends with '/' or '\'. We think this is the wrong thing because 'folder\' - // is a valid folder name. - ValidateNoFileMatch("org/", "org/IISSourceSage/Entries", false); - ValidateNoFileMatch("org\\", "org/IISSourceSage/Entries", false); - } - - [Test] - public void MultipleStarStar() - { - // Multiple-** matches - ValidateFileMatch("c:\\**\\jomof\\**\\*.*", "c:\\Documents and Settings\\JomoF\\NTUSER.DAT", true); - ValidateNoFileMatch("c:\\**\\jomof1\\**\\*.*", "c:\\Documents and Settings\\JomoF\\NTUSER.DAT", true); - ValidateFileMatch("c:\\**\\jomof\\**\\*.*", "c://Documents and Settings\\JomoF\\NTUSER.DAT", true); - ValidateNoFileMatch("c:\\**\\jomof1\\**\\*.*", "c:\\Documents and Settings//JomoF\\NTUSER.DAT", true); - - } - - [Test] - public void Regress54411() - { - // Regress bug#54411: Item recursion doesn't work as expected on "c:\foo\**" - ValidateFileMatch("c:\\foo\\**", "c:\\foo\\bar\\subfile.txt", true); - } - - [Test] - public void IllegalPaths() - { - - // Certain patterns are illegal. - ValidateIllegal("**.cs"); - ValidateIllegal("***"); - ValidateIllegal("****"); - ValidateIllegal("*.cs**"); - ValidateIllegal("*.cs**"); - ValidateIllegal("...\\*.cs"); - ValidateIllegal("http://www.website.com"); - ValidateIllegal("<:tag:>"); - ValidateIllegal("<:\\**"); - } - - [Test] - public void SplitFileSpec() - { - /************************************************************************************* - * Call ValidateSplitFileSpec with various supported combinations. - *************************************************************************************/ - ValidateSplitFileSpec("foo.cs", "", "", "foo.cs"); - ValidateSplitFileSpec("**\\foo.cs", "", "**\\", "foo.cs"); - ValidateSplitFileSpec("f:\\dir1\\**\\foo.cs", "f:\\dir1\\", "**\\", "foo.cs"); - ValidateSplitFileSpec("..\\**\\foo.cs", "..\\", "**\\", "foo.cs"); - ValidateSplitFileSpec("f:\\dir1\\foo.cs", "f:\\dir1\\", "", "foo.cs"); - ValidateSplitFileSpec("f:\\dir?\\foo.cs", "f:\\", "dir?\\", "foo.cs"); - ValidateSplitFileSpec("dir?\\foo.cs", "", "dir?\\", "foo.cs"); - ValidateSplitFileSpec(@"**\test\**", "", @"**\test\**\", "*.*"); - } - - [Test] - public void Regress367780_CrashOnStarDotDot() - { - string workingPath = Path.Combine(Path.GetTempPath(), "Regress367780"); - string workingPathSubfolder = Path.Combine(workingPath, "SubDir"); - string offendingPattern = Path.Combine(workingPath, @"*\..\bar"); - string [] files = new string[0]; - - try - { - Directory.CreateDirectory(workingPath); - Directory.CreateDirectory(workingPathSubfolder); - - files = FileMatcher.Default.GetFiles(workingPath, offendingPattern); - } - finally - { - Directory.Delete(workingPathSubfolder); - Directory.Delete(workingPath); - } - - } - - [Test] - public void Regress141071_StarStarSlashStarStarIsLiteral() - { - string workingPath = Path.Combine(Path.GetTempPath(), "Regress141071"); - string fileName = Path.Combine(workingPath, "MyFile.txt"); - string offendingPattern = Path.Combine(workingPath, @"**\**"); - - string[] files = new string[0]; - - try - { - Directory.CreateDirectory(workingPath); - File.WriteAllText(fileName, "Hello there."); - files = FileMatcher.Default.GetFiles(workingPath, offendingPattern); - } - finally - { - File.Delete(fileName); - Directory.Delete(workingPath); - } - - string result = String.Join(", ", files); - Console.WriteLine(result); - Assertion.Assert(!result.Contains("**")); - Assertion.Assert(result.Contains("MyFile.txt")); - } - - [Test] - public void Regress14090_TrailingDotMatchesNoExtension() - { - string workingPath = Path.Combine(Path.GetTempPath(), "Regress141071"); - string workingPathSubdir = Path.Combine(workingPath, "subdir"); - string workingPathSubdirBing = Path.Combine(workingPathSubdir, "bing"); - - string offendingPattern = Path.Combine(workingPath, @"**\sub*\*."); - - string[] files = new string[0]; - - try - { - Directory.CreateDirectory(workingPath); - Directory.CreateDirectory(workingPathSubdir); - File.AppendAllText(workingPathSubdirBing, "y"); - files = FileMatcher.Default.GetFiles(workingPath, offendingPattern); - } - finally - { - Directory.Delete(workingPath, true); - } - - string result = String.Join(", ", files); - Console.WriteLine(result); - Assertion.AssertEquals(1, files.Length); - } - - [Test] - public void Regress14090_TrailingDotMatchesNoExtension_Part2() - { - ValidateFileMatch(@"c:\mydir\**\*.", @"c:\mydir\subdir\bing", true, /* simulate filesystem? */ false ); - ValidateNoFileMatch(@"c:\mydir\**\*.", @"c:\mydir\subdir\bing.txt", true); - } - - [Test] - public void RemoveProjectDirectory() - { - string[] strings = new string[1] { "c:\\1.file" }; - FileMatcher.RemoveProjectDirectory(strings, "c:\\"); - Assert.AreEqual(strings[0], "1.file"); - - strings = new string[1] { "c:\\directory\\1.file" }; - FileMatcher.RemoveProjectDirectory(strings, "c:\\"); - Assert.AreEqual(strings[0], "directory\\1.file"); - - strings = new string[1] { "c:\\directory\\1.file" }; - FileMatcher.RemoveProjectDirectory(strings , "c:\\directory"); - Assert.AreEqual(strings[0], "1.file"); - - strings = new string[1] { "c:\\1.file" }; - FileMatcher.RemoveProjectDirectory(strings, "c:\\directory"); - Assert.AreEqual(strings[0], "c:\\1.file"); - - strings = new string[1] { "c:\\directorymorechars\\1.file" }; - FileMatcher.RemoveProjectDirectory(strings, "c:\\directory"); - Assert.AreEqual(strings[0], "c:\\directorymorechars\\1.file"); - - strings = new string[1] { "\\Machine\\1.file" }; - FileMatcher.RemoveProjectDirectory(strings, "\\Machine"); - Assert.AreEqual(strings[0], "1.file"); - - strings = new string[1] { "\\Machine\\directory\\1.file" }; - FileMatcher.RemoveProjectDirectory(strings, "\\Machine"); - Assert.AreEqual(strings[0], "directory\\1.file"); - - strings = new string[1] { "\\Machine\\directory\\1.file" }; - FileMatcher.RemoveProjectDirectory(strings, "\\Machine\\directory"); - Assert.AreEqual(strings[0], "1.file"); - - strings = new string[1] { "\\Machine\\1.file" }; - FileMatcher.RemoveProjectDirectory(strings, "\\Machine\\directory"); - Assert.AreEqual(strings[0], "\\Machine\\1.file"); - - strings = new string[1] { "\\Machine\\directorymorechars\\1.file" }; - FileMatcher.RemoveProjectDirectory(strings, "\\Machine\\directory"); - Assert.AreEqual(strings[0], "\\Machine\\directorymorechars\\1.file"); - - } - - - - -#region Support functions. - - /// - /// This support class simulates a file system. - /// It accepts multiple sets of files and keeps track of how many files were "hit" - /// In this case, "hit" means that the caller asked for that file directly. - /// - internal class MockFileSystem - { - /// - /// Array of files (set1) - /// - string[] fileSet1; - - /// - /// Array of files (set2) - /// - string[] fileSet2; - - /// - /// Array of files (set3) - /// - string[] fileSet3; - - /// - /// Number of times a file from set 1 was requested. - /// - int fileSet1Hits = 0; - - /// - /// Number of times a file from set 2 was requested. - /// - int fileSet2Hits = 0; - - /// - /// Number of times a file from set 3 was requested. - /// - int fileSet3Hits = 0; - - /// - /// Construct. - /// - /// First set of files. - /// Second set of files. - /// Third set of files. - internal MockFileSystem - ( - string[] fileSet1, - string[] fileSet2, - string[] fileSet3 - ) - { - this.fileSet1 = fileSet1; - this.fileSet2 = fileSet2; - this.fileSet3 = fileSet3; - } - - /// - /// Number of times a file from set 1 was requested. - /// - internal int FileHits1 - { - get { return fileSet1Hits; } - } - - /// - /// Number of times a file from set 2 was requested. - /// - internal int FileHits2 - { - get { return fileSet2Hits; } - } - - /// - /// Number of times a file from set 3 was requested. - /// - internal int FileHits3 - { - get { return fileSet3Hits; } - } - - - /// - /// Return files that match the given files. - /// - /// Candidate files. - /// The path to search within - /// The pattern to search for. - /// Hashtable receives the files. - /// - private int GetMatchingFiles(string[] candidates, string path, string pattern, Hashtable files) - { - int hits = 0; - if (candidates != null) - { - foreach (string candidate in candidates) - { - string normalizedCandidate = Normalize(candidate); - - // Get the candidate directory. - string candidateDirectoryName = ""; - if (normalizedCandidate.IndexOfAny(FileMatcher.directorySeparatorCharacters) != -1) - { - candidateDirectoryName = Path.GetDirectoryName(normalizedCandidate) + @"\"; - } - - // Does the candidate directory match the requested path? - if (String.Compare(path, candidateDirectoryName, StringComparison.OrdinalIgnoreCase) == 0) - { - // Match the basic *.* or null. These both match any file. - if - ( - pattern == null || - String.Compare(pattern, "*.*", StringComparison.OrdinalIgnoreCase) == 0 - ) - { - ++hits; - files[normalizedCandidate] = String.Empty; - } - else if (pattern.Substring(0, 2) == "*.") // Match patterns like *.cs - { - string tail = pattern.Substring(1); - string candidateTail = candidate.Substring(candidate.Length - tail.Length); - if (String.Compare(tail, candidateTail, StringComparison.OrdinalIgnoreCase) == 0) - { - ++hits; - files[normalizedCandidate] = String.Empty; - } - } - else if (pattern.Substring(pattern.Length - 4, 2) == ".?") // Match patterns like foo.?xt - { - string leader = pattern.Substring(0, pattern.Length - 4); - string candidateLeader = candidate.Substring(candidate.Length - leader.Length - 4, leader.Length); - if (String.Compare(leader, candidateLeader, StringComparison.OrdinalIgnoreCase) == 0) - { - string tail = pattern.Substring(pattern.Length - 2); - string candidateTail = candidate.Substring(candidate.Length - 2); - if (String.Compare(tail, candidateTail, StringComparison.OrdinalIgnoreCase) == 0) - { - ++hits; - files[normalizedCandidate] = String.Empty; - } - } - } - else - { - Assertion.Assert(String.Format("Unhandled case in GetMatchingFiles: {0}", pattern), false); - } - } - } - } - - return hits; - } - - /// - /// Given a path and pattern, return all the simulated directories out of candidates. - /// - /// Candidate file to extract directories from. - /// The path to search. - /// The pattern to match. - /// Receives the directories. - private void GetMatchingDirectories(string[] candidates, string path, string pattern, Hashtable directories) - { - if (candidates != null) - { - foreach (string candidate in candidates) - { - string normalizedCandidate = Normalize(candidate); - - if (IsMatchingDirectory(path, normalizedCandidate)) - { - int nextSlash = normalizedCandidate.IndexOfAny(FileMatcher.directorySeparatorCharacters, path.Length + 1); - if (nextSlash != -1) - { - string match = normalizedCandidate.Substring(0, nextSlash + 1); - string baseMatch = Path.GetFileName(normalizedCandidate.Substring(0, nextSlash)); - if - ( - String.Compare(pattern, "*.*", StringComparison.OrdinalIgnoreCase) == 0 - || pattern == null - ) - { - directories[match] = String.Empty; - } - else if // Match patterns like ?emp - ( - pattern.Substring(0, 1) == "?" - && pattern.Length == baseMatch.Length - ) - { - string tail = pattern.Substring(1); - string baseMatchTail = baseMatch.Substring(1); - if (String.Compare(tail, baseMatchTail, StringComparison.OrdinalIgnoreCase) == 0) - { - directories[match] = String.Empty; - } - } - else - { - Assertion.Assert(String.Format("Unhandled case in GetMatchingDirectories: {0}", pattern), false); - - } - } - } - } - } - } - - /// - /// Method that is delegable for use by FileMatcher. This method simulates a filesystem by returning - /// files and\or folders that match the requested path and pattern. - /// - /// Files, Directories or both - /// The path to search. - /// The pattern to search (may be null) - /// The matched files or folders. - internal string[] GetAccessibleFileSystemEntries(FileMatcher.FileSystemEntity entityType, string path, string pattern, string projectDirectory, bool stripProjectDirectory) - { - string normalizedPath = Normalize(path); - - Hashtable files = new Hashtable(); - if (entityType == FileMatcher.FileSystemEntity.Files || entityType == FileMatcher.FileSystemEntity.FilesAndDirectories) - { - fileSet1Hits += GetMatchingFiles(fileSet1, normalizedPath, pattern, files); - fileSet2Hits += GetMatchingFiles(fileSet2, normalizedPath, pattern, files); - fileSet3Hits += GetMatchingFiles(fileSet3, normalizedPath, pattern, files); - } - - if (entityType == FileMatcher.FileSystemEntity.Directories || entityType == FileMatcher.FileSystemEntity.FilesAndDirectories) - { - GetMatchingDirectories(fileSet1, normalizedPath, pattern, files); - GetMatchingDirectories(fileSet2, normalizedPath, pattern, files); - GetMatchingDirectories(fileSet3, normalizedPath, pattern, files); - } - ArrayList uniqueFiles = new ArrayList(); - uniqueFiles.AddRange(files.Keys); - - return (string[])uniqueFiles.ToArray(typeof(string)); - } - - /// - /// Given a path, fix it up so that it can be compared to another path. - /// - /// The path to fix up. - /// The normalized path. - internal static string Normalize(string path) - { - if (path.Length == 0) - { - return path; - } - - string normalized = path.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar); - - // Replace leading UNC. - if (normalized.Substring(0, 2) == @"\\") - { - normalized = "<:UNC:>" + normalized.Substring(2); - } - - // Preserve parent-directory markers. - normalized = normalized.Replace(@"..\", "<:PARENT:>"); - - - // Just get rid of doubles enough to satisfy our test cases. - normalized = normalized.Replace(@"\\", @"\"); - normalized = normalized.Replace(@"\\", @"\"); - normalized = normalized.Replace(@"\\", @"\"); - - // Strip any .\ - normalized = normalized.Replace(@".\", ""); - - // Put back the preserved markers. - normalized = normalized.Replace("<:UNC:>", @"\\"); - normalized = normalized.Replace("<:PARENT:>", @"..\"); - - return normalized; - } - - /// - /// Determines whether candidate is in a subfolder of path. - /// - /// - /// - /// True if there is a match. - private bool IsMatchingDirectory(string path, string candidate) - { - string normalizedPath = Normalize(path); - string normalizedCandidate = Normalize(candidate); - - // Current directory always matches for non-rooted paths. - if (path.Length == 0 && !Path.IsPathRooted(candidate)) - { - return true; - } - - if (normalizedCandidate.Length > normalizedPath.Length) - { - if (String.Compare(normalizedPath, 0, normalizedCandidate, 0, normalizedPath.Length, StringComparison.OrdinalIgnoreCase) == 0) - { - if (FileUtilities.EndsWithSlash(normalizedPath)) - { - return true; - } - else if (FileUtilities.IsSlash(normalizedCandidate[normalizedPath.Length])) - { - return true; - } - } - } - - return false; - } - - - /// - /// Searches the candidates array for one that matches path - /// - /// - /// - /// The index of the first match or negative one. - private int IndexOfFirstMatchingDirectory(string path, string[] candidates) - { - if (candidates != null) - { - int i = 0; - foreach (string candidate in candidates) - { - if (IsMatchingDirectory(path, candidate)) - { - return i; - } - - ++i; - } - } - - return -1; - } - - /// - /// Delegable method that returns true if the given directory exists in this simulated filesystem - /// - /// The path to check. - /// True if the directory exists. - internal bool DirectoryExists(string path) - { - - if (IndexOfFirstMatchingDirectory(path, fileSet1) != -1) - { - return true; - } - - if (IndexOfFirstMatchingDirectory(path, fileSet2) != -1) - { - return true; - } - - if (IndexOfFirstMatchingDirectory(path, fileSet3) != -1) - { - return true; - } - - return false; - } - } - - /// - /// A general purpose method used to: - /// - /// (1) Simulate a file system. - /// (2) Check whether all matchingFiles where hit by the filespec pattern. - /// (3) Check whether all nonmatchingFiles were *not* hit by the filespec pattern. - /// (4) Check whether all untouchableFiles were not even requested (usually for perf reasons). - /// - /// These can be used in various combinations to test the filematcher framework. - /// - /// A FileMatcher filespec, possibly with wildcards. - /// Files that exist and should be matched. - /// Files that exists and should not be matched. - /// Files that exist but should not be requested. - private static void MatchDriver - ( - string filespec, - string[] matchingFiles, - string[] nonmatchingFiles, - string[] untouchableFiles - ) - { - MockFileSystem mockFileSystem = new MockFileSystem(matchingFiles, nonmatchingFiles, untouchableFiles); - string[] files = FileMatcher.GetFiles - ( - String.Empty, /* we don't need project directory as we use mock filesystem */ - filespec, - new FileMatcher.GetFileSystemEntries(mockFileSystem.GetAccessibleFileSystemEntries), - new FileMatcher.DirectoryExists(mockFileSystem.DirectoryExists) - ); - - // Validate the matching files. - if (matchingFiles != null) - { - foreach (string matchingFile in matchingFiles) - { - int timesFound = 0; - foreach (string file in files) - { - string normalizedFile = MockFileSystem.Normalize(file); - string normalizedMatchingFile = MockFileSystem.Normalize(matchingFile); - if (String.Compare(normalizedFile, normalizedMatchingFile, StringComparison.OrdinalIgnoreCase) == 0) - { - ++timesFound; - } - } - Assertion.Assert(String.Format("Expected to find matching file '{0}' exactly one times. Found it '{1}' times instead.", matchingFile, timesFound), timesFound == 1); - } - } - - - // Validate the non-matching files - if (nonmatchingFiles != null) - { - foreach (string nonmatchingFile in nonmatchingFiles) - { - int timesFound = 0; - foreach (string file in files) - { - string normalizedFile = MockFileSystem.Normalize(file); - string normalizedNonmatchingFile = MockFileSystem.Normalize(nonmatchingFile); - if (String.Compare(normalizedFile, normalizedNonmatchingFile, StringComparison.OrdinalIgnoreCase) == 0) - { - ++timesFound; - } - } - Assertion.Assert(String.Format("Expected not to match file '{0}' but did.", nonmatchingFile), timesFound == 0); - } - } - - // Check untouchable files. - Assertion.Assert("At least one file that was marked untouchable was referenced.", mockFileSystem.FileHits3 == 0); - } - - - - /// - /// Simulate GetFileSystemEntries - /// - /// - /// - /// Array of matching file system entries (can be empty). - private static string[] GetFileSystemEntriesLoopBack(FileMatcher.FileSystemEntity entityType, string path, string pattern, string projectDirectory, bool stripProjectDirectory) - { - return new string[] { Path.Combine(path, pattern) }; - } - - /************************************************************************************* - * Validate that SplitFileSpec(...) is returning the expected constituent values. - *************************************************************************************/ - - private static void ValidateSplitFileSpec - ( - string filespec, - string expectedFixedDirectoryPart, - string expectedWildcardDirectoryPart, - string expectedFilenamePart - ) - { - string fixedDirectoryPart; - string wildcardDirectoryPart; - string filenamePart; - FileMatcher.SplitFileSpec - ( - filespec, - out fixedDirectoryPart, - out wildcardDirectoryPart, - out filenamePart, - new FileMatcher.GetFileSystemEntries(GetFileSystemEntriesLoopBack) - ); - - if - ( - expectedWildcardDirectoryPart!=wildcardDirectoryPart - || expectedFixedDirectoryPart!=fixedDirectoryPart - || expectedFilenamePart!=filenamePart - ) - { - Console.WriteLine("Expect Fixed '{0}' got '{1}'", expectedFixedDirectoryPart, fixedDirectoryPart); - Console.WriteLine("Expect Wildcard '{0}' got '{1}'", expectedWildcardDirectoryPart, wildcardDirectoryPart); - Console.WriteLine("Expect Filename '{0}' got '{1}'", expectedFilenamePart, filenamePart); - Assertion.Assert("FileMatcher Regression: Failure while validating SplitFileSpec.", false); - } - } - - /************************************************************************************* - * Given a pattern (filespec) and a candidate filename (fileToMatch). Verify that they - * do indeed match. - *************************************************************************************/ - private static void ValidateFileMatch - ( - string filespec, - string fileToMatch, - bool shouldBeRecursive - ) - { - ValidateFileMatch(filespec, fileToMatch, shouldBeRecursive, /* Simulate filesystem? */ true); - } - - /************************************************************************************* - * Given a pattern (filespec) and a candidate filename (fileToMatch). Verify that they - * do indeed match. - *************************************************************************************/ - private static void ValidateFileMatch - ( - string filespec, - string fileToMatch, - bool shouldBeRecursive, - bool fileSystemSimulation - ) - { - if (!IsFileMatchAssertIfIllegal(filespec, fileToMatch, shouldBeRecursive)) - { - Assertion.Assert("FileMatcher Regression: Failure while validating that files match.", false); - } - - // Now, simulate a filesystem with only fileToMatch. Make sure the file exists that way. - if (fileSystemSimulation) - { - MatchDriver - ( - filespec, - new string[] { fileToMatch }, - null, - null - ); - } - } - - /************************************************************************************* - * Given a pattern (filespec) and a candidate filename (fileToMatch). Verify that they - * DON'T match. - *************************************************************************************/ - private static void ValidateNoFileMatch - ( - string filespec, - string fileToMatch, - bool shouldBeRecursive - ) - { - if (IsFileMatchAssertIfIllegal(filespec, fileToMatch, shouldBeRecursive)) - { - Assertion.Assert("FileMatcher Regression: Failure while validating that files don't match.", false); - } - - // Now, simulate a filesystem with only fileToMatch. Make sure the file doesn't exist that way. - MatchDriver - ( - filespec, - null, - new string[] { fileToMatch }, - null - ); - } - - /************************************************************************************* - * Verify that the given filespec is illegal. - *************************************************************************************/ - private static void ValidateIllegal - ( - string filespec - ) - { - - Regex regexFileMatch; - bool needsRecursion; - bool isLegalFileSpec; - FileMatcher.GetFileSpecInfo - ( - filespec, - out regexFileMatch, - out needsRecursion, - out isLegalFileSpec, - new FileMatcher.GetFileSystemEntries(GetFileSystemEntriesLoopBack) - ); - - if (isLegalFileSpec) - { - Assertion.Assert("FileMatcher Regression: Expected an illegal filespec, but got a legal one.", false); - } - - // Now, FileMatcher is supposed to take any legal file name and just return it immediately. - // Let's see if it does. - MatchDriver - ( - filespec, // Not legal. - new string[] { filespec }, // Should match - null, - null - ); - - } - /************************************************************************************* - * Given a pattern (filespec) and a candidate filename (fileToMatch) return true if - * FileMatcher would say that they match. - *************************************************************************************/ - private static bool IsFileMatchAssertIfIllegal - ( - string filespec, - string fileToMatch, - bool shouldBeRecursive - ) - { - FileMatcher.Result match = FileMatcher.Default.FileMatch(filespec, fileToMatch); - - if (!match.isLegalFileSpec) - { - Console.WriteLine("Checking FileSpec: '{0}' against '{1}'", filespec, fileToMatch); - Assertion.Assert("FileMatcher Regression: Invalid filespec.", false); - } - if (shouldBeRecursive != match.isFileSpecRecursive) - { - Console.WriteLine("Checking FileSpec: '{0}' against '{1}'", filespec, fileToMatch); - Assertion.Assert("FileMatcher Regression: Match was recursive when it shouldn't be.", shouldBeRecursive ); - Assertion.Assert("FileMatcher Regression: Match was not recursive when it should have been.", !shouldBeRecursive); - } - return match.isMatch; - } - - - -#endregion - } -} - - - - - diff --git a/src/Deprecated/Engine/Shared/UnitTests/FileUtilities_Tests.cs b/src/Deprecated/Engine/Shared/UnitTests/FileUtilities_Tests.cs deleted file mode 100644 index 8237c76152d..00000000000 --- a/src/Deprecated/Engine/Shared/UnitTests/FileUtilities_Tests.cs +++ /dev/null @@ -1,305 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections; -using System.Diagnostics; -using NUnit.Framework; -using System.Text; - -using Microsoft.Build.BuildEngine.Shared; -using System.IO; - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class FileUtilities_Tests - { - /// - /// Exercises FileUtilities.GetItemSpecModifier - /// - /// SumedhK - [Test] - public void GetItemSpecModifier() - { - TestGetItemSpecModifier(Environment.CurrentDirectory); - TestGetItemSpecModifier(null); - } - - private static void TestGetItemSpecModifier(string currentDirectory) - { - Hashtable cache = null; - string modifier = FileUtilities.GetItemSpecModifier(currentDirectory, "foobar", FileUtilities.ItemSpecModifiers.RecursiveDir, ref cache); - Assertion.AssertEquals(String.Empty, modifier); - // cache should be created for constant modifiers - Assertion.AssertNotNull(cache); - - cache = null; - modifier = FileUtilities.GetItemSpecModifier(currentDirectory, "foobar", FileUtilities.ItemSpecModifiers.ModifiedTime, ref cache); - Assertion.AssertEquals(String.Empty, modifier); - // cache shouldn't be created for volatile modifiers - Assertion.AssertNull(cache); - - cache = null; - modifier = FileUtilities.GetItemSpecModifier(currentDirectory, @"foo\bar", FileUtilities.ItemSpecModifiers.RelativeDir, ref cache); - Assertion.AssertEquals(@"foo\", modifier); - Assertion.AssertNotNull(cache); - Assertion.AssertEquals(modifier, cache[FileUtilities.ItemSpecModifiers.RelativeDir]); - // confirm we get the same thing back the second time - modifier = FileUtilities.GetItemSpecModifier(currentDirectory, @"foo\bar", FileUtilities.ItemSpecModifiers.RelativeDir, ref cache); - Assertion.AssertEquals(@"foo\", modifier); - Assertion.AssertNotNull(cache); - Assertion.AssertEquals(modifier, cache[FileUtilities.ItemSpecModifiers.RelativeDir]); - - cache = null; - modifier = FileUtilities.GetItemSpecModifier(currentDirectory, @"c:\foo.txt", FileUtilities.ItemSpecModifiers.FullPath, ref cache); - Assertion.AssertEquals(@"c:\foo.txt", modifier); - - modifier = FileUtilities.GetItemSpecModifier(currentDirectory, @"c:\foo.txt", FileUtilities.ItemSpecModifiers.RootDir, ref cache); - Assertion.AssertEquals(@"c:\", modifier); - - modifier = FileUtilities.GetItemSpecModifier(currentDirectory, @"c:\foo.txt", FileUtilities.ItemSpecModifiers.Filename, ref cache); - Assertion.AssertEquals(@"foo", modifier); - - modifier = FileUtilities.GetItemSpecModifier(currentDirectory, @"c:\foo.txt", FileUtilities.ItemSpecModifiers.Extension, ref cache); - Assertion.AssertEquals(@".txt", modifier); - - modifier = FileUtilities.GetItemSpecModifier(currentDirectory, @"c:\foo.txt", FileUtilities.ItemSpecModifiers.Directory, ref cache); - Assertion.AssertEquals(String.Empty, modifier); - - modifier = FileUtilities.GetItemSpecModifier(currentDirectory, @"c:\foo.txt", FileUtilities.ItemSpecModifiers.Identity, ref cache); - Assertion.AssertEquals(@"c:\foo.txt", modifier); - } - - /// - /// Exercises FileUtilities.GetItemSpecModifier on a bad path. - /// - /// SumedhK - [Test] - [ExpectedException(typeof(InvalidOperationException))] - public void GetItemSpecModifierOnBadPath() - { - TestGetItemSpecModifierOnBadPath(Environment.CurrentDirectory); - } - - /// - /// Exercises FileUtilities.GetItemSpecModifier on a bad path. - /// - [Test] - [ExpectedException(typeof(InvalidOperationException))] - public void GetItemSpecModifierOnBadPath2() - { - TestGetItemSpecModifierOnBadPath(null); - } - - private static void TestGetItemSpecModifierOnBadPath(string currentDirectory) - { - try - { - Hashtable cache = null; - string modifier = FileUtilities.GetItemSpecModifier(currentDirectory, @"http://www.microsoft.com", FileUtilities.ItemSpecModifiers.RootDir, ref cache); - } - catch (Exception e) - { - // so I can see the exception message in NUnit's "Standard Out" window - Console.WriteLine(e.Message); - throw; - } - } - - [Test] - public void GetFileInfoNoThrowBasic() - { - string file = null; - try - { - file = Path.GetTempFileName(); - FileInfo info = FileUtilities.GetFileInfoNoThrow(file); - Assertion.Assert(info.LastWriteTime == new FileInfo(file).LastWriteTime); - } - finally - { - if (file != null) File.Delete(file); - } - } - - [Test] - public void GetFileInfoNoThrowNonexistent() - { - FileInfo info = FileUtilities.GetFileInfoNoThrow("this_file_is_nonexistent"); - Assertion.Assert(info == null); - } - - /// - /// Exercises FileUtilities.EndsWithSlash - /// - /// SumedhK - [Test] - public void EndsWithSlash() - { - Assertion.Assert(FileUtilities.EndsWithSlash(@"C:\foo\")); - Assertion.Assert(FileUtilities.EndsWithSlash(@"C:\")); - Assertion.Assert(FileUtilities.EndsWithSlash(@"\")); - - Assertion.Assert(FileUtilities.EndsWithSlash(@"http://www.microsoft.com/")); - Assertion.Assert(FileUtilities.EndsWithSlash(@"//server/share/")); - Assertion.Assert(FileUtilities.EndsWithSlash(@"/")); - - Assertion.Assert(!FileUtilities.EndsWithSlash(@"C:\foo")); - Assertion.Assert(!FileUtilities.EndsWithSlash(@"C:")); - Assertion.Assert(!FileUtilities.EndsWithSlash(@"foobar")); - - // confirm that empty string doesn't barf - Assertion.Assert(!FileUtilities.EndsWithSlash(String.Empty)); - } - - /// - /// Exercises FileUtilities.GetDirectory - /// - /// SumedhK - [Test] - public void GetDirectoryWithTrailingSlash() - { - Assertion.AssertEquals(@"c:\", FileUtilities.GetDirectory(@"c:\")); - Assertion.AssertEquals(@"c:\", FileUtilities.GetDirectory(@"c:\foo")); - Assertion.AssertEquals(@"c:", FileUtilities.GetDirectory(@"c:")); - Assertion.AssertEquals(@"\", FileUtilities.GetDirectory(@"\")); - Assertion.AssertEquals(@"\", FileUtilities.GetDirectory(@"\foo")); - Assertion.AssertEquals(@"..\", FileUtilities.GetDirectory(@"..\foo")); - Assertion.AssertEquals(@"\foo\", FileUtilities.GetDirectory(@"\foo\")); - Assertion.AssertEquals(@"\\server\share", FileUtilities.GetDirectory(@"\\server\share")); - Assertion.AssertEquals(@"\\server\share\", FileUtilities.GetDirectory(@"\\server\share\")); - Assertion.AssertEquals(@"\\server\share\", FileUtilities.GetDirectory(@"\\server\share\file")); - Assertion.AssertEquals(@"\\server\share\directory\", FileUtilities.GetDirectory(@"\\server\share\directory\")); - Assertion.AssertEquals(@"foo\", FileUtilities.GetDirectory(@"foo\bar")); - Assertion.AssertEquals(@"\foo\bar\", FileUtilities.GetDirectory(@"\foo\bar\")); - Assertion.AssertEquals(String.Empty, FileUtilities.GetDirectory("foobar")); - } - - /// - /// Exercises FileUtilities.HasExtension - /// - /// RGoel - [Test] - public void HasExtension() - { - Assertion.Assert("test 1", FileUtilities.HasExtension("foo.txt", new string[] {".EXE", ".TXT"})); - Assertion.Assert("test 2", !FileUtilities.HasExtension("foo.txt", new string[] {".EXE", ".DLL"})); - } - - /// - /// Exercises FileUtilities.EnsureTrailingSlash - /// - /// RGoel - [Test] - public void EnsureTrailingSlash() - { - // Doesn't have a trailing slash to start with. - Assertion.AssertEquals("test 1", @"foo\bar\", FileUtilities.EnsureTrailingSlash(@"foo\bar")); - Assertion.AssertEquals("test 2", @"foo/bar\", FileUtilities.EnsureTrailingSlash(@"foo/bar")); - - // Already has a trailing slash to start with. - Assertion.AssertEquals("test 3", @"foo/bar/", FileUtilities.EnsureTrailingSlash(@"foo/bar/")); - Assertion.AssertEquals("test 4", @"foo\bar\", FileUtilities.EnsureTrailingSlash(@"foo\bar\")); - Assertion.AssertEquals("test 5", @"foo/bar\", FileUtilities.EnsureTrailingSlash(@"foo/bar\")); - Assertion.AssertEquals("test 5", @"foo\bar/", FileUtilities.EnsureTrailingSlash(@"foo\bar/")); - } - - /// - /// Exercises FileUtilities.IsItemSpecModifier - /// - [Test] - public void IsItemSpecModifier() - { - // Positive matches using exact case. - Assertion.Assert("test 1", FileUtilities.IsItemSpecModifier("FullPath")); - Assertion.Assert("test 2", FileUtilities.IsItemSpecModifier("RootDir")); - Assertion.Assert("test 3", FileUtilities.IsItemSpecModifier("Filename")); - Assertion.Assert("test 4", FileUtilities.IsItemSpecModifier("Extension")); - Assertion.Assert("test 5", FileUtilities.IsItemSpecModifier("RelativeDir")); - Assertion.Assert("test 6", FileUtilities.IsItemSpecModifier("Directory")); - Assertion.Assert("test 7", FileUtilities.IsItemSpecModifier("RecursiveDir")); - Assertion.Assert("test 8", FileUtilities.IsItemSpecModifier("Identity")); - Assertion.Assert("test 9", FileUtilities.IsItemSpecModifier("ModifiedTime")); - Assertion.Assert("test 10", FileUtilities.IsItemSpecModifier("CreatedTime")); - Assertion.Assert("test 11", FileUtilities.IsItemSpecModifier("AccessedTime")); - - // Positive matches using different case. - Assertion.Assert("test 21", FileUtilities.IsItemSpecModifier("fullPath")); - Assertion.Assert("test 22", FileUtilities.IsItemSpecModifier("rootDir")); - Assertion.Assert("test 23", FileUtilities.IsItemSpecModifier("filename")); - Assertion.Assert("test 24", FileUtilities.IsItemSpecModifier("extension")); - Assertion.Assert("test 25", FileUtilities.IsItemSpecModifier("relativeDir")); - Assertion.Assert("test 26", FileUtilities.IsItemSpecModifier("directory")); - Assertion.Assert("test 27", FileUtilities.IsItemSpecModifier("recursiveDir")); - Assertion.Assert("test 28", FileUtilities.IsItemSpecModifier("identity")); - Assertion.Assert("test 29", FileUtilities.IsItemSpecModifier("modifiedTime")); - Assertion.Assert("test 30", FileUtilities.IsItemSpecModifier("createdTime")); - Assertion.Assert("test 31", FileUtilities.IsItemSpecModifier("accessedTime")); - - // Negative tests to get maximum code coverage inside the many many different branches - // of FileUtilities.IsItemSpecModifier. - Assertion.Assert("test 41", !FileUtilities.IsItemSpecModifier("rootxxx")); - Assertion.Assert("test 42", !FileUtilities.IsItemSpecModifier("Rootxxx")); - Assertion.Assert("test 43", !FileUtilities.IsItemSpecModifier("xxxxxxx")); - - Assertion.Assert("test 44", !FileUtilities.IsItemSpecModifier("filexxxx")); - Assertion.Assert("test 45", !FileUtilities.IsItemSpecModifier("Filexxxx")); - Assertion.Assert("test 46", !FileUtilities.IsItemSpecModifier("idenxxxx")); - Assertion.Assert("test 47", !FileUtilities.IsItemSpecModifier("Idenxxxx")); - Assertion.Assert("test 48", !FileUtilities.IsItemSpecModifier("xxxxxxxx")); - - Assertion.Assert("test 49", !FileUtilities.IsItemSpecModifier("extenxxxx")); - Assertion.Assert("test 50", !FileUtilities.IsItemSpecModifier("Extenxxxx")); - Assertion.Assert("test 51", !FileUtilities.IsItemSpecModifier("direcxxxx")); - Assertion.Assert("test 52", !FileUtilities.IsItemSpecModifier("Direcxxxx")); - Assertion.Assert("test 53", !FileUtilities.IsItemSpecModifier("xxxxxxxxx")); - - Assertion.Assert("test 54", !FileUtilities.IsItemSpecModifier("xxxxxxxxxx")); - - Assertion.Assert("test 55", !FileUtilities.IsItemSpecModifier("relativexxx")); - Assertion.Assert("test 56", !FileUtilities.IsItemSpecModifier("Relativexxx")); - Assertion.Assert("test 57", !FileUtilities.IsItemSpecModifier("createdxxxx")); - Assertion.Assert("test 58", !FileUtilities.IsItemSpecModifier("Createdxxxx")); - Assertion.Assert("test 59", !FileUtilities.IsItemSpecModifier("xxxxxxxxxxx")); - - Assertion.Assert("test 60", !FileUtilities.IsItemSpecModifier("recursivexxx")); - Assertion.Assert("test 61", !FileUtilities.IsItemSpecModifier("Recursivexxx")); - Assertion.Assert("test 62", !FileUtilities.IsItemSpecModifier("accessedxxxx")); - Assertion.Assert("test 63", !FileUtilities.IsItemSpecModifier("Accessedxxxx")); - Assertion.Assert("test 64", !FileUtilities.IsItemSpecModifier("modifiedxxxx")); - Assertion.Assert("test 65", !FileUtilities.IsItemSpecModifier("Modifiedxxxx")); - Assertion.Assert("test 66", !FileUtilities.IsItemSpecModifier("xxxxxxxxxxxx")); - - Assertion.Assert("test 67", !FileUtilities.IsItemSpecModifier(null)); - } - - [Test] - public void CheckDerivableItemSpecModifiers() - { - Assertion.Assert(FileUtilities.IsDerivableItemSpecModifier("Filename")); - Assertion.Assert(!FileUtilities.IsDerivableItemSpecModifier("RecursiveDir")); - Assertion.Assert(!FileUtilities.IsDerivableItemSpecModifier("recursivedir")); - } - - [Test] - public void GetExecutablePath() - { - StringBuilder sb = new StringBuilder(NativeMethods.MAX_PATH); - NativeMethods.GetModuleFileName(NativeMethods.NullHandleRef, sb, sb.Capacity); - string path = sb.ToString(); - - string configPath = FileUtilities.CurrentExecutableConfigurationFilePath; - string directoryName = FileUtilities.CurrentExecutableDirectory; - string executablePath = FileUtilities.CurrentExecutablePath; - Assert.IsTrue(string.Compare(configPath, executablePath + ".config", StringComparison.OrdinalIgnoreCase) == 0); - Assert.IsTrue(string.Compare(path, executablePath, StringComparison.OrdinalIgnoreCase) == 0); - Assert.IsTrue(string.Compare(directoryName, Path.GetDirectoryName(path), StringComparison.OrdinalIgnoreCase) == 0); - - } - } -} diff --git a/src/Deprecated/Engine/Shared/UnitTests/MockEngine.cs b/src/Deprecated/Engine/Shared/UnitTests/MockEngine.cs deleted file mode 100644 index 6c955fb201c..00000000000 --- a/src/Deprecated/Engine/Shared/UnitTests/MockEngine.cs +++ /dev/null @@ -1,369 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.IO; -using System.Resources; -using System.Reflection; -using System.Collections; -using System.Globalization; -using NUnit.Framework; -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine; - -namespace Microsoft.Build.UnitTests -{ - /*************************************************************************** - * - * Class: MockEngine - * Owner: RGoel - * - * In order to execute tasks, we have to pass in an Engine object, so the - * task can log events. It doesn't have to be the real Engine object, just - * something that implements the IBuildEngine2 interface. So, we mock up - * a fake engine object here, so we're able to execute tasks from the unit tests. - * - * The unit tests could have instantiated the real Engine object, but then - * we would have had to take a reference onto the Microsoft.Build.Engine assembly, which - * is somewhat of a no-no for task assemblies. - * - **************************************************************************/ - sealed internal class MockEngine : IBuildEngine2 - { - private bool isRunningMultipleNodes; - private int messages = 0; - private int warnings = 0; - private int errors = 0; - private string log = ""; - private string upperLog = null; - private Engine engine; - private bool logToConsole = false; - private MockLogger mockLogger = null; - private BuildPropertyGroup engineGlobalProperties; - - internal MockEngine() :this(false) - { - } - - internal int Messages - { - set { messages = value; } - get { return messages; } - } - - internal int Warnings - { - set {warnings = value;} - get {return warnings;} - } - - internal int Errors - { - set { errors = value; } - get { return errors; } - } - - public MockEngine(bool logToConsole) - { - mockLogger = new MockLogger(); - this.logToConsole = logToConsole; - this.engine = new Engine(Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().EscapedCodeBase).LocalPath)); - this.engine.RegisterLogger(new ConsoleLogger()); - this.engine.RegisterLogger(mockLogger); - engineGlobalProperties = new BuildPropertyGroup(); - } - - - public void LogErrorEvent(BuildErrorEventArgs eventArgs) - { - if (eventArgs.File != null && eventArgs.File.Length > 0) - { - if (logToConsole) - Console.Write("{0}({1},{2}): ", eventArgs.File, eventArgs.LineNumber, eventArgs.ColumnNumber); - } - - if (logToConsole) - Console.Write("ERROR: "); - log += "ERROR: "; - if (logToConsole) - Console.Write("ERROR " + eventArgs.Code + ": "); - log += "ERROR " + eventArgs.Code + ": "; - ++errors; - - if (logToConsole) - Console.WriteLine(eventArgs.Message); - log += eventArgs.Message; - log += "\n"; - } - - public void LogWarningEvent(BuildWarningEventArgs eventArgs) - { - if (eventArgs.File != null && eventArgs.File.Length > 0) - { - if (logToConsole) - Console.Write("{0}({1},{2}): ", eventArgs.File, eventArgs.LineNumber, eventArgs.ColumnNumber); - } - - if (logToConsole) - Console.Write("WARNING " + eventArgs.Code + ": "); - log += "WARNING " + eventArgs.Code + ": "; - ++warnings; - - if (logToConsole) - Console.WriteLine(eventArgs.Message); - log += eventArgs.Message; - log += "\n"; - } - - public void LogCustomEvent(CustomBuildEventArgs eventArgs) - { - if (logToConsole) - Console.WriteLine(eventArgs.Message); - log += eventArgs.Message; - log += "\n"; - } - - public void LogMessageEvent(BuildMessageEventArgs eventArgs) - { - if (logToConsole) - Console.WriteLine(eventArgs.Message); - log += eventArgs.Message; - log += "\n"; - ++messages; - } - - public bool ContinueOnError - { - get - { - return false; - } - } - - public string ProjectFileOfTaskNode - { - get - { - return String.Empty; - } - } - - public int LineNumberOfTaskNode - { - get - { - return 0; - } - } - - public int ColumnNumberOfTaskNode - { - get - { - return 0; - } - } - - public BuildPropertyGroup GlobalProperties - { - set { engineGlobalProperties = value; } - get { return engineGlobalProperties; } - } - - internal string Log - { - set { log = value; } - get { return log; } - } - - public bool IsRunningMultipleNodes - { - get { return isRunningMultipleNodes; } - set { isRunningMultipleNodes = value; } - } - - public bool BuildProjectFile - ( - string projectFileName, - string[] targetNames, - IDictionary globalPropertiesPassedIntoTask, - IDictionary targetOutputs - ) - { - return this.BuildProjectFile(projectFileName, targetNames, globalPropertiesPassedIntoTask, targetOutputs, null); - } - - public bool BuildProjectFile - ( - string projectFileName, - string[] targetNames, - IDictionary globalPropertiesPassedIntoTask, - IDictionary targetOutputs, - string toolsVersion - ) - { - BuildPropertyGroup finalGlobalProperties = new BuildPropertyGroup(); - - // Finally, whatever global properties were passed into the task ... those are the final winners. - if (globalPropertiesPassedIntoTask != null) - { - foreach (DictionaryEntry newGlobalProperty in globalPropertiesPassedIntoTask) - { - finalGlobalProperties.SetProperty((string)newGlobalProperty.Key, - (string)newGlobalProperty.Value); - } - } - - return engine.BuildProjectFile(projectFileName, targetNames, finalGlobalProperties, targetOutputs, BuildSettings.None, toolsVersion); - } - - public bool BuildProjectFilesInParallel - ( - string[] projectFileNames, - string[] targetNames, - IDictionary[] globalProperties, - IDictionary[] targetOutputsPerProject, - string[] toolsVersion, - bool useResultsCache, - bool unloadProjectsOnCompletion - ) - { - engine.GlobalProperties = GlobalProperties; - - bool allSucceeded = true; - for (int i = 0; i < projectFileNames.Length; i++) - { - - BuildPropertyGroup finalGlobalProperties = null; - if (globalProperties[i] != null) - { - finalGlobalProperties = new BuildPropertyGroup(); - foreach (DictionaryEntry newGlobalProperty in globalProperties[i]) - { - finalGlobalProperties.SetProperty((string)newGlobalProperty.Key, - (string)newGlobalProperty.Value); - } - } - bool success = engine.BuildProjectFile((string)projectFileNames[i], targetNames, finalGlobalProperties, targetOutputsPerProject[i]); - allSucceeded = allSucceeded && success; - } - return allSucceeded; - } - - public bool BuildProjectFile - ( - string projectFileName - ) - { - engine.GlobalProperties = GlobalProperties; - return engine.BuildProjectFile(projectFileName); - } - - public bool BuildProjectFile - ( - string projectFileName, - string[] targetNames - ) - { - engine.GlobalProperties = GlobalProperties; - return engine.BuildProjectFile(projectFileName, targetNames); - } - - public bool BuildProjectFile - ( - string projectFileName, - string targetName - ) - { - engine.GlobalProperties = GlobalProperties; - return engine.BuildProjectFile(projectFileName, targetName); - } - - public bool BuildProjectFile - ( - string projectFile, - string[] targetNames, - BuildPropertyGroup globalProperties - ) - { - return engine.BuildProjectFile(projectFile, targetNames, globalProperties); - } - - public void UnregisterAllLoggers - ( - ) - { - engine.UnregisterAllLoggers(); - } - - public void UnloadAllProjects - ( - ) - { - engine.UnloadAllProjects(); - } - - /// - /// Assert that the log file contains the given string. - /// Case insensitive. - /// First check if the string is in the log string. If not - /// than make sure it is also check the MockLogger - /// - /// - internal void AssertLogContains(string contains) - { - if (upperLog == null) - { - upperLog = log; - upperLog = upperLog.ToUpperInvariant(); - } - - // If we do not contain this string than pass it to - // MockLogger. Since MockLogger is also registered as - // a logger it may have this string. - if (!upperLog.Contains - ( - contains.ToUpperInvariant() - ) - ) - { - mockLogger.AssertLogContains(contains); - } - } - - /// - /// Assert that the log doesnt contain the given string. - /// First check if the string is in the log string. If not - /// than make sure it is also not in the MockLogger - /// - /// - internal void AssertLogDoesntContain(string contains) - { - if (upperLog == null) - { - upperLog = log; - upperLog = upperLog.ToUpperInvariant(); - } - - Assertion.Assert - ( - !upperLog.Contains - ( - contains.ToUpperInvariant() - ) - ); - - // If we do not contain this string than pass it to - // MockLogger. Since MockLogger is also registered as - // a logger it may have this string. - mockLogger.AssertLogDoesntContain - ( - contains - ); - } - } -} diff --git a/src/Deprecated/Engine/Shared/UnitTests/MockLogger.cs b/src/Deprecated/Engine/Shared/UnitTests/MockLogger.cs deleted file mode 100644 index 91576965afd..00000000000 --- a/src/Deprecated/Engine/Shared/UnitTests/MockLogger.cs +++ /dev/null @@ -1,313 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.IO; -using System.Xml; -using System.Resources; -using System.Globalization; -using System.Text; -using Microsoft.Build.BuildEngine; -using NUnit.Framework; -using System.Collections; -using System.Collections.Generic; -using Microsoft.Build.Framework; - - -namespace Microsoft.Build.UnitTests -{ - /* - * Class: MockLogger - * Owner: jomof - * - * Mock logger class. Keeps track of errors and warnings and also builds - * up a raw string (fullLog) that contains all messages, warnings, errors. - * - */ - internal sealed class MockLogger : ILogger - { -#region Properties - private int errorCount = 0; - private int warningCount = 0; - private StringBuilder fullLog = new StringBuilder(); - private List errors = new List(); - private List warnings = new List(); - private List externalProjectStartedEvents = new List(); - private List externalProjectFinishedEvents = new List(); - - /* - * Method: ErrorCount - * Owner: jomof - * - * The count of all errors seen so far. - * - */ - internal int ErrorCount - { - get { return this.errorCount; } - } - - /* - * Method: WarningCount - * Owner: jomof - * - * The count of all warnings seen so far. - * - */ - internal int WarningCount - { - get { return this.warningCount; } - } - - /// - /// Return the list of logged errors - /// - /// LukaszG - internal List Errors - { - get - { - return this.errors; - } - } - - /// - /// Returns the list of logged warnings - /// - /// LukaszG - internal List Warnings - { - get - { - return this.warnings; - } - } - - /// - /// List of ExternalProjectStarted events - /// - internal List ExternalProjectStartedEvents - { - get { return this.externalProjectStartedEvents; } - } - - /// - /// List of ExternalProjectFinished events - /// - internal List ExternalProjectFinishedEvents - { - get { return this.externalProjectFinishedEvents; } - } - - /* - * Method: FullLog - * Owner: jomof - * - * The raw concatenation of all messages, errors and warnings seen so far. - * - */ - internal string FullLog - { - get { return this.fullLog.ToString(); } - } -#endregion - -#region Minimal ILogger implementation - - /* - * Property: Verbosity - * Owner: SumedhK - * - * The level of detail to show in the event log. - * - */ - public LoggerVerbosity Verbosity - { - get {return LoggerVerbosity.Normal;} - set {/* do nothing */} - } - - /* - * Property: Parameters - * Owner: SumedhK - * - * The mock logger does not take parameters. - * - */ - public string Parameters - { - get - { - return null; - } - - set - { - // do nothing - } - } - - /* - * Method: Initialize - * Owner: jomof - * - * Add a new build event. - * - */ - public void Initialize(IEventSource eventSource) - { - eventSource.AnyEventRaised += - new AnyEventHandler(LoggerEventHandler); - } - - /// - /// Clears the content of the log "file" - /// - public void ClearLog() - { - this.fullLog = new StringBuilder(); - } - - /* - * Method: Shutdown - * Owner: SumedhK - * - * The mock logger does not need to release any resources. - * - */ - public void Shutdown() - { - // do nothing - } -#endregion - - /* - * Method: LoggerEventHandler - * Owner: jomof - * - * Recieves build events and logs them the way we like. - * - */ - internal void LoggerEventHandler(object sender, BuildEventArgs eventArgs) - { - if (eventArgs is BuildWarningEventArgs) - { - BuildWarningEventArgs w = (BuildWarningEventArgs) eventArgs; - - // hack: disregard the MTA warning. - // need the second condition to pass on ploc builds - if (w.Code != "MSB4056" && !w.Message.Contains("MSB4056")) - { - fullLog.AppendFormat("{0}({1},{2}): {3} warning {4}: {5}\r\n", - w.File, - w.LineNumber, - w.ColumnNumber, - w.Subcategory, - w.Code, - w.Message); - - ++warningCount; - this.warnings.Add(w); - } - } - else if (eventArgs is BuildErrorEventArgs) - { - BuildErrorEventArgs e = (BuildErrorEventArgs) eventArgs; - - fullLog.AppendFormat("{0}({1},{2}): {3} error {4}: {5}\r\n", - e.File, - e.LineNumber, - e.ColumnNumber, - e.Subcategory, - e.Code, - e.Message); - - ++errorCount; - this.errors.Add(e); - } - else - { - fullLog.Append(eventArgs.Message); - fullLog.Append("\r\n"); - } - - if (eventArgs is ExternalProjectStartedEventArgs) - { - this.ExternalProjectStartedEvents.Add((ExternalProjectStartedEventArgs)eventArgs); - } - else if (eventArgs is ExternalProjectFinishedEventArgs) - { - this.ExternalProjectFinishedEvents.Add((ExternalProjectFinishedEventArgs)eventArgs); - } - - if (eventArgs is BuildFinishedEventArgs) - { - // Console.Write in the context of a unit test is very expensive. A hundred - // calls to Console.Write can easily take two seconds on a fast machine. Therefore, only - // do the Console.Write once at the end of the build. - Console.Write(FullLog); - } - } - - // Lazy-init property returning the MSBuild engine resource manager - static private ResourceManager EngineResourceManager - { - get - { - if (engineResourceManager == null) - { - engineResourceManager = new ResourceManager("Microsoft.Build.Engine.Resources.Strings", typeof(Engine).Assembly); - } - - return engineResourceManager; - } - } - - static private ResourceManager engineResourceManager = null; - - // Gets the resource string given the resource ID - static public string GetString(string stringId) - { - return EngineResourceManager.GetString(stringId, CultureInfo.CurrentUICulture); - } - - /// - /// Assert that the log file contains the given strings, in order. - /// - /// - internal void AssertLogContains(params string[] contains) - { - StringReader reader = new StringReader(FullLog); - int index = 0; - string currentLine = reader.ReadLine(); - while(currentLine != null) - { - if (currentLine.Contains(contains[index])) - { - index++; - if (index == contains.Length) break; - } - currentLine = reader.ReadLine(); - } - if (index != contains.Length) - { - Assertion.Fail(String.Format(CultureInfo.CurrentCulture, "Log was expected to contain '{0}', but did not.\n=======\n" + FullLog + "\n=======", contains[index])); - } - } - - /// - /// Assert that the log file contains the given string. - /// - /// - internal void AssertLogDoesntContain(string contains) - { - Assertion.Assert( - String.Format("Log was not expected to contain '{0}', but did.", contains), - !FullLog.Contains(contains)); - } - } -} diff --git a/src/Deprecated/Engine/Shared/UnitTests/ObjectModelHelpers.cs b/src/Deprecated/Engine/Shared/UnitTests/ObjectModelHelpers.cs deleted file mode 100644 index 980d0451b44..00000000000 --- a/src/Deprecated/Engine/Shared/UnitTests/ObjectModelHelpers.cs +++ /dev/null @@ -1,934 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.IO; -using System.Xml; -using System.Text; -using System.Reflection; -using System.Collections; -using System.Text.RegularExpressions; -using System.Collections.Generic; -using System.Diagnostics; - -using NUnit.Framework; - -using Microsoft.Build.BuildEngine; -using Microsoft.Build.Framework; -using Microsoft.VisualStudio.Internal; - -namespace Microsoft.Build.UnitTests -{ - /* - * Class: ObjectModelHelpers - * Owner: jomof - * - * Utility methods for unit tests that work through the object model. - * - */ - public static class ObjectModelHelpers - { - private const string msbuildNamespace = "http://schemas.microsoft.com/developer/msbuild/2003"; - private const string msbuildDefaultToolsVersion = BrandNames.VSGeneralVersion; - private const string msbuildAssemblyVersion = BrandNames.VSGeneralAssemblyVersion; - - /// - /// Return the default tools version - /// - internal static string MSBuildDefaultToolsVersion - { - get - { - return msbuildDefaultToolsVersion; - } - - private set - { - } - } - - /// - /// Return the current assembly version - /// - internal static string MSBuildAssemblyVersion - { - get - { - return msbuildAssemblyVersion; - } - - private set - { - } - } - - /// - /// Helper method to tell us whether a particular metadata name is an MSBuild well-known metadata - /// (e.g., "RelativeDir", "FullPath", etc.) - /// - /// RGoel - private static Hashtable builtInMetadataNames = null; - static private bool IsBuiltInItemMetadataName(string metadataName) - { - if (builtInMetadataNames == null) - { - builtInMetadataNames = new Hashtable(); - - Microsoft.Build.Utilities.TaskItem dummyTaskItem = new Microsoft.Build.Utilities.TaskItem(); - foreach (string builtInMetadataName in dummyTaskItem.MetadataNames) - { - builtInMetadataNames[builtInMetadataName] = String.Empty; - } - } - - return builtInMetadataNames.Contains(metadataName); - } - - /// - /// Asserts that there are no items in the project of the specified type - /// - static internal void AssertNoItem(Project p, string type) - { - BuildItemGroup items = p.GetEvaluatedItemsByName(type); - Assertion.AssertEquals(0, items.Count); - } - - /// - /// Gets an item list from the project and assert that it contains - /// exactly one item with the supplied name. - /// - /// - /// - /// - /// JomoF - static internal BuildItem AssertSingleItem(Project p, string type, string itemInclude) - { - BuildItemGroup items = p.GetEvaluatedItemsByName(type); - int count = 0; - foreach(BuildItem item in items) - { - // This was item.Include before, but I believe it really should have been item.FinalItemSpec, which - // is what is actually used by tasks, etc. - Assertion.AssertEquals(itemInclude.ToUpperInvariant(), item.FinalItemSpec.ToUpperInvariant()); - ++count; - } - - Assertion.AssertEquals(1, count); - - return items[0]; - } - - /// - /// Given a hash table of ITaskItems, make sure there is exactly one - /// item and that the key is 'key' and the Value is an ITaskItem with - /// an item spec of 'itemSpec' - /// - /// - /// - /// - /// JomoF - static internal void AssertSingleItemInDictionary(IDictionary d, string expectedItemSpec) - { - List actualItems = new List(); - - string projectDir= Path.GetTempPath(); - Console.WriteLine("cd={0}", projectDir); - - foreach(DictionaryEntry e in d) - { - foreach(ITaskItem i in (ITaskItem[])e.Value) - { - i.ItemSpec = i.ItemSpec.Replace(projectDir, "<|proj|>"); - actualItems.Add(i); - } - } - - AssertItemsMatch(expectedItemSpec, actualItems.ToArray()); - } - - /// - /// Amazingly sophisticated :) helper function to determine if the set of ITaskItems returned from - /// a task match the expected set of ITaskItems. It can also check that the ITaskItems have the expected - /// metadata, and that the ITaskItems are returned in the correct order. - /// - /// The "expectedItemsString" is a formatted way of easily specifying which items you expect to see. - /// The format is: - /// - /// itemspec1 : metadataname1=metadatavalue1 ; metadataname2=metadatavalue2 ; ... - /// itemspec2 : metadataname3=metadatavalue3 ; metadataname4=metadatavalue4 ; ... - /// itemspec3 : metadataname5=metadatavalue5 ; metadataname6=metadatavalue6 ; ... - /// - /// (Each item needs to be on its own line.) - /// - /// - /// - /// - /// RGoel - static internal void AssertItemsMatch(string expectedItemsString, ITaskItem[] actualItems) - { - AssertItemsMatch(expectedItemsString, actualItems, true); - } - - /// - /// Amazingly sophisticated :) helper function to determine if the set of ITaskItems returned from - /// a task match the expected set of ITaskItems. It can also check that the ITaskItems have the expected - /// metadata, and that the ITaskItems are returned in the correct order. - /// - /// The "expectedItemsString" is a formatted way of easily specifying which items you expect to see. - /// The format is: - /// - /// itemspec1 : metadataname1=metadatavalue1 ; metadataname2=metadatavalue2 ; ... - /// itemspec2 : metadataname3=metadatavalue3 ; metadataname4=metadatavalue4 ; ... - /// itemspec3 : metadataname5=metadatavalue5 ; metadataname6=metadatavalue6 ; ... - /// - /// (Each item needs to be on its own line.) - /// - /// - /// - /// - /// - /// RGoel - static internal void AssertItemsMatch(string expectedItemsString, ITaskItem[] actualItems, bool orderOfItemsShouldMatch) - { - List expectedItems = ParseExpectedItemsString(expectedItemsString); - - // Form a string of expected item specs. For logging purposes only. - StringBuilder expectedItemSpecs = new StringBuilder(); - foreach (ITaskItem expectedItem in expectedItems) - { - if (expectedItemSpecs.Length > 0) - { - expectedItemSpecs.Append("; "); - } - - expectedItemSpecs.Append(expectedItem.ItemSpec); - } - - // Form a string of expected item specs. For logging purposes only. - StringBuilder actualItemSpecs = new StringBuilder(); - foreach (ITaskItem actualItem in actualItems) - { - if (actualItemSpecs.Length > 0) - { - actualItemSpecs.Append("; "); - } - - actualItemSpecs.Append(actualItem.ItemSpec); - } - - bool outOfOrder = false; - - // Loop through all the actual items. - for (int actualItemIndex = 0 ; actualItemIndex < actualItems.Length ; actualItemIndex++) - { - ITaskItem actualItem = actualItems[actualItemIndex]; - - // Loop through all the expected items to find one with the same item spec. - ITaskItem expectedItem = null; - int expectedItemIndex; - for (expectedItemIndex = 0 ; expectedItemIndex < expectedItems.Count ; expectedItemIndex++) - { - if (expectedItems[expectedItemIndex].ItemSpec == actualItem.ItemSpec) - { - expectedItem = expectedItems[expectedItemIndex]; - - // If the items are expected to be in the same order, then the expected item - // should always be found at index zero, because we remove items from the expected - // list as we find them. - if ((expectedItemIndex != 0) && (orderOfItemsShouldMatch)) - { - outOfOrder = true; - } - - break; - } - } - - Assertion.Assert(String.Format("Item '{0}' was returned but not expected.", actualItem.ItemSpec), expectedItem != null); - - // Make sure all the metadata on the expected item matches the metadata on the actual item. - // Don't check built-in metadata ... only check custom metadata. - foreach (string metadataName in expectedItem.MetadataNames) - { - // This check filters out any built-in item metadata, like "RelativeDir", etc. - if (!IsBuiltInItemMetadataName(metadataName)) - { - string expectedMetadataValue = expectedItem.GetMetadata(metadataName); - string actualMetadataValue = actualItem.GetMetadata(metadataName); - - Assertion.Assert(string.Format("Item '{0}' does not have expected metadata '{1}'.", actualItem.ItemSpec, metadataName), - actualMetadataValue.Length > 0 || expectedMetadataValue.Length == 0); - - Assertion.Assert(string.Format("Item '{0}' has unexpected metadata {1}={2}.", actualItem.ItemSpec, metadataName, actualMetadataValue), - actualMetadataValue.Length == 0 || expectedMetadataValue.Length > 0); - - Assertion.Assert(string.Format("Item '{0}' has metadata {1}={2} instead of expected {1}={3}.", - actualItem.ItemSpec, metadataName, actualMetadataValue, expectedMetadataValue), - actualMetadataValue == expectedMetadataValue); - } - } - expectedItems.RemoveAt(expectedItemIndex); - } - - // Log an error for any leftover items in the expectedItems collection. - foreach (ITaskItem expectedItem in expectedItems) - { - Assertion.Assert(String.Format("Item '{0}' was expected but not returned.", expectedItem.ItemSpec), false); - } - - if (outOfOrder) - { - Console.WriteLine("ERROR: Items were returned in the incorrect order..."); - Console.WriteLine("Expected: " + expectedItemSpecs); - Console.WriteLine("Actual: " + actualItemSpecs); - Assertion.Assert("Items were returned in the incorrect order. See 'Standard Out' tab for more details.", false); - } - } - - /// - /// Parses the different string passed into AssertItemsMatch and returns a list of ITaskItems. - /// - /// - /// - /// RGoel - static private List ParseExpectedItemsString(string expectedItemsString) - { - List expectedItems = new List(); - - // First, parse this massive string that we've been given, and create an ITaskItem[] out of it, - // so we can more easily compare it against the actual items. - string[] expectedItemsStringSplit = expectedItemsString.Split(new char[] {'\r', '\n'}, StringSplitOptions.RemoveEmptyEntries); - foreach (string singleExpectedItemString in expectedItemsStringSplit) - { - string singleExpectedItemStringTrimmed = singleExpectedItemString.Trim(); - if (singleExpectedItemStringTrimmed.Length > 0) - { - int indexOfColon = singleExpectedItemStringTrimmed.IndexOf(": "); - if (indexOfColon == -1) - { - expectedItems.Add(new Microsoft.Build.Utilities.TaskItem(singleExpectedItemStringTrimmed)); - } - else - { - // We found a colon, which means there's metadata in there. - - // The item spec is the part before the colon. - string itemSpec = singleExpectedItemStringTrimmed.Substring(0, indexOfColon).Trim(); - - // The metadata is the part after the colon. - string itemMetadataString = singleExpectedItemStringTrimmed.Substring(indexOfColon + 1); - - ITaskItem expectedItem = new Microsoft.Build.Utilities.TaskItem(itemSpec); - - string[] itemMetadataPieces = itemMetadataString.Split(new char[]{';'}, StringSplitOptions.RemoveEmptyEntries); - foreach (string itemMetadataPiece in itemMetadataPieces) - { - string itemMetadataPieceTrimmed = itemMetadataPiece.Trim(); - if (itemMetadataPieceTrimmed.Length > 0) - { - int indexOfEquals = itemMetadataPieceTrimmed.IndexOf('='); - Assertion.Assert(String.Format("Could not find in item metadata definition '{0}'", itemMetadataPieceTrimmed), indexOfEquals != -1); - - string itemMetadataName = itemMetadataPieceTrimmed.Substring(0, indexOfEquals).Trim(); - string itemMetadataValue = itemMetadataPieceTrimmed.Substring(indexOfEquals + 1).Trim(); - - expectedItem.SetMetadata(itemMetadataName, itemMetadataValue); - } - } - - expectedItems.Add(expectedItem); - } - } - } - - return expectedItems; - } - - /// - /// Does certain replacements in a string representing the project file contents. - /// This makes it easier to write unit tests because the author doesn't have - /// to worry about escaping double-quotes, etc. - /// - /// - /// - static internal string CleanupFileContents(string projectFileContents) - { - // Replace reverse-single-quotes with double-quotes. - projectFileContents = projectFileContents.Replace("`", "\""); - - // Place the correct MSBuild namespace into the tag. - projectFileContents = projectFileContents.Replace("msbuildnamespace", msbuildNamespace); - projectFileContents = projectFileContents.Replace("msbuilddefaulttoolsversion", msbuildDefaultToolsVersion); - projectFileContents = projectFileContents.Replace("msbuildassemblyversion", msbuildAssemblyVersion); - - return projectFileContents; - } - - /// - /// Normalizes all the whitespace in an Xml document so that two documents that - /// differ only in whitespace can be easily compared to each other for sameness. - /// - /// - /// - /// RGoel - static private string NormalizeXmlWhitespace(XmlDocument xmldoc) - { - // Normalize all the whitespace by writing the Xml document out to a - // string, with PreserveWhitespace=false. - xmldoc.PreserveWhitespace = false; - StringWriter stringWriter = new StringWriter(); - xmldoc.Save(stringWriter); - return stringWriter.ToString(); - } - - /// - /// Create an MSBuild project file on disk and return the full path to it. - /// - /// - /// - /// RGoel - static internal string CreateTempFileOnDisk(string fileContents, params object[] args) - { - return CreateTempFileOnDiskNoFormat(String.Format(fileContents, args)); - } - - /// - /// Create an MSBuild project file on disk and return the full path to it. - /// - /// - /// - /// RGoel - static internal string CreateTempFileOnDiskNoFormat(string fileContents) - { - string projectFilePath = Path.GetTempFileName(); - - File.WriteAllText(projectFilePath, CleanupFileContents(fileContents)); - - return projectFilePath; - } - - /// - /// Create a project in memory. Load up the given XML. - /// - /// - /// - /// JomoF - static internal Project CreateInMemoryProject(string xml) - { - return CreateInMemoryProject(xml, new ConsoleLogger()); - } - - /// - /// Create a project in memory. Load up the given XML. - /// - /// - /// - /// - /// JomoF - static internal Project CreateInMemoryProject(string xml, ILogger logger /* May be null */) - { - Engine e = new Engine(); - e.DefaultToolsVersion = "4.0"; - return CreateInMemoryProject(e, xml, logger); - } - - /// - /// Create an in-memory project and attach it to the passed-in engine. - /// - /// - /// - /// May be null - /// - static internal Project CreateInMemoryProject(Engine e, string xml, ILogger logger /* May be null */) - { - return CreateInMemoryProject(e, xml, logger, null); - } - - /// - /// Create an in-memory project and attach it to the passed-in engine. - /// - /// May be null - /// May be null - static internal Project CreateInMemoryProject(Engine e, string xml, ILogger logger /* May be null */, string toolsVersion/* may be null */) - { - return CreateInMemoryProject(e, xml, logger, toolsVersion, ProjectLoadSettings.None); - } - - /// - /// Create an in-memory project and attach it to the passed-in engine. - /// - /// May be null - /// May be null - static internal Project CreateInMemoryProject(Engine e, string xml, ILogger logger /* May be null */, string toolsVersion/* may be null */, ProjectLoadSettings projectLoadSettings) - { - // Anonymous in-memory projects use the current directory for $(MSBuildProjectDirectory). - // We need to set the directory to something reasonable. - string originalDir = Directory.GetCurrentDirectory(); - Directory.SetCurrentDirectory(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)); - -#if _NEVER - // Attach a console logger so that build output can go to the test - // harness. - e.RegisterLogger(new ConsoleLogger(ConsoleLogger.Verbosity.Verbose)); -#endif - - Project p = new Project(e, toolsVersion); - p.FullFileName = Path.Combine(Path.GetTempPath(), "Temporary.csproj"); - - if (logger != null) - { - p.ParentEngine.RegisterLogger(logger); - } - p.LoadXml(CleanupFileContents(xml), projectLoadSettings); - - // Return to the original directory. - Directory.SetCurrentDirectory(originalDir); - - return p; - } - - /// - /// Creates a project in memory and builds the default targets. The build is - /// expected to succeed. - /// - /// - /// - /// RGoel - internal static MockLogger BuildProjectExpectSuccess - ( - string projectContents - ) - { - MockLogger logger = new MockLogger(); - Project project = ObjectModelHelpers.CreateInMemoryProject(projectContents, logger); - - bool success = project.Build(null, null); - Assertion.Assert("Build failed. See Standard Out tab for details", success); - - return logger; - } - - /// - /// Creates a project in memory and builds the default targets. The build is - /// expected to fail. - /// - /// - /// - /// RGoel - internal static MockLogger BuildProjectExpectFailure - ( - string projectContents - ) - { - MockLogger logger = new MockLogger(); - Project project = ObjectModelHelpers.CreateInMemoryProject(projectContents, logger); - - bool success = project.Build(null, null); - Assertion.Assert("Build succeeded, but shouldn't have. See Standard Out tab for details", !success); - - return logger; - } - - /// - /// This helper method compares the final project contents with the expected - /// value. - /// - /// - /// - /// RGoel - internal static void CompareProjectContents - ( - Project project, - string newExpectedProjectContents - ) - { - // Get the new XML for the project, normalizing the whitespace. - string newActualProjectContents = project.Xml; - - // Replace single-quotes with double-quotes, and normalize whitespace. - XmlDocument xmldoc = new XmlDocument(); - xmldoc.LoadXml(ObjectModelHelpers.CleanupFileContents(newExpectedProjectContents)); - newExpectedProjectContents = ObjectModelHelpers.NormalizeXmlWhitespace(xmldoc); - - // Compare the actual XML with the expected XML. - Console.WriteLine("================================= EXPECTED ==========================================="); - Console.WriteLine(newExpectedProjectContents); - Console.WriteLine(); - Console.WriteLine("================================== ACTUAL ============================================"); - Console.WriteLine(newActualProjectContents); - Console.WriteLine(); - Assertion.AssertEquals("Project XML does not match expected XML. See 'Standard Out' tab for details.", - newExpectedProjectContents, newActualProjectContents); - } - - private static string tempProjectDir = null; - - /// - /// Returns the path %TEMP%\TempDirForMSBuildUnitTests - /// - internal static string TempProjectDir - { - get - { - if (tempProjectDir == null) - { - tempProjectDir = Path.Combine(Path.GetTempPath(), "TempDirForMSBuildUnitTests"); - } - - return tempProjectDir; - } - } - - /// - /// Deletes the directory %TEMP%\TempDirForMSBuildUnitTests, and all its contents. - /// - internal static void DeleteTempProjectDirectory() - { - // For some reason sometimes get "directory is not empty" - // Try to be as robust as possible using retries and catching all exceptions. - for (int retries = 0; retries < 5; retries++) - { - try - { - // Manually deleting all children, but intentionally leaving the - // Temp project directory behind due to locking issues which were causing - // failures in main on Amd64-WOW runs. - if (Directory.Exists(TempProjectDir)) - { - foreach (string directory in Directory.GetDirectories(TempProjectDir)) - { - Directory.Delete(directory, true); - } - foreach (string file in Directory.GetFiles(TempProjectDir)) - { - File.Delete(file); - } - } - } - catch(Exception ex) - { - Console.WriteLine(ex.ToString()); - } - } - } - - /// - /// Creates a file in the %TEMP%\TempDirForMSBuildUnitTests directory, after cleaning - /// up the file contents (replacing single-back-quote with double-quote, etc.). - /// - /// - /// - internal static string CreateFileInTempProjectDirectory(string fileRelativePath, string fileContents) - { - Assertion.Assert(!String.IsNullOrEmpty(fileRelativePath)); - string fullFilePath = Path.Combine(TempProjectDir, fileRelativePath); - Directory.CreateDirectory(Path.GetDirectoryName(fullFilePath)); - - // retries to deal with occasional locking issues where the file can't be written to initially - for (int retries = 0; retries < 5; retries++) - { - try - { - File.WriteAllText(fullFilePath, CleanupFileContents(fileContents)); - break; - } - catch(Exception ex) - { - if (retries < 4) - { - Console.WriteLine(ex.ToString()); - } - else - { - // All the retries have failed, so we're pretty much screwed. Might as well fail with the - // actual problem now instead of with some more difficult-to-understand - // issue later. - throw ex; - } - } - } - - return fullFilePath; - } - - /// - /// Loads a project file from disk - /// - /// - /// - /// LukaszG - internal static Project LoadProjectFileInTempProjectDirectory(string projectFileRelativePath, ILogger logger) - { - return LoadProjectFileInTempProjectDirectory(projectFileRelativePath, logger, false /* don't touch project*/); - } - - /// - /// Loads a project file from disk - /// - /// - /// - /// LukaszG - internal static Project LoadProjectFileInTempProjectDirectory(string projectFileRelativePath, ILogger logger, bool touchProject) - { - string projectFileFullPath = Path.Combine(TempProjectDir, projectFileRelativePath); - - // Create/initialize a new engine. - Engine engine = new Engine(); - - if (logger != null) - { - engine.RegisterLogger(logger); - } - - // Load the project off disk. - Project project = engine.CreateNewProject(); - - if (touchProject) - { - File.SetLastWriteTime(projectFileFullPath, DateTime.Now); - } - - project.Load(projectFileFullPath); - - return project; - } - - /// - /// Builds a project file from disk, and asserts if the build does not succeed. - /// - /// - /// - /// Can be null. - /// - /// - internal static bool BuildTempProjectFileWithTargets - ( - string projectFileRelativePath, - string[] targets, - BuildPropertyGroup additionalProperties, - MockLogger logger - ) - { - return BuildTempProjectFileWithTargets(projectFileRelativePath, targets, additionalProperties, logger, false /* don't touch project*/); - } - - /// - /// Builds a project file from disk, and asserts if the build does not succeed. - /// - /// - /// - /// Can be null. - /// - /// - internal static bool BuildTempProjectFileWithTargets - ( - string projectFileRelativePath, - string[] targets, - BuildPropertyGroup additionalProperties, - MockLogger logger, - bool touchProject - ) - { - Project project = LoadProjectFileInTempProjectDirectory(projectFileRelativePath, logger, touchProject); - - if (additionalProperties != null) - { - // add extra properties - foreach (BuildProperty additionalProperty in additionalProperties) - { - project.GlobalProperties.SetProperty(additionalProperty.Name, additionalProperty.Value); - } - } - - // Build the default targets. - return project.Build(targets, null); - } - - /// - /// Builds a project file from disk, and asserts if the build does not succeed. - /// - /// - /// - /// RGoel - internal static MockLogger BuildTempProjectFileExpectSuccess(string projectFileRelativePath) - { - return BuildTempProjectFileWithTargetsExpectSuccess(projectFileRelativePath, null, null, false); - } - - /// - /// Builds a project file from disk, and asserts if the build does not succeed. - /// - internal static MockLogger BuildTempProjectFileWithTargetsExpectSuccess(string projectFileRelativePath, string[] targets, BuildPropertyGroup additionalProperties) - { - MockLogger logger = new MockLogger(); - bool success = BuildTempProjectFileWithTargets(projectFileRelativePath, targets, additionalProperties, logger, false); - - Assertion.Assert("Build failed. See Standard Out tab for details", success); - - return logger; - } - - /// - /// Builds a project file from disk, and asserts if the build does not succeed. - /// - internal static MockLogger BuildTempProjectFileWithTargetsExpectSuccess(string projectFileRelativePath, string[] targets, BuildPropertyGroup additionalProperties, bool touchProject) - { - MockLogger logger = new MockLogger(); - bool success = BuildTempProjectFileWithTargets(projectFileRelativePath, targets, additionalProperties, logger, touchProject); - - Assertion.Assert("Build failed. See Standard Out tab for details", success); - - return logger; - } - - /// - /// Builds a project file from disk, and asserts if the build succeeds. - /// - internal static MockLogger BuildTempProjectFileExpectFailure(string projectFileRelativePath) - { - return BuildTempProjectFileWithTargetsExpectFailure(projectFileRelativePath, null, null); - } - - /// - /// Builds a project file from disk, and asserts if the build succeeds. - /// - private static MockLogger BuildTempProjectFileWithTargetsExpectFailure(string projectFileRelativePath, string[] targets, BuildPropertyGroup additionalProperties) - { - MockLogger logger = new MockLogger(); - bool success = BuildTempProjectFileWithTargets(projectFileRelativePath, targets, additionalProperties, logger); - - Assertion.Assert("Build unexpectedly succeeded. See Standard Out tab for details", !success); - - return logger; - } - - /// - /// Runs an EXE and captures the stdout. - /// - /// - /// - /// RGoel - internal static string RunTempProjectBuiltApplication(string builtExe) - { - string builtExeFullPath = Path.Combine(TempProjectDir, builtExe); - - Assertion.Assert(@"Did not find expected file " + builtExe, File.Exists(builtExeFullPath)); - - ProcessStartInfo startInfo = new ProcessStartInfo(builtExeFullPath); - startInfo.UseShellExecute = false; - startInfo.CreateNoWindow = true; - startInfo.RedirectStandardOutput = true; - - Process process = Process.Start(startInfo); - process.WaitForExit(); - - string stdout = process.StandardOutput.ReadToEnd(); - Console.WriteLine("================================================================="); - Console.WriteLine("======= OUTPUT OF BUILT APPLICATION ============================="); - Console.WriteLine("================================================================="); - Console.WriteLine(stdout); - - Assertion.Assert("ConsoleApplication37.exe returned a non-zero exit code.", process.ExitCode == 0); - - return stdout; - } - - /// - /// Assert that a given file exists within the temp project directory. - /// - /// - /// RGoel - internal static void AssertFileExistsInTempProjectDirectory(string fileRelativePath) - { - AssertFileExistsInTempProjectDirectory(fileRelativePath, null); - } - - /// - /// Assert that a given file exists within the temp project directory. - /// - /// - /// Can be null. - internal static void AssertFileExistsInTempProjectDirectory(string fileRelativePath, string message) - { - if (message == null) - { - message = fileRelativePath + " doesn't exist, but it should."; - } - - AssertFileExistenceInTempProjectDirectory(fileRelativePath, message, true); - } - - /// - /// Assert that a given file does not exist within the temp project directory. - /// - /// - internal static void AssertFileDoesNotExistInTempProjectDirectory(string fileRelativePath) - { - AssertFileDoesNotExistInTempProjectDirectory(fileRelativePath, null); - } - - /// - /// Assert that a given file does not exist within the temp project directory. - /// - /// - /// Can be null. - internal static void AssertFileDoesNotExistInTempProjectDirectory(string fileRelativePath, string message) - { - if (message == null) - { - message = fileRelativePath + " exists, but it should not."; - } - - AssertFileExistenceInTempProjectDirectory(fileRelativePath, message, false); - } - - /// - /// Assert that a given file exists (or not) within the temp project directory. - /// - /// - /// Can be null. - private static void AssertFileExistenceInTempProjectDirectory(string fileRelativePath, string message, bool exists) - { - Assertion.Assert(message, (exists == File.Exists(Path.Combine(TempProjectDir, fileRelativePath)))); - } - - /// - /// Delete any files in the list that currently exist. - /// - /// - internal static void DeleteTempFiles(string[] files) - { - for (int i = 0; i < files.Length; i++) - { - if (File.Exists(files[i])) File.Delete(files[i]); - } - } - - /// - /// Returns the requested number of temporary files. - /// - internal static string[] GetTempFiles(int number) - { - return GetTempFiles(number, DateTime.Now); - } - - /// - /// Returns the requested number of temporary files, with the requested write time. - /// - internal static string[] GetTempFiles(int number, DateTime lastWriteTime) - { - string[] files = new string[number]; - - for (int i = 0; i < number; i++) - { - files[i] = Path.GetTempFileName(); - File.SetLastWriteTime(files[i], lastWriteTime); - } - return files; - } - } -} diff --git a/src/Deprecated/Engine/Shared/UnitTests/ResourceUtilities_Tests.cs b/src/Deprecated/Engine/Shared/UnitTests/ResourceUtilities_Tests.cs deleted file mode 100644 index ae375d72201..00000000000 --- a/src/Deprecated/Engine/Shared/UnitTests/ResourceUtilities_Tests.cs +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; - -using NUnit.Framework; - -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class ResourceUtilitiesTests - { - [Test] - public void ExtractMSBuildCode() - { - // most common message pattern - string code; - string messageOnly = ResourceUtilities.ExtractMessageCode(null, "MSB7007: This is a message.", out code); - Assertion.AssertEquals("MSB7007", code); - Assertion.AssertEquals("This is a message.", messageOnly); - - // no whitespace between colon and message is ok - code = null; - messageOnly = ResourceUtilities.ExtractMessageCode(null, "MSB7007:This is a message.", out code); - Assertion.AssertEquals("MSB7007", code); - Assertion.AssertEquals("This is a message.", messageOnly); - - // whitespace before code and after colon is ok - code = null; - messageOnly = ResourceUtilities.ExtractMessageCode(null, " MSB7007: This is a message.", out code); - Assertion.AssertEquals("MSB7007", code); - Assertion.AssertEquals("This is a message.", messageOnly); - - // whitespace between code and colon is not ok - code = null; - messageOnly = ResourceUtilities.ExtractMessageCode(null, "MSB7007 : This is a message.", out code); - Assertion.AssertNull(code); - Assertion.AssertEquals("MSB7007 : This is a message.", messageOnly); - - // whitespace in code is not ok - code = null; - messageOnly = ResourceUtilities.ExtractMessageCode(null, "MSB 7007: This is a message.", out code); - Assertion.AssertNull(code); - Assertion.AssertEquals("MSB 7007: This is a message.", messageOnly); - - // code with less than 4 digits is not ok - code = null; - messageOnly = ResourceUtilities.ExtractMessageCode(null, "MSB007: This is a message.", out code); - Assertion.AssertNull(code); - Assertion.AssertEquals("MSB007: This is a message.", messageOnly); - - // code without digits is not ok - code = null; - messageOnly = ResourceUtilities.ExtractMessageCode(null, "MSB: This is a message.", out code); - Assertion.AssertNull(code); - Assertion.AssertEquals("MSB: This is a message.", messageOnly); - - // code without MSB prefix is not ok - code = null; - messageOnly = ResourceUtilities.ExtractMessageCode(null, "1001: This is a message.", out code); - Assertion.AssertNull(code); - Assertion.AssertEquals("1001: This is a message.", messageOnly); - - // digits before MSB prefix is not ok - code = null; - messageOnly = ResourceUtilities.ExtractMessageCode(null, "7001MSB: This is a message.", out code); - Assertion.AssertNull(code); - Assertion.AssertEquals("7001MSB: This is a message.", messageOnly); - - // mixing letters and digits is not ok - code = null; - messageOnly = ResourceUtilities.ExtractMessageCode(null, "MSB564B: This is a message.", out code); - Assertion.AssertNull(code); - Assertion.AssertEquals("MSB564B: This is a message.", messageOnly); - - // lowercase code is not ok - code = null; - messageOnly = ResourceUtilities.ExtractMessageCode(null, "msb1001: This is a message.", out code); - Assertion.AssertNull(code); - Assertion.AssertEquals("msb1001: This is a message.", messageOnly); - } - } -} diff --git a/src/Deprecated/Engine/Shared/UnitTests/SolutionParser_Tests.cs b/src/Deprecated/Engine/Shared/UnitTests/SolutionParser_Tests.cs deleted file mode 100644 index 2d8491dfb9a..00000000000 --- a/src/Deprecated/Engine/Shared/UnitTests/SolutionParser_Tests.cs +++ /dev/null @@ -1,1301 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Reflection; -using System.Collections; -using System.Collections.Generic; -using System.IO; -using NUnit.Framework; -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine; -using Microsoft.Build.BuildEngine.Shared; -using System.Text.RegularExpressions; - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class SolutionParser_Tests - { - /// - /// Test just the most basic, plain vanilla first project line. - /// - /// JomoF - [Test] - public void BasicParseFirstProjectLine() - { - SolutionParser p = new SolutionParser(); - p.SolutionFile = "foobar.sln"; - ProjectInSolution proj = new ProjectInSolution(p); - - p.ParseFirstProjectLine - ( - "Project(\"{Project GUID}\") = \"Project name\", \"Relative path to project file\", \"Unique name-GUID\"", - proj - ); - Assertion.AssertEquals(SolutionProjectType.Unknown, proj.ProjectType); - Assertion.AssertEquals("Project name", proj.ProjectName); - Assertion.AssertEquals("Relative path to project file", proj.RelativePath); - Assertion.AssertEquals("Unique name-GUID", proj.ProjectGuid); - } - - /// - /// A slightly more complicated test where there is some different whitespace. - /// - /// JomoF - [Test] - public void ParseFirstProjectLineWithDifferentSpacing() - { - SolutionParser p = new SolutionParser(); - p.SolutionFile = "foobar.sln"; - ProjectInSolution proj = new ProjectInSolution(p); - - p.ParseFirstProjectLine - ( - "Project(\" {Project GUID} \") = \" Project name \", \" Relative path to project file \" , \" Unique name-GUID \"", - proj - ); - Assertion.AssertEquals(SolutionProjectType.Unknown, proj.ProjectType); - Assertion.AssertEquals("Project name", proj.ProjectName); - Assertion.AssertEquals("Relative path to project file", proj.RelativePath); - Assertion.AssertEquals("Unique name-GUID", proj.ProjectGuid); - } - - /// - /// Test ParseEtpProject function. - /// - /// NazanKa - [Test] - public void ParseEtpProject() - { - string proj1Path = Path.Combine(Path.GetTempPath(), "someproj.etp"); - try - { - // Create the first .etp project file - string etpProjContent = @" - - - Microsoft Visual Studio Application Template File - 1.00 - - - ClassLibrary2.csproj - - - - - ClassLibrary2.csproj - {73D0F4CE-D9D3-4E8B-81E4-B26FBF4CC2FE} - - - - "; - - File.WriteAllText(proj1Path, etpProjContent); - - // Create the SolutionParser object - string solutionFileContents = - @" - Microsoft Visual Studio Solution File, Format Version 8.00 - Project('{FE3BBBB6-72D5-11D2-9ACE-00C04F79A2A4}') = 'someproj', 'someproj.etp', '{AD0F3D02-9925-4D57-9DAF-E0A9D936ABDB}' - ProjectSection(ProjectDependencies) = postProject - EndProjectSection - EndProject"; - SolutionParser solution = ParseSolutionHelper(solutionFileContents); - //Project should get added to the solution - Assertion.AssertEquals(solution.Projects[0].RelativePath, @"someproj.etp"); - Assertion.AssertEquals(solution.Projects[1].RelativePath, @"ClassLibrary2.csproj"); - } - // Delete the files created during the test - finally - { - File.Delete(proj1Path); - } - } - - /// - /// Test CanBeMSBuildFile - /// - /// NazanKa - [Test] - public void CanBeMSBuildFile() - { - string proj1Path = Path.Combine(Path.GetTempPath(), "someproj.etp"); - string proj2Path = Path.Combine(Path.GetTempPath(), "someproja.proj"); - try - { - // Create the first .etp project file - string etpProjContent = @" - - - Microsoft Visual Studio Application Template File - 1.00 - - - ClassLibrary2.csproj - - - - - ClassLibrary2.csproj - {73D0F4CE-D9D3-4E8B-81E4-B26FBF4CC2FE} - - - - "; - - string genericProj= @" - - - - - - - - - - - - - "; - - File.WriteAllText(proj1Path, etpProjContent); - File.WriteAllText(proj2Path, genericProj); - - // Create the SolutionParser object - string solutionFileContents = - @" - Microsoft Visual Studio Solution File, Format Version 8.00 - Project('{FE3BBBB6-72D5-11D2-9ACE-00C04F79A2A4}') = 'someproj', 'someproj.etp', '{AD0F3D02-9925-4D57-9DAF-E0A9D936ABDB}' - ProjectSection(ProjectDependencies) = postProject - EndProjectSection - EndProject - Project('{NNNNNNNN-9925-4D57-9DAF-E0A9D936ABDB}') = 'someproja', 'someproja.proj', '{CCCCCCCC-9925-4D57-9DAF-E0A9D936ABDB}' - ProjectSection(ProjectDependencies) = postProject - EndProjectSection - EndProject"; - - - SolutionParser solution = ParseSolutionHelper(solutionFileContents); - ProjectInSolution project = (ProjectInSolution)solution.ProjectsByGuid["{AD0F3D02-9925-4D57-9DAF-E0A9D936ABDB}"]; - ProjectInSolution project2 = (ProjectInSolution)solution.ProjectsByGuid["{CCCCCCCC-9925-4D57-9DAF-E0A9D936ABDB}"]; - string error = null; - Assertion.Assert(!project.CanBeMSBuildProjectFile(out error)); - Assertion.Assert(project2.CanBeMSBuildProjectFile(out error)); - } - // Delete the files created during the test - finally - { - File.Delete(proj1Path); - File.Delete(proj2Path); - } - } - - /// - /// Test ParseEtpProject function. - /// - /// NazanKa - [Test] - public void ParseNestedEtpProjectSingleLevel() - { - string proj1Path = Path.Combine(Path.GetTempPath(), "someproj.etp"); - string proj2Path = Path.Combine(Path.GetTempPath(),"someproj2.etp"); - try - { - // Create the first .etp project file - string etpProjContent = @" - - - Microsoft Visual Studio Application Template File - 1.00 - - - someproj2.etp - {73D0F4CE-D9D3-4E8B-81E4-B26FBF4CC2FE} - - - - "; - - File.WriteAllText(proj1Path, etpProjContent); - - // Create the second .etp project file - etpProjContent = @" - - - Microsoft Visual Studio Application Template File - 1.00 - - - ClassLibrary1.csproj - {83D0F4CE-D9D3-4E8B-81E4-B26FBF4CC2FF} - - - - "; - - File.WriteAllText(proj2Path, etpProjContent); - - // Create the SolutionParser object - string solutionFileContents = - @" - Microsoft Visual Studio Solution File, Format Version 8.00 - Project('{FE3BBBB6-72D5-11D2-9ACE-00C04F79A2A4}') = 'someproj', 'someproj.etp', '{AD0F3D02-9925-4D57-9DAF-E0A9D936ABDB}' - ProjectSection(ProjectDependencies) = postProject - EndProjectSection - EndProject"; - SolutionParser solution = ParseSolutionHelper(solutionFileContents); - - //Project should get added to the solution - Assertion.AssertEquals(solution.Projects[0].RelativePath, @"someproj.etp"); - Assertion.AssertEquals(solution.Projects[1].RelativePath, @"someproj2.etp"); - Assertion.AssertEquals(solution.Projects[2].RelativePath, @"ClassLibrary1.csproj"); - } - // Delete the files created during the test - finally - { - File.Delete(proj1Path); - File.Delete(proj2Path); - } - } - - /// - /// Test ParseEtpProject function. - /// - /// NazanKa - [Test] - public void ParseNestedEtpProjectMultipleLevel() - { - string proj1Path = Path.Combine(Path.GetTempPath(), "someproj.etp"); - string proj2Path = Path.Combine(Path.GetTempPath(), "someproj2.etp"); - string proj3Path = Path.Combine(Path.GetTempPath(), "ETPProjUpgradeTest" + Path.DirectorySeparatorChar + "someproj3.etp"); - try - { - // Create the first .etp project file - string etpProjContent = @" - - - Microsoft Visual Studio Application Template File - 1.00 - - - someproj2.etp - {73D0F4CE-D9D3-4E8B-81E4-B26FBF4CC2FE} - - - - "; - - File.WriteAllText(proj1Path, etpProjContent); - - // Create the second .etp project file - etpProjContent = @" - - - Microsoft Visual Studio Application Template File - 1.00 - - - ETPProjUpgradeTest\someproj3.etp - {83D0F4CE-D9D3-4E8B-81E4-B26FBF4CC2FF} - - - - "; - - File.WriteAllText(proj2Path, etpProjContent); - - // Create the thirsd .etp project file - etpProjContent = @" - - - Microsoft Visual Studio Application Template File - 1.00 - - - ..\SomeFolder\ClassLibrary1.csproj - {83D0F4CE-D9D3-4E8B-81E4-B26FBF4CC2FF} - - - - "; - //Create the directory for the third project - Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), "ETPProjUpgradeTest")); - File.WriteAllText(proj3Path, etpProjContent); - - // Create the SolutionParser object - string solutionFileContents = - @" - Microsoft Visual Studio Solution File, Format Version 8.00 - Project('{FE3BBBB6-72D5-11D2-9ACE-00C04F79A2A4}') = 'someproj', 'someproj.etp', '{AD0F3D02-9925-4D57-9DAF-E0A9D936ABDB}' - ProjectSection(ProjectDependencies) = postProject - EndProjectSection - EndProject"; - SolutionParser solution = ParseSolutionHelper(solutionFileContents); - - //Project should get added to the solution - Assertion.AssertEquals(solution.Projects[0].RelativePath, @"someproj.etp"); - Assertion.AssertEquals(solution.Projects[1].RelativePath, @"someproj2.etp"); - Assertion.AssertEquals(solution.Projects[2].RelativePath, @"ETPProjUpgradeTest\someproj3.etp"); - Assertion.AssertEquals(solution.Projects[3].RelativePath, @"ETPProjUpgradeTest\..\SomeFolder\ClassLibrary1.csproj"); - } - // Delete the files created during the test - finally - { - File.Delete(proj1Path); - File.Delete(proj2Path); - File.Delete(proj3Path); - } - - } - - /// - /// Ensure that a malformed .etp proj file listed in the .SLN file results in an - /// InvalidProjectFileException. - /// - [Test] - public void MalformedEtpProjFile() - { - string proj1Path = Path.Combine(Path.GetTempPath(), "someproj.etp"); - try - { - // Create the .etp project file - // Note the is missing - string etpProjContent = @" - - - Microsoft Visual Studio Application Template File - 1.00 - - - ClassLibrary2\ClassLibrary2.csproj - - - - - ClassLibrary2\ClassLibrary2.csproj - {73D0F4CE-D9D3-4E8B-81E4-B26FBF4CC2FE} - - - - "; - - File.WriteAllText(proj1Path, etpProjContent); - - // Create the SolutionParser object - string solutionFileContents = - @" - Microsoft Visual Studio Solution File, Format Version 8.00 - Project('{FE3BBBB6-72D5-11D2-9ACE-00C04F79A2A4}') = 'someproj', 'someproj.etp', '{AD0F3D02-9925-4D57-9DAF-E0A9D936ABDB}' - ProjectSection(ProjectDependencies) = postProject - EndProjectSection - EndProject"; - SolutionParser solution = ParseSolutionHelper(solutionFileContents); - string errCode, ignoredKeyword; - ResourceUtilities.FormatResourceString(out errCode, out ignoredKeyword, "Shared.InvalidProjectFile", - "someproj.etp", String.Empty); - foreach (string warningString in solution.SolutionParserWarnings) - { - Console.WriteLine(warningString.ToString()); - } - Assertion.Assert(solution.SolutionParserErrorCodes[0].ToString().Contains(errCode)); - } - // Delete the files created suring the test - finally - { - File.Delete(proj1Path); - } - } - - /// - /// Ensure that a missing .etp proj file listed in the .SLN file results in an - /// InvalidProjectFileException. - /// - [Test] - public void MissingEtpProjFile() - { - string proj1Path = Path.Combine(Path.GetTempPath(), "someproj.etp"); - // Create the solution file - string solutionFileContents = - @" - Microsoft Visual Studio Solution File, Format Version 8.00 - Project('{FE3BBBB6-72D5-11D2-9ACE-00C04F79A2A4}') = 'someproj', 'someproj.etp', '{AD0F3D02-9925-4D57-9DAF-E0A9D936ABDB}' - ProjectSection(ProjectDependencies) = postProject - EndProjectSection - EndProject"; - // Delete the someproj.etp file if it exists - File.Delete(proj1Path); - SolutionParser solution = ParseSolutionHelper(solutionFileContents); - string errCode, ignoredKeyword; - ResourceUtilities.FormatResourceString(out errCode, out ignoredKeyword, "Shared.ProjectFileCouldNotBeLoaded", - "someproj.etp", String.Empty); - Assertion.Assert(solution.SolutionParserErrorCodes[0].ToString().Contains(errCode)); - } - - /// - /// Test some characters that are valid in a file name but that also could be - /// considered a delimiter by a parser. Does quoting work for special characters? - /// - /// JomoF - [Test] - public void ParseFirstProjectLineWhereProjectNameHasSpecialCharacters() - { - SolutionParser p = new SolutionParser(); - p.SolutionFile = "foobar.sln"; - ProjectInSolution proj = new ProjectInSolution(p); - - p.ParseFirstProjectLine - ( - "Project(\"{Project GUID}\") = \"MyProject,(=IsGreat)\", \"Relative path to project file\" , \"Unique name-GUID\"", - proj - ); - Assertion.AssertEquals(SolutionProjectType.Unknown, proj.ProjectType); - Assertion.AssertEquals("MyProject,(=IsGreat)", proj.ProjectName); - Assertion.AssertEquals("Relative path to project file", proj.RelativePath); - Assertion.AssertEquals("Unique name-GUID", proj.ProjectGuid); - } - - /// - /// Helper method to create a SolutionParser object, and call it to parse the SLN file - /// represented by the string contents passed in. - /// - /// - /// - static internal SolutionParser ParseSolutionHelper - ( - string solutionFileContents - ) - { - solutionFileContents = solutionFileContents.Replace('\'', '"'); - StreamReader sr = StreamHelpers.StringToStreamReader(solutionFileContents); - - SolutionParser sp = new SolutionParser(); - sp.SolutionFileDirectory = Path.GetTempPath(); - sp.SolutionReader = sr; - string tmpFileName = Path.GetTempFileName(); - sp.SolutionFile = tmpFileName + ".sln"; - // This file is not expected to exist at this point, so make sure it doesn't - File.Delete(sp.SolutionFile); - sp.ParseSolution(); - // Clean up the temporary file that got created with this call - File.Delete(tmpFileName); - return sp; - } - - /// - /// Ensure that a bogus version stamp in the .SLN file results in an - /// InvalidProjectFileException. - /// - [ExpectedException(typeof(InvalidProjectFileException))] - [Test] - public void BadVersionStamp() - { - string solutionFileContents = - @" - Microsoft Visual Studio Solution File, Format Version a.b - # Visual Studio 2005 - "; - - SolutionParser solution = ParseSolutionHelper(solutionFileContents); - } - - /// - /// Expected version numbers less than 7 to cause an invalid project file exception. - /// - [ExpectedException(typeof(InvalidProjectFileException))] - [Test] - public void VersionTooLow() - { - string solutionFileContents = - @" - Microsoft Visual Studio Solution File, Format Version 6.0 - # Visual Studio 2005 - "; - - SolutionParser solution = ParseSolutionHelper(solutionFileContents); - } - - /// - /// Ensure that an unsupported version greater than the current maximum (10) in the .SLN file results in a - /// comment indicating we will try and continue - /// - [Test] - public void UnsupportedVersion() - { - string solutionFileContents = - @" - Microsoft Visual Studio Solution File, Format Version 999.0 - # Visual Studio 2005 - "; - - SolutionParser solution = ParseSolutionHelper(solutionFileContents); - Assert.IsTrue(solution.SolutionParserComments.Count == 1, "Expected the solution parser to contain one comment"); - Assert.IsTrue(String.Equals((string)solution.SolutionParserComments[0], ResourceUtilities.FormatResourceString("UnrecognizedSolutionComment", "999"), StringComparison.OrdinalIgnoreCase)); - } - - [Test] - public void Version9() - { - string solutionFileContents = - @" - Microsoft Visual Studio Solution File, Format Version 9.0 - # Visual Studio 2005 - "; - - SolutionParser solution = ParseSolutionHelper(solutionFileContents); - - Assertion.AssertEquals(9, solution.Version); - } - - [Test] - public void Version10() - { - string solutionFileContents = - @" - Microsoft Visual Studio Solution File, Format Version 10.0 - # Visual Studio 2005 - "; - - SolutionParser solution = ParseSolutionHelper(solutionFileContents); - - Assertion.AssertEquals(10, solution.Version); - } - - /// - /// Test to parse a very basic .sln file to validate that description property in a solution file - /// is properly handled. - /// - /// yroy - [Test] - public void ParseSolutionFileWithDescriptionInformation() - { - string solutionFileContents = - @" - Microsoft Visual Studio Solution File, Format Version 9.00 - # Visual Studio 2005 - Project('{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}') = 'AnyProject', 'AnyProject\AnyProject.csproj', '{2CAB0FBD-15D8-458B-8E63-1B5B840E9798}' - EndProject - Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - Description = Some description of this solution - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {2CAB0FBD-15D8-458B-8E63-1B5B840E9798}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2CAB0FBD-15D8-458B-8E63-1B5B840E9798}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2CAB0FBD-15D8-458B-8E63-1B5B840E9798}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2CAB0FBD-15D8-458B-8E63-1B5B840E9798}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - EndGlobal - "; - try - { - SolutionParser solution = ParseSolutionHelper(solutionFileContents); - } - catch(Exception ex) - { - Assertion.Assert("Failed to parse solution containing description information. Error: " + ex.Message, false); - } - } - - /// - /// Tests the parsing of a very basic .SLN file with three independent projects. - /// - [Test] - public void BasicSolution() - { - string solutionFileContents = - @" - Microsoft Visual Studio Solution File, Format Version 9.00 - # Visual Studio 2005 - Project('{F184B08F-C81C-45F6-A57F-5ABD9991F28F}') = 'ConsoleApplication1', 'ConsoleApplication1\ConsoleApplication1.vbproj', '{AB3413A6-D689-486D-B7F0-A095371B3F13}' - EndProject - Project('{F184B08F-C81C-45F6-A57F-5ABD9991F28F}') = 'vbClassLibrary', 'vbClassLibrary\vbClassLibrary.vbproj', '{BA333A76-4511-47B8-8DF4-CA51C303AD0B}' - EndProject - Project('{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}') = 'ClassLibrary1', 'ClassLibrary1\ClassLibrary1.csproj', '{DEBCE986-61B9-435E-8018-44B9EF751655}' - EndProject - Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|AnyCPU = Debug|AnyCPU - Release|AnyCPU = Release|AnyCPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {AB3413A6-D689-486D-B7F0-A095371B3F13}.Debug|AnyCPU.ActiveCfg = Debug|AnyCPU - {AB3413A6-D689-486D-B7F0-A095371B3F13}.Debug|AnyCPU.Build.0 = Debug|AnyCPU - {AB3413A6-D689-486D-B7F0-A095371B3F13}.Release|AnyCPU.ActiveCfg = Release|AnyCPU - {AB3413A6-D689-486D-B7F0-A095371B3F13}.Release|AnyCPU.Build.0 = Release|AnyCPU - {BA333A76-4511-47B8-8DF4-CA51C303AD0B}.Debug|AnyCPU.ActiveCfg = Debug|AnyCPU - {BA333A76-4511-47B8-8DF4-CA51C303AD0B}.Debug|AnyCPU.Build.0 = Debug|AnyCPU - {BA333A76-4511-47B8-8DF4-CA51C303AD0B}.Release|AnyCPU.ActiveCfg = Release|AnyCPU - {BA333A76-4511-47B8-8DF4-CA51C303AD0B}.Release|AnyCPU.Build.0 = Release|AnyCPU - {DEBCE986-61B9-435E-8018-44B9EF751655}.Debug|AnyCPU.ActiveCfg = Debug|AnyCPU - {DEBCE986-61B9-435E-8018-44B9EF751655}.Debug|AnyCPU.Build.0 = Debug|AnyCPU - {DEBCE986-61B9-435E-8018-44B9EF751655}.Release|AnyCPU.ActiveCfg = Release|AnyCPU - {DEBCE986-61B9-435E-8018-44B9EF751655}.Release|AnyCPU.Build.0 = Release|AnyCPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - EndGlobal - "; - - SolutionParser solution = ParseSolutionHelper(solutionFileContents); - - Assertion.AssertEquals(3, solution.Projects.Length); - - Assertion.AssertEquals(SolutionProjectType.ManagedProject, solution.Projects[0].ProjectType); - Assertion.AssertEquals("ConsoleApplication1", solution.Projects[0].ProjectName); - Assertion.AssertEquals(@"ConsoleApplication1\ConsoleApplication1.vbproj", solution.Projects[0].RelativePath); - Assertion.AssertEquals("{AB3413A6-D689-486D-B7F0-A095371B3F13}", solution.Projects[0].ProjectGuid); - Assertion.AssertEquals(0, solution.Projects[0].Dependencies.Count); - Assertion.AssertEquals(null, solution.Projects[0].ParentProjectGuid); - Assertion.AssertEquals("ConsoleApplication1", solution.Projects[0].GetUniqueProjectName()); - - Assertion.AssertEquals(SolutionProjectType.ManagedProject, solution.Projects[1].ProjectType); - Assertion.AssertEquals("vbClassLibrary", solution.Projects[1].ProjectName); - Assertion.AssertEquals(@"vbClassLibrary\vbClassLibrary.vbproj", solution.Projects[1].RelativePath); - Assertion.AssertEquals("{BA333A76-4511-47B8-8DF4-CA51C303AD0B}", solution.Projects[1].ProjectGuid); - Assertion.AssertEquals(0, solution.Projects[1].Dependencies.Count); - Assertion.AssertEquals(null, solution.Projects[1].ParentProjectGuid); - Assertion.AssertEquals("vbClassLibrary", solution.Projects[1].GetUniqueProjectName()); - - Assertion.AssertEquals(SolutionProjectType.ManagedProject, solution.Projects[2].ProjectType); - Assertion.AssertEquals("ClassLibrary1", solution.Projects[2].ProjectName); - Assertion.AssertEquals(@"ClassLibrary1\ClassLibrary1.csproj", solution.Projects[2].RelativePath); - Assertion.AssertEquals("{DEBCE986-61B9-435E-8018-44B9EF751655}", solution.Projects[2].ProjectGuid); - Assertion.AssertEquals(0, solution.Projects[2].Dependencies.Count); - Assertion.AssertEquals(null, solution.Projects[2].ParentProjectGuid); - Assertion.AssertEquals("ClassLibrary1", solution.Projects[2].GetUniqueProjectName()); - - } - - /// - /// Exercises solution folders, and makes sure that samely named projects in different - /// solution folders will get correctly uniquified. - /// - [Test] - public void SolutionFolders() - { - string solutionFileContents = - @" - Microsoft Visual Studio Solution File, Format Version 9.00 - # Visual Studio 2005 - Project('{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}') = 'ClassLibrary1', 'ClassLibrary1\ClassLibrary1.csproj', '{34E0D07D-CF8F-459D-9449-C4188D8C5564}' - EndProject - Project('{2150E333-8FDC-42A3-9474-1A3956D46DE8}') = 'MySlnFolder', 'MySlnFolder', '{E0F97730-25D2-418A-A7BD-02CAFDC6E470}' - EndProject - Project('{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}') = 'ClassLibrary1', 'MyPhysicalFolder\ClassLibrary1\ClassLibrary1.csproj', '{A5EE8128-B08E-4533-86C5-E46714981680}' - EndProject - Project('{2150E333-8FDC-42A3-9474-1A3956D46DE8}') = 'MySubSlnFolder', 'MySubSlnFolder', '{2AE8D6C4-FB43-430C-8AEB-15E5EEDAAE4B}' - EndProject - Project('{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}') = 'ClassLibrary2', 'ClassLibrary2\ClassLibrary2.csproj', '{6DB98C35-FDCC-4818-B5D4-1F0A385FDFD4}' - EndProject - Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {34E0D07D-CF8F-459D-9449-C4188D8C5564}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {34E0D07D-CF8F-459D-9449-C4188D8C5564}.Debug|Any CPU.Build.0 = Debug|Any CPU - {34E0D07D-CF8F-459D-9449-C4188D8C5564}.Release|Any CPU.ActiveCfg = Release|Any CPU - {34E0D07D-CF8F-459D-9449-C4188D8C5564}.Release|Any CPU.Build.0 = Release|Any CPU - {A5EE8128-B08E-4533-86C5-E46714981680}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A5EE8128-B08E-4533-86C5-E46714981680}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A5EE8128-B08E-4533-86C5-E46714981680}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A5EE8128-B08E-4533-86C5-E46714981680}.Release|Any CPU.Build.0 = Release|Any CPU - {6DB98C35-FDCC-4818-B5D4-1F0A385FDFD4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6DB98C35-FDCC-4818-B5D4-1F0A385FDFD4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6DB98C35-FDCC-4818-B5D4-1F0A385FDFD4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6DB98C35-FDCC-4818-B5D4-1F0A385FDFD4}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {A5EE8128-B08E-4533-86C5-E46714981680} = {E0F97730-25D2-418A-A7BD-02CAFDC6E470} - {2AE8D6C4-FB43-430C-8AEB-15E5EEDAAE4B} = {E0F97730-25D2-418A-A7BD-02CAFDC6E470} - {6DB98C35-FDCC-4818-B5D4-1F0A385FDFD4} = {2AE8D6C4-FB43-430C-8AEB-15E5EEDAAE4B} - EndGlobalSection - EndGlobal - "; - - SolutionParser solution = ParseSolutionHelper(solutionFileContents); - - Assertion.AssertEquals(5, solution.Projects.Length); - - Assertion.AssertEquals(@"ClassLibrary1\ClassLibrary1.csproj", solution.Projects[0].RelativePath); - Assertion.AssertEquals("{34E0D07D-CF8F-459D-9449-C4188D8C5564}", solution.Projects[0].ProjectGuid); - Assertion.AssertEquals(0, solution.Projects[0].Dependencies.Count); - Assertion.AssertEquals(null, solution.Projects[0].ParentProjectGuid); - Assertion.AssertEquals("ClassLibrary1", solution.Projects[0].GetUniqueProjectName()); - - Assertion.AssertEquals(SolutionProjectType.SolutionFolder, solution.Projects[1].ProjectType); - Assertion.AssertEquals("{E0F97730-25D2-418A-A7BD-02CAFDC6E470}", solution.Projects[1].ProjectGuid); - Assertion.AssertEquals(0, solution.Projects[1].Dependencies.Count); - Assertion.AssertEquals(null, solution.Projects[1].ParentProjectGuid); - Assertion.AssertEquals("MySlnFolder", solution.Projects[1].GetUniqueProjectName()); - - Assertion.AssertEquals(@"MyPhysicalFolder\ClassLibrary1\ClassLibrary1.csproj", solution.Projects[2].RelativePath); - Assertion.AssertEquals("{A5EE8128-B08E-4533-86C5-E46714981680}", solution.Projects[2].ProjectGuid); - Assertion.AssertEquals(0, solution.Projects[2].Dependencies.Count); - Assertion.AssertEquals("{E0F97730-25D2-418A-A7BD-02CAFDC6E470}", solution.Projects[2].ParentProjectGuid); - Assertion.AssertEquals(@"MySlnFolder\ClassLibrary1", solution.Projects[2].GetUniqueProjectName()); - - Assertion.AssertEquals(SolutionProjectType.SolutionFolder, solution.Projects[3].ProjectType); - Assertion.AssertEquals("{2AE8D6C4-FB43-430C-8AEB-15E5EEDAAE4B}", solution.Projects[3].ProjectGuid); - Assertion.AssertEquals(0, solution.Projects[3].Dependencies.Count); - Assertion.AssertEquals("{E0F97730-25D2-418A-A7BD-02CAFDC6E470}", solution.Projects[3].ParentProjectGuid); - Assertion.AssertEquals(@"MySlnFolder\MySubSlnFolder", solution.Projects[3].GetUniqueProjectName()); - - Assertion.AssertEquals(@"ClassLibrary2\ClassLibrary2.csproj", solution.Projects[4].RelativePath); - Assertion.AssertEquals("{6DB98C35-FDCC-4818-B5D4-1F0A385FDFD4}", solution.Projects[4].ProjectGuid); - Assertion.AssertEquals(0, solution.Projects[4].Dependencies.Count); - Assertion.AssertEquals("{2AE8D6C4-FB43-430C-8AEB-15E5EEDAAE4B}", solution.Projects[4].ParentProjectGuid); - Assertion.AssertEquals(@"MySlnFolder\MySubSlnFolder\ClassLibrary2",solution.Projects[4].GetUniqueProjectName()); - } - - /// - /// Verifies that hand-coded project-to-project dependencies listed in the .SLN file - /// are correctly recognized by our solution parser. - /// - [Test] - public void SolutionDependencies() - { - string solutionFileContents = - @" - Microsoft Visual Studio Solution File, Format Version 9.00 - # Visual Studio 2005 - Project('{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}') = 'ClassLibrary1', 'ClassLibrary1\ClassLibrary1.csproj', '{05A5AD00-71B5-4612-AF2F-9EA9121C4111}' - ProjectSection(ProjectDependencies) = postProject - {FAB4EE06-6E01-495A-8926-5514599E3DD9} = {FAB4EE06-6E01-495A-8926-5514599E3DD9} - EndProjectSection - EndProject - Project('{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}') = 'ClassLibrary2', 'ClassLibrary2\ClassLibrary2.csproj', '{7F316407-AE3E-4F26-BE61-2C50D30DA158}' - ProjectSection(ProjectDependencies) = postProject - {FAB4EE06-6E01-495A-8926-5514599E3DD9} = {FAB4EE06-6E01-495A-8926-5514599E3DD9} - {05A5AD00-71B5-4612-AF2F-9EA9121C4111} = {05A5AD00-71B5-4612-AF2F-9EA9121C4111} - EndProjectSection - EndProject - Project('{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}') = 'ClassLibrary3', 'ClassLibrary3\ClassLibrary3.csproj', '{FAB4EE06-6E01-495A-8926-5514599E3DD9}' - EndProject - Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {05A5AD00-71B5-4612-AF2F-9EA9121C4111}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {05A5AD00-71B5-4612-AF2F-9EA9121C4111}.Debug|Any CPU.Build.0 = Debug|Any CPU - {05A5AD00-71B5-4612-AF2F-9EA9121C4111}.Release|Any CPU.ActiveCfg = Release|Any CPU - {05A5AD00-71B5-4612-AF2F-9EA9121C4111}.Release|Any CPU.Build.0 = Release|Any CPU - {7F316407-AE3E-4F26-BE61-2C50D30DA158}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7F316407-AE3E-4F26-BE61-2C50D30DA158}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7F316407-AE3E-4F26-BE61-2C50D30DA158}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7F316407-AE3E-4F26-BE61-2C50D30DA158}.Release|Any CPU.Build.0 = Release|Any CPU - {FAB4EE06-6E01-495A-8926-5514599E3DD9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FAB4EE06-6E01-495A-8926-5514599E3DD9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FAB4EE06-6E01-495A-8926-5514599E3DD9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FAB4EE06-6E01-495A-8926-5514599E3DD9}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - EndGlobal - "; - - SolutionParser solution = ParseSolutionHelper(solutionFileContents); - - Assertion.AssertEquals(3, solution.Projects.Length); - - Assertion.AssertEquals(@"ClassLibrary1\ClassLibrary1.csproj", solution.Projects[0].RelativePath); - Assertion.AssertEquals("{05A5AD00-71B5-4612-AF2F-9EA9121C4111}", solution.Projects[0].ProjectGuid); - Assertion.AssertEquals(1, solution.Projects[0].Dependencies.Count); - Assertion.AssertEquals("{FAB4EE06-6E01-495A-8926-5514599E3DD9}", (string) solution.Projects[0].Dependencies[0]); - Assertion.AssertEquals(null, solution.Projects[0].ParentProjectGuid); - Assertion.AssertEquals("ClassLibrary1", solution.Projects[0].GetUniqueProjectName()); - - Assertion.AssertEquals(@"ClassLibrary2\ClassLibrary2.csproj", solution.Projects[1].RelativePath); - Assertion.AssertEquals("{7F316407-AE3E-4F26-BE61-2C50D30DA158}", solution.Projects[1].ProjectGuid); - Assertion.AssertEquals(2, solution.Projects[1].Dependencies.Count); - Assertion.AssertEquals("{FAB4EE06-6E01-495A-8926-5514599E3DD9}", (string) solution.Projects[1].Dependencies[0]); - Assertion.AssertEquals("{05A5AD00-71B5-4612-AF2F-9EA9121C4111}", (string) solution.Projects[1].Dependencies[1]); - Assertion.AssertEquals(null, solution.Projects[1].ParentProjectGuid); - Assertion.AssertEquals("ClassLibrary2", solution.Projects[1].GetUniqueProjectName()); - - Assertion.AssertEquals(@"ClassLibrary3\ClassLibrary3.csproj", solution.Projects[2].RelativePath); - Assertion.AssertEquals("{FAB4EE06-6E01-495A-8926-5514599E3DD9}", solution.Projects[2].ProjectGuid); - Assertion.AssertEquals(0, solution.Projects[2].Dependencies.Count); - Assertion.AssertEquals(null, solution.Projects[2].ParentProjectGuid); - Assertion.AssertEquals("ClassLibrary3", solution.Projects[2].GetUniqueProjectName()); - } - - /// - /// Tests to see that all the data/properties are correctly parsed out of a Venus - /// project in a .SLN. - /// - /// RGoel - [Test] - public void VenusProject() - { - string solutionFileContents = - @" - Microsoft Visual Studio Solution File, Format Version 9.00 - # Visual Studio 2005 - Project(`{E24C65DC-7377-472B-9ABA-BC803B73C61A}`) = `C:\WebSites\WebApplication3\`, `C:\WebSites\WebApplication3\`, `{464FD0B9-E335-4677-BE1E-6B2F982F4D86}` - ProjectSection(WebsiteProperties) = preProject - ProjectReferences = `{FD705688-88D1-4C22-9BFF-86235D89C2FC}|CSCla;ssLibra;ry1.dll;{F0726D09-042B-4A7A-8A01-6BED2422BD5D}|VCClassLibrary1.dll;` - Frontpage = false - Debug.AspNetCompiler.VirtualPath = `/publishfirst` - Debug.AspNetCompiler.PhysicalPath = `..\rajeev\temp\websites\myfirstwebsite\` - Debug.AspNetCompiler.TargetPath = `..\rajeev\temp\publishfirst\` - Debug.AspNetCompiler.ForceOverwrite = `true` - Debug.AspNetCompiler.Updateable = `false` - Debug.AspNetCompiler.Debug = `true` - Debug.AspNetCompiler.KeyFile = `debugkeyfile.snk` - Debug.AspNetCompiler.KeyContainer = `12345.container` - Debug.AspNetCompiler.DelaySign = `true` - Debug.AspNetCompiler.AllowPartiallyTrustedCallers = `false` - Debug.AspNetCompiler.FixedNames = `debugfixednames` - Release.AspNetCompiler.VirtualPath = `/publishfirst_release` - Release.AspNetCompiler.PhysicalPath = `..\rajeev\temp\websites\myfirstwebsite_release\` - Release.AspNetCompiler.TargetPath = `..\rajeev\temp\publishfirst_release\` - Release.AspNetCompiler.ForceOverwrite = `true` - Release.AspNetCompiler.Updateable = `true` - Release.AspNetCompiler.Debug = `false` - VWDPort = 63496 - EndProjectSection - EndProject - Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|.NET = Debug|.NET - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {464FD0B9-E335-4677-BE1E-6B2F982F4D86}.Debug|.NET.ActiveCfg = Debug|.NET - {464FD0B9-E335-4677-BE1E-6B2F982F4D86}.Debug|.NET.Build.0 = Debug|.NET - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - EndGlobal - "; - - SolutionParser solution = ParseSolutionHelper(solutionFileContents.Replace('`', '"')); - - Assertion.AssertEquals(1, solution.Projects.Length); - - Assertion.AssertEquals(SolutionProjectType.WebProject, solution.Projects[0].ProjectType); - Assertion.AssertEquals(@"C:\WebSites\WebApplication3\", solution.Projects[0].ProjectName); - Assertion.AssertEquals(@"C:\WebSites\WebApplication3\", solution.Projects[0].RelativePath); - Assertion.AssertEquals("{464FD0B9-E335-4677-BE1E-6B2F982F4D86}", solution.Projects[0].ProjectGuid); - Assertion.AssertEquals(2, solution.Projects[0].Dependencies.Count); - Assertion.AssertEquals(null, solution.Projects[0].ParentProjectGuid); - Assertion.AssertEquals(@"C:\WebSites\WebApplication3\", solution.Projects[0].GetUniqueProjectName()); - - Hashtable aspNetCompilerParameters = solution.Projects[0].AspNetConfigurations; - AspNetCompilerParameters debugAspNetCompilerParameters = (AspNetCompilerParameters) aspNetCompilerParameters["Debug"]; - AspNetCompilerParameters releaseAspNetCompilerParameters = (AspNetCompilerParameters) aspNetCompilerParameters["Release"]; - - Assertion.AssertEquals(@"/publishfirst", debugAspNetCompilerParameters.aspNetVirtualPath); - Assertion.AssertEquals(@"..\rajeev\temp\websites\myfirstwebsite\", debugAspNetCompilerParameters.aspNetPhysicalPath); - Assertion.AssertEquals(@"..\rajeev\temp\publishfirst\", debugAspNetCompilerParameters.aspNetTargetPath); - Assertion.AssertEquals(@"true", debugAspNetCompilerParameters.aspNetForce); - Assertion.AssertEquals(@"false", debugAspNetCompilerParameters.aspNetUpdateable); - Assertion.AssertEquals(@"true", debugAspNetCompilerParameters.aspNetDebug); - Assertion.AssertEquals(@"debugkeyfile.snk", debugAspNetCompilerParameters.aspNetKeyFile); - Assertion.AssertEquals(@"12345.container", debugAspNetCompilerParameters.aspNetKeyContainer); - Assertion.AssertEquals(@"true", debugAspNetCompilerParameters.aspNetDelaySign); - Assertion.AssertEquals(@"false", debugAspNetCompilerParameters.aspNetAPTCA); - Assertion.AssertEquals(@"debugfixednames", debugAspNetCompilerParameters.aspNetFixedNames); - - Assertion.AssertEquals(@"/publishfirst_release", releaseAspNetCompilerParameters.aspNetVirtualPath); - Assertion.AssertEquals(@"..\rajeev\temp\websites\myfirstwebsite_release\", releaseAspNetCompilerParameters.aspNetPhysicalPath); - Assertion.AssertEquals(@"..\rajeev\temp\publishfirst_release\", releaseAspNetCompilerParameters.aspNetTargetPath); - Assertion.AssertEquals(@"true", releaseAspNetCompilerParameters.aspNetForce); - Assertion.AssertEquals(@"true", releaseAspNetCompilerParameters.aspNetUpdateable); - Assertion.AssertEquals(@"false", releaseAspNetCompilerParameters.aspNetDebug); - Assertion.AssertEquals("", releaseAspNetCompilerParameters.aspNetKeyFile); - Assertion.AssertEquals("", releaseAspNetCompilerParameters.aspNetKeyContainer); - Assertion.AssertEquals("", releaseAspNetCompilerParameters.aspNetDelaySign); - Assertion.AssertEquals("", releaseAspNetCompilerParameters.aspNetAPTCA); - Assertion.AssertEquals("", releaseAspNetCompilerParameters.aspNetFixedNames); - - ArrayList aspNetProjectReferences = solution.Projects[0].ProjectReferences; - Assertion.AssertEquals(2, aspNetProjectReferences.Count); - Assertion.AssertEquals("{FD705688-88D1-4C22-9BFF-86235D89C2FC}", aspNetProjectReferences[0]); - Assertion.AssertEquals("{F0726D09-042B-4A7A-8A01-6BED2422BD5D}", aspNetProjectReferences[1]); - } - - /// - /// Tests to see that our solution parser correctly recognizes a Venus project that - /// sits inside a solution folder. - /// - [Test] - public void VenusProjectInASolutionFolder() - { - string solutionFileContents = - @" - Microsoft Visual Studio Solution File, Format Version 9.00 - # Visual Studio 2005 - Project('{E24C65DC-7377-472B-9ABA-BC803B73C61A}') = 'C:\WebSites\WebApplication3\', 'C:\WebSites\WebApplication3\', '{464FD0B9-E335-4677-BE1E-6B2F982F4D86}' - ProjectSection(WebsiteProperties) = preProject - Frontpage = false - AspNetCompiler.VirtualPath = '/webprecompile3' - AspNetCompiler.PhysicalPath = '..\..\WebSites\WebApplication3\' - AspNetCompiler.TargetPath = '..\..\..\rajeev\temp\webprecompile3\' - VWDPort = 63496 - EndProjectSection - EndProject - Project('{2150E333-8FDC-42A3-9474-1A3956D46DE8}') = 'MySlnFolder', 'MySlnFolder', '{092FE6E5-71F8-43F7-9C92-30E3124B8A22}' - EndProject - Project('{E24C65DC-7377-472B-9ABA-BC803B73C61A}') = 'C:\WebSites\WebApplication4\', 'C:\WebSites\WebApplication4\', '{947DB39C-77BA-4F7F-A667-0BCD59CE853F}' - ProjectSection(WebsiteProperties) = preProject - Frontpage = false - AspNetCompiler.VirtualPath = '/webprecompile4' - AspNetCompiler.PhysicalPath = '..\..\WebSites\WebApplication4\' - AspNetCompiler.TargetPath = '..\..\..\rajeev\temp\webprecompile4\' - EndProjectSection - EndProject - Global - GlobalSection(NestedProjects) = preSolution - {947DB39C-77BA-4F7F-A667-0BCD59CE853F} = {092FE6E5-71F8-43F7-9C92-30E3124B8A22} - EndGlobalSection - EndGlobal - "; - - SolutionParser solution = ParseSolutionHelper(solutionFileContents); - - Assertion.AssertEquals(3, solution.Projects.Length); - - Assertion.AssertEquals(SolutionProjectType.WebProject, solution.Projects[0].ProjectType); - Assertion.AssertEquals(@"C:\WebSites\WebApplication3\", solution.Projects[0].GetUniqueProjectName()); - - Assertion.AssertEquals(SolutionProjectType.SolutionFolder, solution.Projects[1].ProjectType); - Assertion.AssertEquals("{092FE6E5-71F8-43F7-9C92-30E3124B8A22}", solution.Projects[1].ProjectGuid); - - Assertion.AssertEquals(SolutionProjectType.WebProject, solution.Projects[2].ProjectType); - Assertion.AssertEquals(@"C:\WebSites\WebApplication4\", solution.Projects[2].GetUniqueProjectName()); - Assertion.AssertEquals("{092FE6E5-71F8-43F7-9C92-30E3124B8A22}", solution.Projects[2].ParentProjectGuid); - } - - /// - /// Make sure the solution configurations get parsed correctly for a simple mixed C#/VC solution - /// - /// LukaszG - [Test] - public void ParseSolutionConfigurations() - { - string solutionFileContents = - @" - Microsoft Visual Studio Solution File, Format Version 9.00 - # Visual Studio 2005 - Project('{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}') = 'ClassLibrary1', 'ClassLibrary1\ClassLibrary1.csproj', '{6185CC21-BE89-448A-B3C0-D1C27112E595}' - EndProject - Project('{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}') = 'MainApp', 'MainApp\MainApp.vcproj', '{A6F99D27-47B9-4EA4-BFC9-25157CBDC281}' - EndProject - Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|Mixed Platforms = Debug|Mixed Platforms - Debug|Win32 = Debug|Win32 - Release|Any CPU = Release|Any CPU - Release|Mixed Platforms = Release|Mixed Platforms - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6185CC21-BE89-448A-B3C0-D1C27112E595}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6185CC21-BE89-448A-B3C0-D1C27112E595}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6185CC21-BE89-448A-B3C0-D1C27112E595}.Debug|Mixed Platforms.ActiveCfg = Release|Any CPU - {6185CC21-BE89-448A-B3C0-D1C27112E595}.Debug|Mixed Platforms.Build.0 = Release|Any CPU - {6185CC21-BE89-448A-B3C0-D1C27112E595}.Debug|Win32.ActiveCfg = Debug|Any CPU - {6185CC21-BE89-448A-B3C0-D1C27112E595}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6185CC21-BE89-448A-B3C0-D1C27112E595}.Release|Any CPU.Build.0 = Release|Any CPU - {6185CC21-BE89-448A-B3C0-D1C27112E595}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {6185CC21-BE89-448A-B3C0-D1C27112E595}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {6185CC21-BE89-448A-B3C0-D1C27112E595}.Release|Win32.ActiveCfg = Release|Any CPU - {A6F99D27-47B9-4EA4-BFC9-25157CBDC281}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {A6F99D27-47B9-4EA4-BFC9-25157CBDC281}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {A6F99D27-47B9-4EA4-BFC9-25157CBDC281}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {A6F99D27-47B9-4EA4-BFC9-25157CBDC281}.Debug|Win32.ActiveCfg = Debug|Win32 - {A6F99D27-47B9-4EA4-BFC9-25157CBDC281}.Debug|Win32.Build.0 = Debug|Win32 - {A6F99D27-47B9-4EA4-BFC9-25157CBDC281}.Release|Any CPU.ActiveCfg = Release|Win32 - {A6F99D27-47B9-4EA4-BFC9-25157CBDC281}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {A6F99D27-47B9-4EA4-BFC9-25157CBDC281}.Release|Mixed Platforms.Build.0 = Release|Win32 - {A6F99D27-47B9-4EA4-BFC9-25157CBDC281}.Release|Win32.ActiveCfg = Release|Win32 - {A6F99D27-47B9-4EA4-BFC9-25157CBDC281}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - EndGlobal - "; - - SolutionParser solution = ParseSolutionHelper(solutionFileContents); - - Assertion.AssertEquals(6, solution.SolutionConfigurations.Count); - - List configurationNames = new List(6); - foreach (ConfigurationInSolution configuration in solution.SolutionConfigurations) - { - configurationNames.Add(configuration.FullName); - } - - Assertion.Assert(configurationNames.Contains("Debug|Any CPU")); - Assertion.Assert(configurationNames.Contains("Debug|Mixed Platforms")); - Assertion.Assert(configurationNames.Contains("Debug|Win32")); - Assertion.Assert(configurationNames.Contains("Release|Any CPU")); - Assertion.Assert(configurationNames.Contains("Release|Mixed Platforms")); - Assertion.Assert(configurationNames.Contains("Release|Win32")); - - Assertion.AssertEquals("Default solution configuration", "Debug", solution.GetDefaultConfigurationName()); - Assertion.AssertEquals("Default solution platform", "Mixed Platforms", solution.GetDefaultPlatformName()); - } - - /// - /// Test some invalid cases for solution configuration parsing. - /// There can be only one '=' character in a sln cfg entry, separating two identical names - /// - /// LukaszG - [ExpectedException(typeof(InvalidProjectFileException))] - [Test] - public void ParseInvalidSolutionConfigurations1() - { - string solutionFileContents = - @" - Microsoft Visual Studio Solution File, Format Version 9.00 - # Visual Studio 2005 - Project('{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}') = 'ClassLibrary1', 'ClassLibrary1\ClassLibrary1.csproj', '{6185CC21-BE89-448A-B3C0-D1C27112E595}' - EndProject - Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any=CPU = Debug|Any=CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - EndGlobal - "; - - SolutionParser solution = ParseSolutionHelper(solutionFileContents); - } - - /// - /// Test some invalid cases for solution configuration parsing - /// There can be only one '=' character in a sln cfg entry, separating two identical names - /// - /// LukaszG - [ExpectedException(typeof(InvalidProjectFileException))] - [Test] - public void ParseInvalidSolutionConfigurations2() - { - string solutionFileContents = - @" - Microsoft Visual Studio Solution File, Format Version 9.00 - # Visual Studio 2005 - Project('{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}') = 'ClassLibrary1', 'ClassLibrary1\ClassLibrary1.csproj', '{6185CC21-BE89-448A-B3C0-D1C27112E595}' - EndProject - Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Something|Else - Release|Any CPU = Release|Any CPU - EndGlobalSection - EndGlobal - "; - - SolutionParser solution = ParseSolutionHelper(solutionFileContents); - } - - /// - /// Test some invalid cases for solution configuration parsing - /// Solution configurations must include the platform part - /// - /// LukaszG - [ExpectedException(typeof(InvalidProjectFileException))] - [Test] - public void ParseInvalidSolutionConfigurations3() - { - string solutionFileContents = - @" - Microsoft Visual Studio Solution File, Format Version 9.00 - # Visual Studio 2005 - Project('{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}') = 'ClassLibrary1', 'ClassLibrary1\ClassLibrary1.csproj', '{6185CC21-BE89-448A-B3C0-D1C27112E595}' - EndProject - Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug = Debug - Release|Any CPU = Release|Any CPU - EndGlobalSection - EndGlobal - "; - - SolutionParser solution = ParseSolutionHelper(solutionFileContents); - } - - /// - /// Make sure the project configurations in solution configurations get parsed correctly - /// for a simple mixed C#/VC solution - /// - /// LukaszG - [Test] - public void ParseProjectConfigurationsInSolutionConfigurations1() - { - string solutionFileContents = - @" - Microsoft Visual Studio Solution File, Format Version 9.00 - # Visual Studio 2005 - Project('{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}') = 'ClassLibrary1', 'ClassLibrary1\ClassLibrary1.csproj', '{6185CC21-BE89-448A-B3C0-D1C27112E595}' - EndProject - Project('{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}') = 'MainApp', 'MainApp\MainApp.vcproj', '{A6F99D27-47B9-4EA4-BFC9-25157CBDC281}' - EndProject - Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|Mixed Platforms = Debug|Mixed Platforms - Debug|Win32 = Debug|Win32 - Release|Any CPU = Release|Any CPU - Release|Mixed Platforms = Release|Mixed Platforms - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6185CC21-BE89-448A-B3C0-D1C27112E595}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6185CC21-BE89-448A-B3C0-D1C27112E595}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6185CC21-BE89-448A-B3C0-D1C27112E595}.Debug|Mixed Platforms.ActiveCfg = Release|Any CPU - {6185CC21-BE89-448A-B3C0-D1C27112E595}.Debug|Mixed Platforms.Build.0 = Release|Any CPU - {6185CC21-BE89-448A-B3C0-D1C27112E595}.Debug|Win32.ActiveCfg = Debug|Any CPU - {6185CC21-BE89-448A-B3C0-D1C27112E595}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6185CC21-BE89-448A-B3C0-D1C27112E595}.Release|Any CPU.Build.0 = Release|Any CPU - {6185CC21-BE89-448A-B3C0-D1C27112E595}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {6185CC21-BE89-448A-B3C0-D1C27112E595}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {6185CC21-BE89-448A-B3C0-D1C27112E595}.Release|Win32.ActiveCfg = Release|Any CPU - {A6F99D27-47B9-4EA4-BFC9-25157CBDC281}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {A6F99D27-47B9-4EA4-BFC9-25157CBDC281}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {A6F99D27-47B9-4EA4-BFC9-25157CBDC281}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {A6F99D27-47B9-4EA4-BFC9-25157CBDC281}.Debug|Win32.ActiveCfg = Debug|Win32 - {A6F99D27-47B9-4EA4-BFC9-25157CBDC281}.Debug|Win32.Build.0 = Debug|Win32 - {A6F99D27-47B9-4EA4-BFC9-25157CBDC281}.Release|Any CPU.ActiveCfg = Release|Win32 - {A6F99D27-47B9-4EA4-BFC9-25157CBDC281}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {A6F99D27-47B9-4EA4-BFC9-25157CBDC281}.Release|Mixed Platforms.Build.0 = Release|Win32 - {A6F99D27-47B9-4EA4-BFC9-25157CBDC281}.Release|Win32.ActiveCfg = Release|Win32 - {A6F99D27-47B9-4EA4-BFC9-25157CBDC281}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - EndGlobal - "; - - SolutionParser solution = ParseSolutionHelper(solutionFileContents); - - ProjectInSolution csProject = (ProjectInSolution) solution.ProjectsByGuid["{6185CC21-BE89-448A-B3C0-D1C27112E595}"]; - ProjectInSolution vcProject = (ProjectInSolution) solution.ProjectsByGuid["{A6F99D27-47B9-4EA4-BFC9-25157CBDC281}"]; - - Assertion.AssertEquals(6, csProject.ProjectConfigurations.Count); - - Assertion.AssertEquals("Debug|AnyCPU", csProject.ProjectConfigurations["Debug|Any CPU"].FullName); - Assertion.AssertEquals(true, csProject.ProjectConfigurations["Debug|Any CPU"].IncludeInBuild); - - Assertion.AssertEquals("Release|AnyCPU", csProject.ProjectConfigurations["Debug|Mixed Platforms"].FullName); - Assertion.AssertEquals(true, csProject.ProjectConfigurations["Debug|Mixed Platforms"].IncludeInBuild); - - Assertion.AssertEquals("Debug|AnyCPU", csProject.ProjectConfigurations["Debug|Win32"].FullName); - Assertion.AssertEquals(false, csProject.ProjectConfigurations["Debug|Win32"].IncludeInBuild); - - Assertion.AssertEquals("Release|AnyCPU", csProject.ProjectConfigurations["Release|Any CPU"].FullName); - Assertion.AssertEquals(true, csProject.ProjectConfigurations["Release|Any CPU"].IncludeInBuild); - - Assertion.AssertEquals("Release|AnyCPU", csProject.ProjectConfigurations["Release|Mixed Platforms"].FullName); - Assertion.AssertEquals(true, csProject.ProjectConfigurations["Release|Mixed Platforms"].IncludeInBuild); - - Assertion.AssertEquals("Release|AnyCPU", csProject.ProjectConfigurations["Release|Win32"].FullName); - Assertion.AssertEquals(false, csProject.ProjectConfigurations["Release|Win32"].IncludeInBuild); - - Assertion.AssertEquals(6, vcProject.ProjectConfigurations.Count); - - Assertion.AssertEquals("Debug|Win32", vcProject.ProjectConfigurations["Debug|Any CPU"].FullName); - Assertion.AssertEquals(false, vcProject.ProjectConfigurations["Debug|Any CPU"].IncludeInBuild); - - Assertion.AssertEquals("Debug|Win32", vcProject.ProjectConfigurations["Debug|Mixed Platforms"].FullName); - Assertion.AssertEquals(true, vcProject.ProjectConfigurations["Debug|Mixed Platforms"].IncludeInBuild); - - Assertion.AssertEquals("Debug|Win32", vcProject.ProjectConfigurations["Debug|Win32"].FullName); - Assertion.AssertEquals(true, vcProject.ProjectConfigurations["Debug|Win32"].IncludeInBuild); - - Assertion.AssertEquals("Release|Win32", vcProject.ProjectConfigurations["Release|Any CPU"].FullName); - Assertion.AssertEquals(false, vcProject.ProjectConfigurations["Release|Any CPU"].IncludeInBuild); - - Assertion.AssertEquals("Release|Win32", vcProject.ProjectConfigurations["Release|Mixed Platforms"].FullName); - Assertion.AssertEquals(true, vcProject.ProjectConfigurations["Release|Mixed Platforms"].IncludeInBuild); - - Assertion.AssertEquals("Release|Win32", vcProject.ProjectConfigurations["Release|Win32"].FullName); - Assertion.AssertEquals(true, vcProject.ProjectConfigurations["Release|Win32"].IncludeInBuild); - } - - /// - /// Make sure the project configurations in solution configurations get parsed correctly - /// for a more tricky solution - /// - /// LukaszG - [Test] - public void ParseProjectConfigurationsInSolutionConfigurations2() - { - string solutionFileContents = - @" - Microsoft Visual Studio Solution File, Format Version 9.00 - # Visual Studio 2005 - Project('{E24C65DC-7377-472B-9ABA-BC803B73C61A}') = 'C:\solutions\WebSite1\', '..\WebSite1\', '{E8E75132-67E4-4D6F-9CAE-8DA4C883F418}' - EndProject - Project('{E24C65DC-7377-472B-9ABA-BC803B73C61A}') = 'C:\solutions\WebSite2\', '..\WebSite2\', '{E8E75132-67E4-4D6F-9CAE-8DA4C883F419}' - EndProject - Project('{2150E333-8FDC-42A3-9474-1A3956D46DE8}') = 'NewFolder1', 'NewFolder1', '{54D20FFE-84BE-4066-A51E-B25D040A4235}' - EndProject - Project('{2150E333-8FDC-42A3-9474-1A3956D46DE8}') = 'NewFolder2', 'NewFolder2', '{D2633E4D-46FF-4C4E-8340-4BC7CDF78615}' - EndProject - Project('{8BC9CEB9-8B4A-11D0-8D11-00A0C91BC942}') = 'MSBuild.exe', '..\..\dd\binaries.x86dbg\bin\i386\MSBuild.exe', '{25FD9E7C-F37E-48E0-9A7C-607FE4AACCC0}' - EndProject - Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|.NET = Debug|.NET - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {E8E75132-67E4-4D6F-9CAE-8DA4C883F418}.Debug|.NET.ActiveCfg = Debug|.NET - {E8E75132-67E4-4D6F-9CAE-8DA4C883F418}.Debug|.NET.Build.0 = Debug|.NET - {25FD9E7C-F37E-48E0-9A7C-607FE4AACCC0}.Debug|.NET.ActiveCfg = Debug - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {25FD9E7C-F37E-48E0-9A7C-607FE4AACCC0} = {D2633E4D-46FF-4C4E-8340-4BC7CDF78615} - EndGlobalSection - EndGlobal - "; - - SolutionParser solution = ParseSolutionHelper(solutionFileContents); - - ProjectInSolution webProject = (ProjectInSolution)solution.ProjectsByGuid["{E8E75132-67E4-4D6F-9CAE-8DA4C883F418}"]; - ProjectInSolution exeProject = (ProjectInSolution)solution.ProjectsByGuid["{25FD9E7C-F37E-48E0-9A7C-607FE4AACCC0}"]; - ProjectInSolution missingWebProject = (ProjectInSolution)solution.ProjectsByGuid["{E8E75132-67E4-4D6F-9CAE-8DA4C883F419}"]; - - Assertion.AssertEquals(1, webProject.ProjectConfigurations.Count); - - Assertion.AssertEquals("Debug|.NET", webProject.ProjectConfigurations["Debug|.NET"].FullName); - Assertion.AssertEquals(true, webProject.ProjectConfigurations["Debug|.NET"].IncludeInBuild); - - Assertion.AssertEquals(1, exeProject.ProjectConfigurations.Count); - - Assertion.AssertEquals("Debug", exeProject.ProjectConfigurations["Debug|.NET"].FullName); - Assertion.AssertEquals(false, exeProject.ProjectConfigurations["Debug|.NET"].IncludeInBuild); - - Assertion.AssertEquals(0, missingWebProject.ProjectConfigurations.Count); - - Assertion.AssertEquals("Default solution configuration", "Debug", solution.GetDefaultConfigurationName()); - Assertion.AssertEquals("Default solution platform", ".NET", solution.GetDefaultPlatformName()); - } - } -} diff --git a/src/Deprecated/Engine/Shared/UnitTests/StreamHelpers.cs b/src/Deprecated/Engine/Shared/UnitTests/StreamHelpers.cs deleted file mode 100644 index b390295cca4..00000000000 --- a/src/Deprecated/Engine/Shared/UnitTests/StreamHelpers.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.IO; -using System.Reflection; -using NUnit.Framework; - - -namespace Microsoft.Build.UnitTests -{ - sealed internal class StreamHelpers - { - /// - /// Take a string and convert it to a StreamReader. - /// - /// - /// - static internal StreamReader StringToStreamReader(string value) - { - MemoryStream m = new MemoryStream(); - TextWriter w = new StreamWriter(m, System.Text.Encoding.Default); - - w.Write(value); - w.Flush(); - m.Seek(0, SeekOrigin.Begin); - - return new StreamReader(m); - } - } -} diff --git a/src/Deprecated/Engine/Shared/UnitTests/TypeLoader_Tests.cs b/src/Deprecated/Engine/Shared/UnitTests/TypeLoader_Tests.cs deleted file mode 100644 index 656b454d8c0..00000000000 --- a/src/Deprecated/Engine/Shared/UnitTests/TypeLoader_Tests.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections; -using NUnit.Framework; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class TypeLoader_Tests - { - [Test] - public void Basic() - { - - Assertion.Assert(TypeLoader.IsPartialTypeNameMatch("Csc", "csc")); // ==> exact match - Assertion.Assert(TypeLoader.IsPartialTypeNameMatch("Microsoft.Build.Tasks.Csc", "Microsoft.Build.Tasks.Csc")); // ==> exact match - Assertion.Assert(TypeLoader.IsPartialTypeNameMatch("Microsoft.Build.Tasks.Csc", "Csc")); // ==> partial match - Assertion.Assert(TypeLoader.IsPartialTypeNameMatch("Microsoft.Build.Tasks.Csc", "Tasks.Csc")); // ==> partial match - Assertion.Assert(TypeLoader.IsPartialTypeNameMatch("MyTasks.ATask+NestedTask", "NestedTask")); // ==> partial match - Assertion.Assert(TypeLoader.IsPartialTypeNameMatch("MyTasks.ATask\\\\+NestedTask", "NestedTask")); // ==> partial match - Assertion.Assert(!TypeLoader.IsPartialTypeNameMatch("MyTasks.CscTask", "Csc")); // ==> no match - Assertion.Assert(!TypeLoader.IsPartialTypeNameMatch("MyTasks.MyCsc", "Csc")); // ==> no match - Assertion.Assert(!TypeLoader.IsPartialTypeNameMatch("MyTasks.ATask\\.Csc", "Csc")); // ==> no match - Assertion.Assert(!TypeLoader.IsPartialTypeNameMatch("MyTasks.ATask\\\\\\.Csc", "Csc")); // ==> no match - } - - [Test] - public void Regress_Mutation_TrailingPartMustMatch() - { - Assertion.Assert(!TypeLoader.IsPartialTypeNameMatch("Microsoft.Build.Tasks.Csc", "Vbc")); - } - - [Test] - public void Regress_Mutation_ParameterOrderDoesntMatter() - { - Assertion.Assert(TypeLoader.IsPartialTypeNameMatch("Csc", "Microsoft.Build.Tasks.Csc")); - } - - } -} diff --git a/src/Deprecated/Engine/Shared/UnitTests/XmakeAttributes_Tests.cs b/src/Deprecated/Engine/Shared/UnitTests/XmakeAttributes_Tests.cs deleted file mode 100644 index 117b0a710cf..00000000000 --- a/src/Deprecated/Engine/Shared/UnitTests/XmakeAttributes_Tests.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections.Generic; - -using NUnit.Framework; - -using Microsoft.Build.BuildEngine; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class XmakeAttributesTest - { - [Test] - public void TestAttributeMethods() - { - Assert.IsFalse(XMakeAttributes.IsSpecialTaskAttribute("NotAnAttribute")); - Assert.IsTrue(XMakeAttributes.IsSpecialTaskAttribute(XMakeAttributes.xmlns)); - Assert.IsTrue(XMakeAttributes.IsSpecialTaskAttribute(XMakeAttributes.continueOnError)); - Assert.IsTrue(XMakeAttributes.IsSpecialTaskAttribute(XMakeAttributes.condition)); - Assert.IsTrue(XMakeAttributes.IsSpecialTaskAttribute(XMakeAttributes.msbuildArchitecture)); - Assert.IsTrue(XMakeAttributes.IsSpecialTaskAttribute(XMakeAttributes.msbuildRuntime)); - - Assert.IsFalse(XMakeAttributes.IsBadlyCasedSpecialTaskAttribute("NotAnAttribute")); - Assert.IsFalse(XMakeAttributes.IsBadlyCasedSpecialTaskAttribute(XMakeAttributes.include)); - Assert.IsFalse(XMakeAttributes.IsBadlyCasedSpecialTaskAttribute(XMakeAttributes.continueOnError)); - Assert.IsFalse(XMakeAttributes.IsBadlyCasedSpecialTaskAttribute(XMakeAttributes.condition)); - Assert.IsFalse(XMakeAttributes.IsBadlyCasedSpecialTaskAttribute(XMakeAttributes.msbuildArchitecture)); - Assert.IsFalse(XMakeAttributes.IsBadlyCasedSpecialTaskAttribute(XMakeAttributes.msbuildRuntime)); - Assert.IsTrue(XMakeAttributes.IsBadlyCasedSpecialTaskAttribute("continueOnError")); - Assert.IsTrue(XMakeAttributes.IsBadlyCasedSpecialTaskAttribute("condition")); - Assert.IsTrue(XMakeAttributes.IsBadlyCasedSpecialTaskAttribute("MsbuildRuntime")); - Assert.IsTrue(XMakeAttributes.IsBadlyCasedSpecialTaskAttribute("msbuildarchitecture")); - - Assert.IsFalse(XMakeAttributes.IsNonBatchingTargetAttribute("NotAnAttribute")); - Assert.IsTrue(XMakeAttributes.IsNonBatchingTargetAttribute(XMakeAttributes.dependsOnTargets)); - Assert.IsTrue(XMakeAttributes.IsNonBatchingTargetAttribute(XMakeAttributes.name)); - Assert.IsTrue(XMakeAttributes.IsNonBatchingTargetAttribute(XMakeAttributes.condition)); - } - } -} diff --git a/src/Deprecated/Engine/Shared/UnitTests/XmlUtilities_Tests.cs b/src/Deprecated/Engine/Shared/UnitTests/XmlUtilities_Tests.cs deleted file mode 100644 index 55f9f452285..00000000000 --- a/src/Deprecated/Engine/Shared/UnitTests/XmlUtilities_Tests.cs +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections.Generic; - -using NUnit.Framework; - -using Microsoft.Build.BuildEngine; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.UnitTests -{ - [TestFixture] - public class XmlUtilities_Tests - { - // Various invalid names, with the first invalid character listed for each - private string[,] invalidNames = new string[,] { - {"foo.bar", "."}, - {"1baz", "1"}, - {"+", "+"}, - {"a+", "+"}, - {"_-.", "."}, - {"AZaz09%", "%"}, - {" x", " "}, - {"A Zaz09%", " "}, - {"foo.", "."}, - {"\u03A3", "\u03A3"}, // sigma - {"a1\u03A3", "\u03A3"} - }; - - /// - /// Verify we get the right invalid char listed in the error string - /// - [Test] - public void InvalidNameErrorLocation() - { - for (int i = 0; i <= invalidNames.GetUpperBound(0); i++) - { - InvalidNameErrorLocationHelper(invalidNames[i,0], invalidNames[i,1]); - } - } - - /// - /// Helper for invalid name error location test - /// - /// - /// - private void InvalidNameErrorLocationHelper(string name, string badChar) - { - string expected = ResourceUtilities.FormatResourceString("NameInvalid", name, badChar); - string actual = String.Empty; - - try - { - XmlUtilities.VerifyThrowValidElementName(name); - } - catch (ArgumentException ex) - { - actual = ex.Message; - } - - Assertion.AssertEquals(expected, actual); - } - } -} diff --git a/src/Deprecated/Engine/Shared/VisualStudioConstants.cs b/src/Deprecated/Engine/Shared/VisualStudioConstants.cs deleted file mode 100644 index 13c6a740f60..00000000000 --- a/src/Deprecated/Engine/Shared/VisualStudioConstants.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -namespace Microsoft.Build.BuildEngine.Shared -{ - /// - /// Shared Visual Studio related constants - /// - internal static class VisualStudioConstants - { - /// - /// This is the version number of the most recent solution file format - /// we will read. It will be the version number used in solution files - /// by the latest version of Visual Studio. - /// - internal const int CurrentVisualStudioSolutionFileVersion = 11; - - /// - /// This is the version number of the latest version of Visual Studio. - /// - /// - /// We use it for the version of the VC PIA we try to load and to find - /// Visual Studio registry hive that we use to find where vcbuild.exe might be. - /// - internal const string CurrentVisualStudioVersion = "10.0"; - } -} diff --git a/src/Deprecated/Engine/Shared/XMakeAttributes.cs b/src/Deprecated/Engine/Shared/XMakeAttributes.cs deleted file mode 100644 index c226f194ab6..00000000000 --- a/src/Deprecated/Engine/Shared/XMakeAttributes.cs +++ /dev/null @@ -1,114 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; - -namespace Microsoft.Build.BuildEngine.Shared -{ - /// - /// Contains the names of the known attributes in the XML project file. - /// - /// RGoel - internal static class XMakeAttributes - { - internal const string condition = "Condition"; - internal const string executeTargets = "ExecuteTargets"; - internal const string name = "Name"; - internal const string msbuildVersion = "MSBuildVersion"; - internal const string xmlns = "xmlns"; - internal const string defaultTargets = "DefaultTargets"; - internal const string initialTargets = "InitialTargets"; - internal const string dependsOnTargets = "DependsOnTargets"; - internal const string beforeTargets = "BeforeTargets"; - internal const string afterTargets = "AfterTargets"; - internal const string include = "Include"; - internal const string exclude = "Exclude"; - internal const string remove = "Remove"; - internal const string keepMetadata = "KeepMetadata"; - internal const string removeMetadata = "RemoveMetadata"; - internal const string keepDuplicates = "KeepDuplicates"; - internal const string inputs = "Inputs"; - internal const string outputs = "Outputs"; - internal const string keepDuplicateOutputs = "KeepDuplicateOutputs"; - internal const string assemblyName = "AssemblyName"; - internal const string assemblyFile = "AssemblyFile"; - internal const string taskName = "TaskName"; - internal const string continueOnError = "ContinueOnError"; - internal const string project = "Project"; - internal const string taskParameter = "TaskParameter"; - internal const string itemName = "ItemName"; - internal const string propertyName = "PropertyName"; - internal const string toolsVersion = "ToolsVersion"; - internal const string requiredRuntime = "RequiredRuntime"; - internal const string requiredPlatform = "RequiredPlatform"; - internal const string runtime = "Runtime"; - internal const string msbuildRuntime = "MSBuildRuntime"; - internal const string architecture = "Architecture"; - internal const string msbuildArchitecture = "MSBuildArchitecture"; - internal const string taskFactory = "TaskFactory"; - internal const string parameterType = "ParameterType"; - internal const string required = "Required"; - internal const string output = "Output"; - internal const string defaultValue = "DefaultValue"; - internal const string evaluate = "Evaluate"; - internal const string label = "Label"; - internal const string returns = "Returns"; - - internal const string defaultXmlNamespace = "http://schemas.microsoft.com/developer/msbuild/2003"; - - /// - /// Returns true if and only if the specified attribute is one of the attributes that the engine specifically recognizes - /// on a task and treats in a special way. - /// - /// SumedhK - /// - /// true, if given attribute is a reserved task attribute - internal static bool IsSpecialTaskAttribute - ( - string attribute - ) - { - // Currently the known "special" attributes for a task are: - // Condition, ContinueOnError - // - // We want to match case-sensitively on all of them - return (attribute == condition) || - (attribute == continueOnError) || - (attribute == msbuildRuntime) || - (attribute == msbuildArchitecture) || - (attribute == xmlns); - } - - /// - /// Checks if the specified attribute is a reserved task attribute with incorrect casing. - /// - /// SumedhK - /// - /// true, if the given attribute is reserved and badly cased - internal static bool IsBadlyCasedSpecialTaskAttribute(string attribute) - { - return !IsSpecialTaskAttribute(attribute) && - ((String.Equals(attribute, condition, StringComparison.OrdinalIgnoreCase)) || - (String.Equals(attribute, continueOnError, StringComparison.OrdinalIgnoreCase)) || - (String.Equals(attribute, msbuildRuntime, StringComparison.OrdinalIgnoreCase)) || - (String.Equals(attribute, msbuildArchitecture, StringComparison.OrdinalIgnoreCase))); - } - - /// - /// Indicates if the specified attribute cannot be used for batching targets. - /// - /// SumedhK - /// - /// true, if a target cannot batch on the given attribute - internal static bool IsNonBatchingTargetAttribute(string attribute) - { - return (attribute == name) || - (attribute == condition) || - (attribute == dependsOnTargets); - } - } -} diff --git a/src/Deprecated/Engine/Shared/XMakeElements.cs b/src/Deprecated/Engine/Shared/XMakeElements.cs deleted file mode 100644 index 3e759935887..00000000000 --- a/src/Deprecated/Engine/Shared/XMakeElements.cs +++ /dev/null @@ -1,102 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System.Collections; -using System.Xml; - -namespace Microsoft.Build.BuildEngine.Shared -{ - /// - /// Contains the names of the known elements in the XML project file. - /// - /// RGoel - internal static class XMakeElements - { - internal const string project = "Project"; - internal const string visualStudioProject = "VisualStudioProject"; - internal const string target = "Target"; - internal const string propertyGroup = "PropertyGroup"; - internal const string output = "Output"; - internal const string itemGroup = "ItemGroup"; - internal const string itemDefinitionGroup = "ItemDefinitionGroup"; - internal const string usingTask = "UsingTask"; - internal const string projectExtensions = "ProjectExtensions"; - internal const string onError = "OnError"; - internal const string error = "Error"; - internal const string warning = "Warning"; - internal const string message = "Message"; - internal const string import = "Import"; - internal const string importGroup = "ImportGroup"; - internal const string choose = "Choose"; - internal const string when = "When"; - internal const string otherwise = "Otherwise"; - internal const string usingTaskParameterGroup = "ParameterGroup"; - internal const string usingTaskParameter = "Parameter"; - internal const string usingTaskBody = "Task"; - - /// - /// Indicates if the given node is valid as a child of a task element. - /// - /// SumedhK - /// - /// true, if specified node can be a child of a task element - internal static bool IsValidTaskChildNode(XmlNode childNode) - { - return (childNode.Name == output) || - (childNode.NodeType == XmlNodeType.Comment) || - (childNode.NodeType == XmlNodeType.Whitespace); - } - - internal static readonly char[] illegalTargetNameCharacters = new char[] { '$', '@', '(', ')', '%', '*', '?', '.' }; - - // Names that cannot be used as property or item names because they are reserved - internal static readonly string[] illegalPropertyOrItemNames = new string[] { -// XMakeElements.project, // "Project" is not reserved, because unfortunately ProjectReference items - // already use it as metadata name. - XMakeElements.visualStudioProject, - XMakeElements.target, - XMakeElements.propertyGroup, - XMakeElements.output, - XMakeElements.itemGroup, - XMakeElements.usingTask, - XMakeElements.projectExtensions, - XMakeElements.onError, -// XMakeElements.import, // "Import" items are used by Visual Basic projects - XMakeElements.importGroup, - XMakeElements.choose, - XMakeElements.when, - XMakeElements.otherwise - }; - - // The set of XMake reserved item/property names (e.g. Choose, Message etc.) - private static Hashtable illegalItemOrPropertyNamesHashtable; - - /// - /// Read-only internal accessor for the hashtable containing - /// MSBuild reserved item/property names (like "Choose", for example). - /// - /// LukaszG - internal static Hashtable IllegalItemPropertyNames - { - get - { - // Lazy creation - if (illegalItemOrPropertyNamesHashtable == null) - { - illegalItemOrPropertyNamesHashtable = new Hashtable(XMakeElements.illegalPropertyOrItemNames.Length); - - foreach (string reservedName in XMakeElements.illegalPropertyOrItemNames) - { - illegalItemOrPropertyNamesHashtable.Add(reservedName, string.Empty); - } - } - - return illegalItemOrPropertyNamesHashtable; - } - } - } -} diff --git a/src/Deprecated/Engine/Shared/XmlUtilities.cs b/src/Deprecated/Engine/Shared/XmlUtilities.cs deleted file mode 100644 index 700cbfdb753..00000000000 --- a/src/Deprecated/Engine/Shared/XmlUtilities.cs +++ /dev/null @@ -1,266 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Xml; - -namespace Microsoft.Build.BuildEngine.Shared -{ - /// - /// This class contains utility methods for XML manipulation. - /// - /// SumedhK - internal static class XmlUtilities - { - /// - /// This method renames an XML element. Well, actually you can't directly - /// rename an XML element using the DOM, so what you have to do is create - /// a brand new XML element with the new name, and copy over all the attributes - /// and children. This method returns the new XML element object. - /// - /// - /// - /// Can be null if global namespace. - /// new/renamed element - /// RGoel - internal static XmlElement RenameXmlElement(XmlElement oldElement, string newElementName, string xmlNamespace) - { - XmlElement newElement = (xmlNamespace == null) - ? oldElement.OwnerDocument.CreateElement(newElementName) - : oldElement.OwnerDocument.CreateElement(newElementName, xmlNamespace); - - // Copy over all the attributes. - foreach (XmlAttribute oldAttribute in oldElement.Attributes) - { - XmlAttribute newAttribute = (XmlAttribute)oldAttribute.CloneNode(true); - newElement.SetAttributeNode(newAttribute); - } - - // Copy over all the child nodes. - foreach (XmlNode oldChildNode in oldElement.ChildNodes) - { - XmlNode newChildNode = oldChildNode.CloneNode(true); - newElement.AppendChild(newChildNode); - } - - - - // Add the new element in the same place the old element was. - oldElement.ParentNode?.ReplaceChild(newElement, oldElement); - - - return newElement; - } - - /// - /// Retrieves the file that the given XML node was defined in. If the XML node is purely in-memory, it may not have a file - /// associated with it, in which case the default file is returned. - /// - /// SumedhK - /// - /// Can be empty string. - /// The path to the XML node's file, or the default file. - internal static string GetXmlNodeFile(XmlNode node, string defaultFile) - { - ErrorUtilities.VerifyThrow(node != null, "Need XML node."); - ErrorUtilities.VerifyThrow(defaultFile != null, "Must specify the default file to use."); - - string file = defaultFile; - - // NOTE: the XML node may not have a filename if it's purely an in-memory node - if (!string.IsNullOrEmpty(node.OwnerDocument.BaseURI)) - { - file = new Uri(node.OwnerDocument.BaseURI).LocalPath; - } - - return file; - } - - /// - /// An XML document can have many root nodes, but usually we want the single root - /// element. Callers can test each root node in turn with this method, until it returns - /// true. - /// - /// Candidate root node - /// true if node is the root element - /// danmose - internal static bool IsXmlRootElement(XmlNode node) - { - // "A Document node can have the following child node types: XmlDeclaration, - // Element (maximum of one), ProcessingInstruction, Comment, and DocumentType." - return - (node.NodeType != XmlNodeType.Comment) && - (node.NodeType != XmlNodeType.Whitespace) && - (node.NodeType != XmlNodeType.XmlDeclaration) && - (node.NodeType != XmlNodeType.ProcessingInstruction) && - (node.NodeType != XmlNodeType.DocumentType) - ; - } - - /// - /// Verifies that a name is valid for the name of an item, property, or piece of metadata. - /// If it isn't, throws an ArgumentException indicating the invalid character. - /// - /// - /// Note that our restrictions are more stringent than the XML Standard's restrictions. - /// - /// ArgumentException - /// name to validate - /// danmose - internal static void VerifyThrowValidElementName(string name) - { - int firstInvalidCharLocation = LocateFirstInvalidElementNameCharacter(name); - - if (-1 != firstInvalidCharLocation) - { - ErrorUtilities.VerifyThrowArgument(false, "NameInvalid", name, name[firstInvalidCharLocation]); - } - } - - /// - /// Verifies that a name is valid for the name of an item, property, or piece of metadata. - /// If it isn't, throws an InvalidProjectException indicating the invalid character. - /// - /// - /// Note that our restrictions are more stringent than the XML Standard's restrictions. - /// - internal static void VerifyThrowProjectValidElementName(XmlElement element) - { - string name = element.Name; - int firstInvalidCharLocation = LocateFirstInvalidElementNameCharacter(name); - - if (-1 != firstInvalidCharLocation) - { - ProjectErrorUtilities.ThrowInvalidProject(element, "NameInvalid", name, name[firstInvalidCharLocation]); - } - } - - /// - /// Indicates if the given name is valid as the name of an item, property or metadatum. - /// - /// - /// Note that our restrictions are more stringent than those of the XML Standard. - /// - /// SumedhK - /// - /// true, if name is valid - internal static bool IsValidElementName(string name) - { - return LocateFirstInvalidElementNameCharacter(name) == -1; - } - - /// - /// Finds the location of the first invalid character, if any, in the name of an - /// item, property, or piece of metadata. Returns the location of the first invalid character, or -1 if there are none. - /// Valid names must match this pattern: [A-Za-z_][A-Za-z_0-9\-.]* - /// Note, this is a subset of all possible valid XmlElement names: we use a subset because we also - /// have to match this same set in our regular expressions, and allowing all valid XmlElement name - /// characters in a regular expression would be impractical. - /// - /// - /// Note that our restrictions are more stringent than the XML Standard's restrictions. - /// PERF: This method has to be as fast as possible, as it's called when any item, property, or piece - /// of metadata is constructed. - /// - internal static int LocateFirstInvalidElementNameCharacter(string name) - { - // Check the first character. - // Try capital letters first. - // Optimize slightly for success. - if (!IsValidInitialElementNameCharacter(name[0])) - { - return 0; - } - - // Check subsequent characters. - // Try lower case letters first. - // Optimize slightly for success. - for (int i = 1; i < name.Length; i++) - { - if (!IsValidSubsequentElementNameCharacter(name[i])) - { - return i; - } - } - - // If we got here, the name was valid. - return -1; - } - - /// - /// Load the xml file using XMLTextReader and locate the element and attribute specified and then - /// return the value. This is a quick way to peek at the xml file whithout having the go through - /// the XMLDocument (MSDN article (Chapter 9 - Improving XML Performance)). - /// - internal static string GetAttributeValueForElementFromFile - ( - string projectFileName, - string elementName, - string attributeName - ) - { - string attributeValue = null; - - try - { - using (XmlTextReader xmlReader = new XmlTextReader(projectFileName)) - { - xmlReader.DtdProcessing = DtdProcessing.Ignore; - while (xmlReader.Read()) - { - if (xmlReader.NodeType == XmlNodeType.Element) - { - if (String.Equals(xmlReader.Name, elementName, StringComparison.OrdinalIgnoreCase)) - { - if (xmlReader.HasAttributes) - { - for (int i = 0; i < xmlReader.AttributeCount; i++) - { - xmlReader.MoveToAttribute(i); - if (String.Equals(xmlReader.Name, attributeName, StringComparison.OrdinalIgnoreCase)) - { - attributeValue = xmlReader.Value; - break; - } - } - } - // if we have already located the element then we are done - break; - } - } - } - } - } - catch (XmlException) - { - // Ignore any XML exceptions as it will be caught later on - } - catch (System.IO.IOException) - { - // Ignore any IO exceptions as it will be caught later on - } - - return attributeValue; - } - - internal static bool IsValidInitialElementNameCharacter(char c) - { - return (c >= 'A' && c <= 'Z') || - (c >= 'a' && c <= 'z') || - (c == '_'); - } - - internal static bool IsValidSubsequentElementNameCharacter(char c) - { - return (c >= 'A' && c <= 'Z') || - (c >= 'a' && c <= 'z') || - (c >= '0' && c <= '9') || - (c == '_') || - (c == '-'); - } - } -} diff --git a/src/Deprecated/Engine/Solution/SolutionWrapperProject.cs b/src/Deprecated/Engine/Solution/SolutionWrapperProject.cs deleted file mode 100644 index 33542698739..00000000000 --- a/src/Deprecated/Engine/Solution/SolutionWrapperProject.cs +++ /dev/null @@ -1,2368 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.IO; -using System.Text; -using System.Xml; - -using Microsoft.Build.BuildEngine.Shared; -using Microsoft.Build.Framework; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// This class is used to generate an MSBuild wrapper project for a solution file or standalone VC project. - /// - /// - /// [!WARNING] - /// > This class (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - /// LukaszG, RGoel - public static class SolutionWrapperProject - { - private const string webProjectOverrideFolder = "_PublishedWebsites"; - private const string cacheSolutionConfigurationPropertyName = "_SolutionProjectConfiguration"; - private const string cacheToolsVersionPropertyName = "_SolutionProjectToolsVersion"; - private const string cacheProjectListName = "_SolutionProjectProjects"; - private const string cacheVersionNumber = "_SolutionProjectCacheVersion"; - - /// - /// This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// Microsoft.Build.Construction - /// Microsoft.Build.Evaluation - /// Microsoft.Build.Execution - /// - /// Given the full path to a solution, returns a string containing the v3.5 MSBuild-format - /// wrapper project for that solution. - /// - /// Full path to the solution we are wrapping - /// May be null. If non-null, contains the ToolsVersion passed in on the command line\ - /// An event context for logging purposes. - /// - /// - /// [!WARNING] - /// > This method (and the whole namespace) is deprecated. Please use the classes in these namespaces instead: - /// > - /// > - /// > - /// ]]> - /// - public static string Generate(string solutionPath, string toolsVersionOverride, BuildEventContext projectBuildEventContext) - { - Project msbuildProject = new Project(); - - SolutionParser solution = new SolutionParser(); - solution.SolutionFile = solutionPath; - solution.ParseSolutionFile(); - - Generate(solution, msbuildProject, toolsVersionOverride, projectBuildEventContext); - - return msbuildProject.Xml; - } - - /// - /// This method generates an XmlDocument representing an MSBuild project file from the list of - /// projects and project dependencies that have been collected from the solution file. - /// - /// - /// - /// Tools Version override (may be null). - /// Any /tv:xxx switch would cause a value here. - /// - /// RGoel - internal static void Generate(SolutionParser solution, Project msbuildProject, string toolsVersionOverride, BuildEventContext projectBuildEventContext) - { - // Validate against our minimum for upgradable projects - ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(solution.Version >= SolutionParser.slnFileMinVersion, - "SubCategoryForSolutionParsingErrors", new BuildEventFileInfo(solution.SolutionFile), "SolutionParseUpgradeNeeded"); - - // Although we only return an XmlDocument back, we need to make decisions about tools versions because - // we have to choose what tags to put in, whether to put a ToolsVersion parameter - // on task tags, and what MSBuildToolsPath to use when scanning child projects - // for dependency information. - string wrapperProjectToolsVersion = DetermineWrapperProjectToolsVersion(toolsVersionOverride); - - msbuildProject.DefaultTargets = "Build"; - msbuildProject.DefaultToolsVersion = wrapperProjectToolsVersion; - Engine parentEngine = msbuildProject.ParentEngine; - - string solutionProjectCache = solution.SolutionFile + ".cache"; - - bool? upToDate = LoadCache(solution, msbuildProject, projectBuildEventContext, wrapperProjectToolsVersion, parentEngine, solutionProjectCache); - - if (upToDate == true) - { - // Cache exists, was loaded, and was up to date: we're done - return; - } - - // Cache didn't exist or wasn't up to date; generate a new one - Project solutionProject = msbuildProject; - - if (upToDate == false) - { - // We have already loaded a cache file we can't use; we need to work in a new project object - solutionProject = CreateNewProject(solution, wrapperProjectToolsVersion, parentEngine, solutionProject); - } - - CreateSolutionProject(solution, solutionProject, projectBuildEventContext, wrapperProjectToolsVersion, parentEngine, solutionProjectCache); - - if (upToDate == false) - { - // Put the contents of the new project object into the one we were passed - msbuildProject.LoadFromXmlDocument(solutionProject.XmlDocument, projectBuildEventContext, msbuildProject.LoadSettings); - } - - // Write a new cache file, hopefully we can use it next time - UpdateCache(parentEngine, msbuildProject, solutionProjectCache, projectBuildEventContext); - } - - /// - /// Attempts to load the solution cache if any into the project provided. Returns null if no attempt was made to load the cache, - /// false if it was loaded but could not be used, or true if it was loaded and can be used. - /// - private static bool? LoadCache(SolutionParser solution, Project msbuildProject, BuildEventContext projectBuildEventContext, string wrapperProjectToolsVersion, Engine parentEngine, string solutionProjectCache) - { - if (!IsSolutionCacheEnabled() || !File.Exists(solutionProjectCache)) - { - return null; - } - - try - { - msbuildProject.Load(solutionProjectCache); - - string fullSolutionConfigurationName = DetermineLikelyActiveSolutionConfiguration(solution, parentEngine); - - bool cacheUpToDate = IsCacheUpToDate(parentEngine, solution.SolutionFile, solution.SolutionFileDirectory, msbuildProject, projectBuildEventContext, fullSolutionConfigurationName, wrapperProjectToolsVersion); - - if (cacheUpToDate) - { - // We're done -- use the cache - parentEngine.LoggingServices.LogComment(projectBuildEventContext, "SolutionCacheBeingUsed", solutionProjectCache, fullSolutionConfigurationName, wrapperProjectToolsVersion); - - return true; - } - } - catch (Exception ex) - { - if (ExceptionHandling.IsCriticalException(ex)) - { - throw; - } - // Eat any regular exceptions: we'll just not use the cache - parentEngine.LoggingServices.LogComment(projectBuildEventContext, "SolutionCacheReadError", solutionProjectCache, ex.Message); - } - - // Cache exists, but was not useable - return false; - } - - /// - /// Attempt to save a new, updated solution cache file. - /// - private static void UpdateCache(Engine parentEngine, Project msbuildProject, string solutionProjectCache, BuildEventContext projectBuildEventContext) - { - if (!IsSolutionCacheEnabled()) - { - return; - } - - try - { - msbuildProject.Save(solutionProjectCache); - } - catch (Exception ex) - { - if (ExceptionHandling.IsCriticalException(ex)) - { - throw; - } - // Eat any regular exceptions: we'll just not use the cache - parentEngine.LoggingServices.LogComment(projectBuildEventContext, "SolutionCacheWriteError", solutionProjectCache, ex.Message); - } - } - - /// - /// Determine whether solution file caches are enabled. If the environment variable "MSBuildUseNoSolutionCache" is - /// NOT defined, they are enabled. - /// - private static bool IsSolutionCacheEnabled() - { - bool solutionCacheEnabled = String.IsNullOrEmpty(Environment.GetEnvironmentVariable("MSBuildUseNoSolutionCache")); - return solutionCacheEnabled; - } - - /// - /// Given a cache loaded into a project, determines whether it is up to date with respect to the projects and the solution file listed - /// with it, and was created with the same configuration/platform and tools version values as the ones currently in use. - /// - private static bool IsCacheUpToDate(Engine parentEngine, string solutionFile, string solutionFileDirectory, Project msbuildProject, BuildEventContext projectBuildEventContext, string fullSolutionConfigurationName, string wrapperProjectToolsVersion) - { - // Check the full solution configuration matches, eg "Debug|AnyCPU" - string cacheSolutionConfigurationName = msbuildProject.GetEvaluatedProperty(cacheSolutionConfigurationPropertyName); - string cacheToolsVersion = msbuildProject.GetEvaluatedProperty(cacheToolsVersionPropertyName); - string cacheVersion = msbuildProject.GetEvaluatedProperty(cacheVersionNumber); - - if (cacheSolutionConfigurationName == null || cacheToolsVersion == null) - { - // Unexpected cache format; we can't use it - return false; - } - - if (!String.Equals(fullSolutionConfigurationName, cacheSolutionConfigurationName, StringComparison.OrdinalIgnoreCase)) - { - parentEngine.LoggingServices.LogComment(projectBuildEventContext, "SolutionCacheNotApplicable", "Configuration", cacheSolutionConfigurationName, fullSolutionConfigurationName); - return false; - } - - if (!String.Equals(wrapperProjectToolsVersion, cacheToolsVersion, StringComparison.OrdinalIgnoreCase)) - { - parentEngine.LoggingServices.LogComment(projectBuildEventContext, "SolutionCacheNotApplicable", "ToolsVersion", cacheToolsVersion, wrapperProjectToolsVersion); - return false; - } - - // We also store the version of MSBuild that wrote the file and verify it's the same as ours: that ensures that we - // don't read possibly incompatible caches. - string thisVersion = Constants.AssemblyVersion; - if (!String.Equals(cacheVersion, thisVersion, StringComparison.OrdinalIgnoreCase)) - { - parentEngine.LoggingServices.LogComment(projectBuildEventContext, "SolutionCacheNotApplicableDueToCacheVersion", cacheVersion, thisVersion); - return false; - } - - // Finally check timestamps - BuildItemGroup allProjects = msbuildProject.GetEvaluatedItemsByName(cacheProjectListName); - List inputs = new List(); - foreach (BuildItem item in allProjects.Items) - { - inputs.Add(item.EvaluatedItemSpec); - } - - if (inputs.Count == 0) - { - // There's no inputs; either an old-format cache file, or there's really - // no projects in this solution. In the former case, we need to regenerate. - // In the latter case, we don't really care if we do. So say it's out of date. - return false; - } - - // If there are inputs to check, we should also add the solution file, as we need to make sure the - // solution file is up to date with respect to the cache file - - // Get the solution file name because the solution file may be something like myDirectory\mysolution.sln - // and since we have already calculated the directory for the solution file, we just need the filename name to - // combine with the directory to get the full path to the solution file without having to call GetFullPath again. - string solutionFileName = Path.GetFileName(solutionFile); - string solutionFileLocation = Path.Combine(solutionFileDirectory, solutionFileName); - inputs.Add(solutionFileLocation); - - List outputs = new List(); - outputs.Add(msbuildProject.FullFileName); - - DependencyAnalysisLogDetail dependencyAnalysisDetail; - bool isAnyOutOfDate = TargetDependencyAnalyzer.IsAnyOutOfDate(out dependencyAnalysisDetail, solutionFileDirectory, inputs, outputs); - - if (isAnyOutOfDate) - { - string reason = TargetDependencyAnalyzer.GetFullBuildReason(dependencyAnalysisDetail); - - string message = ResourceUtilities.FormatResourceString("SolutionCacheOutOfDate", reason); - - parentEngine.LoggingServices.LogCommentFromText(projectBuildEventContext, MessageImportance.Low, message); - return false; - } - else - { - return true; - } - } - - /// - /// Create a new project to construct a solution wrapper cache inside - /// - private static Project CreateNewProject(SolutionParser solution, string wrapperProjectToolsVersion, Engine parentEngine, Project solutionProject) - { - try - { - solutionProject = new Project(parentEngine, wrapperProjectToolsVersion); - solutionProject.DefaultTargets = "Build"; - solutionProject.DefaultToolsVersion = wrapperProjectToolsVersion; - solutionProject.IsLoadedByHost = false; - } - catch (InvalidOperationException) - { - BuildEventFileInfo fileInfo = new BuildEventFileInfo(solution.SolutionFile); - string errorCode; - string helpKeyword; - string message = ResourceUtilities.FormatResourceString(out errorCode, out helpKeyword, "UnrecognizedToolsVersion", wrapperProjectToolsVersion); - throw new InvalidProjectFileException(solution.SolutionFile, fileInfo.Line, fileInfo.Column, fileInfo.EndLine, fileInfo.EndColumn, message, null, errorCode, helpKeyword); - } - return solutionProject; - } - - /// - /// Given an empty project and a solution, create a new solution project from the solution. - /// - private static void CreateSolutionProject(SolutionParser solution, Project msbuildProject, BuildEventContext projectBuildEventContext, string wrapperProjectToolsVersion, Engine parentEngine, string solutionProjectCache) - { - // We have to figure out what tools version the children will be built with, because we will - // have to load and scan them to construct the solution wrapper project, and we should use the - // same tools version they'll build with. - string childProjectToolsVersion = DetermineChildProjectToolsVersion(parentEngine, wrapperProjectToolsVersion); - - string taskAssembly; - - if (String.Equals(msbuildProject.ToolsVersion, "2.0", StringComparison.OrdinalIgnoreCase)) - { - taskAssembly = "Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"; - } - else - { - taskAssembly = "Microsoft.Build.Tasks.v3.5, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"; - } - - // Fully qualified class names are more performant - msbuildProject.AddNewUsingTaskFromAssemblyName("Microsoft.Build.Tasks.CreateTemporaryVCProject", taskAssembly); - msbuildProject.AddNewUsingTaskFromAssemblyName("Microsoft.Build.Tasks.ResolveVCProjectOutput", taskAssembly); - - AddFakeReleaseSolutionConfigurationIfNecessary(solution); - - Dictionary> projectsByDependencyLevel = new Dictionary>(); - - string fullSolutionConfigurationName = PredictActiveSolutionConfigurationName(solution, parentEngine); - - ScanProjectDependencies(solution, parentEngine, childProjectToolsVersion, fullSolutionConfigurationName, projectBuildEventContext); - ConvertVcToVcDependenciesToReferences(solution, parentEngine, projectBuildEventContext); - AssignDependencyLevels(solution, projectsByDependencyLevel); - AddVirtualReferencesForStaticLibraries(solution); - - // Add config, platform and tools version to indicate relevance of cache - AddCacheRelatedProperties(msbuildProject, fullSolutionConfigurationName, wrapperProjectToolsVersion, solution.ProjectsInOrder); - - // Add default solution configuration/platform names in case the user doesn't specify them on the command line - AddConfigurationPlatformDefaults(msbuildProject, solution); - - // Add default Venus configuration names (for more details, see comments for this method) - AddVenusConfigurationDefaults(msbuildProject); - - // Add solution related macros - AddGlobalProperties(msbuildProject, solution); - - // Add a property group for each solution configuration, each with one XML property containing the - // project configurations in this solution configuration. - foreach (ConfigurationInSolution solutionConfiguration in solution.SolutionConfigurations) - { - AddPropertyGroupForSolutionConfiguration(msbuildProject, solution, solutionConfiguration); - } - - // Add the initial target with some solution configuration validation/information - // Only do it if we actually have any solution configurations... - if (solution.SolutionConfigurations.Count > 0) - { - AddInitialTargets(msbuildProject); - } - - // Add a element for each project we have - foreach (ProjectInSolution proj in solution.ProjectsInOrder) - { - string errorMessage; - - // is it a solution folder? - if (proj.ProjectType == SolutionProjectType.SolutionFolder) - { - // Don't add any targets. Solution folder "projects" aren't actually projects at all and should be ignored. - } - else if (proj.ProjectType == SolutionProjectType.WebProject) - { - AddTargetForWebProject(msbuildProject, solution, proj, null); - AddTargetForWebProject(msbuildProject, solution, proj, "Clean"); - AddTargetForWebProject(msbuildProject, solution, proj, "Rebuild"); - AddTargetForWebProject(msbuildProject, solution, proj, "Publish"); - } - else if (proj.ProjectType == SolutionProjectType.VCProject) - { - AddTargetForVCProject(msbuildProject, solution, proj, null); - AddTargetForVCProject(msbuildProject, solution, proj, "Clean"); - AddTargetForVCProject(msbuildProject, solution, proj, "Rebuild"); - AddTargetForVCProject(msbuildProject, solution, proj, "Publish"); - } - // is it an MSBuild project? - else if ((proj.ProjectType == SolutionProjectType.ManagedProject) || - (proj.CanBeMSBuildProjectFile(out errorMessage))) - { - string safeItemNameFromProjectName = MakeIntoSafeItemName(proj.ProjectName); - string targetOutputItemName = string.Format(CultureInfo.InvariantCulture, "{0}BuildOutput", safeItemNameFromProjectName); - AddTargetForManagedProject(msbuildProject, solution, proj, targetOutputItemName, null); - AddTargetForManagedProject(msbuildProject, solution, proj, null, "Clean"); - AddTargetForManagedProject(msbuildProject, solution, proj, targetOutputItemName, "Rebuild"); - AddTargetForManagedProject(msbuildProject, solution, proj, null, "Publish"); - } - else - { - AddTargetForUnknownProjectType(msbuildProject, solution, proj, null, errorMessage); - AddTargetForUnknownProjectType(msbuildProject, solution, proj, "Clean", errorMessage); - AddTargetForUnknownProjectType(msbuildProject, solution, proj, "Rebuild", errorMessage); - AddTargetForUnknownProjectType(msbuildProject, solution, proj, "Publish", errorMessage); - } - } - - // Add a target called "Build" that depends on all the other projects. This will be the - // default target that is invoked when the "project" is built. - AddAllDependencyTarget(msbuildProject, "Build", "CollectedBuildOutput", null, projectsByDependencyLevel); - Target cleanTarget = AddAllDependencyTarget(msbuildProject, "Clean", null, "Clean", projectsByDependencyLevel); - - // As far as cleaning the solution project cache (if any) goes, we can't do it easily, because by the time we know we - // need to do a clean, we've already loaded the cache. Instead, at the end of a solution clean, we'll delete the cache - // file if any. A solution rebuild won't delete the cache, because probably one would expect a rebuild to leave it behind. - if (IsSolutionCacheEnabled()) - { - BuildTask deleteTask = cleanTarget.AddNewTask("Delete"); - // Don't use $(MSBuildProjectFile) for safety, in case user has copied and re-purposed this cache file - deleteTask.SetParameterValue("Files", Path.GetFileName(solutionProjectCache)); - } - - AddAllDependencyTarget(msbuildProject, "Rebuild", "CollectedBuildOutput", "Rebuild", projectsByDependencyLevel); - AddAllDependencyTarget(msbuildProject, "Publish", null, "Publish", projectsByDependencyLevel); - - // Special environment variable to allow people to see the in-memory MSBuild project generated - // to represent the SLN. - if (Environment.GetEnvironmentVariable("MSBuildEmitSolution") != null) - { - msbuildProject.Save(solution.SolutionFile + ".proj"); - } - } - - /// - /// Adds properties indicating the current solution configuration and tools version into the solution project. - /// Also lists all the projects in the solution, as items. - /// - private static void AddCacheRelatedProperties(Project msbuildProject, string fullSolutionConfigurationName, string toolsVersion, ArrayList projects) - { - BuildPropertyGroup cachePropertyGroup = msbuildProject.AddNewPropertyGroup(false /* insertAtEndOfProject = false */); - - // Store the solution configuration, if it's available (ie., not null because it's invalid) - if (fullSolutionConfigurationName != null) - { - cachePropertyGroup.AddNewProperty(cacheSolutionConfigurationPropertyName, fullSolutionConfigurationName); - } - - // Store the tools version, too. - cachePropertyGroup.AddNewProperty(cacheToolsVersionPropertyName, toolsVersion); - - // And the engine version, so we don't read caches written by other engines. - cachePropertyGroup.AddNewProperty(cacheVersionNumber, Constants.AssemblyVersion); - - // And store a list of all the projects. We can use this next time for timestamp checking. - BuildItemGroup cacheItemGroup = msbuildProject.AddNewItemGroup(); - foreach (ProjectInSolution project in projects) - { - // Only add projects that correspond to actual files on disk. Solution folders and web projects correspond to folders, so we don't care about them. - if (project.ProjectType != SolutionProjectType.SolutionFolder && project.ProjectType != SolutionProjectType.WebProject) - { - cacheItemGroup.AddNewItem(cacheProjectListName, EscapingUtilities.Escape(project.RelativePath)); - } - } - } - - /// - /// Figure out what tools version to build the solution wrapper project with. If a /tv - /// switch was passed in, use that; otherwise fall back to the default (4.0). - /// - internal static string DetermineWrapperProjectToolsVersion(string toolsVersionOverride) - { - string wrapperProjectToolsVersion = toolsVersionOverride; - - if (wrapperProjectToolsVersion == null) - { - wrapperProjectToolsVersion = Constants.defaultSolutionWrapperProjectToolsVersion; - } - return wrapperProjectToolsVersion; - } - - /// - /// We have to know the child projects' tools version in order to know what tools version to use when - /// scanning them for dependencies. If $(ProjectToolsVersion) is defined, we use that; otherwise - /// fall back on the tools version of the solution wrapper project. - /// - /// - /// - /// - private static string DetermineChildProjectToolsVersion(Engine parentEngine, string wrapperProjectToolsVersion) - { - BuildProperty property = parentEngine.GlobalProperties["ProjectToolsVersion"]; - string childProjectToolsVersion = null; - - if (property != null) - { - childProjectToolsVersion = property.Value; - } - - if (childProjectToolsVersion == null) - { - childProjectToolsVersion = wrapperProjectToolsVersion; - } - - return childProjectToolsVersion; - } - - /// - /// Adds an MSBuild task to the specified target - /// - /// - /// - /// - /// - /// - /// - /// RGoel, LukaszG - private static BuildTask AddMSBuildTaskElement - ( - Target target, - string projectPath, - string msbuildTargetName, - string configurationName, - string platformName, - bool specifyProjectToolsVersion - ) - { - BuildTask newTask = target.AddNewTask("MSBuild"); - newTask.SetParameterValue("Projects", projectPath, true /* treat as literal */); - - if (!string.IsNullOrEmpty(msbuildTargetName)) - { - newTask.SetParameterValue("Targets", msbuildTargetName); - } - - string additionalProperties = string.Format( - CultureInfo.InvariantCulture, - "Configuration={0}; Platform={1}; BuildingSolutionFile=true; CurrentSolutionConfigurationContents=$(CurrentSolutionConfigurationContents); SolutionDir=$(SolutionDir); SolutionExt=$(SolutionExt); SolutionFileName=$(SolutionFileName); SolutionName=$(SolutionName); SolutionPath=$(SolutionPath)", - EscapingUtilities.Escape(configurationName), - EscapingUtilities.Escape(platformName) - ); - - newTask.SetParameterValue("Properties", additionalProperties); - if (specifyProjectToolsVersion) - { - newTask.SetParameterValue("ToolsVersion", "$(ProjectToolsVersion)"); - newTask.SetParameterValue("UnloadProjectsOnCompletion", "$(UnloadProjectsOnCompletion)"); - newTask.SetParameterValue("UseResultsCache", "$(UseResultsCache)"); - } - - return newTask; - } - - /// - /// Add a target for a project into the XML doc that's being generated. - /// - /// - /// - /// - /// The name of the item exposing this target's outputs. May be null. - /// - /// RGoel, LukaszG - private static void AddTargetForManagedProject - ( - Project msbuildProject, - SolutionParser solution, - ProjectInSolution proj, - string targetOutputItemName, - string subTargetName - ) - { - string targetName = ProjectInSolution.DisambiguateProjectTargetName(proj.GetUniqueProjectName()); - if (!string.IsNullOrEmpty(subTargetName)) - { - targetName = targetName + ":" + subTargetName; - } - - Target newTarget = msbuildProject.Targets.AddNewTarget(targetName); - newTarget.DependsOnTargets = GetProjectDependencies(proj.ParentSolution, proj, subTargetName); - newTarget.Condition = "'$(CurrentSolutionConfigurationContents)' != ''"; - - if (!String.IsNullOrEmpty(targetOutputItemName)) - { - newTarget.TargetElement.SetAttribute("Outputs", string.Format(CultureInfo.InvariantCulture, "@({0})", targetOutputItemName)); - } - - // Only create build items if we're called with the null subtarget. We're getting called - // a total of four times and only want to create the build items once. - bool createBuildItems = (subTargetName == null); - - foreach (ConfigurationInSolution solutionConfiguration in solution.SolutionConfigurations) - { - string condition = GetConditionStringForConfiguration(solutionConfiguration); - - // Create the build item group for this configuration if we haven't already - if (solutionConfiguration.ProjectBuildItems == null) - { - solutionConfiguration.ProjectBuildItems = msbuildProject.AddNewItemGroup(); - solutionConfiguration.ProjectBuildItems.Condition = condition; - } - - ProjectConfigurationInSolution projectConfiguration; - if (proj.ProjectConfigurations.TryGetValue(solutionConfiguration.FullName, out projectConfiguration)) - { - if (projectConfiguration.IncludeInBuild) - { - // We want to specify ToolsVersion on the MSBuild task only if the solution - // is building with a non-Whidbey toolset, because the Whidbey MSBuild task - // does not support the ToolsVersion parameter. If the user explicitly requested - // the 2.0 toolset be used to build the solution while specifying some value - // for the ProjectToolsVersion property, then one of the InitialTargets should - // have produced an error before reaching this point. - // PERF: We could emit two tasks, with a condition on them. But this doubles the size of - // the solution wrapper project, and the cost is too high. The consequence is that when solution wrapper - // projects are emitted to disk (with MSBUILDEMITSOLUION=1) they cannot be reused for tools version v2.0. - bool specifyProjectToolsVersion = - String.Equals(msbuildProject.ToolsVersion, "2.0", StringComparison.OrdinalIgnoreCase) ? false : true; - - BuildTask msbuildTask = AddMSBuildTaskElement(newTarget, proj.RelativePath, subTargetName, - projectConfiguration.ConfigurationName, projectConfiguration.PlatformName, specifyProjectToolsVersion); - msbuildTask.Condition = condition; - - if (!String.IsNullOrEmpty(targetOutputItemName)) - { - msbuildTask.AddOutputItem("TargetOutputs", targetOutputItemName); - } - - if (createBuildItems) - { - string baseItemName = "BuildLevel" + proj.DependencyLevel; - BuildItem projectItem = solutionConfiguration.ProjectBuildItems.AddNewItem(baseItemName, proj.RelativePath, true /* treat as literal */); - - projectItem.SetMetadata("Configuration", EscapingUtilities.Escape(projectConfiguration.ConfigurationName)); - projectItem.SetMetadata("Platform", EscapingUtilities.Escape(projectConfiguration.PlatformName)); - } - } - else - { - BuildTask messageTask = AddErrorWarningMessageElement(newTarget, XMakeElements.message, true, "SolutionProjectSkippedForBuilding", proj.ProjectName, solutionConfiguration.FullName); - messageTask.Condition = condition; - - if (createBuildItems) - { - string baseItemName = "SkipLevel" + proj.DependencyLevel; - BuildItem projectItem = solutionConfiguration.ProjectBuildItems.AddNewItem(baseItemName, proj.ProjectName, true /* treat as literal */); - } - } - } - else - { - BuildTask warningTask = AddErrorWarningMessageElement(newTarget, XMakeElements.warning, true, "SolutionProjectConfigurationMissing", proj.ProjectName, solutionConfiguration.FullName); - warningTask.Condition = condition; - - if (createBuildItems) - { - string baseItemName = "MissingConfigLevel" + proj.DependencyLevel; - BuildItem projectItem = solutionConfiguration.ProjectBuildItems.AddNewItem(baseItemName, proj.ProjectName, true /* treat as literal */); - } - } - } - } - - /// - /// Adds a new ResolveVCProjectOutput task element to the specified target - /// - /// - /// - /// - /// - /// - /// LukaszG - private static BuildTask AddResolveVCProjectOutputTaskElement - ( - Target target, - string solutionPath, - string projectPath, - string fullConfigurationName - ) - { - BuildTask newTask = target.AddNewTask("ResolveVCProjectOutput"); - - newTask.SetParameterValue("ProjectReferences", projectPath, true /* treat as literal */); - newTask.SetParameterValue("Configuration", fullConfigurationName, true /* treat as literal */); - newTask.SetParameterValue("SolutionFile", solutionPath, true /* treat as literal */); - - // If the user passed in an override stylesheet for this .VCPROJ (by specifying a global - // property called VCBuildOverride), we need to use it to resolve the output path. Override - // stylesheets can be used to change the directory that VC projects get built to. - newTask.SetParameterValue("Override", "$(VCBuildOverride)"); - - return newTask; - } - - /// - /// Adds MSBuild and ResolveVCProjectOutput tasks to a project target to pre-resolve its project references - /// - /// - /// - /// - /// - /// - /// - /// - /// LukaszG - private static void AddResolveProjectReferenceTasks - ( - SolutionParser solution, - Project msbuildProject, - Target target, - ProjectInSolution proj, - ConfigurationInSolution solutionConfiguration, - string outputReferenceItemName, - string outputImportLibraryItemName, - out string addedReferenceGuids - ) - { - StringBuilder referenceGuids = new StringBuilder(); - - // Suffix for the reference item name. Since we need to attach additional (different) metadata to every - // reference item, we need to have helper item lists each with only one item - int outputReferenceItemNameSuffix = 0; - - // Pre-resolve the MSBuild/VC project references - foreach (string projectReferenceGuid in proj.ProjectReferences) - { - ProjectInSolution referencedProject = (ProjectInSolution)solution.ProjectsByGuid[projectReferenceGuid]; - ProjectConfigurationInSolution referencedProjectConfiguration = null; - - if ((referencedProject != null) && - (referencedProject.ProjectConfigurations.TryGetValue(solutionConfiguration.FullName, out referencedProjectConfiguration)) && - (referencedProjectConfiguration != null)) - { - string outputReferenceItemNameWithSuffix = string.Format(CultureInfo.InvariantCulture, "{0}_{1}", - outputReferenceItemName, outputReferenceItemNameSuffix); - - bool addCreateItem = false; - - string message; - if ((referencedProject.ProjectType == SolutionProjectType.ManagedProject) || - ((referencedProject.ProjectType == SolutionProjectType.Unknown) && (referencedProject.CanBeMSBuildProjectFile(out message)))) - { - string condition = GetConditionStringForConfiguration(solutionConfiguration); - bool specifyProjectToolsVersion = - String.Equals(msbuildProject.ToolsVersion, "2.0", StringComparison.OrdinalIgnoreCase) ? false : true; - - BuildTask msbuildTask = AddMSBuildTaskElement(target, referencedProject.RelativePath, "GetTargetPath", - referencedProjectConfiguration.ConfigurationName, referencedProjectConfiguration.PlatformName, specifyProjectToolsVersion); - msbuildTask.Condition = condition; - msbuildTask.AddOutputItem("TargetOutputs", outputReferenceItemNameWithSuffix); - - if (referenceGuids.Length > 0) - { - referenceGuids.Append(';'); - } - - referenceGuids.Append(projectReferenceGuid); - addCreateItem = true; - } - else if (referencedProject.ProjectType == SolutionProjectType.VCProject) - { - BuildTask vcbuildTask = null; - - try - { - vcbuildTask = AddResolveVCProjectOutputTaskElement(target, Path.Combine(solution.SolutionFileDirectory, Path.GetFileName(solution.SolutionFile)), - referencedProject.AbsolutePath, referencedProjectConfiguration.FullName); - } - catch (Exception e) when (!ExceptionHandling.NotExpectedException(e)) - { - ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(false, - "SubCategoryForSolutionParsingErrors", - new BuildEventFileInfo(solution.SolutionFile), - "SolutionParseInvalidProjectFileName", - referencedProject.RelativePath, e.Message); - } - - vcbuildTask.Condition = GetConditionStringForConfiguration(solutionConfiguration); - vcbuildTask.AddOutputItem("ResolvedOutputPaths", outputReferenceItemNameWithSuffix); - - if (outputImportLibraryItemName != null) - { - vcbuildTask.AddOutputItem("ResolvedImportLibraryPaths", outputImportLibraryItemName); - } - - if (referenceGuids.Length > 0) - { - referenceGuids.Append(';'); - } - - referenceGuids.Append(projectReferenceGuid); - addCreateItem = true; - } - - // Add create item if either of the conditions above was true. - // This merges the one-item item list into the main list, adding the appropriate guid metadata - if (addCreateItem) - { - BuildTask createItemTask = target.AddNewTask("CreateItem"); - createItemTask.SetParameterValue("Include", "@(" + outputReferenceItemNameWithSuffix + ")", false /* do not treat as literal */); - createItemTask.SetParameterValue("AdditionalMetadata", "Guid=" + projectReferenceGuid, false /* do not treat as literal */); - createItemTask.AddOutputItem("Include", outputReferenceItemName); - } - - outputReferenceItemNameSuffix++; - } - } - - addedReferenceGuids = referenceGuids.ToString(); - } - - /// - /// Adds tasks that create a temporary VC project file with pre-resolved project references (that is, - /// replaced with file references) - /// - /// - /// - /// - /// - /// - /// - /// The path to the temporary project file - /// LukaszG - private static string AddCreateTemporaryVCProjectTasks - ( - SolutionParser solution, - Project msbuildProject, - Target target, - ProjectInSolution proj, - ConfigurationInSolution solutionConfiguration, - string subTargetName, - string projectConfigurationName - ) - { - StringBuilder referenceItemName = new StringBuilder(GenerateSafePropertyName(proj, "References")); - if (!string.IsNullOrEmpty(subTargetName)) - { - referenceItemName.Append('_'); - referenceItemName.Append(subTargetName); - } - - StringBuilder importLibraryItemName = new StringBuilder(GenerateSafePropertyName(proj, "ImportLibraries")); - if (!string.IsNullOrEmpty(subTargetName)) - { - importLibraryItemName.Append('_'); - importLibraryItemName.Append(subTargetName); - } - - string referenceGuidsToRemove; - AddResolveProjectReferenceTasks(solution, msbuildProject, target, proj, solutionConfiguration, - referenceItemName.ToString(), importLibraryItemName.ToString(), out referenceGuidsToRemove); - - if (string.IsNullOrEmpty(referenceGuidsToRemove)) - { - referenceGuidsToRemove = string.Empty; - } - - string fullProjectPath = null; - string projectPath = null; - - try - { - fullProjectPath = proj.AbsolutePath; - string tmpExtension = string.Format(CultureInfo.InvariantCulture, ".tmp_{0}_{1}.vcproj", solutionConfiguration.ConfigurationName, solutionConfiguration.PlatformName); - projectPath = Path.ChangeExtension(fullProjectPath, tmpExtension); - } - catch (Exception e) - { - if (ExceptionHandling.NotExpectedException(e)) - { - throw; - } - - ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(false, - "SubCategoryForSolutionParsingErrors", - new BuildEventFileInfo(solution.SolutionFile), - "SolutionParseInvalidProjectFileName", - proj.RelativePath, e.Message); - } - - // Create the temporary VC project - BuildTask createVCProjectTask = target.AddNewTask("CreateTemporaryVCProject"); - createVCProjectTask.SetParameterValue("ProjectFile", fullProjectPath, true /* treat as literal */); - createVCProjectTask.SetParameterValue("Configuration", projectConfigurationName, true /* treat as literal */); - createVCProjectTask.SetParameterValue("OutputProjectFile", projectPath, true /* treat as literal */); - - createVCProjectTask.SetParameterValue("ReferenceGuids", referenceGuidsToRemove, false /* Contains semicolon-separated list. DO NOT treat as literal */); - createVCProjectTask.SetParameterValue("ReferenceAssemblies", - string.Format(CultureInfo.InvariantCulture, "@({0})", referenceItemName.ToString()), false /* DO NOT treat as literal */); - createVCProjectTask.SetParameterValue("ReferenceImportLibraries", - string.Format(CultureInfo.InvariantCulture, "@({0})", importLibraryItemName.ToString()), false /* DO NOT treat as literal */); - - createVCProjectTask.Condition = GetConditionStringForConfiguration(solutionConfiguration); - - return projectPath; - } - - /// - /// Add a target for a project into the XML doc that's being generated. - /// - /// - /// - /// - /// - /// LukaszG, RGoel - private static void AddTargetForVCProject - ( - Project msbuildProject, - SolutionParser solution, - ProjectInSolution proj, - string subTargetName - ) - { - string targetName = ProjectInSolution.DisambiguateProjectTargetName(proj.GetUniqueProjectName()); - if (!string.IsNullOrEmpty(subTargetName)) - { - targetName = targetName + ":" + subTargetName; - } - - Target newTarget = msbuildProject.Targets.AddNewTarget(targetName); - newTarget.DependsOnTargets = GetProjectDependencies(proj.ParentSolution, proj, subTargetName); - newTarget.Condition = "'$(CurrentSolutionConfigurationContents)' != ''"; - - if (subTargetName == "Publish") - { - // Well, hmmm. The VCBuild doesn't support any kind of - // a "Publish" operation. The best we can really do is offer up a - // message saying so. - AddErrorWarningMessageElement(newTarget, XMakeElements.warning, true, "SolutionVCProjectNoPublish"); - - // ... and now pretend it's a Build subtarget. This way references to VC projects from projects - // that are about to publish will at least get built. - subTargetName = null; - } - - string projectPath = null; - - try - { - projectPath = proj.AbsolutePath; - } - catch (Exception e) - { - if (ExceptionHandling.NotExpectedException(e)) - { - throw; - } - - ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(false, - "SubCategoryForSolutionParsingErrors", - new BuildEventFileInfo(solution.SolutionFile), - "SolutionParseInvalidProjectFileName", - proj.RelativePath, e.Message); - } - - foreach (ConfigurationInSolution solutionConfiguration in solution.SolutionConfigurations) - { - string solutionConfigurationCondition = GetConditionStringForConfiguration(solutionConfiguration); - - ProjectConfigurationInSolution vcProjectConfiguration = null; - BuildTask newTask = null; - - if (proj.ProjectConfigurations.TryGetValue(solutionConfiguration.FullName, out vcProjectConfiguration)) - { - if (vcProjectConfiguration.IncludeInBuild) - { - // Create a temporary VC project with references to MSBuild projects replaced with file references. - if (proj.ProjectReferences.Count > 0) - { - projectPath = AddCreateTemporaryVCProjectTasks(solution, msbuildProject, newTarget, proj, - solutionConfiguration, subTargetName, - vcProjectConfiguration.FullName); - } - - newTask = VCWrapperProject.AddVCBuildTaskElement( - msbuildProject, - newTarget, - EscapingUtilities.Escape(Path.Combine(solution.SolutionFileDirectory, Path.GetFileName(solution.SolutionFile))), - projectPath, subTargetName, - null, EscapingUtilities.Escape(vcProjectConfiguration.FullName)); - - // Delete the temporary VC project - if (proj.ProjectReferences.Count > 0) - { - BuildTask deleteTask = newTarget.AddNewTask("Delete"); - deleteTask.SetParameterValue("Files", projectPath, true /* treat as literal */); - - deleteTask.Condition = solutionConfigurationCondition; - } - } - else - { - newTask = AddErrorWarningMessageElement(newTarget, XMakeElements.message, true, "SolutionProjectSkippedForBuilding", proj.ProjectName, solutionConfiguration.FullName); - } - } - else - { - newTask = AddErrorWarningMessageElement(newTarget, XMakeElements.warning, true, "SolutionProjectConfigurationMissing", proj.ProjectName, solutionConfiguration.FullName); - } - - if (newTask != null) - { - newTask.Condition = solutionConfigurationCondition; - } - } - } - - /// - /// Add a target to the project called "GetFrameworkPathAndRedistList". This target calls the - /// GetFrameworkPath task and then CreateItem to populate @(_CombinedTargetFrameworkDirectoriesItem) and - /// @(InstalledAssemblyTables), so that we can pass these into the ResolveAssemblyReference task - /// when building web projects. - /// - /// - /// RGoel - private static void AddTargetForGetFrameworkPathAndRedistList - ( - Project msbuildProject - ) - { - // See if there's already a target called "GetFrameworkPathAndRedistList" in this project. - // If so, no need to do anything. - foreach (Target target in msbuildProject.Targets) - { - if (target.Name == "GetFrameworkPathAndRedistList") - { - return; - } - } - - Target newTarget = msbuildProject.Targets.AddNewTarget("GetFrameworkPathAndRedistList"); - - BuildTask getFrameworkPathTask = newTarget.AddNewTask("GetFrameworkPath"); - - // Follow the same logic we use in Microsoft.Common.targets to choose the target framework - // directories (which are then used to find the set of redist lists). - getFrameworkPathTask.AddOutputItem( - "Path", - "_CombinedTargetFrameworkDirectoriesItem", - "'$(MSBuildToolsVersion)' == '2.0'"); - - // TFV v4.0 supported by TV 4.0 - getFrameworkPathTask.AddOutputItem( - "FrameworkVersion40Path", - "_CombinedTargetFrameworkDirectoriesItem", - " '$(TargetFrameworkVersion)' == 'v4.0' and '$(MSBuildToolsVersion)' == '4.0'"); - - // TFV v3.5 supported by TV 4.0, TV 3.5 - getFrameworkPathTask.AddOutputItem( - "FrameworkVersion35Path", - "_CombinedTargetFrameworkDirectoriesItem", - " ('$(TargetFrameworkVersion)' == 'v3.5' or '$(TargetFrameworkVersion)' == 'v4.0') and '$(MSBuildToolsVersion)' != '2.0'"); - - // TFV v3.0 supported by TV 4.0, TV 3.5 (there was no TV 3.0) - getFrameworkPathTask.AddOutputItem( - "FrameworkVersion30Path", - "_CombinedTargetFrameworkDirectoriesItem", - " ('$(TargetFrameworkVersion)' == 'v3.0' or '$(TargetFrameworkVersion)' == 'v3.5' or '$(TargetFrameworkVersion)' == 'v4.0') and '$(MSBuildToolsVersion)' != '2.0'"); - - // TFV v2.0 supported by TV 4.0, TV 3.5, (there was no TV 3.0). This property was not added until toolsversion 3.5 therefore it cannot be used for toolsversion 2.0 - getFrameworkPathTask.AddOutputItem( - "FrameworkVersion20Path", - "_CombinedTargetFrameworkDirectoriesItem", - "'$(MSBuildToolsVersion)' != '2.0'"); - - BuildTask createItemTask = newTarget.AddNewTask("CreateItem"); - createItemTask.SetParameterValue("Include", @"@(_CombinedTargetFrameworkDirectoriesItem->'%(Identity)\RedistList\*.xml')", false /* do not treat as literal */); - createItemTask.AddOutputItem("Include", "InstalledAssemblyTables"); - } - - /// - /// Helper method to add a call to the AspNetCompiler task into the given target. - /// - /// - /// - /// - /// RGoel - private static void AddTaskForAspNetCompiler - ( - Target target, - ProjectInSolution proj, - string conditionDescribingValidConfigurations - ) - { - // Add a call to the AspNetCompiler task, conditioned on having a valid Configuration. - BuildTask newTask = target.AddNewTask("AspNetCompiler"); - newTask.SetParameterValue("VirtualPath", "$(" + GenerateSafePropertyName(proj, "AspNetVirtualPath") + ")"); - newTask.SetParameterValue("PhysicalPath", "$(" + GenerateSafePropertyName(proj, "AspNetPhysicalPath") + ")"); - newTask.SetParameterValue("TargetPath", "$(" + GenerateSafePropertyName(proj, "AspNetTargetPath") + ")"); - newTask.SetParameterValue("Force", "$(" + GenerateSafePropertyName(proj, "AspNetForce") + ")"); - newTask.SetParameterValue("Updateable", "$(" + GenerateSafePropertyName(proj, "AspNetUpdateable") + ")"); - newTask.SetParameterValue("Debug", "$(" + GenerateSafePropertyName(proj, "AspNetDebug") + ")"); - newTask.SetParameterValue("KeyFile", "$(" + GenerateSafePropertyName(proj, "AspNetKeyFile") + ")"); - newTask.SetParameterValue("KeyContainer", "$(" + GenerateSafePropertyName(proj, "AspNetKeyContainer") + ")"); - newTask.SetParameterValue("DelaySign", "$(" + GenerateSafePropertyName(proj, "AspNetDelaySign") + ")"); - newTask.SetParameterValue("AllowPartiallyTrustedCallers", "$(" + GenerateSafePropertyName(proj, "AspNetAPTCA") + ")"); - newTask.SetParameterValue("FixedNames", "$(" + GenerateSafePropertyName(proj, "AspNetFixedNames") + ")"); - - newTask.Condition = conditionDescribingValidConfigurations; - } - - /// - /// Add a call to the ResolveAssemblyReference task to crack the pre-resolved referenced - /// assemblies for the complete list of dependencies, PDBs, satellites, etc. The invoke - /// the Copy task to copy all these files (or at least the ones that RAR determined should - /// be copied local) into the web project's bin directory. - /// - /// - /// - /// - /// - /// RGoel - private static void AddTasksToCopyAllDependenciesIntoBinDir - ( - Target target, - ProjectInSolution proj, - string referenceItemName, - string conditionDescribingValidConfigurations - ) - { - string copyLocalFilesItemName = referenceItemName + "_CopyLocalFiles"; - string destinationFolder = String.Format(CultureInfo.InvariantCulture, - @"$({0})\Bin\", GenerateSafePropertyName(proj, "AspNetPhysicalPath")); - - // This is a bit of a hack. We're actually calling the "Copy" task on all of - // the *non-existent* files. Why? Because we want to emit a warning in the - // log for each non-existent file, and the Copy task does that nicely for us. - // I would have used the task except for the fact that we are in - // string-resource lockdown. - BuildTask copyNonExistentReferencesTask = target.AddNewTask("Copy"); - copyNonExistentReferencesTask.SetParameterValue("SourceFiles", "@(" + referenceItemName + "->'%(FullPath)')", false /* Do not treat as literal */); - copyNonExistentReferencesTask.SetParameterValue("DestinationFolder", destinationFolder); - copyNonExistentReferencesTask.Condition = String.Format(CultureInfo.InvariantCulture, "!Exists('%({0}.Identity)')", referenceItemName); - copyNonExistentReferencesTask.ContinueOnError = true; - - // Call ResolveAssemblyReference on each of the .DLL files that were found on - // disk from the .REFRESH files as well as the P2P references. RAR will crack - // the dependencies, find PDBs, satellite assemblies, etc., and determine which - // files need to be copy-localed. - BuildTask rarTask = target.AddNewTask("ResolveAssemblyReference"); - rarTask.SetParameterValue("Assemblies", "@(" + referenceItemName + "->'%(FullPath)')", false /* Do not treat as literal */); - rarTask.SetParameterValue("TargetFrameworkDirectories", "@(_CombinedTargetFrameworkDirectoriesItem)", false /* Do not treat as literal */); - rarTask.SetParameterValue("InstalledAssemblyTables", "@(InstalledAssemblyTables)", false /* Do not treat as literal */); - rarTask.SetParameterValue("SearchPaths", "{RawFileName};{TargetFrameworkDirectory};{GAC}"); - rarTask.SetParameterValue("FindDependencies", "true"); - rarTask.SetParameterValue("FindSatellites", "true"); - rarTask.SetParameterValue("FindSerializationAssemblies", "true"); - rarTask.SetParameterValue("FindRelatedFiles", "true"); - rarTask.Condition = String.Format(CultureInfo.InvariantCulture, "Exists('%({0}.Identity)')", referenceItemName); - rarTask.AddOutputItem("CopyLocalFiles", copyLocalFilesItemName); - - // Copy all the copy-local files (reported by RAR) to the web project's "bin" - // directory. - BuildTask copyTask = target.AddNewTask("Copy"); - copyTask.SetParameterValue("SourceFiles", "@(" + copyLocalFilesItemName + ")", false /* DO NOT treat as literal */); - copyTask.SetParameterValue("DestinationFiles", String.Format(CultureInfo.InvariantCulture, - @"@({0}->'{1}%(DestinationSubDirectory)%(Filename)%(Extension)')", - copyLocalFilesItemName, destinationFolder), false /* DO NOT treat as literal */); - copyTask.Condition = conditionDescribingValidConfigurations; - } - - /// - /// Add a PropertyGroup to the project for a particular Asp.Net configuration. This PropertyGroup - /// will have the correct values for all the Asp.Net properties for this project and this configuration. - /// - /// - /// - /// - /// - /// - /// RGoel - private static void AddPropertyGroupForAspNetConfiguration - ( - Project msbuildProject, - ProjectInSolution proj, - string configurationName, - AspNetCompilerParameters aspNetCompilerParameters, - string solutionFile - ) - { - // Add a new PropertyGroup that is condition'd on the Configuration. - BuildPropertyGroup newPropertyGroup = msbuildProject.AddNewPropertyGroup(false /* insertAtEndOfProject = false */); - newPropertyGroup.Condition = String.Format(CultureInfo.InvariantCulture, " '$(AspNetConfiguration)' == '{0}' ", - EscapingUtilities.Escape(configurationName)); - - // Add properties into the property group for each of the AspNetCompiler properties. - newPropertyGroup.AddNewProperty(GenerateSafePropertyName(proj, "AspNetVirtualPath"), aspNetCompilerParameters.aspNetVirtualPath, true); - newPropertyGroup.AddNewProperty(GenerateSafePropertyName(proj, "AspNetPhysicalPath"), aspNetCompilerParameters.aspNetPhysicalPath, true); - newPropertyGroup.AddNewProperty(GenerateSafePropertyName(proj, "AspNetTargetPath"), aspNetCompilerParameters.aspNetTargetPath, true); - newPropertyGroup.AddNewProperty(GenerateSafePropertyName(proj, "AspNetForce"), aspNetCompilerParameters.aspNetForce, true); - newPropertyGroup.AddNewProperty(GenerateSafePropertyName(proj, "AspNetUpdateable"), aspNetCompilerParameters.aspNetUpdateable, true); - newPropertyGroup.AddNewProperty(GenerateSafePropertyName(proj, "AspNetDebug"), aspNetCompilerParameters.aspNetDebug, true); - newPropertyGroup.AddNewProperty(GenerateSafePropertyName(proj, "AspNetKeyFile"), aspNetCompilerParameters.aspNetKeyFile, true); - newPropertyGroup.AddNewProperty(GenerateSafePropertyName(proj, "AspNetKeyContainer"), aspNetCompilerParameters.aspNetKeyContainer, true); - newPropertyGroup.AddNewProperty(GenerateSafePropertyName(proj, "AspNetDelaySign"), aspNetCompilerParameters.aspNetDelaySign, true); - newPropertyGroup.AddNewProperty(GenerateSafePropertyName(proj, "AspNetAPTCA"), aspNetCompilerParameters.aspNetAPTCA, true); - newPropertyGroup.AddNewProperty(GenerateSafePropertyName(proj, "AspNetFixedNames"), aspNetCompilerParameters.aspNetFixedNames, true); - - string aspNetPhysicalPath = aspNetCompilerParameters.aspNetPhysicalPath; - if (!String.IsNullOrEmpty(aspNetPhysicalPath)) - { - // Trim the trailing slash if one exists. - if ( - (aspNetPhysicalPath[aspNetPhysicalPath.Length - 1] == Path.AltDirectorySeparatorChar) || - (aspNetPhysicalPath[aspNetPhysicalPath.Length - 1] == Path.DirectorySeparatorChar) - ) - { - aspNetPhysicalPath = aspNetPhysicalPath.Substring(0, aspNetPhysicalPath.Length - 1); - } - - // This gets us the last folder in the physical path. - string lastFolderInPhysicalPath = null; - - try - { - lastFolderInPhysicalPath = Path.GetFileName(aspNetPhysicalPath); - } - catch (Exception e) - { - if (ExceptionHandling.NotExpectedException(e)) - { - throw; - } - - ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(false, - "SubCategoryForSolutionParsingErrors", - new BuildEventFileInfo(solutionFile), - "SolutionParseInvalidProjectFileName", - proj.RelativePath, e.Message); - } - - if (!String.IsNullOrEmpty(lastFolderInPhysicalPath)) - { - // If there is a global property called "OutDir" set, that means the caller is trying to - // override the AspNetTargetPath. What we want to do in this case is concatenate: - // $(OutDir) + "\_PublishedWebsites" + (the last portion of the folder in the AspNetPhysicalPath). - BuildProperty targetPathOverrideProperty = newPropertyGroup.AddNewProperty(GenerateSafePropertyName(proj, "AspNetTargetPath"), - @"$(OutDir)" + - EscapingUtilities.Escape(webProjectOverrideFolder) + Path.DirectorySeparatorChar + - EscapingUtilities.Escape(lastFolderInPhysicalPath) + Path.DirectorySeparatorChar); - targetPathOverrideProperty.Condition = " '$(OutDir)' != '' "; - } - } - } - - /// - /// This code handles the *.REFRESH files that are in the "bin" subdirectory of - /// a web project. These .REFRESH files are just text files that contain absolute or - /// relative paths to the referenced assemblies. The goal of these tasks is to - /// search all *.REFRESH files and extract fully-qualified absolute paths for - /// each of the references. - /// - /// - /// - /// - /// RGoel - private static void AddTasksToResolveAutoRefreshFileReferences - ( - Target target, - ProjectInSolution proj, - string referenceItemName - ) - { - string webRoot = "$(" + GenerateSafePropertyName(proj, "AspNetPhysicalPath") + ")"; - - // Create an item list containing each of the .REFRESH files. - BuildTask createItemTask = target.AddNewTask("CreateItem"); - createItemTask.SetParameterValue("Include", webRoot + @"\Bin\*.refresh"); - createItemTask.AddOutputItem("Include", referenceItemName + "_RefreshFile"); - - // Read the lines out of each .REFRESH file; they should be paths to .DLLs. Put these paths - // into an item list. - BuildTask readLinesTask = target.AddNewTask("ReadLinesFromFile"); - readLinesTask.SetParameterValue("File", - String.Format(CultureInfo.InvariantCulture, @"%({0}_RefreshFile.Identity)", referenceItemName)); - readLinesTask.Condition = String.Format(CultureInfo.InvariantCulture, @" '%({0}_RefreshFile.Identity)' != '' ", referenceItemName); - readLinesTask.AddOutputItem("Lines", referenceItemName + "_ReferenceRelPath"); - - // Take those paths and combine them with the root of the web project to form either - // an absolute path or a path relative to the .SLN file. These paths can be passed - // directly to RAR later. - BuildTask combinePathTask = target.AddNewTask("CombinePath"); - combinePathTask.SetParameterValue("BasePath", webRoot); - combinePathTask.SetParameterValue("Paths", - String.Format(CultureInfo.InvariantCulture, @"@({0}_ReferenceRelPath)", referenceItemName)); - combinePathTask.AddOutputItem("CombinedPaths", referenceItemName); - } - - /// - /// When adding a target to build a web project, we want to put a Condition on the Target node that - /// effectively says "Only build this target if the web project is active (marked for building) in the - /// current solution configuration. - /// - /// - /// - /// - /// RGoel - private static string ComputeTargetConditionForWebProject - ( - SolutionParser solution, - ProjectInSolution proj - ) - { - StringBuilder condition = new StringBuilder(" ('$(CurrentSolutionConfigurationContents)' != '') and (false"); - - // Loop through all the solution configurations. - foreach (ConfigurationInSolution solutionConfiguration in solution.SolutionConfigurations) - { - // Find out if the web project has a project configuration for this solution configuration. - // (Actually, web projects only have one project configuration, so the TryGetValue should - // pretty much always return "true". - ProjectConfigurationInSolution projectConfiguration; - if (proj.ProjectConfigurations.TryGetValue(solutionConfiguration.FullName, out projectConfiguration)) - { - // See if the web project is marked as active for this solution configuration. If so, - // we'll build the target. Otherwise not. - if (projectConfiguration.IncludeInBuild) - { - condition.Append(" or ("); - condition.Append(GetConditionStringForConfiguration(solutionConfiguration)); - condition.Append(")"); - } - } - else if (String.Equals(solutionConfiguration.ConfigurationName, "Release", StringComparison.OrdinalIgnoreCase) || - String.Equals(solutionConfiguration.ConfigurationName, "Debug", StringComparison.OrdinalIgnoreCase)) - { - // we don't have a project configuration that matches the solution configuration but - // the solution configuration is called "Release" or "Debug" which are standard AspNetConfigurations - // so these should be available in the solution project - condition.Append(" or ("); - condition.Append(GetConditionStringForConfiguration(solutionConfiguration)); - condition.Append(")"); - } - } - - condition.Append(") "); - return condition.ToString(); - } - - /// - /// Add a target for a Venus project into the XML doc that's being generated. This - /// target will call the AspNetCompiler task. - /// - /// - /// - /// - /// - /// RGoel - private static void AddTargetForWebProject - ( - Project msbuildProject, - SolutionParser solution, - ProjectInSolution proj, - string subTargetName - ) - { - // Add a supporting target called "GetFrameworkPathAndRedistList". - AddTargetForGetFrameworkPathAndRedistList(msbuildProject); - - string targetName = ProjectInSolution.DisambiguateProjectTargetName(proj.GetUniqueProjectName()); - if (!string.IsNullOrEmpty(subTargetName)) - { - targetName = targetName + ":" + subTargetName; - } - - Target newTarget = msbuildProject.Targets.AddNewTarget(targetName); - - newTarget.DependsOnTargets = GetProjectDependencies(proj.ParentSolution, proj, subTargetName) + ";GetFrameworkPathAndRedistList"; - - if (subTargetName == "Clean") - { - // Well, hmmm. The AspNetCompiler task doesn't support any kind of - // a "Clean" operation. The best we can really do is offer up a - // message saying so. - AddErrorWarningMessageElement(newTarget, XMakeElements.message, true, "SolutionVenusProjectNoClean"); - } - else if (subTargetName == "Publish") - { - // Well, hmmm. The AspNetCompiler task doesn't support any kind of - // a "Publish" operation. The best we can really do is offer up a - // message saying so. - AddErrorWarningMessageElement(newTarget, XMakeElements.message, true, "SolutionVenusProjectNoPublish"); - } - else - { - // Add a Condition onto the Target that will cause it only to get executed for those solution configurations - // in which this web project is active. - newTarget.Condition = ComputeTargetConditionForWebProject(solution, proj); - - // For normal build and "Rebuild", just call the AspNetCompiler task with the - // correct parameters. But before calling the AspNetCompiler task, we need to - // do a bunch of prep work regarding references. - - // We're going to build up an MSBuild condition string that represents the valid Configurations. - // We do this by OR'ing together individual conditions, each of which compares $(Configuration) - // with a valid configuration name. We init our condition string to "false", so we can easily - // OR together more stuff as we go, and also easily take the negation of the condition by putting - // a ! around the whole thing. - StringBuilder conditionDescribingValidConfigurations = new StringBuilder("(false)"); - - // Loop through all the valid configurations and add a PropertyGroup for each one. - foreach (DictionaryEntry aspNetConfiguration in proj.AspNetConfigurations) - { - string configurationName = (string)aspNetConfiguration.Key; - AspNetCompilerParameters aspNetCompilerParameters = (AspNetCompilerParameters)aspNetConfiguration.Value; - - // We only add the PropertyGroup once per Venus project. Without the following "if", we would add - // the same identical PropertyGroup twice, once when AddTargetForWebProject is called with - // subTargetName=null and once when subTargetName="Rebuild". - if (subTargetName == null) - { - AddPropertyGroupForAspNetConfiguration(msbuildProject, proj, configurationName, - aspNetCompilerParameters, solution.SolutionFile); - } - - // Update our big condition string to include this configuration. - conditionDescribingValidConfigurations.Append(" or "); - conditionDescribingValidConfigurations.AppendFormat(CultureInfo.InvariantCulture, "('$(AspNetConfiguration)' == '{0}')", - EscapingUtilities.Escape(configurationName)); - } - - StringBuilder referenceItemName = new StringBuilder(GenerateSafePropertyName(proj, "References")); - if (!string.IsNullOrEmpty(subTargetName)) - { - referenceItemName.Append('_'); - referenceItemName.Append(subTargetName); - } - - // Add tasks to resolve project references of this web project, if any - if (proj.ProjectReferences.Count > 0) - { - // This is a bit tricky. Even though web projects don't use solution configurations, - // we want to use the current solution configuration to build the proper configurations - // of referenced projects. - foreach (ConfigurationInSolution solutionConfiguration in solution.SolutionConfigurations) - { - string referenceProjectGuids; - AddResolveProjectReferenceTasks(solution, msbuildProject, newTarget, proj, solutionConfiguration, - referenceItemName.ToString(), null /* don't care about native references */, out referenceProjectGuids); - } - } - - // Add tasks to capture the auto-refreshed file references (those .REFRESH files). - AddTasksToResolveAutoRefreshFileReferences(newTarget, proj, referenceItemName.ToString()); - - // Add a call to RAR (ResolveAssemblyReference) and the Copy task to put the referenced - // project outputs in the right place - AddTasksToCopyAllDependenciesIntoBinDir(newTarget, proj, referenceItemName.ToString(), conditionDescribingValidConfigurations.ToString()); - - // Add a call to the AspNetCompiler task, conditioned on having a valid Configuration. - AddTaskForAspNetCompiler(newTarget, proj, conditionDescribingValidConfigurations.ToString()); - - // Add a call to the task, conditioned on having an *invalid* Configuration. The - // message says that we're skipping the Venus project because it's either not enabled - // for precompilation, or doesn't support the given configuration. - BuildTask newMessageTag = AddErrorWarningMessageElement(newTarget, XMakeElements.message, false, "SolutionVenusProjectSkipped"); - newMessageTag.Condition = "!(" + conditionDescribingValidConfigurations.ToString() + ")"; - } - } - - /// - /// Takes a project in the solution and a base property name, and creates a new property name - /// that can safely be used as an XML element name, and is also unique to that project (by - /// embedding the project's GUID into the property name. - /// - /// - /// - /// A safe property name that can be used as an XML element name. - /// RGoel - private static string GenerateSafePropertyName - ( - ProjectInSolution proj, - string propertyName - ) - { - // XML element names cannot contain curly braces, so get rid of them from the project guid. - string projectGuid = proj.ProjectGuid.Substring(1, proj.ProjectGuid.Length - 2); - return "Project_" + projectGuid + "_" + propertyName; - } - - /// - /// Makes a legal item name from a given string by replacing invalid characters with '_' - /// - private static string MakeIntoSafeItemName(string name) - { - int indexOfBadCharacter = XmlUtilities.LocateFirstInvalidElementNameCharacter(name); - - if (indexOfBadCharacter == -1) - { - return name; - } - - StringBuilder builder = new StringBuilder(name); - - do - { - builder[indexOfBadCharacter] = '_'; - indexOfBadCharacter = XmlUtilities.LocateFirstInvalidElementNameCharacter(builder.ToString()); - } - while (indexOfBadCharacter != -1); - - return builder.ToString(); - } - - /// - /// Add a new error/warning/message tag into the given target - /// - /// Destination target for the tag - /// Element type to add (Error, Warning, Message) - /// Whether to treat the Text as a literal string or one that contains embedded properties, etc. - /// Resource string name to use in the tag text - /// Additional parameters to pass to FormatString - /// LukaszG - internal static BuildTask AddErrorWarningMessageElement(Target target, string elementType, - bool treatAsLiteral, string textResourceName, params object[] args) - { - string code; - string helpKeyword; - string text = ResourceUtilities.FormatResourceString(out code, out helpKeyword, textResourceName, args); - - BuildTask task = target.AddNewTask(elementType); - task.SetParameterValue("Text", text, treatAsLiteral); - - if ((elementType != XMakeElements.message) && (code != null)) - { - task.SetParameterValue("Code", code, true /* treat as literal */); - } - - if ((elementType != XMakeElements.message) && (helpKeyword != null)) - { - task.SetParameterValue("HelpKeyword", helpKeyword, true /* treat as literal */); - } - - return task; - } - - /// - /// Emit warnings when the project type is unknown. - /// - /// The project to add the target to - /// The project to add as a target. - /// The target to call within the project that's being added. - /// Optional detailed error message to print out in case we already tried accessing the - /// project file before and failed. - /// RGoel - private static void AddTargetForUnknownProjectType - ( - Project msbuildProject, - SolutionParser solution, - ProjectInSolution proj, - string subTargetName, - string errorMessage - ) - { - string targetName = ProjectInSolution.DisambiguateProjectTargetName(proj.GetUniqueProjectName()); - if (!string.IsNullOrEmpty(subTargetName)) - { - targetName = targetName + ":" + subTargetName; - } - - Target newTarget = msbuildProject.Targets.AddNewTarget(targetName); - newTarget.DependsOnTargets = GetProjectDependencies(proj.ParentSolution, proj, subTargetName); - newTarget.Condition = "'$(CurrentSolutionConfigurationContents)' != ''"; - - foreach (ConfigurationInSolution solutionConfiguration in solution.SolutionConfigurations) - { - ProjectConfigurationInSolution projectConfiguration; - BuildTask newTask; - if (proj.ProjectConfigurations.TryGetValue(solutionConfiguration.FullName, out projectConfiguration)) - { - if (projectConfiguration.IncludeInBuild) - { - if (errorMessage == null) - { - // we haven't encountered any problems accessing the project file in the past, but do not support - // building this project type - newTask = AddErrorWarningMessageElement(newTarget, XMakeElements.warning, true, "SolutionParseUnknownProjectType", proj.RelativePath); - } - else - { - // this project file may be of supported type, but we have encountered problems accessing it - newTask = AddErrorWarningMessageElement(newTarget, XMakeElements.warning, true, "SolutionParseErrorReadingProject", proj.RelativePath, errorMessage); - } - } - else - { - newTask = AddErrorWarningMessageElement(newTarget, XMakeElements.message, true, "SolutionProjectSkippedForBuilding", proj.ProjectName, solutionConfiguration.FullName); - } - } - else - { - newTask = AddErrorWarningMessageElement(newTarget, XMakeElements.warning, true, "SolutionProjectConfigurationMissing", proj.ProjectName, solutionConfiguration.FullName); - } - - if (newTask != null) - { - newTask.Condition = GetConditionStringForConfiguration(solutionConfiguration); - } - } - } - - /// - /// Add a new target that depends on all targets. Examples of this are Clean and Rebuild. - /// - /// The project to add the target to - /// The target name to add. - /// The name of the item exposing this target's outputs. May be null. - /// The target to call within the project that's being added. - /// - /// RGoel - private static Target AddAllDependencyTarget - ( - Project msbuildProject, - string targetName, - string targetOutputItemName, - string subTargetName, - Dictionary> projectsByDependencyLevel - ) - { - Target newTarget = msbuildProject.Targets.AddNewTarget(targetName); - newTarget.Condition = "'$(CurrentSolutionConfigurationContents)' != ''"; - - if (!String.IsNullOrEmpty(targetOutputItemName)) - { - newTarget.TargetElement.SetAttribute("Outputs", string.Format(CultureInfo.InvariantCulture, "@({0})", targetOutputItemName)); - } - - for (int dependencyLevel = 0; dependencyLevel < projectsByDependencyLevel.Count; dependencyLevel++) - { - string buildItemName = "BuildLevel" + dependencyLevel; - string buildItemReference = string.Format(CultureInfo.InvariantCulture, "@({0})", buildItemName); - - BuildTask msbuildTask = newTarget.AddNewTask("MSBuild"); - msbuildTask.Condition = buildItemReference + " != ''"; - msbuildTask.SetParameterValue("Projects", buildItemReference); - msbuildTask.SetParameterValue("Properties", "Configuration=%(Configuration); Platform=%(Platform); BuildingSolutionFile=true; CurrentSolutionConfigurationContents=$(CurrentSolutionConfigurationContents); SolutionDir=$(SolutionDir); SolutionExt=$(SolutionExt); SolutionFileName=$(SolutionFileName); SolutionName=$(SolutionName); SolutionPath=$(SolutionPath)"); - - if (!string.IsNullOrEmpty(subTargetName)) - { - msbuildTask.SetParameterValue("Targets", subTargetName); - } - - if (!String.IsNullOrEmpty(targetOutputItemName)) - { - msbuildTask.AddOutputItem("TargetOutputs", targetOutputItemName); - } - - if (!String.Equals(msbuildProject.ToolsVersion, "2.0", StringComparison.OrdinalIgnoreCase)) - { - msbuildTask.SetParameterValue("ToolsVersion", "$(ProjectToolsVersion)"); - msbuildTask.SetParameterValue("BuildInParallel", "true"); - msbuildTask.SetParameterValue("UnloadProjectsOnCompletion", "$(UnloadProjectsOnCompletion)"); - msbuildTask.SetParameterValue("UseResultsCache", "$(UseResultsCache)"); - } - - BuildTask messageTask = AddErrorWarningMessageElement(newTarget, XMakeElements.message, false /* don't treat as literal */, "SolutionProjectSkippedForBuilding", - string.Format(CultureInfo.InvariantCulture, "%(SkipLevel{0}.Identity)", dependencyLevel), "$(Configuration)|$(Platform)"); - messageTask.Condition = string.Format(CultureInfo.InvariantCulture, "@(SkipLevel{0}) != ''", dependencyLevel); - - BuildTask warningTask = AddErrorWarningMessageElement(newTarget, XMakeElements.warning, false /* don't treat as literal */, "SolutionProjectConfigurationMissing", - string.Format(CultureInfo.InvariantCulture, "%(MissingConfigLevel{0}.Identity)", dependencyLevel), "$(Configuration)|$(Platform)"); - warningTask.Condition = string.Format(CultureInfo.InvariantCulture, "@(MissingConfigLevel{0}) != ''", dependencyLevel); - - string allProjects = GetAllNonMSBuildProjectDependencies(projectsByDependencyLevel, dependencyLevel, subTargetName); - if (allProjects.Length > 0) - { - BuildTask newTask = newTarget.AddNewTask("CallTarget"); - newTask.SetParameterValue("Targets", allProjects, false /* DO NOT treat as literal */); - - newTask.SetParameterValue("RunEachTargetSeparately", "true"); - } - } - - return newTarget; - } - - /// - /// This method returns a string containing a semicolon-separated list of "friendly" project names - /// on which the specified project depends. If the null is specified, a list of all projects - /// is returned. - /// - /// - /// - /// - /// - /// RGoel - private static string GetProjectDependencies(SolutionParser solution, ProjectInSolution project, string subTargetName) - { - ErrorUtilities.VerifyThrow(project != null, "We should always have a project for this method"); - StringBuilder dependencies = new StringBuilder(); - - // Get all the dependencies for this project - foreach (string dependency in project.Dependencies) - { - if (dependencies.Length != 0) - { - dependencies.Append(";"); - } - - string projectUniqueName = solution.GetProjectUniqueNameByGuid(dependency); - ProjectFileErrorUtilities.VerifyThrowInvalidProjectFile(projectUniqueName != null, - "SubCategoryForSolutionParsingErrors", - new BuildEventFileInfo(solution.SolutionFile), - "SolutionParseProjectDepNotFoundError", project.ProjectGuid, dependency); - - dependencies.Append(ProjectInSolution.DisambiguateProjectTargetName(projectUniqueName)); - if (!string.IsNullOrEmpty(subTargetName)) - { - dependencies.Append(":"); - dependencies.Append(subTargetName); - } - } - - return dependencies.ToString(); - } - - /// - /// Get all projects for the given dependency level. - /// - /// - /// - /// - /// - private static string GetAllNonMSBuildProjectDependencies - ( - Dictionary> projectsByDependencyLevel, - int dependencyLevel, - string subTargetName - ) - { - StringBuilder dependencies = new StringBuilder(); - - // Return *all* projects except solution folders - foreach (ProjectInSolution proj in projectsByDependencyLevel[dependencyLevel]) - { - if (proj.ProjectType == SolutionProjectType.SolutionFolder) - { - continue; - } - - if (proj.ProjectType == SolutionProjectType.ManagedProject) - { - continue; - } - - if (dependencies.Length != 0) - { - dependencies.Append(";"); - } - - dependencies.Append(ProjectInSolution.DisambiguateProjectTargetName(proj.GetUniqueProjectName())); - if (!string.IsNullOrEmpty(subTargetName)) - { - dependencies.Append(":"); - dependencies.Append(subTargetName); - } - } - - return dependencies.ToString(); - } - - /// - /// A helper method for constructing conditions for a solution configuration - /// - /// - /// Sample configuration condition: - /// '$(Configuration)' == 'Release' and '$(Platform)' == 'Any CPU' - /// - /// - /// - /// LukaszG - private static string GetConditionStringForConfiguration(ConfigurationInSolution configuration) - { - return string.Format(CultureInfo.InvariantCulture, " ('$(Configuration)' == '{0}') and ('$(Platform)' == '{1}') ", - EscapingUtilities.Escape(configuration.ConfigurationName), - EscapingUtilities.Escape(configuration.PlatformName)); - } - - /// - /// Creates default Configuration and Platform values based on solution configurations present in the solution - /// - /// - /// - /// LukaszG - private static void AddConfigurationPlatformDefaults - ( - Project msbuildProject, - SolutionParser solution - ) - { - BuildPropertyGroup configurationDefaultingPropertyGroup = msbuildProject.AddNewPropertyGroup(true /* insertAtEndOfProject = true */); - configurationDefaultingPropertyGroup.Condition = " '$(Configuration)' == '' "; - configurationDefaultingPropertyGroup.AddNewProperty("Configuration", solution.GetDefaultConfigurationName(), true /* treat as literal */); - - BuildPropertyGroup platformDefaultingPropertyGroup = msbuildProject.AddNewPropertyGroup(true /* insertAtEndOfProject = true */); - platformDefaultingPropertyGroup.Condition = " '$(Platform)' == '' "; - platformDefaultingPropertyGroup.AddNewProperty("Platform", solution.GetDefaultPlatformName(), true /* treat as literal */); - } - - /// - /// Adds a new property group with contents of the given solution configuration to the project - /// Internal for unit-testing. - /// - /// - /// - /// - /// LukaszG - internal static void AddPropertyGroupForSolutionConfiguration - ( - Project msbuildProject, - SolutionParser solution, - ConfigurationInSolution solutionConfiguration - ) - { - BuildPropertyGroup propertyGroup = msbuildProject.AddNewPropertyGroup(true /* insertAtEndOfProject = true */); - propertyGroup.Condition = GetConditionStringForConfiguration(solutionConfiguration); - - StringBuilder solutionConfigurationContents = new StringBuilder(""); - - // add a project configuration entry for each project in the solution - foreach (ProjectInSolution project in solution.ProjectsInOrder) - { - ProjectConfigurationInSolution projectConfiguration; - if (project.ProjectConfigurations.TryGetValue(solutionConfiguration.FullName, out projectConfiguration)) - { - solutionConfigurationContents.AppendFormat( - CultureInfo.InvariantCulture, - "{1}", - project.ProjectGuid, - projectConfiguration.FullName - ); - } - } - - solutionConfigurationContents.Append(""); - - propertyGroup.AddNewProperty("CurrentSolutionConfigurationContents", solutionConfigurationContents.ToString(), true /* treat as literal */); - } - - /// - /// Creates the default Venus configuration property based on the selected solution configuration. - /// Unfortunately, Venus projects only expose one project configuration in the IDE (Debug) although - /// they allow building Debug and Release from command line. This means that if we wanted to use - /// the project configuration from the active solution configuration for Venus projects, we'd always - /// end up with Debug and there'd be no way to build the Release configuration. To work around this, - /// we use a special mechanism for choosing ASP.NET project configuration: we set it to Release if - /// we're building a Release solution configuration, and to Debug if we're building a Debug solution - /// configuration. The property is also settable from the command line, in which case it takes - /// precedence over this algorithm. - /// - /// - /// LukaszG - private static void AddVenusConfigurationDefaults - ( - Project msbuildProject - ) - { - BuildPropertyGroup propertyGroup = msbuildProject.AddNewPropertyGroup(true /* insertAtEndOfProject = true */); - propertyGroup.Condition = " ('$(AspNetConfiguration)' == '') "; - propertyGroup.AddNewProperty("AspNetConfiguration", "$(Configuration)"); - } - - /// - /// Adds solution related build event macros and other global properties to the wrapper project - /// - /// - /// - /// LukaszG - private static void AddGlobalProperties(Project msbuildProject, SolutionParser solution) - { - BuildPropertyGroup propertyGroup = msbuildProject.AddNewPropertyGroup(true /* insertAtEndOfProject = true */); - - string directoryName = solution.SolutionFileDirectory; - if (!directoryName.EndsWith(Path.DirectorySeparatorChar.ToString(), StringComparison.Ordinal)) - { - directoryName += Path.DirectorySeparatorChar; - } - - propertyGroup.AddNewProperty("SolutionDir", directoryName, true /* treat as literal */); - propertyGroup.AddNewProperty("SolutionExt", Path.GetExtension(solution.SolutionFile), true /* treat as literal */); - propertyGroup.AddNewProperty("SolutionFileName", Path.GetFileName(solution.SolutionFile), true /* treat as literal */); - propertyGroup.AddNewProperty("SolutionName", Path.GetFileNameWithoutExtension(solution.SolutionFile), true /* treat as literal */); - - propertyGroup.AddNewProperty("SolutionPath", Path.Combine(solution.SolutionFileDirectory, Path.GetFileName(solution.SolutionFile)), true /* treat as literal */); - - // Add other global properties - BuildPropertyGroup propertyGroup2 = msbuildProject.AddNewPropertyGroup(true /* insertAtEndOfProject = true */); - - // Set the property "TargetFrameworkVersion". This is needed for the GetFrameworkPath target. - // If TargetFrameworkVersion is already set by the user, use that value. - // Otherwise if MSBuildToolsVersion is 2.0, use "v2.0" - // Otherwise if MSBuildToolsVersion is 3.5, use "v3.5" - // Otherwise use "v4.0". - BuildProperty v20Property = propertyGroup2.AddNewProperty("TargetFrameworkVersion", "v2.0", true /* treat as literal */); - BuildProperty v35Property = propertyGroup2.AddNewProperty("TargetFrameworkVersion", "v3.5", true /* treat as literal */); - BuildProperty v40Property = propertyGroup2.AddNewProperty("TargetFrameworkVersion", "v4.0", true /* treat as literal */); - v20Property.Condition = "'$(TargetFrameworkVersion)' == '' and '$(MSBuildToolsVersion)' == '2.0'"; - v35Property.Condition = "'$(TargetFrameworkVersion)' == '' and ('$(MSBuildToolsVersion)' == '3.5' or '$(MSBuildToolsVersion)' == '3.0')"; - v40Property.Condition = "'$(TargetFrameworkVersion)' == '' and '$(MSBuildToolsVersion)' == '4.0'"; - } - - /// - /// Special hack for web projects. It can happen that there is no Release configuration for solutions - /// containing web projects, yet we still want to be able to build the Release configuration for - /// those projects. Since the ASP.NET project configuration defaults to the solution configuration, - /// we allow Release even if it doesn't actually exist in the solution. - /// - /// - /// LukaszG - private static void AddFakeReleaseSolutionConfigurationIfNecessary(SolutionParser solution) - { - if (solution.ContainsWebProjects) - { - bool solutionHasReleaseConfiguration = false; - foreach (ConfigurationInSolution solutionConfiguration in solution.SolutionConfigurations) - { - if (string.Equals(solutionConfiguration.ConfigurationName, "Release", StringComparison.OrdinalIgnoreCase)) - { - solutionHasReleaseConfiguration = true; - break; - } - } - - if ((!solutionHasReleaseConfiguration) && (solution.SolutionConfigurations.Count > 0)) - { - solution.SolutionConfigurations.Add(new ConfigurationInSolution("Release", solution.GetDefaultPlatformName())); - } - } - } - - /// - /// Adds the initial target to the solution wrapper project, necessary for a few message/error tags - /// - /// - /// LukaszG - private static void AddInitialTargets(Project msbuildProject) - { - Target initialTarget = msbuildProject.Targets.AddNewTarget("ValidateSolutionConfiguration"); - - BuildTask errorTask = AddErrorWarningMessageElement(initialTarget, XMakeElements.error, false /* do not treat as literal */, - "SolutionInvalidSolutionConfiguration", "$(Configuration)|$(Platform)"); - errorTask.Condition = "('$(CurrentSolutionConfigurationContents)' == '') and ('$(SkipInvalidConfigurations)' != 'true')"; - - BuildTask warningTask = AddErrorWarningMessageElement(initialTarget, XMakeElements.warning, false /* do not treat as literal */, - "SolutionInvalidSolutionConfiguration", "$(Configuration)|$(Platform)"); - warningTask.Condition = "('$(CurrentSolutionConfigurationContents)' == '') and ('$(SkipInvalidConfigurations)' == 'true')"; - - BuildTask messageTask = AddErrorWarningMessageElement(initialTarget, XMakeElements.message, false /* do not treat as literal */, - "SolutionBuildingSolutionConfiguration", "$(Configuration)|$(Platform)"); - messageTask.Condition = "'$(CurrentSolutionConfigurationContents)' != ''"; - - Target validateToolsVersionsTarget = msbuildProject.Targets.AddNewTarget("ValidateToolsVersions"); - BuildTask toolsVersionErrorTask = AddErrorWarningMessageElement(validateToolsVersionsTarget, XMakeElements.error, false /* do not treat as literal */, - "SolutionToolsVersionDoesNotSupportProjectToolsVersion", "$(MSBuildToolsVersion)"); - toolsVersionErrorTask.Condition = "'$(MSBuildToolsVersion)' == '2.0' and ('$(ProjectToolsVersion)' != '2.0' and '$(ProjectToolsVersion)' != '')"; - - msbuildProject.InitialTargets = initialTarget.Name + ";" + validateToolsVersionsTarget.Name; - } - - /// - /// Normally the active solution configuration/platform is determined when we build the solution - /// wrapper project, not when we create it. However, we need to know them to scan project references - /// for the right project configuration/platform. It's unlikely that references would be conditional, - /// but still possible and we want to get that case right. - /// - /// - /// LukaszG - internal static string PredictActiveSolutionConfigurationName(SolutionParser solution, Engine parentEngine) - { - string candidateFullSolutionConfigurationName = DetermineLikelyActiveSolutionConfiguration(solution, parentEngine); - - // Now check if this solution configuration actually exists - string fullSolutionConfigurationName = null; - - foreach (ConfigurationInSolution solutionConfiguration in solution.SolutionConfigurations) - { - if (String.Equals(solutionConfiguration.FullName, candidateFullSolutionConfigurationName, StringComparison.OrdinalIgnoreCase)) - { - fullSolutionConfigurationName = solutionConfiguration.FullName; - break; - } - } - - return fullSolutionConfigurationName; - } - - /// - /// Figure out what solution configuration we are going to build, whether or not it actually exists in the solution - /// file. - /// - private static string DetermineLikelyActiveSolutionConfiguration(SolutionParser solution, Engine parentEngine) - { - string activeSolutionConfiguration; - string activeSolutionPlatform; - - BuildProperty configurationProperty = parentEngine.GlobalProperties["Configuration"]; - BuildProperty platformProperty = parentEngine.GlobalProperties["Platform"]; - - if (configurationProperty != null) - { - activeSolutionConfiguration = configurationProperty.FinalValue; - } - else - { - activeSolutionConfiguration = solution.GetDefaultConfigurationName(); - } - - if (platformProperty != null) - { - activeSolutionPlatform = platformProperty.FinalValue; - } - else - { - activeSolutionPlatform = solution.GetDefaultPlatformName(); - } - - ConfigurationInSolution configurationInSolution = new ConfigurationInSolution(activeSolutionConfiguration, activeSolutionPlatform); - - return configurationInSolution.FullName; - } - - /// - /// Loads each MSBuild project in this solution and looks for its project-to-project references so that - /// we know what build order we should use when building the solution. - /// - /// LukaszG - private static void ScanProjectDependencies(SolutionParser solution, Engine parentEngine, string childProjectToolsVersion, string fullSolutionConfigurationName, BuildEventContext projectBuildEventContext) - { - // Don't bother with all this if the solution configuration doesn't even exist. - if (fullSolutionConfigurationName == null) - { - return; - } - - foreach (ProjectInSolution project in solution.ProjectsInOrder) - { - // Skip the project if we don't have its configuration in this solution configuration - if (!project.ProjectConfigurations.ContainsKey(fullSolutionConfigurationName)) - { - continue; - } - - string message; - if ((project.ProjectType == SolutionProjectType.ManagedProject) || - ((project.ProjectType == SolutionProjectType.Unknown) && (project.CanBeMSBuildProjectFile(out message)))) - { - try - { - //Will fail to load a throw an error if the tools version is incorrect. - Project msbuildProject = new Project(parentEngine, childProjectToolsVersion); - msbuildProject.IsLoadedByHost = false; - - // this is before building the solution wrapper project, so the current directory may be not set to - // the one containing the solution file, and we'd get the relative path wrong - msbuildProject.Load(project.AbsolutePath); - - // Project references for MSBuild projects could be affected by the active configuration, - // so set it before retrieving references. - msbuildProject.GlobalProperties.SetProperty("Configuration", - project.ProjectConfigurations[fullSolutionConfigurationName].ConfigurationName, true /* treat as literal */); - msbuildProject.GlobalProperties.SetProperty("Platform", - project.ProjectConfigurations[fullSolutionConfigurationName].PlatformName, true /* treat as literal */); - - BuildItemGroup references = msbuildProject.GetEvaluatedItemsByName("ProjectReference"); - - foreach (BuildItem reference in references) - { - string referencedProjectGuid = reference.GetEvaluatedMetadata("Project"); // Need unescaped data here. - AddDependencyByGuid(solution, project, parentEngine, projectBuildEventContext, referencedProjectGuid); - } - - // - // ProjectDependency items work exactly like ProjectReference items from the point of - // view of determining that project B depends on project A. This item must cause - // project A to be built prior to project B. - // - references = msbuildProject.GetEvaluatedItemsByName("ProjectDependency"); - - foreach (BuildItem reference in references) - { - string referencedProjectGuid = reference.GetEvaluatedMetadata("Project"); // Need unescaped data here. - AddDependencyByGuid(solution, project, parentEngine, projectBuildEventContext, referencedProjectGuid); - } - - // - // If this is a web deployment project, we have a reference specified as a property - // "SourceWebProject" rather than as a ProjectReference item. This has the format - // {GUID}|PATH_TO_CSPROJ - // where - // GUID is the project guid for the "source" project - // PATH_TO_CSPROJ is the solution-relative path to the csproj file. - // - // NOTE: This is obsolete and is intended only for backward compatability with - // Whidbey-generated web deployment projects. New projects should use the - // ProjectDependency item above. - // - string referencedWebProjectGuid = msbuildProject.GetEvaluatedProperty("SourceWebProject"); - if (!string.IsNullOrEmpty(referencedWebProjectGuid)) - { - // Grab the guid with its curly braces... - referencedWebProjectGuid = referencedWebProjectGuid.Substring(0, 38); - AddDependencyByGuid(solution, project, parentEngine, projectBuildEventContext, referencedWebProjectGuid); - } - } - // We don't want any problems scanning the project file to result in aborting the build. - catch (Exception e) - { - if (ExceptionHandling.IsCriticalException(e)) - { - throw; - } - - parentEngine.LoggingServices.LogWarning(projectBuildEventContext, "SubCategoryForSolutionParsingErrors", new BuildEventFileInfo(project.RelativePath), - "SolutionScanProjectDependenciesFailed", project.RelativePath, e.Message); - } - } - else if (project.ProjectType == SolutionProjectType.VCProject) - { - try - { - XmlDocument doc = new XmlDocument(); - doc.Load(project.AbsolutePath); - - project.IsStaticLibrary = VCProjectParser.IsStaticLibrary(doc, project.ProjectConfigurations[fullSolutionConfigurationName].FullName); - - // this is before building the solution wrapper project, so the current directory may be not set to - // the one containing the solution file, and we'd get the relative path wrong - List referencedProjectGuids = VCProjectParser.GetReferencedProjectGuids(doc); - - foreach (string referencedProjectGuid in referencedProjectGuids) - { - if (!string.IsNullOrEmpty(referencedProjectGuid)) - { - if (solution.ProjectsByGuid.ContainsKey(referencedProjectGuid)) - { - project.Dependencies.Add(referencedProjectGuid); - project.ProjectReferences.Add(referencedProjectGuid); - } - else - { - parentEngine.LoggingServices.LogWarning(projectBuildEventContext, "SubCategoryForSolutionParsingErrors", new BuildEventFileInfo(solution.SolutionFile), - "SolutionParseProjectDepNotFoundError", project.ProjectGuid, referencedProjectGuid); - } - } - } - } - // We don't want any problems scanning the project file to result in aborting the build. - catch (Exception e) - { - if (ExceptionHandling.IsCriticalException(e)) - { - throw; - } - - parentEngine.LoggingServices.LogWarning(projectBuildEventContext, "SubCategoryForSolutionParsingErrors", new BuildEventFileInfo(project.RelativePath), - "SolutionScanProjectDependenciesFailed", project.RelativePath, e.Message); - } - } - } - } - - /// - /// Adds a dependency to the project based on the specified guid string. - /// - /// - /// If the string is null or empty, no dependency is added and this is not considered an error. - /// - /// The solution in which the project exists - /// The project to which the dependency will be added - /// The engine handling the conversion - /// The build event context - /// The guid, in string form, of the dependency project - private static void AddDependencyByGuid(SolutionParser solution, ProjectInSolution project, Engine parentEngine, BuildEventContext projectBuildEventContext, string dependencyGuid) - { - if (!String.IsNullOrEmpty(dependencyGuid)) - { - if (solution.ProjectsByGuid.ContainsKey(dependencyGuid)) - { - project.Dependencies.Add(dependencyGuid); - } - else - { - parentEngine.LoggingServices.LogWarning(projectBuildEventContext, "SubCategoryForSolutionParsingErrors", new BuildEventFileInfo(solution.SolutionFile), - "SolutionParseProjectDepNotFoundError", project.ProjectGuid, dependencyGuid); - } - } - } - - /// - /// For MSBuild projects, project dependencies you can set in the IDE only represent build order constraints. - /// If both projects are VC however, the VC project system treats dependencies as regular P2P references. - /// This behavior is a carry-over from the days of VC5/6, that's how P2P refs were done back then. Tricky. - /// To compensate for that, we need to add a P2P reference for every dependency between two VC projects. - /// MSBuild -> VC, VC -> MSBuild dependencies are not affected. - /// - /// - /// - /// LukaszG - internal static void ConvertVcToVcDependenciesToReferences(SolutionParser solution, Engine parentEngine, BuildEventContext projectBuildEventContext) - { - // Go through the list of the projects in solution looking for VC projects - foreach (ProjectInSolution project in solution.ProjectsInOrder) - { - if (project.ProjectType == SolutionProjectType.VCProject) - { - // Found a VC project. Does it have any dependencies on other VC projects? - foreach (string dependentProjectGuid in project.Dependencies) - { - if (solution.ProjectsByGuid.ContainsKey(dependentProjectGuid)) - { - ProjectInSolution dependentProject = (ProjectInSolution)solution.ProjectsByGuid[dependentProjectGuid]; - - // Found a dependency on another VC project. If there's not already a P2P reference between - // the two, add it. - if ((dependentProject.ProjectType == SolutionProjectType.VCProject) && - (!project.ProjectReferences.Contains(dependentProjectGuid))) - { - project.ProjectReferences.Add(dependentProjectGuid); - } - } - else - { - parentEngine.LoggingServices.LogWarning(projectBuildEventContext, "SubCategoryForSolutionParsingErrors", new BuildEventFileInfo(solution.SolutionFile), - "SolutionParseProjectDepNotFoundError", project.ProjectGuid, dependentProjectGuid); - } - } - } - } - } - - /// - /// Figure out the dependency level of the given project. - /// - /// - /// - /// - private static void AssignDependencyLevel(ProjectInSolution project, SolutionParser solution, Dictionary> projectsByDependencyLevel) - { - // if we ever try to recurse into a project whose dependency level we're calculating above, - // we have a circular dependency. - if (project.DependencyLevel == ProjectInSolution.DependencyLevelBeingDetermined) - { - ProjectErrorUtilities.VerifyThrowInvalidProject(false, null, "SolutionCircularDependencyError", project.ProjectName); - } - - if (project.DependencyLevel == ProjectInSolution.DependencyLevelUnknown) - { - project.DependencyLevel = ProjectInSolution.DependencyLevelBeingDetermined; - - int maxDependencyLevel = 0; - - // First, go through dependencies and ensure they have their dependency level set correctly. - foreach (string dependencyGuid in project.Dependencies) - { - ProjectInSolution referencedProject = (ProjectInSolution)solution.ProjectsByGuid[dependencyGuid]; - - AssignDependencyLevel(referencedProject, solution, projectsByDependencyLevel); - - if (referencedProject.DependencyLevel + 1 > maxDependencyLevel) - { - maxDependencyLevel = referencedProject.DependencyLevel + 1; - } - } - - // Our dependency level is the highest dependency level of all our dependencies plus 1, or 0 if we had - // no dependencies. - project.DependencyLevel = maxDependencyLevel; - - if (!projectsByDependencyLevel.ContainsKey(maxDependencyLevel)) - { - projectsByDependencyLevel.Add(maxDependencyLevel, new List()); - } - - projectsByDependencyLevel[maxDependencyLevel].Add(project); - } - } - - /// - /// Main entry point for figuring out the dependency levels. A dependency level is a set of projects that - /// have no intra-dependencies and depend only on projects fron dependency level N-1. Dependency level 0 - /// projects have no dependencies whatsoever. - /// - /// - /// - private static void AssignDependencyLevels(SolutionParser solution, Dictionary> projectsByDependencyLevel) - { - foreach (ProjectInSolution project in solution.ProjectsInOrder) - { - AssignDependencyLevel(project, solution, projectsByDependencyLevel); - } - } - - /// - /// Add virtual references for reference chains containing VC static library projects. - /// Since static libraries have no link step, any references they have to be passed - /// to their parent project, if any. So for example, in a chain like - /// native dll -> native static lib1 -> native static lib2 - /// we need to add a virtual reference between the native dll and the static lib2 - /// to maintain parity with the IDE behavior. - /// - /// - private static void AddVirtualReferencesForStaticLibraries(SolutionParser solution) - { - foreach (ProjectInSolution project in solution.ProjectsInOrder) - { - GatherChildReferencesForStaticLibraries(solution, project); - } - } - - /// - /// Recursive helper for AddVirtualReferencesForStaticLibraries - /// - private static void GatherChildReferencesForStaticLibraries(SolutionParser solution, ProjectInSolution project) - { - // We don't need to worry about cycles since we've already run the dependency level assignment - // which already checked for them. - if (!project.ChildReferencesGathered) - { - List referenceGuidsToAdd = new List(); - - foreach (string referenceGuid in project.ProjectReferences) - { - ProjectInSolution referencedProject = (ProjectInSolution)solution.ProjectsByGuid[referenceGuid]; - - // Gather references for all child projects recursively... - GatherChildReferencesForStaticLibraries(solution, referencedProject); - - // ... and pass on references from any static lib children we have to ourselves - if (referencedProject.IsStaticLibrary) - { - foreach (string childReferenceGuid in referencedProject.ProjectReferences) - { - if (!project.ProjectReferences.Contains(childReferenceGuid) && - !referenceGuidsToAdd.Contains(childReferenceGuid)) - { - referenceGuidsToAdd.Add(childReferenceGuid); - } - } - } - } - - project.ProjectReferences.AddRange(referenceGuidsToAdd); - project.ChildReferencesGathered = true; - } - } - } -} diff --git a/src/Deprecated/Engine/Solution/VCProjectParser.cs b/src/Deprecated/Engine/Solution/VCProjectParser.cs deleted file mode 100644 index 34a790dfcf9..00000000000 --- a/src/Deprecated/Engine/Solution/VCProjectParser.cs +++ /dev/null @@ -1,79 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections.Generic; -using System.Xml; - -namespace Microsoft.Build.BuildEngine -{ - internal static class VCProjectParser - { - /// - /// For a given VC project, retrieves the projects it references - /// - /// - /// - /// LukaszG - internal static List GetReferencedProjectGuids(XmlDocument project) - { - List referencedProjectGuids = new List(); - - XmlNodeList referenceElements = project.DocumentElement.GetElementsByTagName("References"); - - if (referenceElements.Count > 0) - { - foreach (XmlElement referenceElement in ((XmlElement)referenceElements[0]).GetElementsByTagName("ProjectReference")) - { - string referencedProjectGuid = referenceElement.GetAttribute("ReferencedProjectIdentifier"); - - if (!string.IsNullOrEmpty(referencedProjectGuid)) - { - referencedProjectGuids.Add(referencedProjectGuid); - } - } - } - - return referencedProjectGuids; - } - - /// - /// Is the project built as a static library for the given configuration? - /// - internal static bool IsStaticLibrary(XmlDocument project, string configurationName) - { - XmlNodeList configurationsElements = project.DocumentElement.GetElementsByTagName("Configurations"); - bool isStaticLibrary = false; - - // There should be only one configurations element - if (configurationsElements.Count > 0) - { - foreach (XmlNode configurationNode in configurationsElements[0].ChildNodes) - { - if (configurationNode.NodeType == XmlNodeType.Element) - { - XmlElement element = (XmlElement)configurationNode; - - // Look for configuration that matches our name - if ((string.Equals(element.Name, "Configuration", StringComparison.OrdinalIgnoreCase)) && - (string.Equals(element.GetAttribute("Name"), configurationName, StringComparison.OrdinalIgnoreCase))) - { - XmlElement configurationElement = element; - string configurationType = configurationElement.GetAttribute("ConfigurationType"); - isStaticLibrary = (configurationType == "4"); - - // we found our configuration, nothing more to do here - break; - } - } - } - } - - return isStaticLibrary; - } - } -} diff --git a/src/Deprecated/Engine/Solution/VCWrapperProject.cs b/src/Deprecated/Engine/Solution/VCWrapperProject.cs deleted file mode 100644 index b8b79a7e356..00000000000 --- a/src/Deprecated/Engine/Solution/VCWrapperProject.cs +++ /dev/null @@ -1,346 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.IO; -using System.Xml; -using Microsoft.Build.BuildEngine.Shared; -using Microsoft.Win32; - -namespace Microsoft.Build.BuildEngine -{ - internal class VCWrapperProject - { - /// - /// Add a target for a VC project file into the XML doc that's being generated. - /// This is used only when building standalone VC projects - /// - /// - /// - /// - /// - /// RGoel - private static void AddVCBuildTarget - ( - Project msbuildProject, - string projectPath, - string targetName, - string subTargetName - ) - { - Target newTarget = msbuildProject.Targets.AddNewTarget(targetName); - if (subTargetName == "Publish") - { - // Well, hmmm. The VCBuild doesn't support any kind of - // a "Publish" operation. The best we can really do is offer up a - // message saying so. - SolutionWrapperProject.AddErrorWarningMessageElement(newTarget, XMakeElements.error, true, "SolutionVCProjectNoPublish"); - } - else - { - SolutionWrapperProject.AddErrorWarningMessageElement(newTarget, XMakeElements.warning, true, "StandaloneVCProjectP2PRefsBroken"); - - string projectFullPath = Path.GetFullPath(projectPath); - AddVCBuildTaskElement(msbuildProject, newTarget, "$(VCBuildSolutionFile)", projectFullPath, subTargetName, "$(PlatformName)", "$(ConfigurationName)"); - } - } - - /// - /// Adds a new VCBuild task element to the specified target - /// - /// The target to add the VCBuild task to - /// Path to the solution if any - /// Path to the solution if any - /// The VCBuild target name - /// The platform parameter to VCBuild - /// Configuration property value - /// - internal static BuildTask AddVCBuildTaskElement - ( - Project msbuildProject, - Target target, - string solutionPath, - string projectPath, - string vcbuildTargetName, - string platformName, - string fullConfigurationName - ) - { - // The VCBuild task (which we already shipped) has a bug - it cannot - // find vcbuild.exe when running in MSBuild 64 bit unless it's on the path. - // So, pass it here, unless some explicit path was passed. - // Note, we have to do this even if we're in a 32 bit MSBuild, because we save the .sln.cache - // file, and the next build of the solution could be a 64 bit MSBuild. - - if (VCBuildLocationHint != null) // Should only be null if vcbuild truly isn't installed; in that case, let the task log its error - { - BuildTask createProperty = target.AddNewTask("CreateProperty"); - - createProperty.SetParameterValue("Value", VCBuildLocationHint); - createProperty.Condition = "'$(VCBuildToolPath)' == ''"; - createProperty.AddOutputProperty("Value", "VCBuildToolPath"); - } - - BuildTask newTask = target.AddNewTask("VCBuild"); - - newTask.SetParameterValue("Projects", projectPath, true /* treat as literal */); - - // Add the toolpath so that the user can override if necessary - newTask.SetParameterValue("ToolPath", "$(VCBuildToolPath)"); - - newTask.SetParameterValue("Configuration", fullConfigurationName); - - if (!string.IsNullOrEmpty(platformName)) - { - newTask.SetParameterValue("Platform", platformName); - } - - newTask.SetParameterValue("SolutionFile", solutionPath); - - if (!string.IsNullOrEmpty(vcbuildTargetName)) - { - newTask.SetParameterValue(vcbuildTargetName, "true"); - } - - // Add the override switch so that the user can supply one if necessary - newTask.SetParameterValue("Override", "$(VCBuildOverride)"); - - // Add any additional lib paths - newTask.SetParameterValue("AdditionalLibPaths", "$(VCBuildAdditionalLibPaths)"); - - // Only use new properties if we're not emitting a 2.0 project - if (!String.Equals(msbuildProject.ToolsVersion, "2.0", StringComparison.OrdinalIgnoreCase)) - { - // Add any additional link library paths - newTask.SetParameterValue("AdditionalLinkLibraryPaths", "$(VCBuildAdditionalLinkLibraryPaths)"); - - // Add the useenv switch so that the user can supply one if necessary - // Note: "VCBuildUserEnvironment" is included for backwards-compatibility; the correct - // property name is "VCBuildUseEnvironment" to match the task parameter. When the old name is - // used the task will emit a warning. - newTask.SetParameterValue("UseEnvironment", "$(VCBuildUseEnvironment)"); - } - - newTask.SetParameterValue("UserEnvironment", "$(VCBuildUserEnvironment)"); - - // Add the additional options switches - newTask.SetParameterValue("AdditionalOptions", "$(VCBuildAdditionalOptions)"); - - return newTask; - } - - /// - /// This method generates an XmlDocument representing an MSBuild project wrapper for a VC project - /// - /// LukaszG - internal static XmlDocument GenerateVCWrapperProject(Engine parentEngine, string vcProjectFilename, string toolsVersion) - { - string projectPath = Path.GetFullPath(vcProjectFilename); - Project msbuildProject; - try - { - msbuildProject = new Project(parentEngine, toolsVersion); - } - catch (InvalidOperationException) - { - BuildEventFileInfo fileInfo = new BuildEventFileInfo(projectPath); - string errorCode; - string helpKeyword; - string message = ResourceUtilities.FormatResourceString(out errorCode, out helpKeyword, "UnrecognizedToolsVersion", toolsVersion); - throw new InvalidProjectFileException(projectPath, fileInfo.Line, fileInfo.Column, fileInfo.EndLine, fileInfo.EndColumn, message, null, errorCode, helpKeyword); - } - - msbuildProject.IsLoadedByHost = false; - msbuildProject.DefaultTargets = "Build"; - - string wrapperProjectToolsVersion = SolutionWrapperProject.DetermineWrapperProjectToolsVersion(toolsVersion); - msbuildProject.DefaultToolsVersion = wrapperProjectToolsVersion; - - BuildPropertyGroup propertyGroup = msbuildProject.AddNewPropertyGroup(true /* insertAtEndOfProject = true */); - propertyGroup.Condition = " ('$(Configuration)' != '') and ('$(Platform)' == '') "; - propertyGroup.AddNewProperty("ConfigurationName", "$(Configuration)"); - - propertyGroup = msbuildProject.AddNewPropertyGroup(true /* insertAtEndOfProject = true */); - propertyGroup.Condition = " ('$(Configuration)' != '') and ('$(Platform)' != '') "; - propertyGroup.AddNewProperty("ConfigurationName", "$(Configuration)|$(Platform)"); - - // only use PlatformName if we only have the platform part - propertyGroup = msbuildProject.AddNewPropertyGroup(true /* insertAtEndOfProject = true */); - propertyGroup.Condition = " ('$(Configuration)' == '') and ('$(Platform)' != '') "; - propertyGroup.AddNewProperty("PlatformName", "$(Platform)"); - - AddVCBuildTarget(msbuildProject, projectPath, "Build", null); - AddVCBuildTarget(msbuildProject, projectPath, "Clean", "Clean"); - AddVCBuildTarget(msbuildProject, projectPath, "Rebuild", "Rebuild"); - AddVCBuildTarget(msbuildProject, projectPath, "Publish", "Publish"); - - // Special environment variable to allow people to see the in-memory MSBuild project generated - // to represent the VC project. - if (Environment.GetEnvironmentVariable("MSBuildEmitSolution") != null) - { - msbuildProject.Save(vcProjectFilename + ".proj"); - } - - return msbuildProject.XmlDocument; - } - - /// - /// Hint to give the VCBuild task to help it find vcbuild.exe. - /// - private static string path; - - /// - /// Hint to give the VCBuild task to help it find vcbuild.exe. - /// Directory in which vcbuild.exe is found. - /// - internal static string VCBuildLocationHint - { - get - { - if (path == null) - { - path = GenerateFullPathToTool(RegistryView.Default); - - if (path == null && Environment.Is64BitProcess) - { - path = GenerateFullPathToTool(RegistryView.Registry32); - } - - if (path != null) - { - path = Path.GetDirectoryName(path); - } - } - - return path; - } - } - - // The code below is mostly copied from the VCBuild task that we shipped in 3.5. - // It is the logic it uses to find vcbuild.exe. That logic had a flaw - - // in 64 bit MSBuild, in a vanilla command window (like in Team Build) it would not - // find vcbuild.exe. We use the logic below to predict whether VCBuild will find it, - // and if it won't, we will pass the "hint" to use the 64 bit program files location. - - /// - /// constants for VS9 Pro and above SKUs - /// - // root registry key for VS9 - private const string vs9RegKey = @"SOFTWARE\Microsoft\VisualStudio\9.0"; - // the name of the value containing disk install directory for the IDE components - // ("...\common7\ide" for layouts) - private const string vs9InstallDirValueName = "InstallDir"; - // relative path from the above directory to vcbuild.exe on layouts - private const string vs9RelativePathToVCBuildLayouts = @"..\..\vc\vcpackages\vcbuild.exe"; - // relative path from the above directory to vcbuild.exe on batch - private const string vs9RelativePathToVCBuildBatch = @"vcbuild.exe"; - - /// - /// constants for the VC9 Express SKU - /// - // root registry key for VC9 - private const string vc9RegKey = @"SOFTWARE\Microsoft\VCExpress\9.0"; - // the name of the value containing disk install directory for the IDE components - // ("...\common7\ide" for layouts) - private const string vc9InstallDirValueName = "InstallDir"; - // relative path from the above directory to vcbuild.exe on layouts - private const string vc9RelativePathToVCBuildLayouts = @"..\..\vc\vcpackages\vcbuild.exe"; - // relative path from the above directory to vcbuild.exe on batch - private const string vc9RelativePathToVCBuildBatch = @"vcbuild.exe"; - - // name of the tool - private const string vcbuildName = "vcbuild.exe"; - - /// - /// Determing the path to vcbuild.exe - /// - /// path to vcbuild.exe, or null if it's not found - private static string GenerateFullPathToTool(RegistryView registryView) - { - using (RegistryKey baseKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, registryView)) - { - // try VS9 professional and above SKUs first - string location = TryLocationFromRegistry(baseKey, vs9RegKey, vs9InstallDirValueName, - vs9RelativePathToVCBuildLayouts, vs9RelativePathToVCBuildBatch); - - if (location != null) - { - return location; - } - - // fall back to the VC Express SKU - location = TryLocationFromRegistry(baseKey, vc9RegKey, vc9InstallDirValueName, - vc9RelativePathToVCBuildLayouts, vc9RelativePathToVCBuildBatch); - - if (location != null) - { - return location; - } - - // finally, try looking in the system path - if (Microsoft.Build.BuildEngine.Shared.NativeMethods.FindOnPath(vcbuildName) == null) - { - // If SearchPath didn't find the file, it's not on the system path and we have no chance of finding it. - return null; - } - - return null; - } - } - - /// - /// Looks up a path from the registry if present, and checks whether VCBuild.exe is there. - /// - /// Registry key to open - /// Value under that key to read - /// Low-pri message to log if registry key isn't found - /// Relative path from the key value to vcbuild.exe for layout installs - /// Relative path from the key value to vcbuild.exe for batch installs - /// Path to vcbuild.exe, or null if it's not found - /// danmose - private static string TryLocationFromRegistry(RegistryKey root, string subKeyName, string valueName, - string relativePathFromValueOnLayout, string relativePathFromValueOnBatch) - { - using (RegistryKey subKey = root.OpenSubKey(subKeyName)) - { - if (subKey == null) - { - // We couldn't find an installation of the product we were looking for. - return null; - } - else - { - string rootDir = (string)subKey.GetValue(valueName); - - if (rootDir != null) - { - // first try the location for layouts - string vcBuildPath = Path.Combine(rootDir, relativePathFromValueOnLayout); - if (File.Exists(vcBuildPath)) - { - return vcBuildPath; - } - - // if not found in layouts location, try the alternate dir if any, - // which contains vcbuild for batch installs - if (relativePathFromValueOnBatch != null) - { - vcBuildPath = Path.Combine(rootDir, relativePathFromValueOnBatch); - if (File.Exists(vcBuildPath)) - { - return vcBuildPath; - } - } - } - } - - // Didn't find it - return null; - } - } - } -} diff --git a/src/Deprecated/Engine/Tasks/IntrinsicTask.cs b/src/Deprecated/Engine/Tasks/IntrinsicTask.cs deleted file mode 100644 index 5c833b7e4b6..00000000000 --- a/src/Deprecated/Engine/Tasks/IntrinsicTask.cs +++ /dev/null @@ -1,380 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections.Generic; - -using Microsoft.Build.Framework; -using Microsoft.Build.BuildEngine.Shared; -using System.Xml; -using System.Collections; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// A class that evaluates an ItemGroup or PropertyGroup that is within a target. - /// - internal sealed class IntrinsicTask - { - #region Constructors - - /// - /// Creates an IntrinsicTask object around a "task" node - /// - internal IntrinsicTask(XmlElement taskNodeXmlElement, EngineLoggingServices loggingServices, BuildEventContext eventContext, string executionDirectory, ItemDefinitionLibrary itemDefinitionLibrary) - { - this.taskNodeXmlElement = taskNodeXmlElement; - this.conditionAttribute = taskNodeXmlElement.Attributes[XMakeAttributes.condition]; - this.loggingServices = loggingServices; - this.buildEventContext = eventContext; - this.executionDirectory = executionDirectory; - this.itemDefinitionLibrary = itemDefinitionLibrary; - - ErrorUtilities.VerifyThrow(IsIntrinsicTaskName(taskNodeXmlElement.Name), "Only PropertyGroup and ItemGroup are known intrinsic tasks"); - - switch (taskNodeXmlElement.Name) - { - case XMakeElements.propertyGroup: - backingType = BackingType.PropertyGroup; - // If the backing type is a property group, we can just use a property group object; its semantics aren't - // tangled up with the project object. Put another way, we only really need the code that understands the XML - // format of a property group, and we can get that without the rest of BuildPropertyGroup getting in the way. - // Specify that these properties are output properties, so they get reverted when the project is reset. - backingPropertyGroup = new BuildPropertyGroup(null /* no parent project */, taskNodeXmlElement, PropertyType.OutputProperty); - break; - case XMakeElements.itemGroup: - backingType = BackingType.ItemGroup; - // If the backing type is an item group, we just re-use the code that understands the XML format of an item group; - // the semantics of BuildItemGroup are too coupled to its current use in the Project object for us to re-use it. - backingItemGroupXml = new BuildItemGroupXml(taskNodeXmlElement); - List children = backingItemGroupXml.GetChildren(); - backingBuildItemGroupChildren = new List(children.Count); - - foreach (XmlElement child in children) - { - BuildItemGroupChildXml childXml = new BuildItemGroupChildXml(child, ChildType.Any); - backingBuildItemGroupChildren.Add(childXml); - } - break; - } - } - - #endregion - - #region Methods - - /// - /// Called to execute a task within a target. This method instantiates the task, sets its parameters, and executes it. - /// - internal void ExecuteTask(Lookup lookup) - { - ErrorUtilities.VerifyThrow(lookup != null, "Need to specify lookup."); - - if ((conditionAttribute != null) - && !Utilities.EvaluateCondition(conditionAttribute.Value, conditionAttribute, new Expander(lookup.ReadOnlyLookup), null, ParserOptions.AllowPropertiesAndItemLists, loggingServices, buildEventContext)) - { - return; - } - - // For these tasks, "execution" occurs the same whether we are asked to execute tasks - // or merely asked to infer outputs - switch (backingType) - { - case BackingType.PropertyGroup: - ExecutePropertyGroup(lookup); - break; - case BackingType.ItemGroup: - ExecuteItemGroup(lookup); - break; - } - } - - /// - /// Execute a PropertyGroup element, including each child property - /// - private void ExecutePropertyGroup(Lookup lookup) - { - foreach (BuildProperty property in backingPropertyGroup) - { - ArrayList buckets = null; - - try - { - // Find all the metadata references in order to create buckets - List parameterValues = new List(); - GetBatchableValuesFromProperty(parameterValues, property); - buckets = BatchingEngine.PrepareBatchingBuckets(taskNodeXmlElement, parameterValues, lookup); - - // "Execute" each bucket - foreach (ItemBucket bucket in buckets) - { - if (Utilities.EvaluateCondition(property.Condition, property.ConditionAttribute, - bucket.Expander, null, ParserOptions.AllowAll, loggingServices, buildEventContext)) - { - // Check for a reserved name now, so it fails right here instead of later when the property eventually reaches - // the outer scope. - ProjectErrorUtilities.VerifyThrowInvalidProject(!ReservedPropertyNames.IsReservedProperty(property.Name), property.PropertyElement, - "CannotModifyReservedProperty", property.Name); - - property.Evaluate(bucket.Expander); - bucket.Lookup.SetProperty(property); - } - } - } - finally - { - if (buckets != null) - { - // Propagate the property changes to the bucket above - foreach (ItemBucket bucket in buckets) - { - bucket.Lookup.LeaveScope(); - } - } - } - } - } - - /// - /// Execute an ItemGroup element, including each child item expression - /// - private void ExecuteItemGroup(Lookup lookup) - { - foreach (BuildItemGroupChildXml child in backingBuildItemGroupChildren) - { - ArrayList buckets = null; - - try - { - List parameterValues = new List(); - GetBatchableValuesFromBuildItemGroupChild(parameterValues, child); - buckets = BatchingEngine.PrepareBatchingBuckets(taskNodeXmlElement, parameterValues, lookup, child.Name); - - // "Execute" each bucket - foreach (ItemBucket bucket in buckets) - { - // Gather the outputs, but don't make them visible to other buckets - switch (child.ChildType) - { - case ChildType.BuildItemAdd: - // It's an item -- we're "adding" items to the world - ExecuteAdd(child, bucket); - break; - case ChildType.BuildItemRemove: - // It's a remove -- we're "removing" items from the world - ExecuteRemove(child, bucket); - break; - case ChildType.BuildItemModify: - // It's a modify -- changing existing items - ExecuteModify(child, bucket); - break; - } - } - } - finally - { - if (buckets != null) - { - // Propagate the item changes to the bucket above - foreach (ItemBucket bucket in buckets) - { - bucket.Lookup.LeaveScope(); - } - } - } - } - } - - /// - /// Add items to the world. This is the in-target equivalent of an item include expression outside of a target. - /// - private void ExecuteAdd(BuildItemGroupChildXml child, ItemBucket bucket) - { - // By making the items "not persisted", we ensure they are cleaned away when the project is reset - BuildItem item = new BuildItem(child.Element, false /* not imported */, false /* not persisted */, itemDefinitionLibrary); - - // If the condition on the item is false, Evaluate returns an empty group - BuildItemGroup itemsToAdd = item.Evaluate(bucket.Expander, executionDirectory, true /* expand metadata */, ParserOptions.AllowAll, loggingServices, buildEventContext); - - bucket.Lookup.AddNewItems(itemsToAdd); - } - - /// - /// Remove items from the world. Removes to items that are part of the project manifest are backed up, so - /// they can be reverted when the project is reset after the end of the build. - /// - private void ExecuteRemove(BuildItemGroupChildXml child, ItemBucket bucket) - { - if (!Utilities.EvaluateCondition(child.Condition, child.ConditionAttribute, bucket.Expander, ParserOptions.AllowAll, loggingServices, buildEventContext)) - { - return; - } - - BuildItemGroup group = bucket.Lookup.GetItems(child.Name); - if (group == null) - { - // No items of this type to remove - return; - } - - List itemsToRemove = BuildItemGroup.FindItemsMatchingSpecification(group, child.Remove, child.RemoveAttribute, bucket.Expander, executionDirectory); - - if (itemsToRemove != null) - { - bucket.Lookup.RemoveItems(itemsToRemove); - } - } - - /// - /// Modifies items in the world - specifically, changes their metadata. Changes to items that are part of the project manifest are backed up, so - /// they can be reverted when the project is reset after the end of the build. - /// - /// - /// - private void ExecuteModify(BuildItemGroupChildXml child, ItemBucket bucket) - { - if (!Utilities.EvaluateCondition(child.Condition, child.ConditionAttribute, bucket.Expander, ParserOptions.AllowAll, loggingServices, buildEventContext)) - { - return; - } - - BuildItemGroup group = (BuildItemGroup)bucket.Lookup.GetItems(child.Name); - if (group == null) - { - // No items of this type to modify - return; - } - - // Figure out what metadata names and values we need to set - Dictionary metadataToSet = new Dictionary(StringComparer.OrdinalIgnoreCase); - - List metadataElements = child.GetChildren(); - foreach (XmlElement metadataElement in metadataElements) - { - bool metadataCondition = true; - XmlAttribute conditionAttribute = ProjectXmlUtilities.GetConditionAttribute(metadataElement, true /*no other attributes allowed*/); - - if (conditionAttribute != null) - { - metadataCondition = Utilities.EvaluateCondition(conditionAttribute.Value, conditionAttribute, bucket.Expander, ParserOptions.AllowAll, loggingServices, buildEventContext); - } - - if (metadataCondition) - { - string unevaluatedMetadataValue = Utilities.GetXmlNodeInnerContents(metadataElement); - string evaluatedMetadataValue = bucket.Expander.ExpandAllIntoStringLeaveEscaped(unevaluatedMetadataValue, metadataElement); - // The last metadata with a particular name, wins, so we just set through the indexer here. - metadataToSet[metadataElement.Name] = evaluatedMetadataValue; - } - } - - bucket.Lookup.ModifyItems(child.Name, group, metadataToSet); - } - - /// - /// Adds batchable parameters from a property element into the list. If the property element was - /// a task, these would be its raw parameter values. - /// - private void GetBatchableValuesFromProperty(List parameterValues, BuildProperty property) - { - AddIfNotEmptyString(parameterValues, property.Value); - AddIfNotEmptyString(parameterValues, property.Condition); - } - - /// - /// Adds batchable parameters from an item element into the list. If the item element was a task, these - /// would be its raw parameter values. - /// - private void GetBatchableValuesFromBuildItemGroupChild(List parameterValues, BuildItemGroupChildXml child) - { - AddIfNotEmptyString(parameterValues, child.Include); - AddIfNotEmptyString(parameterValues, child.Exclude); - AddIfNotEmptyString(parameterValues, child.Remove); - AddIfNotEmptyString(parameterValues, child.Condition); - - List metadataElements = child.GetChildren(); - foreach (XmlElement metadataElement in metadataElements) - { - AddIfNotEmptyString(parameterValues, Utilities.GetXmlNodeInnerContents(metadataElement)); - XmlAttribute conditionAttribute = metadataElement.Attributes[XMakeAttributes.condition]; - if (conditionAttribute != null) - { - AddIfNotEmptyString(parameterValues, conditionAttribute.Value); - } - } - } - - /// - /// If value is not an empty string, adds it to list. - /// - private static void AddIfNotEmptyString(List list, string value) - { - if (!String.IsNullOrEmpty(value)) - { - list.Add(value); - } - } - - #endregion - - #region Fields - - // the XML backing the task - private XmlElement taskNodeXmlElement; - // the logging services provider - private EngineLoggingServices loggingServices; - // event contextual information where the event is fired from - private BuildEventContext buildEventContext; - - // whether the backing type is a property group, or an item group - private BackingType backingType; - - // backing property group, if any - private BuildPropertyGroup backingPropertyGroup; - - // backing xml for a backing item group, if any - private BuildItemGroupXml backingItemGroupXml; - - // children of the backing item group, if any - private List backingBuildItemGroupChildren = null; - - // directory in which the project is executing -- the current directory needed to expand wildcards - private string executionDirectory; - // the conditional expression that controls task execution - private XmlAttribute conditionAttribute; - // the library of default metadata that any new items should inherit - private ItemDefinitionLibrary itemDefinitionLibrary; - #endregion - - #region Nested Types - - /// - /// Used to discriminate the backing type of this object - /// - private enum BackingType - { - PropertyGroup, - ItemGroup - } - - #endregion - - #region Static methods - - /// - /// Compares the task name (case sensitively) to see - /// if it's an "intrinsic task" - /// - internal static bool IsIntrinsicTaskName(string name) - { - return String.Equals(name, XMakeElements.propertyGroup, StringComparison.Ordinal) - || String.Equals(name, XMakeElements.itemGroup, StringComparison.Ordinal); - } - - #endregion - } -} diff --git a/src/Deprecated/Engine/Utilities/EngineFileUtilities.cs b/src/Deprecated/Engine/Utilities/EngineFileUtilities.cs deleted file mode 100644 index eb7abc45aa8..00000000000 --- a/src/Deprecated/Engine/Utilities/EngineFileUtilities.cs +++ /dev/null @@ -1,87 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - internal class EngineFileUtilities - { - /// - /// Used for the purposes of evaluating an item specification. Given a filespec that may include wildcard characters * and - /// ?, we translate it into an actual list of files. If the input filespec doesn't contain any wildcard characters, and it - /// doesn't appear to point to an actual file on disk, then we just give back the input string as an array of length one, - /// assuming that it wasn't really intended to be a filename (as items are not required to necessarily represent files). - /// - /// RGoel - /// The filespec to evaluate. - /// Array of file paths. - internal static string[] GetFileListEscaped - ( - string directory, - string filespec - ) - { - ErrorUtilities.VerifyThrow(filespec.Length > 0, "Need a valid file-spec."); - - string[] fileList; - - bool containsEscapedWildcards = EscapingUtilities.ContainsEscapedWildcards(filespec); - bool containsRealWildcards = FileMatcher.HasWildcards(filespec); - - if (containsEscapedWildcards && containsRealWildcards) - { - // Umm, this makes no sense. The item's Include has both escaped wildcards and - // real wildcards. What does he want us to do? Go to the file system and find - // files that literally have '*' in their filename? Well, that's not going to - // happen because '*' is an illegal character to have in a filename. - - // Just return the original string. - fileList = new string[] { EscapingUtilities.Escape(filespec) }; - } - else if (!containsEscapedWildcards && containsRealWildcards) - { - // Unescape before handing it to the filesystem. - string filespecUnescaped = EscapingUtilities.UnescapeAll(filespec); - - // Get the list of actual files which match the filespec. Put - // the list into a string array. If the filespec started out - // as a relative path, we will get back a bunch of relative paths. - // If the filespec started out as an absolute path, we will get - // back a bunch of absolute paths. - fileList = FileMatcher.GetFiles(directory, filespecUnescaped); - - ErrorUtilities.VerifyThrow(fileList != null, "We must have a list of files here, even if it's empty."); - - // Before actually returning the file list, we sort them alphabetically. This - // provides a certain amount of extra determinism and reproducability. That is, - // we're sure that the build will behave in exactly the same way every time, - // and on every machine. - Array.Sort(fileList); - - // We must now go back and make sure all special characters are escaped because we always - // store data in the engine in escaped form so it doesn't screw up our parsing. - // Note that this means that characters that were not escaped in the original filespec - // may now be escaped, but that's not easy to avoid. - for (int i = 0; i < fileList.Length; i++) - { - fileList[i] = EscapingUtilities.Escape(fileList[i]); - } - } - else - { - // No real wildcards means we just return the original string. Don't even bother - // escaping ... it should already be escaped appropriately since it came directly - // from the project file or the OM host. - fileList = new string[] { filespec }; - } - - return fileList; - } - } -} diff --git a/src/Deprecated/Engine/Xml/BuildItemGroupChildXml.cs b/src/Deprecated/Engine/Xml/BuildItemGroupChildXml.cs deleted file mode 100644 index 070055fdc91..00000000000 --- a/src/Deprecated/Engine/Xml/BuildItemGroupChildXml.cs +++ /dev/null @@ -1,366 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections.Generic; -using Microsoft.Build.BuildEngine.Shared; -using System.Xml; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// Encapsulates, as far as possible, any XML behind the child of a BuildItemGroup element - /// - internal class BuildItemGroupChildXml - { - #region Fields - - // The element itself - private XmlElement element; - // The Condition attribute on it, if any, to save lookup - private XmlAttribute conditionAttribute; - // The Include attribute on it, if any, to save lookup - private XmlAttribute includeAttribute; - // The Exclude attribute on it, if any, to save lookup - private XmlAttribute excludeAttribute; - // The Remove attribute on it, if any, to save lookup - private XmlAttribute removeAttribute; - // Whether this is represents an add, remove, or modify - private ChildType childType; - - #endregion - - #region Constructors - - internal BuildItemGroupChildXml(XmlDocument ownerDocument, string name, string include) - { - this.element = ownerDocument.CreateElement(name, XMakeAttributes.defaultXmlNamespace); - this.Include = include; - } - - internal BuildItemGroupChildXml(XmlElement element, ChildType childTypeExpected) - { - ErrorUtilities.VerifyThrow(element != null, "Need an XML node."); - ErrorUtilities.VerifyThrowNoAssert(childTypeExpected != ChildType.Invalid, "Can't expect invalid childtype"); - ProjectXmlUtilities.VerifyThrowProjectValidNameAndNamespace(element); - - this.element = element; - - // Loop through each of the attributes on the item element. - foreach (XmlAttribute attribute in element.Attributes) - { - switch (attribute.Name) - { - case XMakeAttributes.include: - this.includeAttribute = attribute; - break; - - case XMakeAttributes.exclude: - this.excludeAttribute = attribute; - break; - - case XMakeAttributes.condition: - this.conditionAttribute = attribute; - break; - - case XMakeAttributes.xmlns: - // We already verified that the namespace is correct - break; - - case XMakeAttributes.remove: - this.removeAttribute = attribute; - break; - - case XMakeAttributes.keepMetadata: - case XMakeAttributes.removeMetadata: - case XMakeAttributes.keepDuplicates: - // Ignore these - they are part of the new OM. - break; - - default: - ProjectXmlUtilities.ThrowProjectInvalidAttribute(attribute); - break; - } - } - - this.childType = ChildType.Invalid; - - // Default to modify, if that's one of the child types we are told to expect. - if ((childTypeExpected & ChildType.BuildItemModify) == ChildType.BuildItemModify) - { - this.childType = ChildType.BuildItemModify; - } - - if (this.includeAttribute != null) - { - ProjectXmlUtilities.VerifyThrowProjectInvalidAttribute((childTypeExpected & ChildType.BuildItemAdd) == ChildType.BuildItemAdd, includeAttribute); - ProjectErrorUtilities.VerifyThrowInvalidProject(Include.Length > 0, element, "MissingRequiredAttribute", XMakeAttributes.include, element.Name); - ProjectXmlUtilities.VerifyThrowProjectInvalidAttribute(removeAttribute == null, removeAttribute); - this.childType = ChildType.BuildItemAdd; - } - - if (this.excludeAttribute != null) - { - ProjectXmlUtilities.VerifyThrowProjectInvalidAttribute((childTypeExpected & ChildType.BuildItemAdd) == ChildType.BuildItemAdd, excludeAttribute); - ProjectErrorUtilities.VerifyThrowInvalidProject(Include.Length > 0, element, "MissingRequiredAttribute", XMakeAttributes.include, element.Name); - ProjectXmlUtilities.VerifyThrowProjectInvalidAttribute(removeAttribute == null, removeAttribute); - this.childType = ChildType.BuildItemAdd; - } - - if (this.removeAttribute != null) - { - ProjectXmlUtilities.VerifyThrowProjectInvalidAttribute((childTypeExpected & ChildType.BuildItemRemove) == ChildType.BuildItemRemove, removeAttribute); - ProjectErrorUtilities.VerifyThrowInvalidProject(Remove.Length > 0, element, "MissingRequiredAttribute", XMakeAttributes.remove, element.Name); - ProjectXmlUtilities.VerifyThrowProjectInvalidAttribute(includeAttribute == null, includeAttribute); - ProjectXmlUtilities.VerifyThrowProjectInvalidAttribute(excludeAttribute == null, excludeAttribute); - this.childType = ChildType.BuildItemRemove; - } - - if (this.childType == ChildType.Invalid) - { - // So the xml wasn't consistent with any of the child types that we were told to expect. - // Figure out the most reasonable message to produce. - if ((childTypeExpected & ChildType.BuildItemAdd) == ChildType.BuildItemAdd) - { - ProjectErrorUtilities.VerifyThrowInvalidProject(Include.Length > 0, element, "MissingRequiredAttribute", XMakeAttributes.include, element.Name); - } - else if ((childTypeExpected & ChildType.BuildItemRemove) == ChildType.BuildItemRemove) - { - ProjectErrorUtilities.VerifyThrowInvalidProject(Remove.Length > 0, element, "MissingRequiredAttribute", XMakeAttributes.remove, element.Name); - } - else - { - ErrorUtilities.ThrowInternalError("Unexpected child type"); - } - } - - // Validate each of the child nodes beneath the item. - List children = ProjectXmlUtilities.GetValidChildElements(element); - - if (this.childType == ChildType.BuildItemRemove && children.Count != 0) - { - ProjectErrorUtilities.ThrowInvalidProject(element, "ChildElementsBelowRemoveNotAllowed", children[0].Name); - } - - foreach (XmlElement child in children) - { - ProjectXmlUtilities.VerifyThrowProjectValidNameAndNamespace(child); - - ProjectErrorUtilities.VerifyThrowInvalidProject(!FileUtilities.IsItemSpecModifier(child.Name), child, "ItemSpecModifierCannotBeCustomMetadata", child.Name); - ProjectErrorUtilities.VerifyThrowInvalidProject(XMakeElements.IllegalItemPropertyNames[child.Name] == null, child, "CannotModifyReservedItemMetadata", child.Name); - } - } - - #endregion - - - #region Properties - - internal string Name - { - get - { - return element.Name; - } - - set - { - element = XmlUtilities.RenameXmlElement(element, value, XMakeAttributes.defaultXmlNamespace); - - // Because this actually created a new element, we have to find the attributes again - includeAttribute = element.Attributes[XMakeAttributes.include]; - excludeAttribute = element.Attributes[XMakeAttributes.exclude]; - conditionAttribute = element.Attributes[XMakeAttributes.condition]; - removeAttribute = element.Attributes[XMakeAttributes.remove]; - } - } - - internal string Include - { - get - { - return ProjectXmlUtilities.GetAttributeValue(includeAttribute); - } - - set - { - element.SetAttribute(XMakeAttributes.include, value); - includeAttribute = element.Attributes[XMakeAttributes.include]; - } - } - - internal string Exclude - { - get - { - return ProjectXmlUtilities.GetAttributeValue(excludeAttribute); - } - - set - { - excludeAttribute = ProjectXmlUtilities.SetOrRemoveAttribute(element, XMakeAttributes.exclude, value); - } - } - - internal string Remove - { - get - { - return ProjectXmlUtilities.GetAttributeValue(removeAttribute); - } - } - - internal string Condition - { - get - { - return ProjectXmlUtilities.GetAttributeValue(conditionAttribute); - } - - set - { - conditionAttribute = ProjectXmlUtilities.SetOrRemoveAttribute(element, XMakeAttributes.condition, value); - } - } - - internal XmlElement Element - { - get { return element; } - } - - internal XmlAttribute IncludeAttribute - { - get { return includeAttribute; } - } - - internal XmlAttribute ExcludeAttribute - { - get { return excludeAttribute; } - } - - internal XmlAttribute RemoveAttribute - { - get { return removeAttribute; } - } - - internal XmlAttribute ConditionAttribute - { - get { return conditionAttribute; } - } - - internal ChildType ChildType - { - get { return childType; } - } - - #endregion - - #region Methods - - /// - /// Gets all child elements, ignoring whitespace and comments, and any conditions - /// - internal List GetChildren() - { - List children = ProjectXmlUtilities.GetValidChildElements(element); - return children; - } - - /// - /// Removes all child elements with the specified name. - /// - internal void RemoveChildrenByName(string name) - { - List children = GetChildren(); - foreach (XmlElement child in children) - { - if (String.Equals(name, child.Name, StringComparison.OrdinalIgnoreCase)) - { - element.RemoveChild(child); - } - } - } - - /// - /// Ensures there's a child element with the specified name and value. - /// Disregards any Condition attributes on the children. - /// If several children are already present with the specified name, removes all except the last one. - /// If a child is present with the specified name, does not modify it if the value is already as specified. - /// Returns true if the XML was meaningfully modified. - /// - internal bool SetChildValue(string name, string value) - { - bool dirty = false; - XmlElement childToModify = null; - List children = GetChildren(); - - foreach (XmlElement child in children) - { - if (String.Equals(name, child.Name, StringComparison.OrdinalIgnoreCase)) - { - if (childToModify != null) - { - // We already found a matching child, remove that, we'll - // use this later one; the later one was winning anyway, - // so we don't consider this dirtying the item - element.RemoveChild(childToModify); - } - - childToModify = child; - } - } - - if (childToModify == null) - { - // create a new child as specified - childToModify = element.OwnerDocument.CreateElement(name, XMakeAttributes.defaultXmlNamespace); - element.AppendChild(childToModify); - dirty = true; - } - - // if we just added this child, or the old value and new value are different... - if (dirty || !String.Equals(Utilities.GetXmlNodeInnerContents(childToModify), value, StringComparison.Ordinal)) - { - // give the child the new value - Utilities.SetXmlNodeInnerContents(childToModify, value); - dirty = true; - } - - return dirty; - } - - #endregion - } - - /// - /// Type of the item group child element - /// - internal enum ChildType - { - Invalid = 0, - - /// - /// Regular item, with Include and possibly Exclude attributes - /// - BuildItemAdd = 1, - - /// - /// Remove item, with Remove attribute - /// - BuildItemRemove = 2, - - /// - /// Modify item, with no attributes (except possibly Condition) - /// - BuildItemModify = 4, - - /// - /// Add, remove, or modify item expression - /// - Any = BuildItemAdd | BuildItemRemove | BuildItemModify - } -} diff --git a/src/Deprecated/Engine/Xml/BuildItemGroupXml.cs b/src/Deprecated/Engine/Xml/BuildItemGroupXml.cs deleted file mode 100644 index e6218e8cdd4..00000000000 --- a/src/Deprecated/Engine/Xml/BuildItemGroupXml.cs +++ /dev/null @@ -1,123 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections.Generic; -using Microsoft.Build.BuildEngine.Shared; -using System.Xml; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// Encapsulates, as far as possible, any XML behind a BuildItemGroup - /// - internal class BuildItemGroupXml - { - #region Fields - - // The element - private XmlElement element; - // The Condition attribute on it, if any, to save lookup - private XmlAttribute conditionAttribute; - - #endregion - - #region Constructors - - /// - /// BuildItemGroup element is provided - /// - internal BuildItemGroupXml(XmlElement element) - { - ErrorUtilities.VerifyThrowNoAssert(element != null, "Need a valid XML node."); - ProjectXmlUtilities.VerifyThrowElementName(element, XMakeElements.itemGroup); - - this.element = element; - this.conditionAttribute = ProjectXmlUtilities.GetConditionAttribute(element, true /*no other attributes allowed*/); - } - - /// - /// BuildItemGroup element is created given a document - /// - internal BuildItemGroupXml(XmlDocument owner) - { - ErrorUtilities.VerifyThrowNoAssert(owner != null, "Need valid XmlDocument owner for this item group."); - this.element = owner.CreateElement(XMakeElements.itemGroup, XMakeAttributes.defaultXmlNamespace); - } - - #endregion - - #region Properties - - internal string Condition - { - get - { - return conditionAttribute != null ? conditionAttribute.Value : String.Empty; - } - - set - { - conditionAttribute = ProjectXmlUtilities.SetOrRemoveAttribute(element, XMakeAttributes.condition, value); - } - } - - internal XmlElement ParentElement - { - get - { - if (element?.ParentNode is XmlElement) - { - return (XmlElement)element.ParentNode; - } - return null; - } - } - - internal XmlElement Element - { - get { return element; } - } - - internal XmlAttribute ConditionAttribute - { - get { return conditionAttribute; } - } - - internal XmlDocument OwnerDocument - { - get { return element.OwnerDocument; } - } - - #endregion - - #region Methods - - internal List GetChildren() - { - List children = ProjectXmlUtilities.GetValidChildElements(element); - return children; - } - - internal void AppendChild(XmlElement child) - { - element.AppendChild(child); - } - - internal void InsertAfter(XmlElement parent, XmlElement child, XmlElement reference) - { - parent.InsertAfter(child, reference); - } - - internal void InsertBefore(XmlElement parent, XmlElement child, XmlElement reference) - { - parent.InsertBefore(child, reference); - } - - #endregion - } -} diff --git a/src/Deprecated/Engine/Xml/ProjectXmlUtilities.cs b/src/Deprecated/Engine/Xml/ProjectXmlUtilities.cs deleted file mode 100644 index 59cecdf0b05..00000000000 --- a/src/Deprecated/Engine/Xml/ProjectXmlUtilities.cs +++ /dev/null @@ -1,211 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// THE ASSEMBLY BUILT FROM THIS SOURCE FILE HAS BEEN DEPRECATED FOR YEARS. IT IS BUILT ONLY TO PROVIDE -// BACKWARD COMPATIBILITY FOR API USERS WHO HAVE NOT YET MOVED TO UPDATED APIS. PLEASE DO NOT SEND PULL -// REQUESTS THAT CHANGE THIS FILE WITHOUT FIRST CHECKING WITH THE MAINTAINERS THAT THE FIX IS REQUIRED. - -using System; -using System.Collections.Generic; -using System.Xml; -using Microsoft.Build.BuildEngine.Shared; - -namespace Microsoft.Build.BuildEngine -{ - /// - /// Project-related Xml utilities - /// - internal class ProjectXmlUtilities - { - /// - /// Gets child elements, ignoring whitespace and comments. - /// - /// Thrown for elements in the wrong namespace, or unexpected XML node types - internal static List GetValidChildElements(XmlElement element) - { - List children = new List(); - - foreach (XmlNode child in element) - { - switch (child.NodeType) - { - case XmlNodeType.Comment: - case XmlNodeType.Whitespace: - // These are legal, and ignored - break; - - case XmlNodeType.Element: - XmlElement childElement = (XmlElement)child; - VerifyThrowProjectValidNamespace(childElement); - children.Add(childElement); - break; - - default: - ThrowProjectInvalidChildElement(child); - break; - } - } - return children; - } - - /// - /// Throw an invalid project exception if the child is not an XmlElement - /// - /// - internal static void VerifyThrowProjectXmlElementChild(XmlNode childNode) - { - if (childNode.NodeType != XmlNodeType.Element) - { - ThrowProjectInvalidChildElement(childNode); - } - } - - /// - /// Throw an invalid project exception if there are any child elements at all - /// - internal static void VerifyThrowProjectNoChildElements(XmlElement element) - { - List childElements = GetValidChildElements(element); - if (childElements.Count > 0) - { - ThrowProjectInvalidChildElement(element.FirstChild); - } - } - - /// - /// Throw an invalid project exception indicating that the child is not valid beneath the element - /// - internal static void ThrowProjectInvalidChildElement(XmlNode child) - { - ProjectErrorUtilities.ThrowInvalidProject(child, "UnrecognizedChildElement", child.Name, child.ParentNode.Name); - } - - /// - /// Throws an InternalErrorException if the name of the element is not the expected name. - /// - internal static void VerifyThrowElementName(XmlElement element, string expected) - { - ErrorUtilities.VerifyThrowNoAssert(String.Equals(element.Name, expected, StringComparison.Ordinal), "Expected " + expected + " element, got " + element.Name); - } - - /// - /// Verifies an element has a valid name, and is in the MSBuild namespace, otherwise throws an InvalidProjectFileException. - /// - internal static void VerifyThrowProjectValidNameAndNamespace(XmlElement element) - { - XmlUtilities.VerifyThrowProjectValidElementName(element); - VerifyThrowProjectValidNamespace(element); - } - - /// - /// Verifies that an element is in the MSBuild namespace, otherwise throws an InvalidProjectFileException. - /// - internal static void VerifyThrowProjectValidNamespace(XmlElement element) - { - if (element.Prefix.Length > 0 || - !String.Equals(element.NamespaceURI, XMakeAttributes.defaultXmlNamespace, StringComparison.OrdinalIgnoreCase)) - { - ProjectErrorUtilities.ThrowInvalidProject(element, "CustomNamespaceNotAllowedOnThisChildElement", element.Name, element.ParentNode.Name); - } - } - - /// - /// If there are any attributes on the element, throws an InvalidProjectFileException complaining that the attribute is not valid on this element. - /// - internal static void VerifyThrowProjectNoAttributes(XmlElement element) - { - foreach (XmlAttribute attribute in element.Attributes) - { - ThrowProjectInvalidAttribute(attribute); - } - } - - /// - /// If the condition is false, throws an InvalidProjectFileException complaining that the attribute is not valid on this element. - /// - internal static void VerifyThrowProjectInvalidAttribute(bool condition, XmlAttribute attribute) - { - if (!condition) - { - ThrowProjectInvalidAttribute(attribute); - } - } - - /// - /// Throws an InvalidProjectFileException complaining that the attribute is not valid on this element. - /// - internal static void ThrowProjectInvalidAttribute(XmlAttribute attribute) - { - ProjectErrorUtilities.ThrowInvalidProject(attribute, "UnrecognizedAttribute", attribute.Name, attribute.OwnerElement.Name); - } - - /// - /// Get the Condition attribute, if any. Optionally, throw an invalid project exception if there are - /// any other attributes. - /// - internal static XmlAttribute GetConditionAttribute(XmlElement element, bool verifySoleAttribute) - { - XmlAttribute condition = null; - foreach (XmlAttribute attribute in element.Attributes) - { - switch (attribute.Name) - { - case XMakeAttributes.condition: - condition = attribute; - break; - - // Label is only recognized by the new OM. - // Ignore BUT ONLY if the caller of this function is a - // PropertyGroup, ItemDefinitionGroup, or ItemGroup: the "Label" - // attribute is only legal on those element types. - case XMakeAttributes.label: - if (!( - String.Equals(element.Name, XMakeElements.propertyGroup, StringComparison.Ordinal) || - String.Equals(element.Name, XMakeElements.itemDefinitionGroup, StringComparison.Ordinal) || - String.Equals(element.Name, XMakeElements.itemGroup, StringComparison.Ordinal) - )) - { - ProjectErrorUtilities.VerifyThrowInvalidProject(!verifySoleAttribute, attribute, "UnrecognizedAttribute", attribute.Name, element.Name); - } - // otherwise, do nothing. - break; - - default: - ProjectErrorUtilities.VerifyThrowInvalidProject(!verifySoleAttribute, attribute, "UnrecognizedAttribute", attribute.Name, element.Name); - break; - } - } - return condition; - } - - /// - /// Sets the value of an attribute, but if the value to set is null or empty, just - /// removes the element. Returns the attribute, or null if it was removed. - /// - internal static XmlAttribute SetOrRemoveAttribute(XmlElement element, string name, string value) - { - if (String.IsNullOrEmpty(value)) - { - // The caller passed in a null or an empty value. So remove the attribute. - element.RemoveAttribute(name); - return null; - } - else - { - // Set the new attribute value - element.SetAttribute(name, value); - XmlAttribute attribute = element.Attributes[name]; - return attribute; - } - } - - /// - /// Returns the value of the attribute. - /// If the attribute is null, returns an empty string. - /// - internal static string GetAttributeValue(XmlAttribute attribute) - { - return (attribute == null) ? String.Empty : attribute.Value; - } - } -} diff --git a/src/Deprecated/README.md b/src/Deprecated/README.md deleted file mode 100644 index 3e0ef06bd12..00000000000 --- a/src/Deprecated/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Deprecated assemblies - -The assemblies built under this folder have been deprecated for years. They are built only to provide backward compatibility for API users who have not yet moved to updated APIs. - -⚠ Please do not send pull requests that change any files in this folder without first checking with the maintainers that the fix is required. \ No newline at end of file diff --git a/src/Framework/Properties/AssemblyInfo.cs b/src/Framework/Properties/AssemblyInfo.cs index 633749084f0..80691b8860b 100644 --- a/src/Framework/Properties/AssemblyInfo.cs +++ b/src/Framework/Properties/AssemblyInfo.cs @@ -42,7 +42,6 @@ [assembly: InternalsVisibleTo("Microsoft.Build.Utilities.Core, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")] [assembly: InternalsVisibleTo("Microsoft.Build.Tasks.Core, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")] [assembly: InternalsVisibleTo("MSBuild, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")] -[assembly: InternalsVisibleTo("Microsoft.Build.Conversion.Core, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")] [assembly: InternalsVisibleTo("Microsoft.Build.Engine.UnitTests, PublicKey=002400000480000094000000060200000024000052534131000400000100010015c01ae1f50e8cc09ba9eac9147cf8fd9fce2cfe9f8dce4f7301c4132ca9fb50ce8cbf1df4dc18dd4d210e4345c744ecb3365ed327efdbc52603faa5e21daa11234c8c4a73e51f03bf192544581ebe107adee3a34928e39d04e524a9ce729d5090bfd7dad9d10c722c0def9ccc08ff0a03790e48bcd1f9b6c476063e1966a1c4")] [assembly: InternalsVisibleTo("Microsoft.Build.BuildCheck.UnitTests, PublicKey=002400000480000094000000060200000024000052534131000400000100010015c01ae1f50e8cc09ba9eac9147cf8fd9fce2cfe9f8dce4f7301c4132ca9fb50ce8cbf1df4dc18dd4d210e4345c744ecb3365ed327efdbc52603faa5e21daa11234c8c4a73e51f03bf192544581ebe107adee3a34928e39d04e524a9ce729d5090bfd7dad9d10c722c0def9ccc08ff0a03790e48bcd1f9b6c476063e1966a1c4")] diff --git a/src/MSBuild/app.amd64.config b/src/MSBuild/app.amd64.config index b374afffa4c..339dfe620bf 100644 --- a/src/MSBuild/app.amd64.config +++ b/src/MSBuild/app.amd64.config @@ -36,16 +36,6 @@ - - - - - - - - - - diff --git a/src/MSBuild/app.config b/src/MSBuild/app.config index 0931bf4a8ce..9bc9a4c595c 100644 --- a/src/MSBuild/app.config +++ b/src/MSBuild/app.config @@ -29,14 +29,6 @@ - - - - - - - - diff --git a/src/Package/DevDivPackage/DevDivPackage.csproj b/src/Package/DevDivPackage/DevDivPackage.csproj index e4396d9d736..5fd8407217e 100644 --- a/src/Package/DevDivPackage/DevDivPackage.csproj +++ b/src/Package/DevDivPackage/DevDivPackage.csproj @@ -14,7 +14,6 @@ - diff --git a/src/Package/DevDivPackage/VS.ExternalAPIs.MSBuild.nuspec b/src/Package/DevDivPackage/VS.ExternalAPIs.MSBuild.nuspec index 2ca9b231420..6c24f9d1820 100644 --- a/src/Package/DevDivPackage/VS.ExternalAPIs.MSBuild.nuspec +++ b/src/Package/DevDivPackage/VS.ExternalAPIs.MSBuild.nuspec @@ -19,10 +19,6 @@ - - - - diff --git a/src/Package/MSBuild.VSSetup/MSBuild.clientenabledpkg b/src/Package/MSBuild.VSSetup/MSBuild.clientenabledpkg index 6720b9b4800..042a8b40d91 100644 --- a/src/Package/MSBuild.VSSetup/MSBuild.clientenabledpkg +++ b/src/Package/MSBuild.VSSetup/MSBuild.clientenabledpkg @@ -3,4 +3,3 @@ Microsoft.Build.pkgdef Microsoft.Build.Tasks.Core.pkgdef System.Resources.Extensions.pkgdef Microsoft.Build.Utilities.Core.pkgdef -Microsoft.Build.Engine.pkgdef diff --git a/src/Package/MSBuild.VSSetup/files.swr b/src/Package/MSBuild.VSSetup/files.swr index 8f08096e0c9..fcd8630dbd6 100644 --- a/src/Package/MSBuild.VSSetup/files.swr +++ b/src/Package/MSBuild.VSSetup/files.swr @@ -332,4 +332,3 @@ folder InstallDir:\Common7\IDE\CommonExtensions\MSBuild file source=$(SourceDir)Tasks\Microsoft.Build.Tasks.Core.pkgdef file source=$(SourceDir)Tasks\System.Resources.Extensions.pkgdef file source=$(SourceDir)Utilities\Microsoft.Build.Utilities.Core.pkgdef - file source=$(SourceDir)Deprecated\Engine\Microsoft.Build.Engine.pkgdef diff --git a/src/Shared/UnitTests/App.config b/src/Shared/UnitTests/App.config index f5c247787c0..2273d1fcfac 100644 --- a/src/Shared/UnitTests/App.config +++ b/src/Shared/UnitTests/App.config @@ -19,10 +19,6 @@ - - - -